{-# 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.RespondToAuthChallenge
(
RespondToAuthChallenge (..),
newRespondToAuthChallenge,
respondToAuthChallenge_clientMetadata,
respondToAuthChallenge_analyticsMetadata,
respondToAuthChallenge_challengeResponses,
respondToAuthChallenge_userContextData,
respondToAuthChallenge_session,
respondToAuthChallenge_clientId,
respondToAuthChallenge_challengeName,
RespondToAuthChallengeResponse (..),
newRespondToAuthChallengeResponse,
respondToAuthChallengeResponse_challengeName,
respondToAuthChallengeResponse_challengeParameters,
respondToAuthChallengeResponse_authenticationResult,
respondToAuthChallengeResponse_session,
respondToAuthChallengeResponse_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
data RespondToAuthChallenge = RespondToAuthChallenge'
{
RespondToAuthChallenge -> Maybe (HashMap Text Text)
clientMetadata :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
RespondToAuthChallenge -> Maybe AnalyticsMetadataType
analyticsMetadata :: Prelude.Maybe AnalyticsMetadataType,
RespondToAuthChallenge -> Maybe (HashMap Text Text)
challengeResponses :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
RespondToAuthChallenge -> Maybe UserContextDataType
userContextData :: Prelude.Maybe UserContextDataType,
RespondToAuthChallenge -> Maybe Text
session :: Prelude.Maybe Prelude.Text,
RespondToAuthChallenge -> Sensitive Text
clientId :: Core.Sensitive Prelude.Text,
RespondToAuthChallenge -> ChallengeNameType
challengeName :: ChallengeNameType
}
deriving (RespondToAuthChallenge -> RespondToAuthChallenge -> Bool
(RespondToAuthChallenge -> RespondToAuthChallenge -> Bool)
-> (RespondToAuthChallenge -> RespondToAuthChallenge -> Bool)
-> Eq RespondToAuthChallenge
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RespondToAuthChallenge -> RespondToAuthChallenge -> Bool
$c/= :: RespondToAuthChallenge -> RespondToAuthChallenge -> Bool
== :: RespondToAuthChallenge -> RespondToAuthChallenge -> Bool
$c== :: RespondToAuthChallenge -> RespondToAuthChallenge -> Bool
Prelude.Eq, Int -> RespondToAuthChallenge -> ShowS
[RespondToAuthChallenge] -> ShowS
RespondToAuthChallenge -> String
(Int -> RespondToAuthChallenge -> ShowS)
-> (RespondToAuthChallenge -> String)
-> ([RespondToAuthChallenge] -> ShowS)
-> Show RespondToAuthChallenge
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RespondToAuthChallenge] -> ShowS
$cshowList :: [RespondToAuthChallenge] -> ShowS
show :: RespondToAuthChallenge -> String
$cshow :: RespondToAuthChallenge -> String
showsPrec :: Int -> RespondToAuthChallenge -> ShowS
$cshowsPrec :: Int -> RespondToAuthChallenge -> ShowS
Prelude.Show, (forall x. RespondToAuthChallenge -> Rep RespondToAuthChallenge x)
-> (forall x.
Rep RespondToAuthChallenge x -> RespondToAuthChallenge)
-> Generic RespondToAuthChallenge
forall x. Rep RespondToAuthChallenge x -> RespondToAuthChallenge
forall x. RespondToAuthChallenge -> Rep RespondToAuthChallenge x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RespondToAuthChallenge x -> RespondToAuthChallenge
$cfrom :: forall x. RespondToAuthChallenge -> Rep RespondToAuthChallenge x
Prelude.Generic)
newRespondToAuthChallenge ::
Prelude.Text ->
ChallengeNameType ->
RespondToAuthChallenge
newRespondToAuthChallenge :: Text -> ChallengeNameType -> RespondToAuthChallenge
newRespondToAuthChallenge Text
pClientId_ ChallengeNameType
pChallengeName_ =
RespondToAuthChallenge' :: Maybe (HashMap Text Text)
-> Maybe AnalyticsMetadataType
-> Maybe (HashMap Text Text)
-> Maybe UserContextDataType
-> Maybe Text
-> Sensitive Text
-> ChallengeNameType
-> RespondToAuthChallenge
RespondToAuthChallenge'
{ $sel:clientMetadata:RespondToAuthChallenge' :: Maybe (HashMap Text Text)
clientMetadata =
Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:analyticsMetadata:RespondToAuthChallenge' :: Maybe AnalyticsMetadataType
analyticsMetadata = Maybe AnalyticsMetadataType
forall a. Maybe a
Prelude.Nothing,
$sel:challengeResponses:RespondToAuthChallenge' :: Maybe (HashMap Text Text)
challengeResponses = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:userContextData:RespondToAuthChallenge' :: Maybe UserContextDataType
userContextData = Maybe UserContextDataType
forall a. Maybe a
Prelude.Nothing,
$sel:session:RespondToAuthChallenge' :: Maybe Text
session = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:clientId:RespondToAuthChallenge' :: Sensitive Text
clientId = 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
pClientId_,
$sel:challengeName:RespondToAuthChallenge' :: ChallengeNameType
challengeName = ChallengeNameType
pChallengeName_
}
respondToAuthChallenge_clientMetadata :: Lens.Lens' RespondToAuthChallenge (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
respondToAuthChallenge_clientMetadata :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> RespondToAuthChallenge -> f RespondToAuthChallenge
respondToAuthChallenge_clientMetadata = (RespondToAuthChallenge -> Maybe (HashMap Text Text))
-> (RespondToAuthChallenge
-> Maybe (HashMap Text Text) -> RespondToAuthChallenge)
-> Lens
RespondToAuthChallenge
RespondToAuthChallenge
(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 (\RespondToAuthChallenge' {Maybe (HashMap Text Text)
clientMetadata :: Maybe (HashMap Text Text)
$sel:clientMetadata:RespondToAuthChallenge' :: RespondToAuthChallenge -> Maybe (HashMap Text Text)
clientMetadata} -> Maybe (HashMap Text Text)
clientMetadata) (\s :: RespondToAuthChallenge
s@RespondToAuthChallenge' {} Maybe (HashMap Text Text)
a -> RespondToAuthChallenge
s {$sel:clientMetadata:RespondToAuthChallenge' :: Maybe (HashMap Text Text)
clientMetadata = Maybe (HashMap Text Text)
a} :: RespondToAuthChallenge) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> RespondToAuthChallenge -> f RespondToAuthChallenge)
-> ((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)))
-> RespondToAuthChallenge
-> f RespondToAuthChallenge
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
respondToAuthChallenge_analyticsMetadata :: Lens.Lens' RespondToAuthChallenge (Prelude.Maybe AnalyticsMetadataType)
respondToAuthChallenge_analyticsMetadata :: (Maybe AnalyticsMetadataType -> f (Maybe AnalyticsMetadataType))
-> RespondToAuthChallenge -> f RespondToAuthChallenge
respondToAuthChallenge_analyticsMetadata = (RespondToAuthChallenge -> Maybe AnalyticsMetadataType)
-> (RespondToAuthChallenge
-> Maybe AnalyticsMetadataType -> RespondToAuthChallenge)
-> Lens
RespondToAuthChallenge
RespondToAuthChallenge
(Maybe AnalyticsMetadataType)
(Maybe AnalyticsMetadataType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RespondToAuthChallenge' {Maybe AnalyticsMetadataType
analyticsMetadata :: Maybe AnalyticsMetadataType
$sel:analyticsMetadata:RespondToAuthChallenge' :: RespondToAuthChallenge -> Maybe AnalyticsMetadataType
analyticsMetadata} -> Maybe AnalyticsMetadataType
analyticsMetadata) (\s :: RespondToAuthChallenge
s@RespondToAuthChallenge' {} Maybe AnalyticsMetadataType
a -> RespondToAuthChallenge
s {$sel:analyticsMetadata:RespondToAuthChallenge' :: Maybe AnalyticsMetadataType
analyticsMetadata = Maybe AnalyticsMetadataType
a} :: RespondToAuthChallenge)
respondToAuthChallenge_challengeResponses :: Lens.Lens' RespondToAuthChallenge (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
respondToAuthChallenge_challengeResponses :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> RespondToAuthChallenge -> f RespondToAuthChallenge
respondToAuthChallenge_challengeResponses = (RespondToAuthChallenge -> Maybe (HashMap Text Text))
-> (RespondToAuthChallenge
-> Maybe (HashMap Text Text) -> RespondToAuthChallenge)
-> Lens
RespondToAuthChallenge
RespondToAuthChallenge
(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 (\RespondToAuthChallenge' {Maybe (HashMap Text Text)
challengeResponses :: Maybe (HashMap Text Text)
$sel:challengeResponses:RespondToAuthChallenge' :: RespondToAuthChallenge -> Maybe (HashMap Text Text)
challengeResponses} -> Maybe (HashMap Text Text)
challengeResponses) (\s :: RespondToAuthChallenge
s@RespondToAuthChallenge' {} Maybe (HashMap Text Text)
a -> RespondToAuthChallenge
s {$sel:challengeResponses:RespondToAuthChallenge' :: Maybe (HashMap Text Text)
challengeResponses = Maybe (HashMap Text Text)
a} :: RespondToAuthChallenge) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> RespondToAuthChallenge -> f RespondToAuthChallenge)
-> ((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)))
-> RespondToAuthChallenge
-> f RespondToAuthChallenge
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
respondToAuthChallenge_userContextData :: Lens.Lens' RespondToAuthChallenge (Prelude.Maybe UserContextDataType)
respondToAuthChallenge_userContextData :: (Maybe UserContextDataType -> f (Maybe UserContextDataType))
-> RespondToAuthChallenge -> f RespondToAuthChallenge
respondToAuthChallenge_userContextData = (RespondToAuthChallenge -> Maybe UserContextDataType)
-> (RespondToAuthChallenge
-> Maybe UserContextDataType -> RespondToAuthChallenge)
-> Lens
RespondToAuthChallenge
RespondToAuthChallenge
(Maybe UserContextDataType)
(Maybe UserContextDataType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RespondToAuthChallenge' {Maybe UserContextDataType
userContextData :: Maybe UserContextDataType
$sel:userContextData:RespondToAuthChallenge' :: RespondToAuthChallenge -> Maybe UserContextDataType
userContextData} -> Maybe UserContextDataType
userContextData) (\s :: RespondToAuthChallenge
s@RespondToAuthChallenge' {} Maybe UserContextDataType
a -> RespondToAuthChallenge
s {$sel:userContextData:RespondToAuthChallenge' :: Maybe UserContextDataType
userContextData = Maybe UserContextDataType
a} :: RespondToAuthChallenge)
respondToAuthChallenge_session :: Lens.Lens' RespondToAuthChallenge (Prelude.Maybe Prelude.Text)
respondToAuthChallenge_session :: (Maybe Text -> f (Maybe Text))
-> RespondToAuthChallenge -> f RespondToAuthChallenge
respondToAuthChallenge_session = (RespondToAuthChallenge -> Maybe Text)
-> (RespondToAuthChallenge -> Maybe Text -> RespondToAuthChallenge)
-> Lens
RespondToAuthChallenge
RespondToAuthChallenge
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RespondToAuthChallenge' {Maybe Text
session :: Maybe Text
$sel:session:RespondToAuthChallenge' :: RespondToAuthChallenge -> Maybe Text
session} -> Maybe Text
session) (\s :: RespondToAuthChallenge
s@RespondToAuthChallenge' {} Maybe Text
a -> RespondToAuthChallenge
s {$sel:session:RespondToAuthChallenge' :: Maybe Text
session = Maybe Text
a} :: RespondToAuthChallenge)
respondToAuthChallenge_clientId :: Lens.Lens' RespondToAuthChallenge Prelude.Text
respondToAuthChallenge_clientId :: (Text -> f Text)
-> RespondToAuthChallenge -> f RespondToAuthChallenge
respondToAuthChallenge_clientId = (RespondToAuthChallenge -> Sensitive Text)
-> (RespondToAuthChallenge
-> Sensitive Text -> RespondToAuthChallenge)
-> Lens
RespondToAuthChallenge
RespondToAuthChallenge
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RespondToAuthChallenge' {Sensitive Text
clientId :: Sensitive Text
$sel:clientId:RespondToAuthChallenge' :: RespondToAuthChallenge -> Sensitive Text
clientId} -> Sensitive Text
clientId) (\s :: RespondToAuthChallenge
s@RespondToAuthChallenge' {} Sensitive Text
a -> RespondToAuthChallenge
s {$sel:clientId:RespondToAuthChallenge' :: Sensitive Text
clientId = Sensitive Text
a} :: RespondToAuthChallenge) ((Sensitive Text -> f (Sensitive Text))
-> RespondToAuthChallenge -> f RespondToAuthChallenge)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> RespondToAuthChallenge
-> f RespondToAuthChallenge
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
respondToAuthChallenge_challengeName :: Lens.Lens' RespondToAuthChallenge ChallengeNameType
respondToAuthChallenge_challengeName :: (ChallengeNameType -> f ChallengeNameType)
-> RespondToAuthChallenge -> f RespondToAuthChallenge
respondToAuthChallenge_challengeName = (RespondToAuthChallenge -> ChallengeNameType)
-> (RespondToAuthChallenge
-> ChallengeNameType -> RespondToAuthChallenge)
-> Lens
RespondToAuthChallenge
RespondToAuthChallenge
ChallengeNameType
ChallengeNameType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RespondToAuthChallenge' {ChallengeNameType
challengeName :: ChallengeNameType
$sel:challengeName:RespondToAuthChallenge' :: RespondToAuthChallenge -> ChallengeNameType
challengeName} -> ChallengeNameType
challengeName) (\s :: RespondToAuthChallenge
s@RespondToAuthChallenge' {} ChallengeNameType
a -> RespondToAuthChallenge
s {$sel:challengeName:RespondToAuthChallenge' :: ChallengeNameType
challengeName = ChallengeNameType
a} :: RespondToAuthChallenge)
instance Core.AWSRequest RespondToAuthChallenge where
type
AWSResponse RespondToAuthChallenge =
RespondToAuthChallengeResponse
request :: RespondToAuthChallenge -> Request RespondToAuthChallenge
request = Service -> RespondToAuthChallenge -> Request RespondToAuthChallenge
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RespondToAuthChallenge
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RespondToAuthChallenge)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse RespondToAuthChallenge))
-> Logger
-> Service
-> Proxy RespondToAuthChallenge
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RespondToAuthChallenge)))
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 ChallengeNameType
-> Maybe (HashMap Text Text)
-> Maybe AuthenticationResultType
-> Maybe Text
-> Int
-> RespondToAuthChallengeResponse
RespondToAuthChallengeResponse'
(Maybe ChallengeNameType
-> Maybe (HashMap Text Text)
-> Maybe AuthenticationResultType
-> Maybe Text
-> Int
-> RespondToAuthChallengeResponse)
-> Either String (Maybe ChallengeNameType)
-> Either
String
(Maybe (HashMap Text Text)
-> Maybe AuthenticationResultType
-> Maybe Text
-> Int
-> RespondToAuthChallengeResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ChallengeNameType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ChallengeName")
Either
String
(Maybe (HashMap Text Text)
-> Maybe AuthenticationResultType
-> Maybe Text
-> Int
-> RespondToAuthChallengeResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
String
(Maybe AuthenticationResultType
-> Maybe Text -> Int -> RespondToAuthChallengeResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ChallengeParameters"
Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty
)
Either
String
(Maybe AuthenticationResultType
-> Maybe Text -> Int -> RespondToAuthChallengeResponse)
-> Either String (Maybe AuthenticationResultType)
-> Either
String (Maybe Text -> Int -> RespondToAuthChallengeResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AuthenticationResultType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AuthenticationResult")
Either String (Maybe Text -> Int -> RespondToAuthChallengeResponse)
-> Either String (Maybe Text)
-> Either String (Int -> RespondToAuthChallengeResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Session")
Either String (Int -> RespondToAuthChallengeResponse)
-> Either String Int
-> Either String RespondToAuthChallengeResponse
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 RespondToAuthChallenge
instance Prelude.NFData RespondToAuthChallenge
instance Core.ToHeaders RespondToAuthChallenge where
toHeaders :: RespondToAuthChallenge -> ResponseHeaders
toHeaders =
ResponseHeaders -> RespondToAuthChallenge -> 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.RespondToAuthChallenge" ::
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 RespondToAuthChallenge where
toJSON :: RespondToAuthChallenge -> Value
toJSON RespondToAuthChallenge' {Maybe Text
Maybe (HashMap Text Text)
Maybe AnalyticsMetadataType
Maybe UserContextDataType
Sensitive Text
ChallengeNameType
challengeName :: ChallengeNameType
clientId :: Sensitive Text
session :: Maybe Text
userContextData :: Maybe UserContextDataType
challengeResponses :: Maybe (HashMap Text Text)
analyticsMetadata :: Maybe AnalyticsMetadataType
clientMetadata :: Maybe (HashMap Text Text)
$sel:challengeName:RespondToAuthChallenge' :: RespondToAuthChallenge -> ChallengeNameType
$sel:clientId:RespondToAuthChallenge' :: RespondToAuthChallenge -> Sensitive Text
$sel:session:RespondToAuthChallenge' :: RespondToAuthChallenge -> Maybe Text
$sel:userContextData:RespondToAuthChallenge' :: RespondToAuthChallenge -> Maybe UserContextDataType
$sel:challengeResponses:RespondToAuthChallenge' :: RespondToAuthChallenge -> Maybe (HashMap Text Text)
$sel:analyticsMetadata:RespondToAuthChallenge' :: RespondToAuthChallenge -> Maybe AnalyticsMetadataType
$sel:clientMetadata:RespondToAuthChallenge' :: RespondToAuthChallenge -> 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,
(Text
"AnalyticsMetadata" Text -> AnalyticsMetadataType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(AnalyticsMetadataType -> Pair)
-> Maybe AnalyticsMetadataType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AnalyticsMetadataType
analyticsMetadata,
(Text
"ChallengeResponses" 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)
challengeResponses,
(Text
"UserContextData" Text -> UserContextDataType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(UserContextDataType -> Pair)
-> Maybe UserContextDataType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UserContextDataType
userContextData,
(Text
"Session" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
session,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClientId" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
clientId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ChallengeName" Text -> ChallengeNameType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ChallengeNameType
challengeName)
]
)
instance Core.ToPath RespondToAuthChallenge where
toPath :: RespondToAuthChallenge -> ByteString
toPath = ByteString -> RespondToAuthChallenge -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RespondToAuthChallenge where
toQuery :: RespondToAuthChallenge -> QueryString
toQuery = QueryString -> RespondToAuthChallenge -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RespondToAuthChallengeResponse = RespondToAuthChallengeResponse'
{
RespondToAuthChallengeResponse -> Maybe ChallengeNameType
challengeName :: Prelude.Maybe ChallengeNameType,
RespondToAuthChallengeResponse -> Maybe (HashMap Text Text)
challengeParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
RespondToAuthChallengeResponse -> Maybe AuthenticationResultType
authenticationResult :: Prelude.Maybe AuthenticationResultType,
RespondToAuthChallengeResponse -> Maybe Text
session :: Prelude.Maybe Prelude.Text,
RespondToAuthChallengeResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RespondToAuthChallengeResponse
-> RespondToAuthChallengeResponse -> Bool
(RespondToAuthChallengeResponse
-> RespondToAuthChallengeResponse -> Bool)
-> (RespondToAuthChallengeResponse
-> RespondToAuthChallengeResponse -> Bool)
-> Eq RespondToAuthChallengeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RespondToAuthChallengeResponse
-> RespondToAuthChallengeResponse -> Bool
$c/= :: RespondToAuthChallengeResponse
-> RespondToAuthChallengeResponse -> Bool
== :: RespondToAuthChallengeResponse
-> RespondToAuthChallengeResponse -> Bool
$c== :: RespondToAuthChallengeResponse
-> RespondToAuthChallengeResponse -> Bool
Prelude.Eq, Int -> RespondToAuthChallengeResponse -> ShowS
[RespondToAuthChallengeResponse] -> ShowS
RespondToAuthChallengeResponse -> String
(Int -> RespondToAuthChallengeResponse -> ShowS)
-> (RespondToAuthChallengeResponse -> String)
-> ([RespondToAuthChallengeResponse] -> ShowS)
-> Show RespondToAuthChallengeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RespondToAuthChallengeResponse] -> ShowS
$cshowList :: [RespondToAuthChallengeResponse] -> ShowS
show :: RespondToAuthChallengeResponse -> String
$cshow :: RespondToAuthChallengeResponse -> String
showsPrec :: Int -> RespondToAuthChallengeResponse -> ShowS
$cshowsPrec :: Int -> RespondToAuthChallengeResponse -> ShowS
Prelude.Show, (forall x.
RespondToAuthChallengeResponse
-> Rep RespondToAuthChallengeResponse x)
-> (forall x.
Rep RespondToAuthChallengeResponse x
-> RespondToAuthChallengeResponse)
-> Generic RespondToAuthChallengeResponse
forall x.
Rep RespondToAuthChallengeResponse x
-> RespondToAuthChallengeResponse
forall x.
RespondToAuthChallengeResponse
-> Rep RespondToAuthChallengeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RespondToAuthChallengeResponse x
-> RespondToAuthChallengeResponse
$cfrom :: forall x.
RespondToAuthChallengeResponse
-> Rep RespondToAuthChallengeResponse x
Prelude.Generic)
newRespondToAuthChallengeResponse ::
Prelude.Int ->
RespondToAuthChallengeResponse
newRespondToAuthChallengeResponse :: Int -> RespondToAuthChallengeResponse
newRespondToAuthChallengeResponse Int
pHttpStatus_ =
RespondToAuthChallengeResponse' :: Maybe ChallengeNameType
-> Maybe (HashMap Text Text)
-> Maybe AuthenticationResultType
-> Maybe Text
-> Int
-> RespondToAuthChallengeResponse
RespondToAuthChallengeResponse'
{ $sel:challengeName:RespondToAuthChallengeResponse' :: Maybe ChallengeNameType
challengeName =
Maybe ChallengeNameType
forall a. Maybe a
Prelude.Nothing,
$sel:challengeParameters:RespondToAuthChallengeResponse' :: Maybe (HashMap Text Text)
challengeParameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:authenticationResult:RespondToAuthChallengeResponse' :: Maybe AuthenticationResultType
authenticationResult = Maybe AuthenticationResultType
forall a. Maybe a
Prelude.Nothing,
$sel:session:RespondToAuthChallengeResponse' :: Maybe Text
session = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RespondToAuthChallengeResponse' :: Int
httpStatus = Int
pHttpStatus_
}
respondToAuthChallengeResponse_challengeName :: Lens.Lens' RespondToAuthChallengeResponse (Prelude.Maybe ChallengeNameType)
respondToAuthChallengeResponse_challengeName :: (Maybe ChallengeNameType -> f (Maybe ChallengeNameType))
-> RespondToAuthChallengeResponse
-> f RespondToAuthChallengeResponse
respondToAuthChallengeResponse_challengeName = (RespondToAuthChallengeResponse -> Maybe ChallengeNameType)
-> (RespondToAuthChallengeResponse
-> Maybe ChallengeNameType -> RespondToAuthChallengeResponse)
-> Lens
RespondToAuthChallengeResponse
RespondToAuthChallengeResponse
(Maybe ChallengeNameType)
(Maybe ChallengeNameType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RespondToAuthChallengeResponse' {Maybe ChallengeNameType
challengeName :: Maybe ChallengeNameType
$sel:challengeName:RespondToAuthChallengeResponse' :: RespondToAuthChallengeResponse -> Maybe ChallengeNameType
challengeName} -> Maybe ChallengeNameType
challengeName) (\s :: RespondToAuthChallengeResponse
s@RespondToAuthChallengeResponse' {} Maybe ChallengeNameType
a -> RespondToAuthChallengeResponse
s {$sel:challengeName:RespondToAuthChallengeResponse' :: Maybe ChallengeNameType
challengeName = Maybe ChallengeNameType
a} :: RespondToAuthChallengeResponse)
respondToAuthChallengeResponse_challengeParameters :: Lens.Lens' RespondToAuthChallengeResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
respondToAuthChallengeResponse_challengeParameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> RespondToAuthChallengeResponse
-> f RespondToAuthChallengeResponse
respondToAuthChallengeResponse_challengeParameters = (RespondToAuthChallengeResponse -> Maybe (HashMap Text Text))
-> (RespondToAuthChallengeResponse
-> Maybe (HashMap Text Text) -> RespondToAuthChallengeResponse)
-> Lens
RespondToAuthChallengeResponse
RespondToAuthChallengeResponse
(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 (\RespondToAuthChallengeResponse' {Maybe (HashMap Text Text)
challengeParameters :: Maybe (HashMap Text Text)
$sel:challengeParameters:RespondToAuthChallengeResponse' :: RespondToAuthChallengeResponse -> Maybe (HashMap Text Text)
challengeParameters} -> Maybe (HashMap Text Text)
challengeParameters) (\s :: RespondToAuthChallengeResponse
s@RespondToAuthChallengeResponse' {} Maybe (HashMap Text Text)
a -> RespondToAuthChallengeResponse
s {$sel:challengeParameters:RespondToAuthChallengeResponse' :: Maybe (HashMap Text Text)
challengeParameters = Maybe (HashMap Text Text)
a} :: RespondToAuthChallengeResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> RespondToAuthChallengeResponse
-> f RespondToAuthChallengeResponse)
-> ((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)))
-> RespondToAuthChallengeResponse
-> f RespondToAuthChallengeResponse
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
respondToAuthChallengeResponse_authenticationResult :: Lens.Lens' RespondToAuthChallengeResponse (Prelude.Maybe AuthenticationResultType)
respondToAuthChallengeResponse_authenticationResult :: (Maybe AuthenticationResultType
-> f (Maybe AuthenticationResultType))
-> RespondToAuthChallengeResponse
-> f RespondToAuthChallengeResponse
respondToAuthChallengeResponse_authenticationResult = (RespondToAuthChallengeResponse -> Maybe AuthenticationResultType)
-> (RespondToAuthChallengeResponse
-> Maybe AuthenticationResultType
-> RespondToAuthChallengeResponse)
-> Lens
RespondToAuthChallengeResponse
RespondToAuthChallengeResponse
(Maybe AuthenticationResultType)
(Maybe AuthenticationResultType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RespondToAuthChallengeResponse' {Maybe AuthenticationResultType
authenticationResult :: Maybe AuthenticationResultType
$sel:authenticationResult:RespondToAuthChallengeResponse' :: RespondToAuthChallengeResponse -> Maybe AuthenticationResultType
authenticationResult} -> Maybe AuthenticationResultType
authenticationResult) (\s :: RespondToAuthChallengeResponse
s@RespondToAuthChallengeResponse' {} Maybe AuthenticationResultType
a -> RespondToAuthChallengeResponse
s {$sel:authenticationResult:RespondToAuthChallengeResponse' :: Maybe AuthenticationResultType
authenticationResult = Maybe AuthenticationResultType
a} :: RespondToAuthChallengeResponse)
respondToAuthChallengeResponse_session :: Lens.Lens' RespondToAuthChallengeResponse (Prelude.Maybe Prelude.Text)
respondToAuthChallengeResponse_session :: (Maybe Text -> f (Maybe Text))
-> RespondToAuthChallengeResponse
-> f RespondToAuthChallengeResponse
respondToAuthChallengeResponse_session = (RespondToAuthChallengeResponse -> Maybe Text)
-> (RespondToAuthChallengeResponse
-> Maybe Text -> RespondToAuthChallengeResponse)
-> Lens
RespondToAuthChallengeResponse
RespondToAuthChallengeResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RespondToAuthChallengeResponse' {Maybe Text
session :: Maybe Text
$sel:session:RespondToAuthChallengeResponse' :: RespondToAuthChallengeResponse -> Maybe Text
session} -> Maybe Text
session) (\s :: RespondToAuthChallengeResponse
s@RespondToAuthChallengeResponse' {} Maybe Text
a -> RespondToAuthChallengeResponse
s {$sel:session:RespondToAuthChallengeResponse' :: Maybe Text
session = Maybe Text
a} :: RespondToAuthChallengeResponse)
respondToAuthChallengeResponse_httpStatus :: Lens.Lens' RespondToAuthChallengeResponse Prelude.Int
respondToAuthChallengeResponse_httpStatus :: (Int -> f Int)
-> RespondToAuthChallengeResponse
-> f RespondToAuthChallengeResponse
respondToAuthChallengeResponse_httpStatus = (RespondToAuthChallengeResponse -> Int)
-> (RespondToAuthChallengeResponse
-> Int -> RespondToAuthChallengeResponse)
-> Lens
RespondToAuthChallengeResponse
RespondToAuthChallengeResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RespondToAuthChallengeResponse' {Int
httpStatus :: Int
$sel:httpStatus:RespondToAuthChallengeResponse' :: RespondToAuthChallengeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RespondToAuthChallengeResponse
s@RespondToAuthChallengeResponse' {} Int
a -> RespondToAuthChallengeResponse
s {$sel:httpStatus:RespondToAuthChallengeResponse' :: Int
httpStatus = Int
a} :: RespondToAuthChallengeResponse)
instance
Prelude.NFData
RespondToAuthChallengeResponse