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

/**
 * User create details.
 *
 */
class UserCreateParameters {
  /**
   * Create a UserCreateParameters.
   * @property {string} [state] Account state. Specifies whether the user is
   * active or not. Blocked users are unable to sign into the developer portal
   * or call any APIs of subscribed products. Default state is Active. Possible
   * values include: 'active', 'blocked', 'pending', 'deleted'. Default value:
   * 'active' .
   * @property {string} [note] Optional note about a user set by the
   * administrator.
   * @property {array} [identities] Collection of user identities.
   * @property {string} email Email address. Must not be empty and must be
   * unique within the service instance.
   * @property {string} firstName First name.
   * @property {string} lastName Last name.
   * @property {string} [password] User Password. If no value is provided, a
   * default password is generated.
   * @property {string} [appType] Determines the type of application which send
   * the create user request. Default is legacy portal. Possible values
   * include: 'portal', 'developerPortal'
   * @property {string} [confirmation] Determines the type of confirmation
   * e-mail that will be sent to the newly created user. Possible values
   * include: 'signup', 'invite'
   */
  constructor() {
  }

  /**
   * Defines the metadata of UserCreateParameters
   *
   * @returns {object} metadata of UserCreateParameters
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'UserCreateParameters',
      type: {
        name: 'Composite',
        className: 'UserCreateParameters',
        modelProperties: {
          state: {
            required: false,
            serializedName: 'properties.state',
            defaultValue: 'active',
            type: {
              name: 'String'
            }
          },
          note: {
            required: false,
            serializedName: 'properties.note',
            type: {
              name: 'String'
            }
          },
          identities: {
            required: false,
            serializedName: 'properties.identities',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'UserIdentityContractElementType',
                  type: {
                    name: 'Composite',
                    className: 'UserIdentityContract'
                  }
              }
            }
          },
          email: {
            required: true,
            serializedName: 'properties.email',
            constraints: {
              MaxLength: 254,
              MinLength: 1
            },
            type: {
              name: 'String'
            }
          },
          firstName: {
            required: true,
            serializedName: 'properties.firstName',
            constraints: {
              MaxLength: 100,
              MinLength: 1
            },
            type: {
              name: 'String'
            }
          },
          lastName: {
            required: true,
            serializedName: 'properties.lastName',
            constraints: {
              MaxLength: 100,
              MinLength: 1
            },
            type: {
              name: 'String'
            }
          },
          password: {
            required: false,
            serializedName: 'properties.password',
            type: {
              name: 'String'
            }
          },
          appType: {
            required: false,
            serializedName: 'properties.appType',
            type: {
              name: 'String'
            }
          },
          confirmation: {
            required: false,
            serializedName: 'properties.confirmation',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = UserCreateParameters;
