{-# 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.UpdateUserPool
-- 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 with the specified attributes. You can
-- get a list of the current user pool settings using
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_DescribeUserPool.html DescribeUserPool>.
-- If you don\'t provide a value for an attribute, it will be set to the
-- default value.
--
-- This action might generate an SMS text message. Starting June 1, 2021,
-- U.S. telecom carriers require that you register an origination phone
-- number before you can send SMS messages to U.S. phone numbers. If you
-- use SMS text messages in Amazon Cognito, you must register a phone
-- number with
-- <https://console.aws.amazon.com/pinpoint/home/ Amazon Pinpoint>. Cognito
-- will use the the registered number automatically. Otherwise, Cognito
-- users that must receive SMS messages might be unable to sign up,
-- activate their accounts, or sign in.
--
-- If you have never used SMS text messages with Amazon Cognito or any
-- other Amazon Web Service, Amazon SNS might place your account in SMS
-- sandbox. In
-- /<https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html sandbox mode>/
-- , you’ll have limitations, such as sending messages to only verified
-- phone numbers. After testing in the sandbox environment, you can move
-- out of the SMS sandbox and into production. For more information, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html SMS message settings for Cognito User Pools>
-- in the /Amazon Cognito Developer Guide/.
module Amazonka.CognitoIdentityProvider.UpdateUserPool
  ( -- * Creating a Request
    UpdateUserPool (..),
    newUpdateUserPool,

    -- * Request Lenses
    updateUserPool_userPoolTags,
    updateUserPool_verificationMessageTemplate,
    updateUserPool_emailVerificationMessage,
    updateUserPool_smsAuthenticationMessage,
    updateUserPool_userPoolAddOns,
    updateUserPool_emailVerificationSubject,
    updateUserPool_accountRecoverySetting,
    updateUserPool_emailConfiguration,
    updateUserPool_smsVerificationMessage,
    updateUserPool_mfaConfiguration,
    updateUserPool_lambdaConfig,
    updateUserPool_smsConfiguration,
    updateUserPool_adminCreateUserConfig,
    updateUserPool_deviceConfiguration,
    updateUserPool_autoVerifiedAttributes,
    updateUserPool_policies,
    updateUserPool_userPoolId,

    -- * Destructuring the Response
    UpdateUserPoolResponse (..),
    newUpdateUserPoolResponse,

    -- * Response Lenses
    updateUserPoolResponse_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.
--
-- /See:/ 'newUpdateUserPool' smart constructor.
data UpdateUserPool = UpdateUserPool'
  { -- | The tag keys and values to assign to the user pool. A tag is a label
    -- that you can use to categorize and manage user pools in different ways,
    -- such as by purpose, owner, environment, or other criteria.
    UpdateUserPool -> Maybe (HashMap Text Text)
userPoolTags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The template for verification messages.
    UpdateUserPool -> Maybe VerificationMessageTemplateType
verificationMessageTemplate :: Prelude.Maybe VerificationMessageTemplateType,
    -- | The contents of the email verification message.
    UpdateUserPool -> Maybe Text
emailVerificationMessage :: Prelude.Maybe Prelude.Text,
    -- | The contents of the SMS authentication message.
    UpdateUserPool -> Maybe Text
smsAuthenticationMessage :: Prelude.Maybe Prelude.Text,
    -- | Used to enable advanced security risk detection. Set the key
    -- @AdvancedSecurityMode@ to the value \"AUDIT\".
    UpdateUserPool -> Maybe UserPoolAddOnsType
userPoolAddOns :: Prelude.Maybe UserPoolAddOnsType,
    -- | The subject of the email verification message.
    UpdateUserPool -> Maybe Text
emailVerificationSubject :: Prelude.Maybe Prelude.Text,
    -- | Use this setting to define which verified available method a user can
    -- use to recover their password when they call @ForgotPassword@. It allows
    -- you to define a preferred method when a user has more than one method
    -- available. With this setting, SMS does not qualify for a valid password
    -- recovery mechanism if the user also has SMS MFA enabled. In the absence
    -- of this setting, Cognito uses the legacy behavior to determine the
    -- recovery method where SMS is preferred over email.
    UpdateUserPool -> Maybe AccountRecoverySettingType
accountRecoverySetting :: Prelude.Maybe AccountRecoverySettingType,
    -- | Email configuration.
    UpdateUserPool -> Maybe EmailConfigurationType
emailConfiguration :: Prelude.Maybe EmailConfigurationType,
    -- | A container with information about the SMS verification message.
    UpdateUserPool -> Maybe Text
smsVerificationMessage :: Prelude.Maybe Prelude.Text,
    -- | Can be one of the following values:
    --
    -- -   @OFF@ - MFA tokens are not required and cannot be specified during
    --     user registration.
    --
    -- -   @ON@ - MFA tokens are required for all user registrations. You can
    --     only specify ON when you are initially creating a user pool. You can
    --     use the
    --     <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_SetUserPoolMfaConfig.html SetUserPoolMfaConfig>
    --     API operation to turn MFA \"ON\" for existing user pools.
    --
    -- -   @OPTIONAL@ - Users have the option when registering to create an MFA
    --     token.
    UpdateUserPool -> Maybe UserPoolMfaType
mfaConfiguration :: Prelude.Maybe UserPoolMfaType,
    -- | The Lambda configuration information from the request to update the user
    -- pool.
    UpdateUserPool -> Maybe LambdaConfigType
lambdaConfig :: Prelude.Maybe LambdaConfigType,
    -- | SMS configuration.
    UpdateUserPool -> Maybe SmsConfigurationType
smsConfiguration :: Prelude.Maybe SmsConfigurationType,
    -- | The configuration for @AdminCreateUser@ requests.
    UpdateUserPool -> Maybe AdminCreateUserConfigType
adminCreateUserConfig :: Prelude.Maybe AdminCreateUserConfigType,
    -- | Device configuration.
    UpdateUserPool -> Maybe DeviceConfigurationType
deviceConfiguration :: Prelude.Maybe DeviceConfigurationType,
    -- | The attributes that are automatically verified when the Amazon Cognito
    -- service makes a request to update user pools.
    UpdateUserPool -> Maybe [VerifiedAttributeType]
autoVerifiedAttributes :: Prelude.Maybe [VerifiedAttributeType],
    -- | A container with the policies you wish to update in a user pool.
    UpdateUserPool -> Maybe UserPoolPolicyType
policies :: Prelude.Maybe UserPoolPolicyType,
    -- | The user pool ID for the user pool you want to update.
    UpdateUserPool -> Text
userPoolId :: Prelude.Text
  }
  deriving (UpdateUserPool -> UpdateUserPool -> Bool
(UpdateUserPool -> UpdateUserPool -> Bool)
-> (UpdateUserPool -> UpdateUserPool -> Bool) -> Eq UpdateUserPool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateUserPool -> UpdateUserPool -> Bool
$c/= :: UpdateUserPool -> UpdateUserPool -> Bool
== :: UpdateUserPool -> UpdateUserPool -> Bool
$c== :: UpdateUserPool -> UpdateUserPool -> Bool
Prelude.Eq, ReadPrec [UpdateUserPool]
ReadPrec UpdateUserPool
Int -> ReadS UpdateUserPool
ReadS [UpdateUserPool]
(Int -> ReadS UpdateUserPool)
-> ReadS [UpdateUserPool]
-> ReadPrec UpdateUserPool
-> ReadPrec [UpdateUserPool]
-> Read UpdateUserPool
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateUserPool]
$creadListPrec :: ReadPrec [UpdateUserPool]
readPrec :: ReadPrec UpdateUserPool
$creadPrec :: ReadPrec UpdateUserPool
readList :: ReadS [UpdateUserPool]
$creadList :: ReadS [UpdateUserPool]
readsPrec :: Int -> ReadS UpdateUserPool
$creadsPrec :: Int -> ReadS UpdateUserPool
Prelude.Read, Int -> UpdateUserPool -> ShowS
[UpdateUserPool] -> ShowS
UpdateUserPool -> String
(Int -> UpdateUserPool -> ShowS)
-> (UpdateUserPool -> String)
-> ([UpdateUserPool] -> ShowS)
-> Show UpdateUserPool
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateUserPool] -> ShowS
$cshowList :: [UpdateUserPool] -> ShowS
show :: UpdateUserPool -> String
$cshow :: UpdateUserPool -> String
showsPrec :: Int -> UpdateUserPool -> ShowS
$cshowsPrec :: Int -> UpdateUserPool -> ShowS
Prelude.Show, (forall x. UpdateUserPool -> Rep UpdateUserPool x)
-> (forall x. Rep UpdateUserPool x -> UpdateUserPool)
-> Generic UpdateUserPool
forall x. Rep UpdateUserPool x -> UpdateUserPool
forall x. UpdateUserPool -> Rep UpdateUserPool x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateUserPool x -> UpdateUserPool
$cfrom :: forall x. UpdateUserPool -> Rep UpdateUserPool x
Prelude.Generic)

