{-# 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 #-}
module Amazonka.CognitoIdentityProvider.GetUserAttributeVerificationCode
(
GetUserAttributeVerificationCode (..),
newGetUserAttributeVerificationCode,
getUserAttributeVerificationCode_clientMetadata,
getUserAttributeVerificationCode_accessToken,
getUserAttributeVerificationCode_attributeName,
GetUserAttributeVerificationCodeResponse (..),
newGetUserAttributeVerificationCodeResponse,
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
data GetUserAttributeVerificationCode = GetUserAttributeVerificationCode'
{
GetUserAttributeVerificationCode -> Maybe (HashMap Text Text)
clientMetadata :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
GetUserAttributeVerificationCode -> Sensitive Text
accessToken :: Data.Sensitive Prelude.Text,
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)
newGetUserAttributeVerificationCode ::
Prelude.Text ->
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_
}
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
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
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
data GetUserAttributeVerificationCodeResponse = GetUserAttributeVerificationCodeResponse'
{
GetUserAttributeVerificationCodeResponse
-> Maybe CodeDeliveryDetailsType
codeDeliveryDetails :: Prelude.Maybe CodeDeliveryDetailsType,
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)
newGetUserAttributeVerificationCodeResponse ::
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_
}
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)
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