{-# 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.CreateUserPool
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a new Amazon Cognito user pool and sets the password policy for
-- the pool.
--
-- This action might generate an SMS text message. Starting June 1, 2021,
-- US telecom carriers require you to register an origination phone number
-- before you can send SMS messages to US 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>. Amazon
-- Cognito uses the registered number automatically. Otherwise, Amazon
-- Cognito users who must receive SMS messages might not be able 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 Simple Notification Service might place
-- your account in the SMS sandbox. In
-- /<https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html sandbox mode>/
-- , you can send messages only to verified phone numbers. After you test
-- your app while in the sandbox environment, you can move out of the
-- 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 Amazon Cognito user pools>
-- in the /Amazon Cognito Developer Guide/.
module Amazonka.CognitoIdentityProvider.CreateUserPool
  ( -- * Creating a Request
    CreateUserPool (..),
    newCreateUserPool,

    -- * Request Lenses
    createUserPool_accountRecoverySetting,
    createUserPool_adminCreateUserConfig,
    createUserPool_aliasAttributes,
    createUserPool_autoVerifiedAttributes,
    createUserPool_deletionProtection,
    createUserPool_deviceConfiguration,
    createUserPool_emailConfiguration,
    createUserPool_emailVerificationMessage,
    createUserPool_emailVerificationSubject,
    createUserPool_lambdaConfig,
    createUserPool_mfaConfiguration,
    createUserPool_policies,
    createUserPool_schema,
    createUserPool_smsAuthenticationMessage,
    createUserPool_smsConfiguration,
    createUserPool_smsVerificationMessage,
    createUserPool_userAttributeUpdateSettings,
    createUserPool_userPoolAddOns,
    createUserPool_userPoolTags,
    createUserPool_usernameAttributes,
    createUserPool_usernameConfiguration,
    createUserPool_verificationMessageTemplate,
    createUserPool_poolName,

    -- * Destructuring the Response
    CreateUserPoolResponse (..),
    newCreateUserPoolResponse,

    -- * Response Lenses
    createUserPoolResponse_userPool,
    createUserPoolResponse_httpStatus,
  )
where

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

-- | Represents the request to create a user pool.
--
-- /See:/ 'newCreateUserPool' smart constructor.
data CreateUserPool = CreateUserPool'
  { -- | The available verified method a user can use to recover their password
    -- when they call @ForgotPassword@. You can use this setting to define a
    -- preferred method when a user has more than one method available. With
    -- this setting, SMS doesn\'t qualify for a valid password recovery
    -- mechanism if the user also has SMS multi-factor authentication (MFA)
    -- activated. In the absence of this setting, Amazon Cognito uses the
    -- legacy behavior to determine the recovery method where SMS is preferred
    -- through email.
    CreateUserPool -> Maybe AccountRecoverySettingType
accountRecoverySetting :: Prelude.Maybe AccountRecoverySettingType,
    -- | The configuration for @AdminCreateUser@ requests.
    CreateUserPool -> Maybe AdminCreateUserConfigType
adminCreateUserConfig :: Prelude.Maybe AdminCreateUserConfigType,
    -- | Attributes supported as an alias for this user pool. Possible values:
    -- __phone_number__, __email__, or __preferred_username__.
    CreateUserPool -> Maybe [AliasAttributeType]
aliasAttributes :: Prelude.Maybe [AliasAttributeType],
    -- | The attributes to be auto-verified. Possible values: __email__,
    -- __phone_number__.
    CreateUserPool -> Maybe [VerifiedAttributeType]
autoVerifiedAttributes :: Prelude.Maybe [VerifiedAttributeType],
    -- | When active, @DeletionProtection@ prevents accidental deletion of your
    -- user pool. Before you can delete a user pool that you have protected
    -- against deletion, you must deactivate this feature.
    --
    -- When you try to delete a protected user pool in a @DeleteUserPool@ API
    -- request, Amazon Cognito returns an @InvalidParameterException@ error. To
    -- delete a protected user pool, send a new @DeleteUserPool@ request after
    -- you deactivate deletion protection in an @UpdateUserPool@ API request.
    CreateUserPool -> Maybe DeletionProtectionType
deletionProtection :: Prelude.Maybe DeletionProtectionType,
    -- | The device-remembering configuration for a user pool. A null value
    -- indicates that you have deactivated device remembering in your user
    -- pool.
    --
    -- When you provide a value for any @DeviceConfiguration@ field, you
    -- activate the Amazon Cognito device-remembering feature.
    CreateUserPool -> Maybe DeviceConfigurationType
deviceConfiguration :: Prelude.Maybe DeviceConfigurationType,
    -- | The email configuration of your user pool. The email configuration type
    -- sets your preferred sending method, Amazon Web Services Region, and
    -- sender for messages from your user pool.
    CreateUserPool -> Maybe EmailConfigurationType
emailConfiguration :: Prelude.Maybe EmailConfigurationType,
    -- | This parameter is no longer used. See
    -- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_VerificationMessageTemplateType.html VerificationMessageTemplateType>.
    CreateUserPool -> Maybe Text
emailVerificationMessage :: Prelude.Maybe Prelude.Text,
    -- | This parameter is no longer used. See
    -- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_VerificationMessageTemplateType.html VerificationMessageTemplateType>.
    CreateUserPool -> Maybe Text
emailVerificationSubject :: Prelude.Maybe Prelude.Text,
    -- | The Lambda trigger configuration information for the new user pool.
    --
    -- In a push model, event sources (such as Amazon S3 and custom
    -- applications) need permission to invoke a function. So you must make an
    -- extra call to add permission for these event sources to invoke your
    -- Lambda function.
    --
    -- For more information on using the Lambda API to add permission, see
    -- <https://docs.aws.amazon.com/lambda/latest/dg/API_AddPermission.html AddPermission>
    -- .
    --
    -- For adding permission using the CLI, see
    -- <https://docs.aws.amazon.com/cli/latest/reference/lambda/add-permission.html add-permission>
    -- .
    CreateUserPool -> Maybe LambdaConfigType
lambdaConfig :: Prelude.Maybe LambdaConfigType,
    -- | Specifies MFA configuration details.
    CreateUserPool -> Maybe UserPoolMfaType
mfaConfiguration :: Prelude.Maybe UserPoolMfaType,
    -- | The policies associated with the new user pool.
    CreateUserPool -> Maybe UserPoolPolicyType
policies :: Prelude.Maybe UserPoolPolicyType,
    -- | An array of schema attributes for the new user pool. These attributes
    -- can be standard or custom attributes.
    CreateUserPool -> Maybe (NonEmpty SchemaAttributeType)
schema :: Prelude.Maybe (Prelude.NonEmpty SchemaAttributeType),
    -- | A string representing the SMS authentication message.
    CreateUserPool -> Maybe Text
smsAuthenticationMessage :: Prelude.Maybe Prelude.Text,
    -- | The SMS configuration with the settings that your Amazon Cognito user
    -- pool must use to send an SMS message from your Amazon Web Services
    -- account through Amazon Simple Notification Service. To send SMS messages
    -- with Amazon SNS in the Amazon Web Services Region that you want, the
    -- Amazon Cognito user pool uses an Identity and Access Management (IAM)
    -- role in your Amazon Web Services account.
    CreateUserPool -> Maybe SmsConfigurationType
smsConfiguration :: Prelude.Maybe SmsConfigurationType,
    -- | This parameter is no longer used. See
    -- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_VerificationMessageTemplateType.html VerificationMessageTemplateType>.
    CreateUserPool -> Maybe Text
smsVerificationMessage :: Prelude.Maybe Prelude.Text,
    -- | The settings for updates to user attributes. These settings include the
    -- property @AttributesRequireVerificationBeforeUpdate@, a user-pool
    -- setting that tells Amazon Cognito how to handle changes to the value of
    -- your users\' email address and phone number attributes. For more
    -- information, see
    -- <https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-email-phone-verification.html#user-pool-settings-verifications-verify-attribute-updates Verifying updates to email addresses and phone numbers>.
    CreateUserPool -> Maybe UserAttributeUpdateSettingsType
userAttributeUpdateSettings :: Prelude.Maybe UserAttributeUpdateSettingsType,
    -- | Enables advanced security risk detection. Set the key
    -- @AdvancedSecurityMode@ to the value \"AUDIT\".
    CreateUserPool -> Maybe UserPoolAddOnsType
userPoolAddOns :: Prelude.Maybe UserPoolAddOnsType,
    -- | 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.
    CreateUserPool -> Maybe (HashMap Text Text)
userPoolTags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Specifies whether a user can use an email address or phone number as a
    -- username when they sign up.
    CreateUserPool -> Maybe [UsernameAttributeType]
usernameAttributes :: Prelude.Maybe [UsernameAttributeType],
    -- | Case sensitivity on the username input for the selected sign-in option.
    -- For example, when case sensitivity is set to @False@, users can sign in
    -- using either \"username\" or \"Username\". This configuration is
    -- immutable once it has been set. For more information, see
    -- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_UsernameConfigurationType.html UsernameConfigurationType>.
    CreateUserPool -> Maybe UsernameConfigurationType
usernameConfiguration :: Prelude.Maybe UsernameConfigurationType,
    -- | The template for the verification message that the user sees when the
    -- app requests permission to access the user\'s information.
    CreateUserPool -> Maybe VerificationMessageTemplateType
verificationMessageTemplate :: Prelude.Maybe VerificationMessageTemplateType,
    -- | A string used to name the user pool.
    CreateUserPool -> Text
poolName :: Prelude.Text
  }
  deriving (CreateUserPool -> CreateUserPool -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateUserPool -> CreateUserPool -> Bool
$c/= :: CreateUserPool -> CreateUserPool -> Bool
== :: CreateUserPool -> CreateUserPool -> Bool
$c== :: CreateUserPool -> CreateUserPool -> Bool
Prelude.Eq, ReadPrec [CreateUserPool]
ReadPrec CreateUserPool
Int -> ReadS CreateUserPool
ReadS [CreateUserPool]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateUserPool]
$creadListPrec :: ReadPrec [CreateUserPool]
readPrec :: ReadPrec CreateUserPool
$creadPrec :: ReadPrec CreateUserPool
readList :: ReadS [CreateUserPool]
$creadList :: ReadS [CreateUserPool]
readsPrec :: Int -> ReadS CreateUserPool
$creadsPrec :: Int -> ReadS CreateUserPool
Prelude.Read, Int -> CreateUserPool -> ShowS
[CreateUserPool] -> ShowS
CreateUserPool -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateUserPool] -> ShowS
$cshowList :: [CreateUserPool] -> ShowS
show :: CreateUserPool -> String
$cshow :: CreateUserPool -> String
showsPrec :: Int -> CreateUserPool -> ShowS
$cshowsPrec :: Int -> CreateUserPool -> ShowS
Prelude.Show, forall x. Rep CreateUserPool x -> CreateUserPool
forall x. CreateUserPool -> Rep CreateUserPool x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateUserPool x -> CreateUserPool
$cfrom :: forall x. CreateUserPool -> Rep CreateUserPool x
Prelude.Generic)

