/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

'use strict';

const models = require('./index');

/**
 * Pipeline resource type.
 *
 * @extends models['SubResource']
 */
class PipelineResource extends models['SubResource'] {
  /**
   * Create a PipelineResource.
   * @member {string} [description] The description of the pipeline.
   * @member {array} [activities] List of activities in pipeline.
   * @member {object} [parameters] List of parameters for pipeline.
   * @member {object} [variables] List of variables for pipeline.
   * @member {number} [concurrency] The max number of concurrent runs for the
   * pipeline.
   * @member {array} [annotations] List of tags that can be used for describing
   * the Pipeline.
   * @member {object} [folder] The folder that this Pipeline is in. If not
   * specified, Pipeline will appear at the root level.
   * @member {string} [folder.name] The name of the folder that this Pipeline
   * is in.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of PipelineResource
   *
   * @returns {object} metadata of PipelineResource
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'PipelineResource',
      type: {
        name: 'Composite',
        additionalProperties: {
          type: {
            name: 'Dictionary',
            value: {
                required: false,
                serializedName: 'ObjectElementType',
                type: {
                  name: 'Object'
                }
            }
          }
        },
        className: 'PipelineResource',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          etag: {
            required: false,
            readOnly: true,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          },
          description: {
            required: false,
            serializedName: 'properties.description',
            type: {
              name: 'String'
            }
          },
          activities: {
            required: false,
            serializedName: 'properties.activities',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ActivityElementType',
                  type: {
                    name: 'Composite',
                    additionalProperties: {
                      type: {
                        name: 'Dictionary',
                        value: {
                            required: false,
                            serializedName: 'ObjectElementType',
                            type: {
                              name: 'Object'
                            }
                        }
                      }
                    },
                    polymorphicDiscriminator: {
                      serializedName: 'type',
                      clientName: 'type'
                    },
                    uberParent: 'Activity',
                    className: 'Activity'
                  }
              }
            }
          },
          parameters: {
            required: false,
            serializedName: 'properties.parameters',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'ParameterSpecificationElementType',
                  type: {
                    name: 'Composite',
                    className: 'ParameterSpecification'
                  }
              }
            }
          },
          variables: {
            required: false,
            serializedName: 'properties.variables',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'VariableSpecificationElementType',
                  type: {
                    name: 'Composite',
                    className: 'VariableSpecification'
                  }
              }
            }
          },
          concurrency: {
            required: false,
            serializedName: 'properties.concurrency',
            constraints: {
              InclusiveMinimum: 1
            },
            type: {
              name: 'Number'
            }
          },
          annotations: {
            required: false,
            serializedName: 'properties.annotations',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ObjectElementType',
                  type: {
                    name: 'Object'
                  }
              }
            }
          },
          folder: {
            required: false,
            serializedName: 'properties.folder',
            type: {
              name: 'Composite',
              className: 'PipelineFolder'
            }
          }
        }
      }
    };
  }
}

module.exports = PipelineResource;
