{-# 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.UpdateUserPoolClient
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates the specified user pool app client with the specified
-- attributes. You can get a list of the current user pool app client
-- settings using
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_DescribeUserPoolClient.html DescribeUserPoolClient>.
--
-- If you don\'t provide a value for an attribute, it will be set to the
-- default value.
--
-- You can also use this operation to enable token revocation for user pool
-- clients. 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.UpdateUserPoolClient
  ( -- * Creating a Request
    UpdateUserPoolClient (..),
    newUpdateUserPoolClient,

    -- * Request Lenses
    updateUserPoolClient_refreshTokenValidity,
    updateUserPoolClient_explicitAuthFlows,
    updateUserPoolClient_supportedIdentityProviders,
    updateUserPoolClient_logoutURLs,
    updateUserPoolClient_allowedOAuthFlowsUserPoolClient,
    updateUserPoolClient_idTokenValidity,
    updateUserPoolClient_tokenValidityUnits,
    updateUserPoolClient_defaultRedirectURI,
    updateUserPoolClient_enableTokenRevocation,
    updateUserPoolClient_writeAttributes,
    updateUserPoolClient_preventUserExistenceErrors,
    updateUserPoolClient_accessTokenValidity,
    updateUserPoolClient_readAttributes,
    updateUserPoolClient_allowedOAuthScopes,
    updateUserPoolClient_allowedOAuthFlows,
    updateUserPoolClient_analyticsConfiguration,
    updateUserPoolClient_clientName,
    updateUserPoolClient_callbackURLs,
    updateUserPoolClient_userPoolId,
    updateUserPoolClient_clientId,

    -- * Destructuring the Response
    UpdateUserPoolClientResponse (..),
    newUpdateUserPoolClientResponse,

    -- * Response Lenses
    updateUserPoolClientResponse_userPoolClient,
    updateUserPoolClientResponse_httpStatus,
  )
where

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

-- | Represents the request to update the user pool client.
--
-- /See:/ 'newUpdateUserPoolClient' smart constructor.
data UpdateUserPoolClient = UpdateUserPoolClient'
  { -- | The time limit, in days, after which the refresh token is no longer
    -- valid and cannot be used.
    UpdateUserPoolClient -> Maybe Natural
refreshTokenValidity :: Prelude.Maybe Prelude.Natural,
    -- | The authentication flows that are supported by the user pool clients.
    -- Flow names without the @ALLOW_@ prefix are deprecated in favor of new
    -- names with the @ALLOW_@ prefix. Note that values with @ALLOW_@ prefix
    -- cannot be used along with values without @ALLOW_@ prefix.
    --
    -- 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, Cognito receives the password in the request instead of using
    --     the SRP (Secure Remote Password protocol) protocol to verify
    --     passwords.
    --
    -- -   @ALLOW_CUSTOM_AUTH@: Enable Lambda trigger based authentication.
    --
    -- -   @ALLOW_USER_PASSWORD_AUTH@: Enable user password-based
    --     authentication. In this flow, 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.
    UpdateUserPoolClient -> Maybe [ExplicitAuthFlowsType]
explicitAuthFlows :: Prelude.Maybe [ExplicitAuthFlowsType],
    -- | A list of provider names for the identity providers that are supported
    -- on this client.
    UpdateUserPoolClient -> Maybe [Text]
supportedIdentityProviders :: Prelude.Maybe [Prelude.Text],
    -- | A list of allowed logout URLs for the identity providers.
    UpdateUserPoolClient -> Maybe [Text]
logoutURLs :: Prelude.Maybe [Prelude.Text],
    -- | Set to true if the client is allowed to follow the OAuth protocol when
    -- interacting with Cognito user pools.
    UpdateUserPoolClient -> Maybe Bool
allowedOAuthFlowsUserPoolClient :: Prelude.Maybe Prelude.Bool,
    -- | The time limit, after which the ID token is no longer valid and cannot
    -- be used.
    UpdateUserPoolClient -> Maybe Natural
idTokenValidity :: Prelude.Maybe Prelude.Natural,
    -- | The units in which the validity times are represented in. Default for
    -- RefreshToken is days, and default for ID and access tokens are hours.
    UpdateUserPoolClient -> Maybe TokenValidityUnitsType
tokenValidityUnits :: Prelude.Maybe TokenValidityUnitsType,
    -- | 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.
    UpdateUserPoolClient -> Maybe Text
defaultRedirectURI :: Prelude.Maybe Prelude.Text,
    -- | Enables or disables token revocation. For more information about
    -- revoking tokens, see
    -- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_RevokeToken.html RevokeToken>.
    UpdateUserPoolClient -> Maybe Bool
enableTokenRevocation :: Prelude.Maybe Prelude.Bool,
    -- | The writeable attributes of the user pool.
    UpdateUserPoolClient -> Maybe [Text]
writeAttributes :: Prelude.Maybe [Prelude.Text],
    -- | Use this setting to choose which errors and responses are returned by
    -- Cognito APIs during authentication, account confirmation, and password
    -- recovery when the user does not exist in the user pool. When set to
    -- @ENABLED@ and the user does not exist, authentication returns an error
    -- indicating either the username or password was incorrect, and account
    -- confirmation and password recovery return a response indicating a code
    -- was sent to a simulated destination. When set to @LEGACY@, those APIs
    -- will return a @UserNotFoundException@ exception if the user does not
    -- exist in the user pool.
    --
    -- Valid values include:
    --
    -- -   @ENABLED@ - This prevents user existence-related errors.
    --
    -- -   @LEGACY@ - This represents the old behavior of Cognito where user
    --     existence related errors are not prevented.
    --
    -- After February 15th 2020, the value of @PreventUserExistenceErrors@ will
    -- default to @ENABLED@ for newly created user pool clients if no value is
    -- provided.
    UpdateUserPoolClient -> Maybe PreventUserExistenceErrorTypes
preventUserExistenceErrors :: Prelude.Maybe PreventUserExistenceErrorTypes,
    -- | The time limit, after which the access token is no longer valid and
    -- cannot be used.
    UpdateUserPoolClient -> Maybe Natural
accessTokenValidity :: Prelude.Maybe Prelude.Natural,
    -- | The read-only attributes of the user pool.
    UpdateUserPoolClient -> Maybe [Text]
readAttributes :: Prelude.Maybe [Prelude.Text],
    -- | 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.
    UpdateUserPoolClient -> Maybe [Text]
allowedOAuthScopes :: Prelude.Maybe [Prelude.Text],
    -- | The allowed OAuth flows.
    --
    -- Set to @code@ to initiate a code grant flow, which provides an
    -- authorization code as the response. This code can be exchanged for
    -- access tokens with the token endpoint.
    --
    -- Set to @implicit@ to specify that the client should get the access token
    -- (and, optionally, ID token, based on scopes) directly.
    --
    -- Set to @client_credentials@ to specify that the client should get the
    -- access token (and, optionally, ID token, based on scopes) from the token
    -- endpoint using a combination of client and client_secret.
    UpdateUserPoolClient -> Maybe [OAuthFlowType]
allowedOAuthFlows :: Prelude.Maybe [OAuthFlowType],
    -- | The Amazon Pinpoint analytics configuration for collecting metrics for
    -- this user pool.
    --
    -- In regions where Pinpoint is not available, Cognito User Pools only
    -- supports sending events to Amazon Pinpoint projects in us-east-1. In
    -- regions where Pinpoint is available, Cognito User Pools will support
    -- sending events to Amazon Pinpoint projects within that same region.
    UpdateUserPoolClient -> Maybe AnalyticsConfigurationType
analyticsConfiguration :: Prelude.Maybe AnalyticsConfigurationType,
    -- | The client name from the update user pool client request.
    UpdateUserPoolClient -> Maybe Text
clientName :: Prelude.Maybe Prelude.Text,
    -- | A list of allowed redirect (callback) URLs for the identity providers.
    --
    -- 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.
    UpdateUserPoolClient -> Maybe [Text]
callbackURLs :: Prelude.Maybe [Prelude.Text],
    -- | The user pool ID for the user pool where you want to update the user
    -- pool client.
    UpdateUserPoolClient -> Text
userPoolId :: Prelude.Text,
    -- | The ID of the client associated with the user pool.
    UpdateUserPoolClient -> Sensitive Text
clientId :: Core.Sensitive Prelude.Text
  }
  deriving (UpdateUserPoolClient -> UpdateUserPoolClient -> Bool
(UpdateUserPoolClient -> UpdateUserPoolClient -> Bool)
-> (UpdateUserPoolClient -> UpdateUserPoolClient -> Bool)
-> Eq UpdateUserPoolClient
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateUserPoolClient -> UpdateUserPoolClient -> Bool
$c/= :: UpdateUserPoolClient -> UpdateUserPoolClient -> Bool
== :: UpdateUserPoolClient -> UpdateUserPoolClient -> Bool
$c== :: UpdateUserPoolClient -> UpdateUserPoolClient -> Bool
Prelude.Eq, Int -> UpdateUserPoolClient -> ShowS
[UpdateUserPoolClient] -> ShowS
UpdateUserPoolClient -> String
(Int -> UpdateUserPoolClient -> ShowS)
-> (UpdateUserPoolClient -> String)
-> ([UpdateUserPoolClient] -> ShowS)
-> Show UpdateUserPoolClient
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateUserPoolClient] -> ShowS
$cshowList :: [UpdateUserPoolClient] -> ShowS
show :: UpdateUserPoolClient -> String
$cshow :: UpdateUserPoolClient -> String
showsPrec :: Int -> UpdateUserPoolClient -> ShowS
$cshowsPrec :: Int -> UpdateUserPoolClient -> ShowS
Prelude.Show, (forall x. UpdateUserPoolClient -> Rep UpdateUserPoolClient x)
-> (forall x. Rep UpdateUserPoolClient x -> UpdateUserPoolClient)
-> Generic UpdateUserPoolClient
forall x. Rep UpdateUserPoolClient x -> UpdateUserPoolClient
forall x. UpdateUserPoolClient -> Rep UpdateUserPoolClient x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateUserPoolClient x -> UpdateUserPoolClient
$cfrom :: forall x. UpdateUserPoolClient -> Rep UpdateUserPoolClient x
Prelude.Generic)

