/*
 * 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 User registered to a lab
 *
 * @extends models['Resource']
 */
class User extends models['Resource'] {
  /**
   * Create a User.
   * @property {string} [email] The user email address, as it was specified
   * during registration.
   * @property {string} [familyName] The user family name, as it was specified
   * during registration.
   * @property {string} [givenName] The user given name, as it was specified
   * during registration.
   * @property {string} [tenantId] The user tenant ID, as it was specified
   * during registration.
   * @property {moment.duration} [totalUsage] How long the user has used his
   * VMs in this lab
   * @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 User
   *
   * @returns {object} metadata of User
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'User',
      type: {
        name: 'Composite',
        className: 'User',
        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'
                  }
              }
            }
          },
          email: {
            required: false,
            readOnly: true,
            serializedName: 'properties.email',
            type: {
              name: 'String'
            }
          },
          familyName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.familyName',
            type: {
              name: 'String'
            }
          },
          givenName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.givenName',
            type: {
              name: 'String'
            }
          },
          tenantId: {
            required: false,
            readOnly: true,
            serializedName: 'properties.tenantId',
            type: {
              name: 'String'
            }
          },
          totalUsage: {
            required: false,
            readOnly: true,
            serializedName: 'properties.totalUsage',
            type: {
              name: 'TimeSpan'
            }
          },
          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 = User;