-- |
-- Create a value of 'CreateUserPool' 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:
--
-- 'accountRecoverySetting', 'createUserPool_accountRecoverySetting' - The available verified method a user can use to recover their password
-- when they call @ForgotPassword@. You can use this setting to define a
-- preferred method when a user has more than one method available. With
-- this setting, SMS doesn\'t qualify for a valid password recovery
-- mechanism if the user also has SMS multi-factor authentication (MFA)
-- activated. In the absence of this setting, Amazon Cognito uses the
-- legacy behavior to determine the recovery method where SMS is preferred
-- through email.
--
-- 'adminCreateUserConfig', 'createUserPool_adminCreateUserConfig' - The configuration for @AdminCreateUser@ requests.
--
-- 'aliasAttributes', 'createUserPool_aliasAttributes' - Attributes supported as an alias for this user pool. Possible values:
-- __phone_number__, __email__, or __preferred_username__.
--
-- 'autoVerifiedAttributes', 'createUserPool_autoVerifiedAttributes' - The attributes to be auto-verified. Possible values: __email__,
-- __phone_number__.
--
-- 'deletionProtection', 'createUserPool_deletionProtection' - When active, @DeletionProtection@ prevents accidental deletion of your
-- user pool. Before you can delete a user pool that you have protected
-- against deletion, you must deactivate this feature.
--
-- When you try to delete a protected user pool in a @DeleteUserPool@ API
-- request, Amazon Cognito returns an @InvalidParameterException@ error. To
-- delete a protected user pool, send a new @DeleteUserPool@ request after
-- you deactivate deletion protection in an @UpdateUserPool@ API request.
--
-- 'deviceConfiguration', 'createUserPool_deviceConfiguration' - The device-remembering configuration for a user pool. A null value
-- indicates that you have deactivated device remembering in your user
-- pool.
--
-- When you provide a value for any @DeviceConfiguration@ field, you
-- activate the Amazon Cognito device-remembering feature.
--
-- 'emailConfiguration', 'createUserPool_emailConfiguration' - The email configuration of your user pool. The email configuration type
-- sets your preferred sending method, Amazon Web Services Region, and
-- sender for messages from your user pool.
--
-- 'emailVerificationMessage', 'createUserPool_emailVerificationMessage' - This parameter is no longer used. See
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_VerificationMessageTemplateType.html VerificationMessageTemplateType>.
--
-- 'emailVerificationSubject', 'createUserPool_emailVerificationSubject' - This parameter is no longer used. See
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_VerificationMessageTemplateType.html VerificationMessageTemplateType>.
--
-- 'lambdaConfig', 'createUserPool_lambdaConfig' - The Lambda trigger configuration information for the new user pool.
--
-- In a push model, event sources (such as Amazon S3 and custom
-- applications) need permission to invoke a function. So you must make an
-- extra call to add permission for these event sources to invoke your
-- Lambda function.
--
-- For more information on using the Lambda API to add permission, see
-- <https://docs.aws.amazon.com/lambda/latest/dg/API_AddPermission.html AddPermission>
-- .
--
-- For adding permission using the CLI, see
-- <https://docs.aws.amazon.com/cli/latest/reference/lambda/add-permission.html add-permission>
-- .
--
-- 'mfaConfiguration', 'createUserPool_mfaConfiguration' - Specifies MFA configuration details.
--
-- 'policies', 'createUserPool_policies' - The policies associated with the new user pool.
--
-- 'schema', 'createUserPool_schema' - An array of schema attributes for the new user pool. These attributes
-- can be standard or custom attributes.
--
-- 'smsAuthenticationMessage', 'createUserPool_smsAuthenticationMessage' - A string representing the SMS authentication message.
--
-- 'smsConfiguration', 'createUserPool_smsConfiguration' - The SMS configuration with the settings that your Amazon Cognito user
-- pool must use to send an SMS message from your Amazon Web Services
-- account through Amazon Simple Notification Service. To send SMS messages
-- with Amazon SNS in the Amazon Web Services Region that you want, the
-- Amazon Cognito user pool uses an Identity and Access Management (IAM)
-- role in your Amazon Web Services account.
--
-- 'smsVerificationMessage', 'createUserPool_smsVerificationMessage' - This parameter is no longer used. See
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_VerificationMessageTemplateType.html VerificationMessageTemplateType>.
--
-- 'userAttributeUpdateSettings', 'createUserPool_userAttributeUpdateSettings' - The settings for updates to user attributes. These settings include the
-- property @AttributesRequireVerificationBeforeUpdate@, a user-pool
-- setting that tells Amazon Cognito how to handle changes to the value of
-- your users\' email address and phone number attributes. For more
-- information, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-email-phone-verification.html#user-pool-settings-verifications-verify-attribute-updates Verifying updates to email addresses and phone numbers>.
--
-- 'userPoolAddOns', 'createUserPool_userPoolAddOns' - Enables advanced security risk detection. Set the key
-- @AdvancedSecurityMode@ to the value \"AUDIT\".
--
-- 'userPoolTags', 'createUserPool_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.
--
-- 'usernameAttributes', 'createUserPool_usernameAttributes' - Specifies whether a user can use an email address or phone number as a
-- username when they sign up.
--
-- 'usernameConfiguration', 'createUserPool_usernameConfiguration' - Case sensitivity on the username input for the selected sign-in option.
-- For example, when case sensitivity is set to @False@, users can sign in
-- using either \"username\" or \"Username\". This configuration is
-- immutable once it has been set. For more information, see
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_UsernameConfigurationType.html UsernameConfigurationType>.
--
-- 'verificationMessageTemplate', 'createUserPool_verificationMessageTemplate' - The template for the verification message that the user sees when the
-- app requests permission to access the user\'s information.
--
-- 'poolName', 'createUserPool_poolName' - A string used to name the user pool.
newCreateUserPool ::
  -- | 'poolName'
  Prelude.Text ->
  CreateUserPool