-- |
-- Create a value of 'UpdateUserPoolClient' 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:
--
-- 'refreshTokenValidity', 'updateUserPoolClient_refreshTokenValidity' - The time limit, in days, after which the refresh token is no longer
-- valid and cannot be used.
--
-- 'explicitAuthFlows', 'updateUserPoolClient_explicitAuthFlows' - The authentication flows that are supported by the user pool clients.
-- Flow names without the @ALLOW_@ prefix are deprecated in favor of new
-- names with the @ALLOW_@ prefix. Note that values with @ALLOW_@ prefix
-- cannot be used along with values without @ALLOW_@ prefix.
--
-- 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, Cognito receives the password in the request instead of using
--     the SRP (Secure Remote Password protocol) protocol to verify
--     passwords.
--
-- -   @ALLOW_CUSTOM_AUTH@: Enable Lambda trigger based authentication.
--
-- -   @ALLOW_USER_PASSWORD_AUTH@: Enable user password-based
--     authentication. In this flow, 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.
--
-- 'supportedIdentityProviders', 'updateUserPoolClient_supportedIdentityProviders' - A list of provider names for the identity providers that are supported
-- on this client.
--
-- 'logoutURLs', 'updateUserPoolClient_logoutURLs' - A list of allowed logout URLs for the identity providers.
--
-- 'allowedOAuthFlowsUserPoolClient', 'updateUserPoolClient_allowedOAuthFlowsUserPoolClient' - Set to true if the client is allowed to follow the OAuth protocol when
-- interacting with Cognito user pools.
--
-- 'idTokenValidity', 'updateUserPoolClient_idTokenValidity' - The time limit, after which the ID token is no longer valid and cannot
-- be used.
--
-- 'tokenValidityUnits', 'updateUserPoolClient_tokenValidityUnits' - The units in which the validity times are represented in. Default for
-- RefreshToken is days, and default for ID and access tokens are hours.
--
-- 'defaultRedirectURI', 'updateUserPoolClient_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.
--
-- 'enableTokenRevocation', 'updateUserPoolClient_enableTokenRevocation' - Enables or disables token revocation. For more information about
-- revoking tokens, see
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_RevokeToken.html RevokeToken>.
--
-- 'writeAttributes', 'updateUserPoolClient_writeAttributes' - The writeable attributes of the user pool.
--
-- 'preventUserExistenceErrors', 'updateUserPoolClient_preventUserExistenceErrors' - Use this setting to choose which errors and responses are returned by
-- Cognito APIs during authentication, account confirmation, and password
-- recovery when the user does not exist in the user pool. When set to
-- @ENABLED@ and the user does not exist, authentication returns an error
-- indicating either the username or password was incorrect, and account
-- confirmation and password recovery return a response indicating a code
-- was sent to a simulated destination. When set to @LEGACY@, those APIs
-- will return a @UserNotFoundException@ exception if the user does not
-- exist in the user pool.
--
-- Valid values include:
--
-- -   @ENABLED@ - This prevents user existence-related errors.
--
-- -   @LEGACY@ - This represents the old behavior of Cognito where user
--     existence related errors are not prevented.
--
-- After February 15th 2020, the value of @PreventUserExistenceErrors@ will
-- default to @ENABLED@ for newly created user pool clients if no value is
-- provided.
--
-- 'accessTokenValidity', 'updateUserPoolClient_accessTokenValidity' - The time limit, after which the access token is no longer valid and
-- cannot be used.
--
-- 'readAttributes', 'updateUserPoolClient_readAttributes' - The read-only attributes of the user pool.
--
-- 'allowedOAuthScopes', 'updateUserPoolClient_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.
--
-- 'allowedOAuthFlows', 'updateUserPoolClient_allowedOAuthFlows' - The allowed OAuth flows.
--
-- Set to @code@ to initiate a code grant flow, which provides an
-- authorization code as the response. This code can be exchanged for
-- access tokens with the token endpoint.
--
-- Set to @implicit@ to specify that the client should get the access token
-- (and, optionally, ID token, based on scopes) directly.
--
-- Set to @client_credentials@ to specify that the client should get the
-- access token (and, optionally, ID token, based on scopes) from the token
-- endpoint using a combination of client and client_secret.
--
-- 'analyticsConfiguration', 'updateUserPoolClient_analyticsConfiguration' - The Amazon Pinpoint analytics configuration for collecting metrics for
-- this user pool.
--
-- In regions where Pinpoint is not available, Cognito User Pools only
-- supports sending events to Amazon Pinpoint projects in us-east-1. In
-- regions where Pinpoint is available, Cognito User Pools will support
-- sending events to Amazon Pinpoint projects within that same region.
--
-- 'clientName', 'updateUserPoolClient_clientName' - The client name from the update user pool client request.
--
-- 'callbackURLs', 'updateUserPoolClient_callbackURLs' - A list of allowed redirect (callback) URLs for the identity providers.
--
-- 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.
--
-- 'userPoolId', 'updateUserPoolClient_userPoolId' - The user pool ID for the user pool where you want to update the user
-- pool client.
--
-- 'clientId', 'updateUserPoolClient_clientId' - The ID of the client associated with the user pool.
newUpdateUserPoolClient ::
  -- | 'userPoolId'
  Prelude.Text ->
  -- | 'clientId'
  Prelude.Text ->
  UpdateUserPoolClient
