{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets the user attribute verification code for the specified attribute
-- name.
--
-- This action might generate an SMS text message. Starting June 1, 2021,
-- U.S. telecom carriers require that you register an origination phone
-- number before you can send SMS messages to U.S. phone numbers. If you
-- use SMS text messages in Amazon Cognito, you must register a phone
-- number with
-- <https://console.aws.amazon.com/pinpoint/home/ Amazon Pinpoint>. Cognito
-- will use the the registered number automatically. Otherwise, Cognito
-- users that must receive SMS messages might be unable to sign up,
-- activate their accounts, or sign in.
--
-- If you have never used SMS text messages with Amazon Cognito or any
-- other Amazon Web Service, Amazon SNS might place your account in SMS
-- sandbox. In
-- /<https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html sandbox mode>/
-- , you’ll have limitations, such as sending messages to only verified
-- phone numbers. After testing in the sandbox environment, you can move
-- out of the SMS sandbox and into production. For more information, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html SMS message settings for Cognito User Pools>
-- in the /Amazon Cognito Developer Guide/.
module Amazonka.CognitoIdentityProvider.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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Represents the request to 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/.
    --
    -- Take the following limitations into consideration when you use the
    -- ClientMetadata parameter:
    --
    -- -   Amazon Cognito does not 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 does
    --     not include triggers, the ClientMetadata parameter serves no
    --     purpose.
    --
    -- -   Amazon Cognito does not validate the ClientMetadata value.
    --
    -- -   Amazon Cognito does not encrypt the the ClientMetadata value, so
    --     don\'t use it to provide sensitive information.
    GetUserAttributeVerificationCode -> Maybe (HashMap Text Text)
clientMetadata :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The access token returned by the server response to get the user
    -- attribute verification code.
    GetUserAttributeVerificationCode -> Sensitive Text
accessToken :: Core.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
(GetUserAttributeVerificationCode
 -> GetUserAttributeVerificationCode -> Bool)
-> (GetUserAttributeVerificationCode
    -> GetUserAttributeVerificationCode -> Bool)
-> Eq GetUserAttributeVerificationCode
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
(Int -> GetUserAttributeVerificationCode -> ShowS)
-> (GetUserAttributeVerificationCode -> String)
-> ([GetUserAttributeVerificationCode] -> ShowS)
-> Show GetUserAttributeVerificationCode
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.
 GetUserAttributeVerificationCode
 -> Rep GetUserAttributeVerificationCode x)
-> (forall x.
    Rep GetUserAttributeVerificationCode x
    -> GetUserAttributeVerificationCode)
-> Generic GetUserAttributeVerificationCode
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/.
--
-- Take the following limitations into consideration when you use the
-- ClientMetadata parameter:
--
-- -   Amazon Cognito does not 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 does
--     not include triggers, the ClientMetadata parameter serves no
--     purpose.
--
-- -   Amazon Cognito does not validate the ClientMetadata value.
--
-- -   Amazon Cognito does not encrypt the the ClientMetadata value, so
--     don\'t use it to provide sensitive information.
--
-- 'accessToken', 'getUserAttributeVerificationCode_accessToken' - The access token returned by the server response to get the user
-- attribute verification code.
--
-- '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' :: Maybe (HashMap Text Text)
-> Sensitive Text -> Text -> GetUserAttributeVerificationCode
GetUserAttributeVerificationCode'
      { $sel:clientMetadata:GetUserAttributeVerificationCode' :: Maybe (HashMap Text Text)
clientMetadata =
          Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:accessToken:GetUserAttributeVerificationCode' :: Sensitive Text
accessToken =
          Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
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/.
--
-- Take the following limitations into consideration when you use the
-- ClientMetadata parameter:
--
-- -   Amazon Cognito does not 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 does
--     not include triggers, the ClientMetadata parameter serves no
--     purpose.
--
-- -   Amazon Cognito does not validate the ClientMetadata value.
--
-- -   Amazon Cognito does not encrypt the the ClientMetadata value, so
--     don\'t use it to provide sensitive information.
getUserAttributeVerificationCode_clientMetadata :: Lens.Lens' GetUserAttributeVerificationCode (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getUserAttributeVerificationCode_clientMetadata :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetUserAttributeVerificationCode
-> f GetUserAttributeVerificationCode
getUserAttributeVerificationCode_clientMetadata = (GetUserAttributeVerificationCode -> Maybe (HashMap Text Text))
-> (GetUserAttributeVerificationCode
    -> Maybe (HashMap Text Text) -> GetUserAttributeVerificationCode)
-> Lens
     GetUserAttributeVerificationCode
     GetUserAttributeVerificationCode
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\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) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> GetUserAttributeVerificationCode
 -> f GetUserAttributeVerificationCode)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetUserAttributeVerificationCode
-> f GetUserAttributeVerificationCode
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The access token returned by the server response to get the user
-- attribute verification code.
getUserAttributeVerificationCode_accessToken :: Lens.Lens' GetUserAttributeVerificationCode Prelude.Text
getUserAttributeVerificationCode_accessToken :: (Text -> f Text)
-> GetUserAttributeVerificationCode
-> f GetUserAttributeVerificationCode
getUserAttributeVerificationCode_accessToken = (GetUserAttributeVerificationCode -> Sensitive Text)
-> (GetUserAttributeVerificationCode
    -> Sensitive Text -> GetUserAttributeVerificationCode)
-> Lens
     GetUserAttributeVerificationCode
     GetUserAttributeVerificationCode
     (Sensitive Text)
     (Sensitive Text)
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) ((Sensitive Text -> f (Sensitive Text))
 -> GetUserAttributeVerificationCode
 -> f GetUserAttributeVerificationCode)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> GetUserAttributeVerificationCode
-> f GetUserAttributeVerificationCode
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._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 :: (Text -> f Text)
-> GetUserAttributeVerificationCode
-> f GetUserAttributeVerificationCode
getUserAttributeVerificationCode_attributeName = (GetUserAttributeVerificationCode -> Text)
-> (GetUserAttributeVerificationCode
    -> Text -> GetUserAttributeVerificationCode)
-> Lens
     GetUserAttributeVerificationCode
     GetUserAttributeVerificationCode
     Text
     Text
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 :: GetUserAttributeVerificationCode
-> Request GetUserAttributeVerificationCode
request = Service
-> GetUserAttributeVerificationCode
-> Request GetUserAttributeVerificationCode
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetUserAttributeVerificationCode
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetUserAttributeVerificationCode)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetUserAttributeVerificationCode))
-> Logger
-> Service
-> Proxy GetUserAttributeVerificationCode
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetUserAttributeVerificationCode)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe CodeDeliveryDetailsType
-> Int -> GetUserAttributeVerificationCodeResponse
GetUserAttributeVerificationCodeResponse'
            (Maybe CodeDeliveryDetailsType
 -> Int -> GetUserAttributeVerificationCodeResponse)
-> Either String (Maybe CodeDeliveryDetailsType)
-> Either String (Int -> GetUserAttributeVerificationCodeResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe CodeDeliveryDetailsType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CodeDeliveryDetails")
            Either String (Int -> GetUserAttributeVerificationCodeResponse)
-> Either String Int
-> Either String GetUserAttributeVerificationCodeResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    GetUserAttributeVerificationCode

instance
  Prelude.NFData
    GetUserAttributeVerificationCode

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

instance Core.ToJSON 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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ClientMetadata" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
clientMetadata,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AccessToken" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
accessToken),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"AttributeName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
attributeName)
          ]
      )

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

instance
  Core.ToQuery
    GetUserAttributeVerificationCode
  where
  toQuery :: GetUserAttributeVerificationCode -> QueryString
toQuery = QueryString -> GetUserAttributeVerificationCode -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(GetUserAttributeVerificationCodeResponse
 -> GetUserAttributeVerificationCodeResponse -> Bool)
-> (GetUserAttributeVerificationCodeResponse
    -> GetUserAttributeVerificationCodeResponse -> Bool)
-> Eq GetUserAttributeVerificationCodeResponse
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]
(Int -> ReadS GetUserAttributeVerificationCodeResponse)
-> ReadS [GetUserAttributeVerificationCodeResponse]
-> ReadPrec GetUserAttributeVerificationCodeResponse
-> ReadPrec [GetUserAttributeVerificationCodeResponse]
-> Read 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
(Int -> GetUserAttributeVerificationCodeResponse -> ShowS)
-> (GetUserAttributeVerificationCodeResponse -> String)
-> ([GetUserAttributeVerificationCodeResponse] -> ShowS)
-> Show GetUserAttributeVerificationCodeResponse
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.
 GetUserAttributeVerificationCodeResponse
 -> Rep GetUserAttributeVerificationCodeResponse x)
-> (forall x.
    Rep GetUserAttributeVerificationCodeResponse x
    -> GetUserAttributeVerificationCodeResponse)
-> Generic GetUserAttributeVerificationCodeResponse
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' :: Maybe CodeDeliveryDetailsType
-> Int -> GetUserAttributeVerificationCodeResponse
GetUserAttributeVerificationCodeResponse'
      { $sel:codeDeliveryDetails:GetUserAttributeVerificationCodeResponse' :: Maybe CodeDeliveryDetailsType
codeDeliveryDetails =
          Maybe CodeDeliveryDetailsType
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 :: (Maybe CodeDeliveryDetailsType
 -> f (Maybe CodeDeliveryDetailsType))
-> GetUserAttributeVerificationCodeResponse
-> f GetUserAttributeVerificationCodeResponse
getUserAttributeVerificationCodeResponse_codeDeliveryDetails = (GetUserAttributeVerificationCodeResponse
 -> Maybe CodeDeliveryDetailsType)
-> (GetUserAttributeVerificationCodeResponse
    -> Maybe CodeDeliveryDetailsType
    -> GetUserAttributeVerificationCodeResponse)
-> Lens
     GetUserAttributeVerificationCodeResponse
     GetUserAttributeVerificationCodeResponse
     (Maybe CodeDeliveryDetailsType)
     (Maybe CodeDeliveryDetailsType)
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 :: (Int -> f Int)
-> GetUserAttributeVerificationCodeResponse
-> f GetUserAttributeVerificationCodeResponse
getUserAttributeVerificationCodeResponse_httpStatus = (GetUserAttributeVerificationCodeResponse -> Int)
-> (GetUserAttributeVerificationCodeResponse
    -> Int -> GetUserAttributeVerificationCodeResponse)
-> Lens
     GetUserAttributeVerificationCodeResponse
     GetUserAttributeVerificationCodeResponse
     Int
     Int
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