/*
 * 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 a Service Fabric application.
 *
 */
class ApplicationDescription {
  /**
   * Create a ApplicationDescription.
   * @property {string} name The name of the application, including the
   * 'fabric:' URI scheme.
   * @property {string} typeName The application type name as defined in the
   * application manifest.
   * @property {string} typeVersion The version of the application type as
   * defined in the application manifest.
   * @property {array} [parameterList] List of application parameters with
   * overridden values from their default values specified in the application
   * manifest.
   * @property {object} [applicationCapacity] 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
   * @property {number} [applicationCapacity.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} [applicationCapacity.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.
   * @property {array} [applicationCapacity.applicationMetrics] List of
   * application capacity metric description.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ApplicationDescription
   *
   * @returns {object} metadata of ApplicationDescription
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApplicationDescription',
      type: {
        name: 'Composite',
        className: 'ApplicationDescription',
        modelProperties: {
          name: {
            required: true,
            serializedName: 'Name',
            type: {
              name: 'String'
            }
          },
          typeName: {
            required: true,
            serializedName: 'TypeName',
            type: {
              name: 'String'
            }
          },
          typeVersion: {
            required: true,
            serializedName: 'TypeVersion',
            type: {
              name: 'String'
            }
          },
          parameterList: {
            required: false,
            serializedName: 'ParameterList',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ApplicationParameterElementType',
                  type: {
                    name: 'Composite',
                    className: 'ApplicationParameter'
                  }
              }
            }
          },
          applicationCapacity: {
            required: false,
            serializedName: 'ApplicationCapacity',
            type: {
              name: 'Composite',
              className: 'ApplicationCapacityDescription'
            }
          }
        }
      }
    };
  }
}

module.exports = ApplicationDescription;
