{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CognitoIdentityProvider.CreateUserPoolClient
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates the user pool client.
--
-- When you create a new user pool client, token revocation is
-- automatically activated. For more information about revoking tokens, see
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_RevokeToken.html RevokeToken>.
module Amazonka.CognitoIdentityProvider.CreateUserPoolClient
  ( -- * Creating a Request
    CreateUserPoolClient (..),
    newCreateUserPoolClient,

    -- * Request Lenses
    createUserPoolClient_accessTokenValidity,
    createUserPoolClient_allowedOAuthFlows,
    createUserPoolClient_allowedOAuthFlowsUserPoolClient,
    createUserPoolClient_allowedOAuthScopes,
    createUserPoolClient_analyticsConfiguration,
    createUserPoolClient_authSessionValidity,
    createUserPoolClient_callbackURLs,
    createUserPoolClient_defaultRedirectURI,
    createUserPoolClient_enablePropagateAdditionalUserContextData,
    createUserPoolClient_enableTokenRevocation,
    createUserPoolClient_explicitAuthFlows,
    createUserPoolClient_generateSecret,
    createUserPoolClient_idTokenValidity,
    createUserPoolClient_logoutURLs,
    createUserPoolClient_preventUserExistenceErrors,
    createUserPoolClient_readAttributes,
    createUserPoolClient_refreshTokenValidity,
    createUserPoolClient_supportedIdentityProviders,
    createUserPoolClient_tokenValidityUnits,
    createUserPoolClient_writeAttributes,
    createUserPoolClient_userPoolId,
    createUserPoolClient_clientName,

    -- * Destructuring the Response
    CreateUserPoolClientResponse (..),
    newCreateUserPoolClientResponse,

    -- * Response Lenses
    createUserPoolClientResponse_userPoolClient,
    createUserPoolClientResponse_httpStatus,
  )
where

import Amazonka.CognitoIdentityProvider.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Represents the request to create a user pool client.
--
-- /See:/ 'newCreateUserPoolClient' smart constructor.
data CreateUserPoolClient = CreateUserPoolClient'
  { -- | The access token time limit. After this limit expires, your user can\'t
    -- use their access token. To specify the time unit for
    -- @AccessTokenValidity@ as @seconds@, @minutes@, @hours@, or @days@, set a
    -- @TokenValidityUnits@ value in your API request.
    --
    -- For example, when you set @AccessTokenValidity@ to @10@ and
    -- @TokenValidityUnits@ to @hours@, your user can authorize access with
    -- their access token for 10 hours.
    --
    -- The default time unit for @AccessTokenValidity@ in an API request is
    -- hours. /Valid range/ is displayed below in seconds.
    --
    -- If you don\'t specify otherwise in the configuration of your app client,
    -- your access tokens are valid for one hour.
    CreateUserPoolClient -> Maybe Natural
accessTokenValidity :: Prelude.Maybe Prelude.Natural,
    -- | The allowed OAuth flows.
    --
    -- [code]
    --     Use a code grant flow, which provides an authorization code as the
    --     response. This code can be exchanged for access tokens with the
    --     @\/oauth2\/token@ endpoint.
    --
    -- [implicit]
    --     Issue the access token (and, optionally, ID token, based on scopes)
    --     directly to your user.
    --
    -- [client_credentials]
    --     Issue the access token from the @\/oauth2\/token@ endpoint directly
    --     to a non-person user using a combination of the client ID and client
    --     secret.
    CreateUserPoolClient -> Maybe [OAuthFlowType]
allowedOAuthFlows :: Prelude.Maybe [OAuthFlowType],
    -- | Set to true if the client is allowed to follow the OAuth protocol when
    -- interacting with Amazon Cognito user pools.
    CreateUserPoolClient -> Maybe Bool
allowedOAuthFlowsUserPoolClient :: Prelude.Maybe Prelude.Bool,
    -- | The allowed OAuth scopes. Possible values provided by OAuth are @phone@,
    -- @email@, @openid@, and @profile@. Possible values provided by Amazon Web
    -- Services are @aws.cognito.signin.user.admin@. Custom scopes created in
    -- Resource Servers are also supported.
    CreateUserPoolClient -> Maybe [Text]
allowedOAuthScopes :: Prelude.Maybe [Prelude.Text],
    -- | The user pool analytics configuration for collecting metrics and sending
    -- them to your Amazon Pinpoint campaign.
    --
    -- In Amazon Web Services Regions where Amazon Pinpoint isn\'t available,
    -- user pools only support sending events to Amazon Pinpoint projects in
    -- Amazon Web Services Region us-east-1. In Regions where Amazon Pinpoint
    -- is available, user pools support sending events to Amazon Pinpoint
    -- projects within that same Region.
    CreateUserPoolClient -> Maybe AnalyticsConfigurationType
analyticsConfiguration :: Prelude.Maybe AnalyticsConfigurationType,
    -- | Amazon Cognito creates a session token for each API request in an
    -- authentication flow. @AuthSessionValidity@ is the duration, in minutes,
    -- of that session token. Your user pool native user must respond to each
    -- authentication challenge before the session expires.
    CreateUserPoolClient -> Maybe Natural
authSessionValidity :: Prelude.Maybe Prelude.Natural,
    -- | A list of allowed redirect (callback) URLs for the IdPs.
    --
    -- A redirect URI must:
    --
    -- -   Be an absolute URI.
    --
    -- -   Be registered with the authorization server.
    --
    -- -   Not include a fragment component.
    --
    -- See
    -- <https://tools.ietf.org/html/rfc6749#section-3.1.2 OAuth 2.0 - Redirection Endpoint>.
    --
    -- Amazon Cognito requires HTTPS over HTTP except for http:\/\/localhost
    -- for testing purposes only.
    --
    -- App callback URLs such as myapp:\/\/example are also supported.
    CreateUserPoolClient -> Maybe [Text]
callbackURLs :: Prelude.Maybe [Prelude.Text],
    -- | The default redirect URI. Must be in the @CallbackURLs@ list.
    --
    -- A redirect URI must:
    --
    -- -   Be an absolute URI.
    --
    -- -   Be registered with the authorization server.
    --
    -- -   Not include a fragment component.
    --
    -- See
    -- <https://tools.ietf.org/html/rfc6749#section-3.1.2 OAuth 2.0 - Redirection Endpoint>.
    --
    -- Amazon Cognito requires HTTPS over HTTP except for http:\/\/localhost
    -- for testing purposes only.
    --
    -- App callback URLs such as myapp:\/\/example are also supported.
    CreateUserPoolClient -> Maybe Text
defaultRedirectURI :: Prelude.Maybe Prelude.Text,
    -- | Activates the propagation of additional user context data. For more
    -- information about propagation of user context data, see
    -- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-advanced-security.html Adding advanced security to a user pool>.
    -- If you don’t include this parameter, you can\'t send device fingerprint
    -- information, including source IP address, to Amazon Cognito advanced
    -- security. You can only activate
    -- @EnablePropagateAdditionalUserContextData@ in an app client that has a
    -- client secret.
    CreateUserPoolClient -> Maybe Bool
enablePropagateAdditionalUserContextData :: Prelude.Maybe Prelude.Bool,
    -- | Activates or deactivates token revocation. For more information about
    -- revoking tokens, see
    -- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_RevokeToken.html RevokeToken>.
    --
    -- If you don\'t include this parameter, token revocation is automatically
    -- activated for the new user pool client.
    CreateUserPoolClient -> Maybe Bool
enableTokenRevocation :: Prelude.Maybe Prelude.Bool,
    -- | The authentication flows that you want your user pool client to support.
    -- For each app client in your user pool, you can sign in your users with
    -- any combination of one or more flows, including with a user name and
    -- Secure Remote Password (SRP), a user name and password, or a custom
    -- authentication process that you define with Lambda functions.
    --
    -- If you don\'t specify a value for @ExplicitAuthFlows@, your user client
    -- supports @ALLOW_REFRESH_TOKEN_AUTH@, @ALLOW_USER_SRP_AUTH@, and
    -- @ALLOW_CUSTOM_AUTH@.
    --
    -- Valid values include:
    --
    -- -   @ALLOW_ADMIN_USER_PASSWORD_AUTH@: Enable admin based user password
    --     authentication flow @ADMIN_USER_PASSWORD_AUTH@. This setting
    --     replaces the @ADMIN_NO_SRP_AUTH@ setting. With this authentication
    --     flow, your app passes a user name and password to Amazon Cognito in
    --     the request, instead of using the Secure Remote Password (SRP)
    --     protocol to securely transmit the password.
    --
    -- -   @ALLOW_CUSTOM_AUTH@: Enable Lambda trigger based authentication.
    --
    -- -   @ALLOW_USER_PASSWORD_AUTH@: Enable user password-based
    --     authentication. In this flow, Amazon Cognito receives the password
    --     in the request instead of using the SRP protocol to verify
    --     passwords.
    --
    -- -   @ALLOW_USER_SRP_AUTH@: Enable SRP-based authentication.
    --
    -- -   @ALLOW_REFRESH_TOKEN_AUTH@: Enable authflow to refresh tokens.
    --
    -- In some environments, you will see the values @ADMIN_NO_SRP_AUTH@,
    -- @CUSTOM_AUTH_FLOW_ONLY@, or @USER_PASSWORD_AUTH@. You can\'t assign
    -- these legacy @ExplicitAuthFlows@ values to user pool clients at the same
    -- time as values that begin with @ALLOW_@, like @ALLOW_USER_SRP_AUTH@.
    CreateUserPoolClient -> Maybe [ExplicitAuthFlowsType]
explicitAuthFlows :: Prelude.Maybe [ExplicitAuthFlowsType],
    -- | Boolean to specify whether you want to generate a secret for the user
    -- pool client being created.
    CreateUserPoolClient -> Maybe Bool
generateSecret :: Prelude.Maybe Prelude.Bool,
    -- | The ID token time limit. After this limit expires, your user can\'t use
    -- their ID token. To specify the time unit for @IdTokenValidity@ as
    -- @seconds@, @minutes@, @hours@, or @days@, set a @TokenValidityUnits@
    -- value in your API request.
    --
    -- For example, when you set @IdTokenValidity@ as @10@ and
    -- @TokenValidityUnits@ as @hours@, your user can authenticate their
    -- session with their ID token for 10 hours.
    --
    -- The default time unit for @AccessTokenValidity@ in an API request is
    -- hours. /Valid range/ is displayed below in seconds.
    --
    -- If you don\'t specify otherwise in the configuration of your app client,
    -- your ID tokens are valid for one hour.
    CreateUserPoolClient -> Maybe Natural
idTokenValidity :: Prelude.Maybe Prelude.Natural,
    -- | A list of allowed logout URLs for the IdPs.
    CreateUserPoolClient -> Maybe [Text]
logoutURLs :: Prelude.Maybe [Prelude.Text],
    -- | Errors and responses that you want Amazon Cognito APIs to return during
    -- authentication, account confirmation, and password recovery when the
    -- user doesn\'t exist in the user pool. When set to @ENABLED@ and the user
    -- doesn\'t exist, authentication returns an error indicating either the
    -- username or password was incorrect. Account confirmation and password
    -- recovery return a response indicating a code was sent to a simulated
    -- destination. When set to @LEGACY@, those APIs return a
    -- @UserNotFoundException@ exception if the user doesn\'t exist in the user
    -- pool.
    --
    -- Valid values include:
    --
    -- -   @ENABLED@ - This prevents user existence-related errors.
    --
    -- -   @LEGACY@ - This represents the early behavior of Amazon Cognito
    --     where user existence related errors aren\'t prevented.
    CreateUserPoolClient -> Maybe PreventUserExistenceErrorTypes
preventUserExistenceErrors :: Prelude.Maybe PreventUserExistenceErrorTypes,
    -- | The read attributes.
    CreateUserPoolClient -> Maybe [Text]
readAttributes :: Prelude.Maybe [Prelude.Text],
    -- | The refresh token time limit. After this limit expires, your user can\'t
    -- use their refresh token. To specify the time unit for
    -- @RefreshTokenValidity@ as @seconds@, @minutes@, @hours@, or @days@, set
    -- a @TokenValidityUnits@ value in your API request.
    --
    -- For example, when you set @RefreshTokenValidity@ as @10@ and
    -- @TokenValidityUnits@ as @days@, your user can refresh their session and
    -- retrieve new access and ID tokens for 10 days.
    --
    -- The default time unit for @RefreshTokenValidity@ in an API request is
    -- days. You can\'t set @RefreshTokenValidity@ to 0. If you do, Amazon
    -- Cognito overrides the value with the default value of 30 days. /Valid
    -- range/ is displayed below in seconds.
    --
    -- If you don\'t specify otherwise in the configuration of your app client,
    -- your refresh tokens are valid for 30 days.
    CreateUserPoolClient -> Maybe Natural
refreshTokenValidity :: Prelude.Maybe Prelude.Natural,
    -- | A list of provider names for the identity providers (IdPs) that are
    -- supported on this client. The following are supported: @COGNITO@,
    -- @Facebook@, @Google@, @SignInWithApple@, and @LoginWithAmazon@. You can
    -- also specify the names that you configured for the SAML and OIDC IdPs in
    -- your user pool, for example @MySAMLIdP@ or @MyOIDCIdP@.
    CreateUserPoolClient -> Maybe [Text]
supportedIdentityProviders :: Prelude.Maybe [Prelude.Text],
    -- | The units in which the validity times are represented. The default unit
    -- for RefreshToken is days, and default for ID and access tokens are
    -- hours.
    CreateUserPoolClient -> Maybe TokenValidityUnitsType
tokenValidityUnits :: Prelude.Maybe TokenValidityUnitsType,
    -- | The user pool attributes that the app client can write to.
    --
    -- If your app client allows users to sign in through an IdP, this array
    -- must include all attributes that you have mapped to IdP attributes.
    -- Amazon Cognito updates mapped attributes when users sign in to your
    -- application through an IdP. If your app client does not have write
    -- access to a mapped attribute, Amazon Cognito throws an error when it
    -- tries to update the attribute. For more information, see
    -- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-specifying-attribute-mapping.html Specifying IdP Attribute Mappings for Your user pool>.
    CreateUserPoolClient -> Maybe [Text]
writeAttributes :: Prelude.Maybe [Prelude.Text],
    -- | The user pool ID for the user pool where you want to create a user pool
    -- client.
    CreateUserPoolClient -> Text
userPoolId :: Prelude.Text,
    -- | The client name for the user pool client you would like to create.
    CreateUserPoolClient -> Text
clientName :: Prelude.Text
  }
  deriving (CreateUserPoolClient -> CreateUserPoolClient -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateUserPoolClient -> CreateUserPoolClient -> Bool
$c/= :: CreateUserPoolClient -> CreateUserPoolClient -> Bool
== :: CreateUserPoolClient -> CreateUserPoolClient -> Bool
$c== :: CreateUserPoolClient -> CreateUserPoolClient -> Bool
Prelude.Eq, ReadPrec [CreateUserPoolClient]
ReadPrec CreateUserPoolClient
Int -> ReadS CreateUserPoolClient
ReadS [CreateUserPoolClient]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateUserPoolClient]
$creadListPrec :: ReadPrec [CreateUserPoolClient]
readPrec :: ReadPrec CreateUserPoolClient
$creadPrec :: ReadPrec CreateUserPoolClient
readList :: ReadS [CreateUserPoolClient]
$creadList :: ReadS [CreateUserPoolClient]
readsPrec :: Int -> ReadS CreateUserPoolClient
$creadsPrec :: Int -> ReadS CreateUserPoolClient
Prelude.Read, Int -> CreateUserPoolClient -> ShowS
[CreateUserPoolClient] -> ShowS
CreateUserPoolClient -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateUserPoolClient] -> ShowS
$cshowList :: [CreateUserPoolClient] -> ShowS
show :: CreateUserPoolClient -> String
$cshow :: CreateUserPoolClient -> String
showsPrec :: Int -> CreateUserPoolClient -> ShowS
$cshowsPrec :: Int -> CreateUserPoolClient -> ShowS
Prelude.Show, forall x. Rep CreateUserPoolClient x -> CreateUserPoolClient
forall x. CreateUserPoolClient -> Rep CreateUserPoolClient x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateUserPoolClient x -> CreateUserPoolClient
$cfrom :: forall x. CreateUserPoolClient -> Rep CreateUserPoolClient x
Prelude.Generic)

