{-# 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.ConfirmSignUp
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Confirms registration of a new user.
module Amazonka.CognitoIdentityProvider.ConfirmSignUp
  ( -- * Creating a Request
    ConfirmSignUp (..),
    newConfirmSignUp,

    -- * Request Lenses
    confirmSignUp_analyticsMetadata,
    confirmSignUp_clientMetadata,
    confirmSignUp_forceAliasCreation,
    confirmSignUp_secretHash,
    confirmSignUp_userContextData,
    confirmSignUp_clientId,
    confirmSignUp_username,
    confirmSignUp_confirmationCode,

    -- * Destructuring the Response
    ConfirmSignUpResponse (..),
    newConfirmSignUpResponse,

    -- * Response Lenses
    confirmSignUpResponse_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 confirm registration of a user.
--
-- /See:/ 'newConfirmSignUp' smart constructor.
data ConfirmSignUp = ConfirmSignUp'
  { -- | The Amazon Pinpoint analytics metadata for collecting metrics for
    -- @ConfirmSignUp@ calls.
    ConfirmSignUp -> Maybe AnalyticsMetadataType
analyticsMetadata :: Prelude.Maybe AnalyticsMetadataType,
    -- | A map of custom key-value pairs that you can provide as input for any
    -- custom workflows that this action triggers.
    --
    -- You create custom workflows by assigning Lambda functions to user pool
    -- triggers. When you use the ConfirmSignUp API action, Amazon Cognito
    -- invokes the function that is assigned to the /post confirmation/
    -- trigger. When Amazon Cognito invokes this function, it passes a JSON
    -- payload, which the function receives as input. This payload contains a
    -- @clientMetadata@ attribute, which provides the data that you assigned to
    -- the ClientMetadata parameter in your ConfirmSignUp request. In your
    -- function code in Lambda, you can process the @clientMetadata@ value to
    -- enhance your workflow for your specific needs.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html Customizing user pool Workflows with Lambda Triggers>
    -- in the /Amazon Cognito Developer Guide/.
    --
    -- When you use the ClientMetadata parameter, remember that Amazon Cognito
    -- won\'t do the following:
    --
    -- -   Store the ClientMetadata value. This data is available only to
    --     Lambda triggers that are assigned to a user pool to support custom
    --     workflows. If your user pool configuration doesn\'t include
    --     triggers, the ClientMetadata parameter serves no purpose.
    --
    -- -   Validate the ClientMetadata value.
    --
    -- -   Encrypt the ClientMetadata value. Don\'t use Amazon Cognito to
    --     provide sensitive information.
    ConfirmSignUp -> Maybe (HashMap Text Text)
clientMetadata :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Boolean to be specified to force user confirmation irrespective of
    -- existing alias. By default set to @False@. If this parameter is set to
    -- @True@ and the phone number\/email used for sign up confirmation already
    -- exists as an alias with a different user, the API call will migrate the
    -- alias from the previous user to the newly created user being confirmed.
    -- If set to @False@, the API will throw an __AliasExistsException__ error.
    ConfirmSignUp -> Maybe Bool
forceAliasCreation :: Prelude.Maybe Prelude.Bool,
    -- | A keyed-hash message authentication code (HMAC) calculated using the
    -- secret key of a user pool client and username plus the client ID in the
    -- message.
    ConfirmSignUp -> Maybe (Sensitive Text)
secretHash :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | Contextual data about your user session, such as the device fingerprint,
    -- IP address, or location. Amazon Cognito advanced security evaluates the
    -- risk of an authentication event based on the context that your app
    -- generates and passes to Amazon Cognito when it makes API requests.
    ConfirmSignUp -> Maybe UserContextDataType
userContextData :: Prelude.Maybe UserContextDataType,
    -- | The ID of the app client associated with the user pool.
    ConfirmSignUp -> Sensitive Text
clientId :: Data.Sensitive Prelude.Text,
    -- | The user name of the user whose registration you want to confirm.
    ConfirmSignUp -> Sensitive Text
username :: Data.Sensitive Prelude.Text,
    -- | The confirmation code sent by a user\'s request to confirm registration.
    ConfirmSignUp -> Text
confirmationCode :: Prelude.Text
  }
  deriving (ConfirmSignUp -> ConfirmSignUp -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfirmSignUp -> ConfirmSignUp -> Bool
$c/= :: ConfirmSignUp -> ConfirmSignUp -> Bool
== :: ConfirmSignUp -> ConfirmSignUp -> Bool
$c== :: ConfirmSignUp -> ConfirmSignUp -> Bool
Prelude.Eq, Int -> ConfirmSignUp -> ShowS
[ConfirmSignUp] -> ShowS
ConfirmSignUp -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfirmSignUp] -> ShowS
$cshowList :: [ConfirmSignUp] -> ShowS
show :: ConfirmSignUp -> String
$cshow :: ConfirmSignUp -> String
showsPrec :: Int -> ConfirmSignUp -> ShowS
$cshowsPrec :: Int -> ConfirmSignUp -> ShowS
Prelude.Show, forall x. Rep ConfirmSignUp x -> ConfirmSignUp
forall x. ConfirmSignUp -> Rep ConfirmSignUp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConfirmSignUp x -> ConfirmSignUp
$cfrom :: forall x. ConfirmSignUp -> Rep ConfirmSignUp x
Prelude.Generic)

-- |
-- Create a value of 'ConfirmSignUp' 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:
--
-- 'analyticsMetadata', 'confirmSignUp_analyticsMetadata' - The Amazon Pinpoint analytics metadata for collecting metrics for
-- @ConfirmSignUp@ calls.
--
-- 'clientMetadata', 'confirmSignUp_clientMetadata' - A map of custom key-value pairs that you can provide as input for any
-- custom workflows that this action triggers.
--
-- You create custom workflows by assigning Lambda functions to user pool
-- triggers. When you use the ConfirmSignUp API action, Amazon Cognito
-- invokes the function that is assigned to the /post confirmation/
-- trigger. When Amazon Cognito invokes this function, it passes a JSON
-- payload, which the function receives as input. This payload contains a
-- @clientMetadata@ attribute, which provides the data that you assigned to
-- the ClientMetadata parameter in your ConfirmSignUp request. In your
-- function code in Lambda, you can process the @clientMetadata@ value to
-- enhance your workflow for your specific needs.
--
-- For more information, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html Customizing user pool Workflows with Lambda Triggers>
-- in the /Amazon Cognito Developer Guide/.
--
-- When you use the ClientMetadata parameter, remember that Amazon Cognito
-- won\'t do the following:
--
-- -   Store the ClientMetadata value. This data is available only to
--     Lambda triggers that are assigned to a user pool to support custom
--     workflows. If your user pool configuration doesn\'t include
--     triggers, the ClientMetadata parameter serves no purpose.
--
-- -   Validate the ClientMetadata value.
--
-- -   Encrypt the ClientMetadata value. Don\'t use Amazon Cognito to
--     provide sensitive information.
--
-- 'forceAliasCreation', 'confirmSignUp_forceAliasCreation' - Boolean to be specified to force user confirmation irrespective of
-- existing alias. By default set to @False@. If this parameter is set to
-- @True@ and the phone number\/email used for sign up confirmation already
-- exists as an alias with a different user, the API call will migrate the
-- alias from the previous user to the newly created user being confirmed.
-- If set to @False@, the API will throw an __AliasExistsException__ error.
--
-- 'secretHash', 'confirmSignUp_secretHash' - A keyed-hash message authentication code (HMAC) calculated using the
-- secret key of a user pool client and username plus the client ID in the
-- message.
--
-- 'userContextData', 'confirmSignUp_userContextData' - Contextual data about your user session, such as the device fingerprint,
-- IP address, or location. Amazon Cognito advanced security evaluates the
-- risk of an authentication event based on the context that your app
-- generates and passes to Amazon Cognito when it makes API requests.
--
-- 'clientId', 'confirmSignUp_clientId' - The ID of the app client associated with the user pool.
--
-- 'username', 'confirmSignUp_username' - The user name of the user whose registration you want to confirm.
--
-- 'confirmationCode', 'confirmSignUp_confirmationCode' - The confirmation code sent by a user\'s request to confirm registration.
newConfirmSignUp ::
  -- | 'clientId'
  Prelude.Text ->
  -- | 'username'
  Prelude.Text ->
  -- | 'confirmationCode'
  Prelude.Text ->
  ConfirmSignUp
newConfirmSignUp :: Text -> Text -> Text -> ConfirmSignUp
newConfirmSignUp
  Text
pClientId_
  Text
pUsername_
  Text
pConfirmationCode_ =
    ConfirmSignUp'
      { $sel:analyticsMetadata:ConfirmSignUp' :: Maybe AnalyticsMetadataType
analyticsMetadata = forall a. Maybe a
Prelude.Nothing,
        $sel:clientMetadata:ConfirmSignUp' :: Maybe (HashMap Text Text)
clientMetadata = forall a. Maybe a
Prelude.Nothing,
        $sel:forceAliasCreation:ConfirmSignUp' :: Maybe Bool
forceAliasCreation = forall a. Maybe a
Prelude.Nothing,
        $sel:secretHash:ConfirmSignUp' :: Maybe (Sensitive Text)
secretHash = forall a. Maybe a
Prelude.Nothing,
        $sel:userContextData:ConfirmSignUp' :: Maybe UserContextDataType
userContextData = forall a. Maybe a
Prelude.Nothing,
        $sel:clientId:ConfirmSignUp' :: Sensitive Text
clientId = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pClientId_,
        $sel:username:ConfirmSignUp' :: Sensitive Text
username = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pUsername_,
        $sel:confirmationCode:ConfirmSignUp' :: Text
confirmationCode = Text
pConfirmationCode_
      }

-- | The Amazon Pinpoint analytics metadata for collecting metrics for
-- @ConfirmSignUp@ calls.
confirmSignUp_analyticsMetadata :: Lens.Lens' ConfirmSignUp (Prelude.Maybe AnalyticsMetadataType)
confirmSignUp_analyticsMetadata :: Lens' ConfirmSignUp (Maybe AnalyticsMetadataType)
confirmSignUp_analyticsMetadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmSignUp' {Maybe AnalyticsMetadataType
analyticsMetadata :: Maybe AnalyticsMetadataType
$sel:analyticsMetadata:ConfirmSignUp' :: ConfirmSignUp -> Maybe AnalyticsMetadataType
analyticsMetadata} -> Maybe AnalyticsMetadataType
analyticsMetadata) (\s :: ConfirmSignUp
s@ConfirmSignUp' {} Maybe AnalyticsMetadataType
a -> ConfirmSignUp
s {$sel:analyticsMetadata:ConfirmSignUp' :: Maybe AnalyticsMetadataType
analyticsMetadata = Maybe AnalyticsMetadataType
a} :: ConfirmSignUp)

