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

/**
 * Describes the auto scaling policy
 *
 */
class AutoScalingPolicy {
  /**
   * Create a AutoScalingPolicy.
   * @member {string} name The name of the auto scaling policy.
   * @member {object} trigger Determines when auto scaling operation will be
   * invoked.
   * @member {string} [trigger.kind] Polymorphic Discriminator
   * @member {object} mechanism The mechanism that is used to scale when auto
   * scaling operation is invoked.
   * @member {string} [mechanism.kind] Polymorphic Discriminator
   */
  constructor() {
  }

  /**
   * Defines the metadata of AutoScalingPolicy
   *
   * @returns {object} metadata of AutoScalingPolicy
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AutoScalingPolicy',
      type: {
        name: 'Composite',
        className: 'AutoScalingPolicy',
        modelProperties: {
          name: {
            required: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          trigger: {
            required: true,
            serializedName: 'trigger',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'kind',
                clientName: 'kind'
              },
              uberParent: 'AutoScalingTrigger',
              className: 'AutoScalingTrigger'
            }
          },
          mechanism: {
            required: true,
            serializedName: 'mechanism',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'kind',
                clientName: 'kind'
              },
              uberParent: 'AutoScalingMechanism',
              className: 'AutoScalingMechanism'
            }
          }
        }
      }
    };
  }
}

module.exports = AutoScalingPolicy;