-- |
-- Create a value of 'CreateUserPoolClient' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'accessTokenValidity', 'createUserPoolClient_accessTokenValidity' - The access token time limit. After this limit expires, your user can\'t
-- use their access token. To specify the time unit for
-- @AccessTokenValidity@ as @seconds@, @minutes@, @hours@, or @days@, set a
-- @TokenValidityUnits@ value in your API request.
--
-- For example, when you set @AccessTokenValidity@ to @10@ and
-- @TokenValidityUnits@ to @hours@, your user can authorize access with
-- their access token for 10 hours.
--
-- The default time unit for @AccessTokenValidity@ in an API request is
-- hours. /Valid range/ is displayed below in seconds.
--
-- If you don\'t specify otherwise in the configuration of your app client,
-- your access tokens are valid for one hour.
--
-- 'allowedOAuthFlows', 'createUserPoolClient_allowedOAuthFlows' - The allowed OAuth flows.
--
-- [code]
--     Use a code grant flow, which provides an authorization code as the
--     response. This code can be exchanged for access tokens with the
--     @\/oauth2\/token@ endpoint.
--
-- [implicit]
--     Issue the access token (and, optionally, ID token, based on scopes)
--     directly to your user.
--
-- [client_credentials]
--     Issue the access token from the @\/oauth2\/token@ endpoint directly
--     to a non-person user using a combination of the client ID and client
--     secret.
--
-- 'allowedOAuthFlowsUserPoolClient', 'createUserPoolClient_allowedOAuthFlowsUserPoolClient' - Set to true if the client is allowed to follow the OAuth protocol when
-- interacting with Amazon Cognito user pools.
--
-- 'allowedOAuthScopes', 'createUserPoolClient_allowedOAuthScopes' - The allowed OAuth scopes. Possible values provided by OAuth are @phone@,
-- @email@, @openid@, and @profile@. Possible values provided by Amazon Web
-- Services are @aws.cognito.signin.user.admin@. Custom scopes created in
-- Resource Servers are also supported.
--
-- 'analyticsConfiguration', 'createUserPoolClient_analyticsConfiguration' - The user pool analytics configuration for collecting metrics and sending
-- them to your Amazon Pinpoint campaign.
--
-- In Amazon Web Services Regions where Amazon Pinpoint isn\'t available,
-- user pools only support sending events to Amazon Pinpoint projects in
-- Amazon Web Services Region us-east-1. In Regions where Amazon Pinpoint
-- is available, user pools support sending events to Amazon Pinpoint
-- projects within that same Region.
--
-- 'authSessionValidity', 'createUserPoolClient_authSessionValidity' - Amazon Cognito creates a session token for each API request in an
-- authentication flow. @AuthSessionValidity@ is the duration, in minutes,
-- of that session token. Your user pool native user must respond to each
-- authentication challenge before the session expires.
--
-- 'callbackURLs', 'createUserPoolClient_callbackURLs' - A list of allowed redirect (callback) URLs for the IdPs.
--
-- A redirect URI must:
--
-- -   Be an absolute URI.
--
-- -   Be registered with the authorization server.
--
-- -   Not include a fragment component.
--
-- See
-- <https://tools.ietf.org/html/rfc6749#section-3.1.2 OAuth 2.0 - Redirection Endpoint>.
--
-- Amazon Cognito requires HTTPS over HTTP except for http:\/\/localhost
-- for testing purposes only.
--
-- App callback URLs such as myapp:\/\/example are also supported.
--
-- 'defaultRedirectURI', 'createUserPoolClient_defaultRedirectURI' - The default redirect URI. Must be in the @CallbackURLs@ list.
--
-- A redirect URI must:
--
-- -   Be an absolute URI.
--
-- -   Be registered with the authorization server.
--
-- -   Not include a fragment component.
--
-- See
-- <https://tools.ietf.org/html/rfc6749#section-3.1.2 OAuth 2.0 - Redirection Endpoint>.
--
-- Amazon Cognito requires HTTPS over HTTP except for http:\/\/localhost
-- for testing purposes only.
--
-- App callback URLs such as myapp:\/\/example are also supported.
--
-- 'enablePropagateAdditionalUserContextData', 'createUserPoolClient_enablePropagateAdditionalUserContextData' - Activates the propagation of additional user context data. For more
-- information about propagation of user context data, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-advanced-security.html Adding advanced security to a user pool>.
-- If you don’t include this parameter, you can\'t send device fingerprint
-- information, including source IP address, to Amazon Cognito advanced
-- security. You can only activate
-- @EnablePropagateAdditionalUserContextData@ in an app client that has a
-- client secret.
--
-- 'enableTokenRevocation', 'createUserPoolClient_enableTokenRevocation' - Activates or deactivates token revocation. For more information about
-- revoking tokens, see
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_RevokeToken.html RevokeToken>.
--
-- If you don\'t include this parameter, token revocation is automatically
-- activated for the new user pool client.
--
-- 'explicitAuthFlows', 'createUserPoolClient_explicitAuthFlows' - The authentication flows that you want your user pool client to support.
-- For each app client in your user pool, you can sign in your users with
-- any combination of one or more flows, including with a user name and
-- Secure Remote Password (SRP), a user name and password, or a custom
-- authentication process that you define with Lambda functions.
--
-- If you don\'t specify a value for @ExplicitAuthFlows@, your user client
-- supports @ALLOW_REFRESH_TOKEN_AUTH@, @ALLOW_USER_SRP_AUTH@, and
-- @ALLOW_CUSTOM_AUTH@.
--
-- Valid values include:
--
-- -   @ALLOW_ADMIN_USER_PASSWORD_AUTH@: Enable admin based user password
--     authentication flow @ADMIN_USER_PASSWORD_AUTH@. This setting
--     replaces the @ADMIN_NO_SRP_AUTH@ setting. With this authentication
--     flow, your app passes a user name and password to Amazon Cognito in
--     the request, instead of using the Secure Remote Password (SRP)
--     protocol to securely transmit the password.
--
-- -   @ALLOW_CUSTOM_AUTH@: Enable Lambda trigger based authentication.
--
-- -   @ALLOW_USER_PASSWORD_AUTH@: Enable user password-based
--     authentication. In this flow, Amazon Cognito receives the password
--     in the request instead of using the SRP protocol to verify
--     passwords.
--
-- -   @ALLOW_USER_SRP_AUTH@: Enable SRP-based authentication.
--
-- -   @ALLOW_REFRESH_TOKEN_AUTH@: Enable authflow to refresh tokens.
--
-- In some environments, you will see the values @ADMIN_NO_SRP_AUTH@,
-- @CUSTOM_AUTH_FLOW_ONLY@, or @USER_PASSWORD_AUTH@. You can\'t assign
-- these legacy @ExplicitAuthFlows@ values to user pool clients at the same
-- time as values that begin with @ALLOW_@, like @ALLOW_USER_SRP_AUTH@.
--
-- 'generateSecret', 'createUserPoolClient_generateSecret' - Boolean to specify whether you want to generate a secret for the user
-- pool client being created.
--
-- 'idTokenValidity', 'createUserPoolClient_idTokenValidity' - The ID token time limit. After this limit expires, your user can\'t use
-- their ID token. To specify the time unit for @IdTokenValidity@ as
-- @seconds@, @minutes@, @hours@, or @days@, set a @TokenValidityUnits@
-- value in your API request.
--
-- For example, when you set @IdTokenValidity@ as @10@ and
-- @TokenValidityUnits@ as @hours@, your user can authenticate their
-- session with their ID token for 10 hours.
--
-- The default time unit for @AccessTokenValidity@ in an API request is
-- hours. /Valid range/ is displayed below in seconds.
--
-- If you don\'t specify otherwise in the configuration of your app client,
-- your ID tokens are valid for one hour.
--
-- 'logoutURLs', 'createUserPoolClient_logoutURLs' - A list of allowed logout URLs for the IdPs.
--
-- 'preventUserExistenceErrors', 'createUserPoolClient_preventUserExistenceErrors' - Errors and responses that you want Amazon Cognito APIs to return during
-- authentication, account confirmation, and password recovery when the
-- user doesn\'t exist in the user pool. When set to @ENABLED@ and the user
-- doesn\'t exist, authentication returns an error indicating either the
-- username or password was incorrect. Account confirmation and password
-- recovery return a response indicating a code was sent to a simulated
-- destination. When set to @LEGACY@, those APIs return a
-- @UserNotFoundException@ exception if the user doesn\'t exist in the user
-- pool.
--
-- Valid values include:
--
-- -   @ENABLED@ - This prevents user existence-related errors.
--
-- -   @LEGACY@ - This represents the early behavior of Amazon Cognito
--     where user existence related errors aren\'t prevented.
--
-- 'readAttributes', 'createUserPoolClient_readAttributes' - The read attributes.
--
-- 'refreshTokenValidity', 'createUserPoolClient_refreshTokenValidity' - The refresh token time limit. After this limit expires, your user can\'t
-- use their refresh token. To specify the time unit for
-- @RefreshTokenValidity@ as @seconds@, @minutes@, @hours@, or @days@, set
-- a @TokenValidityUnits@ value in your API request.
--
-- For example, when you set @RefreshTokenValidity@ as @10@ and
-- @TokenValidityUnits@ as @days@, your user can refresh their session and
-- retrieve new access and ID tokens for 10 days.
--
-- The default time unit for @RefreshTokenValidity@ in an API request is
-- days. You can\'t set @RefreshTokenValidity@ to 0. If you do, Amazon
-- Cognito overrides the value with the default value of 30 days. /Valid
-- range/ is displayed below in seconds.
--
-- If you don\'t specify otherwise in the configuration of your app client,
-- your refresh tokens are valid for 30 days.
--
-- 'supportedIdentityProviders', 'createUserPoolClient_supportedIdentityProviders' - A list of provider names for the identity providers (IdPs) that are
-- supported on this client. The following are supported: @COGNITO@,
-- @Facebook@, @Google@, @SignInWithApple@, and @LoginWithAmazon@. You can
-- also specify the names that you configured for the SAML and OIDC IdPs in
-- your user pool, for example @MySAMLIdP@ or @MyOIDCIdP@.
--
-- 'tokenValidityUnits', 'createUserPoolClient_tokenValidityUnits' - The units in which the validity times are represented. The default unit
-- for RefreshToken is days, and default for ID and access tokens are
-- hours.
--
-- 'writeAttributes', 'createUserPoolClient_writeAttributes' - The user pool attributes that the app client can write to.
--
-- If your app client allows users to sign in through an IdP, this array
-- must include all attributes that you have mapped to IdP attributes.
-- Amazon Cognito updates mapped attributes when users sign in to your
-- application through an IdP. If your app client does not have write
-- access to a mapped attribute, Amazon Cognito throws an error when it
-- tries to update the attribute. For more information, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-specifying-attribute-mapping.html Specifying IdP Attribute Mappings for Your user pool>.
--
-- 'userPoolId', 'createUserPoolClient_userPoolId' - The user pool ID for the user pool where you want to create a user pool
-- client.
--
-- 'clientName', 'createUserPoolClient_clientName' - The client name for the user pool client you would like to create.
newCreateUserPoolClient ::
  -- | 'userPoolId'
  Prelude.Text ->
  -- | 'clientName'
  Prelude.Text ->
  CreateUserPoolClient
