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

/**
 * Configuration settings for the Azure App Service Authentication /
 * Authorization feature.
 *
 * @extends models['ProxyOnlyResource']
 */
class SiteAuthSettings extends models['ProxyOnlyResource'] {
  /**
   * Create a SiteAuthSettings.
   * @member {boolean} [enabled] <code>true</code> if the Authentication /
   * Authorization feature is enabled for the current app; otherwise,
   * <code>false</code>.
   * @member {string} [runtimeVersion] The RuntimeVersion of the Authentication
   * / Authorization feature in use for the current app.
   * The setting in this value can control the behavior of certain features in
   * the Authentication / Authorization module.
   * @member {string} [unauthenticatedClientAction] The action to take when an
   * unauthenticated client attempts to access the app. Possible values
   * include: 'RedirectToLoginPage', 'AllowAnonymous'
   * @member {boolean} [tokenStoreEnabled] <code>true</code> to durably store
   * platform-specific security tokens that are obtained during login flows;
   * otherwise, <code>false</code>.
   * The default is <code>false</code>.
   * @member {array} [allowedExternalRedirectUrls] External URLs that can be
   * redirected to as part of logging in or logging out of the app. Note that
   * the query string part of the URL is ignored.
   * This is an advanced setting typically only needed by Windows Store
   * application backends.
   * Note that URLs within the current domain are always implicitly allowed.
   * @member {string} [defaultProvider] The default authentication provider to
   * use when multiple providers are configured.
   * This setting is only needed if multiple providers are configured and the
   * unauthenticated client
   * action is set to "RedirectToLoginPage". Possible values include:
   * 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount',
   * 'Twitter'
   * @member {number} [tokenRefreshExtensionHours] The number of hours after
   * session token expiration that a session token can be used to
   * call the token refresh API. The default is 72 hours.
   * @member {string} [clientId] The Client ID of this relying party
   * application, known as the client_id.
   * This setting is required for enabling OpenID Connection authentication
   * with Azure Active Directory or
   * other 3rd party OpenID Connect providers.
   * More information on OpenID Connect:
   * http://openid.net/specs/openid-connect-core-1_0.html
   * @member {string} [clientSecret] The Client Secret of this relying party
   * application (in Azure Active Directory, this is also referred to as the
   * Key).
   * This setting is optional. If no client secret is configured, the OpenID
   * Connect implicit auth flow is used to authenticate end users.
   * Otherwise, the OpenID Connect Authorization Code Flow is used to
   * authenticate end users.
   * More information on OpenID Connect:
   * http://openid.net/specs/openid-connect-core-1_0.html
   * @member {string} [issuer] The OpenID Connect Issuer URI that represents
   * the entity which issues access tokens for this application.
   * When using Azure Active Directory, this value is the URI of the directory
   * tenant, e.g. https://sts.windows.net/{tenant-guid}/.
   * This URI is a case-sensitive identifier for the token issuer.
   * More information on OpenID Connect Discovery:
   * http://openid.net/specs/openid-connect-discovery-1_0.html
   * @member {boolean} [validateIssuer] Gets a value indicating whether the
   * issuer should be a valid HTTPS url and be validated as such.
   * @member {array} [allowedAudiences] Allowed audience values to consider
   * when validating JWTs issued by
   * Azure Active Directory. Note that the <code>ClientID</code> value is
   * always considered an
   * allowed audience, regardless of this setting.
   * @member {array} [additionalLoginParams] Login parameters to send to the
   * OpenID Connect authorization endpoint when
   * a user logs in. Each parameter must be in the form "key=value".
   * @member {string} [googleClientId] The OpenID Connect Client ID for the
   * Google web application.
   * This setting is required for enabling Google Sign-In.
   * Google Sign-In documentation:
   * https://developers.google.com/identity/sign-in/web/
   * @member {string} [googleClientSecret] The client secret associated with
   * the Google web application.
   * This setting is required for enabling Google Sign-In.
   * Google Sign-In documentation:
   * https://developers.google.com/identity/sign-in/web/
   * @member {array} [googleOAuthScopes] The OAuth 2.0 scopes that will be
   * requested as part of Google Sign-In authentication.
   * This setting is optional. If not specified, "openid", "profile", and
   * "email" are used as default scopes.
   * Google Sign-In documentation:
   * https://developers.google.com/identity/sign-in/web/
   * @member {string} [facebookAppId] The App ID of the Facebook app used for
   * login.
   * This setting is required for enabling Facebook Login.
   * Facebook Login documentation:
   * https://developers.facebook.com/docs/facebook-login
   * @member {string} [facebookAppSecret] The App Secret of the Facebook app
   * used for Facebook Login.
   * This setting is required for enabling Facebook Login.
   * Facebook Login documentation:
   * https://developers.facebook.com/docs/facebook-login
   * @member {array} [facebookOAuthScopes] The OAuth 2.0 scopes that will be
   * requested as part of Facebook Login authentication.
   * This setting is optional.
   * Facebook Login documentation:
   * https://developers.facebook.com/docs/facebook-login
   * @member {string} [twitterConsumerKey] The OAuth 1.0a consumer key of the
   * Twitter application used for sign-in.
   * This setting is required for enabling Twitter Sign-In.
   * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in
   * @member {string} [twitterConsumerSecret] The OAuth 1.0a consumer secret of
   * the Twitter application used for sign-in.
   * This setting is required for enabling Twitter Sign-In.
   * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in
   * @member {string} [microsoftAccountClientId] The OAuth 2.0 client ID that
   * was created for the app used for authentication.
   * This setting is required for enabling Microsoft Account authentication.
   * Microsoft Account OAuth documentation:
   * https://dev.onedrive.com/auth/msa_oauth.htm
   * @member {string} [microsoftAccountClientSecret] The OAuth 2.0 client
   * secret that was created for the app used for authentication.
   * This setting is required for enabling Microsoft Account authentication.
   * Microsoft Account OAuth documentation:
   * https://dev.onedrive.com/auth/msa_oauth.htm
   * @member {array} [microsoftAccountOAuthScopes] The OAuth 2.0 scopes that
   * will be requested as part of Microsoft Account authentication.
   * This setting is optional. If not specified, "wl.basic" is used as the
   * default scope.
   * Microsoft Account Scopes and permissions documentation:
   * https://msdn.microsoft.com/en-us/library/dn631845.aspx
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of SiteAuthSettings
   *
   * @returns {object} metadata of SiteAuthSettings
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'SiteAuthSettings',
      type: {
        name: 'Composite',
        className: 'SiteAuthSettings',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          kind: {
            required: false,
            serializedName: 'kind',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          enabled: {
            required: false,
            serializedName: 'properties.enabled',
            type: {
              name: 'Boolean'
            }
          },
          runtimeVersion: {
            required: false,
            serializedName: 'properties.runtimeVersion',
            type: {
              name: 'String'
            }
          },
          unauthenticatedClientAction: {
            required: false,
            serializedName: 'properties.unauthenticatedClientAction',
            type: {
              name: 'Enum',
              allowedValues: [ 'RedirectToLoginPage', 'AllowAnonymous' ]
            }
          },
          tokenStoreEnabled: {
            required: false,
            serializedName: 'properties.tokenStoreEnabled',
            type: {
              name: 'Boolean'
            }
          },
          allowedExternalRedirectUrls: {
            required: false,
            serializedName: 'properties.allowedExternalRedirectUrls',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          defaultProvider: {
            required: false,
            serializedName: 'properties.defaultProvider',
            type: {
              name: 'Enum',
              allowedValues: [ 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', 'Twitter' ]
            }
          },
          tokenRefreshExtensionHours: {
            required: false,
            serializedName: 'properties.tokenRefreshExtensionHours',
            type: {
              name: 'Number'
            }
          },
          clientId: {
            required: false,
            serializedName: 'properties.clientId',
            type: {
              name: 'String'
            }
          },
          clientSecret: {
            required: false,
            serializedName: 'properties.clientSecret',
            type: {
              name: 'String'
            }
          },
          issuer: {
            required: false,
            serializedName: 'properties.issuer',
            type: {
              name: 'String'
            }
          },
          validateIssuer: {
            required: false,
            serializedName: 'properties.validateIssuer',
            type: {
              name: 'Boolean'
            }
          },
          allowedAudiences: {
            required: false,
            serializedName: 'properties.allowedAudiences',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          additionalLoginParams: {
            required: false,
            serializedName: 'properties.additionalLoginParams',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          googleClientId: {
            required: false,
            serializedName: 'properties.googleClientId',
            type: {
              name: 'String'
            }
          },
          googleClientSecret: {
            required: false,
            serializedName: 'properties.googleClientSecret',
            type: {
              name: 'String'
            }
          },
          googleOAuthScopes: {
            required: false,
            serializedName: 'properties.googleOAuthScopes',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          facebookAppId: {
            required: false,
            serializedName: 'properties.facebookAppId',
            type: {
              name: 'String'
            }
          },
          facebookAppSecret: {
            required: false,
            serializedName: 'properties.facebookAppSecret',
            type: {
              name: 'String'
            }
          },
          facebookOAuthScopes: {
            required: false,
            serializedName: 'properties.facebookOAuthScopes',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          twitterConsumerKey: {
            required: false,
            serializedName: 'properties.twitterConsumerKey',
            type: {
              name: 'String'
            }
          },
          twitterConsumerSecret: {
            required: false,
            serializedName: 'properties.twitterConsumerSecret',
            type: {
              name: 'String'
            }
          },
          microsoftAccountClientId: {
            required: false,
            serializedName: 'properties.microsoftAccountClientId',
            type: {
              name: 'String'
            }
          },
          microsoftAccountClientSecret: {
            required: false,
            serializedName: 'properties.microsoftAccountClientSecret',
            type: {
              name: 'String'
            }
          },
          microsoftAccountOAuthScopes: {
            required: false,
            serializedName: 'properties.microsoftAccountOAuthScopes',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = SiteAuthSettings;
