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

/**
 * @summary The definition of the user identity under which the task is run.
  *
 * Specify either the userName or autoUser property, but not both.
 *
 */
class UserIdentity {
  /**
   * Create a UserIdentity.
   * @property {string} [userName] The name of the user identity under which
   * the task is run. The userName and autoUser properties are mutually
   * exclusive; you must specify one but not both.
   * @property {object} [autoUser] The auto user under which the task is run.
   * The userName and autoUser properties are mutually exclusive; you must
   * specify one but not both.
   * @property {string} [autoUser.scope] The default value is Pool. If the pool
   * is running Windows a value of Task should be specified if stricter
   * isolation between tasks is required. For example, if the task mutates the
   * registry in a way which could impact other tasks, or if certificates have
   * been specified on the pool which should not be accessible by normal tasks
   * but should be accessible by start tasks. Possible values include: 'Task',
   * 'Pool'
   * @property {string} [autoUser.elevationLevel] The default value is
   * nonAdmin. Possible values include: 'NonAdmin', 'Admin'
   */
  constructor() {
  }

  /**
   * Defines the metadata of UserIdentity
   *
   * @returns {object} metadata of UserIdentity
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'UserIdentity',
      type: {
        name: 'Composite',
        className: 'UserIdentity',
        modelProperties: {
          userName: {
            required: false,
            serializedName: 'userName',
            type: {
              name: 'String'
            }
          },
          autoUser: {
            required: false,
            serializedName: 'autoUser',
            type: {
              name: 'Composite',
              className: 'AutoUserSpecification'
            }
          }
        }
      }
    };
  }
}

module.exports = UserIdentity;