newCreateUserPoolClient :: Text -> Text -> CreateUserPoolClient
newCreateUserPoolClient Text
pUserPoolId_ Text
pClientName_ =
  CreateUserPoolClient'
    { $sel:accessTokenValidity:CreateUserPoolClient' :: Maybe Natural
accessTokenValidity =
        forall a. Maybe a
Prelude.Nothing,
      $sel:allowedOAuthFlows:CreateUserPoolClient' :: Maybe [OAuthFlowType]
allowedOAuthFlows = forall a. Maybe a
Prelude.Nothing,
      $sel:allowedOAuthFlowsUserPoolClient:CreateUserPoolClient' :: Maybe Bool
allowedOAuthFlowsUserPoolClient = forall a. Maybe a
Prelude.Nothing,
      $sel:allowedOAuthScopes:CreateUserPoolClient' :: Maybe [Text]
allowedOAuthScopes = forall a. Maybe a
Prelude.Nothing,
      $sel:analyticsConfiguration:CreateUserPoolClient' :: Maybe AnalyticsConfigurationType
analyticsConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:authSessionValidity:CreateUserPoolClient' :: Maybe Natural
authSessionValidity = forall a. Maybe a
Prelude.Nothing,
      $sel:callbackURLs:CreateUserPoolClient' :: Maybe [Text]
callbackURLs = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultRedirectURI:CreateUserPoolClient' :: Maybe Text
defaultRedirectURI = forall a. Maybe a
Prelude.Nothing,
      $sel:enablePropagateAdditionalUserContextData:CreateUserPoolClient' :: Maybe Bool
enablePropagateAdditionalUserContextData =
        forall a. Maybe a
Prelude.Nothing,
      $sel:enableTokenRevocation:CreateUserPoolClient' :: Maybe Bool
enableTokenRevocation = forall a. Maybe a
Prelude.Nothing,
      $sel:explicitAuthFlows:CreateUserPoolClient' :: Maybe [ExplicitAuthFlowsType]
explicitAuthFlows = forall a. Maybe a
Prelude.Nothing,
      $sel:generateSecret:CreateUserPoolClient' :: Maybe Bool
generateSecret = forall a. Maybe a
Prelude.Nothing,
      $sel:idTokenValidity:CreateUserPoolClient' :: Maybe Natural
idTokenValidity = forall a. Maybe a
Prelude.Nothing,
      $sel:logoutURLs:CreateUserPoolClient' :: Maybe [Text]
logoutURLs = forall a. Maybe a
Prelude.Nothing,
      $sel:preventUserExistenceErrors:CreateUserPoolClient' :: Maybe PreventUserExistenceErrorTypes
preventUserExistenceErrors = forall a. Maybe a
Prelude.Nothing,
      $sel:readAttributes:CreateUserPoolClient' :: Maybe [Text]
readAttributes = forall a. Maybe a
Prelude.Nothing,
      $sel:refreshTokenValidity:CreateUserPoolClient' :: Maybe Natural
refreshTokenValidity = forall a. Maybe a
Prelude.Nothing,
      $sel:supportedIdentityProviders:CreateUserPoolClient' :: Maybe [Text]
supportedIdentityProviders = forall a. Maybe a
Prelude.Nothing,
      $sel:tokenValidityUnits:CreateUserPoolClient' :: Maybe TokenValidityUnitsType
tokenValidityUnits = forall a. Maybe a
Prelude.Nothing,
      $sel:writeAttributes:CreateUserPoolClient' :: Maybe [Text]
writeAttributes = forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolId:CreateUserPoolClient' :: Text
userPoolId = Text
pUserPoolId_,
      $sel:clientName:CreateUserPoolClient' :: Text
clientName = Text
pClientName_
    }

