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

/**
 * Active Directory user information.
 *
 * @extends models['DirectoryObject']
 */
class User extends models['DirectoryObject'] {
  /**
   * Create a User.
   * @member {string} [immutableId] This must be specified if you are using a
   * federated domain for the user's userPrincipalName (UPN) property when
   * creating a new user account. It is used to associate an on-premises Active
   * Directory user account with their Azure AD user object.
   * @member {string} [usageLocation] A two letter country code (ISO standard
   * 3166). Required for users that will be assigned licenses due to legal
   * requirement to check for availability of services in countries. Examples
   * include: "US", "JP", and "GB".
   * @member {string} [givenName] The given name for the user.
   * @member {string} [surname] The user's surname (family name or last name).
   * @member {string} [userType] A string value that can be used to classify
   * user types in your directory, such as 'Member' and 'Guest'. Possible
   * values include: 'Member', 'Guest'
   * @member {boolean} [accountEnabled] Whether the account is enabled.
   * @member {string} [displayName] The display name of the user.
   * @member {string} [userPrincipalName] The principal name of the user.
   * @member {string} [mailNickname] The mail alias for the user.
   * @member {string} [mail] The primary email address of the user.
   * @member {array} [signInNames] The sign-in names of the user.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of User
   *
   * @returns {object} metadata of User
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'User',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'objectType',
          clientName: 'objectType'
        },
        uberParent: 'DirectoryObject',
        className: 'User',
        modelProperties: {
          objectId: {
            required: false,
            readOnly: true,
            serializedName: 'objectId',
            type: {
              name: 'String'
            }
          },
          deletionTimestamp: {
            required: false,
            readOnly: true,
            serializedName: 'deletionTimestamp',
            type: {
              name: 'DateTime'
            }
          },
          objectType: {
            required: true,
            serializedName: 'objectType',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          immutableId: {
            required: false,
            serializedName: 'immutableId',
            type: {
              name: 'String'
            }
          },
          usageLocation: {
            required: false,
            serializedName: 'usageLocation',
            type: {
              name: 'String'
            }
          },
          givenName: {
            required: false,
            serializedName: 'givenName',
            type: {
              name: 'String'
            }
          },
          surname: {
            required: false,
            serializedName: 'surname',
            type: {
              name: 'String'
            }
          },
          userType: {
            required: false,
            serializedName: 'userType',
            type: {
              name: 'String'
            }
          },
          accountEnabled: {
            required: false,
            serializedName: 'accountEnabled',
            type: {
              name: 'Boolean'
            }
          },
          displayName: {
            required: false,
            serializedName: 'displayName',
            type: {
              name: 'String'
            }
          },
          userPrincipalName: {
            required: false,
            serializedName: 'userPrincipalName',
            type: {
              name: 'String'
            }
          },
          mailNickname: {
            required: false,
            serializedName: 'mailNickname',
            type: {
              name: 'String'
            }
          },
          mail: {
            required: false,
            serializedName: 'mail',
            type: {
              name: 'String'
            }
          },
          signInNames: {
            required: false,
            serializedName: 'signInNames',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'SignInNameElementType',
                  type: {
                    name: 'Composite',
                    additionalProperties: {
                      type: {
                        name: 'Dictionary',
                        value: {
                            required: false,
                            serializedName: 'ObjectElementType',
                            type: {
                              name: 'Object'
                            }
                        }
                      }
                    },
                    className: 'SignInName'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = User;
