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

/**
 * Global configuration for services in the cluster.
 *
 */
class GlobalServiceConfiguration {
  /**
   * Create a GlobalServiceConfiguration.
   * @member {object} [additionalProperties] Unmatched properties from the
   * message are deserialized this collection
   * @member {string} [etag] The configuartion ETag for updates.
   * @member {object} [ssl] The SSL configuration properties
   * @member {string} [ssl.status] SSL status. Allowed values are Enabled and
   * Disabled. Possible values include: 'Enabled', 'Disabled'
   * @member {string} [ssl.cert] The SSL cert data in PEM format encoded as
   * base64 string
   * @member {string} [ssl.key] The SSL key data in PEM format encoded as
   * base64 string. This is not returned in response of GET/PUT on the
   * resource. To see this please call listKeys API.
   * @member {string} [ssl.cname] The CName of the certificate.
   * @member {object} [serviceAuth] Optional global authorization keys for all
   * user services deployed in cluster. These are used if the service does not
   * have auth keys.
   * @member {string} [serviceAuth.primaryAuthKeyHash] The primary auth key
   * hash. This is not returned in response of GET/PUT on the resource.. To see
   * this please call listKeys API.
   * @member {string} [serviceAuth.secondaryAuthKeyHash] The secondary auth key
   * hash. This is not returned in response of GET/PUT on the resource.. To see
   * this please call listKeys API.
   * @member {object} [autoScale] The auto-scale configuration
   * @member {string} [autoScale.status] If auto-scale is enabled for all
   * services. Each service can turn it off individually. Possible values
   * include: 'Enabled', 'Disabled'
   * @member {number} [autoScale.minReplicas] The minimum number of replicas
   * for each service.
   * @member {number} [autoScale.maxReplicas] The maximum number of replicas
   * for each service.
   * @member {number} [autoScale.targetUtilization] The target utilization.
   * @member {number} [autoScale.refreshPeriodInSeconds] Refresh period in
   * seconds.
   */
  constructor() {
  }

  /**
   * Defines the metadata of GlobalServiceConfiguration
   *
   * @returns {object} metadata of GlobalServiceConfiguration
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'GlobalServiceConfiguration',
      type: {
        name: 'Composite',
        className: 'GlobalServiceConfiguration',
        modelProperties: {
          additionalProperties: {
            required: false,
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'ObjectElementType',
                  type: {
                    name: 'Object'
                  }
              }
            }
          },
          etag: {
            required: false,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          },
          ssl: {
            required: false,
            serializedName: 'ssl',
            type: {
              name: 'Composite',
              className: 'SslConfiguration'
            }
          },
          serviceAuth: {
            required: false,
            serializedName: 'serviceAuth',
            type: {
              name: 'Composite',
              className: 'ServiceAuthConfiguration'
            }
          },
          autoScale: {
            required: false,
            serializedName: 'autoScale',
            type: {
              name: 'Composite',
              className: 'AutoScaleConfiguration'
            }
          }
        }
      }
    };
  }
}

module.exports = GlobalServiceConfiguration;
