{-# 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.AdminInitiateAuth
(
AdminInitiateAuth (..),
newAdminInitiateAuth,
adminInitiateAuth_clientMetadata,
adminInitiateAuth_contextData,
adminInitiateAuth_analyticsMetadata,
adminInitiateAuth_authParameters,
adminInitiateAuth_userPoolId,
adminInitiateAuth_clientId,
adminInitiateAuth_authFlow,
AdminInitiateAuthResponse (..),
newAdminInitiateAuthResponse,
adminInitiateAuthResponse_challengeName,
adminInitiateAuthResponse_challengeParameters,
adminInitiateAuthResponse_authenticationResult,
adminInitiateAuthResponse_session,
adminInitiateAuthResponse_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 AdminInitiateAuth = AdminInitiateAuth'
{
AdminInitiateAuth -> Maybe (HashMap Text Text)
clientMetadata :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
AdminInitiateAuth -> Maybe ContextDataType
contextData :: Prelude.Maybe ContextDataType,
AdminInitiateAuth -> Maybe AnalyticsMetadataType
analyticsMetadata :: Prelude.Maybe AnalyticsMetadataType,
AdminInitiateAuth -> Maybe (Sensitive (HashMap Text Text))
authParameters :: Prelude.Maybe (Core.Sensitive (Prelude.HashMap Prelude.Text Prelude.Text)),
AdminInitiateAuth -> Text
userPoolId :: Prelude.Text,
AdminInitiateAuth -> Sensitive Text
clientId :: Core.Sensitive Prelude.Text,
AdminInitiateAuth -> AuthFlowType
authFlow :: AuthFlowType
}
deriving (AdminInitiateAuth -> AdminInitiateAuth -> Bool
(AdminInitiateAuth -> AdminInitiateAuth -> Bool)
-> (AdminInitiateAuth -> AdminInitiateAuth -> Bool)
-> Eq AdminInitiateAuth
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdminInitiateAuth -> AdminInitiateAuth -> Bool
$c/= :: AdminInitiateAuth -> AdminInitiateAuth -> Bool
== :: AdminInitiateAuth -> AdminInitiateAuth -> Bool
$c== :: AdminInitiateAuth -> AdminInitiateAuth -> Bool
Prelude.Eq, Int -> AdminInitiateAuth -> ShowS
[AdminInitiateAuth] -> ShowS
AdminInitiateAuth -> String
(Int -> AdminInitiateAuth -> ShowS)
-> (AdminInitiateAuth -> String)
-> ([AdminInitiateAuth] -> ShowS)
-> Show AdminInitiateAuth
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdminInitiateAuth] -> ShowS
$cshowList :: [AdminInitiateAuth] -> ShowS
show :: AdminInitiateAuth -> String
$cshow :: AdminInitiateAuth -> String
showsPrec :: Int -> AdminInitiateAuth -> ShowS
$cshowsPrec :: Int -> AdminInitiateAuth -> ShowS
Prelude.Show, (forall x. AdminInitiateAuth -> Rep AdminInitiateAuth x)
-> (forall x. Rep AdminInitiateAuth x -> AdminInitiateAuth)
-> Generic AdminInitiateAuth
forall x. Rep AdminInitiateAuth x -> AdminInitiateAuth
forall x. AdminInitiateAuth -> Rep AdminInitiateAuth x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AdminInitiateAuth x -> AdminInitiateAuth
$cfrom :: forall x. AdminInitiateAuth -> Rep AdminInitiateAuth x
Prelude.Generic)
newAdminInitiateAuth ::
Prelude.Text ->
Prelude.Text ->
AuthFlowType ->
AdminInitiateAuth
newAdminInitiateAuth :: Text -> Text -> AuthFlowType -> AdminInitiateAuth
newAdminInitiateAuth
Text
pUserPoolId_
Text
pClientId_
AuthFlowType
pAuthFlow_ =
AdminInitiateAuth' :: Maybe (HashMap Text Text)
-> Maybe ContextDataType
-> Maybe AnalyticsMetadataType
-> Maybe (Sensitive (HashMap Text Text))
-> Text
-> Sensitive Text
-> AuthFlowType
-> AdminInitiateAuth
AdminInitiateAuth'
{ $sel:clientMetadata:AdminInitiateAuth' :: Maybe (HashMap Text Text)
clientMetadata =
Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:contextData:AdminInitiateAuth' :: Maybe ContextDataType
contextData = Maybe ContextDataType
forall a. Maybe a
Prelude.Nothing,
$sel:analyticsMetadata:AdminInitiateAuth' :: Maybe AnalyticsMetadataType
analyticsMetadata = Maybe AnalyticsMetadataType
forall a. Maybe a
Prelude.Nothing,
$sel:authParameters:AdminInitiateAuth' :: Maybe (Sensitive (HashMap Text Text))
authParameters = Maybe (Sensitive (HashMap Text Text))
forall a. Maybe a
Prelude.Nothing,
$sel:userPoolId:AdminInitiateAuth' :: Text
userPoolId = Text
pUserPoolId_,
$sel:clientId:AdminInitiateAuth' :: 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:authFlow:AdminInitiateAuth' :: AuthFlowType
authFlow = AuthFlowType
pAuthFlow_
}
adminInitiateAuth_clientMetadata :: Lens.Lens' AdminInitiateAuth (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
adminInitiateAuth_clientMetadata :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AdminInitiateAuth -> f AdminInitiateAuth
adminInitiateAuth_clientMetadata = (AdminInitiateAuth -> Maybe (HashMap Text Text))
-> (AdminInitiateAuth
-> Maybe (HashMap Text Text) -> AdminInitiateAuth)
-> Lens
AdminInitiateAuth
AdminInitiateAuth
(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 (\AdminInitiateAuth' {Maybe (HashMap Text Text)
clientMetadata :: Maybe (HashMap Text Text)
$sel:clientMetadata:AdminInitiateAuth' :: AdminInitiateAuth -> Maybe (HashMap Text Text)
clientMetadata} -> Maybe (HashMap Text Text)
clientMetadata) (\s :: AdminInitiateAuth
s@AdminInitiateAuth' {} Maybe (HashMap Text Text)
a -> AdminInitiateAuth
s {$sel:clientMetadata:AdminInitiateAuth' :: Maybe (HashMap Text Text)
clientMetadata = Maybe (HashMap Text Text)
a} :: AdminInitiateAuth) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AdminInitiateAuth -> f AdminInitiateAuth)
-> ((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)))
-> AdminInitiateAuth
-> f AdminInitiateAuth
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
adminInitiateAuth_contextData :: Lens.Lens' AdminInitiateAuth (Prelude.Maybe ContextDataType)
adminInitiateAuth_contextData :: (Maybe ContextDataType -> f (Maybe ContextDataType))
-> AdminInitiateAuth -> f AdminInitiateAuth
adminInitiateAuth_contextData = (AdminInitiateAuth -> Maybe ContextDataType)
-> (AdminInitiateAuth
-> Maybe ContextDataType -> AdminInitiateAuth)
-> Lens
AdminInitiateAuth
AdminInitiateAuth
(Maybe ContextDataType)
(Maybe ContextDataType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminInitiateAuth' {Maybe ContextDataType
contextData :: Maybe ContextDataType
$sel:contextData:AdminInitiateAuth' :: AdminInitiateAuth -> Maybe ContextDataType
contextData} -> Maybe ContextDataType
contextData) (\s :: AdminInitiateAuth
s@AdminInitiateAuth' {} Maybe ContextDataType
a -> AdminInitiateAuth
s {$sel:contextData:AdminInitiateAuth' :: Maybe ContextDataType
contextData = Maybe ContextDataType
a} :: AdminInitiateAuth)
adminInitiateAuth_analyticsMetadata :: Lens.Lens' AdminInitiateAuth (Prelude.Maybe AnalyticsMetadataType)
adminInitiateAuth_analyticsMetadata :: (Maybe AnalyticsMetadataType -> f (Maybe AnalyticsMetadataType))
-> AdminInitiateAuth -> f AdminInitiateAuth
adminInitiateAuth_analyticsMetadata = (AdminInitiateAuth -> Maybe AnalyticsMetadataType)
-> (AdminInitiateAuth
-> Maybe AnalyticsMetadataType -> AdminInitiateAuth)
-> Lens
AdminInitiateAuth
AdminInitiateAuth
(Maybe AnalyticsMetadataType)
(Maybe AnalyticsMetadataType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminInitiateAuth' {Maybe AnalyticsMetadataType
analyticsMetadata :: Maybe AnalyticsMetadataType
$sel:analyticsMetadata:AdminInitiateAuth' :: AdminInitiateAuth -> Maybe AnalyticsMetadataType
analyticsMetadata} -> Maybe AnalyticsMetadataType
analyticsMetadata) (\s :: AdminInitiateAuth
s@AdminInitiateAuth' {} Maybe AnalyticsMetadataType
a -> AdminInitiateAuth
s {$sel:analyticsMetadata:AdminInitiateAuth' :: Maybe AnalyticsMetadataType
analyticsMetadata = Maybe AnalyticsMetadataType
a} :: AdminInitiateAuth)
adminInitiateAuth_authParameters :: Lens.Lens' AdminInitiateAuth (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
adminInitiateAuth_authParameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AdminInitiateAuth -> f AdminInitiateAuth
adminInitiateAuth_authParameters = (AdminInitiateAuth -> Maybe (Sensitive (HashMap Text Text)))
-> (AdminInitiateAuth
-> Maybe (Sensitive (HashMap Text Text)) -> AdminInitiateAuth)
-> Lens
AdminInitiateAuth
AdminInitiateAuth
(Maybe (Sensitive (HashMap Text Text)))
(Maybe (Sensitive (HashMap Text Text)))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminInitiateAuth' {Maybe (Sensitive (HashMap Text Text))
authParameters :: Maybe (Sensitive (HashMap Text Text))
$sel:authParameters:AdminInitiateAuth' :: AdminInitiateAuth -> Maybe (Sensitive (HashMap Text Text))
authParameters} -> Maybe (Sensitive (HashMap Text Text))
authParameters) (\s :: AdminInitiateAuth
s@AdminInitiateAuth' {} Maybe (Sensitive (HashMap Text Text))
a -> AdminInitiateAuth
s {$sel:authParameters:AdminInitiateAuth' :: Maybe (Sensitive (HashMap Text Text))
authParameters = Maybe (Sensitive (HashMap Text Text))
a} :: AdminInitiateAuth) ((Maybe (Sensitive (HashMap Text Text))
-> f (Maybe (Sensitive (HashMap Text Text))))
-> AdminInitiateAuth -> f AdminInitiateAuth)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (Sensitive (HashMap Text Text))
-> f (Maybe (Sensitive (HashMap Text Text))))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AdminInitiateAuth
-> f AdminInitiateAuth
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (Sensitive (HashMap Text Text)))
(Maybe (Sensitive (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
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive AnIso
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
-> AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> AnIso
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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)
adminInitiateAuth_userPoolId :: Lens.Lens' AdminInitiateAuth Prelude.Text
adminInitiateAuth_userPoolId :: (Text -> f Text) -> AdminInitiateAuth -> f AdminInitiateAuth
adminInitiateAuth_userPoolId = (AdminInitiateAuth -> Text)
-> (AdminInitiateAuth -> Text -> AdminInitiateAuth)
-> Lens AdminInitiateAuth AdminInitiateAuth Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminInitiateAuth' {Text
userPoolId :: Text
$sel:userPoolId:AdminInitiateAuth' :: AdminInitiateAuth -> Text
userPoolId} -> Text
userPoolId) (\s :: AdminInitiateAuth
s@AdminInitiateAuth' {} Text
a -> AdminInitiateAuth
s {$sel:userPoolId:AdminInitiateAuth' :: Text
userPoolId = Text
a} :: AdminInitiateAuth)
adminInitiateAuth_clientId :: Lens.Lens' AdminInitiateAuth Prelude.Text
adminInitiateAuth_clientId :: (Text -> f Text) -> AdminInitiateAuth -> f AdminInitiateAuth
adminInitiateAuth_clientId = (AdminInitiateAuth -> Sensitive Text)
-> (AdminInitiateAuth -> Sensitive Text -> AdminInitiateAuth)
-> Lens
AdminInitiateAuth
AdminInitiateAuth
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminInitiateAuth' {Sensitive Text
clientId :: Sensitive Text
$sel:clientId:AdminInitiateAuth' :: AdminInitiateAuth -> Sensitive Text
clientId} -> Sensitive Text
clientId) (\s :: AdminInitiateAuth
s@AdminInitiateAuth' {} Sensitive Text
a -> AdminInitiateAuth
s {$sel:clientId:AdminInitiateAuth' :: Sensitive Text
clientId = Sensitive Text
a} :: AdminInitiateAuth) ((Sensitive Text -> f (Sensitive Text))
-> AdminInitiateAuth -> f AdminInitiateAuth)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> AdminInitiateAuth
-> f AdminInitiateAuth
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
adminInitiateAuth_authFlow :: Lens.Lens' AdminInitiateAuth AuthFlowType
adminInitiateAuth_authFlow :: (AuthFlowType -> f AuthFlowType)
-> AdminInitiateAuth -> f AdminInitiateAuth
adminInitiateAuth_authFlow = (AdminInitiateAuth -> AuthFlowType)
-> (AdminInitiateAuth -> AuthFlowType -> AdminInitiateAuth)
-> Lens
AdminInitiateAuth AdminInitiateAuth AuthFlowType AuthFlowType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminInitiateAuth' {AuthFlowType
authFlow :: AuthFlowType
$sel:authFlow:AdminInitiateAuth' :: AdminInitiateAuth -> AuthFlowType
authFlow} -> AuthFlowType
authFlow) (\s :: AdminInitiateAuth
s@AdminInitiateAuth' {} AuthFlowType
a -> AdminInitiateAuth
s {$sel:authFlow:AdminInitiateAuth' :: AuthFlowType
authFlow = AuthFlowType
a} :: AdminInitiateAuth)
instance Core.AWSRequest AdminInitiateAuth where
type
AWSResponse AdminInitiateAuth =
AdminInitiateAuthResponse
request :: AdminInitiateAuth -> Request AdminInitiateAuth
request = Service -> AdminInitiateAuth -> Request AdminInitiateAuth
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AdminInitiateAuth
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AdminInitiateAuth)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse AdminInitiateAuth))
-> Logger
-> Service
-> Proxy AdminInitiateAuth
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AdminInitiateAuth)))
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
-> AdminInitiateAuthResponse
AdminInitiateAuthResponse'
(Maybe ChallengeNameType
-> Maybe (HashMap Text Text)
-> Maybe AuthenticationResultType
-> Maybe Text
-> Int
-> AdminInitiateAuthResponse)
-> Either String (Maybe ChallengeNameType)
-> Either
String
(Maybe (HashMap Text Text)
-> Maybe AuthenticationResultType
-> Maybe Text
-> Int
-> AdminInitiateAuthResponse)
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
-> AdminInitiateAuthResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
String
(Maybe AuthenticationResultType
-> Maybe Text -> Int -> AdminInitiateAuthResponse)
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 -> AdminInitiateAuthResponse)
-> Either String (Maybe AuthenticationResultType)
-> Either String (Maybe Text -> Int -> AdminInitiateAuthResponse)
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 -> AdminInitiateAuthResponse)
-> Either String (Maybe Text)
-> Either String (Int -> AdminInitiateAuthResponse)
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 -> AdminInitiateAuthResponse)
-> Either String Int -> Either String AdminInitiateAuthResponse
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 AdminInitiateAuth
instance Prelude.NFData AdminInitiateAuth
instance Core.ToHeaders AdminInitiateAuth where
toHeaders :: AdminInitiateAuth -> ResponseHeaders
toHeaders =
ResponseHeaders -> AdminInitiateAuth -> 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.AdminInitiateAuth" ::
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 AdminInitiateAuth where
toJSON :: AdminInitiateAuth -> Value
toJSON AdminInitiateAuth' {Maybe (HashMap Text Text)
Maybe (Sensitive (HashMap Text Text))
Maybe AnalyticsMetadataType
Maybe ContextDataType
Text
Sensitive Text
AuthFlowType
authFlow :: AuthFlowType
clientId :: Sensitive Text
userPoolId :: Text
authParameters :: Maybe (Sensitive (HashMap Text Text))
analyticsMetadata :: Maybe AnalyticsMetadataType
contextData :: Maybe ContextDataType
clientMetadata :: Maybe (HashMap Text Text)
$sel:authFlow:AdminInitiateAuth' :: AdminInitiateAuth -> AuthFlowType
$sel:clientId:AdminInitiateAuth' :: AdminInitiateAuth -> Sensitive Text
$sel:userPoolId:AdminInitiateAuth' :: AdminInitiateAuth -> Text
$sel:authParameters:AdminInitiateAuth' :: AdminInitiateAuth -> Maybe (Sensitive (HashMap Text Text))
$sel:analyticsMetadata:AdminInitiateAuth' :: AdminInitiateAuth -> Maybe AnalyticsMetadataType
$sel:contextData:AdminInitiateAuth' :: AdminInitiateAuth -> Maybe ContextDataType
$sel:clientMetadata:AdminInitiateAuth' :: AdminInitiateAuth -> 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
"ContextData" Text -> ContextDataType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ContextDataType -> Pair) -> Maybe ContextDataType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ContextDataType
contextData,
(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
"AuthParameters" Text -> Sensitive (HashMap Text Text) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Sensitive (HashMap Text Text) -> Pair)
-> Maybe (Sensitive (HashMap Text Text)) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive (HashMap Text Text))
authParameters,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserPoolId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userPoolId),
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
"AuthFlow" Text -> AuthFlowType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AuthFlowType
authFlow)
]
)
instance Core.ToPath AdminInitiateAuth where
toPath :: AdminInitiateAuth -> ByteString
toPath = ByteString -> AdminInitiateAuth -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AdminInitiateAuth where
toQuery :: AdminInitiateAuth -> QueryString
toQuery = QueryString -> AdminInitiateAuth -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AdminInitiateAuthResponse = AdminInitiateAuthResponse'
{
AdminInitiateAuthResponse -> Maybe ChallengeNameType
challengeName :: Prelude.Maybe ChallengeNameType,
AdminInitiateAuthResponse -> Maybe (HashMap Text Text)
challengeParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
AdminInitiateAuthResponse -> Maybe AuthenticationResultType
authenticationResult :: Prelude.Maybe AuthenticationResultType,
AdminInitiateAuthResponse -> Maybe Text
session :: Prelude.Maybe Prelude.Text,
AdminInitiateAuthResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AdminInitiateAuthResponse -> AdminInitiateAuthResponse -> Bool
(AdminInitiateAuthResponse -> AdminInitiateAuthResponse -> Bool)
-> (AdminInitiateAuthResponse -> AdminInitiateAuthResponse -> Bool)
-> Eq AdminInitiateAuthResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdminInitiateAuthResponse -> AdminInitiateAuthResponse -> Bool
$c/= :: AdminInitiateAuthResponse -> AdminInitiateAuthResponse -> Bool
== :: AdminInitiateAuthResponse -> AdminInitiateAuthResponse -> Bool
$c== :: AdminInitiateAuthResponse -> AdminInitiateAuthResponse -> Bool
Prelude.Eq, Int -> AdminInitiateAuthResponse -> ShowS
[AdminInitiateAuthResponse] -> ShowS
AdminInitiateAuthResponse -> String
(Int -> AdminInitiateAuthResponse -> ShowS)
-> (AdminInitiateAuthResponse -> String)
-> ([AdminInitiateAuthResponse] -> ShowS)
-> Show AdminInitiateAuthResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdminInitiateAuthResponse] -> ShowS
$cshowList :: [AdminInitiateAuthResponse] -> ShowS
show :: AdminInitiateAuthResponse -> String
$cshow :: AdminInitiateAuthResponse -> String
showsPrec :: Int -> AdminInitiateAuthResponse -> ShowS
$cshowsPrec :: Int -> AdminInitiateAuthResponse -> ShowS
Prelude.Show, (forall x.
AdminInitiateAuthResponse -> Rep AdminInitiateAuthResponse x)
-> (forall x.
Rep AdminInitiateAuthResponse x -> AdminInitiateAuthResponse)
-> Generic AdminInitiateAuthResponse
forall x.
Rep AdminInitiateAuthResponse x -> AdminInitiateAuthResponse
forall x.
AdminInitiateAuthResponse -> Rep AdminInitiateAuthResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AdminInitiateAuthResponse x -> AdminInitiateAuthResponse
$cfrom :: forall x.
AdminInitiateAuthResponse -> Rep AdminInitiateAuthResponse x
Prelude.Generic)
newAdminInitiateAuthResponse ::
Prelude.Int ->
AdminInitiateAuthResponse
newAdminInitiateAuthResponse :: Int -> AdminInitiateAuthResponse
newAdminInitiateAuthResponse Int
pHttpStatus_ =
AdminInitiateAuthResponse' :: Maybe ChallengeNameType
-> Maybe (HashMap Text Text)
-> Maybe AuthenticationResultType
-> Maybe Text
-> Int
-> AdminInitiateAuthResponse
AdminInitiateAuthResponse'
{ $sel:challengeName:AdminInitiateAuthResponse' :: Maybe ChallengeNameType
challengeName =
Maybe ChallengeNameType
forall a. Maybe a
Prelude.Nothing,
$sel:challengeParameters:AdminInitiateAuthResponse' :: Maybe (HashMap Text Text)
challengeParameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:authenticationResult:AdminInitiateAuthResponse' :: Maybe AuthenticationResultType
authenticationResult = Maybe AuthenticationResultType
forall a. Maybe a
Prelude.Nothing,
$sel:session:AdminInitiateAuthResponse' :: Maybe Text
session = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:AdminInitiateAuthResponse' :: Int
httpStatus = Int
pHttpStatus_
}
adminInitiateAuthResponse_challengeName :: Lens.Lens' AdminInitiateAuthResponse (Prelude.Maybe ChallengeNameType)
adminInitiateAuthResponse_challengeName :: (Maybe ChallengeNameType -> f (Maybe ChallengeNameType))
-> AdminInitiateAuthResponse -> f AdminInitiateAuthResponse
adminInitiateAuthResponse_challengeName = (AdminInitiateAuthResponse -> Maybe ChallengeNameType)
-> (AdminInitiateAuthResponse
-> Maybe ChallengeNameType -> AdminInitiateAuthResponse)
-> Lens
AdminInitiateAuthResponse
AdminInitiateAuthResponse
(Maybe ChallengeNameType)
(Maybe ChallengeNameType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminInitiateAuthResponse' {Maybe ChallengeNameType
challengeName :: Maybe ChallengeNameType
$sel:challengeName:AdminInitiateAuthResponse' :: AdminInitiateAuthResponse -> Maybe ChallengeNameType
challengeName} -> Maybe ChallengeNameType
challengeName) (\s :: AdminInitiateAuthResponse
s@AdminInitiateAuthResponse' {} Maybe ChallengeNameType
a -> AdminInitiateAuthResponse
s {$sel:challengeName:AdminInitiateAuthResponse' :: Maybe ChallengeNameType
challengeName = Maybe ChallengeNameType
a} :: AdminInitiateAuthResponse)
adminInitiateAuthResponse_challengeParameters :: Lens.Lens' AdminInitiateAuthResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
adminInitiateAuthResponse_challengeParameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AdminInitiateAuthResponse -> f AdminInitiateAuthResponse
adminInitiateAuthResponse_challengeParameters = (AdminInitiateAuthResponse -> Maybe (HashMap Text Text))
-> (AdminInitiateAuthResponse
-> Maybe (HashMap Text Text) -> AdminInitiateAuthResponse)
-> Lens
AdminInitiateAuthResponse
AdminInitiateAuthResponse
(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 (\AdminInitiateAuthResponse' {Maybe (HashMap Text Text)
challengeParameters :: Maybe (HashMap Text Text)
$sel:challengeParameters:AdminInitiateAuthResponse' :: AdminInitiateAuthResponse -> Maybe (HashMap Text Text)
challengeParameters} -> Maybe (HashMap Text Text)
challengeParameters) (\s :: AdminInitiateAuthResponse
s@AdminInitiateAuthResponse' {} Maybe (HashMap Text Text)
a -> AdminInitiateAuthResponse
s {$sel:challengeParameters:AdminInitiateAuthResponse' :: Maybe (HashMap Text Text)
challengeParameters = Maybe (HashMap Text Text)
a} :: AdminInitiateAuthResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AdminInitiateAuthResponse -> f AdminInitiateAuthResponse)
-> ((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)))
-> AdminInitiateAuthResponse
-> f AdminInitiateAuthResponse
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
adminInitiateAuthResponse_authenticationResult :: Lens.Lens' AdminInitiateAuthResponse (Prelude.Maybe AuthenticationResultType)
adminInitiateAuthResponse_authenticationResult :: (Maybe AuthenticationResultType
-> f (Maybe AuthenticationResultType))
-> AdminInitiateAuthResponse -> f AdminInitiateAuthResponse
adminInitiateAuthResponse_authenticationResult = (AdminInitiateAuthResponse -> Maybe AuthenticationResultType)
-> (AdminInitiateAuthResponse
-> Maybe AuthenticationResultType -> AdminInitiateAuthResponse)
-> Lens
AdminInitiateAuthResponse
AdminInitiateAuthResponse
(Maybe AuthenticationResultType)
(Maybe AuthenticationResultType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminInitiateAuthResponse' {Maybe AuthenticationResultType
authenticationResult :: Maybe AuthenticationResultType
$sel:authenticationResult:AdminInitiateAuthResponse' :: AdminInitiateAuthResponse -> Maybe AuthenticationResultType
authenticationResult} -> Maybe AuthenticationResultType
authenticationResult) (\s :: AdminInitiateAuthResponse
s@AdminInitiateAuthResponse' {} Maybe AuthenticationResultType
a -> AdminInitiateAuthResponse
s {$sel:authenticationResult:AdminInitiateAuthResponse' :: Maybe AuthenticationResultType
authenticationResult = Maybe AuthenticationResultType
a} :: AdminInitiateAuthResponse)
adminInitiateAuthResponse_session :: Lens.Lens' AdminInitiateAuthResponse (Prelude.Maybe Prelude.Text)
adminInitiateAuthResponse_session :: (Maybe Text -> f (Maybe Text))
-> AdminInitiateAuthResponse -> f AdminInitiateAuthResponse
adminInitiateAuthResponse_session = (AdminInitiateAuthResponse -> Maybe Text)
-> (AdminInitiateAuthResponse
-> Maybe Text -> AdminInitiateAuthResponse)
-> Lens
AdminInitiateAuthResponse
AdminInitiateAuthResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminInitiateAuthResponse' {Maybe Text
session :: Maybe Text
$sel:session:AdminInitiateAuthResponse' :: AdminInitiateAuthResponse -> Maybe Text
session} -> Maybe Text
session) (\s :: AdminInitiateAuthResponse
s@AdminInitiateAuthResponse' {} Maybe Text
a -> AdminInitiateAuthResponse
s {$sel:session:AdminInitiateAuthResponse' :: Maybe Text
session = Maybe Text
a} :: AdminInitiateAuthResponse)
adminInitiateAuthResponse_httpStatus :: Lens.Lens' AdminInitiateAuthResponse Prelude.Int
adminInitiateAuthResponse_httpStatus :: (Int -> f Int)
-> AdminInitiateAuthResponse -> f AdminInitiateAuthResponse
adminInitiateAuthResponse_httpStatus = (AdminInitiateAuthResponse -> Int)
-> (AdminInitiateAuthResponse -> Int -> AdminInitiateAuthResponse)
-> Lens AdminInitiateAuthResponse AdminInitiateAuthResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminInitiateAuthResponse' {Int
httpStatus :: Int
$sel:httpStatus:AdminInitiateAuthResponse' :: AdminInitiateAuthResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AdminInitiateAuthResponse
s@AdminInitiateAuthResponse' {} Int
a -> AdminInitiateAuthResponse
s {$sel:httpStatus:AdminInitiateAuthResponse' :: Int
httpStatus = Int
a} :: AdminInitiateAuthResponse)
instance Prelude.NFData AdminInitiateAuthResponse