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

/**
 * The parameters for the scaling action.
 *
 */
class ScaleAction {
  /**
   * Create a ScaleAction.
   * @property {string} direction the scale direction. Whether the scaling
   * action increases or decreases the number of instances. Possible values
   * include: 'None', 'Increase', 'Decrease'
   * @property {string} type the type of action that should occur when the
   * scale rule fires. Possible values include: 'ChangeCount',
   * 'PercentChangeCount', 'ExactCount'
   * @property {string} [value] the number of instances that are involved in
   * the scaling action. This value must be 1 or greater. The default value is
   * 1. Default value: '1' .
   * @property {moment.duration} cooldown the amount of time to wait since the
   * last scaling action before this action occurs. It must be between 1 week
   * and 1 minute in ISO 8601 format.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ScaleAction
   *
   * @returns {object} metadata of ScaleAction
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ScaleAction',
      type: {
        name: 'Composite',
        className: 'ScaleAction',
        modelProperties: {
          direction: {
            required: true,
            serializedName: 'direction',
            type: {
              name: 'Enum',
              allowedValues: [ 'None', 'Increase', 'Decrease' ]
            }
          },
          type: {
            required: true,
            serializedName: 'type',
            type: {
              name: 'Enum',
              allowedValues: [ 'ChangeCount', 'PercentChangeCount', 'ExactCount' ]
            }
          },
          value: {
            required: false,
            serializedName: 'value',
            defaultValue: '1',
            type: {
              name: 'String'
            }
          },
          cooldown: {
            required: true,
            serializedName: 'cooldown',
            type: {
              name: 'TimeSpan'
            }
          }
        }
      }
    };
  }
}

module.exports = ScaleAction;