-- |
-- Create a value of 'UpdateUserPool' 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:
--
-- 'userPoolTags', 'updateUserPool_userPoolTags' - The tag keys and values to assign to the user pool. A tag is a label
-- that you can use to categorize and manage user pools in different ways,
-- such as by purpose, owner, environment, or other criteria.
--
-- 'verificationMessageTemplate', 'updateUserPool_verificationMessageTemplate' - The template for verification messages.
--
-- 'emailVerificationMessage', 'updateUserPool_emailVerificationMessage' - The contents of the email verification message.
--
-- 'smsAuthenticationMessage', 'updateUserPool_smsAuthenticationMessage' - The contents of the SMS authentication message.
--
-- 'userPoolAddOns', 'updateUserPool_userPoolAddOns' - Used to enable advanced security risk detection. Set the key
-- @AdvancedSecurityMode@ to the value \"AUDIT\".
--
-- 'emailVerificationSubject', 'updateUserPool_emailVerificationSubject' - The subject of the email verification message.
--
-- 'accountRecoverySetting', 'updateUserPool_accountRecoverySetting' - Use this setting to define which verified available method a user can
-- use to recover their password when they call @ForgotPassword@. It allows
-- you to define a preferred method when a user has more than one method
-- available. With this setting, SMS does not qualify for a valid password
-- recovery mechanism if the user also has SMS MFA enabled. In the absence
-- of this setting, Cognito uses the legacy behavior to determine the
-- recovery method where SMS is preferred over email.
--
-- 'emailConfiguration', 'updateUserPool_emailConfiguration' - Email configuration.
--
-- 'smsVerificationMessage', 'updateUserPool_smsVerificationMessage' - A container with information about the SMS verification message.
--
-- 'mfaConfiguration', 'updateUserPool_mfaConfiguration' - Can be one of the following values:
--
-- -   @OFF@ - MFA tokens are not required and cannot be specified during
--     user registration.
--
-- -   @ON@ - MFA tokens are required for all user registrations. You can
--     only specify ON when you are initially creating a user pool. You can
--     use the
--     <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_SetUserPoolMfaConfig.html SetUserPoolMfaConfig>
--     API operation to turn MFA \"ON\" for existing user pools.
--
-- -   @OPTIONAL@ - Users have the option when registering to create an MFA
--     token.
--
-- 'lambdaConfig', 'updateUserPool_lambdaConfig' - The Lambda configuration information from the request to update the user
-- pool.
--
-- 'smsConfiguration', 'updateUserPool_smsConfiguration' - SMS configuration.
--
-- 'adminCreateUserConfig', 'updateUserPool_adminCreateUserConfig' - The configuration for @AdminCreateUser@ requests.
--
-- 'deviceConfiguration', 'updateUserPool_deviceConfiguration' - Device configuration.
--
-- 'autoVerifiedAttributes', 'updateUserPool_autoVerifiedAttributes' - The attributes that are automatically verified when the Amazon Cognito
-- service makes a request to update user pools.
--
-- 'policies', 'updateUserPool_policies' - A container with the policies you wish to update in a user pool.
--
-- 'userPoolId', 'updateUserPool_userPoolId' - The user pool ID for the user pool you want to update.
newUpdateUserPool ::
  -- | 'userPoolId'
  Prelude.Text ->
  UpdateUserPool
newUpdateUserPool :: Text -> UpdateUserPool
newUpdateUserPool Text
pUserPoolId_ =
  UpdateUserPool' :: Maybe (HashMap Text Text)
