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

/**
 * The description of the provisioning service.
 *
 * @extends models['Resource']
 */
class ProvisioningServiceDescription extends models['Resource'] {
  /**
   * Create a ProvisioningServiceDescription.
   * @member {string} [etag] The Etag field is *not* required. If it is
   * provided in the response body, it must also be provided as a header per
   * the normal ETag convention.
   * @member {object} properties Service specific properties for a provisioning
   * service
   * @member {string} [properties.state] Current state of the provisioning
   * service. Possible values include: 'Activating', 'Active', 'Deleting',
   * 'Deleted', 'ActivationFailed', 'DeletionFailed', 'Transitioning',
   * 'Suspending', 'Suspended', 'Resuming', 'FailingOver', 'FailoverFailed'
   * @member {string} [properties.provisioningState] The ARM provisioning state
   * of the provisioning service.
   * @member {array} [properties.iotHubs] List of IoT hubs assosciated with
   * this provisioning service.
   * @member {string} [properties.allocationPolicy] Allocation policy to be
   * used by this provisioning service. Possible values include: 'Hashed',
   * 'GeoLatency', 'Static'
   * @member {string} [properties.serviceOperationsHostName] Service endpoint
   * for provisioning service.
   * @member {string} [properties.deviceProvisioningHostName] Device endpoint
   * for this provisioning service.
   * @member {string} [properties.idScope] Unique identifier of this
   * provisioning service.
   * @member {array} [properties.authorizationPolicies] List of authorization
   * keys for a provisioning service.
   * @member {object} sku Sku info for a provisioning Service.
   * @member {string} [sku.name] Sku name. Possible values include: 'S1'
   * @member {string} [sku.tier] Pricing tier name of the provisioning service.
   * @member {number} [sku.capacity] The number of units to provision
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ProvisioningServiceDescription
   *
   * @returns {object} metadata of ProvisioningServiceDescription
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ProvisioningServiceDescription',
      type: {
        name: 'Composite',
        className: 'ProvisioningServiceDescription',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            constraints: {
              Pattern: '^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'
            },
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          location: {
            required: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          etag: {
            required: false,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          },
          properties: {
            required: true,
            serializedName: 'properties',
            type: {
              name: 'Composite',
              className: 'IotDpsPropertiesDescription'
            }
          },
          sku: {
            required: true,
            serializedName: 'sku',
            type: {
              name: 'Composite',
              className: 'IotDpsSkuInfo'
            }
          }
        }
      }
    };
  }
}

module.exports = ProvisioningServiceDescription;