-- | A map of custom key-value pairs that you can provide as input for any
-- custom workflows that this action triggers.
--
-- You create custom workflows by assigning Lambda functions to user pool
-- triggers. When you use the ConfirmSignUp API action, Amazon Cognito
-- invokes the function that is assigned to the /post confirmation/
-- trigger. When Amazon Cognito invokes this function, it passes a JSON
-- payload, which the function receives as input. This payload contains a
-- @clientMetadata@ attribute, which provides the data that you assigned to
-- the ClientMetadata parameter in your ConfirmSignUp request. In your
-- function code in Lambda, you can process the @clientMetadata@ value to
-- enhance your workflow for your specific needs.
--
-- For more information, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html Customizing user pool Workflows with Lambda Triggers>
-- in the /Amazon Cognito Developer Guide/.
--
-- When you use the ClientMetadata parameter, remember that Amazon Cognito
-- won\'t do the following:
--
-- -   Store the ClientMetadata value. This data is available only to
--     Lambda triggers that are assigned to a user pool to support custom
--     workflows. If your user pool configuration doesn\'t include
--     triggers, the ClientMetadata parameter serves no purpose.
--
-- -   Validate the ClientMetadata value.
--
-- -   Encrypt the ClientMetadata value. Don\'t use Amazon Cognito to
--     provide sensitive information.
confirmSignUp_clientMetadata :: Lens.Lens' ConfirmSignUp (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
confirmSignUp_clientMetadata :: Lens' ConfirmSignUp (Maybe (HashMap Text Text))
confirmSignUp_clientMetadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmSignUp' {Maybe (HashMap Text Text)
clientMetadata :: Maybe (HashMap Text Text)
$sel:clientMetadata:ConfirmSignUp' :: ConfirmSignUp -> Maybe (HashMap Text Text)
clientMetadata} -> Maybe (HashMap Text Text)
clientMetadata) (\s :: ConfirmSignUp
s@ConfirmSignUp' {} Maybe (HashMap Text Text)
a -> ConfirmSignUp
s {$sel:clientMetadata:ConfirmSignUp' :: Maybe (HashMap Text Text)
clientMetadata = Maybe (HashMap Text Text)
a} :: ConfirmSignUp) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Boolean to be specified to force user confirmation irrespective of
-- existing alias. By default set to @False@. If this parameter is set to
-- @True@ and the phone number\/email used for sign up confirmation already
-- exists as an alias with a different user, the API call will migrate the
-- alias from the previous user to the newly created user being confirmed.
-- If set to @False@, the API will throw an __AliasExistsException__ error.
confirmSignUp_forceAliasCreation :: Lens.Lens' ConfirmSignUp (Prelude.Maybe Prelude.Bool)
confirmSignUp_forceAliasCreation :: Lens' ConfirmSignUp (Maybe Bool)
confirmSignUp_forceAliasCreation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmSignUp' {Maybe Bool
forceAliasCreation :: Maybe Bool
$sel:forceAliasCreation:ConfirmSignUp' :: ConfirmSignUp -> Maybe Bool
forceAliasCreation} -> Maybe Bool
forceAliasCreation) (\s :: ConfirmSignUp
s@ConfirmSignUp' {} Maybe Bool
a -> ConfirmSignUp
s {$sel:forceAliasCreation:ConfirmSignUp' :: Maybe Bool
forceAliasCreation = Maybe Bool
a} :: ConfirmSignUp)

