/*
 * 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');

/**
 * Base class for all triggers that support one to many model for trigger to
 * pipeline.
 *
 * @extends models['Trigger']
 */
class MultiplePipelineTrigger extends models['Trigger'] {
  /**
   * Create a MultiplePipelineTrigger.
   * @member {array} [pipelines] Pipelines that need to be started.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of MultiplePipelineTrigger
   *
   * @returns {object} metadata of MultiplePipelineTrigger
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'MultiplePipelineTrigger',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'type',
          clientName: 'type'
        },
        uberParent: 'Trigger',
        className: 'MultiplePipelineTrigger',
        modelProperties: {
          description: {
            required: false,
            serializedName: 'description',
            type: {
              name: 'String'
            }
          },
          runtimeState: {
            required: false,
            readOnly: true,
            serializedName: 'runtimeState',
            type: {
              name: 'String'
            }
          },
          type: {
            required: true,
            serializedName: 'type',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          pipelines: {
            required: false,
            serializedName: 'pipelines',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'TriggerPipelineReferenceElementType',
                  type: {
                    name: 'Composite',
                    className: 'TriggerPipelineReference'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = MultiplePipelineTrigger;
