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

/**
 * This represents the details about a User's environment and its state.
 *
 */
class EnvironmentDetails {
  /**
   * Create a EnvironmentDetails.
   * @property {string} [name] Name of the Environment
   * @property {string} [description] Description of the Environment
   * @property {string} [id] Resource Id of the environment
   * @property {string} [provisioningState] The provisioning state of the
   * environment. This also includes LabIsFull and NotYetProvisioned status.
   * @property {object} [virtualMachineDetails] Details of backing DTL virtual
   * machine with compute and network details.
   * @property {string} [virtualMachineDetails.provisioningState] Provisioning
   * state of the Dtl VM
   * @property {string} [virtualMachineDetails.rdpAuthority] Connection
   * information for Windows
   * @property {string} [virtualMachineDetails.sshAuthority] Connection
   * information for Linux
   * @property {string} [virtualMachineDetails.privateIpAddress] PrivateIp
   * address of the compute VM
   * @property {string} [virtualMachineDetails.userName] Compute VM login user
   * name
   * @property {string} [virtualMachineDetails.lastKnownPowerState] Last known
   * compute power state captured in DTL
   * @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
   * @property {string} [environmentState] Publishing state of the environment
   * setting Possible values are Creating, Created, Failed
   * @property {moment.duration} [totalUsage] How long the environment has been
   * used by a lab user
   * @property {date} [passwordLastReset] When the password was last reset on
   * the environment.
   */
  constructor() {
  }

  /**
   * Defines the metadata of EnvironmentDetails
   *
   * @returns {object} metadata of EnvironmentDetails
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'EnvironmentDetails',
      type: {
        name: 'Composite',
        className: 'EnvironmentDetails',
        modelProperties: {
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          description: {
            required: false,
            readOnly: true,
            serializedName: 'description',
            type: {
              name: 'String'
            }
          },
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'provisioningState',
            type: {
              name: 'String'
            }
          },
          virtualMachineDetails: {
            required: false,
            readOnly: true,
            serializedName: 'virtualMachineDetails',
            type: {
              name: 'Composite',
              className: 'VirtualMachineDetails'
            }
          },
          latestOperationResult: {
            required: false,
            readOnly: true,
            serializedName: 'latestOperationResult',
            type: {
              name: 'Composite',
              className: 'LatestOperationResult'
            }
          },
          environmentState: {
            required: false,
            readOnly: true,
            serializedName: 'environmentState',
            type: {
              name: 'String'
            }
          },
          totalUsage: {
            required: false,
            readOnly: true,
            serializedName: 'totalUsage',
            type: {
              name: 'TimeSpan'
            }
          },
          passwordLastReset: {
            required: false,
            readOnly: true,
            serializedName: 'passwordLastReset',
            type: {
              name: 'DateTime'
            }
          }
        }
      }
    };
  }
}

module.exports = EnvironmentDetails;