-- | A keyed-hash message authentication code (HMAC) calculated using the
-- secret key of a user pool client and username plus the client ID in the
-- message.
confirmSignUp_secretHash :: Lens.Lens' ConfirmSignUp (Prelude.Maybe Prelude.Text)
confirmSignUp_secretHash :: Lens' ConfirmSignUp (Maybe Text)
confirmSignUp_secretHash = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmSignUp' {Maybe (Sensitive Text)
secretHash :: Maybe (Sensitive Text)
$sel:secretHash:ConfirmSignUp' :: ConfirmSignUp -> Maybe (Sensitive Text)
secretHash} -> Maybe (Sensitive Text)
secretHash) (\s :: ConfirmSignUp
s@ConfirmSignUp' {} Maybe (Sensitive Text)
a -> ConfirmSignUp
s {$sel:secretHash:ConfirmSignUp' :: Maybe (Sensitive Text)
secretHash = Maybe (Sensitive Text)
a} :: ConfirmSignUp) 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 a. Iso' (Sensitive a) a
Data._Sensitive

-- | Contextual data about your user session, such as the device fingerprint,
-- IP address, or location. Amazon Cognito advanced security evaluates the
-- risk of an authentication event based on the context that your app
-- generates and passes to Amazon Cognito when it makes API requests.
confirmSignUp_userContextData :: Lens.Lens' ConfirmSignUp (Prelude.Maybe UserContextDataType)
confirmSignUp_userContextData :: Lens' ConfirmSignUp (Maybe UserContextDataType)
confirmSignUp_userContextData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmSignUp' {Maybe UserContextDataType
userContextData :: Maybe UserContextDataType
$sel:userContextData:ConfirmSignUp' :: ConfirmSignUp -> Maybe UserContextDataType
userContextData} -> Maybe UserContextDataType
userContextData) (\s :: ConfirmSignUp
s@ConfirmSignUp' {} Maybe UserContextDataType
a -> ConfirmSignUp
s {$sel:userContextData:ConfirmSignUp' :: Maybe UserContextDataType
userContextData = Maybe UserContextDataType
a} :: ConfirmSignUp)

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

-- | The user name of the user whose registration you want to confirm.
confirmSignUp_username :: Lens.Lens' ConfirmSignUp Prelude.Text
confirmSignUp_username :: Lens' ConfirmSignUp Text
confirmSignUp_username = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmSignUp' {Sensitive Text
username :: Sensitive Text
$sel:username:ConfirmSignUp' :: ConfirmSignUp -> Sensitive Text
username} -> Sensitive Text
username) (\s :: ConfirmSignUp
s@ConfirmSignUp' {} Sensitive Text
a -> ConfirmSignUp
s {$sel:username:ConfirmSignUp' :: Sensitive Text
username = Sensitive Text
a} :: ConfirmSignUp) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The confirmation code sent by a user\'s request to confirm registration.
confirmSignUp_confirmationCode :: Lens.Lens' ConfirmSignUp Prelude.Text
confirmSignUp_confirmationCode :: Lens' ConfirmSignUp Text
confirmSignUp_confirmationCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmSignUp' {Text
confirmationCode :: Text
$sel:confirmationCode:ConfirmSignUp' :: ConfirmSignUp -> Text
confirmationCode} -> Text
confirmationCode) (\s :: ConfirmSignUp
s@ConfirmSignUp' {} Text
a -> ConfirmSignUp
s {$sel:confirmationCode:ConfirmSignUp' :: Text
confirmationCode = Text
a} :: ConfirmSignUp)

instance Core.AWSRequest ConfirmSignUp where
  type
    AWSResponse ConfirmSignUp =
      ConfirmSignUpResponse
  request :: (Service -> Service) -> ConfirmSignUp -> Request ConfirmSignUp
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 ConfirmSignUp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ConfirmSignUp)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> ConfirmSignUpResponse
ConfirmSignUpResponse'
            forall (f :: * -> *) a b. Functor 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 ConfirmSignUp where
  hashWithSalt :: Int -> ConfirmSignUp -> Int
hashWithSalt Int
_salt ConfirmSignUp' {Maybe Bool
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe AnalyticsMetadataType
Maybe UserContextDataType
Text
Sensitive Text
confirmationCode :: Text
username :: Sensitive Text
clientId :: Sensitive Text
userContextData :: Maybe UserContextDataType
secretHash :: Maybe (Sensitive Text)
forceAliasCreation :: Maybe Bool
clientMetadata :: Maybe (HashMap Text Text)
analyticsMetadata :: Maybe AnalyticsMetadataType
$sel:confirmationCode:ConfirmSignUp' :: ConfirmSignUp -> Text
$sel:username:ConfirmSignUp' :: ConfirmSignUp -> Sensitive Text
$sel:clientId:ConfirmSignUp' :: ConfirmSignUp -> Sensitive Text
$sel:userContextData:ConfirmSignUp' :: ConfirmSignUp -> Maybe UserContextDataType
$sel:secretHash:ConfirmSignUp' :: ConfirmSignUp -> Maybe (Sensitive Text)
$sel:forceAliasCreation:ConfirmSignUp' :: ConfirmSignUp -> Maybe Bool
$sel:clientMetadata:ConfirmSignUp' :: ConfirmSignUp -> Maybe (HashMap Text Text)
$sel:analyticsMetadata:ConfirmSignUp' :: ConfirmSignUp -> Maybe AnalyticsMetadataType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AnalyticsMetadataType
analyticsMetadata
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
clientMetadata
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
forceAliasCreation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
secretHash
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UserContextDataType
userContextData
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
clientId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
username
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
confirmationCode

instance Prelude.NFData ConfirmSignUp where
  rnf :: ConfirmSignUp -> ()
rnf ConfirmSignUp' {Maybe Bool
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe AnalyticsMetadataType
Maybe UserContextDataType
Text
Sensitive Text
confirmationCode :: Text
username :: Sensitive Text
clientId :: Sensitive Text
userContextData :: Maybe UserContextDataType
secretHash :: Maybe (Sensitive Text)
forceAliasCreation :: Maybe Bool
clientMetadata :: Maybe (HashMap Text Text)
analyticsMetadata :: Maybe AnalyticsMetadataType
$sel:confirmationCode:ConfirmSignUp' :: ConfirmSignUp -> Text
$sel:username:ConfirmSignUp' :: ConfirmSignUp -> Sensitive Text
$sel:clientId:ConfirmSignUp' :: ConfirmSignUp -> Sensitive Text
$sel:userContextData:ConfirmSignUp' :: ConfirmSignUp -> Maybe UserContextDataType
$sel:secretHash:ConfirmSignUp' :: ConfirmSignUp -> Maybe (Sensitive Text)
$sel:forceAliasCreation:ConfirmSignUp' :: ConfirmSignUp -> Maybe Bool
$sel:clientMetadata:ConfirmSignUp' :: ConfirmSignUp -> Maybe (HashMap Text Text)
$sel:analyticsMetadata:ConfirmSignUp' :: ConfirmSignUp -> Maybe AnalyticsMetadataType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AnalyticsMetadataType
analyticsMetadata
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
clientMetadata
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
forceAliasCreation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
secretHash
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UserContextDataType
userContextData
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
clientId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
username
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
confirmationCode

instance Data.ToHeaders ConfirmSignUp where
  toHeaders :: ConfirmSignUp -> 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.ConfirmSignUp" ::
                          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 ConfirmSignUp where
  toJSON :: ConfirmSignUp -> Value
toJSON ConfirmSignUp' {Maybe Bool
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe AnalyticsMetadataType
Maybe UserContextDataType
Text
Sensitive Text
confirmationCode :: Text
username :: Sensitive Text
clientId :: Sensitive Text
userContextData :: Maybe UserContextDataType
secretHash :: Maybe (Sensitive Text)
forceAliasCreation :: Maybe Bool
clientMetadata :: Maybe (HashMap Text Text)
analyticsMetadata :: Maybe AnalyticsMetadataType
$sel:confirmationCode:ConfirmSignUp' :: ConfirmSignUp -> Text
$sel:username:ConfirmSignUp' :: ConfirmSignUp -> Sensitive Text
$sel:clientId:ConfirmSignUp' :: ConfirmSignUp -> Sensitive Text
$sel:userContextData:ConfirmSignUp' :: ConfirmSignUp -> Maybe UserContextDataType
$sel:secretHash:ConfirmSignUp' :: ConfirmSignUp -> Maybe (Sensitive Text)
$sel:forceAliasCreation:ConfirmSignUp' :: ConfirmSignUp -> Maybe Bool
$sel:clientMetadata:ConfirmSignUp' :: ConfirmSignUp -> Maybe (HashMap Text Text)
$sel:analyticsMetadata:ConfirmSignUp' :: ConfirmSignUp -> Maybe AnalyticsMetadataType
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AnalyticsMetadata" 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 AnalyticsMetadataType
analyticsMetadata,
            (Key
"ClientMetadata" 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)
clientMetadata,
            (Key
"ForceAliasCreation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
forceAliasCreation,
            (Key
"SecretHash" 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 (Sensitive Text)
secretHash,
            (Key
"UserContextData" 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 UserContextDataType
userContextData,
            forall a. a -> Maybe a
Prelude.Just (Key
"ClientId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
clientId),
            forall a. a -> Maybe a
Prelude.Just (Key
"Username" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
username),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ConfirmationCode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
confirmationCode)
          ]
      )

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

instance Data.ToQuery ConfirmSignUp where
  toQuery :: ConfirmSignUp -> 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 registration
-- confirmation.
--
-- /See:/ 'newConfirmSignUpResponse' smart constructor.
data ConfirmSignUpResponse = ConfirmSignUpResponse'
  { -- | The response's http status code.
    ConfirmSignUpResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ConfirmSignUpResponse -> ConfirmSignUpResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfirmSignUpResponse -> ConfirmSignUpResponse -> Bool
$c/= :: ConfirmSignUpResponse -> ConfirmSignUpResponse -> Bool
== :: ConfirmSignUpResponse -> ConfirmSignUpResponse -> Bool
$c== :: ConfirmSignUpResponse -> ConfirmSignUpResponse -> Bool
Prelude.Eq, ReadPrec [ConfirmSignUpResponse]
ReadPrec ConfirmSignUpResponse
Int -> ReadS ConfirmSignUpResponse
ReadS [ConfirmSignUpResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConfirmSignUpResponse]
$creadListPrec :: ReadPrec [ConfirmSignUpResponse]
readPrec :: ReadPrec ConfirmSignUpResponse
$creadPrec :: ReadPrec ConfirmSignUpResponse
readList :: ReadS [ConfirmSignUpResponse]
$creadList :: ReadS [ConfirmSignUpResponse]
readsPrec :: Int -> ReadS ConfirmSignUpResponse
$creadsPrec :: Int -> ReadS ConfirmSignUpResponse
Prelude.Read, Int -> ConfirmSignUpResponse -> ShowS
[ConfirmSignUpResponse] -> ShowS
ConfirmSignUpResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfirmSignUpResponse] -> ShowS
$cshowList :: [ConfirmSignUpResponse] -> ShowS
show :: ConfirmSignUpResponse -> String
$cshow :: ConfirmSignUpResponse -> String
showsPrec :: Int -> ConfirmSignUpResponse -> ShowS
$cshowsPrec :: Int -> ConfirmSignUpResponse -> ShowS
Prelude.Show, forall x. Rep ConfirmSignUpResponse x -> ConfirmSignUpResponse
forall x. ConfirmSignUpResponse -> Rep ConfirmSignUpResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConfirmSignUpResponse x -> ConfirmSignUpResponse
$cfrom :: forall x. ConfirmSignUpResponse -> Rep ConfirmSignUpResponse x
Prelude.Generic)

-- |
-- Create a value of 'ConfirmSignUpResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'confirmSignUpResponse_httpStatus' - The response's http status code.
newConfirmSignUpResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ConfirmSignUpResponse
newConfirmSignUpResponse :: Int -> ConfirmSignUpResponse
newConfirmSignUpResponse Int
pHttpStatus_ =
  ConfirmSignUpResponse' {$sel:httpStatus:ConfirmSignUpResponse' :: Int
httpStatus = Int
pHttpStatus_}

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

instance Prelude.NFData ConfirmSignUpResponse where
  rnf :: ConfirmSignUpResponse -> ()
rnf ConfirmSignUpResponse' {Int
httpStatus :: Int
$sel:httpStatus:ConfirmSignUpResponse' :: ConfirmSignUpResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus