/*
 * 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 service specific properties of a provisoning service, including keys,
 * linked iot hubs, current state, and system generated properties such as
 * hostname and idScope
 *
 */
class IotDpsPropertiesDescription {
  /**
   * Create a IotDpsPropertiesDescription.
   * @member {string} [state] Current state of the provisioning service.
   * Possible values include: 'Activating', 'Active', 'Deleting', 'Deleted',
   * 'ActivationFailed', 'DeletionFailed', 'Transitioning', 'Suspending',
   * 'Suspended', 'Resuming', 'FailingOver', 'FailoverFailed'
   * @member {string} [provisioningState] The ARM provisioning state of the
   * provisioning service.
   * @member {array} [iotHubs] List of IoT hubs assosciated with this
   * provisioning service.
   * @member {string} [allocationPolicy] Allocation policy to be used by this
   * provisioning service. Possible values include: 'Hashed', 'GeoLatency',
   * 'Static'
   * @member {string} [serviceOperationsHostName] Service endpoint for
   * provisioning service.
   * @member {string} [deviceProvisioningHostName] Device endpoint for this
   * provisioning service.
   * @member {string} [idScope] Unique identifier of this provisioning service.
   * @member {array} [authorizationPolicies] List of authorization keys for a
   * provisioning service.
   */
  constructor() {
  }

  /**
   * Defines the metadata of IotDpsPropertiesDescription
   *
   * @returns {object} metadata of IotDpsPropertiesDescription
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'IotDpsPropertiesDescription',
      type: {
        name: 'Composite',
        className: 'IotDpsPropertiesDescription',
        modelProperties: {
          state: {
            required: false,
            serializedName: 'state',
            type: {
              name: 'String'
            }
          },
          provisioningState: {
            required: false,
            serializedName: 'provisioningState',
            type: {
              name: 'String'
            }
          },
          iotHubs: {
            required: false,
            serializedName: 'iotHubs',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'IotHubDefinitionDescriptionElementType',
                  type: {
                    name: 'Composite',
                    className: 'IotHubDefinitionDescription'
                  }
              }
            }
          },
          allocationPolicy: {
            required: false,
            serializedName: 'allocationPolicy',
            type: {
              name: 'String'
            }
          },
          serviceOperationsHostName: {
            required: false,
            readOnly: true,
            serializedName: 'serviceOperationsHostName',
            type: {
              name: 'String'
            }
          },
          deviceProvisioningHostName: {
            required: false,
            readOnly: true,
            serializedName: 'deviceProvisioningHostName',
            type: {
              name: 'String'
            }
          },
          idScope: {
            required: false,
            readOnly: true,
            serializedName: 'idScope',
            type: {
              name: 'String'
            }
          },
          authorizationPolicies: {
            required: false,
            serializedName: 'authorizationPolicies',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'SharedAccessSignatureAuthorizationRuleAccessRightsDescriptionElementType',
                  type: {
                    name: 'Composite',
                    className: 'SharedAccessSignatureAuthorizationRuleAccessRightsDescription'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = IotDpsPropertiesDescription;
