/*
 * 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 Properties used to create a user on an Azure Batch node.
  *
 */
class UserAccount {
  /**
   * Create a UserAccount.
   * @property {string} name The name of the user account.
   * @property {string} password The password for the user account.
   * @property {string} [elevationLevel] The elevation level of the user
   * account. nonAdmin - The auto user is a standard user without elevated
   * access. admin - The auto user is a user with elevated access and operates
   * with full Administrator permissions. The default value is nonAdmin.
   * Possible values include: 'NonAdmin', 'Admin'
   * @property {object} [linuxUserConfiguration] The Linux-specific user
   * configuration for the user account. This property is ignored if specified
   * on a Windows pool. If not specified, the user is created with the default
   * options.
   * @property {number} [linuxUserConfiguration.uid] The uid and gid properties
   * must be specified together or not at all. If not specified the underlying
   * operating system picks the uid.
   * @property {number} [linuxUserConfiguration.gid] The uid and gid properties
   * must be specified together or not at all. If not specified the underlying
   * operating system picks the gid.
   * @property {string} [linuxUserConfiguration.sshPrivateKey] The private key
   * must not be password protected. The private key is used to automatically
   * configure asymmetric-key based authentication for SSH between nodes in a
   * Linux pool when the pool's enableInterNodeCommunication property is true
   * (it is ignored if enableInterNodeCommunication is false). It does this by
   * placing the key pair into the user's .ssh directory. If not specified,
   * password-less SSH is not configured between nodes (no modification of the
   * user's .ssh directory is done).
   * @property {object} [windowsUserConfiguration] The Windows-specific user
   * configuration for the user account. This property can only be specified if
   * the user is on a Windows pool. If not specified and on a Windows pool, the
   * user is created with the default options.
   * @property {string} [windowsUserConfiguration.loginMode] Specifies login
   * mode for the user. The default value for VirtualMachineConfiguration pools
   * is interactive mode and for CloudServiceConfiguration pools is batch mode.
   * Possible values include: 'Batch', 'Interactive'
   */
  constructor() {
  }

  /**
   * Defines the metadata of UserAccount
   *
   * @returns {object} metadata of UserAccount
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'UserAccount',
      type: {
        name: 'Composite',
        className: 'UserAccount',
        modelProperties: {
          name: {
            required: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          password: {
            required: true,
            serializedName: 'password',
            type: {
              name: 'String'
            }
          },
          elevationLevel: {
            required: false,
            serializedName: 'elevationLevel',
            type: {
              name: 'Enum',
              allowedValues: [ 'NonAdmin', 'Admin' ]
            }
          },
          linuxUserConfiguration: {
            required: false,
            serializedName: 'linuxUserConfiguration',
            type: {
              name: 'Composite',
              className: 'LinuxUserConfiguration'
            }
          },
          windowsUserConfiguration: {
            required: false,
            serializedName: 'windowsUserConfiguration',
            type: {
              name: 'Composite',
              className: 'WindowsUserConfiguration'
            }
          }
        }
      }
    };
  }
}

module.exports = UserAccount;