-- | The access token time limit. After this limit expires, your user can\'t
-- use their access token. To specify the time unit for
-- @AccessTokenValidity@ as @seconds@, @minutes@, @hours@, or @days@, set a
-- @TokenValidityUnits@ value in your API request.
--
-- For example, when you set @AccessTokenValidity@ to @10@ and
-- @TokenValidityUnits@ to @hours@, your user can authorize access with
-- their access token for 10 hours.
--
-- The default time unit for @AccessTokenValidity@ in an API request is
-- hours. /Valid range/ is displayed below in seconds.
--
-- If you don\'t specify otherwise in the configuration of your app client,
-- your access tokens are valid for one hour.
createUserPoolClient_accessTokenValidity :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe Prelude.Natural)
createUserPoolClient_accessTokenValidity :: Lens' CreateUserPoolClient (Maybe Natural)
createUserPoolClient_accessTokenValidity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe Natural
accessTokenValidity :: Maybe Natural
$sel:accessTokenValidity:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Natural
accessTokenValidity} -> Maybe Natural
accessTokenValidity) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe Natural
a -> CreateUserPoolClient
s {$sel:accessTokenValidity:CreateUserPoolClient' :: Maybe Natural
accessTokenValidity = Maybe Natural
a} :: CreateUserPoolClient)

-- | The allowed OAuth flows.
--
-- [code]
--     Use a code grant flow, which provides an authorization code as the
--     response. This code can be exchanged for access tokens with the
--     @\/oauth2\/token@ endpoint.
--
-- [implicit]
--     Issue the access token (and, optionally, ID token, based on scopes)
--     directly to your user.
--
-- [client_credentials]
--     Issue the access token from the @\/oauth2\/token@ endpoint directly
--     to a non-person user using a combination of the client ID and client
--     secret.
createUserPoolClient_allowedOAuthFlows :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe [OAuthFlowType])
createUserPoolClient_allowedOAuthFlows :: Lens' CreateUserPoolClient (Maybe [OAuthFlowType])
createUserPoolClient_allowedOAuthFlows = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe [OAuthFlowType]
allowedOAuthFlows :: Maybe [OAuthFlowType]
$sel:allowedOAuthFlows:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [OAuthFlowType]
allowedOAuthFlows} -> Maybe [OAuthFlowType]
allowedOAuthFlows) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe [OAuthFlowType]
a -> CreateUserPoolClient
s {$sel:allowedOAuthFlows:CreateUserPoolClient' :: Maybe [OAuthFlowType]
allowedOAuthFlows = Maybe [OAuthFlowType]
a} :: CreateUserPoolClient) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Set to true if the client is allowed to follow the OAuth protocol when
-- interacting with Amazon Cognito user pools.
createUserPoolClient_allowedOAuthFlowsUserPoolClient :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe Prelude.Bool)
createUserPoolClient_allowedOAuthFlowsUserPoolClient :: Lens' CreateUserPoolClient (Maybe Bool)
createUserPoolClient_allowedOAuthFlowsUserPoolClient = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe Bool
allowedOAuthFlowsUserPoolClient :: Maybe Bool
$sel:allowedOAuthFlowsUserPoolClient:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Bool
allowedOAuthFlowsUserPoolClient} -> Maybe Bool
allowedOAuthFlowsUserPoolClient) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe Bool
a -> CreateUserPoolClient
s {$sel:allowedOAuthFlowsUserPoolClient:CreateUserPoolClient' :: Maybe Bool
allowedOAuthFlowsUserPoolClient = Maybe Bool
a} :: CreateUserPoolClient)

-- | The allowed OAuth scopes. Possible values provided by OAuth are @phone@,
-- @email@, @openid@, and @profile@. Possible values provided by Amazon Web
-- Services are @aws.cognito.signin.user.admin@. Custom scopes created in
-- Resource Servers are also supported.
createUserPoolClient_allowedOAuthScopes :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe [Prelude.Text])
createUserPoolClient_allowedOAuthScopes :: Lens' CreateUserPoolClient (Maybe [Text])
createUserPoolClient_allowedOAuthScopes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe [Text]
allowedOAuthScopes :: Maybe [Text]
$sel:allowedOAuthScopes:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
allowedOAuthScopes} -> Maybe [Text]
allowedOAuthScopes) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe [Text]
a -> CreateUserPoolClient
s {$sel:allowedOAuthScopes:CreateUserPoolClient' :: Maybe [Text]
allowedOAuthScopes = Maybe [Text]
a} :: CreateUserPoolClient) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The user pool analytics configuration for collecting metrics and sending
-- them to your Amazon Pinpoint campaign.
--
-- In Amazon Web Services Regions where Amazon Pinpoint isn\'t available,
-- user pools only support sending events to Amazon Pinpoint projects in
-- Amazon Web Services Region us-east-1. In Regions where Amazon Pinpoint
-- is available, user pools support sending events to Amazon Pinpoint
-- projects within that same Region.
createUserPoolClient_analyticsConfiguration :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe AnalyticsConfigurationType)
createUserPoolClient_analyticsConfiguration :: Lens' CreateUserPoolClient (Maybe AnalyticsConfigurationType)
createUserPoolClient_analyticsConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe AnalyticsConfigurationType
analyticsConfiguration :: Maybe AnalyticsConfigurationType
$sel:analyticsConfiguration:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe AnalyticsConfigurationType
analyticsConfiguration} -> Maybe AnalyticsConfigurationType
analyticsConfiguration) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe AnalyticsConfigurationType
a -> CreateUserPoolClient
s {$sel:analyticsConfiguration:CreateUserPoolClient' :: Maybe AnalyticsConfigurationType
analyticsConfiguration = Maybe AnalyticsConfigurationType
a} :: CreateUserPoolClient)

-- | Amazon Cognito creates a session token for each API request in an
-- authentication flow. @AuthSessionValidity@ is the duration, in minutes,
-- of that session token. Your user pool native user must respond to each
-- authentication challenge before the session expires.
createUserPoolClient_authSessionValidity :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe Prelude.Natural)
createUserPoolClient_authSessionValidity :: Lens' CreateUserPoolClient (Maybe Natural)
createUserPoolClient_authSessionValidity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe Natural
authSessionValidity :: Maybe Natural
$sel:authSessionValidity:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Natural
authSessionValidity} -> Maybe Natural
authSessionValidity) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe Natural
a -> CreateUserPoolClient
s {$sel:authSessionValidity:CreateUserPoolClient' :: Maybe Natural
authSessionValidity = Maybe Natural
a} :: CreateUserPoolClient)

-- | A list of allowed redirect (callback) URLs for the IdPs.
--
-- A redirect URI must:
--
-- -   Be an absolute URI.
--
-- -   Be registered with the authorization server.
--
-- -   Not include a fragment component.
--
-- See
-- <https://tools.ietf.org/html/rfc6749#section-3.1.2 OAuth 2.0 - Redirection Endpoint>.
--
-- Amazon Cognito requires HTTPS over HTTP except for http:\/\/localhost
-- for testing purposes only.
--
-- App callback URLs such as myapp:\/\/example are also supported.
createUserPoolClient_callbackURLs :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe [Prelude.Text])
createUserPoolClient_callbackURLs :: Lens' CreateUserPoolClient (Maybe [Text])
createUserPoolClient_callbackURLs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe [Text]
callbackURLs :: Maybe [Text]
$sel:callbackURLs:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
callbackURLs} -> Maybe [Text]
callbackURLs) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe [Text]
a -> CreateUserPoolClient
s {$sel:callbackURLs:CreateUserPoolClient' :: Maybe [Text]
callbackURLs = Maybe [Text]
a} :: CreateUserPoolClient) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The default redirect URI. Must be in the @CallbackURLs@ list.
--
-- A redirect URI must:
--
-- -   Be an absolute URI.
--
-- -   Be registered with the authorization server.
--
-- -   Not include a fragment component.
--
-- See
-- <https://tools.ietf.org/html/rfc6749#section-3.1.2 OAuth 2.0 - Redirection Endpoint>.
--
-- Amazon Cognito requires HTTPS over HTTP except for http:\/\/localhost
-- for testing purposes only.
--
-- App callback URLs such as myapp:\/\/example are also supported.
createUserPoolClient_defaultRedirectURI :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe Prelude.Text)
createUserPoolClient_defaultRedirectURI :: Lens' CreateUserPoolClient (Maybe Text)
createUserPoolClient_defaultRedirectURI = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe Text
defaultRedirectURI :: Maybe Text
$sel:defaultRedirectURI:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Text
defaultRedirectURI} -> Maybe Text
defaultRedirectURI) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe Text
a -> CreateUserPoolClient
s {$sel:defaultRedirectURI:CreateUserPoolClient' :: Maybe Text
defaultRedirectURI = Maybe Text
a} :: CreateUserPoolClient)

-- | Activates the propagation of additional user context data. For more
-- information about propagation of user context data, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-advanced-security.html Adding advanced security to a user pool>.
-- If you don’t include this parameter, you can\'t send device fingerprint
-- information, including source IP address, to Amazon Cognito advanced
-- security. You can only activate
-- @EnablePropagateAdditionalUserContextData@ in an app client that has a
-- client secret.
createUserPoolClient_enablePropagateAdditionalUserContextData :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe Prelude.Bool)
createUserPoolClient_enablePropagateAdditionalUserContextData :: Lens' CreateUserPoolClient (Maybe Bool)
createUserPoolClient_enablePropagateAdditionalUserContextData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe Bool
enablePropagateAdditionalUserContextData :: Maybe Bool
$sel:enablePropagateAdditionalUserContextData:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Bool
enablePropagateAdditionalUserContextData} -> Maybe Bool
enablePropagateAdditionalUserContextData) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe Bool
a -> CreateUserPoolClient
s {$sel:enablePropagateAdditionalUserContextData:CreateUserPoolClient' :: Maybe Bool
enablePropagateAdditionalUserContextData = Maybe Bool
a} :: CreateUserPoolClient)

-- | Activates or deactivates token revocation. For more information about
-- revoking tokens, see
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_RevokeToken.html RevokeToken>.
--
-- If you don\'t include this parameter, token revocation is automatically
-- activated for the new user pool client.
createUserPoolClient_enableTokenRevocation :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe Prelude.Bool)
createUserPoolClient_enableTokenRevocation :: Lens' CreateUserPoolClient (Maybe Bool)
createUserPoolClient_enableTokenRevocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe Bool
enableTokenRevocation :: Maybe Bool
$sel:enableTokenRevocation:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Bool
enableTokenRevocation} -> Maybe Bool
enableTokenRevocation) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe Bool
a -> CreateUserPoolClient
s {$sel:enableTokenRevocation:CreateUserPoolClient' :: Maybe Bool
enableTokenRevocation = Maybe Bool
a} :: CreateUserPoolClient)

-- | The authentication flows that you want your user pool client to support.
-- For each app client in your user pool, you can sign in your users with
-- any combination of one or more flows, including with a user name and
-- Secure Remote Password (SRP), a user name and password, or a custom
-- authentication process that you define with Lambda functions.
--
-- If you don\'t specify a value for @ExplicitAuthFlows@, your user client
-- supports @ALLOW_REFRESH_TOKEN_AUTH@, @ALLOW_USER_SRP_AUTH@, and
-- @ALLOW_CUSTOM_AUTH@.
--
-- Valid values include:
--
-- -   @ALLOW_ADMIN_USER_PASSWORD_AUTH@: Enable admin based user password
--     authentication flow @ADMIN_USER_PASSWORD_AUTH@. This setting
--     replaces the @ADMIN_NO_SRP_AUTH@ setting. With this authentication
--     flow, your app passes a user name and password to Amazon Cognito in
--     the request, instead of using the Secure Remote Password (SRP)
--     protocol to securely transmit the password.
--
-- -   @ALLOW_CUSTOM_AUTH@: Enable Lambda trigger based authentication.
--
-- -   @ALLOW_USER_PASSWORD_AUTH@: Enable user password-based
--     authentication. In this flow, Amazon Cognito receives the password
--     in the request instead of using the SRP protocol to verify
--     passwords.
--
-- -   @ALLOW_USER_SRP_AUTH@: Enable SRP-based authentication.
--
-- -   @ALLOW_REFRESH_TOKEN_AUTH@: Enable authflow to refresh tokens.
--
-- In some environments, you will see the values @ADMIN_NO_SRP_AUTH@,
-- @CUSTOM_AUTH_FLOW_ONLY@, or @USER_PASSWORD_AUTH@. You can\'t assign
-- these legacy @ExplicitAuthFlows@ values to user pool clients at the same
-- time as values that begin with @ALLOW_@, like @ALLOW_USER_SRP_AUTH@.
createUserPoolClient_explicitAuthFlows :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe [ExplicitAuthFlowsType])
createUserPoolClient_explicitAuthFlows :: Lens' CreateUserPoolClient (Maybe [ExplicitAuthFlowsType])
createUserPoolClient_explicitAuthFlows = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe [ExplicitAuthFlowsType]
explicitAuthFlows :: Maybe [ExplicitAuthFlowsType]
$sel:explicitAuthFlows:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [ExplicitAuthFlowsType]
explicitAuthFlows} -> Maybe [ExplicitAuthFlowsType]
explicitAuthFlows) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe [ExplicitAuthFlowsType]
a -> CreateUserPoolClient
s {$sel:explicitAuthFlows:CreateUserPoolClient' :: Maybe [ExplicitAuthFlowsType]
explicitAuthFlows = Maybe [ExplicitAuthFlowsType]
a} :: CreateUserPoolClient) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Boolean to specify whether you want to generate a secret for the user
-- pool client being created.
createUserPoolClient_generateSecret :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe Prelude.Bool)
createUserPoolClient_generateSecret :: Lens' CreateUserPoolClient (Maybe Bool)
createUserPoolClient_generateSecret = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe Bool
generateSecret :: Maybe Bool
$sel:generateSecret:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Bool
generateSecret} -> Maybe Bool
generateSecret) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe Bool
a -> CreateUserPoolClient
s {$sel:generateSecret:CreateUserPoolClient' :: Maybe Bool
generateSecret = Maybe Bool
a} :: CreateUserPoolClient)