-> Maybe VerificationMessageTemplateType
-> Maybe Text
-> Maybe Text
-> Maybe UserPoolAddOnsType
-> Maybe Text
-> Maybe AccountRecoverySettingType
-> Maybe EmailConfigurationType
-> Maybe Text
-> Maybe UserPoolMfaType
-> Maybe LambdaConfigType
-> Maybe SmsConfigurationType
-> Maybe AdminCreateUserConfigType
-> Maybe DeviceConfigurationType
-> Maybe [VerifiedAttributeType]
-> Maybe UserPoolPolicyType
-> Text
-> UpdateUserPool
UpdateUserPool'
    { $sel:userPoolTags:UpdateUserPool' :: Maybe (HashMap Text Text)
userPoolTags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:verificationMessageTemplate:UpdateUserPool' :: Maybe VerificationMessageTemplateType
verificationMessageTemplate = Maybe VerificationMessageTemplateType
forall a. Maybe a
Prelude.Nothing,
      $sel:emailVerificationMessage:UpdateUserPool' :: Maybe Text
emailVerificationMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:smsAuthenticationMessage:UpdateUserPool' :: Maybe Text
smsAuthenticationMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolAddOns:UpdateUserPool' :: Maybe UserPoolAddOnsType
userPoolAddOns = Maybe UserPoolAddOnsType
forall a. Maybe a
Prelude.Nothing,
      $sel:emailVerificationSubject:UpdateUserPool' :: Maybe Text
emailVerificationSubject = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:accountRecoverySetting:UpdateUserPool' :: Maybe AccountRecoverySettingType
accountRecoverySetting = Maybe AccountRecoverySettingType
forall a. Maybe a
Prelude.Nothing,
      $sel:emailConfiguration:UpdateUserPool' :: Maybe EmailConfigurationType
emailConfiguration = Maybe EmailConfigurationType
forall a. Maybe a
Prelude.Nothing,
      $sel:smsVerificationMessage:UpdateUserPool' :: Maybe Text
smsVerificationMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:mfaConfiguration:UpdateUserPool' :: Maybe UserPoolMfaType
mfaConfiguration = Maybe UserPoolMfaType
forall a. Maybe a
Prelude.Nothing,
      $sel:lambdaConfig:UpdateUserPool' :: Maybe LambdaConfigType
lambdaConfig = Maybe LambdaConfigType
forall a. Maybe a
Prelude.Nothing,
      $sel:smsConfiguration:UpdateUserPool' :: Maybe SmsConfigurationType
smsConfiguration = Maybe SmsConfigurationType
forall a. Maybe a
Prelude.Nothing,
      $sel:adminCreateUserConfig:UpdateUserPool' :: Maybe AdminCreateUserConfigType
adminCreateUserConfig = Maybe AdminCreateUserConfigType
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceConfiguration:UpdateUserPool' :: Maybe DeviceConfigurationType
deviceConfiguration = Maybe DeviceConfigurationType
forall a. Maybe a
Prelude.Nothing,
      $sel:autoVerifiedAttributes:UpdateUserPool' :: Maybe [VerifiedAttributeType]
autoVerifiedAttributes = Maybe [VerifiedAttributeType]
forall a. Maybe a
Prelude.Nothing,
      $sel:policies:UpdateUserPool' :: Maybe UserPoolPolicyType
policies = Maybe UserPoolPolicyType
forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolId:UpdateUserPool' :: Text
userPoolId = Text
pUserPoolId_
    }

-- | The tag keys and values to assign to the user pool. A tag is a label
-- that you can use to categorize and manage user pools in different ways,
-- such as by purpose, owner, environment, or other criteria.
updateUserPool_userPoolTags :: Lens.Lens' UpdateUserPool (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateUserPool_userPoolTags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateUserPool -> f UpdateUserPool
updateUserPool_userPoolTags = (UpdateUserPool -> Maybe (HashMap Text Text))
-> (UpdateUserPool -> Maybe (HashMap Text Text) -> UpdateUserPool)
-> Lens
     UpdateUserPool
     UpdateUserPool
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPool' {Maybe (HashMap Text Text)
userPoolTags :: Maybe (HashMap Text Text)
$sel:userPoolTags:UpdateUserPool' :: UpdateUserPool -> Maybe (HashMap Text Text)
userPoolTags} -> Maybe (HashMap Text Text)
userPoolTags) (\s :: UpdateUserPool
s@UpdateUserPool' {} Maybe (HashMap Text Text)
a -> UpdateUserPool
s {$sel:userPoolTags:UpdateUserPool' :: Maybe (HashMap Text Text)
userPoolTags = Maybe (HashMap Text Text)
a} :: UpdateUserPool) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> UpdateUserPool -> f UpdateUserPool)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateUserPool
-> f UpdateUserPool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The template for verification messages.
updateUserPool_verificationMessageTemplate :: Lens.Lens' UpdateUserPool (Prelude.Maybe VerificationMessageTemplateType)
updateUserPool_verificationMessageTemplate :: (Maybe VerificationMessageTemplateType
 -> f (Maybe VerificationMessageTemplateType))
-> UpdateUserPool -> f UpdateUserPool
updateUserPool_verificationMessageTemplate = (UpdateUserPool -> Maybe VerificationMessageTemplateType)
-> (UpdateUserPool
    -> Maybe VerificationMessageTemplateType -> UpdateUserPool)
-> Lens
     UpdateUserPool
     UpdateUserPool
     (Maybe VerificationMessageTemplateType)
     (Maybe VerificationMessageTemplateType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPool' {Maybe VerificationMessageTemplateType
verificationMessageTemplate :: Maybe VerificationMessageTemplateType
$sel:verificationMessageTemplate:UpdateUserPool' :: UpdateUserPool -> Maybe VerificationMessageTemplateType
verificationMessageTemplate} -> Maybe VerificationMessageTemplateType
verificationMessageTemplate) (\s :: UpdateUserPool
s@UpdateUserPool' {} Maybe VerificationMessageTemplateType
a -> UpdateUserPool
s {$sel:verificationMessageTemplate:UpdateUserPool' :: Maybe VerificationMessageTemplateType
verificationMessageTemplate = Maybe VerificationMessageTemplateType
a} :: UpdateUserPool)

