{-# 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-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)
--
-- 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,
-- 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.CreateUserPool
  ( -- * Creating a Request
    CreateUserPool (..),
    newCreateUserPool,

    -- * Request Lenses
    createUserPool_userPoolTags,
    createUserPool_verificationMessageTemplate,
    createUserPool_emailVerificationMessage,
    createUserPool_smsAuthenticationMessage,
    createUserPool_userPoolAddOns,
    createUserPool_emailVerificationSubject,
    createUserPool_usernameAttributes,
    createUserPool_aliasAttributes,
    createUserPool_schema,
    createUserPool_accountRecoverySetting,
    createUserPool_emailConfiguration,
    createUserPool_smsVerificationMessage,
    createUserPool_mfaConfiguration,
    createUserPool_lambdaConfig,
    createUserPool_smsConfiguration,
    createUserPool_adminCreateUserConfig,
    createUserPool_deviceConfiguration,
    createUserPool_autoVerifiedAttributes,
    createUserPool_policies,
    createUserPool_usernameConfiguration,
    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.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 create a user pool.
--
-- /See:/ 'newCreateUserPool' smart constructor.
data CreateUserPool = 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 -> Maybe (HashMap Text Text)
userPoolTags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | 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 representing the email verification message.
    -- EmailVerificationMessage is allowed only if
    -- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_EmailConfigurationType.html#CognitoUserPools-Type-EmailConfigurationType-EmailSendingAccount EmailSendingAccount>
    -- is DEVELOPER.
    CreateUserPool -> Maybe Text
emailVerificationMessage :: Prelude.Maybe Prelude.Text,
    -- | A string representing the SMS authentication message.
    CreateUserPool -> Maybe Text
smsAuthenticationMessage :: Prelude.Maybe Prelude.Text,
    -- | Used to enable advanced security risk detection. Set the key
    -- @AdvancedSecurityMode@ to the value \"AUDIT\".
    CreateUserPool -> Maybe UserPoolAddOnsType
userPoolAddOns :: Prelude.Maybe UserPoolAddOnsType,
    -- | A string representing the email verification subject.
    -- EmailVerificationSubject is allowed only if
    -- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_EmailConfigurationType.html#CognitoUserPools-Type-EmailConfigurationType-EmailSendingAccount EmailSendingAccount>
    -- is DEVELOPER.
    CreateUserPool -> Maybe Text
emailVerificationSubject :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether email addresses or phone numbers can be specified as
    -- usernames when a user signs up.
    CreateUserPool -> Maybe [UsernameAttributeType]
usernameAttributes :: Prelude.Maybe [UsernameAttributeType],
    -- | Attributes supported as an alias for this user pool. Possible values:
    -- __phone_number__, __email__, or __preferred_username__.
    CreateUserPool -> Maybe [AliasAttributeType]
aliasAttributes :: Prelude.Maybe [AliasAttributeType],
    -- | 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),
    -- | 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.
    CreateUserPool -> Maybe AccountRecoverySettingType
accountRecoverySetting :: Prelude.Maybe AccountRecoverySettingType,
    -- | The email configuration.
    CreateUserPool -> Maybe EmailConfigurationType
emailConfiguration :: Prelude.Maybe EmailConfigurationType,
    -- | A string representing the SMS verification message.
    CreateUserPool -> Maybe Text
smsVerificationMessage :: Prelude.Maybe Prelude.Text,
    -- | Specifies MFA configuration details.
    CreateUserPool -> Maybe UserPoolMfaType
mfaConfiguration :: Prelude.Maybe UserPoolMfaType,
    -- | 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 will need to
    -- 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,
    -- | The SMS configuration.
    CreateUserPool -> Maybe SmsConfigurationType
smsConfiguration :: Prelude.Maybe SmsConfigurationType,
    -- | The configuration for @AdminCreateUser@ requests.
    CreateUserPool -> Maybe AdminCreateUserConfigType
adminCreateUserConfig :: Prelude.Maybe AdminCreateUserConfigType,
    -- | The device configuration.
    CreateUserPool -> Maybe DeviceConfigurationType
deviceConfiguration :: Prelude.Maybe DeviceConfigurationType,
    -- | The attributes to be auto-verified. Possible values: __email__,
    -- __phone_number__.
    CreateUserPool -> Maybe [VerifiedAttributeType]
autoVerifiedAttributes :: Prelude.Maybe [VerifiedAttributeType],
    -- | The policies associated with the new user pool.
    CreateUserPool -> Maybe UserPoolPolicyType
policies :: Prelude.Maybe UserPoolPolicyType,
    -- | You can choose to set case sensitivity on the username input for the
    -- selected sign-in option. For example, when this is set to @False@, users
    -- will be able to 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,
    -- | A string used to name the user pool.
    CreateUserPool -> Text
poolName :: Prelude.Text
  }
  deriving (CreateUserPool -> CreateUserPool -> Bool
(CreateUserPool -> CreateUserPool -> Bool)
-> (CreateUserPool -> CreateUserPool -> Bool) -> Eq CreateUserPool
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]
(Int -> ReadS CreateUserPool)
-> ReadS [CreateUserPool]
-> ReadPrec CreateUserPool
-> ReadPrec [CreateUserPool]
-> Read 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
(Int -> CreateUserPool -> ShowS)
-> (CreateUserPool -> String)
-> ([CreateUserPool] -> ShowS)
-> Show CreateUserPool
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. CreateUserPool -> Rep CreateUserPool x)
-> (forall x. Rep CreateUserPool x -> CreateUserPool)
-> Generic CreateUserPool
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:
--
-- '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.
--
-- 'verificationMessageTemplate', 'createUserPool_verificationMessageTemplate' - The template for the verification message that the user sees when the
-- app requests permission to access the user\'s information.
--
-- 'emailVerificationMessage', 'createUserPool_emailVerificationMessage' - A string representing the email verification message.
-- EmailVerificationMessage is allowed only if
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_EmailConfigurationType.html#CognitoUserPools-Type-EmailConfigurationType-EmailSendingAccount EmailSendingAccount>
-- is DEVELOPER.
--
-- 'smsAuthenticationMessage', 'createUserPool_smsAuthenticationMessage' - A string representing the SMS authentication message.
--
-- 'userPoolAddOns', 'createUserPool_userPoolAddOns' - Used to enable advanced security risk detection. Set the key
-- @AdvancedSecurityMode@ to the value \"AUDIT\".
--
-- 'emailVerificationSubject', 'createUserPool_emailVerificationSubject' - A string representing the email verification subject.
-- EmailVerificationSubject is allowed only if
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_EmailConfigurationType.html#CognitoUserPools-Type-EmailConfigurationType-EmailSendingAccount EmailSendingAccount>
-- is DEVELOPER.
--
-- 'usernameAttributes', 'createUserPool_usernameAttributes' - Specifies whether email addresses or phone numbers can be specified as
-- usernames when a user signs up.
--
-- 'aliasAttributes', 'createUserPool_aliasAttributes' - Attributes supported as an alias for this user pool. Possible values:
-- __phone_number__, __email__, or __preferred_username__.
--
-- 'schema', 'createUserPool_schema' - An array of schema attributes for the new user pool. These attributes
-- can be standard or custom attributes.
--
-- 'accountRecoverySetting', 'createUserPool_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', 'createUserPool_emailConfiguration' - The email configuration.
--
-- 'smsVerificationMessage', 'createUserPool_smsVerificationMessage' - A string representing the SMS verification message.
--
-- 'mfaConfiguration', 'createUserPool_mfaConfiguration' - Specifies MFA configuration details.
--
-- '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 will need to
-- 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>
-- .
--
-- 'smsConfiguration', 'createUserPool_smsConfiguration' - The SMS configuration.
--
-- 'adminCreateUserConfig', 'createUserPool_adminCreateUserConfig' - The configuration for @AdminCreateUser@ requests.
--
-- 'deviceConfiguration', 'createUserPool_deviceConfiguration' - The device configuration.
--
-- 'autoVerifiedAttributes', 'createUserPool_autoVerifiedAttributes' - The attributes to be auto-verified. Possible values: __email__,
-- __phone_number__.
--
-- 'policies', 'createUserPool_policies' - The policies associated with the new user pool.
--
-- 'usernameConfiguration', 'createUserPool_usernameConfiguration' - You can choose to set case sensitivity on the username input for the
-- selected sign-in option. For example, when this is set to @False@, users
-- will be able to 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>.
--
-- 'poolName', 'createUserPool_poolName' - A string used to name the user pool.
newCreateUserPool ::
  -- | 'poolName'
  Prelude.Text ->
  CreateUserPool
newCreateUserPool :: Text -> CreateUserPool
newCreateUserPool Text
pPoolName_ =
  CreateUserPool' :: Maybe (HashMap Text Text)
-> Maybe VerificationMessageTemplateType
-> Maybe Text
-> Maybe Text
-> Maybe UserPoolAddOnsType
-> Maybe Text
-> Maybe [UsernameAttributeType]
-> Maybe [AliasAttributeType]
-> Maybe (NonEmpty SchemaAttributeType)
-> Maybe AccountRecoverySettingType
-> Maybe EmailConfigurationType
-> Maybe Text
-> Maybe UserPoolMfaType
-> Maybe LambdaConfigType
-> Maybe SmsConfigurationType
-> Maybe AdminCreateUserConfigType
-> Maybe DeviceConfigurationType
-> Maybe [VerifiedAttributeType]
-> Maybe UserPoolPolicyType
-> Maybe UsernameConfigurationType
-> Text
-> CreateUserPool
CreateUserPool'
    { $sel:userPoolTags:CreateUserPool' :: Maybe (HashMap Text Text)
userPoolTags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:verificationMessageTemplate:CreateUserPool' :: Maybe VerificationMessageTemplateType
verificationMessageTemplate = Maybe VerificationMessageTemplateType
forall a. Maybe a
Prelude.Nothing,
      $sel:emailVerificationMessage:CreateUserPool' :: Maybe Text
emailVerificationMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:smsAuthenticationMessage:CreateUserPool' :: Maybe Text
smsAuthenticationMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolAddOns:CreateUserPool' :: Maybe UserPoolAddOnsType
userPoolAddOns = Maybe UserPoolAddOnsType
forall a. Maybe a
Prelude.Nothing,
      $sel:emailVerificationSubject:CreateUserPool' :: Maybe Text
emailVerificationSubject = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:usernameAttributes:CreateUserPool' :: Maybe [UsernameAttributeType]
usernameAttributes = Maybe [UsernameAttributeType]
forall a. Maybe a
Prelude.Nothing,
      $sel:aliasAttributes:CreateUserPool' :: Maybe [AliasAttributeType]
aliasAttributes = Maybe [AliasAttributeType]
forall a. Maybe a
Prelude.Nothing,
      $sel:schema:CreateUserPool' :: Maybe (NonEmpty SchemaAttributeType)
schema = Maybe (NonEmpty SchemaAttributeType)
forall a. Maybe a
Prelude.Nothing,
      $sel:accountRecoverySetting:CreateUserPool' :: Maybe AccountRecoverySettingType
accountRecoverySetting = Maybe AccountRecoverySettingType
forall a. Maybe a
Prelude.Nothing,
      $sel:emailConfiguration:CreateUserPool' :: Maybe EmailConfigurationType
emailConfiguration = Maybe EmailConfigurationType
forall a. Maybe a
Prelude.Nothing,
      $sel:smsVerificationMessage:CreateUserPool' :: Maybe Text
smsVerificationMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:mfaConfiguration:CreateUserPool' :: Maybe UserPoolMfaType
mfaConfiguration = Maybe UserPoolMfaType
forall a. Maybe a
Prelude.Nothing,
      $sel:lambdaConfig:CreateUserPool' :: Maybe LambdaConfigType
lambdaConfig = Maybe LambdaConfigType
forall a. Maybe a
Prelude.Nothing,
      $sel:smsConfiguration:CreateUserPool' :: Maybe SmsConfigurationType
smsConfiguration = Maybe SmsConfigurationType
forall a. Maybe a
Prelude.Nothing,
      $sel:adminCreateUserConfig:CreateUserPool' :: Maybe AdminCreateUserConfigType
adminCreateUserConfig = Maybe AdminCreateUserConfigType
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceConfiguration:CreateUserPool' :: Maybe DeviceConfigurationType
deviceConfiguration = Maybe DeviceConfigurationType
forall a. Maybe a
Prelude.Nothing,
      $sel:autoVerifiedAttributes:CreateUserPool' :: Maybe [VerifiedAttributeType]
autoVerifiedAttributes = Maybe [VerifiedAttributeType]
forall a. Maybe a
Prelude.Nothing,
      $sel:policies:CreateUserPool' :: Maybe UserPoolPolicyType
policies = Maybe UserPoolPolicyType
forall a. Maybe a
Prelude.Nothing,
      $sel:usernameConfiguration:CreateUserPool' :: Maybe UsernameConfigurationType
usernameConfiguration = Maybe UsernameConfigurationType
forall a. Maybe a
Prelude.Nothing,
      $sel:poolName:CreateUserPool' :: Text
poolName = Text
pPoolName_
    }

-- | 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 :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateUserPool -> f CreateUserPool
createUserPool_userPoolTags = (CreateUserPool -> Maybe (HashMap Text Text))
-> (CreateUserPool -> Maybe (HashMap Text Text) -> CreateUserPool)
-> Lens
     CreateUserPool
     CreateUserPool
     (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 (\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) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateUserPool -> f CreateUserPool)
-> ((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)))
-> CreateUserPool
-> f CreateUserPool
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 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 :: (Maybe VerificationMessageTemplateType
 -> f (Maybe VerificationMessageTemplateType))
-> CreateUserPool -> f CreateUserPool
createUserPool_verificationMessageTemplate = (CreateUserPool -> Maybe VerificationMessageTemplateType)
-> (CreateUserPool
    -> Maybe VerificationMessageTemplateType -> CreateUserPool)
-> Lens
     CreateUserPool
     CreateUserPool
     (Maybe VerificationMessageTemplateType)
     (Maybe VerificationMessageTemplateType)
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 representing the email verification message.
-- EmailVerificationMessage is allowed only if
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_EmailConfigurationType.html#CognitoUserPools-Type-EmailConfigurationType-EmailSendingAccount EmailSendingAccount>
-- is DEVELOPER.
createUserPool_emailVerificationMessage :: Lens.Lens' CreateUserPool (Prelude.Maybe Prelude.Text)
createUserPool_emailVerificationMessage :: (Maybe Text -> f (Maybe Text))
-> CreateUserPool -> f CreateUserPool
createUserPool_emailVerificationMessage = (CreateUserPool -> Maybe Text)
-> (CreateUserPool -> Maybe Text -> CreateUserPool)
-> Lens CreateUserPool CreateUserPool (Maybe Text) (Maybe Text)
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)

-- | A string representing the SMS authentication message.
createUserPool_smsAuthenticationMessage :: Lens.Lens' CreateUserPool (Prelude.Maybe Prelude.Text)
createUserPool_smsAuthenticationMessage :: (Maybe Text -> f (Maybe Text))
-> CreateUserPool -> f CreateUserPool
createUserPool_smsAuthenticationMessage = (CreateUserPool -> Maybe Text)
-> (CreateUserPool -> Maybe Text -> CreateUserPool)
-> Lens CreateUserPool CreateUserPool (Maybe Text) (Maybe Text)
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)

-- | Used to enable advanced security risk detection. Set the key
-- @AdvancedSecurityMode@ to the value \"AUDIT\".
createUserPool_userPoolAddOns :: Lens.Lens' CreateUserPool (Prelude.Maybe UserPoolAddOnsType)
createUserPool_userPoolAddOns :: (Maybe UserPoolAddOnsType -> f (Maybe UserPoolAddOnsType))
-> CreateUserPool -> f CreateUserPool
createUserPool_userPoolAddOns = (CreateUserPool -> Maybe UserPoolAddOnsType)
-> (CreateUserPool -> Maybe UserPoolAddOnsType -> CreateUserPool)
-> Lens
     CreateUserPool
     CreateUserPool
     (Maybe UserPoolAddOnsType)
     (Maybe UserPoolAddOnsType)
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)

-- | A string representing the email verification subject.
-- EmailVerificationSubject is allowed only if
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_EmailConfigurationType.html#CognitoUserPools-Type-EmailConfigurationType-EmailSendingAccount EmailSendingAccount>
-- is DEVELOPER.
createUserPool_emailVerificationSubject :: Lens.Lens' CreateUserPool (Prelude.Maybe Prelude.Text)
createUserPool_emailVerificationSubject :: (Maybe Text -> f (Maybe Text))
-> CreateUserPool -> f CreateUserPool
createUserPool_emailVerificationSubject = (CreateUserPool -> Maybe Text)
-> (CreateUserPool -> Maybe Text -> CreateUserPool)
-> Lens CreateUserPool CreateUserPool (Maybe Text) (Maybe Text)
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)

-- | Specifies whether email addresses or phone numbers can be specified as
-- usernames when a user signs up.
createUserPool_usernameAttributes :: Lens.Lens' CreateUserPool (Prelude.Maybe [UsernameAttributeType])
createUserPool_usernameAttributes :: (Maybe [UsernameAttributeType]
 -> f (Maybe [UsernameAttributeType]))
-> CreateUserPool -> f CreateUserPool
createUserPool_usernameAttributes = (CreateUserPool -> Maybe [UsernameAttributeType])
-> (CreateUserPool
    -> Maybe [UsernameAttributeType] -> CreateUserPool)
-> Lens
     CreateUserPool
     CreateUserPool
     (Maybe [UsernameAttributeType])
     (Maybe [UsernameAttributeType])
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) ((Maybe [UsernameAttributeType]
  -> f (Maybe [UsernameAttributeType]))
 -> CreateUserPool -> f CreateUserPool)
-> ((Maybe [UsernameAttributeType]
     -> f (Maybe [UsernameAttributeType]))
    -> Maybe [UsernameAttributeType]
    -> f (Maybe [UsernameAttributeType]))
-> (Maybe [UsernameAttributeType]
    -> f (Maybe [UsernameAttributeType]))
-> CreateUserPool
-> f CreateUserPool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [UsernameAttributeType]
  [UsernameAttributeType]
  [UsernameAttributeType]
  [UsernameAttributeType]
-> Iso
     (Maybe [UsernameAttributeType])
     (Maybe [UsernameAttributeType])
     (Maybe [UsernameAttributeType])
     (Maybe [UsernameAttributeType])
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
  [UsernameAttributeType]
  [UsernameAttributeType]
  [UsernameAttributeType]
  [UsernameAttributeType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: (Maybe [AliasAttributeType] -> f (Maybe [AliasAttributeType]))
-> CreateUserPool -> f CreateUserPool
createUserPool_aliasAttributes = (CreateUserPool -> Maybe [AliasAttributeType])
-> (CreateUserPool -> Maybe [AliasAttributeType] -> CreateUserPool)
-> Lens
     CreateUserPool
     CreateUserPool
     (Maybe [AliasAttributeType])
     (Maybe [AliasAttributeType])
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) ((Maybe [AliasAttributeType] -> f (Maybe [AliasAttributeType]))
 -> CreateUserPool -> f CreateUserPool)
-> ((Maybe [AliasAttributeType] -> f (Maybe [AliasAttributeType]))
    -> Maybe [AliasAttributeType] -> f (Maybe [AliasAttributeType]))
-> (Maybe [AliasAttributeType] -> f (Maybe [AliasAttributeType]))
-> CreateUserPool
-> f CreateUserPool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AliasAttributeType]
  [AliasAttributeType]
  [AliasAttributeType]
  [AliasAttributeType]
-> Iso
     (Maybe [AliasAttributeType])
     (Maybe [AliasAttributeType])
     (Maybe [AliasAttributeType])
     (Maybe [AliasAttributeType])
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
  [AliasAttributeType]
  [AliasAttributeType]
  [AliasAttributeType]
  [AliasAttributeType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: (Maybe (NonEmpty SchemaAttributeType)
 -> f (Maybe (NonEmpty SchemaAttributeType)))
-> CreateUserPool -> f CreateUserPool
createUserPool_schema = (CreateUserPool -> Maybe (NonEmpty SchemaAttributeType))
-> (CreateUserPool
    -> Maybe (NonEmpty SchemaAttributeType) -> CreateUserPool)
-> Lens
     CreateUserPool
     CreateUserPool
     (Maybe (NonEmpty SchemaAttributeType))
     (Maybe (NonEmpty SchemaAttributeType))
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) ((Maybe (NonEmpty SchemaAttributeType)
  -> f (Maybe (NonEmpty SchemaAttributeType)))
 -> CreateUserPool -> f CreateUserPool)
-> ((Maybe (NonEmpty SchemaAttributeType)
     -> f (Maybe (NonEmpty SchemaAttributeType)))
    -> Maybe (NonEmpty SchemaAttributeType)
    -> f (Maybe (NonEmpty SchemaAttributeType)))
-> (Maybe (NonEmpty SchemaAttributeType)
    -> f (Maybe (NonEmpty SchemaAttributeType)))
-> CreateUserPool
-> f CreateUserPool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty SchemaAttributeType)
  (NonEmpty SchemaAttributeType)
  (NonEmpty SchemaAttributeType)
  (NonEmpty SchemaAttributeType)
-> Iso
     (Maybe (NonEmpty SchemaAttributeType))
     (Maybe (NonEmpty SchemaAttributeType))
     (Maybe (NonEmpty SchemaAttributeType))
     (Maybe (NonEmpty SchemaAttributeType))
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
  (NonEmpty SchemaAttributeType)
  (NonEmpty SchemaAttributeType)
  (NonEmpty SchemaAttributeType)
  (NonEmpty SchemaAttributeType)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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.
createUserPool_accountRecoverySetting :: Lens.Lens' CreateUserPool (Prelude.Maybe AccountRecoverySettingType)
createUserPool_accountRecoverySetting :: (Maybe AccountRecoverySettingType
 -> f (Maybe AccountRecoverySettingType))
-> CreateUserPool -> f CreateUserPool
createUserPool_accountRecoverySetting = (CreateUserPool -> Maybe AccountRecoverySettingType)
-> (CreateUserPool
    -> Maybe AccountRecoverySettingType -> CreateUserPool)
-> Lens
     CreateUserPool
     CreateUserPool
     (Maybe AccountRecoverySettingType)
     (Maybe AccountRecoverySettingType)
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 email configuration.
createUserPool_emailConfiguration :: Lens.Lens' CreateUserPool (Prelude.Maybe EmailConfigurationType)
createUserPool_emailConfiguration :: (Maybe EmailConfigurationType -> f (Maybe EmailConfigurationType))
-> CreateUserPool -> f CreateUserPool
createUserPool_emailConfiguration = (CreateUserPool -> Maybe EmailConfigurationType)
-> (CreateUserPool
    -> Maybe EmailConfigurationType -> CreateUserPool)
-> Lens
     CreateUserPool
     CreateUserPool
     (Maybe EmailConfigurationType)
     (Maybe EmailConfigurationType)
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)

-- | A string representing the SMS verification message.
createUserPool_smsVerificationMessage :: Lens.Lens' CreateUserPool (Prelude.Maybe Prelude.Text)
createUserPool_smsVerificationMessage :: (Maybe Text -> f (Maybe Text))
-> CreateUserPool -> f CreateUserPool
createUserPool_smsVerificationMessage = (CreateUserPool -> Maybe Text)
-> (CreateUserPool -> Maybe Text -> CreateUserPool)
-> Lens CreateUserPool CreateUserPool (Maybe Text) (Maybe Text)
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)

-- | Specifies MFA configuration details.
createUserPool_mfaConfiguration :: Lens.Lens' CreateUserPool (Prelude.Maybe UserPoolMfaType)
createUserPool_mfaConfiguration :: (Maybe UserPoolMfaType -> f (Maybe UserPoolMfaType))
-> CreateUserPool -> f CreateUserPool
createUserPool_mfaConfiguration = (CreateUserPool -> Maybe UserPoolMfaType)
-> (CreateUserPool -> Maybe UserPoolMfaType -> CreateUserPool)
-> Lens
     CreateUserPool
     CreateUserPool
     (Maybe UserPoolMfaType)
     (Maybe UserPoolMfaType)
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 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 will need to
-- 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 :: (Maybe LambdaConfigType -> f (Maybe LambdaConfigType))
-> CreateUserPool -> f CreateUserPool
createUserPool_lambdaConfig = (CreateUserPool -> Maybe LambdaConfigType)
-> (CreateUserPool -> Maybe LambdaConfigType -> CreateUserPool)
-> Lens
     CreateUserPool
     CreateUserPool
     (Maybe LambdaConfigType)
     (Maybe LambdaConfigType)
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)

-- | The SMS configuration.
createUserPool_smsConfiguration :: Lens.Lens' CreateUserPool (Prelude.Maybe SmsConfigurationType)
createUserPool_smsConfiguration :: (Maybe SmsConfigurationType -> f (Maybe SmsConfigurationType))
-> CreateUserPool -> f CreateUserPool
createUserPool_smsConfiguration = (CreateUserPool -> Maybe SmsConfigurationType)
-> (CreateUserPool -> Maybe SmsConfigurationType -> CreateUserPool)
-> Lens
     CreateUserPool
     CreateUserPool
     (Maybe SmsConfigurationType)
     (Maybe SmsConfigurationType)
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)

-- | The configuration for @AdminCreateUser@ requests.
createUserPool_adminCreateUserConfig :: Lens.Lens' CreateUserPool (Prelude.Maybe AdminCreateUserConfigType)
createUserPool_adminCreateUserConfig :: (Maybe AdminCreateUserConfigType
 -> f (Maybe AdminCreateUserConfigType))
-> CreateUserPool -> f CreateUserPool
createUserPool_adminCreateUserConfig = (CreateUserPool -> Maybe AdminCreateUserConfigType)
-> (CreateUserPool
    -> Maybe AdminCreateUserConfigType -> CreateUserPool)
-> Lens
     CreateUserPool
     CreateUserPool
     (Maybe AdminCreateUserConfigType)
     (Maybe AdminCreateUserConfigType)
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)

-- | The device configuration.
createUserPool_deviceConfiguration :: Lens.Lens' CreateUserPool (Prelude.Maybe DeviceConfigurationType)
createUserPool_deviceConfiguration :: (Maybe DeviceConfigurationType
 -> f (Maybe DeviceConfigurationType))
-> CreateUserPool -> f CreateUserPool
createUserPool_deviceConfiguration = (CreateUserPool -> Maybe DeviceConfigurationType)
-> (CreateUserPool
    -> Maybe DeviceConfigurationType -> CreateUserPool)
-> Lens
     CreateUserPool
     CreateUserPool
     (Maybe DeviceConfigurationType)
     (Maybe DeviceConfigurationType)
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 attributes to be auto-verified. Possible values: __email__,
-- __phone_number__.
createUserPool_autoVerifiedAttributes :: Lens.Lens' CreateUserPool (Prelude.Maybe [VerifiedAttributeType])
createUserPool_autoVerifiedAttributes :: (Maybe [VerifiedAttributeType]
 -> f (Maybe [VerifiedAttributeType]))
-> CreateUserPool -> f CreateUserPool
createUserPool_autoVerifiedAttributes = (CreateUserPool -> Maybe [VerifiedAttributeType])
-> (CreateUserPool
    -> Maybe [VerifiedAttributeType] -> CreateUserPool)
-> Lens
     CreateUserPool
     CreateUserPool
     (Maybe [VerifiedAttributeType])
     (Maybe [VerifiedAttributeType])
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) ((Maybe [VerifiedAttributeType]
  -> f (Maybe [VerifiedAttributeType]))
 -> CreateUserPool -> f CreateUserPool)
-> ((Maybe [VerifiedAttributeType]
     -> f (Maybe [VerifiedAttributeType]))
    -> Maybe [VerifiedAttributeType]
    -> f (Maybe [VerifiedAttributeType]))
-> (Maybe [VerifiedAttributeType]
    -> f (Maybe [VerifiedAttributeType]))
-> CreateUserPool
-> f CreateUserPool
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

-- | The policies associated with the new user pool.
createUserPool_policies :: Lens.Lens' CreateUserPool (Prelude.Maybe UserPoolPolicyType)
createUserPool_policies :: (Maybe UserPoolPolicyType -> f (Maybe UserPoolPolicyType))
-> CreateUserPool -> f CreateUserPool
createUserPool_policies = (CreateUserPool -> Maybe UserPoolPolicyType)
-> (CreateUserPool -> Maybe UserPoolPolicyType -> CreateUserPool)
-> Lens
     CreateUserPool
     CreateUserPool
     (Maybe UserPoolPolicyType)
     (Maybe UserPoolPolicyType)
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)

-- | You can choose to set case sensitivity on the username input for the
-- selected sign-in option. For example, when this is set to @False@, users
-- will be able to 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 :: (Maybe UsernameConfigurationType
 -> f (Maybe UsernameConfigurationType))
-> CreateUserPool -> f CreateUserPool
createUserPool_usernameConfiguration = (CreateUserPool -> Maybe UsernameConfigurationType)
-> (CreateUserPool
    -> Maybe UsernameConfigurationType -> CreateUserPool)
-> Lens
     CreateUserPool
     CreateUserPool
     (Maybe UsernameConfigurationType)
     (Maybe UsernameConfigurationType)
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)

-- | A string used to name the user pool.
createUserPool_poolName :: Lens.Lens' CreateUserPool Prelude.Text
createUserPool_poolName :: (Text -> f Text) -> CreateUserPool -> f CreateUserPool
createUserPool_poolName = (CreateUserPool -> Text)
-> (CreateUserPool -> Text -> CreateUserPool)
-> Lens CreateUserPool CreateUserPool Text Text
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 :: CreateUserPool -> Request CreateUserPool
request = Service -> CreateUserPool -> Request CreateUserPool
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateUserPool
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateUserPool)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateUserPool))
-> Logger
-> Service
-> Proxy CreateUserPool
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateUserPool)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe UserPoolType -> Int -> CreateUserPoolResponse
CreateUserPoolResponse'
            (Maybe UserPoolType -> Int -> CreateUserPoolResponse)
-> Either String (Maybe UserPoolType)
-> Either String (Int -> CreateUserPoolResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe UserPoolType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UserPool")
            Either String (Int -> CreateUserPoolResponse)
-> Either String Int -> Either String CreateUserPoolResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateUserPool

instance Prelude.NFData CreateUserPool

instance Core.ToHeaders CreateUserPool where
  toHeaders :: CreateUserPool -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateUserPool -> 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.CreateUserPool" ::
                          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 CreateUserPool where
  toJSON :: CreateUserPool -> Value
toJSON CreateUserPool' {Maybe [AliasAttributeType]
Maybe [UsernameAttributeType]
Maybe [VerifiedAttributeType]
Maybe (NonEmpty SchemaAttributeType)
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 UsernameConfigurationType
Maybe VerificationMessageTemplateType
Text
poolName :: Text
usernameConfiguration :: Maybe UsernameConfigurationType
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
schema :: Maybe (NonEmpty SchemaAttributeType)
aliasAttributes :: Maybe [AliasAttributeType]
usernameAttributes :: Maybe [UsernameAttributeType]
emailVerificationSubject :: Maybe Text
userPoolAddOns :: Maybe UserPoolAddOnsType
smsAuthenticationMessage :: Maybe Text
emailVerificationMessage :: Maybe Text
verificationMessageTemplate :: Maybe VerificationMessageTemplateType
userPoolTags :: Maybe (HashMap Text Text)
$sel:poolName:CreateUserPool' :: CreateUserPool -> Text
$sel:usernameConfiguration:CreateUserPool' :: CreateUserPool -> Maybe UsernameConfigurationType
$sel:policies:CreateUserPool' :: CreateUserPool -> Maybe UserPoolPolicyType
$sel:autoVerifiedAttributes:CreateUserPool' :: CreateUserPool -> Maybe [VerifiedAttributeType]
$sel:deviceConfiguration:CreateUserPool' :: CreateUserPool -> Maybe DeviceConfigurationType
$sel:adminCreateUserConfig:CreateUserPool' :: CreateUserPool -> Maybe AdminCreateUserConfigType
$sel:smsConfiguration:CreateUserPool' :: CreateUserPool -> Maybe SmsConfigurationType
$sel:lambdaConfig:CreateUserPool' :: CreateUserPool -> Maybe LambdaConfigType
$sel:mfaConfiguration:CreateUserPool' :: CreateUserPool -> Maybe UserPoolMfaType
$sel:smsVerificationMessage:CreateUserPool' :: CreateUserPool -> Maybe Text
$sel:emailConfiguration:CreateUserPool' :: CreateUserPool -> Maybe EmailConfigurationType
$sel:accountRecoverySetting:CreateUserPool' :: CreateUserPool -> Maybe AccountRecoverySettingType
$sel:schema:CreateUserPool' :: CreateUserPool -> Maybe (NonEmpty SchemaAttributeType)
$sel:aliasAttributes:CreateUserPool' :: CreateUserPool -> Maybe [AliasAttributeType]
$sel:usernameAttributes:CreateUserPool' :: CreateUserPool -> Maybe [UsernameAttributeType]
$sel:emailVerificationSubject:CreateUserPool' :: CreateUserPool -> Maybe Text
$sel:userPoolAddOns:CreateUserPool' :: CreateUserPool -> Maybe UserPoolAddOnsType
$sel:smsAuthenticationMessage:CreateUserPool' :: CreateUserPool -> Maybe Text
$sel:emailVerificationMessage:CreateUserPool' :: CreateUserPool -> Maybe Text
$sel:verificationMessageTemplate:CreateUserPool' :: CreateUserPool -> Maybe VerificationMessageTemplateType
$sel:userPoolTags:CreateUserPool' :: CreateUserPool -> 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
"UsernameAttributes" Text -> [UsernameAttributeType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([UsernameAttributeType] -> Pair)
-> Maybe [UsernameAttributeType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [UsernameAttributeType]
usernameAttributes,
            (Text
"AliasAttributes" Text -> [AliasAttributeType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([AliasAttributeType] -> Pair)
-> Maybe [AliasAttributeType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AliasAttributeType]
aliasAttributes,
            (Text
"Schema" Text -> NonEmpty SchemaAttributeType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty SchemaAttributeType -> Pair)
-> Maybe (NonEmpty SchemaAttributeType) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty SchemaAttributeType)
schema,
            (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,
            (Text
"UsernameConfiguration" Text -> UsernameConfigurationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (UsernameConfigurationType -> Pair)
-> Maybe UsernameConfigurationType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UsernameConfigurationType
usernameConfiguration,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"PoolName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
poolName)
          ]
      )

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

instance Core.ToQuery CreateUserPool where
  toQuery :: CreateUserPool -> QueryString
toQuery = QueryString -> CreateUserPool -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(CreateUserPoolResponse -> CreateUserPoolResponse -> Bool)
-> (CreateUserPoolResponse -> CreateUserPoolResponse -> Bool)
-> Eq CreateUserPoolResponse
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]
(Int -> ReadS CreateUserPoolResponse)
-> ReadS [CreateUserPoolResponse]
-> ReadPrec CreateUserPoolResponse
-> ReadPrec [CreateUserPoolResponse]
-> Read 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
(Int -> CreateUserPoolResponse -> ShowS)
-> (CreateUserPoolResponse -> String)
-> ([CreateUserPoolResponse] -> ShowS)
-> Show CreateUserPoolResponse
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. CreateUserPoolResponse -> Rep CreateUserPoolResponse x)
-> (forall x.
    Rep CreateUserPoolResponse x -> CreateUserPoolResponse)
-> Generic CreateUserPoolResponse
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' :: Maybe UserPoolType -> Int -> CreateUserPoolResponse
CreateUserPoolResponse'
    { $sel:userPool:CreateUserPoolResponse' :: Maybe UserPoolType
userPool = Maybe UserPoolType
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 :: (Maybe UserPoolType -> f (Maybe UserPoolType))
-> CreateUserPoolResponse -> f CreateUserPoolResponse
createUserPoolResponse_userPool = (CreateUserPoolResponse -> Maybe UserPoolType)
-> (CreateUserPoolResponse
    -> Maybe UserPoolType -> CreateUserPoolResponse)
-> Lens
     CreateUserPoolResponse
     CreateUserPoolResponse
     (Maybe UserPoolType)
     (Maybe UserPoolType)
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 :: (Int -> f Int)
-> CreateUserPoolResponse -> f CreateUserPoolResponse
createUserPoolResponse_httpStatus = (CreateUserPoolResponse -> Int)
-> (CreateUserPoolResponse -> Int -> CreateUserPoolResponse)
-> Lens CreateUserPoolResponse CreateUserPoolResponse Int Int
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