-- | The ID token time limit. After this limit expires, your user can\'t use
-- their ID token. To specify the time unit for @IdTokenValidity@ as
-- @seconds@, @minutes@, @hours@, or @days@, set a @TokenValidityUnits@
-- value in your API request.
--
-- For example, when you set @IdTokenValidity@ as @10@ and
-- @TokenValidityUnits@ as @hours@, your user can authenticate their
-- session with their ID token for 10 hours.
--
-- The default time unit for @AccessTokenValidity@ in an API request is
-- hours. /Valid range/ is displayed below in seconds.
--
-- If you don\'t specify otherwise in the configuration of your app client,
-- your ID tokens are valid for one hour.
createUserPoolClient_idTokenValidity :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe Prelude.Natural)
createUserPoolClient_idTokenValidity :: Lens' CreateUserPoolClient (Maybe Natural)
createUserPoolClient_idTokenValidity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe Natural
idTokenValidity :: Maybe Natural
$sel:idTokenValidity:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Natural
idTokenValidity} -> Maybe Natural
idTokenValidity) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe Natural
a -> CreateUserPoolClient
s {$sel:idTokenValidity:CreateUserPoolClient' :: Maybe Natural
idTokenValidity = Maybe Natural
a} :: CreateUserPoolClient)

-- | A list of allowed logout URLs for the IdPs.
createUserPoolClient_logoutURLs :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe [Prelude.Text])
createUserPoolClient_logoutURLs :: Lens' CreateUserPoolClient (Maybe [Text])
createUserPoolClient_logoutURLs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe [Text]
logoutURLs :: Maybe [Text]
$sel:logoutURLs:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
logoutURLs} -> Maybe [Text]
logoutURLs) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe [Text]
a -> CreateUserPoolClient
s {$sel:logoutURLs:CreateUserPoolClient' :: Maybe [Text]
logoutURLs = Maybe [Text]
a} :: CreateUserPoolClient) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Errors and responses that you want Amazon Cognito APIs to return during
-- authentication, account confirmation, and password recovery when the
-- user doesn\'t exist in the user pool. When set to @ENABLED@ and the user
-- doesn\'t exist, authentication returns an error indicating either the
-- username or password was incorrect. Account confirmation and password
-- recovery return a response indicating a code was sent to a simulated
-- destination. When set to @LEGACY@, those APIs return a
-- @UserNotFoundException@ exception if the user doesn\'t exist in the user
-- pool.
--
-- Valid values include:
--
-- -   @ENABLED@ - This prevents user existence-related errors.
--
-- -   @LEGACY@ - This represents the early behavior of Amazon Cognito
--     where user existence related errors aren\'t prevented.
createUserPoolClient_preventUserExistenceErrors :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe PreventUserExistenceErrorTypes)
createUserPoolClient_preventUserExistenceErrors :: Lens' CreateUserPoolClient (Maybe PreventUserExistenceErrorTypes)
createUserPoolClient_preventUserExistenceErrors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe PreventUserExistenceErrorTypes
preventUserExistenceErrors :: Maybe PreventUserExistenceErrorTypes
$sel:preventUserExistenceErrors:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe PreventUserExistenceErrorTypes
preventUserExistenceErrors} -> Maybe PreventUserExistenceErrorTypes
preventUserExistenceErrors) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe PreventUserExistenceErrorTypes
a -> CreateUserPoolClient
s {$sel:preventUserExistenceErrors:CreateUserPoolClient' :: Maybe PreventUserExistenceErrorTypes
preventUserExistenceErrors = Maybe PreventUserExistenceErrorTypes
a} :: CreateUserPoolClient)

-- | The read attributes.
createUserPoolClient_readAttributes :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe [Prelude.Text])
createUserPoolClient_readAttributes :: Lens' CreateUserPoolClient (Maybe [Text])
createUserPoolClient_readAttributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe [Text]
readAttributes :: Maybe [Text]
$sel:readAttributes:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
readAttributes} -> Maybe [Text]
readAttributes) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe [Text]
a -> CreateUserPoolClient
s {$sel:readAttributes:CreateUserPoolClient' :: Maybe [Text]
readAttributes = Maybe [Text]
a} :: CreateUserPoolClient) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The refresh token time limit. After this limit expires, your user can\'t
-- use their refresh token. To specify the time unit for
-- @RefreshTokenValidity@ as @seconds@, @minutes@, @hours@, or @days@, set
-- a @TokenValidityUnits@ value in your API request.
--
-- For example, when you set @RefreshTokenValidity@ as @10@ and
-- @TokenValidityUnits@ as @days@, your user can refresh their session and
-- retrieve new access and ID tokens for 10 days.
--
-- The default time unit for @RefreshTokenValidity@ in an API request is
-- days. You can\'t set @RefreshTokenValidity@ to 0. If you do, Amazon
-- Cognito overrides the value with the default value of 30 days. /Valid
-- range/ is displayed below in seconds.
--
-- If you don\'t specify otherwise in the configuration of your app client,
-- your refresh tokens are valid for 30 days.
createUserPoolClient_refreshTokenValidity :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe Prelude.Natural)
createUserPoolClient_refreshTokenValidity :: Lens' CreateUserPoolClient (Maybe Natural)
createUserPoolClient_refreshTokenValidity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe Natural
refreshTokenValidity :: Maybe Natural
$sel:refreshTokenValidity:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Natural
refreshTokenValidity} -> Maybe Natural
refreshTokenValidity) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe Natural
a -> CreateUserPoolClient
s {$sel:refreshTokenValidity:CreateUserPoolClient' :: Maybe Natural
refreshTokenValidity = Maybe Natural
a} :: CreateUserPoolClient)

-- | A list of provider names for the identity providers (IdPs) that are
-- supported on this client. The following are supported: @COGNITO@,
-- @Facebook@, @Google@, @SignInWithApple@, and @LoginWithAmazon@. You can
-- also specify the names that you configured for the SAML and OIDC IdPs in
-- your user pool, for example @MySAMLIdP@ or @MyOIDCIdP@.
createUserPoolClient_supportedIdentityProviders :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe [Prelude.Text])
createUserPoolClient_supportedIdentityProviders :: Lens' CreateUserPoolClient (Maybe [Text])
createUserPoolClient_supportedIdentityProviders = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe [Text]
supportedIdentityProviders :: Maybe [Text]
$sel:supportedIdentityProviders:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
supportedIdentityProviders} -> Maybe [Text]
supportedIdentityProviders) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe [Text]
a -> CreateUserPoolClient
s {$sel:supportedIdentityProviders:CreateUserPoolClient' :: Maybe [Text]
supportedIdentityProviders = Maybe [Text]
a} :: CreateUserPoolClient) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The units in which the validity times are represented. The default unit
-- for RefreshToken is days, and default for ID and access tokens are
-- hours.
createUserPoolClient_tokenValidityUnits :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe TokenValidityUnitsType)
createUserPoolClient_tokenValidityUnits :: Lens' CreateUserPoolClient (Maybe TokenValidityUnitsType)
createUserPoolClient_tokenValidityUnits = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe TokenValidityUnitsType
tokenValidityUnits :: Maybe TokenValidityUnitsType
$sel:tokenValidityUnits:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe TokenValidityUnitsType
tokenValidityUnits} -> Maybe TokenValidityUnitsType
tokenValidityUnits) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe TokenValidityUnitsType
a -> CreateUserPoolClient
s {$sel:tokenValidityUnits:CreateUserPoolClient' :: Maybe TokenValidityUnitsType
tokenValidityUnits = Maybe TokenValidityUnitsType
a} :: CreateUserPoolClient)

-- | The user pool attributes that the app client can write to.
--
-- If your app client allows users to sign in through an IdP, this array
-- must include all attributes that you have mapped to IdP attributes.
-- Amazon Cognito updates mapped attributes when users sign in to your
-- application through an IdP. If your app client does not have write
-- access to a mapped attribute, Amazon Cognito throws an error when it
-- tries to update the attribute. For more information, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-specifying-attribute-mapping.html Specifying IdP Attribute Mappings for Your user pool>.
createUserPoolClient_writeAttributes :: Lens.Lens' CreateUserPoolClient (Prelude.Maybe [Prelude.Text])
createUserPoolClient_writeAttributes :: Lens' CreateUserPoolClient (Maybe [Text])
createUserPoolClient_writeAttributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Maybe [Text]
writeAttributes :: Maybe [Text]
$sel:writeAttributes:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
writeAttributes} -> Maybe [Text]
writeAttributes) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Maybe [Text]
a -> CreateUserPoolClient
s {$sel:writeAttributes:CreateUserPoolClient' :: Maybe [Text]
writeAttributes = Maybe [Text]
a} :: CreateUserPoolClient) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The user pool ID for the user pool where you want to create a user pool
-- client.
createUserPoolClient_userPoolId :: Lens.Lens' CreateUserPoolClient Prelude.Text
createUserPoolClient_userPoolId :: Lens' CreateUserPoolClient Text
createUserPoolClient_userPoolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Text
userPoolId :: Text
$sel:userPoolId:CreateUserPoolClient' :: CreateUserPoolClient -> Text
userPoolId} -> Text
userPoolId) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Text
a -> CreateUserPoolClient
s {$sel:userPoolId:CreateUserPoolClient' :: Text
userPoolId = Text
a} :: CreateUserPoolClient)

