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

/**
 * Identity Provider details.
 *
 * @extends models['Resource']
 */
class IdentityProviderCreateContract extends models['Resource'] {
  /**
   * Create a IdentityProviderCreateContract.
   * @property {string} [identityProviderCreateContractType] Identity Provider
   * Type identifier. Possible values include: 'facebook', 'google',
   * 'microsoft', 'twitter', 'aad', 'aadB2C'
   * @property {string} [signinTenant] The TenantId to use instead of Common
   * when logging into Active Directory
   * @property {array} [allowedTenants] List of Allowed Tenants when
   * configuring Azure Active Directory login.
   * @property {string} [authority] OpenID Connect discovery endpoint hostname
   * for AAD or AAD B2C.
   * @property {string} [signupPolicyName] Signup Policy Name. Only applies to
   * AAD B2C Identity Provider.
   * @property {string} [signinPolicyName] Signin Policy Name. Only applies to
   * AAD B2C Identity Provider.
   * @property {string} [profileEditingPolicyName] Profile Editing Policy Name.
   * Only applies to AAD B2C Identity Provider.
   * @property {string} [passwordResetPolicyName] Password Reset Policy Name.
   * Only applies to AAD B2C Identity Provider.
   * @property {string} clientId Client Id of the Application in the external
   * Identity Provider. It is App ID for Facebook login, Client ID for Google
   * login, App ID for Microsoft.
   * @property {string} clientSecret Client secret of the Application in
   * external Identity Provider, used to authenticate login request. For
   * example, it is App Secret for Facebook login, API Key for Google login,
   * Public Key for Microsoft. This property will not be filled on 'GET'
   * operations! Use '/listSecrets' POST request to get the value.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of IdentityProviderCreateContract
   *
   * @returns {object} metadata of IdentityProviderCreateContract
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'IdentityProviderCreateContract',
      type: {
        name: 'Composite',
        className: 'IdentityProviderCreateContract',
        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'
            }
          },
          identityProviderCreateContractType: {
            required: false,
            serializedName: 'properties.type',
            type: {
              name: 'String'
            }
          },
          signinTenant: {
            required: false,
            serializedName: 'properties.signinTenant',
            type: {
              name: 'String'
            }
          },
          allowedTenants: {
            required: false,
            serializedName: 'properties.allowedTenants',
            constraints: {
              MaxItems: 32
            },
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          authority: {
            required: false,
            serializedName: 'properties.authority',
            type: {
              name: 'String'
            }
          },
          signupPolicyName: {
            required: false,
            serializedName: 'properties.signupPolicyName',
            constraints: {
              MinLength: 1
            },
            type: {
              name: 'String'
            }
          },
          signinPolicyName: {
            required: false,
            serializedName: 'properties.signinPolicyName',
            constraints: {
              MinLength: 1
            },
            type: {
              name: 'String'
            }
          },
          profileEditingPolicyName: {
            required: false,
            serializedName: 'properties.profileEditingPolicyName',
            constraints: {
              MinLength: 1
            },
            type: {
              name: 'String'
            }
          },
          passwordResetPolicyName: {
            required: false,
            serializedName: 'properties.passwordResetPolicyName',
            constraints: {
              MinLength: 1
            },
            type: {
              name: 'String'
            }
          },
          clientId: {
            required: true,
            serializedName: 'properties.clientId',
            constraints: {
              MinLength: 1
            },
            type: {
              name: 'String'
            }
          },
          clientSecret: {
            required: true,
            serializedName: 'properties.clientSecret',
            constraints: {
              MinLength: 1
            },
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = IdentityProviderCreateContract;