-- | The contents of the email verification message.
updateUserPool_emailVerificationMessage :: Lens.Lens' UpdateUserPool (Prelude.Maybe Prelude.Text)
updateUserPool_emailVerificationMessage :: (Maybe Text -> f (Maybe Text))
-> UpdateUserPool -> f UpdateUserPool
updateUserPool_emailVerificationMessage = (UpdateUserPool -> Maybe Text)
-> (UpdateUserPool -> Maybe Text -> UpdateUserPool)
-> Lens UpdateUserPool UpdateUserPool (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPool' {Maybe Text
emailVerificationMessage :: Maybe Text
$sel:emailVerificationMessage:UpdateUserPool' :: UpdateUserPool -> Maybe Text
emailVerificationMessage} -> Maybe Text
emailVerificationMessage) (\s :: UpdateUserPool
s@UpdateUserPool' {} Maybe Text
a -> UpdateUserPool
s {$sel:emailVerificationMessage:UpdateUserPool' :: Maybe Text
emailVerificationMessage = Maybe Text
a} :: UpdateUserPool)

-- | The contents of the SMS authentication message.
updateUserPool_smsAuthenticationMessage :: Lens.Lens' UpdateUserPool (Prelude.Maybe Prelude.Text)
updateUserPool_smsAuthenticationMessage :: (Maybe Text -> f (Maybe Text))
-> UpdateUserPool -> f UpdateUserPool
updateUserPool_smsAuthenticationMessage = (UpdateUserPool -> Maybe Text)
-> (UpdateUserPool -> Maybe Text -> UpdateUserPool)
-> Lens UpdateUserPool UpdateUserPool (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPool' {Maybe Text
smsAuthenticationMessage :: Maybe Text
$sel:smsAuthenticationMessage:UpdateUserPool' :: UpdateUserPool -> Maybe Text
smsAuthenticationMessage} -> Maybe Text
smsAuthenticationMessage) (\s :: UpdateUserPool
s@UpdateUserPool' {} Maybe Text
a -> UpdateUserPool
s {$sel:smsAuthenticationMessage:UpdateUserPool' :: Maybe Text
smsAuthenticationMessage = Maybe Text
a} :: UpdateUserPool)

-- | Used to enable advanced security risk detection. Set the key
-- @AdvancedSecurityMode@ to the value \"AUDIT\".
updateUserPool_userPoolAddOns :: Lens.Lens' UpdateUserPool (Prelude.Maybe UserPoolAddOnsType)
updateUserPool_userPoolAddOns :: (Maybe UserPoolAddOnsType -> f (Maybe UserPoolAddOnsType))
-> UpdateUserPool -> f UpdateUserPool
updateUserPool_userPoolAddOns = (UpdateUserPool -> Maybe UserPoolAddOnsType)
-> (UpdateUserPool -> Maybe UserPoolAddOnsType -> UpdateUserPool)
-> Lens
     UpdateUserPool
     UpdateUserPool
     (Maybe UserPoolAddOnsType)
     (Maybe UserPoolAddOnsType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPool' {Maybe UserPoolAddOnsType
userPoolAddOns :: Maybe UserPoolAddOnsType
$sel:userPoolAddOns:UpdateUserPool' :: UpdateUserPool -> Maybe UserPoolAddOnsType
userPoolAddOns} -> Maybe UserPoolAddOnsType
userPoolAddOns) (\s :: UpdateUserPool
s@UpdateUserPool' {} Maybe UserPoolAddOnsType
a -> UpdateUserPool
s {$sel:userPoolAddOns:UpdateUserPool' :: Maybe UserPoolAddOnsType
userPoolAddOns = Maybe UserPoolAddOnsType
a} :: UpdateUserPool)

-- | The subject of the email verification message.
updateUserPool_emailVerificationSubject :: Lens.Lens' UpdateUserPool (Prelude.Maybe Prelude.Text)
updateUserPool_emailVerificationSubject :: (Maybe Text -> f (Maybe Text))
-> UpdateUserPool -> f UpdateUserPool
updateUserPool_emailVerificationSubject = (UpdateUserPool -> Maybe Text)
-> (UpdateUserPool -> Maybe Text -> UpdateUserPool)
-> Lens UpdateUserPool UpdateUserPool (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPool' {Maybe Text
emailVerificationSubject :: Maybe Text
$sel:emailVerificationSubject:UpdateUserPool' :: UpdateUserPool -> Maybe Text
emailVerificationSubject} -> Maybe Text
emailVerificationSubject) (\s :: UpdateUserPool
s@UpdateUserPool' {} Maybe Text
a -> UpdateUserPool
s {$sel:emailVerificationSubject:UpdateUserPool' :: Maybe Text
emailVerificationSubject = Maybe Text
a} :: UpdateUserPool)

-- | Use this setting to define which verified available method a user can
-- use to recover their password when they call @ForgotPassword@. It allows
-- you to define a preferred method when a user has more than one method
-- available. With this setting, SMS does not qualify for a valid password
-- recovery mechanism if the user also has SMS MFA enabled. In the absence
-- of this setting, Cognito uses the legacy behavior to determine the
-- recovery method where SMS is preferred over email.
updateUserPool_accountRecoverySetting :: Lens.Lens' UpdateUserPool (Prelude.Maybe AccountRecoverySettingType)
updateUserPool_accountRecoverySetting :: (Maybe AccountRecoverySettingType
 -> f (Maybe AccountRecoverySettingType))
-> UpdateUserPool -> f UpdateUserPool
updateUserPool_accountRecoverySetting = (UpdateUserPool -> Maybe AccountRecoverySettingType)
-> (UpdateUserPool
    -> Maybe AccountRecoverySettingType -> UpdateUserPool)
-> Lens
     UpdateUserPool
     UpdateUserPool
     (Maybe AccountRecoverySettingType)
     (Maybe AccountRecoverySettingType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPool' {Maybe AccountRecoverySettingType
accountRecoverySetting :: Maybe AccountRecoverySettingType
$sel:accountRecoverySetting:UpdateUserPool' :: UpdateUserPool -> Maybe AccountRecoverySettingType
accountRecoverySetting} -> Maybe AccountRecoverySettingType
accountRecoverySetting) (\s :: UpdateUserPool
s@UpdateUserPool' {} Maybe AccountRecoverySettingType
a -> UpdateUserPool
s {$sel:accountRecoverySetting:UpdateUserPool' :: Maybe AccountRecoverySettingType
accountRecoverySetting = Maybe AccountRecoverySettingType
a} :: UpdateUserPool)