-- | The client name for the user pool client you would like to create.
createUserPoolClient_clientName :: Lens.Lens' CreateUserPoolClient Prelude.Text
createUserPoolClient_clientName :: Lens' CreateUserPoolClient Text
createUserPoolClient_clientName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClient' {Text
clientName :: Text
$sel:clientName:CreateUserPoolClient' :: CreateUserPoolClient -> Text
clientName} -> Text
clientName) (\s :: CreateUserPoolClient
s@CreateUserPoolClient' {} Text
a -> CreateUserPoolClient
s {$sel:clientName:CreateUserPoolClient' :: Text
clientName = Text
a} :: CreateUserPoolClient)

instance Core.AWSRequest CreateUserPoolClient where
  type
    AWSResponse CreateUserPoolClient =
      CreateUserPoolClientResponse
  request :: (Service -> Service)
-> CreateUserPoolClient -> Request CreateUserPoolClient
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateUserPoolClient
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateUserPoolClient)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe UserPoolClientType -> Int -> CreateUserPoolClientResponse
CreateUserPoolClientResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"UserPoolClient")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateUserPoolClient where
  hashWithSalt :: Int -> CreateUserPoolClient -> Int
hashWithSalt Int
_salt CreateUserPoolClient' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [ExplicitAuthFlowsType]
Maybe [OAuthFlowType]
Maybe Text
Maybe AnalyticsConfigurationType
Maybe PreventUserExistenceErrorTypes
Maybe TokenValidityUnitsType
Text
clientName :: Text
userPoolId :: Text
writeAttributes :: Maybe [Text]
tokenValidityUnits :: Maybe TokenValidityUnitsType
supportedIdentityProviders :: Maybe [Text]
refreshTokenValidity :: Maybe Natural
readAttributes :: Maybe [Text]
preventUserExistenceErrors :: Maybe PreventUserExistenceErrorTypes
logoutURLs :: Maybe [Text]
idTokenValidity :: Maybe Natural
generateSecret :: Maybe Bool
explicitAuthFlows :: Maybe [ExplicitAuthFlowsType]
enableTokenRevocation :: Maybe Bool
enablePropagateAdditionalUserContextData :: Maybe Bool
defaultRedirectURI :: Maybe Text
callbackURLs :: Maybe [Text]
authSessionValidity :: Maybe Natural
analyticsConfiguration :: Maybe AnalyticsConfigurationType
allowedOAuthScopes :: Maybe [Text]
allowedOAuthFlowsUserPoolClient :: Maybe Bool
allowedOAuthFlows :: Maybe [OAuthFlowType]
accessTokenValidity :: Maybe Natural
$sel:clientName:CreateUserPoolClient' :: CreateUserPoolClient -> Text
$sel:userPoolId:CreateUserPoolClient' :: CreateUserPoolClient -> Text
$sel:writeAttributes:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
$sel:tokenValidityUnits:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe TokenValidityUnitsType
$sel:supportedIdentityProviders:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
$sel:refreshTokenValidity:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Natural
$sel:readAttributes:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
$sel:preventUserExistenceErrors:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe PreventUserExistenceErrorTypes
$sel:logoutURLs:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
$sel:idTokenValidity:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Natural
$sel:generateSecret:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Bool
$sel:explicitAuthFlows:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [ExplicitAuthFlowsType]
$sel:enableTokenRevocation:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Bool
$sel:enablePropagateAdditionalUserContextData:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Bool
$sel:defaultRedirectURI:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Text
$sel:callbackURLs:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
$sel:authSessionValidity:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Natural
$sel:analyticsConfiguration:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe AnalyticsConfigurationType
$sel:allowedOAuthScopes:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
$sel:allowedOAuthFlowsUserPoolClient:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Bool
$sel:allowedOAuthFlows:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [OAuthFlowType]
$sel:accessTokenValidity:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
accessTokenValidity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [OAuthFlowType]
allowedOAuthFlows
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
allowedOAuthFlowsUserPoolClient
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
allowedOAuthScopes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AnalyticsConfigurationType
analyticsConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
authSessionValidity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
callbackURLs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultRedirectURI
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enablePropagateAdditionalUserContextData
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enableTokenRevocation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ExplicitAuthFlowsType]
explicitAuthFlows
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
generateSecret
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
idTokenValidity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
logoutURLs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PreventUserExistenceErrorTypes
preventUserExistenceErrors
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
readAttributes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
refreshTokenValidity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
supportedIdentityProviders
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TokenValidityUnitsType
tokenValidityUnits
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
writeAttributes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
userPoolId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clientName

instance Prelude.NFData CreateUserPoolClient where
  rnf :: CreateUserPoolClient -> ()
rnf CreateUserPoolClient' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [ExplicitAuthFlowsType]
Maybe [OAuthFlowType]
Maybe Text
Maybe AnalyticsConfigurationType
Maybe PreventUserExistenceErrorTypes
Maybe TokenValidityUnitsType
Text
clientName :: Text
userPoolId :: Text
writeAttributes :: Maybe [Text]
tokenValidityUnits :: Maybe TokenValidityUnitsType
supportedIdentityProviders :: Maybe [Text]
refreshTokenValidity :: Maybe Natural
readAttributes :: Maybe [Text]
preventUserExistenceErrors :: Maybe PreventUserExistenceErrorTypes
logoutURLs :: Maybe [Text]
idTokenValidity :: Maybe Natural
generateSecret :: Maybe Bool
explicitAuthFlows :: Maybe [ExplicitAuthFlowsType]
enableTokenRevocation :: Maybe Bool
enablePropagateAdditionalUserContextData :: Maybe Bool
defaultRedirectURI :: Maybe Text
callbackURLs :: Maybe [Text]
authSessionValidity :: Maybe Natural
analyticsConfiguration :: Maybe AnalyticsConfigurationType
allowedOAuthScopes :: Maybe [Text]
allowedOAuthFlowsUserPoolClient :: Maybe Bool
allowedOAuthFlows :: Maybe [OAuthFlowType]
accessTokenValidity :: Maybe Natural
$sel:clientName:CreateUserPoolClient' :: CreateUserPoolClient -> Text
$sel:userPoolId:CreateUserPoolClient' :: CreateUserPoolClient -> Text
$sel:writeAttributes:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
$sel:tokenValidityUnits:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe TokenValidityUnitsType
$sel:supportedIdentityProviders:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
$sel:refreshTokenValidity:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Natural
$sel:readAttributes:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
$sel:preventUserExistenceErrors:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe PreventUserExistenceErrorTypes
$sel:logoutURLs:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
$sel:idTokenValidity:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Natural
$sel:generateSecret:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Bool
$sel:explicitAuthFlows:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [ExplicitAuthFlowsType]
$sel:enableTokenRevocation:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Bool
$sel:enablePropagateAdditionalUserContextData:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Bool
$sel:defaultRedirectURI:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Text
$sel:callbackURLs:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
$sel:authSessionValidity:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Natural
$sel:analyticsConfiguration:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe AnalyticsConfigurationType
$sel:allowedOAuthScopes:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
$sel:allowedOAuthFlowsUserPoolClient:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Bool
$sel:allowedOAuthFlows:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [OAuthFlowType]
$sel:accessTokenValidity:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
accessTokenValidity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [OAuthFlowType]
allowedOAuthFlows
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
allowedOAuthFlowsUserPoolClient
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
allowedOAuthScopes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AnalyticsConfigurationType
analyticsConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
authSessionValidity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
callbackURLs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultRedirectURI
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enablePropagateAdditionalUserContextData
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enableTokenRevocation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ExplicitAuthFlowsType]
explicitAuthFlows
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
generateSecret
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
idTokenValidity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
logoutURLs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PreventUserExistenceErrorTypes
preventUserExistenceErrors
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
readAttributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
refreshTokenValidity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
        Maybe [Text]
supportedIdentityProviders
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TokenValidityUnitsType
tokenValidityUnits
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
writeAttributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
userPoolId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clientName

instance Data.ToHeaders CreateUserPoolClient where
  toHeaders :: CreateUserPoolClient -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSCognitoIdentityProviderService.CreateUserPoolClient" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateUserPoolClient where
  toJSON :: CreateUserPoolClient -> Value
