{-# 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.GetUserAttributeVerificationCode
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Generates a user attribute verification code for the specified attribute
-- name. Sends a message to a user with a code that they must return in a
-- VerifyUserAttribute request.
--
-- This action might generate an SMS text message. Starting June 1, 2021,
-- US telecom carriers require you to register an origination phone number
-- before you can send SMS messages to US phone numbers. If you use SMS
-- text messages in Amazon Cognito, you must register a phone number with
-- <https://console.aws.amazon.com/pinpoint/home/ Amazon Pinpoint>. Amazon
-- Cognito uses the registered number automatically. Otherwise, Amazon
-- Cognito users who must receive SMS messages might not be able to sign
-- up, activate their accounts, or sign in.
--
-- If you have never used SMS text messages with Amazon Cognito or any
-- other Amazon Web Service, Amazon Simple Notification Service might place
-- your account in the SMS sandbox. In
-- /<https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html sandbox mode>/
-- , you can send messages only to verified phone numbers. After you test
-- your app while in the sandbox environment, you can move out of the
-- sandbox and into production. For more information, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html SMS message settings for Amazon Cognito user pools>
-- in the /Amazon Cognito Developer Guide/.
module Amazonka.CognitoIdentityProvider.GetUserAttributeVerificationCode
  ( -- * Creating a Request
    GetUserAttributeVerificationCode (..),
    newGetUserAttributeVerificationCode,

    -- * Request Lenses
    getUserAttributeVerificationCode_clientMetadata,
    getUserAttributeVerificationCode_accessToken,
    getUserAttributeVerificationCode_attributeName,

    -- * Destructuring the Response
    GetUserAttributeVerificationCodeResponse (..),
    newGetUserAttributeVerificationCodeResponse,

    -- * Response Lenses
    getUserAttributeVerificationCodeResponse_codeDeliveryDetails,
    getUserAttributeVerificationCodeResponse_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 get user attribute verification.
--
-- /See:/ 'newGetUserAttributeVerificationCode' smart constructor.
data GetUserAttributeVerificationCode = GetUserAttributeVerificationCode'
  { -- | 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 GetUserAttributeVerificationCode API action,
    -- Amazon Cognito invokes the function that is assigned to the /custom
    -- message/ 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
    -- GetUserAttributeVerificationCode 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.
    GetUserAttributeVerificationCode -> Maybe (HashMap Text Text)
clientMetadata :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A non-expired access token for the user whose attribute verification
    -- code you want to generate.
    GetUserAttributeVerificationCode -> Sensitive Text
accessToken :: Data.Sensitive Prelude.Text,
    -- | The attribute name returned by the server response to get the user
    -- attribute verification code.
    GetUserAttributeVerificationCode -> Text
attributeName :: Prelude.Text
  }
  deriving (GetUserAttributeVerificationCode
-> GetUserAttributeVerificationCode -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetUserAttributeVerificationCode
-> GetUserAttributeVerificationCode -> Bool
$c/= :: GetUserAttributeVerificationCode
-> GetUserAttributeVerificationCode -> Bool
== :: GetUserAttributeVerificationCode
-> GetUserAttributeVerificationCode -> Bool
$c== :: GetUserAttributeVerificationCode
-> GetUserAttributeVerificationCode -> Bool
Prelude.Eq, Int -> GetUserAttributeVerificationCode -> ShowS
[GetUserAttributeVerificationCode] -> ShowS
GetUserAttributeVerificationCode -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetUserAttributeVerificationCode] -> ShowS
$cshowList :: [GetUserAttributeVerificationCode] -> ShowS
show :: GetUserAttributeVerificationCode -> String
$cshow :: GetUserAttributeVerificationCode -> String
showsPrec :: Int -> GetUserAttributeVerificationCode -> ShowS
$cshowsPrec :: Int -> GetUserAttributeVerificationCode -> ShowS
Prelude.Show, forall x.
Rep GetUserAttributeVerificationCode x
-> GetUserAttributeVerificationCode
forall x.
GetUserAttributeVerificationCode
-> Rep GetUserAttributeVerificationCode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetUserAttributeVerificationCode x
-> GetUserAttributeVerificationCode
$cfrom :: forall x.
GetUserAttributeVerificationCode
-> Rep GetUserAttributeVerificationCode x
Prelude.Generic)

-- |
-- Create a value of 'GetUserAttributeVerificationCode' 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:
--
-- 'clientMetadata', 'getUserAttributeVerificationCode_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 GetUserAttributeVerificationCode API action,
-- Amazon Cognito invokes the function that is assigned to the /custom
-- message/ 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
-- GetUserAttributeVerificationCode 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.
--
-- 'accessToken', 'getUserAttributeVerificationCode_accessToken' - A non-expired access token for the user whose attribute verification
-- code you want to generate.
--
-- 'attributeName', 'getUserAttributeVerificationCode_attributeName' - The attribute name returned by the server response to get the user
-- attribute verification code.
newGetUserAttributeVerificationCode ::
  -- | 'accessToken'
  Prelude.Text ->
  -- | 'attributeName'
  Prelude.Text ->
  GetUserAttributeVerificationCode
newGetUserAttributeVerificationCode :: Text -> Text -> GetUserAttributeVerificationCode
newGetUserAttributeVerificationCode
  Text
pAccessToken_
  Text
pAttributeName_ =
    GetUserAttributeVerificationCode'
      { $sel:clientMetadata:GetUserAttributeVerificationCode' :: Maybe (HashMap Text Text)
clientMetadata =
          forall a. Maybe a
Prelude.Nothing,
        $sel:accessToken:GetUserAttributeVerificationCode' :: Sensitive Text
accessToken =
          forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pAccessToken_,
        $sel:attributeName:GetUserAttributeVerificationCode' :: Text
attributeName = Text
pAttributeName_
      }

-- | 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 GetUserAttributeVerificationCode API action,
-- Amazon Cognito invokes the function that is assigned to the /custom
-- message/ 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
-- GetUserAttributeVerificationCode 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.
getUserAttributeVerificationCode_clientMetadata :: Lens.Lens' GetUserAttributeVerificationCode (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getUserAttributeVerificationCode_clientMetadata :: Lens' GetUserAttributeVerificationCode (Maybe (HashMap Text Text))
getUserAttributeVerificationCode_clientMetadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUserAttributeVerificationCode' {Maybe (HashMap Text Text)
clientMetadata :: Maybe (HashMap Text Text)
$sel:clientMetadata:GetUserAttributeVerificationCode' :: GetUserAttributeVerificationCode -> Maybe (HashMap Text Text)
clientMetadata} -> Maybe (HashMap Text Text)
clientMetadata) (\s :: GetUserAttributeVerificationCode
s@GetUserAttributeVerificationCode' {} Maybe (HashMap Text Text)
a -> GetUserAttributeVerificationCode
s {$sel:clientMetadata:GetUserAttributeVerificationCode' :: Maybe (HashMap Text Text)
clientMetadata = Maybe (HashMap Text Text)
a} :: GetUserAttributeVerificationCode) 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 non-expired access token for the user whose attribute verification
-- code you want to generate.
getUserAttributeVerificationCode_accessToken :: Lens.Lens' GetUserAttributeVerificationCode Prelude.Text
getUserAttributeVerificationCode_accessToken :: Lens' GetUserAttributeVerificationCode Text
getUserAttributeVerificationCode_accessToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUserAttributeVerificationCode' {Sensitive Text
accessToken :: Sensitive Text
$sel:accessToken:GetUserAttributeVerificationCode' :: GetUserAttributeVerificationCode -> Sensitive Text
accessToken} -> Sensitive Text
accessToken) (\s :: GetUserAttributeVerificationCode
s@GetUserAttributeVerificationCode' {} Sensitive Text
a -> GetUserAttributeVerificationCode
s {$sel:accessToken:GetUserAttributeVerificationCode' :: Sensitive Text
accessToken = Sensitive Text
a} :: GetUserAttributeVerificationCode) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The attribute name returned by the server response to get the user
-- attribute verification code.
getUserAttributeVerificationCode_attributeName :: Lens.Lens' GetUserAttributeVerificationCode Prelude.Text
getUserAttributeVerificationCode_attributeName :: Lens' GetUserAttributeVerificationCode Text
getUserAttributeVerificationCode_attributeName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUserAttributeVerificationCode' {Text
attributeName :: Text
$sel:attributeName:GetUserAttributeVerificationCode' :: GetUserAttributeVerificationCode -> Text
attributeName} -> Text
attributeName) (\s :: GetUserAttributeVerificationCode
s@GetUserAttributeVerificationCode' {} Text
a -> GetUserAttributeVerificationCode
s {$sel:attributeName:GetUserAttributeVerificationCode' :: Text
attributeName = Text
a} :: GetUserAttributeVerificationCode)

instance
  Core.AWSRequest
    GetUserAttributeVerificationCode
  where
  type
    AWSResponse GetUserAttributeVerificationCode =
      GetUserAttributeVerificationCodeResponse
  request :: (Service -> Service)
-> GetUserAttributeVerificationCode
-> Request GetUserAttributeVerificationCode
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 GetUserAttributeVerificationCode
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetUserAttributeVerificationCode)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe CodeDeliveryDetailsType
-> Int -> GetUserAttributeVerificationCodeResponse
GetUserAttributeVerificationCodeResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CodeDeliveryDetails")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    GetUserAttributeVerificationCode
  where
  hashWithSalt :: Int -> GetUserAttributeVerificationCode -> Int
hashWithSalt
    Int
_salt
    GetUserAttributeVerificationCode' {Maybe (HashMap Text Text)
Text
Sensitive Text
attributeName :: Text
accessToken :: Sensitive Text
clientMetadata :: Maybe (HashMap Text Text)
$sel:attributeName:GetUserAttributeVerificationCode' :: GetUserAttributeVerificationCode -> Text
$sel:accessToken:GetUserAttributeVerificationCode' :: GetUserAttributeVerificationCode -> Sensitive Text
$sel:clientMetadata:GetUserAttributeVerificationCode' :: GetUserAttributeVerificationCode -> Maybe (HashMap Text Text)
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
clientMetadata
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
accessToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
attributeName

instance
  Prelude.NFData
    GetUserAttributeVerificationCode
  where
  rnf :: GetUserAttributeVerificationCode -> ()
rnf GetUserAttributeVerificationCode' {Maybe (HashMap Text Text)
Text
Sensitive Text
attributeName :: Text
accessToken :: Sensitive Text
clientMetadata :: Maybe (HashMap Text Text)
$sel:attributeName:GetUserAttributeVerificationCode' :: GetUserAttributeVerificationCode -> Text
$sel:accessToken:GetUserAttributeVerificationCode' :: GetUserAttributeVerificationCode -> Sensitive Text
$sel:clientMetadata:GetUserAttributeVerificationCode' :: GetUserAttributeVerificationCode -> Maybe (HashMap Text Text)
..} =
    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 Sensitive Text
accessToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
attributeName

instance
  Data.ToHeaders
    GetUserAttributeVerificationCode
  where
  toHeaders :: GetUserAttributeVerificationCode -> 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.GetUserAttributeVerificationCode" ::
                          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 GetUserAttributeVerificationCode where
  toJSON :: GetUserAttributeVerificationCode -> Value
toJSON GetUserAttributeVerificationCode' {Maybe (HashMap Text Text)
Text
Sensitive Text
attributeName :: Text
accessToken :: Sensitive Text
clientMetadata :: Maybe (HashMap Text Text)
$sel:attributeName:GetUserAttributeVerificationCode' :: GetUserAttributeVerificationCode -> Text
$sel:accessToken:GetUserAttributeVerificationCode' :: GetUserAttributeVerificationCode -> Sensitive Text
$sel:clientMetadata:GetUserAttributeVerificationCode' :: GetUserAttributeVerificationCode -> Maybe (HashMap Text Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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,
            forall a. a -> Maybe a
Prelude.Just (Key
"AccessToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
accessToken),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"AttributeName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
attributeName)
          ]
      )

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

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

-- | The verification code response returned by the server response to get
-- the user attribute verification code.
--
-- /See:/ 'newGetUserAttributeVerificationCodeResponse' smart constructor.
data GetUserAttributeVerificationCodeResponse = GetUserAttributeVerificationCodeResponse'
  { -- | The code delivery details returned by the server in response to the
    -- request to get the user attribute verification code.
    GetUserAttributeVerificationCodeResponse
-> Maybe CodeDeliveryDetailsType
codeDeliveryDetails :: Prelude.Maybe CodeDeliveryDetailsType,
    -- | The response's http status code.
    GetUserAttributeVerificationCodeResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetUserAttributeVerificationCodeResponse
-> GetUserAttributeVerificationCodeResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetUserAttributeVerificationCodeResponse
-> GetUserAttributeVerificationCodeResponse -> Bool
$c/= :: GetUserAttributeVerificationCodeResponse
-> GetUserAttributeVerificationCodeResponse -> Bool
== :: GetUserAttributeVerificationCodeResponse
-> GetUserAttributeVerificationCodeResponse -> Bool
$c== :: GetUserAttributeVerificationCodeResponse
-> GetUserAttributeVerificationCodeResponse -> Bool
Prelude.Eq, ReadPrec [GetUserAttributeVerificationCodeResponse]
ReadPrec GetUserAttributeVerificationCodeResponse
Int -> ReadS GetUserAttributeVerificationCodeResponse
ReadS [GetUserAttributeVerificationCodeResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetUserAttributeVerificationCodeResponse]
$creadListPrec :: ReadPrec [GetUserAttributeVerificationCodeResponse]
readPrec :: ReadPrec GetUserAttributeVerificationCodeResponse
$creadPrec :: ReadPrec GetUserAttributeVerificationCodeResponse
readList :: ReadS [GetUserAttributeVerificationCodeResponse]
$creadList :: ReadS [GetUserAttributeVerificationCodeResponse]
readsPrec :: Int -> ReadS GetUserAttributeVerificationCodeResponse
$creadsPrec :: Int -> ReadS GetUserAttributeVerificationCodeResponse
Prelude.Read, Int -> GetUserAttributeVerificationCodeResponse -> ShowS
[GetUserAttributeVerificationCodeResponse] -> ShowS
GetUserAttributeVerificationCodeResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetUserAttributeVerificationCodeResponse] -> ShowS
$cshowList :: [GetUserAttributeVerificationCodeResponse] -> ShowS
show :: GetUserAttributeVerificationCodeResponse -> String
$cshow :: GetUserAttributeVerificationCodeResponse -> String
showsPrec :: Int -> GetUserAttributeVerificationCodeResponse -> ShowS
$cshowsPrec :: Int -> GetUserAttributeVerificationCodeResponse -> ShowS
Prelude.Show, forall x.
Rep GetUserAttributeVerificationCodeResponse x
-> GetUserAttributeVerificationCodeResponse
forall x.
GetUserAttributeVerificationCodeResponse
-> Rep GetUserAttributeVerificationCodeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetUserAttributeVerificationCodeResponse x
-> GetUserAttributeVerificationCodeResponse
$cfrom :: forall x.
GetUserAttributeVerificationCodeResponse
-> Rep GetUserAttributeVerificationCodeResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetUserAttributeVerificationCodeResponse' 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:
--
-- 'codeDeliveryDetails', 'getUserAttributeVerificationCodeResponse_codeDeliveryDetails' - The code delivery details returned by the server in response to the
-- request to get the user attribute verification code.
--
-- 'httpStatus', 'getUserAttributeVerificationCodeResponse_httpStatus' - The response's http status code.
newGetUserAttributeVerificationCodeResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetUserAttributeVerificationCodeResponse
newGetUserAttributeVerificationCodeResponse :: Int -> GetUserAttributeVerificationCodeResponse
newGetUserAttributeVerificationCodeResponse
  Int
pHttpStatus_ =
    GetUserAttributeVerificationCodeResponse'
      { $sel:codeDeliveryDetails:GetUserAttributeVerificationCodeResponse' :: Maybe CodeDeliveryDetailsType
codeDeliveryDetails =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetUserAttributeVerificationCodeResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The code delivery details returned by the server in response to the
-- request to get the user attribute verification code.
getUserAttributeVerificationCodeResponse_codeDeliveryDetails :: Lens.Lens' GetUserAttributeVerificationCodeResponse (Prelude.Maybe CodeDeliveryDetailsType)
getUserAttributeVerificationCodeResponse_codeDeliveryDetails :: Lens'
  GetUserAttributeVerificationCodeResponse
  (Maybe CodeDeliveryDetailsType)
getUserAttributeVerificationCodeResponse_codeDeliveryDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUserAttributeVerificationCodeResponse' {Maybe CodeDeliveryDetailsType
codeDeliveryDetails :: Maybe CodeDeliveryDetailsType
$sel:codeDeliveryDetails:GetUserAttributeVerificationCodeResponse' :: GetUserAttributeVerificationCodeResponse
-> Maybe CodeDeliveryDetailsType
codeDeliveryDetails} -> Maybe CodeDeliveryDetailsType
codeDeliveryDetails) (\s :: GetUserAttributeVerificationCodeResponse
s@GetUserAttributeVerificationCodeResponse' {} Maybe CodeDeliveryDetailsType
a -> GetUserAttributeVerificationCodeResponse
s {$sel:codeDeliveryDetails:GetUserAttributeVerificationCodeResponse' :: Maybe CodeDeliveryDetailsType
codeDeliveryDetails = Maybe CodeDeliveryDetailsType
a} :: GetUserAttributeVerificationCodeResponse)

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

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