/*
 * 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 capacity information for services of this application. This
 * description can be used for describing the following.
 * - Reserving the capacity for the services on the nodes
 * - Limiting the total number of nodes that services of this application can
 * run on
 * - Limiting the custom capacity metrics to limit the total consumption of
 * this metric by the services of this application
 *
 */
class ApplicationCapacityDescription {
  /**
   * Create a ApplicationCapacityDescription.
   * @property {number} [minimumNodes] The minimum number of nodes where
   * Service Fabric will reserve capacity for this application. Note that this
   * does not mean that the services of this application will be placed on all
   * of those nodes. If this property is set to zero, no capacity will be
   * reserved. The value of this property cannot be more than the value of the
   * MaximumNodes property.
   * @property {number} [maximumNodes] The maximum number of nodes where
   * Service Fabric will reserve capacity for this application. Note that this
   * does not mean that the services of this application will be placed on all
   * of those nodes. By default, the value of this property is zero and it
   * means that the services can be placed on any node. Default value: 0 .
   * @property {array} [applicationMetrics] List of application capacity metric
   * description.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ApplicationCapacityDescription
   *
   * @returns {object} metadata of ApplicationCapacityDescription
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApplicationCapacityDescription',
      type: {
        name: 'Composite',
        className: 'ApplicationCapacityDescription',
        modelProperties: {
          minimumNodes: {
            required: false,
            serializedName: 'MinimumNodes',
            constraints: {
              InclusiveMinimum: 0
            },
            type: {
              name: 'Number'
            }
          },
          maximumNodes: {
            required: false,
            serializedName: 'MaximumNodes',
            defaultValue: 0,
            constraints: {
              InclusiveMinimum: 0
            },
            type: {
              name: 'Number'
            }
          },
          applicationMetrics: {
            required: false,
            serializedName: 'ApplicationMetrics',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ApplicationMetricDescriptionElementType',
                  type: {
                    name: 'Composite',
                    className: 'ApplicationMetricDescription'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = ApplicationCapacityDescription;
