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

/**
 * Represents settings of an environment, from which environment instances
 * would be created
 *
 * @extends models['Resource']
 */
class EnvironmentSetting extends models['Resource'] {
  /**
   * Create a EnvironmentSetting.
   * @property {string} [publishingState] Describes the readiness of this
   * environment setting. Possible values include: 'Draft', 'Publishing',
   * 'Published', 'PublishFailed', 'Scaling'
   * @property {string} [configurationState] Describes the user's progress in
   * configuring their environment setting. Possible values include:
   * 'NotApplicable', 'Completed'
   * @property {string} [description] Describes the environment and its
   * resource settings
   * @property {string} [title] Brief title describing the environment and its
   * resource settings
   * @property {object} resourceSettings The resource specific settings
   * @property {string} [resourceSettings.id] The unique id of the resource
   * setting
   * @property {string} [resourceSettings.galleryImageResourceId] The resource
   * id of the gallery image used for creating the virtual machine
   * @property {string} [resourceSettings.imageName] The name of the image used
   * to created the environment setting
   * @property {string} [resourceSettings.size] The size of the virtual
   * machine. Possible values include: 'Basic', 'Standard', 'Performance'
   * @property {number} [resourceSettings.cores] The translated compute cores
   * of the virtual machine
   * @property {object} [resourceSettings.referenceVm] Details specific to
   * Reference Vm
   * @property {string} [resourceSettings.referenceVm.userName] The username of
   * the virtual machine
   * @property {string} [resourceSettings.referenceVm.password] The password of
   * the virtual machine. This will be set to null in GET resource API
   * @property {object} [resourceSettings.referenceVm.vmStateDetails] The state
   * details for the reference virtual machine.
   * @property {string}
   * [resourceSettings.referenceVm.vmStateDetails.rdpAuthority] The
   * RdpAuthority property is a server DNS host name or IP address followed by
   * the service port number for RDP (Remote Desktop Protocol).
   * @property {string}
   * [resourceSettings.referenceVm.vmStateDetails.sshAuthority] The
   * SshAuthority property is a server DNS host name or IP address followed by
   * the service port number for SSH.
   * @property {string}
   * [resourceSettings.referenceVm.vmStateDetails.powerState] The power state
   * of the reference virtual machine.
   * @property {string}
   * [resourceSettings.referenceVm.vmStateDetails.lastKnownPowerState] Last
   * known compute power state captured in DTL
   * @property {string} [resourceSettings.referenceVm.vmResourceId] VM resource
   * Id for the environment
   * @property {date} [lastChanged] Time when the template VM was last changed.
   * @property {date} [lastPublished] Time when the template VM was last sent
   * for publishing.
   * @property {string} [provisioningState] The provisioning status of the
   * resource.
   * @property {string} [uniqueIdentifier] The unique immutable identifier of a
   * resource (Guid).
   * @property {object} [latestOperationResult] The details of the latest
   * operation. ex: status, error
   * @property {string} [latestOperationResult.status] The current status of
   * the operation.
   * @property {string} [latestOperationResult.errorCode] Error code on
   * failure.
   * @property {string} [latestOperationResult.errorMessage] The error message.
   * @property {string} [latestOperationResult.requestUri] Request URI of the
   * operation.
   * @property {string} [latestOperationResult.httpMethod] The HttpMethod -
   * PUT/POST/DELETE for the operation.
   * @property {string} [latestOperationResult.operationUrl] The URL to use to
   * check long-running operation status
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of EnvironmentSetting
   *
   * @returns {object} metadata of EnvironmentSetting
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'EnvironmentSetting',
      type: {
        name: 'Composite',
        className: 'EnvironmentSetting',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          location: {
            required: false,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          publishingState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.publishingState',
            type: {
              name: 'String'
            }
          },
          configurationState: {
            required: false,
            serializedName: 'properties.configurationState',
            type: {
              name: 'String'
            }
          },
          description: {
            required: false,
            serializedName: 'properties.description',
            type: {
              name: 'String'
            }
          },
          title: {
            required: false,
            serializedName: 'properties.title',
            type: {
              name: 'String'
            }
          },
          resourceSettings: {
            required: true,
            serializedName: 'properties.resourceSettings',
            type: {
              name: 'Composite',
              className: 'ResourceSettings'
            }
          },
          lastChanged: {
            required: false,
            readOnly: true,
            serializedName: 'properties.lastChanged',
            type: {
              name: 'DateTime'
            }
          },
          lastPublished: {
            required: false,
            readOnly: true,
            serializedName: 'properties.lastPublished',
            type: {
              name: 'DateTime'
            }
          },
          provisioningState: {
            required: false,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          uniqueIdentifier: {
            required: false,
            serializedName: 'properties.uniqueIdentifier',
            type: {
              name: 'String'
            }
          },
          latestOperationResult: {
            required: false,
            readOnly: true,
            serializedName: 'properties.latestOperationResult',
            type: {
              name: 'Composite',
              className: 'LatestOperationResult'
            }
          }
        }
      }
    };
  }
}

module.exports = EnvironmentSetting;