-- | Email configuration.
updateUserPool_emailConfiguration :: Lens.Lens' UpdateUserPool (Prelude.Maybe EmailConfigurationType)
updateUserPool_emailConfiguration :: (Maybe EmailConfigurationType -> f (Maybe EmailConfigurationType))
-> UpdateUserPool -> f UpdateUserPool
updateUserPool_emailConfiguration = (UpdateUserPool -> Maybe EmailConfigurationType)
-> (UpdateUserPool
    -> Maybe EmailConfigurationType -> UpdateUserPool)
-> Lens
     UpdateUserPool
     UpdateUserPool
     (Maybe EmailConfigurationType)
     (Maybe EmailConfigurationType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPool' {Maybe EmailConfigurationType
emailConfiguration :: Maybe EmailConfigurationType
$sel:emailConfiguration:UpdateUserPool' :: UpdateUserPool -> Maybe EmailConfigurationType
emailConfiguration} -> Maybe EmailConfigurationType
emailConfiguration) (\s :: UpdateUserPool
s@UpdateUserPool' {} Maybe EmailConfigurationType
a -> UpdateUserPool
s {$sel:emailConfiguration:UpdateUserPool' :: Maybe EmailConfigurationType
emailConfiguration = Maybe EmailConfigurationType
a} :: UpdateUserPool)

-- | A container with information about the SMS verification message.
updateUserPool_smsVerificationMessage :: Lens.Lens' UpdateUserPool (Prelude.Maybe Prelude.Text)
updateUserPool_smsVerificationMessage :: (Maybe Text -> f (Maybe Text))
-> UpdateUserPool -> f UpdateUserPool
updateUserPool_smsVerificationMessage = (UpdateUserPool -> Maybe Text)
-> (UpdateUserPool -> Maybe Text -> UpdateUserPool)
-> Lens UpdateUserPool UpdateUserPool (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPool' {Maybe Text
smsVerificationMessage :: Maybe Text
$sel:smsVerificationMessage:UpdateUserPool' :: UpdateUserPool -> Maybe Text
smsVerificationMessage} -> Maybe Text
smsVerificationMessage) (\s :: UpdateUserPool
s@UpdateUserPool' {} Maybe Text
a -> UpdateUserPool
s {$sel:smsVerificationMessage:UpdateUserPool' :: Maybe Text
smsVerificationMessage = Maybe Text
a} :: UpdateUserPool)

-- | Can be one of the following values:
--
-- -   @OFF@ - MFA tokens are not required and cannot be specified during
--     user registration.
--
-- -   @ON@ - MFA tokens are required for all user registrations. You can
--     only specify ON when you are initially creating a user pool. You can
--     use the
--     <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_SetUserPoolMfaConfig.html SetUserPoolMfaConfig>
--     API operation to turn MFA \"ON\" for existing user pools.
--
-- -   @OPTIONAL@ - Users have the option when registering to create an MFA
--     token.
updateUserPool_mfaConfiguration :: Lens.Lens' UpdateUserPool (Prelude.Maybe UserPoolMfaType)
updateUserPool_mfaConfiguration :: (Maybe UserPoolMfaType -> f (Maybe UserPoolMfaType))
-> UpdateUserPool -> f UpdateUserPool
updateUserPool_mfaConfiguration = (UpdateUserPool -> Maybe UserPoolMfaType)
-> (UpdateUserPool -> Maybe UserPoolMfaType -> UpdateUserPool)
-> Lens
     UpdateUserPool
     UpdateUserPool
     (Maybe UserPoolMfaType)
     (Maybe UserPoolMfaType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPool' {Maybe UserPoolMfaType
mfaConfiguration :: Maybe UserPoolMfaType
$sel:mfaConfiguration:UpdateUserPool' :: UpdateUserPool -> Maybe UserPoolMfaType
mfaConfiguration} -> Maybe UserPoolMfaType
mfaConfiguration) (\s :: UpdateUserPool
s@UpdateUserPool' {} Maybe UserPoolMfaType
a -> UpdateUserPool
s {$sel:mfaConfiguration:UpdateUserPool' :: Maybe UserPoolMfaType
mfaConfiguration = Maybe UserPoolMfaType
a} :: UpdateUserPool)

-- | The Lambda configuration information from the request to update the user
-- pool.
updateUserPool_lambdaConfig :: Lens.Lens' UpdateUserPool (Prelude.Maybe LambdaConfigType)
updateUserPool_lambdaConfig :: (Maybe LambdaConfigType -> f (Maybe LambdaConfigType))
-> UpdateUserPool -> f UpdateUserPool
updateUserPool_lambdaConfig = (UpdateUserPool -> Maybe LambdaConfigType)
-> (UpdateUserPool -> Maybe LambdaConfigType -> UpdateUserPool)
-> Lens
     UpdateUserPool
     UpdateUserPool
     (Maybe LambdaConfigType)
     (Maybe LambdaConfigType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPool' {Maybe LambdaConfigType
lambdaConfig :: Maybe LambdaConfigType
$sel:lambdaConfig:UpdateUserPool' :: UpdateUserPool -> Maybe LambdaConfigType
lambdaConfig} -> Maybe LambdaConfigType
lambdaConfig) (\s :: UpdateUserPool
s@UpdateUserPool' {} Maybe LambdaConfigType
a -> UpdateUserPool
s {$sel:lambdaConfig:UpdateUserPool' :: Maybe LambdaConfigType
lambdaConfig = Maybe LambdaConfigType
a} :: UpdateUserPool)

-- | SMS configuration.
updateUserPool_smsConfiguration :: Lens.Lens' UpdateUserPool (Prelude.Maybe SmsConfigurationType)
updateUserPool_smsConfiguration :: (Maybe SmsConfigurationType -> f (Maybe SmsConfigurationType))
-> UpdateUserPool -> f UpdateUserPool
updateUserPool_smsConfiguration = (UpdateUserPool -> Maybe SmsConfigurationType)
-> (UpdateUserPool -> Maybe SmsConfigurationType -> UpdateUserPool)
-> Lens
     UpdateUserPool
     UpdateUserPool
     (Maybe SmsConfigurationType)
     (Maybe SmsConfigurationType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPool' {Maybe SmsConfigurationType
smsConfiguration :: Maybe SmsConfigurationType
$sel:smsConfiguration:UpdateUserPool' :: UpdateUserPool -> Maybe SmsConfigurationType
smsConfiguration} -> Maybe SmsConfigurationType
smsConfiguration) (\s :: UpdateUserPool
s@UpdateUserPool' {} Maybe SmsConfigurationType
a -> UpdateUserPool
s {$sel:smsConfiguration:UpdateUserPool' :: Maybe SmsConfigurationType
smsConfiguration = Maybe SmsConfigurationType
a} :: UpdateUserPool)