newUpdateUserPoolClient :: Text -> Text -> UpdateUserPoolClient
newUpdateUserPoolClient Text
pUserPoolId_ Text
pClientId_ =
  UpdateUserPoolClient' :: Maybe Natural
-> Maybe [ExplicitAuthFlowsType]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Bool
-> Maybe Natural
-> Maybe TokenValidityUnitsType
-> Maybe Text
-> Maybe Bool
-> Maybe [Text]
-> Maybe PreventUserExistenceErrorTypes
-> Maybe Natural
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [OAuthFlowType]
-> Maybe AnalyticsConfigurationType
-> Maybe Text
-> Maybe [Text]
-> Text
-> Sensitive Text
-> UpdateUserPoolClient
UpdateUserPoolClient'
    { $sel:refreshTokenValidity:UpdateUserPoolClient' :: Maybe Natural
refreshTokenValidity =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:explicitAuthFlows:UpdateUserPoolClient' :: Maybe [ExplicitAuthFlowsType]
explicitAuthFlows = Maybe [ExplicitAuthFlowsType]
forall a. Maybe a
Prelude.Nothing,
      $sel:supportedIdentityProviders:UpdateUserPoolClient' :: Maybe [Text]
supportedIdentityProviders = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:logoutURLs:UpdateUserPoolClient' :: Maybe [Text]
logoutURLs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:allowedOAuthFlowsUserPoolClient:UpdateUserPoolClient' :: Maybe Bool
allowedOAuthFlowsUserPoolClient = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:idTokenValidity:UpdateUserPoolClient' :: Maybe Natural
idTokenValidity = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:tokenValidityUnits:UpdateUserPoolClient' :: Maybe TokenValidityUnitsType
tokenValidityUnits = Maybe TokenValidityUnitsType
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultRedirectURI:UpdateUserPoolClient' :: Maybe Text
defaultRedirectURI = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enableTokenRevocation:UpdateUserPoolClient' :: Maybe Bool
enableTokenRevocation = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:writeAttributes:UpdateUserPoolClient' :: Maybe [Text]
writeAttributes = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:preventUserExistenceErrors:UpdateUserPoolClient' :: Maybe PreventUserExistenceErrorTypes
preventUserExistenceErrors = Maybe PreventUserExistenceErrorTypes
forall a. Maybe a
Prelude.Nothing,
      $sel:accessTokenValidity:UpdateUserPoolClient' :: Maybe Natural
accessTokenValidity = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:readAttributes:UpdateUserPoolClient' :: Maybe [Text]
readAttributes = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:allowedOAuthScopes:UpdateUserPoolClient' :: Maybe [Text]
allowedOAuthScopes = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:allowedOAuthFlows:UpdateUserPoolClient' :: Maybe [OAuthFlowType]
allowedOAuthFlows = Maybe [OAuthFlowType]
forall a. Maybe a
Prelude.Nothing,
      $sel:analyticsConfiguration:UpdateUserPoolClient' :: Maybe AnalyticsConfigurationType
analyticsConfiguration = Maybe AnalyticsConfigurationType
forall a. Maybe a
Prelude.Nothing,
      $sel:clientName:UpdateUserPoolClient' :: Maybe Text
clientName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:callbackURLs:UpdateUserPoolClient' :: Maybe [Text]
callbackURLs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolId:UpdateUserPoolClient' :: Text
userPoolId = Text
pUserPoolId_,
      $sel:clientId:UpdateUserPoolClient' :: Sensitive Text
clientId = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pClientId_
    }

-- | The time limit, in days, after which the refresh token is no longer
-- valid and cannot be used.
updateUserPoolClient_refreshTokenValidity :: Lens.Lens' UpdateUserPoolClient (Prelude.Maybe Prelude.Natural)
updateUserPoolClient_refreshTokenValidity :: (Maybe Natural -> f (Maybe Natural))
-> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_refreshTokenValidity = (UpdateUserPoolClient -> Maybe Natural)
-> (UpdateUserPoolClient -> Maybe Natural -> UpdateUserPoolClient)
-> Lens
     UpdateUserPoolClient
     UpdateUserPoolClient
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Maybe Natural
refreshTokenValidity :: Maybe Natural
$sel:refreshTokenValidity:UpdateUserPoolClient' :: UpdateUserPoolClient -> Maybe Natural
refreshTokenValidity} -> Maybe Natural
refreshTokenValidity) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Maybe Natural
a -> UpdateUserPoolClient
s {$sel:refreshTokenValidity:UpdateUserPoolClient' :: Maybe Natural
refreshTokenValidity = Maybe Natural
a} :: UpdateUserPoolClient)

-- | The authentication flows that are supported by the user pool clients.
-- Flow names without the @ALLOW_@ prefix are deprecated in favor of new
-- names with the @ALLOW_@ prefix. Note that values with @ALLOW_@ prefix
-- cannot be used along with values without @ALLOW_@ prefix.
--
-- 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, Cognito receives the password in the request instead of using
--     the SRP (Secure Remote Password protocol) protocol to verify
--     passwords.
--
-- -   @ALLOW_CUSTOM_AUTH@: Enable Lambda trigger based authentication.
--
-- -   @ALLOW_USER_PASSWORD_AUTH@: Enable user password-based
--     authentication. In this flow, 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.
updateUserPoolClient_explicitAuthFlows :: Lens.Lens' UpdateUserPoolClient (Prelude.Maybe [ExplicitAuthFlowsType])
updateUserPoolClient_explicitAuthFlows :: (Maybe [ExplicitAuthFlowsType]
 -> f (Maybe [ExplicitAuthFlowsType]))
-> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_explicitAuthFlows = (UpdateUserPoolClient -> Maybe [ExplicitAuthFlowsType])
-> (UpdateUserPoolClient
    -> Maybe [ExplicitAuthFlowsType] -> UpdateUserPoolClient)
-> Lens
     UpdateUserPoolClient
     UpdateUserPoolClient
     (Maybe [ExplicitAuthFlowsType])
     (Maybe [ExplicitAuthFlowsType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Maybe [ExplicitAuthFlowsType]
explicitAuthFlows :: Maybe [ExplicitAuthFlowsType]
$sel:explicitAuthFlows:UpdateUserPoolClient' :: UpdateUserPoolClient -> Maybe [ExplicitAuthFlowsType]
explicitAuthFlows} -> Maybe [ExplicitAuthFlowsType]
explicitAuthFlows) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Maybe [ExplicitAuthFlowsType]
a -> UpdateUserPoolClient
s {$sel:explicitAuthFlows:UpdateUserPoolClient' :: Maybe [ExplicitAuthFlowsType]
explicitAuthFlows = Maybe [ExplicitAuthFlowsType]
a} :: UpdateUserPoolClient) ((Maybe [ExplicitAuthFlowsType]
  -> f (Maybe [ExplicitAuthFlowsType]))
 -> UpdateUserPoolClient -> f UpdateUserPoolClient)
-> ((Maybe [ExplicitAuthFlowsType]
     -> f (Maybe [ExplicitAuthFlowsType]))
    -> Maybe [ExplicitAuthFlowsType]
    -> f (Maybe [ExplicitAuthFlowsType]))
-> (Maybe [ExplicitAuthFlowsType]
    -> f (Maybe [ExplicitAuthFlowsType]))
-> UpdateUserPoolClient
-> f UpdateUserPoolClient
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ExplicitAuthFlowsType]
  [ExplicitAuthFlowsType]
  [ExplicitAuthFlowsType]
  [ExplicitAuthFlowsType]
-> Iso
     (Maybe [ExplicitAuthFlowsType])
     (Maybe [ExplicitAuthFlowsType])
     (Maybe [ExplicitAuthFlowsType])
     (Maybe [ExplicitAuthFlowsType])
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 AnIso
  [ExplicitAuthFlowsType]
  [ExplicitAuthFlowsType]
  [ExplicitAuthFlowsType]
  [ExplicitAuthFlowsType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of provider names for the identity providers that are supported
-- on this client.
updateUserPoolClient_supportedIdentityProviders :: Lens.Lens' UpdateUserPoolClient (Prelude.Maybe [Prelude.Text])
updateUserPoolClient_supportedIdentityProviders :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_supportedIdentityProviders = (UpdateUserPoolClient -> Maybe [Text])
-> (UpdateUserPoolClient -> Maybe [Text] -> UpdateUserPoolClient)
-> Lens
     UpdateUserPoolClient
     UpdateUserPoolClient
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Maybe [Text]
supportedIdentityProviders :: Maybe [Text]
$sel:supportedIdentityProviders:UpdateUserPoolClient' :: UpdateUserPoolClient -> Maybe [Text]
supportedIdentityProviders} -> Maybe [Text]
supportedIdentityProviders) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Maybe [Text]
a -> UpdateUserPoolClient
s {$sel:supportedIdentityProviders:UpdateUserPoolClient' :: Maybe [Text]
supportedIdentityProviders = Maybe [Text]
a} :: UpdateUserPoolClient) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateUserPoolClient -> f UpdateUserPoolClient)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateUserPoolClient
-> f UpdateUserPoolClient
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of allowed logout URLs for the identity providers.
updateUserPoolClient_logoutURLs :: Lens.Lens' UpdateUserPoolClient (Prelude.Maybe [Prelude.Text])
updateUserPoolClient_logoutURLs :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_logoutURLs = (UpdateUserPoolClient -> Maybe [Text])
-> (UpdateUserPoolClient -> Maybe [Text] -> UpdateUserPoolClient)
-> Lens
     UpdateUserPoolClient
     UpdateUserPoolClient
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Maybe [Text]
logoutURLs :: Maybe [Text]
$sel:logoutURLs:UpdateUserPoolClient' :: UpdateUserPoolClient -> Maybe [Text]
logoutURLs} -> Maybe [Text]
logoutURLs) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Maybe [Text]
a -> UpdateUserPoolClient
s {$sel:logoutURLs:UpdateUserPoolClient' :: Maybe [Text]
logoutURLs = Maybe [Text]
a} :: UpdateUserPoolClient) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateUserPoolClient -> f UpdateUserPoolClient)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateUserPoolClient
-> f UpdateUserPoolClient
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
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 Cognito user pools.
updateUserPoolClient_allowedOAuthFlowsUserPoolClient :: Lens.Lens' UpdateUserPoolClient (Prelude.Maybe Prelude.Bool)
updateUserPoolClient_allowedOAuthFlowsUserPoolClient :: (Maybe Bool -> f (Maybe Bool))
-> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_allowedOAuthFlowsUserPoolClient = (UpdateUserPoolClient -> Maybe Bool)
-> (UpdateUserPoolClient -> Maybe Bool -> UpdateUserPoolClient)
-> Lens
     UpdateUserPoolClient UpdateUserPoolClient (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Maybe Bool
allowedOAuthFlowsUserPoolClient :: Maybe Bool
$sel:allowedOAuthFlowsUserPoolClient:UpdateUserPoolClient' :: UpdateUserPoolClient -> Maybe Bool
allowedOAuthFlowsUserPoolClient} -> Maybe Bool
allowedOAuthFlowsUserPoolClient) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Maybe Bool
a -> UpdateUserPoolClient
s {$sel:allowedOAuthFlowsUserPoolClient:UpdateUserPoolClient' :: Maybe Bool
allowedOAuthFlowsUserPoolClient = Maybe Bool
a} :: UpdateUserPoolClient)

-- | The time limit, after which the ID token is no longer valid and cannot
-- be used.
updateUserPoolClient_idTokenValidity :: Lens.Lens' UpdateUserPoolClient (Prelude.Maybe Prelude.Natural)
updateUserPoolClient_idTokenValidity :: (Maybe Natural -> f (Maybe Natural))
-> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_idTokenValidity = (UpdateUserPoolClient -> Maybe Natural)
-> (UpdateUserPoolClient -> Maybe Natural -> UpdateUserPoolClient)
-> Lens
     UpdateUserPoolClient
     UpdateUserPoolClient
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Maybe Natural
idTokenValidity :: Maybe Natural
$sel:idTokenValidity:UpdateUserPoolClient' :: UpdateUserPoolClient -> Maybe Natural
idTokenValidity} -> Maybe Natural
idTokenValidity) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Maybe Natural
a -> UpdateUserPoolClient
s {$sel:idTokenValidity:UpdateUserPoolClient' :: Maybe Natural
idTokenValidity = Maybe Natural
a} :: UpdateUserPoolClient)

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

-- | 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.
updateUserPoolClient_defaultRedirectURI :: Lens.Lens' UpdateUserPoolClient (Prelude.Maybe Prelude.Text)
updateUserPoolClient_defaultRedirectURI :: (Maybe Text -> f (Maybe Text))
-> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_defaultRedirectURI = (UpdateUserPoolClient -> Maybe Text)
-> (UpdateUserPoolClient -> Maybe Text -> UpdateUserPoolClient)
-> Lens
     UpdateUserPoolClient UpdateUserPoolClient (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Maybe Text
defaultRedirectURI :: Maybe Text
$sel:defaultRedirectURI:UpdateUserPoolClient' :: UpdateUserPoolClient -> Maybe Text
defaultRedirectURI} -> Maybe Text
defaultRedirectURI) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Maybe Text
a -> UpdateUserPoolClient
s {$sel:defaultRedirectURI:UpdateUserPoolClient' :: Maybe Text
defaultRedirectURI = Maybe Text
a} :: UpdateUserPoolClient)

-- | Enables or disables token revocation. For more information about
-- revoking tokens, see
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_RevokeToken.html RevokeToken>.
updateUserPoolClient_enableTokenRevocation :: Lens.Lens' UpdateUserPoolClient (Prelude.Maybe Prelude.Bool)
updateUserPoolClient_enableTokenRevocation :: (Maybe Bool -> f (Maybe Bool))
-> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_enableTokenRevocation = (UpdateUserPoolClient -> Maybe Bool)
-> (UpdateUserPoolClient -> Maybe Bool -> UpdateUserPoolClient)
-> Lens
     UpdateUserPoolClient UpdateUserPoolClient (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Maybe Bool
enableTokenRevocation :: Maybe Bool
$sel:enableTokenRevocation:UpdateUserPoolClient' :: UpdateUserPoolClient -> Maybe Bool
enableTokenRevocation} -> Maybe Bool
enableTokenRevocation) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Maybe Bool
a -> UpdateUserPoolClient
s {$sel:enableTokenRevocation:UpdateUserPoolClient' :: Maybe Bool
enableTokenRevocation = Maybe Bool
a} :: UpdateUserPoolClient)

-- | The writeable attributes of the user pool.
updateUserPoolClient_writeAttributes :: Lens.Lens' UpdateUserPoolClient (Prelude.Maybe [Prelude.Text])
updateUserPoolClient_writeAttributes :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_writeAttributes = (UpdateUserPoolClient -> Maybe [Text])
-> (UpdateUserPoolClient -> Maybe [Text] -> UpdateUserPoolClient)
-> Lens
     UpdateUserPoolClient
     UpdateUserPoolClient
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Maybe [Text]
writeAttributes :: Maybe [Text]
$sel:writeAttributes:UpdateUserPoolClient' :: UpdateUserPoolClient -> Maybe [Text]
writeAttributes} -> Maybe [Text]
writeAttributes) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Maybe [Text]
a -> UpdateUserPoolClient
s {$sel:writeAttributes:UpdateUserPoolClient' :: Maybe [Text]
writeAttributes = Maybe [Text]
a} :: UpdateUserPoolClient) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateUserPoolClient -> f UpdateUserPoolClient)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateUserPoolClient
-> f UpdateUserPoolClient
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Use this setting to choose which errors and responses are returned by
-- Cognito APIs during authentication, account confirmation, and password
-- recovery when the user does not exist in the user pool. When set to
-- @ENABLED@ and the user does not exist, authentication returns an error
-- indicating either the username or password was incorrect, and account
-- confirmation and password recovery return a response indicating a code
-- was sent to a simulated destination. When set to @LEGACY@, those APIs
-- will return a @UserNotFoundException@ exception if the user does not
-- exist in the user pool.
--
-- Valid values include:
--
-- -   @ENABLED@ - This prevents user existence-related errors.
--
-- -   @LEGACY@ - This represents the old behavior of Cognito where user
--     existence related errors are not prevented.
--
-- After February 15th 2020, the value of @PreventUserExistenceErrors@ will
-- default to @ENABLED@ for newly created user pool clients if no value is
-- provided.
updateUserPoolClient_preventUserExistenceErrors :: Lens.Lens' UpdateUserPoolClient (Prelude.Maybe PreventUserExistenceErrorTypes)
updateUserPoolClient_preventUserExistenceErrors :: (Maybe PreventUserExistenceErrorTypes
 -> f (Maybe PreventUserExistenceErrorTypes))
-> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_preventUserExistenceErrors = (UpdateUserPoolClient -> Maybe PreventUserExistenceErrorTypes)
-> (UpdateUserPoolClient
    -> Maybe PreventUserExistenceErrorTypes -> UpdateUserPoolClient)
-> Lens
     UpdateUserPoolClient
     UpdateUserPoolClient
     (Maybe PreventUserExistenceErrorTypes)
     (Maybe PreventUserExistenceErrorTypes)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Maybe PreventUserExistenceErrorTypes
preventUserExistenceErrors :: Maybe PreventUserExistenceErrorTypes
$sel:preventUserExistenceErrors:UpdateUserPoolClient' :: UpdateUserPoolClient -> Maybe PreventUserExistenceErrorTypes
preventUserExistenceErrors} -> Maybe PreventUserExistenceErrorTypes
preventUserExistenceErrors) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Maybe PreventUserExistenceErrorTypes
a -> UpdateUserPoolClient
s {$sel:preventUserExistenceErrors:UpdateUserPoolClient' :: Maybe PreventUserExistenceErrorTypes
preventUserExistenceErrors = Maybe PreventUserExistenceErrorTypes
a} :: UpdateUserPoolClient)

-- | The time limit, after which the access token is no longer valid and
-- cannot be used.
updateUserPoolClient_accessTokenValidity :: Lens.Lens' UpdateUserPoolClient (Prelude.Maybe Prelude.Natural)
updateUserPoolClient_accessTokenValidity :: (Maybe Natural -> f (Maybe Natural))
-> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_accessTokenValidity = (UpdateUserPoolClient -> Maybe Natural)
-> (UpdateUserPoolClient -> Maybe Natural -> UpdateUserPoolClient)
-> Lens
     UpdateUserPoolClient
     UpdateUserPoolClient
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Maybe Natural
accessTokenValidity :: Maybe Natural
$sel:accessTokenValidity:UpdateUserPoolClient' :: UpdateUserPoolClient -> Maybe Natural
accessTokenValidity} -> Maybe Natural
accessTokenValidity) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Maybe Natural
a -> UpdateUserPoolClient
s {$sel:accessTokenValidity:UpdateUserPoolClient' :: Maybe Natural
accessTokenValidity = Maybe Natural
a} :: UpdateUserPoolClient)

-- | The read-only attributes of the user pool.
updateUserPoolClient_readAttributes :: Lens.Lens' UpdateUserPoolClient (Prelude.Maybe [Prelude.Text])
updateUserPoolClient_readAttributes :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_readAttributes = (UpdateUserPoolClient -> Maybe [Text])
-> (UpdateUserPoolClient -> Maybe [Text] -> UpdateUserPoolClient)
-> Lens
     UpdateUserPoolClient
     UpdateUserPoolClient
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Maybe [Text]
readAttributes :: Maybe [Text]
$sel:readAttributes:UpdateUserPoolClient' :: UpdateUserPoolClient -> Maybe [Text]
readAttributes} -> Maybe [Text]
readAttributes) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Maybe [Text]
a -> UpdateUserPoolClient
s {$sel:readAttributes:UpdateUserPoolClient' :: Maybe [Text]
readAttributes = Maybe [Text]
a} :: UpdateUserPoolClient) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateUserPoolClient -> f UpdateUserPoolClient)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateUserPoolClient
-> f UpdateUserPoolClient
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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.
updateUserPoolClient_allowedOAuthScopes :: Lens.Lens' UpdateUserPoolClient (Prelude.Maybe [Prelude.Text])
updateUserPoolClient_allowedOAuthScopes :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_allowedOAuthScopes = (UpdateUserPoolClient -> Maybe [Text])
-> (UpdateUserPoolClient -> Maybe [Text] -> UpdateUserPoolClient)
-> Lens
     UpdateUserPoolClient
     UpdateUserPoolClient
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Maybe [Text]
allowedOAuthScopes :: Maybe [Text]
$sel:allowedOAuthScopes:UpdateUserPoolClient' :: UpdateUserPoolClient -> Maybe [Text]
allowedOAuthScopes} -> Maybe [Text]
allowedOAuthScopes) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Maybe [Text]
a -> UpdateUserPoolClient
s {$sel:allowedOAuthScopes:UpdateUserPoolClient' :: Maybe [Text]
allowedOAuthScopes = Maybe [Text]
a} :: UpdateUserPoolClient) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateUserPoolClient -> f UpdateUserPoolClient)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateUserPoolClient
-> f UpdateUserPoolClient
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The allowed OAuth flows.
--
-- Set to @code@ to initiate a code grant flow, which provides an
-- authorization code as the response. This code can be exchanged for
-- access tokens with the token endpoint.
--
-- Set to @implicit@ to specify that the client should get the access token
-- (and, optionally, ID token, based on scopes) directly.
--
-- Set to @client_credentials@ to specify that the client should get the
-- access token (and, optionally, ID token, based on scopes) from the token
-- endpoint using a combination of client and client_secret.
updateUserPoolClient_allowedOAuthFlows :: Lens.Lens' UpdateUserPoolClient (Prelude.Maybe [OAuthFlowType])
updateUserPoolClient_allowedOAuthFlows :: (Maybe [OAuthFlowType] -> f (Maybe [OAuthFlowType]))
-> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_allowedOAuthFlows = (UpdateUserPoolClient -> Maybe [OAuthFlowType])
-> (UpdateUserPoolClient
    -> Maybe [OAuthFlowType] -> UpdateUserPoolClient)
