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

/**
 * Represents a scaling mechanism for adding or removing named partitions of a
 * stateless service. Partition names are in the format '0','1''N-1'
 *
 * @extends models['ScalingMechanismDescription']
 */
class AddRemoveIncrementalNamedPartitionScalingMechanism extends models['ScalingMechanismDescription'] {
  /**
   * Create a AddRemoveIncrementalNamedPartitionScalingMechanism.
   * @property {number} minPartitionCount Minimum number of named partitions of
   * the service.
   * @property {number} maxPartitionCount Maximum number of named partitions of
   * the service.
   * @property {number} scaleIncrement The number of instances to add or remove
   * during a scaling operation.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of AddRemoveIncrementalNamedPartitionScalingMechanism
   *
   * @returns {object} metadata of AddRemoveIncrementalNamedPartitionScalingMechanism
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AddRemoveIncrementalNamedPartition',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'Kind',
          clientName: 'kind'
        },
        uberParent: 'ScalingMechanismDescription',
        className: 'AddRemoveIncrementalNamedPartitionScalingMechanism',
        modelProperties: {
          kind: {
            required: true,
            serializedName: 'Kind',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          minPartitionCount: {
            required: true,
            serializedName: 'MinPartitionCount',
            type: {
              name: 'Number'
            }
          },
          maxPartitionCount: {
            required: true,
            serializedName: 'MaxPartitionCount',
            type: {
              name: 'Number'
            }
          },
          scaleIncrement: {
            required: true,
            serializedName: 'ScaleIncrement',
            type: {
              name: 'Number'
            }
          }
        }
      }
    };
  }
}

module.exports = AddRemoveIncrementalNamedPartitionScalingMechanism;