-- | The configuration for @AdminCreateUser@ requests.
updateUserPool_adminCreateUserConfig :: Lens.Lens' UpdateUserPool (Prelude.Maybe AdminCreateUserConfigType)
updateUserPool_adminCreateUserConfig :: (Maybe AdminCreateUserConfigType
 -> f (Maybe AdminCreateUserConfigType))
-> UpdateUserPool -> f UpdateUserPool
updateUserPool_adminCreateUserConfig = (UpdateUserPool -> Maybe AdminCreateUserConfigType)
-> (UpdateUserPool
    -> Maybe AdminCreateUserConfigType -> UpdateUserPool)
-> Lens
     UpdateUserPool
     UpdateUserPool
     (Maybe AdminCreateUserConfigType)
     (Maybe AdminCreateUserConfigType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPool' {Maybe AdminCreateUserConfigType
adminCreateUserConfig :: Maybe AdminCreateUserConfigType
$sel:adminCreateUserConfig:UpdateUserPool' :: UpdateUserPool -> Maybe AdminCreateUserConfigType
adminCreateUserConfig} -> Maybe AdminCreateUserConfigType
adminCreateUserConfig) (\s :: UpdateUserPool
s@UpdateUserPool' {} Maybe AdminCreateUserConfigType
a -> UpdateUserPool
s {$sel:adminCreateUserConfig:UpdateUserPool' :: Maybe AdminCreateUserConfigType
adminCreateUserConfig = Maybe AdminCreateUserConfigType
a} :: UpdateUserPool)

-- | Device configuration.
updateUserPool_deviceConfiguration :: Lens.Lens' UpdateUserPool (Prelude.Maybe DeviceConfigurationType)
updateUserPool_deviceConfiguration :: (Maybe DeviceConfigurationType
 -> f (Maybe DeviceConfigurationType))
-> UpdateUserPool -> f UpdateUserPool
updateUserPool_deviceConfiguration = (UpdateUserPool -> Maybe DeviceConfigurationType)
-> (UpdateUserPool
    -> Maybe DeviceConfigurationType -> UpdateUserPool)
-> Lens
     UpdateUserPool
     UpdateUserPool
     (Maybe DeviceConfigurationType)
     (Maybe DeviceConfigurationType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPool' {Maybe DeviceConfigurationType
deviceConfiguration :: Maybe DeviceConfigurationType
$sel:deviceConfiguration:UpdateUserPool' :: UpdateUserPool -> Maybe DeviceConfigurationType
deviceConfiguration} -> Maybe DeviceConfigurationType
deviceConfiguration) (\s :: UpdateUserPool
s@UpdateUserPool' {} Maybe DeviceConfigurationType
a -> UpdateUserPool
s {$sel:deviceConfiguration:UpdateUserPool' :: Maybe DeviceConfigurationType
deviceConfiguration = Maybe DeviceConfigurationType
a} :: UpdateUserPool)

-- | The attributes that are automatically verified when the Amazon Cognito
-- service makes a request to update user pools.
updateUserPool_autoVerifiedAttributes :: Lens.Lens' UpdateUserPool (Prelude.Maybe [VerifiedAttributeType])
updateUserPool_autoVerifiedAttributes :: (Maybe [VerifiedAttributeType]
 -> f (Maybe [VerifiedAttributeType]))
-> UpdateUserPool -> f UpdateUserPool
updateUserPool_autoVerifiedAttributes = (UpdateUserPool -> Maybe [VerifiedAttributeType])
-> (UpdateUserPool
    -> Maybe [VerifiedAttributeType] -> UpdateUserPool)
-> Lens
     UpdateUserPool
     UpdateUserPool
     (Maybe [VerifiedAttributeType])
     (Maybe [VerifiedAttributeType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPool' {Maybe [VerifiedAttributeType]
autoVerifiedAttributes :: Maybe [VerifiedAttributeType]
$sel:autoVerifiedAttributes:UpdateUserPool' :: UpdateUserPool -> Maybe [VerifiedAttributeType]
autoVerifiedAttributes} -> Maybe [VerifiedAttributeType]
autoVerifiedAttributes) (\s :: UpdateUserPool
s@UpdateUserPool' {} Maybe [VerifiedAttributeType]
a -> UpdateUserPool
s {$sel:autoVerifiedAttributes:UpdateUserPool' :: Maybe [VerifiedAttributeType]
autoVerifiedAttributes = Maybe [VerifiedAttributeType]
a} :: UpdateUserPool) ((Maybe [VerifiedAttributeType]
  -> f (Maybe [VerifiedAttributeType]))
 -> UpdateUserPool -> f UpdateUserPool)
-> ((Maybe [VerifiedAttributeType]
     -> f (Maybe [VerifiedAttributeType]))
    -> Maybe [VerifiedAttributeType]
    -> f (Maybe [VerifiedAttributeType]))
-> (Maybe [VerifiedAttributeType]
    -> f (Maybe [VerifiedAttributeType]))
-> UpdateUserPool
-> f UpdateUserPool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [VerifiedAttributeType]
  [VerifiedAttributeType]
  [VerifiedAttributeType]
  [VerifiedAttributeType]
-> Iso
     (Maybe [VerifiedAttributeType])
     (Maybe [VerifiedAttributeType])
     (Maybe [VerifiedAttributeType])
     (Maybe [VerifiedAttributeType])
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
  [VerifiedAttributeType]
  [VerifiedAttributeType]
  [VerifiedAttributeType]
  [VerifiedAttributeType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A container with the policies you wish to update in a user pool.
updateUserPool_policies :: Lens.Lens' UpdateUserPool (Prelude.Maybe UserPoolPolicyType)
updateUserPool_policies :: (Maybe UserPoolPolicyType -> f (Maybe UserPoolPolicyType))
-> UpdateUserPool -> f UpdateUserPool
updateUserPool_policies = (UpdateUserPool -> Maybe UserPoolPolicyType)
-> (UpdateUserPool -> Maybe UserPoolPolicyType -> UpdateUserPool)
-> Lens
     UpdateUserPool
     UpdateUserPool
     (Maybe UserPoolPolicyType)
     (Maybe UserPoolPolicyType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPool' {Maybe UserPoolPolicyType
policies :: Maybe UserPoolPolicyType
$sel:policies:UpdateUserPool' :: UpdateUserPool -> Maybe UserPoolPolicyType
policies} -> Maybe UserPoolPolicyType
policies) (\s :: UpdateUserPool
s@UpdateUserPool' {} Maybe UserPoolPolicyType
a -> UpdateUserPool
s {$sel:policies:UpdateUserPool' :: Maybe UserPoolPolicyType
policies = Maybe UserPoolPolicyType
a} :: UpdateUserPool)

-- | The user pool ID for the user pool you want to update.
updateUserPool_userPoolId :: Lens.Lens' UpdateUserPool Prelude.Text
updateUserPool_userPoolId :: (Text -> f Text) -> UpdateUserPool -> f UpdateUserPool
updateUserPool_userPoolId = (UpdateUserPool -> Text)
-> (UpdateUserPool -> Text -> UpdateUserPool)
-> Lens UpdateUserPool UpdateUserPool Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPool' {Text
userPoolId :: Text
$sel:userPoolId:UpdateUserPool' :: UpdateUserPool -> Text
userPoolId} -> Text
userPoolId) (\s :: UpdateUserPool
s@UpdateUserPool' {} Text
a -> UpdateUserPool
s {$sel:userPoolId:UpdateUserPool' :: Text
userPoolId = Text
a} :: UpdateUserPool)

instance Core.AWSRequest UpdateUserPool where
  type
    AWSResponse UpdateUserPool =
      UpdateUserPoolResponse
  request :: UpdateUserPool -> Request UpdateUserPool
request = Service -> UpdateUserPool -> Request UpdateUserPool
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateUserPool
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateUserPool)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse UpdateUserPool))
-> Logger
-> Service
-> Proxy UpdateUserPool
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateUserPool)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> UpdateUserPoolResponse
UpdateUserPoolResponse'
            (Int -> UpdateUserPoolResponse)
-> Either String Int -> Either String UpdateUserPoolResponse
forall (f :: * -> *) a b. Functor 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 UpdateUserPool

instance Prelude.NFData UpdateUserPool

instance Core.ToHeaders UpdateUserPool where
  toHeaders :: UpdateUserPool -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateUserPool -> 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.UpdateUserPool" ::
                          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 UpdateUserPool where
  toJSON :: UpdateUserPool -> Value
toJSON UpdateUserPool' {Maybe [VerifiedAttributeType]
Maybe Text
Maybe (HashMap Text Text)
Maybe DeviceConfigurationType
Maybe EmailConfigurationType
Maybe LambdaConfigType
Maybe AdminCreateUserConfigType
Maybe AccountRecoverySettingType
Maybe SmsConfigurationType
Maybe UserPoolAddOnsType
Maybe UserPoolMfaType
Maybe UserPoolPolicyType
Maybe VerificationMessageTemplateType
Text
userPoolId :: Text
policies :: Maybe UserPoolPolicyType
autoVerifiedAttributes :: Maybe [VerifiedAttributeType]
deviceConfiguration :: Maybe DeviceConfigurationType
adminCreateUserConfig :: Maybe AdminCreateUserConfigType
smsConfiguration :: Maybe SmsConfigurationType
lambdaConfig :: Maybe LambdaConfigType
mfaConfiguration :: Maybe UserPoolMfaType
smsVerificationMessage :: Maybe Text
emailConfiguration :: Maybe EmailConfigurationType
accountRecoverySetting :: Maybe AccountRecoverySettingType
emailVerificationSubject :: Maybe Text
userPoolAddOns :: Maybe UserPoolAddOnsType
smsAuthenticationMessage :: Maybe Text
emailVerificationMessage :: Maybe Text
verificationMessageTemplate :: Maybe VerificationMessageTemplateType
userPoolTags :: Maybe (HashMap Text Text)
$sel:userPoolId:UpdateUserPool' :: UpdateUserPool -> Text
$sel:policies:UpdateUserPool' :: UpdateUserPool -> Maybe UserPoolPolicyType
$sel:autoVerifiedAttributes:UpdateUserPool' :: UpdateUserPool -> Maybe [VerifiedAttributeType]
$sel:deviceConfiguration:UpdateUserPool' :: UpdateUserPool -> Maybe DeviceConfigurationType
$sel:adminCreateUserConfig:UpdateUserPool' :: UpdateUserPool -> Maybe AdminCreateUserConfigType
$sel:smsConfiguration:UpdateUserPool' :: UpdateUserPool -> Maybe SmsConfigurationType
$sel:lambdaConfig:UpdateUserPool' :: UpdateUserPool -> Maybe LambdaConfigType
$sel:mfaConfiguration:UpdateUserPool' :: UpdateUserPool -> Maybe UserPoolMfaType
$sel:smsVerificationMessage:UpdateUserPool' :: UpdateUserPool -> Maybe Text
$sel:emailConfiguration:UpdateUserPool' :: UpdateUserPool -> Maybe EmailConfigurationType
$sel:accountRecoverySetting:UpdateUserPool' :: UpdateUserPool -> Maybe AccountRecoverySettingType
$sel:emailVerificationSubject:UpdateUserPool' :: UpdateUserPool -> Maybe Text
$sel:userPoolAddOns:UpdateUserPool' :: UpdateUserPool -> Maybe UserPoolAddOnsType
$sel:smsAuthenticationMessage:UpdateUserPool' :: UpdateUserPool -> Maybe Text
$sel:emailVerificationMessage:UpdateUserPool' :: UpdateUserPool -> Maybe Text
$sel:verificationMessageTemplate:UpdateUserPool' :: UpdateUserPool -> Maybe VerificationMessageTemplateType
$sel:userPoolTags:UpdateUserPool' :: UpdateUserPool -> Maybe (HashMap Text Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"UserPoolTags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
userPoolTags,
            (Text
"VerificationMessageTemplate" Text -> VerificationMessageTemplateType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (VerificationMessageTemplateType -> Pair)
-> Maybe VerificationMessageTemplateType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VerificationMessageTemplateType
verificationMessageTemplate,
            (Text
"EmailVerificationMessage" 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
emailVerificationMessage,
            (Text
"SmsAuthenticationMessage" 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
smsAuthenticationMessage,
            (Text
"UserPoolAddOns" Text -> UserPoolAddOnsType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (UserPoolAddOnsType -> Pair)
-> Maybe UserPoolAddOnsType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UserPoolAddOnsType
userPoolAddOns,
            (Text
"EmailVerificationSubject" 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
emailVerificationSubject,
            (Text
"AccountRecoverySetting" Text -> AccountRecoverySettingType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AccountRecoverySettingType -> Pair)
-> Maybe AccountRecoverySettingType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AccountRecoverySettingType
accountRecoverySetting,
            (Text
"EmailConfiguration" Text -> EmailConfigurationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (EmailConfigurationType -> Pair)
-> Maybe EmailConfigurationType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EmailConfigurationType
emailConfiguration,
            (Text
"SmsVerificationMessage" 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
smsVerificationMessage,
            (Text
"MfaConfiguration" Text -> UserPoolMfaType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (UserPoolMfaType -> Pair) -> Maybe UserPoolMfaType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UserPoolMfaType
mfaConfiguration,
            (Text
"LambdaConfig" Text -> LambdaConfigType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LambdaConfigType -> Pair) -> Maybe LambdaConfigType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LambdaConfigType
lambdaConfig,
            (Text
"SmsConfiguration" Text -> SmsConfigurationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SmsConfigurationType -> Pair)
-> Maybe SmsConfigurationType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SmsConfigurationType
smsConfiguration,
            (Text
"AdminCreateUserConfig" Text -> AdminCreateUserConfigType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AdminCreateUserConfigType -> Pair)
-> Maybe AdminCreateUserConfigType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AdminCreateUserConfigType
adminCreateUserConfig,
            (Text
"DeviceConfiguration" Text -> DeviceConfigurationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DeviceConfigurationType -> Pair)
-> Maybe DeviceConfigurationType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeviceConfigurationType
deviceConfiguration,
            (Text
"AutoVerifiedAttributes" Text -> [VerifiedAttributeType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([VerifiedAttributeType] -> Pair)
-> Maybe [VerifiedAttributeType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [VerifiedAttributeType]
autoVerifiedAttributes,
            (Text
"Policies" Text -> UserPoolPolicyType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (UserPoolPolicyType -> Pair)
-> Maybe UserPoolPolicyType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UserPoolPolicyType
policies,
            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)
          ]
      )

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

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

-- | Represents the response from the server when you make a request to
-- update the user pool.
--
-- /See:/ 'newUpdateUserPoolResponse' smart constructor.
data UpdateUserPoolResponse = UpdateUserPoolResponse'
  { -- | The response's http status code.
    UpdateUserPoolResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateUserPoolResponse -> UpdateUserPoolResponse -> Bool
(UpdateUserPoolResponse -> UpdateUserPoolResponse -> Bool)
-> (UpdateUserPoolResponse -> UpdateUserPoolResponse -> Bool)
-> Eq UpdateUserPoolResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateUserPoolResponse -> UpdateUserPoolResponse -> Bool
$c/= :: UpdateUserPoolResponse -> UpdateUserPoolResponse -> Bool
== :: UpdateUserPoolResponse -> UpdateUserPoolResponse -> Bool
$c== :: UpdateUserPoolResponse -> UpdateUserPoolResponse -> Bool
Prelude.Eq, ReadPrec [UpdateUserPoolResponse]
ReadPrec UpdateUserPoolResponse
Int -> ReadS UpdateUserPoolResponse
ReadS [UpdateUserPoolResponse]
(Int -> ReadS UpdateUserPoolResponse)
-> ReadS [UpdateUserPoolResponse]
-> ReadPrec UpdateUserPoolResponse
-> ReadPrec [UpdateUserPoolResponse]
-> Read UpdateUserPoolResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateUserPoolResponse]
$creadListPrec :: ReadPrec [UpdateUserPoolResponse]
readPrec :: ReadPrec UpdateUserPoolResponse
$creadPrec :: ReadPrec UpdateUserPoolResponse
readList :: ReadS [UpdateUserPoolResponse]
$creadList :: ReadS [UpdateUserPoolResponse]
readsPrec :: Int -> ReadS UpdateUserPoolResponse
$creadsPrec :: Int -> ReadS UpdateUserPoolResponse
Prelude.Read, Int -> UpdateUserPoolResponse -> ShowS
[UpdateUserPoolResponse] -> ShowS
UpdateUserPoolResponse -> String
(Int -> UpdateUserPoolResponse -> ShowS)
-> (UpdateUserPoolResponse -> String)
-> ([UpdateUserPoolResponse] -> ShowS)
-> Show UpdateUserPoolResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateUserPoolResponse] -> ShowS
$cshowList :: [UpdateUserPoolResponse] -> ShowS
show :: UpdateUserPoolResponse -> String
$cshow :: UpdateUserPoolResponse -> String
showsPrec :: Int -> UpdateUserPoolResponse -> ShowS
$cshowsPrec :: Int -> UpdateUserPoolResponse -> ShowS
Prelude.Show, (forall x. UpdateUserPoolResponse -> Rep UpdateUserPoolResponse x)
-> (forall x.
    Rep UpdateUserPoolResponse x -> UpdateUserPoolResponse)
-> Generic UpdateUserPoolResponse
forall x. Rep UpdateUserPoolResponse x -> UpdateUserPoolResponse
forall x. UpdateUserPoolResponse -> Rep UpdateUserPoolResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateUserPoolResponse x -> UpdateUserPoolResponse
$cfrom :: forall x. UpdateUserPoolResponse -> Rep UpdateUserPoolResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateUserPoolResponse' 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:
--
-- 'httpStatus', 'updateUserPoolResponse_httpStatus' - The response's http status code.
newUpdateUserPoolResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateUserPoolResponse
newUpdateUserPoolResponse :: Int -> UpdateUserPoolResponse
newUpdateUserPoolResponse Int
pHttpStatus_ =
  UpdateUserPoolResponse' :: Int -> UpdateUserPoolResponse
UpdateUserPoolResponse' {$sel:httpStatus:UpdateUserPoolResponse' :: Int
httpStatus = Int
pHttpStatus_}

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

instance Prelude.NFData UpdateUserPoolResponse