-> Lens
     UpdateUserPoolClient
     UpdateUserPoolClient
     (Maybe [OAuthFlowType])
     (Maybe [OAuthFlowType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Maybe [OAuthFlowType]
allowedOAuthFlows :: Maybe [OAuthFlowType]
$sel:allowedOAuthFlows:UpdateUserPoolClient' :: UpdateUserPoolClient -> Maybe [OAuthFlowType]
allowedOAuthFlows} -> Maybe [OAuthFlowType]
allowedOAuthFlows) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Maybe [OAuthFlowType]
a -> UpdateUserPoolClient
s {$sel:allowedOAuthFlows:UpdateUserPoolClient' :: Maybe [OAuthFlowType]
allowedOAuthFlows = Maybe [OAuthFlowType]
a} :: UpdateUserPoolClient) ((Maybe [OAuthFlowType] -> f (Maybe [OAuthFlowType]))
 -> UpdateUserPoolClient -> f UpdateUserPoolClient)
-> ((Maybe [OAuthFlowType] -> f (Maybe [OAuthFlowType]))
    -> Maybe [OAuthFlowType] -> f (Maybe [OAuthFlowType]))
-> (Maybe [OAuthFlowType] -> f (Maybe [OAuthFlowType]))
-> UpdateUserPoolClient
-> f UpdateUserPoolClient
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [OAuthFlowType] [OAuthFlowType] [OAuthFlowType] [OAuthFlowType]
-> Iso
     (Maybe [OAuthFlowType])
     (Maybe [OAuthFlowType])
     (Maybe [OAuthFlowType])
     (Maybe [OAuthFlowType])
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 AnIso
  [OAuthFlowType] [OAuthFlowType] [OAuthFlowType] [OAuthFlowType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Pinpoint analytics configuration for collecting metrics for
-- this user pool.
--
-- In regions where Pinpoint is not available, Cognito User Pools only
-- supports sending events to Amazon Pinpoint projects in us-east-1. In
-- regions where Pinpoint is available, Cognito User Pools will support
-- sending events to Amazon Pinpoint projects within that same region.
updateUserPoolClient_analyticsConfiguration :: Lens.Lens' UpdateUserPoolClient (Prelude.Maybe AnalyticsConfigurationType)
updateUserPoolClient_analyticsConfiguration :: (Maybe AnalyticsConfigurationType
 -> f (Maybe AnalyticsConfigurationType))
-> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_analyticsConfiguration = (UpdateUserPoolClient -> Maybe AnalyticsConfigurationType)
-> (UpdateUserPoolClient
    -> Maybe AnalyticsConfigurationType -> UpdateUserPoolClient)
-> Lens
     UpdateUserPoolClient
     UpdateUserPoolClient
     (Maybe AnalyticsConfigurationType)
     (Maybe AnalyticsConfigurationType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Maybe AnalyticsConfigurationType
analyticsConfiguration :: Maybe AnalyticsConfigurationType
$sel:analyticsConfiguration:UpdateUserPoolClient' :: UpdateUserPoolClient -> Maybe AnalyticsConfigurationType
analyticsConfiguration} -> Maybe AnalyticsConfigurationType
analyticsConfiguration) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Maybe AnalyticsConfigurationType
a -> UpdateUserPoolClient
s {$sel:analyticsConfiguration:UpdateUserPoolClient' :: Maybe AnalyticsConfigurationType
analyticsConfiguration = Maybe AnalyticsConfigurationType
a} :: UpdateUserPoolClient)

-- | The client name from the update user pool client request.
updateUserPoolClient_clientName :: Lens.Lens' UpdateUserPoolClient (Prelude.Maybe Prelude.Text)
updateUserPoolClient_clientName :: (Maybe Text -> f (Maybe Text))
-> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_clientName = (UpdateUserPoolClient -> Maybe Text)
-> (UpdateUserPoolClient -> Maybe Text -> UpdateUserPoolClient)
-> Lens
     UpdateUserPoolClient UpdateUserPoolClient (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Maybe Text
clientName :: Maybe Text
$sel:clientName:UpdateUserPoolClient' :: UpdateUserPoolClient -> Maybe Text
clientName} -> Maybe Text
clientName) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Maybe Text
a -> UpdateUserPoolClient
s {$sel:clientName:UpdateUserPoolClient' :: Maybe Text
clientName = Maybe Text
a} :: UpdateUserPoolClient)

-- | A list of allowed redirect (callback) URLs for the identity providers.
--
-- 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.
updateUserPoolClient_callbackURLs :: Lens.Lens' UpdateUserPoolClient (Prelude.Maybe [Prelude.Text])
updateUserPoolClient_callbackURLs :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_callbackURLs = (UpdateUserPoolClient -> Maybe [Text])
-> (UpdateUserPoolClient -> Maybe [Text] -> UpdateUserPoolClient)
-> Lens
     UpdateUserPoolClient
     UpdateUserPoolClient
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Maybe [Text]
callbackURLs :: Maybe [Text]
$sel:callbackURLs:UpdateUserPoolClient' :: UpdateUserPoolClient -> Maybe [Text]
callbackURLs} -> Maybe [Text]
callbackURLs) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Maybe [Text]
a -> UpdateUserPoolClient
s {$sel:callbackURLs:UpdateUserPoolClient' :: Maybe [Text]
callbackURLs = Maybe [Text]
a} :: UpdateUserPoolClient) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateUserPoolClient -> f UpdateUserPoolClient)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateUserPoolClient
-> f UpdateUserPoolClient
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
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 update the user
-- pool client.
updateUserPoolClient_userPoolId :: Lens.Lens' UpdateUserPoolClient Prelude.Text
updateUserPoolClient_userPoolId :: (Text -> f Text) -> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_userPoolId = (UpdateUserPoolClient -> Text)
-> (UpdateUserPoolClient -> Text -> UpdateUserPoolClient)
-> Lens UpdateUserPoolClient UpdateUserPoolClient Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Text
userPoolId :: Text
$sel:userPoolId:UpdateUserPoolClient' :: UpdateUserPoolClient -> Text
userPoolId} -> Text
userPoolId) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Text
a -> UpdateUserPoolClient
s {$sel:userPoolId:UpdateUserPoolClient' :: Text
userPoolId = Text
a} :: UpdateUserPoolClient)

-- | The ID of the client associated with the user pool.
updateUserPoolClient_clientId :: Lens.Lens' UpdateUserPoolClient Prelude.Text
updateUserPoolClient_clientId :: (Text -> f Text) -> UpdateUserPoolClient -> f UpdateUserPoolClient
updateUserPoolClient_clientId = (UpdateUserPoolClient -> Sensitive Text)
-> (UpdateUserPoolClient -> Sensitive Text -> UpdateUserPoolClient)
-> Lens
     UpdateUserPoolClient
     UpdateUserPoolClient
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClient' {Sensitive Text
clientId :: Sensitive Text
$sel:clientId:UpdateUserPoolClient' :: UpdateUserPoolClient -> Sensitive Text
clientId} -> Sensitive Text
clientId) (\s :: UpdateUserPoolClient
s@UpdateUserPoolClient' {} Sensitive Text
a -> UpdateUserPoolClient
s {$sel:clientId:UpdateUserPoolClient' :: Sensitive Text
clientId = Sensitive Text
a} :: UpdateUserPoolClient) ((Sensitive Text -> f (Sensitive Text))
 -> UpdateUserPoolClient -> f UpdateUserPoolClient)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> UpdateUserPoolClient
-> f UpdateUserPoolClient
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

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

instance Prelude.Hashable UpdateUserPoolClient

instance Prelude.NFData UpdateUserPoolClient

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

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

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

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

-- | Represents the response from the server to the request to update the
-- user pool client.
--
-- /See:/ 'newUpdateUserPoolClientResponse' smart constructor.
data UpdateUserPoolClientResponse = UpdateUserPoolClientResponse'
  { -- | The user pool client value from the response from the server when an
    -- update user pool client request is made.
    UpdateUserPoolClientResponse -> Maybe UserPoolClientType
userPoolClient :: Prelude.Maybe UserPoolClientType,
    -- | The response's http status code.
    UpdateUserPoolClientResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateUserPoolClientResponse
-> UpdateUserPoolClientResponse -> Bool
(UpdateUserPoolClientResponse
 -> UpdateUserPoolClientResponse -> Bool)
-> (UpdateUserPoolClientResponse
    -> UpdateUserPoolClientResponse -> Bool)
-> Eq UpdateUserPoolClientResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateUserPoolClientResponse
-> UpdateUserPoolClientResponse -> Bool
$c/= :: UpdateUserPoolClientResponse
-> UpdateUserPoolClientResponse -> Bool
== :: UpdateUserPoolClientResponse
-> UpdateUserPoolClientResponse -> Bool
$c== :: UpdateUserPoolClientResponse
-> UpdateUserPoolClientResponse -> Bool
Prelude.Eq, Int -> UpdateUserPoolClientResponse -> ShowS
[UpdateUserPoolClientResponse] -> ShowS
UpdateUserPoolClientResponse -> String
(Int -> UpdateUserPoolClientResponse -> ShowS)
-> (UpdateUserPoolClientResponse -> String)
-> ([UpdateUserPoolClientResponse] -> ShowS)
-> Show UpdateUserPoolClientResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateUserPoolClientResponse] -> ShowS
$cshowList :: [UpdateUserPoolClientResponse] -> ShowS
show :: UpdateUserPoolClientResponse -> String
$cshow :: UpdateUserPoolClientResponse -> String
showsPrec :: Int -> UpdateUserPoolClientResponse -> ShowS
$cshowsPrec :: Int -> UpdateUserPoolClientResponse -> ShowS
Prelude.Show, (forall x.
 UpdateUserPoolClientResponse -> Rep UpdateUserPoolClientResponse x)
-> (forall x.
    Rep UpdateUserPoolClientResponse x -> UpdateUserPoolClientResponse)
-> Generic UpdateUserPoolClientResponse
forall x.
Rep UpdateUserPoolClientResponse x -> UpdateUserPoolClientResponse
forall x.
UpdateUserPoolClientResponse -> Rep UpdateUserPoolClientResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateUserPoolClientResponse x -> UpdateUserPoolClientResponse
$cfrom :: forall x.
UpdateUserPoolClientResponse -> Rep UpdateUserPoolClientResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateUserPoolClientResponse' 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', 'updateUserPoolClientResponse_userPoolClient' - The user pool client value from the response from the server when an
-- update user pool client request is made.
--
-- 'httpStatus', 'updateUserPoolClientResponse_httpStatus' - The response's http status code.
newUpdateUserPoolClientResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateUserPoolClientResponse
newUpdateUserPoolClientResponse :: Int -> UpdateUserPoolClientResponse
newUpdateUserPoolClientResponse Int
pHttpStatus_ =
  UpdateUserPoolClientResponse' :: Maybe UserPoolClientType -> Int -> UpdateUserPoolClientResponse
UpdateUserPoolClientResponse'
    { $sel:userPoolClient:UpdateUserPoolClientResponse' :: Maybe UserPoolClientType
userPoolClient =
        Maybe UserPoolClientType
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateUserPoolClientResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The user pool client value from the response from the server when an
-- update user pool client request is made.
updateUserPoolClientResponse_userPoolClient :: Lens.Lens' UpdateUserPoolClientResponse (Prelude.Maybe UserPoolClientType)
updateUserPoolClientResponse_userPoolClient :: (Maybe UserPoolClientType -> f (Maybe UserPoolClientType))
-> UpdateUserPoolClientResponse -> f UpdateUserPoolClientResponse
updateUserPoolClientResponse_userPoolClient = (UpdateUserPoolClientResponse -> Maybe UserPoolClientType)
-> (UpdateUserPoolClientResponse
    -> Maybe UserPoolClientType -> UpdateUserPoolClientResponse)
-> Lens
     UpdateUserPoolClientResponse
     UpdateUserPoolClientResponse
     (Maybe UserPoolClientType)
     (Maybe UserPoolClientType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPoolClientResponse' {Maybe UserPoolClientType
userPoolClient :: Maybe UserPoolClientType
$sel:userPoolClient:UpdateUserPoolClientResponse' :: UpdateUserPoolClientResponse -> Maybe UserPoolClientType
userPoolClient} -> Maybe UserPoolClientType
userPoolClient) (\s :: UpdateUserPoolClientResponse
s@UpdateUserPoolClientResponse' {} Maybe UserPoolClientType
a -> UpdateUserPoolClientResponse
s {$sel:userPoolClient:UpdateUserPoolClientResponse' :: Maybe UserPoolClientType
userPoolClient = Maybe UserPoolClientType
a} :: UpdateUserPoolClientResponse)

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

instance Prelude.NFData UpdateUserPoolClientResponse