newCreateUserPool :: Text -> CreateUserPool
newCreateUserPool Text
pPoolName_ =
  CreateUserPool'
    { $sel:accountRecoverySetting:CreateUserPool' :: Maybe AccountRecoverySettingType
accountRecoverySetting =
        forall a. Maybe a
Prelude.Nothing,
      $sel:adminCreateUserConfig:CreateUserPool' :: Maybe AdminCreateUserConfigType
adminCreateUserConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:aliasAttributes:CreateUserPool' :: Maybe [AliasAttributeType]
aliasAttributes = forall a. Maybe a
Prelude.Nothing,
      $sel:autoVerifiedAttributes:CreateUserPool' :: Maybe [VerifiedAttributeType]
autoVerifiedAttributes = forall a. Maybe a
Prelude.Nothing,
      $sel:deletionProtection:CreateUserPool' :: Maybe DeletionProtectionType
deletionProtection = forall a. Maybe a
Prelude.Nothing,
      $sel:deviceConfiguration:CreateUserPool' :: Maybe DeviceConfigurationType
deviceConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:emailConfiguration:CreateUserPool' :: Maybe EmailConfigurationType
emailConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:emailVerificationMessage:CreateUserPool' :: Maybe Text
emailVerificationMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:emailVerificationSubject:CreateUserPool' :: Maybe Text
emailVerificationSubject = forall a. Maybe a
Prelude.Nothing,
      $sel:lambdaConfig:CreateUserPool' :: Maybe LambdaConfigType
lambdaConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:mfaConfiguration:CreateUserPool' :: Maybe UserPoolMfaType
mfaConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:policies:CreateUserPool' :: Maybe UserPoolPolicyType
policies = forall a. Maybe a
Prelude.Nothing,
      $sel:schema:CreateUserPool' :: Maybe (NonEmpty SchemaAttributeType)
schema = forall a. Maybe a
Prelude.Nothing,
      $sel:smsAuthenticationMessage:CreateUserPool' :: Maybe Text
smsAuthenticationMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:smsConfiguration:CreateUserPool' :: Maybe SmsConfigurationType
smsConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:smsVerificationMessage:CreateUserPool' :: Maybe Text
smsVerificationMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:userAttributeUpdateSettings:CreateUserPool' :: Maybe UserAttributeUpdateSettingsType
userAttributeUpdateSettings = forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolAddOns:CreateUserPool' :: Maybe UserPoolAddOnsType
userPoolAddOns = forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolTags:CreateUserPool' :: Maybe (HashMap Text Text)
userPoolTags = forall a. Maybe a
Prelude.Nothing,
      $sel:usernameAttributes:CreateUserPool' :: Maybe [UsernameAttributeType]
usernameAttributes = forall a. Maybe a
Prelude.Nothing,
      $sel:usernameConfiguration:CreateUserPool' :: Maybe UsernameConfigurationType
usernameConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:verificationMessageTemplate:CreateUserPool' :: Maybe VerificationMessageTemplateType
verificationMessageTemplate = forall a. Maybe a
Prelude.Nothing,
      $sel:poolName:CreateUserPool' :: Text
poolName = Text
pPoolName_
    }

-- | The available verified method a user can use to recover their password
-- when they call @ForgotPassword@. You can use this setting to define a
-- preferred method when a user has more than one method available. With
-- this setting, SMS doesn\'t qualify for a valid password recovery
-- mechanism if the user also has SMS multi-factor authentication (MFA)
-- activated. In the absence of this setting, Amazon Cognito uses the
-- legacy behavior to determine the recovery method where SMS is preferred
-- through email.
createUserPool_accountRecoverySetting :: Lens.Lens' CreateUserPool (Prelude.Maybe AccountRecoverySettingType)
createUserPool_accountRecoverySetting :: Lens' CreateUserPool (Maybe AccountRecoverySettingType)
createUserPool_accountRecoverySetting = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe AccountRecoverySettingType
accountRecoverySetting :: Maybe AccountRecoverySettingType
$sel:accountRecoverySetting:CreateUserPool' :: CreateUserPool -> Maybe AccountRecoverySettingType
accountRecoverySetting} -> Maybe AccountRecoverySettingType
accountRecoverySetting) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe AccountRecoverySettingType
a -> CreateUserPool
s {$sel:accountRecoverySetting:CreateUserPool' :: Maybe AccountRecoverySettingType
accountRecoverySetting = Maybe AccountRecoverySettingType
a} :: CreateUserPool)

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