toJSON CreateUserPoolClient' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [ExplicitAuthFlowsType]
Maybe [OAuthFlowType]
Maybe Text
Maybe AnalyticsConfigurationType
Maybe PreventUserExistenceErrorTypes
Maybe TokenValidityUnitsType
Text
clientName :: Text
userPoolId :: Text
writeAttributes :: Maybe [Text]
tokenValidityUnits :: Maybe TokenValidityUnitsType
supportedIdentityProviders :: Maybe [Text]
refreshTokenValidity :: Maybe Natural
readAttributes :: Maybe [Text]
preventUserExistenceErrors :: Maybe PreventUserExistenceErrorTypes
logoutURLs :: Maybe [Text]
idTokenValidity :: Maybe Natural
generateSecret :: Maybe Bool
explicitAuthFlows :: Maybe [ExplicitAuthFlowsType]
enableTokenRevocation :: Maybe Bool
enablePropagateAdditionalUserContextData :: Maybe Bool
defaultRedirectURI :: Maybe Text
callbackURLs :: Maybe [Text]
authSessionValidity :: Maybe Natural
analyticsConfiguration :: Maybe AnalyticsConfigurationType
allowedOAuthScopes :: Maybe [Text]
allowedOAuthFlowsUserPoolClient :: Maybe Bool
allowedOAuthFlows :: Maybe [OAuthFlowType]
accessTokenValidity :: Maybe Natural
$sel:clientName:CreateUserPoolClient' :: CreateUserPoolClient -> Text
$sel:userPoolId:CreateUserPoolClient' :: CreateUserPoolClient -> Text
$sel:writeAttributes:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
$sel:tokenValidityUnits:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe TokenValidityUnitsType
$sel:supportedIdentityProviders:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
$sel:refreshTokenValidity:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Natural
$sel:readAttributes:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
$sel:preventUserExistenceErrors:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe PreventUserExistenceErrorTypes
$sel:logoutURLs:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
$sel:idTokenValidity:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Natural
$sel:generateSecret:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Bool
$sel:explicitAuthFlows:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [ExplicitAuthFlowsType]
$sel:enableTokenRevocation:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Bool
$sel:enablePropagateAdditionalUserContextData:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Bool
$sel:defaultRedirectURI:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Text
$sel:callbackURLs:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
$sel:authSessionValidity:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Natural
$sel:analyticsConfiguration:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe AnalyticsConfigurationType
$sel:allowedOAuthScopes:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [Text]
$sel:allowedOAuthFlowsUserPoolClient:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Bool
$sel:allowedOAuthFlows:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe [OAuthFlowType]
$sel:accessTokenValidity:CreateUserPoolClient' :: CreateUserPoolClient -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AccessTokenValidity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
accessTokenValidity,
            (Key
"AllowedOAuthFlows" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [OAuthFlowType]
allowedOAuthFlows,
            (Key
"AllowedOAuthFlowsUserPoolClient" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
allowedOAuthFlowsUserPoolClient,
            (Key
"AllowedOAuthScopes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
allowedOAuthScopes,
            (Key
"AnalyticsConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AnalyticsConfigurationType
analyticsConfiguration,
            (Key
"AuthSessionValidity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
authSessionValidity,
            (Key
"CallbackURLs" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
callbackURLs,
            (Key
"DefaultRedirectURI" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
defaultRedirectURI,
            (Key
"EnablePropagateAdditionalUserContextData" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enablePropagateAdditionalUserContextData,
            (Key
"EnableTokenRevocation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableTokenRevocation,
            (Key
"ExplicitAuthFlows" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ExplicitAuthFlowsType]
explicitAuthFlows,
            (Key
"GenerateSecret" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
generateSecret,
            (Key
"IdTokenValidity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
idTokenValidity,
            (Key
"LogoutURLs" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
logoutURLs,
            (Key
"PreventUserExistenceErrors" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PreventUserExistenceErrorTypes
preventUserExistenceErrors,
            (Key
"ReadAttributes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
readAttributes,
            (Key
"RefreshTokenValidity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
refreshTokenValidity,
            (Key
"SupportedIdentityProviders" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
supportedIdentityProviders,
            (Key
"TokenValidityUnits" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TokenValidityUnitsType
tokenValidityUnits,
            (Key
"WriteAttributes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
writeAttributes,
            forall a. a -> Maybe a
Prelude.Just (Key
"UserPoolId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
userPoolId),
            forall a. a -> Maybe a
Prelude.Just (Key
"ClientName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
clientName)
          ]
      )

instance Data.ToPath CreateUserPoolClient where
  toPath :: CreateUserPoolClient -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery CreateUserPoolClient where
  toQuery :: CreateUserPoolClient -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | Represents the response from the server to create a user pool client.
--
-- /See:/ 'newCreateUserPoolClientResponse' smart constructor.
data CreateUserPoolClientResponse = CreateUserPoolClientResponse'
  { -- | The user pool client that was just created.
    CreateUserPoolClientResponse -> Maybe UserPoolClientType
userPoolClient :: Prelude.Maybe UserPoolClientType,
    -- | The response's http status code.
    CreateUserPoolClientResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateUserPoolClientResponse
-> CreateUserPoolClientResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateUserPoolClientResponse
-> CreateUserPoolClientResponse -> Bool
$c/= :: CreateUserPoolClientResponse
-> CreateUserPoolClientResponse -> Bool
== :: CreateUserPoolClientResponse
-> CreateUserPoolClientResponse -> Bool
$c== :: CreateUserPoolClientResponse
-> CreateUserPoolClientResponse -> Bool
Prelude.Eq, Int -> CreateUserPoolClientResponse -> ShowS
[CreateUserPoolClientResponse] -> ShowS
CreateUserPoolClientResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateUserPoolClientResponse] -> ShowS
$cshowList :: [CreateUserPoolClientResponse] -> ShowS
show :: CreateUserPoolClientResponse -> String
$cshow :: CreateUserPoolClientResponse -> String
showsPrec :: Int -> CreateUserPoolClientResponse -> ShowS
$cshowsPrec :: Int -> CreateUserPoolClientResponse -> ShowS
Prelude.Show, forall x.
Rep CreateUserPoolClientResponse x -> CreateUserPoolClientResponse
forall x.
CreateUserPoolClientResponse -> Rep CreateUserPoolClientResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateUserPoolClientResponse x -> CreateUserPoolClientResponse
$cfrom :: forall x.
CreateUserPoolClientResponse -> Rep CreateUserPoolClientResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateUserPoolClientResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'userPoolClient', 'createUserPoolClientResponse_userPoolClient' - The user pool client that was just created.
--
-- 'httpStatus', 'createUserPoolClientResponse_httpStatus' - The response's http status code.
newCreateUserPoolClientResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateUserPoolClientResponse
newCreateUserPoolClientResponse :: Int -> CreateUserPoolClientResponse
newCreateUserPoolClientResponse Int
pHttpStatus_ =
  CreateUserPoolClientResponse'
    { $sel:userPoolClient:CreateUserPoolClientResponse' :: Maybe UserPoolClientType
userPoolClient =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateUserPoolClientResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The user pool client that was just created.
createUserPoolClientResponse_userPoolClient :: Lens.Lens' CreateUserPoolClientResponse (Prelude.Maybe UserPoolClientType)
createUserPoolClientResponse_userPoolClient :: Lens' CreateUserPoolClientResponse (Maybe UserPoolClientType)
createUserPoolClientResponse_userPoolClient = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClientResponse' {Maybe UserPoolClientType
userPoolClient :: Maybe UserPoolClientType
$sel:userPoolClient:CreateUserPoolClientResponse' :: CreateUserPoolClientResponse -> Maybe UserPoolClientType
userPoolClient} -> Maybe UserPoolClientType
userPoolClient) (\s :: CreateUserPoolClientResponse
s@CreateUserPoolClientResponse' {} Maybe UserPoolClientType
a -> CreateUserPoolClientResponse
s {$sel:userPoolClient:CreateUserPoolClientResponse' :: Maybe UserPoolClientType
userPoolClient = Maybe UserPoolClientType
a} :: CreateUserPoolClientResponse)

-- | The response's http status code.
createUserPoolClientResponse_httpStatus :: Lens.Lens' CreateUserPoolClientResponse Prelude.Int
createUserPoolClientResponse_httpStatus :: Lens' CreateUserPoolClientResponse Int
createUserPoolClientResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolClientResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateUserPoolClientResponse' :: CreateUserPoolClientResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateUserPoolClientResponse
s@CreateUserPoolClientResponse' {} Int
a -> CreateUserPoolClientResponse
s {$sel:httpStatus:CreateUserPoolClientResponse' :: Int
httpStatus = Int
a} :: CreateUserPoolClientResponse)

instance Prelude.NFData CreateUserPoolClientResponse where
  rnf :: CreateUserPoolClientResponse -> ()
rnf CreateUserPoolClientResponse' {Int
Maybe UserPoolClientType
httpStatus :: Int
userPoolClient :: Maybe UserPoolClientType
$sel:httpStatus:CreateUserPoolClientResponse' :: CreateUserPoolClientResponse -> Int
$sel:userPoolClient:CreateUserPoolClientResponse' :: CreateUserPoolClientResponse -> Maybe UserPoolClientType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe UserPoolClientType
userPoolClient
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus