{-# 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.ConfirmForgotPassword
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Allows a user to enter a confirmation code to reset a forgotten
-- password.
module Amazonka.CognitoIdentityProvider.ConfirmForgotPassword
  ( -- * Creating a Request
    ConfirmForgotPassword (..),
    newConfirmForgotPassword,

    -- * Request Lenses
    confirmForgotPassword_analyticsMetadata,
    confirmForgotPassword_clientMetadata,
    confirmForgotPassword_secretHash,
    confirmForgotPassword_userContextData,
    confirmForgotPassword_clientId,
    confirmForgotPassword_username,
    confirmForgotPassword_confirmationCode,
    confirmForgotPassword_password,

    -- * Destructuring the Response
    ConfirmForgotPasswordResponse (..),
    newConfirmForgotPasswordResponse,

    -- * Response Lenses
    confirmForgotPasswordResponse_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

-- | The request representing the confirmation for a password reset.
--
-- /See:/ 'newConfirmForgotPassword' smart constructor.
data ConfirmForgotPassword = ConfirmForgotPassword'
  { -- | The Amazon Pinpoint analytics metadata for collecting metrics for
    -- @ConfirmForgotPassword@ calls.
    ConfirmForgotPassword -> 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 ConfirmForgotPassword 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 ConfirmForgotPassword 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.
    ConfirmForgotPassword -> Maybe (HashMap Text Text)
clientMetadata :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | 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.
    ConfirmForgotPassword -> 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.
    ConfirmForgotPassword -> Maybe UserContextDataType
userContextData :: Prelude.Maybe UserContextDataType,
    -- | The app client ID of the app associated with the user pool.
    ConfirmForgotPassword -> Sensitive Text
clientId :: Data.Sensitive Prelude.Text,
    -- | The user name of the user for whom you want to enter a code to retrieve
    -- a forgotten password.
    ConfirmForgotPassword -> Sensitive Text
username :: Data.Sensitive Prelude.Text,
    -- | The confirmation code from your user\'s request to reset their password.
    -- For more information, see
    -- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ForgotPassword.html ForgotPassword>.
    ConfirmForgotPassword -> Text
confirmationCode :: Prelude.Text,
    -- | The new password that your user wants to set.
    ConfirmForgotPassword -> Sensitive Text
password :: Data.Sensitive Prelude.Text
  }
  deriving (ConfirmForgotPassword -> ConfirmForgotPassword -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfirmForgotPassword -> ConfirmForgotPassword -> Bool
$c/= :: ConfirmForgotPassword -> ConfirmForgotPassword -> Bool
== :: ConfirmForgotPassword -> ConfirmForgotPassword -> Bool
$c== :: ConfirmForgotPassword -> ConfirmForgotPassword -> Bool
Prelude.Eq, Int -> ConfirmForgotPassword -> ShowS
[ConfirmForgotPassword] -> ShowS
ConfirmForgotPassword -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfirmForgotPassword] -> ShowS
$cshowList :: [ConfirmForgotPassword] -> ShowS
show :: ConfirmForgotPassword -> String
$cshow :: ConfirmForgotPassword -> String
showsPrec :: Int -> ConfirmForgotPassword -> ShowS
$cshowsPrec :: Int -> ConfirmForgotPassword -> ShowS
Prelude.Show, forall x. Rep ConfirmForgotPassword x -> ConfirmForgotPassword
forall x. ConfirmForgotPassword -> Rep ConfirmForgotPassword x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConfirmForgotPassword x -> ConfirmForgotPassword
$cfrom :: forall x. ConfirmForgotPassword -> Rep ConfirmForgotPassword x
Prelude.Generic)

-- |
-- Create a value of 'ConfirmForgotPassword' 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', 'confirmForgotPassword_analyticsMetadata' - The Amazon Pinpoint analytics metadata for collecting metrics for
-- @ConfirmForgotPassword@ calls.
--
-- 'clientMetadata', 'confirmForgotPassword_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 ConfirmForgotPassword 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 ConfirmForgotPassword 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.
--
-- 'secretHash', 'confirmForgotPassword_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', 'confirmForgotPassword_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', 'confirmForgotPassword_clientId' - The app client ID of the app associated with the user pool.
--
-- 'username', 'confirmForgotPassword_username' - The user name of the user for whom you want to enter a code to retrieve
-- a forgotten password.
--
-- 'confirmationCode', 'confirmForgotPassword_confirmationCode' - The confirmation code from your user\'s request to reset their password.
-- For more information, see
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ForgotPassword.html ForgotPassword>.
--
-- 'password', 'confirmForgotPassword_password' - The new password that your user wants to set.
newConfirmForgotPassword ::
  -- | 'clientId'
  Prelude.Text ->
  -- | 'username'
  Prelude.Text ->
  -- | 'confirmationCode'
  Prelude.Text ->
  -- | 'password'
  Prelude.Text ->
  ConfirmForgotPassword
newConfirmForgotPassword :: Text -> Text -> Text -> Text -> ConfirmForgotPassword
newConfirmForgotPassword
  Text
pClientId_
  Text
pUsername_
  Text
pConfirmationCode_
  Text
pPassword_ =
    ConfirmForgotPassword'
      { $sel:analyticsMetadata:ConfirmForgotPassword' :: Maybe AnalyticsMetadataType
analyticsMetadata =
          forall a. Maybe a
Prelude.Nothing,
        $sel:clientMetadata:ConfirmForgotPassword' :: Maybe (HashMap Text Text)
clientMetadata = forall a. Maybe a
Prelude.Nothing,
        $sel:secretHash:ConfirmForgotPassword' :: Maybe (Sensitive Text)
secretHash = forall a. Maybe a
Prelude.Nothing,
        $sel:userContextData:ConfirmForgotPassword' :: Maybe UserContextDataType
userContextData = forall a. Maybe a
Prelude.Nothing,
        $sel:clientId:ConfirmForgotPassword' :: Sensitive Text
clientId = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pClientId_,
        $sel:username:ConfirmForgotPassword' :: Sensitive Text
username = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pUsername_,
        $sel:confirmationCode:ConfirmForgotPassword' :: Text
confirmationCode = Text
pConfirmationCode_,
        $sel:password:ConfirmForgotPassword' :: Sensitive Text
password = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pPassword_
      }

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

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

-- | A 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.
confirmForgotPassword_secretHash :: Lens.Lens' ConfirmForgotPassword (Prelude.Maybe Prelude.Text)
confirmForgotPassword_secretHash :: Lens' ConfirmForgotPassword (Maybe Text)
confirmForgotPassword_secretHash = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmForgotPassword' {Maybe (Sensitive Text)
secretHash :: Maybe (Sensitive Text)
$sel:secretHash:ConfirmForgotPassword' :: ConfirmForgotPassword -> Maybe (Sensitive Text)
secretHash} -> Maybe (Sensitive Text)
secretHash) (\s :: ConfirmForgotPassword
s@ConfirmForgotPassword' {} Maybe (Sensitive Text)
a -> ConfirmForgotPassword
s {$sel:secretHash:ConfirmForgotPassword' :: Maybe (Sensitive Text)
secretHash = Maybe (Sensitive Text)
a} :: ConfirmForgotPassword) 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.
confirmForgotPassword_userContextData :: Lens.Lens' ConfirmForgotPassword (Prelude.Maybe UserContextDataType)
confirmForgotPassword_userContextData :: Lens' ConfirmForgotPassword (Maybe UserContextDataType)
confirmForgotPassword_userContextData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmForgotPassword' {Maybe UserContextDataType
userContextData :: Maybe UserContextDataType
$sel:userContextData:ConfirmForgotPassword' :: ConfirmForgotPassword -> Maybe UserContextDataType
userContextData} -> Maybe UserContextDataType
userContextData) (\s :: ConfirmForgotPassword
s@ConfirmForgotPassword' {} Maybe UserContextDataType
a -> ConfirmForgotPassword
s {$sel:userContextData:ConfirmForgotPassword' :: Maybe UserContextDataType
userContextData = Maybe UserContextDataType
a} :: ConfirmForgotPassword)

-- | The app client ID of the app associated with the user pool.
confirmForgotPassword_clientId :: Lens.Lens' ConfirmForgotPassword Prelude.Text
confirmForgotPassword_clientId :: Lens' ConfirmForgotPassword Text
confirmForgotPassword_clientId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmForgotPassword' {Sensitive Text
clientId :: Sensitive Text
$sel:clientId:ConfirmForgotPassword' :: ConfirmForgotPassword -> Sensitive Text
clientId} -> Sensitive Text
clientId) (\s :: ConfirmForgotPassword
s@ConfirmForgotPassword' {} Sensitive Text
a -> ConfirmForgotPassword
s {$sel:clientId:ConfirmForgotPassword' :: Sensitive Text
clientId = Sensitive Text
a} :: ConfirmForgotPassword) 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 for whom you want to enter a code to retrieve
-- a forgotten password.
confirmForgotPassword_username :: Lens.Lens' ConfirmForgotPassword Prelude.Text
confirmForgotPassword_username :: Lens' ConfirmForgotPassword Text
confirmForgotPassword_username = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmForgotPassword' {Sensitive Text
username :: Sensitive Text
$sel:username:ConfirmForgotPassword' :: ConfirmForgotPassword -> Sensitive Text
username} -> Sensitive Text
username) (\s :: ConfirmForgotPassword
s@ConfirmForgotPassword' {} Sensitive Text
a -> ConfirmForgotPassword
s {$sel:username:ConfirmForgotPassword' :: Sensitive Text
username = Sensitive Text
a} :: ConfirmForgotPassword) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The confirmation code from your user\'s request to reset their password.
-- For more information, see
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ForgotPassword.html ForgotPassword>.
confirmForgotPassword_confirmationCode :: Lens.Lens' ConfirmForgotPassword Prelude.Text
confirmForgotPassword_confirmationCode :: Lens' ConfirmForgotPassword Text
confirmForgotPassword_confirmationCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmForgotPassword' {Text
confirmationCode :: Text
$sel:confirmationCode:ConfirmForgotPassword' :: ConfirmForgotPassword -> Text
confirmationCode} -> Text
confirmationCode) (\s :: ConfirmForgotPassword
s@ConfirmForgotPassword' {} Text
a -> ConfirmForgotPassword
s {$sel:confirmationCode:ConfirmForgotPassword' :: Text
confirmationCode = Text
a} :: ConfirmForgotPassword)

-- | The new password that your user wants to set.
confirmForgotPassword_password :: Lens.Lens' ConfirmForgotPassword Prelude.Text
confirmForgotPassword_password :: Lens' ConfirmForgotPassword Text
confirmForgotPassword_password = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmForgotPassword' {Sensitive Text
password :: Sensitive Text
$sel:password:ConfirmForgotPassword' :: ConfirmForgotPassword -> Sensitive Text
password} -> Sensitive Text
password) (\s :: ConfirmForgotPassword
s@ConfirmForgotPassword' {} Sensitive Text
a -> ConfirmForgotPassword
s {$sel:password:ConfirmForgotPassword' :: Sensitive Text
password = Sensitive Text
a} :: ConfirmForgotPassword) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

instance Core.AWSRequest ConfirmForgotPassword where
  type
    AWSResponse ConfirmForgotPassword =
      ConfirmForgotPasswordResponse
  request :: (Service -> Service)
-> ConfirmForgotPassword -> Request ConfirmForgotPassword
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 ConfirmForgotPassword
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ConfirmForgotPassword)))
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 -> ConfirmForgotPasswordResponse
ConfirmForgotPasswordResponse'
            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 ConfirmForgotPassword where
  hashWithSalt :: Int -> ConfirmForgotPassword -> Int
hashWithSalt Int
_salt ConfirmForgotPassword' {Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe AnalyticsMetadataType
Maybe UserContextDataType
Text
Sensitive Text
password :: Sensitive Text
confirmationCode :: Text
username :: Sensitive Text
clientId :: Sensitive Text
userContextData :: Maybe UserContextDataType
secretHash :: Maybe (Sensitive Text)
clientMetadata :: Maybe (HashMap Text Text)
analyticsMetadata :: Maybe AnalyticsMetadataType
$sel:password:ConfirmForgotPassword' :: ConfirmForgotPassword -> Sensitive Text
$sel:confirmationCode:ConfirmForgotPassword' :: ConfirmForgotPassword -> Text
$sel:username:ConfirmForgotPassword' :: ConfirmForgotPassword -> Sensitive Text
$sel:clientId:ConfirmForgotPassword' :: ConfirmForgotPassword -> Sensitive Text
$sel:userContextData:ConfirmForgotPassword' :: ConfirmForgotPassword -> Maybe UserContextDataType
$sel:secretHash:ConfirmForgotPassword' :: ConfirmForgotPassword -> Maybe (Sensitive Text)
$sel:clientMetadata:ConfirmForgotPassword' :: ConfirmForgotPassword -> Maybe (HashMap Text Text)
$sel:analyticsMetadata:ConfirmForgotPassword' :: ConfirmForgotPassword -> 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 (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
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
password

instance Prelude.NFData ConfirmForgotPassword where
  rnf :: ConfirmForgotPassword -> ()
rnf ConfirmForgotPassword' {Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe AnalyticsMetadataType
Maybe UserContextDataType
Text
Sensitive Text
password :: Sensitive Text
confirmationCode :: Text
username :: Sensitive Text
clientId :: Sensitive Text
userContextData :: Maybe UserContextDataType
secretHash :: Maybe (Sensitive Text)
clientMetadata :: Maybe (HashMap Text Text)
analyticsMetadata :: Maybe AnalyticsMetadataType
$sel:password:ConfirmForgotPassword' :: ConfirmForgotPassword -> Sensitive Text
$sel:confirmationCode:ConfirmForgotPassword' :: ConfirmForgotPassword -> Text
$sel:username:ConfirmForgotPassword' :: ConfirmForgotPassword -> Sensitive Text
$sel:clientId:ConfirmForgotPassword' :: ConfirmForgotPassword -> Sensitive Text
$sel:userContextData:ConfirmForgotPassword' :: ConfirmForgotPassword -> Maybe UserContextDataType
$sel:secretHash:ConfirmForgotPassword' :: ConfirmForgotPassword -> Maybe (Sensitive Text)
$sel:clientMetadata:ConfirmForgotPassword' :: ConfirmForgotPassword -> Maybe (HashMap Text Text)
$sel:analyticsMetadata:ConfirmForgotPassword' :: ConfirmForgotPassword -> 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 (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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
password

instance Data.ToHeaders ConfirmForgotPassword where
  toHeaders :: ConfirmForgotPassword -> 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.ConfirmForgotPassword" ::
                          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 ConfirmForgotPassword where
  toJSON :: ConfirmForgotPassword -> Value
toJSON ConfirmForgotPassword' {Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe AnalyticsMetadataType
Maybe UserContextDataType
Text
Sensitive Text
password :: Sensitive Text
confirmationCode :: Text
username :: Sensitive Text
clientId :: Sensitive Text
userContextData :: Maybe UserContextDataType
secretHash :: Maybe (Sensitive Text)
clientMetadata :: Maybe (HashMap Text Text)
analyticsMetadata :: Maybe AnalyticsMetadataType
$sel:password:ConfirmForgotPassword' :: ConfirmForgotPassword -> Sensitive Text
$sel:confirmationCode:ConfirmForgotPassword' :: ConfirmForgotPassword -> Text
$sel:username:ConfirmForgotPassword' :: ConfirmForgotPassword -> Sensitive Text
$sel:clientId:ConfirmForgotPassword' :: ConfirmForgotPassword -> Sensitive Text
$sel:userContextData:ConfirmForgotPassword' :: ConfirmForgotPassword -> Maybe UserContextDataType
$sel:secretHash:ConfirmForgotPassword' :: ConfirmForgotPassword -> Maybe (Sensitive Text)
$sel:clientMetadata:ConfirmForgotPassword' :: ConfirmForgotPassword -> Maybe (HashMap Text Text)
$sel:analyticsMetadata:ConfirmForgotPassword' :: ConfirmForgotPassword -> 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
"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),
            forall a. a -> Maybe a
Prelude.Just (Key
"Password" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
password)
          ]
      )

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

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

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

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

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

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