-- | Attributes supported as an alias for this user pool. Possible values:
-- __phone_number__, __email__, or __preferred_username__.
createUserPool_aliasAttributes :: Lens.Lens' CreateUserPool (Prelude.Maybe [AliasAttributeType])
createUserPool_aliasAttributes :: Lens' CreateUserPool (Maybe [AliasAttributeType])
createUserPool_aliasAttributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe [AliasAttributeType]
aliasAttributes :: Maybe [AliasAttributeType]
$sel:aliasAttributes:CreateUserPool' :: CreateUserPool -> Maybe [AliasAttributeType]
aliasAttributes} -> Maybe [AliasAttributeType]
aliasAttributes) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe [AliasAttributeType]
a -> CreateUserPool
s {$sel:aliasAttributes:CreateUserPool' :: Maybe [AliasAttributeType]
aliasAttributes = Maybe [AliasAttributeType]
a} :: CreateUserPool) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The attributes to be auto-verified. Possible values: __email__,
-- __phone_number__.
createUserPool_autoVerifiedAttributes :: Lens.Lens' CreateUserPool (Prelude.Maybe [VerifiedAttributeType])
createUserPool_autoVerifiedAttributes :: Lens' CreateUserPool (Maybe [VerifiedAttributeType])
createUserPool_autoVerifiedAttributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe [VerifiedAttributeType]
autoVerifiedAttributes :: Maybe [VerifiedAttributeType]
$sel:autoVerifiedAttributes:CreateUserPool' :: CreateUserPool -> Maybe [VerifiedAttributeType]
autoVerifiedAttributes} -> Maybe [VerifiedAttributeType]
autoVerifiedAttributes) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe [VerifiedAttributeType]
a -> CreateUserPool
s {$sel:autoVerifiedAttributes:CreateUserPool' :: Maybe [VerifiedAttributeType]
autoVerifiedAttributes = Maybe [VerifiedAttributeType]
a} :: CreateUserPool) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | When active, @DeletionProtection@ prevents accidental deletion of your
-- user pool. Before you can delete a user pool that you have protected
-- against deletion, you must deactivate this feature.
--
-- When you try to delete a protected user pool in a @DeleteUserPool@ API
-- request, Amazon Cognito returns an @InvalidParameterException@ error. To
-- delete a protected user pool, send a new @DeleteUserPool@ request after
-- you deactivate deletion protection in an @UpdateUserPool@ API request.
createUserPool_deletionProtection :: Lens.Lens' CreateUserPool (Prelude.Maybe DeletionProtectionType)
createUserPool_deletionProtection :: Lens' CreateUserPool (Maybe DeletionProtectionType)
createUserPool_deletionProtection = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe DeletionProtectionType
deletionProtection :: Maybe DeletionProtectionType
$sel:deletionProtection:CreateUserPool' :: CreateUserPool -> Maybe DeletionProtectionType
deletionProtection} -> Maybe DeletionProtectionType
deletionProtection) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe DeletionProtectionType
a -> CreateUserPool
s {$sel:deletionProtection:CreateUserPool' :: Maybe DeletionProtectionType
deletionProtection = Maybe DeletionProtectionType
a} :: CreateUserPool)

-- | The device-remembering configuration for a user pool. A null value
-- indicates that you have deactivated device remembering in your user
-- pool.
--
-- When you provide a value for any @DeviceConfiguration@ field, you
-- activate the Amazon Cognito device-remembering feature.
createUserPool_deviceConfiguration :: Lens.Lens' CreateUserPool (Prelude.Maybe DeviceConfigurationType)
createUserPool_deviceConfiguration :: Lens' CreateUserPool (Maybe DeviceConfigurationType)
createUserPool_deviceConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe DeviceConfigurationType
deviceConfiguration :: Maybe DeviceConfigurationType
$sel:deviceConfiguration:CreateUserPool' :: CreateUserPool -> Maybe DeviceConfigurationType
deviceConfiguration} -> Maybe DeviceConfigurationType
deviceConfiguration) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe DeviceConfigurationType
a -> CreateUserPool
s {$sel:deviceConfiguration:CreateUserPool' :: Maybe DeviceConfigurationType
deviceConfiguration = Maybe DeviceConfigurationType
a} :: CreateUserPool)

-- | The email configuration of your user pool. The email configuration type
-- sets your preferred sending method, Amazon Web Services Region, and
-- sender for messages from your user pool.
createUserPool_emailConfiguration :: Lens.Lens' CreateUserPool (Prelude.Maybe EmailConfigurationType)
createUserPool_emailConfiguration :: Lens' CreateUserPool (Maybe EmailConfigurationType)
createUserPool_emailConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe EmailConfigurationType
emailConfiguration :: Maybe EmailConfigurationType
$sel:emailConfiguration:CreateUserPool' :: CreateUserPool -> Maybe EmailConfigurationType
emailConfiguration} -> Maybe EmailConfigurationType
emailConfiguration) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe EmailConfigurationType
a -> CreateUserPool
s {$sel:emailConfiguration:CreateUserPool' :: Maybe EmailConfigurationType
emailConfiguration = Maybe EmailConfigurationType
a} :: CreateUserPool)

-- | This parameter is no longer used. See
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_VerificationMessageTemplateType.html VerificationMessageTemplateType>.
createUserPool_emailVerificationMessage :: Lens.Lens' CreateUserPool (Prelude.Maybe Prelude.Text)
createUserPool_emailVerificationMessage :: Lens' CreateUserPool (Maybe Text)
createUserPool_emailVerificationMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe Text
emailVerificationMessage :: Maybe Text
$sel:emailVerificationMessage:CreateUserPool' :: CreateUserPool -> Maybe Text
emailVerificationMessage} -> Maybe Text
emailVerificationMessage) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe Text
a -> CreateUserPool
s {$sel:emailVerificationMessage:CreateUserPool' :: Maybe Text
emailVerificationMessage = Maybe Text
a} :: CreateUserPool)

-- | This parameter is no longer used. See
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_VerificationMessageTemplateType.html VerificationMessageTemplateType>.
createUserPool_emailVerificationSubject :: Lens.Lens' CreateUserPool (Prelude.Maybe Prelude.Text)
createUserPool_emailVerificationSubject :: Lens' CreateUserPool (Maybe Text)
createUserPool_emailVerificationSubject = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe Text
emailVerificationSubject :: Maybe Text
$sel:emailVerificationSubject:CreateUserPool' :: CreateUserPool -> Maybe Text
emailVerificationSubject} -> Maybe Text
emailVerificationSubject) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe Text
a -> CreateUserPool
s {$sel:emailVerificationSubject:CreateUserPool' :: Maybe Text
emailVerificationSubject = Maybe Text
a} :: CreateUserPool)

-- | The Lambda trigger configuration information for the new user pool.
--
-- In a push model, event sources (such as Amazon S3 and custom
-- applications) need permission to invoke a function. So you must make an
-- extra call to add permission for these event sources to invoke your
-- Lambda function.
--
-- For more information on using the Lambda API to add permission, see
-- <https://docs.aws.amazon.com/lambda/latest/dg/API_AddPermission.html AddPermission>
-- .
--
-- For adding permission using the CLI, see
-- <https://docs.aws.amazon.com/cli/latest/reference/lambda/add-permission.html add-permission>
-- .
createUserPool_lambdaConfig :: Lens.Lens' CreateUserPool (Prelude.Maybe LambdaConfigType)
createUserPool_lambdaConfig :: Lens' CreateUserPool (Maybe LambdaConfigType)
createUserPool_lambdaConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe LambdaConfigType
lambdaConfig :: Maybe LambdaConfigType
$sel:lambdaConfig:CreateUserPool' :: CreateUserPool -> Maybe LambdaConfigType
lambdaConfig} -> Maybe LambdaConfigType
lambdaConfig) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe LambdaConfigType
a -> CreateUserPool
s {$sel:lambdaConfig:CreateUserPool' :: Maybe LambdaConfigType
lambdaConfig = Maybe LambdaConfigType
a} :: CreateUserPool)

-- | Specifies MFA configuration details.
createUserPool_mfaConfiguration :: Lens.Lens' CreateUserPool (Prelude.Maybe UserPoolMfaType)
createUserPool_mfaConfiguration :: Lens' CreateUserPool (Maybe UserPoolMfaType)
createUserPool_mfaConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe UserPoolMfaType
mfaConfiguration :: Maybe UserPoolMfaType
$sel:mfaConfiguration:CreateUserPool' :: CreateUserPool -> Maybe UserPoolMfaType
mfaConfiguration} -> Maybe UserPoolMfaType
mfaConfiguration) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe UserPoolMfaType
a -> CreateUserPool
s {$sel:mfaConfiguration:CreateUserPool' :: Maybe UserPoolMfaType
mfaConfiguration = Maybe UserPoolMfaType
a} :: CreateUserPool)

-- | The policies associated with the new user pool.
createUserPool_policies :: Lens.Lens' CreateUserPool (Prelude.Maybe UserPoolPolicyType)
createUserPool_policies :: Lens' CreateUserPool (Maybe UserPoolPolicyType)
createUserPool_policies = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe UserPoolPolicyType
policies :: Maybe UserPoolPolicyType
$sel:policies:CreateUserPool' :: CreateUserPool -> Maybe UserPoolPolicyType
policies} -> Maybe UserPoolPolicyType
policies) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe UserPoolPolicyType
a -> CreateUserPool
s {$sel:policies:CreateUserPool' :: Maybe UserPoolPolicyType
policies = Maybe UserPoolPolicyType
a} :: CreateUserPool)

-- | An array of schema attributes for the new user pool. These attributes
-- can be standard or custom attributes.
createUserPool_schema :: Lens.Lens' CreateUserPool (Prelude.Maybe (Prelude.NonEmpty SchemaAttributeType))
createUserPool_schema :: Lens' CreateUserPool (Maybe (NonEmpty SchemaAttributeType))
createUserPool_schema = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe (NonEmpty SchemaAttributeType)
schema :: Maybe (NonEmpty SchemaAttributeType)
$sel:schema:CreateUserPool' :: CreateUserPool -> Maybe (NonEmpty SchemaAttributeType)
schema} -> Maybe (NonEmpty SchemaAttributeType)
schema) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe (NonEmpty SchemaAttributeType)
a -> CreateUserPool
s {$sel:schema:CreateUserPool' :: Maybe (NonEmpty SchemaAttributeType)
schema = Maybe (NonEmpty SchemaAttributeType)
a} :: CreateUserPool) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A string representing the SMS authentication message.
createUserPool_smsAuthenticationMessage :: Lens.Lens' CreateUserPool (Prelude.Maybe Prelude.Text)
createUserPool_smsAuthenticationMessage :: Lens' CreateUserPool (Maybe Text)
createUserPool_smsAuthenticationMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe Text
smsAuthenticationMessage :: Maybe Text
$sel:smsAuthenticationMessage:CreateUserPool' :: CreateUserPool -> Maybe Text
smsAuthenticationMessage} -> Maybe Text
smsAuthenticationMessage) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe Text
a -> CreateUserPool
s {$sel:smsAuthenticationMessage:CreateUserPool' :: Maybe Text
smsAuthenticationMessage = Maybe Text
a} :: CreateUserPool)

-- | The SMS configuration with the settings that your Amazon Cognito user
-- pool must use to send an SMS message from your Amazon Web Services
-- account through Amazon Simple Notification Service. To send SMS messages
-- with Amazon SNS in the Amazon Web Services Region that you want, the
-- Amazon Cognito user pool uses an Identity and Access Management (IAM)
-- role in your Amazon Web Services account.
createUserPool_smsConfiguration :: Lens.Lens' CreateUserPool (Prelude.Maybe SmsConfigurationType)
createUserPool_smsConfiguration :: Lens' CreateUserPool (Maybe SmsConfigurationType)
createUserPool_smsConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe SmsConfigurationType
smsConfiguration :: Maybe SmsConfigurationType
$sel:smsConfiguration:CreateUserPool' :: CreateUserPool -> Maybe SmsConfigurationType
smsConfiguration} -> Maybe SmsConfigurationType
smsConfiguration) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe SmsConfigurationType
a -> CreateUserPool
s {$sel:smsConfiguration:CreateUserPool' :: Maybe SmsConfigurationType
smsConfiguration = Maybe SmsConfigurationType
a} :: CreateUserPool)

-- | This parameter is no longer used. See
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_VerificationMessageTemplateType.html VerificationMessageTemplateType>.
createUserPool_smsVerificationMessage :: Lens.Lens' CreateUserPool (Prelude.Maybe Prelude.Text)
createUserPool_smsVerificationMessage :: Lens' CreateUserPool (Maybe Text)
createUserPool_smsVerificationMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe Text
smsVerificationMessage :: Maybe Text
$sel:smsVerificationMessage:CreateUserPool' :: CreateUserPool -> Maybe Text
smsVerificationMessage} -> Maybe Text
smsVerificationMessage) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe Text
a -> CreateUserPool
s {$sel:smsVerificationMessage:CreateUserPool' :: Maybe Text
smsVerificationMessage = Maybe Text
a} :: CreateUserPool)

-- | The settings for updates to user attributes. These settings include the
-- property @AttributesRequireVerificationBeforeUpdate@, a user-pool
-- setting that tells Amazon Cognito how to handle changes to the value of
-- your users\' email address and phone number attributes. For more
-- information, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-email-phone-verification.html#user-pool-settings-verifications-verify-attribute-updates Verifying updates to email addresses and phone numbers>.
createUserPool_userAttributeUpdateSettings :: Lens.Lens' CreateUserPool (Prelude.Maybe UserAttributeUpdateSettingsType)
createUserPool_userAttributeUpdateSettings :: Lens' CreateUserPool (Maybe UserAttributeUpdateSettingsType)
createUserPool_userAttributeUpdateSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe UserAttributeUpdateSettingsType
userAttributeUpdateSettings :: Maybe UserAttributeUpdateSettingsType
$sel:userAttributeUpdateSettings:CreateUserPool' :: CreateUserPool -> Maybe UserAttributeUpdateSettingsType
userAttributeUpdateSettings} -> Maybe UserAttributeUpdateSettingsType
userAttributeUpdateSettings) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe UserAttributeUpdateSettingsType
a -> CreateUserPool
s {$sel:userAttributeUpdateSettings:CreateUserPool' :: Maybe UserAttributeUpdateSettingsType
userAttributeUpdateSettings = Maybe UserAttributeUpdateSettingsType
a} :: CreateUserPool)

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

-- | 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.
createUserPool_userPoolTags :: Lens.Lens' CreateUserPool (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createUserPool_userPoolTags :: Lens' CreateUserPool (Maybe (HashMap Text Text))
createUserPool_userPoolTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe (HashMap Text Text)
userPoolTags :: Maybe (HashMap Text Text)
$sel:userPoolTags:CreateUserPool' :: CreateUserPool -> Maybe (HashMap Text Text)
userPoolTags} -> Maybe (HashMap Text Text)
userPoolTags) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe (HashMap Text Text)
a -> CreateUserPool
s {$sel:userPoolTags:CreateUserPool' :: Maybe (HashMap Text Text)
userPoolTags = Maybe (HashMap Text Text)
a} :: CreateUserPool) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies whether a user can use an email address or phone number as a
-- username when they sign up.
createUserPool_usernameAttributes :: Lens.Lens' CreateUserPool (Prelude.Maybe [UsernameAttributeType])
createUserPool_usernameAttributes :: Lens' CreateUserPool (Maybe [UsernameAttributeType])
createUserPool_usernameAttributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe [UsernameAttributeType]
usernameAttributes :: Maybe [UsernameAttributeType]
$sel:usernameAttributes:CreateUserPool' :: CreateUserPool -> Maybe [UsernameAttributeType]
usernameAttributes} -> Maybe [UsernameAttributeType]
usernameAttributes) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe [UsernameAttributeType]
a -> CreateUserPool
s {$sel:usernameAttributes:CreateUserPool' :: Maybe [UsernameAttributeType]
usernameAttributes = Maybe [UsernameAttributeType]
a} :: CreateUserPool) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Case sensitivity on the username input for the selected sign-in option.
-- For example, when case sensitivity is set to @False@, users can sign in
-- using either \"username\" or \"Username\". This configuration is
-- immutable once it has been set. For more information, see
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_UsernameConfigurationType.html UsernameConfigurationType>.
createUserPool_usernameConfiguration :: Lens.Lens' CreateUserPool (Prelude.Maybe UsernameConfigurationType)
createUserPool_usernameConfiguration :: Lens' CreateUserPool (Maybe UsernameConfigurationType)
createUserPool_usernameConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe UsernameConfigurationType
usernameConfiguration :: Maybe UsernameConfigurationType
$sel:usernameConfiguration:CreateUserPool' :: CreateUserPool -> Maybe UsernameConfigurationType
usernameConfiguration} -> Maybe UsernameConfigurationType
usernameConfiguration) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe UsernameConfigurationType
a -> CreateUserPool
s {$sel:usernameConfiguration:CreateUserPool' :: Maybe UsernameConfigurationType
usernameConfiguration = Maybe UsernameConfigurationType
a} :: CreateUserPool)

-- | The template for the verification message that the user sees when the
-- app requests permission to access the user\'s information.
createUserPool_verificationMessageTemplate :: Lens.Lens' CreateUserPool (Prelude.Maybe VerificationMessageTemplateType)
createUserPool_verificationMessageTemplate :: Lens' CreateUserPool (Maybe VerificationMessageTemplateType)
createUserPool_verificationMessageTemplate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Maybe VerificationMessageTemplateType
verificationMessageTemplate :: Maybe VerificationMessageTemplateType
$sel:verificationMessageTemplate:CreateUserPool' :: CreateUserPool -> Maybe VerificationMessageTemplateType
verificationMessageTemplate} -> Maybe VerificationMessageTemplateType
verificationMessageTemplate) (\s :: CreateUserPool
s@CreateUserPool' {} Maybe VerificationMessageTemplateType
a -> CreateUserPool
s {$sel:verificationMessageTemplate:CreateUserPool' :: Maybe VerificationMessageTemplateType
verificationMessageTemplate = Maybe VerificationMessageTemplateType
a} :: CreateUserPool)

-- | A string used to name the user pool.
createUserPool_poolName :: Lens.Lens' CreateUserPool Prelude.Text
createUserPool_poolName :: Lens' CreateUserPool Text
createUserPool_poolName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPool' {Text
poolName :: Text
$sel:poolName:CreateUserPool' :: CreateUserPool -> Text
poolName} -> Text
poolName) (\s :: CreateUserPool
s@CreateUserPool' {} Text
a -> CreateUserPool
s {$sel:poolName:CreateUserPool' :: Text
poolName = Text
a} :: CreateUserPool)

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

instance Prelude.Hashable CreateUserPool where
  hashWithSalt :: Int -> CreateUserPool -> Int
hashWithSalt Int
_salt CreateUserPool' {Maybe [AliasAttributeType]
Maybe [UsernameAttributeType]
Maybe [VerifiedAttributeType]
Maybe (NonEmpty SchemaAttributeType)
Maybe Text
Maybe (HashMap Text Text)
Maybe DeletionProtectionType
Maybe DeviceConfigurationType
Maybe EmailConfigurationType
Maybe LambdaConfigType
Maybe AdminCreateUserConfigType
Maybe AccountRecoverySettingType
Maybe SmsConfigurationType
Maybe UserPoolAddOnsType
Maybe UserPoolMfaType
Maybe UserPoolPolicyType
Maybe UsernameConfigurationType
Maybe VerificationMessageTemplateType
Maybe UserAttributeUpdateSettingsType
Text
poolName :: Text
verificationMessageTemplate :: Maybe VerificationMessageTemplateType
usernameConfiguration :: Maybe UsernameConfigurationType
usernameAttributes :: Maybe [UsernameAttributeType]
userPoolTags :: Maybe (HashMap Text Text)
userPoolAddOns :: Maybe UserPoolAddOnsType
userAttributeUpdateSettings :: Maybe UserAttributeUpdateSettingsType
smsVerificationMessage :: Maybe Text
smsConfiguration :: Maybe SmsConfigurationType
smsAuthenticationMessage :: Maybe Text
schema :: Maybe (NonEmpty SchemaAttributeType)
policies :: Maybe UserPoolPolicyType
mfaConfiguration :: Maybe UserPoolMfaType
lambdaConfig :: Maybe LambdaConfigType
emailVerificationSubject :: Maybe Text
emailVerificationMessage :: Maybe Text
emailConfiguration :: Maybe EmailConfigurationType
deviceConfiguration :: Maybe DeviceConfigurationType
deletionProtection :: Maybe DeletionProtectionType
autoVerifiedAttributes :: Maybe [VerifiedAttributeType]
aliasAttributes :: Maybe [AliasAttributeType]
adminCreateUserConfig :: Maybe AdminCreateUserConfigType
accountRecoverySetting :: Maybe AccountRecoverySettingType
$sel:poolName:CreateUserPool' :: CreateUserPool -> Text
$sel:verificationMessageTemplate:CreateUserPool' :: CreateUserPool -> Maybe VerificationMessageTemplateType
$sel:usernameConfiguration:CreateUserPool' :: CreateUserPool -> Maybe UsernameConfigurationType
$sel:usernameAttributes:CreateUserPool' :: CreateUserPool -> Maybe [UsernameAttributeType]
$sel:userPoolTags:CreateUserPool' :: CreateUserPool -> Maybe (HashMap Text Text)
$sel:userPoolAddOns:CreateUserPool' :: CreateUserPool -> Maybe UserPoolAddOnsType
$sel:userAttributeUpdateSettings:CreateUserPool' :: CreateUserPool -> Maybe UserAttributeUpdateSettingsType
$sel:smsVerificationMessage:CreateUserPool' :: CreateUserPool -> Maybe Text
$sel:smsConfiguration:CreateUserPool' :: CreateUserPool -> Maybe SmsConfigurationType
$sel:smsAuthenticationMessage:CreateUserPool' :: CreateUserPool -> Maybe Text
$sel:schema:CreateUserPool' :: CreateUserPool -> Maybe (NonEmpty SchemaAttributeType)
$sel:policies:CreateUserPool' :: CreateUserPool -> Maybe UserPoolPolicyType
$sel:mfaConfiguration:CreateUserPool' :: CreateUserPool -> Maybe UserPoolMfaType
$sel:lambdaConfig:CreateUserPool' :: CreateUserPool -> Maybe LambdaConfigType
$sel:emailVerificationSubject:CreateUserPool' :: CreateUserPool -> Maybe Text
$sel:emailVerificationMessage:CreateUserPool' :: CreateUserPool -> Maybe Text
$sel:emailConfiguration:CreateUserPool' :: CreateUserPool -> Maybe EmailConfigurationType
$sel:deviceConfiguration:CreateUserPool' :: CreateUserPool -> Maybe DeviceConfigurationType
$sel:deletionProtection:CreateUserPool' :: CreateUserPool -> Maybe DeletionProtectionType
$sel:autoVerifiedAttributes:CreateUserPool' :: CreateUserPool -> Maybe [VerifiedAttributeType]
$sel:aliasAttributes:CreateUserPool' :: CreateUserPool -> Maybe [AliasAttributeType]
$sel:adminCreateUserConfig:CreateUserPool' :: CreateUserPool -> Maybe AdminCreateUserConfigType
$sel:accountRecoverySetting:CreateUserPool' :: CreateUserPool -> Maybe AccountRecoverySettingType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AccountRecoverySettingType
accountRecoverySetting
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AdminCreateUserConfigType
adminCreateUserConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AliasAttributeType]
aliasAttributes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [VerifiedAttributeType]
autoVerifiedAttributes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeletionProtectionType
deletionProtection
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeviceConfigurationType
deviceConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EmailConfigurationType
emailConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
emailVerificationMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
emailVerificationSubject
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LambdaConfigType
lambdaConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UserPoolMfaType
mfaConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UserPoolPolicyType
policies
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty SchemaAttributeType)
schema
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
smsAuthenticationMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SmsConfigurationType
smsConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
smsVerificationMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UserAttributeUpdateSettingsType
userAttributeUpdateSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UserPoolAddOnsType
userPoolAddOns
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
userPoolTags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [UsernameAttributeType]
usernameAttributes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UsernameConfigurationType
usernameConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VerificationMessageTemplateType
verificationMessageTemplate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
poolName

instance Prelude.NFData CreateUserPool where
  rnf :: CreateUserPool -> ()
rnf CreateUserPool' {Maybe [AliasAttributeType]
Maybe [UsernameAttributeType]
Maybe [VerifiedAttributeType]
Maybe (NonEmpty SchemaAttributeType)
Maybe Text
Maybe (HashMap Text Text)
Maybe DeletionProtectionType
Maybe DeviceConfigurationType
Maybe EmailConfigurationType
Maybe LambdaConfigType
Maybe AdminCreateUserConfigType
Maybe AccountRecoverySettingType
Maybe SmsConfigurationType
Maybe UserPoolAddOnsType
Maybe UserPoolMfaType
Maybe UserPoolPolicyType
Maybe UsernameConfigurationType
Maybe VerificationMessageTemplateType
Maybe UserAttributeUpdateSettingsType
Text
poolName :: Text
verificationMessageTemplate :: Maybe VerificationMessageTemplateType
usernameConfiguration :: Maybe UsernameConfigurationType
usernameAttributes :: Maybe [UsernameAttributeType]
userPoolTags :: Maybe (HashMap Text Text)
userPoolAddOns :: Maybe UserPoolAddOnsType
userAttributeUpdateSettings :: Maybe UserAttributeUpdateSettingsType
smsVerificationMessage :: Maybe Text
smsConfiguration :: Maybe SmsConfigurationType
smsAuthenticationMessage :: Maybe Text
schema :: Maybe (NonEmpty SchemaAttributeType)
policies :: Maybe UserPoolPolicyType
mfaConfiguration :: Maybe UserPoolMfaType
lambdaConfig :: Maybe LambdaConfigType
emailVerificationSubject :: Maybe Text
emailVerificationMessage :: Maybe Text
emailConfiguration :: Maybe EmailConfigurationType
deviceConfiguration :: Maybe DeviceConfigurationType
deletionProtection :: Maybe DeletionProtectionType
autoVerifiedAttributes :: Maybe [VerifiedAttributeType]
aliasAttributes :: Maybe [AliasAttributeType]
adminCreateUserConfig :: Maybe AdminCreateUserConfigType
accountRecoverySetting :: Maybe AccountRecoverySettingType
$sel:poolName:CreateUserPool' :: CreateUserPool -> Text
$sel:verificationMessageTemplate:CreateUserPool' :: CreateUserPool -> Maybe VerificationMessageTemplateType
$sel:usernameConfiguration:CreateUserPool' :: CreateUserPool -> Maybe UsernameConfigurationType
$sel:usernameAttributes:CreateUserPool' :: CreateUserPool -> Maybe [UsernameAttributeType]
$sel:userPoolTags:CreateUserPool' :: CreateUserPool -> Maybe (HashMap Text Text)
$sel:userPoolAddOns:CreateUserPool' :: CreateUserPool -> Maybe UserPoolAddOnsType
$sel:userAttributeUpdateSettings:CreateUserPool' :: CreateUserPool -> Maybe UserAttributeUpdateSettingsType
$sel:smsVerificationMessage:CreateUserPool' :: CreateUserPool -> Maybe Text
$sel:smsConfiguration:CreateUserPool' :: CreateUserPool -> Maybe SmsConfigurationType
$sel:smsAuthenticationMessage:CreateUserPool' :: CreateUserPool -> Maybe Text
$sel:schema:CreateUserPool' :: CreateUserPool -> Maybe (NonEmpty SchemaAttributeType)
$sel:policies:CreateUserPool' :: CreateUserPool -> Maybe UserPoolPolicyType
$sel:mfaConfiguration:CreateUserPool' :: CreateUserPool -> Maybe UserPoolMfaType
$sel:lambdaConfig:CreateUserPool' :: CreateUserPool -> Maybe LambdaConfigType
$sel:emailVerificationSubject:CreateUserPool' :: CreateUserPool -> Maybe Text
$sel:emailVerificationMessage:CreateUserPool' :: CreateUserPool -> Maybe Text
$sel:emailConfiguration:CreateUserPool' :: CreateUserPool -> Maybe EmailConfigurationType
$sel:deviceConfiguration:CreateUserPool' :: CreateUserPool -> Maybe DeviceConfigurationType
$sel:deletionProtection:CreateUserPool' :: CreateUserPool -> Maybe DeletionProtectionType
$sel:autoVerifiedAttributes:CreateUserPool' :: CreateUserPool -> Maybe [VerifiedAttributeType]
$sel:aliasAttributes:CreateUserPool' :: CreateUserPool -> Maybe [AliasAttributeType]
$sel:adminCreateUserConfig:CreateUserPool' :: CreateUserPool -> Maybe AdminCreateUserConfigType
$sel:accountRecoverySetting:CreateUserPool' :: CreateUserPool -> Maybe AccountRecoverySettingType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AccountRecoverySettingType
accountRecoverySetting
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AdminCreateUserConfigType
adminCreateUserConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [AliasAttributeType]
aliasAttributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [VerifiedAttributeType]
autoVerifiedAttributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DeletionProtectionType
deletionProtection
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DeviceConfigurationType
deviceConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EmailConfigurationType
emailConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
emailVerificationMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
emailVerificationSubject
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LambdaConfigType
lambdaConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UserPoolMfaType
mfaConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UserPoolPolicyType
policies
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty SchemaAttributeType)
schema
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
smsAuthenticationMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SmsConfigurationType
smsConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
smsVerificationMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
        Maybe UserAttributeUpdateSettingsType
userAttributeUpdateSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UserPoolAddOnsType
userPoolAddOns
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
userPoolTags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [UsernameAttributeType]
usernameAttributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
        Maybe UsernameConfigurationType
usernameConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
        Maybe VerificationMessageTemplateType
verificationMessageTemplate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
poolName

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

instance Data.ToJSON CreateUserPool where
  toJSON :: CreateUserPool -> Value
toJSON CreateUserPool' {Maybe [AliasAttributeType]
Maybe [UsernameAttributeType]
Maybe [VerifiedAttributeType]
Maybe (NonEmpty SchemaAttributeType)
Maybe Text
Maybe (HashMap Text Text)
Maybe DeletionProtectionType
Maybe DeviceConfigurationType
Maybe EmailConfigurationType
Maybe LambdaConfigType
Maybe AdminCreateUserConfigType
Maybe AccountRecoverySettingType
Maybe SmsConfigurationType
Maybe UserPoolAddOnsType
Maybe UserPoolMfaType
Maybe UserPoolPolicyType
Maybe UsernameConfigurationType
Maybe VerificationMessageTemplateType
Maybe UserAttributeUpdateSettingsType
Text
poolName :: Text
verificationMessageTemplate :: Maybe VerificationMessageTemplateType
usernameConfiguration :: Maybe UsernameConfigurationType
usernameAttributes :: Maybe [UsernameAttributeType]
userPoolTags :: Maybe (HashMap Text Text)
userPoolAddOns :: Maybe UserPoolAddOnsType
userAttributeUpdateSettings :: Maybe UserAttributeUpdateSettingsType
smsVerificationMessage :: Maybe Text
smsConfiguration :: Maybe SmsConfigurationType
smsAuthenticationMessage :: Maybe Text
schema :: Maybe (NonEmpty SchemaAttributeType)
policies :: Maybe UserPoolPolicyType
mfaConfiguration :: Maybe UserPoolMfaType
lambdaConfig :: Maybe LambdaConfigType
emailVerificationSubject :: Maybe Text
emailVerificationMessage :: Maybe Text
emailConfiguration :: Maybe EmailConfigurationType
deviceConfiguration :: Maybe DeviceConfigurationType
deletionProtection :: Maybe DeletionProtectionType
autoVerifiedAttributes :: Maybe [VerifiedAttributeType]
aliasAttributes :: Maybe [AliasAttributeType]
adminCreateUserConfig :: Maybe AdminCreateUserConfigType
accountRecoverySetting :: Maybe AccountRecoverySettingType
$sel:poolName:CreateUserPool' :: CreateUserPool -> Text
$sel:verificationMessageTemplate:CreateUserPool' :: CreateUserPool -> Maybe VerificationMessageTemplateType
$sel:usernameConfiguration:CreateUserPool' :: CreateUserPool -> Maybe UsernameConfigurationType
$sel:usernameAttributes:CreateUserPool' :: CreateUserPool -> Maybe [UsernameAttributeType]
$sel:userPoolTags:CreateUserPool' :: CreateUserPool -> Maybe (HashMap Text Text)
$sel:userPoolAddOns:CreateUserPool' :: CreateUserPool -> Maybe UserPoolAddOnsType
$sel:userAttributeUpdateSettings:CreateUserPool' :: CreateUserPool -> Maybe UserAttributeUpdateSettingsType
$sel:smsVerificationMessage:CreateUserPool' :: CreateUserPool -> Maybe Text
$sel:smsConfiguration:CreateUserPool' :: CreateUserPool -> Maybe SmsConfigurationType
$sel:smsAuthenticationMessage:CreateUserPool' :: CreateUserPool -> Maybe Text
$sel:schema:CreateUserPool' :: CreateUserPool -> Maybe (NonEmpty SchemaAttributeType)
$sel:policies:CreateUserPool' :: CreateUserPool -> Maybe UserPoolPolicyType
$sel:mfaConfiguration:CreateUserPool' :: CreateUserPool -> Maybe UserPoolMfaType
$sel:lambdaConfig:CreateUserPool' :: CreateUserPool -> Maybe LambdaConfigType
$sel:emailVerificationSubject:CreateUserPool' :: CreateUserPool -> Maybe Text
$sel:emailVerificationMessage:CreateUserPool' :: CreateUserPool -> Maybe Text
$sel:emailConfiguration:CreateUserPool' :: CreateUserPool -> Maybe EmailConfigurationType
$sel:deviceConfiguration:CreateUserPool' :: CreateUserPool -> Maybe DeviceConfigurationType
$sel:deletionProtection:CreateUserPool' :: CreateUserPool -> Maybe DeletionProtectionType
$sel:autoVerifiedAttributes:CreateUserPool' :: CreateUserPool -> Maybe [VerifiedAttributeType]
$sel:aliasAttributes:CreateUserPool' :: CreateUserPool -> Maybe [AliasAttributeType]
$sel:adminCreateUserConfig:CreateUserPool' :: CreateUserPool -> Maybe AdminCreateUserConfigType
$sel:accountRecoverySetting:CreateUserPool' :: CreateUserPool -> Maybe AccountRecoverySettingType
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AccountRecoverySetting" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AccountRecoverySettingType
accountRecoverySetting,
            (Key
"AdminCreateUserConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AdminCreateUserConfigType
adminCreateUserConfig,
            (Key
"AliasAttributes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AliasAttributeType]
aliasAttributes,
            (Key
"AutoVerifiedAttributes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [VerifiedAttributeType]
autoVerifiedAttributes,
            (Key
"DeletionProtection" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeletionProtectionType
deletionProtection,
            (Key
"DeviceConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeviceConfigurationType
deviceConfiguration,
            (Key
"EmailConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EmailConfigurationType
emailConfiguration,
            (Key
"EmailVerificationMessage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
emailVerificationMessage,
            (Key
"EmailVerificationSubject" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
emailVerificationSubject,
            (Key
"LambdaConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LambdaConfigType
lambdaConfig,
            (Key
"MfaConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UserPoolMfaType
mfaConfiguration,
            (Key
"Policies" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UserPoolPolicyType
policies,
            (Key
"Schema" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty SchemaAttributeType)
schema,
            (Key
"SmsAuthenticationMessage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
smsAuthenticationMessage,
            (Key
"SmsConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SmsConfigurationType
smsConfiguration,
            (Key
"SmsVerificationMessage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
smsVerificationMessage,
            (Key
"UserAttributeUpdateSettings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UserAttributeUpdateSettingsType
userAttributeUpdateSettings,
            (Key
"UserPoolAddOns" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UserPoolAddOnsType
userPoolAddOns,
            (Key
"UserPoolTags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
userPoolTags,
            (Key
"UsernameAttributes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [UsernameAttributeType]
usernameAttributes,
            (Key
"UsernameConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UsernameConfigurationType
usernameConfiguration,
            (Key
"VerificationMessageTemplate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VerificationMessageTemplateType
verificationMessageTemplate,
            forall a. a -> Maybe a
Prelude.Just (Key
"PoolName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
poolName)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateUserPoolResponse' 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:
--
-- 'userPool', 'createUserPoolResponse_userPool' - A container for the user pool details.
--
-- 'httpStatus', 'createUserPoolResponse_httpStatus' - The response's http status code.
newCreateUserPoolResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateUserPoolResponse
newCreateUserPoolResponse :: Int -> CreateUserPoolResponse
newCreateUserPoolResponse Int
pHttpStatus_ =
  CreateUserPoolResponse'
    { $sel:userPool:CreateUserPoolResponse' :: Maybe UserPoolType
userPool = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateUserPoolResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A container for the user pool details.
createUserPoolResponse_userPool :: Lens.Lens' CreateUserPoolResponse (Prelude.Maybe UserPoolType)
createUserPoolResponse_userPool :: Lens' CreateUserPoolResponse (Maybe UserPoolType)
createUserPoolResponse_userPool = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserPoolResponse' {Maybe UserPoolType
userPool :: Maybe UserPoolType
$sel:userPool:CreateUserPoolResponse' :: CreateUserPoolResponse -> Maybe UserPoolType
userPool} -> Maybe UserPoolType
userPool) (\s :: CreateUserPoolResponse
s@CreateUserPoolResponse' {} Maybe UserPoolType
a -> CreateUserPoolResponse
s {$sel:userPool:CreateUserPoolResponse' :: Maybe UserPoolType
userPool = Maybe UserPoolType
a} :: CreateUserPoolResponse)

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

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