{-# 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.SignUp
(
SignUp (..),
newSignUp,
signUp_clientMetadata,
signUp_analyticsMetadata,
signUp_userContextData,
signUp_userAttributes,
signUp_secretHash,
signUp_validationData,
signUp_clientId,
signUp_username,
signUp_password,
SignUpResponse (..),
newSignUpResponse,
signUpResponse_codeDeliveryDetails,
signUpResponse_httpStatus,
signUpResponse_userConfirmed,
signUpResponse_userSub,
)
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 SignUp = SignUp'
{
SignUp -> Maybe (HashMap Text Text)
clientMetadata :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
SignUp -> Maybe AnalyticsMetadataType
analyticsMetadata :: Prelude.Maybe AnalyticsMetadataType,
SignUp -> Maybe UserContextDataType
userContextData :: Prelude.Maybe UserContextDataType,
SignUp -> Maybe [AttributeType]
userAttributes :: Prelude.Maybe [AttributeType],
SignUp -> Maybe (Sensitive Text)
secretHash :: Prelude.Maybe (Core.Sensitive Prelude.Text),
SignUp -> Maybe [AttributeType]
validationData :: Prelude.Maybe [AttributeType],
SignUp -> Sensitive Text
clientId :: Core.Sensitive Prelude.Text,
SignUp -> Sensitive Text
username :: Core.Sensitive Prelude.Text,
SignUp -> Sensitive Text
password :: Core.Sensitive Prelude.Text
}
deriving (SignUp -> SignUp -> Bool
(SignUp -> SignUp -> Bool)
-> (SignUp -> SignUp -> Bool) -> Eq SignUp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SignUp -> SignUp -> Bool
$c/= :: SignUp -> SignUp -> Bool
== :: SignUp -> SignUp -> Bool
$c== :: SignUp -> SignUp -> Bool
Prelude.Eq, Int -> SignUp -> ShowS
[SignUp] -> ShowS
SignUp -> String
(Int -> SignUp -> ShowS)
-> (SignUp -> String) -> ([SignUp] -> ShowS) -> Show SignUp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SignUp] -> ShowS
$cshowList :: [SignUp] -> ShowS
show :: SignUp -> String
$cshow :: SignUp -> String
showsPrec :: Int -> SignUp -> ShowS
$cshowsPrec :: Int -> SignUp -> ShowS
Prelude.Show, (forall x. SignUp -> Rep SignUp x)
-> (forall x. Rep SignUp x -> SignUp) -> Generic SignUp
forall x. Rep SignUp x -> SignUp
forall x. SignUp -> Rep SignUp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SignUp x -> SignUp
$cfrom :: forall x. SignUp -> Rep SignUp x
Prelude.Generic)
newSignUp ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
SignUp
newSignUp :: Text -> Text -> Text -> SignUp
newSignUp Text
pClientId_ Text
pUsername_ Text
pPassword_ =
SignUp' :: Maybe (HashMap Text Text)
-> Maybe AnalyticsMetadataType
-> Maybe UserContextDataType
-> Maybe [AttributeType]
-> Maybe (Sensitive Text)
-> Maybe [AttributeType]
-> Sensitive Text
-> Sensitive Text
-> Sensitive Text
-> SignUp
SignUp'
{ $sel:clientMetadata:SignUp' :: Maybe (HashMap Text Text)
clientMetadata = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:analyticsMetadata:SignUp' :: Maybe AnalyticsMetadataType
analyticsMetadata = Maybe AnalyticsMetadataType
forall a. Maybe a
Prelude.Nothing,
$sel:userContextData:SignUp' :: Maybe UserContextDataType
userContextData = Maybe UserContextDataType
forall a. Maybe a
Prelude.Nothing,
$sel:userAttributes:SignUp' :: Maybe [AttributeType]
userAttributes = Maybe [AttributeType]
forall a. Maybe a
Prelude.Nothing,
$sel:secretHash:SignUp' :: Maybe (Sensitive Text)
secretHash = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:validationData:SignUp' :: Maybe [AttributeType]
validationData = Maybe [AttributeType]
forall a. Maybe a
Prelude.Nothing,
$sel:clientId:SignUp' :: 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:username:SignUp' :: Sensitive Text
username = 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
pUsername_,
$sel:password:SignUp' :: Sensitive Text
password = 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
pPassword_
}
signUp_clientMetadata :: Lens.Lens' SignUp (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
signUp_clientMetadata :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SignUp -> f SignUp
signUp_clientMetadata = (SignUp -> Maybe (HashMap Text Text))
-> (SignUp -> Maybe (HashMap Text Text) -> SignUp)
-> Lens
SignUp
SignUp
(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 (\SignUp' {Maybe (HashMap Text Text)
clientMetadata :: Maybe (HashMap Text Text)
$sel:clientMetadata:SignUp' :: SignUp -> Maybe (HashMap Text Text)
clientMetadata} -> Maybe (HashMap Text Text)
clientMetadata) (\s :: SignUp
s@SignUp' {} Maybe (HashMap Text Text)
a -> SignUp
s {$sel:clientMetadata:SignUp' :: Maybe (HashMap Text Text)
clientMetadata = Maybe (HashMap Text Text)
a} :: SignUp) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SignUp -> f SignUp)
-> ((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)))
-> SignUp
-> f SignUp
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
signUp_analyticsMetadata :: Lens.Lens' SignUp (Prelude.Maybe AnalyticsMetadataType)
signUp_analyticsMetadata :: (Maybe AnalyticsMetadataType -> f (Maybe AnalyticsMetadataType))
-> SignUp -> f SignUp
signUp_analyticsMetadata = (SignUp -> Maybe AnalyticsMetadataType)
-> (SignUp -> Maybe AnalyticsMetadataType -> SignUp)
-> Lens
SignUp
SignUp
(Maybe AnalyticsMetadataType)
(Maybe AnalyticsMetadataType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUp' {Maybe AnalyticsMetadataType
analyticsMetadata :: Maybe AnalyticsMetadataType
$sel:analyticsMetadata:SignUp' :: SignUp -> Maybe AnalyticsMetadataType
analyticsMetadata} -> Maybe AnalyticsMetadataType
analyticsMetadata) (\s :: SignUp
s@SignUp' {} Maybe AnalyticsMetadataType
a -> SignUp
s {$sel:analyticsMetadata:SignUp' :: Maybe AnalyticsMetadataType
analyticsMetadata = Maybe AnalyticsMetadataType
a} :: SignUp)
signUp_userContextData :: Lens.Lens' SignUp (Prelude.Maybe UserContextDataType)
signUp_userContextData :: (Maybe UserContextDataType -> f (Maybe UserContextDataType))
-> SignUp -> f SignUp
signUp_userContextData = (SignUp -> Maybe UserContextDataType)
-> (SignUp -> Maybe UserContextDataType -> SignUp)
-> Lens
SignUp
SignUp
(Maybe UserContextDataType)
(Maybe UserContextDataType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUp' {Maybe UserContextDataType
userContextData :: Maybe UserContextDataType
$sel:userContextData:SignUp' :: SignUp -> Maybe UserContextDataType
userContextData} -> Maybe UserContextDataType
userContextData) (\s :: SignUp
s@SignUp' {} Maybe UserContextDataType
a -> SignUp
s {$sel:userContextData:SignUp' :: Maybe UserContextDataType
userContextData = Maybe UserContextDataType
a} :: SignUp)
signUp_userAttributes :: Lens.Lens' SignUp (Prelude.Maybe [AttributeType])
signUp_userAttributes :: (Maybe [AttributeType] -> f (Maybe [AttributeType]))
-> SignUp -> f SignUp
signUp_userAttributes = (SignUp -> Maybe [AttributeType])
-> (SignUp -> Maybe [AttributeType] -> SignUp)
-> Lens
SignUp SignUp (Maybe [AttributeType]) (Maybe [AttributeType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUp' {Maybe [AttributeType]
userAttributes :: Maybe [AttributeType]
$sel:userAttributes:SignUp' :: SignUp -> Maybe [AttributeType]
userAttributes} -> Maybe [AttributeType]
userAttributes) (\s :: SignUp
s@SignUp' {} Maybe [AttributeType]
a -> SignUp
s {$sel:userAttributes:SignUp' :: Maybe [AttributeType]
userAttributes = Maybe [AttributeType]
a} :: SignUp) ((Maybe [AttributeType] -> f (Maybe [AttributeType]))
-> SignUp -> f SignUp)
-> ((Maybe [AttributeType] -> f (Maybe [AttributeType]))
-> Maybe [AttributeType] -> f (Maybe [AttributeType]))
-> (Maybe [AttributeType] -> f (Maybe [AttributeType]))
-> SignUp
-> f SignUp
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[AttributeType] [AttributeType] [AttributeType] [AttributeType]
-> Iso
(Maybe [AttributeType])
(Maybe [AttributeType])
(Maybe [AttributeType])
(Maybe [AttributeType])
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
[AttributeType] [AttributeType] [AttributeType] [AttributeType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
signUp_secretHash :: Lens.Lens' SignUp (Prelude.Maybe Prelude.Text)
signUp_secretHash :: (Maybe Text -> f (Maybe Text)) -> SignUp -> f SignUp
signUp_secretHash = (SignUp -> Maybe (Sensitive Text))
-> (SignUp -> Maybe (Sensitive Text) -> SignUp)
-> Lens
SignUp SignUp (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUp' {Maybe (Sensitive Text)
secretHash :: Maybe (Sensitive Text)
$sel:secretHash:SignUp' :: SignUp -> Maybe (Sensitive Text)
secretHash} -> Maybe (Sensitive Text)
secretHash) (\s :: SignUp
s@SignUp' {} Maybe (Sensitive Text)
a -> SignUp
s {$sel:secretHash:SignUp' :: Maybe (Sensitive Text)
secretHash = Maybe (Sensitive Text)
a} :: SignUp) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> SignUp -> f SignUp)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> SignUp
-> f SignUp
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe 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 Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
signUp_validationData :: Lens.Lens' SignUp (Prelude.Maybe [AttributeType])
signUp_validationData :: (Maybe [AttributeType] -> f (Maybe [AttributeType]))
-> SignUp -> f SignUp
signUp_validationData = (SignUp -> Maybe [AttributeType])
-> (SignUp -> Maybe [AttributeType] -> SignUp)
-> Lens
SignUp SignUp (Maybe [AttributeType]) (Maybe [AttributeType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUp' {Maybe [AttributeType]
validationData :: Maybe [AttributeType]
$sel:validationData:SignUp' :: SignUp -> Maybe [AttributeType]
validationData} -> Maybe [AttributeType]
validationData) (\s :: SignUp
s@SignUp' {} Maybe [AttributeType]
a -> SignUp
s {$sel:validationData:SignUp' :: Maybe [AttributeType]
validationData = Maybe [AttributeType]
a} :: SignUp) ((Maybe [AttributeType] -> f (Maybe [AttributeType]))
-> SignUp -> f SignUp)
-> ((Maybe [AttributeType] -> f (Maybe [AttributeType]))
-> Maybe [AttributeType] -> f (Maybe [AttributeType]))
-> (Maybe [AttributeType] -> f (Maybe [AttributeType]))
-> SignUp
-> f SignUp
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[AttributeType] [AttributeType] [AttributeType] [AttributeType]
-> Iso
(Maybe [AttributeType])
(Maybe [AttributeType])
(Maybe [AttributeType])
(Maybe [AttributeType])
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
[AttributeType] [AttributeType] [AttributeType] [AttributeType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
signUp_clientId :: Lens.Lens' SignUp Prelude.Text
signUp_clientId :: (Text -> f Text) -> SignUp -> f SignUp
signUp_clientId = (SignUp -> Sensitive Text)
-> (SignUp -> Sensitive Text -> SignUp)
-> Lens SignUp SignUp (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUp' {Sensitive Text
clientId :: Sensitive Text
$sel:clientId:SignUp' :: SignUp -> Sensitive Text
clientId} -> Sensitive Text
clientId) (\s :: SignUp
s@SignUp' {} Sensitive Text
a -> SignUp
s {$sel:clientId:SignUp' :: Sensitive Text
clientId = Sensitive Text
a} :: SignUp) ((Sensitive Text -> f (Sensitive Text)) -> SignUp -> f SignUp)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> SignUp
-> f SignUp
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
signUp_username :: Lens.Lens' SignUp Prelude.Text
signUp_username :: (Text -> f Text) -> SignUp -> f SignUp
signUp_username = (SignUp -> Sensitive Text)
-> (SignUp -> Sensitive Text -> SignUp)
-> Lens SignUp SignUp (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUp' {Sensitive Text
username :: Sensitive Text
$sel:username:SignUp' :: SignUp -> Sensitive Text
username} -> Sensitive Text
username) (\s :: SignUp
s@SignUp' {} Sensitive Text
a -> SignUp
s {$sel:username:SignUp' :: Sensitive Text
username = Sensitive Text
a} :: SignUp) ((Sensitive Text -> f (Sensitive Text)) -> SignUp -> f SignUp)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> SignUp
-> f SignUp
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
signUp_password :: Lens.Lens' SignUp Prelude.Text
signUp_password :: (Text -> f Text) -> SignUp -> f SignUp
signUp_password = (SignUp -> Sensitive Text)
-> (SignUp -> Sensitive Text -> SignUp)
-> Lens SignUp SignUp (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUp' {Sensitive Text
password :: Sensitive Text
$sel:password:SignUp' :: SignUp -> Sensitive Text
password} -> Sensitive Text
password) (\s :: SignUp
s@SignUp' {} Sensitive Text
a -> SignUp
s {$sel:password:SignUp' :: Sensitive Text
password = Sensitive Text
a} :: SignUp) ((Sensitive Text -> f (Sensitive Text)) -> SignUp -> f SignUp)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> SignUp
-> f SignUp
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
instance Core.AWSRequest SignUp where
type AWSResponse SignUp = SignUpResponse
request :: SignUp -> Request SignUp
request = Service -> SignUp -> Request SignUp
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SignUp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SignUp)))
response =
(Int
-> ResponseHeaders -> Object -> Either String (AWSResponse SignUp))
-> Logger
-> Service
-> Proxy SignUp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SignUp)))
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 -> Bool -> Text -> SignUpResponse
SignUpResponse'
(Maybe CodeDeliveryDetailsType
-> Int -> Bool -> Text -> SignUpResponse)
-> Either String (Maybe CodeDeliveryDetailsType)
-> Either String (Int -> Bool -> Text -> SignUpResponse)
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 -> Bool -> Text -> SignUpResponse)
-> Either String Int
-> Either String (Bool -> Text -> SignUpResponse)
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))
Either String (Bool -> Text -> SignUpResponse)
-> Either String Bool -> Either String (Text -> SignUpResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Bool
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"UserConfirmed")
Either String (Text -> SignUpResponse)
-> Either String Text -> Either String SignUpResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"UserSub")
)
instance Prelude.Hashable SignUp
instance Prelude.NFData SignUp
instance Core.ToHeaders SignUp where
toHeaders :: SignUp -> ResponseHeaders
toHeaders =
ResponseHeaders -> SignUp -> 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.SignUp" ::
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 SignUp where
toJSON :: SignUp -> Value
toJSON SignUp' {Maybe [AttributeType]
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe AnalyticsMetadataType
Maybe UserContextDataType
Sensitive Text
password :: Sensitive Text
username :: Sensitive Text
clientId :: Sensitive Text
validationData :: Maybe [AttributeType]
secretHash :: Maybe (Sensitive Text)
userAttributes :: Maybe [AttributeType]
userContextData :: Maybe UserContextDataType
analyticsMetadata :: Maybe AnalyticsMetadataType
clientMetadata :: Maybe (HashMap Text Text)
$sel:password:SignUp' :: SignUp -> Sensitive Text
$sel:username:SignUp' :: SignUp -> Sensitive Text
$sel:clientId:SignUp' :: SignUp -> Sensitive Text
$sel:validationData:SignUp' :: SignUp -> Maybe [AttributeType]
$sel:secretHash:SignUp' :: SignUp -> Maybe (Sensitive Text)
$sel:userAttributes:SignUp' :: SignUp -> Maybe [AttributeType]
$sel:userContextData:SignUp' :: SignUp -> Maybe UserContextDataType
$sel:analyticsMetadata:SignUp' :: SignUp -> Maybe AnalyticsMetadataType
$sel:clientMetadata:SignUp' :: SignUp -> 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
"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
"UserAttributes" Text -> [AttributeType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([AttributeType] -> Pair) -> Maybe [AttributeType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AttributeType]
userAttributes,
(Text
"SecretHash" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
secretHash,
(Text
"ValidationData" Text -> [AttributeType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([AttributeType] -> Pair) -> Maybe [AttributeType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AttributeType]
validationData,
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
"Username" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
username),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Password" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
password)
]
)
instance Core.ToPath SignUp where
toPath :: SignUp -> ByteString
toPath = ByteString -> SignUp -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SignUp where
toQuery :: SignUp -> QueryString
toQuery = QueryString -> SignUp -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SignUpResponse = SignUpResponse'
{
SignUpResponse -> Maybe CodeDeliveryDetailsType
codeDeliveryDetails :: Prelude.Maybe CodeDeliveryDetailsType,
SignUpResponse -> Int
httpStatus :: Prelude.Int,
SignUpResponse -> Bool
userConfirmed :: Prelude.Bool,
SignUpResponse -> Text
userSub :: Prelude.Text
}
deriving (SignUpResponse -> SignUpResponse -> Bool
(SignUpResponse -> SignUpResponse -> Bool)
-> (SignUpResponse -> SignUpResponse -> Bool) -> Eq SignUpResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SignUpResponse -> SignUpResponse -> Bool
$c/= :: SignUpResponse -> SignUpResponse -> Bool
== :: SignUpResponse -> SignUpResponse -> Bool
$c== :: SignUpResponse -> SignUpResponse -> Bool
Prelude.Eq, ReadPrec [SignUpResponse]
ReadPrec SignUpResponse
Int -> ReadS SignUpResponse
ReadS [SignUpResponse]
(Int -> ReadS SignUpResponse)
-> ReadS [SignUpResponse]
-> ReadPrec SignUpResponse
-> ReadPrec [SignUpResponse]
-> Read SignUpResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SignUpResponse]
$creadListPrec :: ReadPrec [SignUpResponse]
readPrec :: ReadPrec SignUpResponse
$creadPrec :: ReadPrec SignUpResponse
readList :: ReadS [SignUpResponse]
$creadList :: ReadS [SignUpResponse]
readsPrec :: Int -> ReadS SignUpResponse
$creadsPrec :: Int -> ReadS SignUpResponse
Prelude.Read, Int -> SignUpResponse -> ShowS
[SignUpResponse] -> ShowS
SignUpResponse -> String
(Int -> SignUpResponse -> ShowS)
-> (SignUpResponse -> String)
-> ([SignUpResponse] -> ShowS)
-> Show SignUpResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SignUpResponse] -> ShowS
$cshowList :: [SignUpResponse] -> ShowS
show :: SignUpResponse -> String
$cshow :: SignUpResponse -> String
showsPrec :: Int -> SignUpResponse -> ShowS
$cshowsPrec :: Int -> SignUpResponse -> ShowS
Prelude.Show, (forall x. SignUpResponse -> Rep SignUpResponse x)
-> (forall x. Rep SignUpResponse x -> SignUpResponse)
-> Generic SignUpResponse
forall x. Rep SignUpResponse x -> SignUpResponse
forall x. SignUpResponse -> Rep SignUpResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SignUpResponse x -> SignUpResponse
$cfrom :: forall x. SignUpResponse -> Rep SignUpResponse x
Prelude.Generic)
newSignUpResponse ::
Prelude.Int ->
Prelude.Bool ->
Prelude.Text ->
SignUpResponse
newSignUpResponse :: Int -> Bool -> Text -> SignUpResponse
newSignUpResponse
Int
pHttpStatus_
Bool
pUserConfirmed_
Text
pUserSub_ =
SignUpResponse' :: Maybe CodeDeliveryDetailsType
-> Int -> Bool -> Text -> SignUpResponse
SignUpResponse'
{ $sel:codeDeliveryDetails:SignUpResponse' :: Maybe CodeDeliveryDetailsType
codeDeliveryDetails =
Maybe CodeDeliveryDetailsType
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:SignUpResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:userConfirmed:SignUpResponse' :: Bool
userConfirmed = Bool
pUserConfirmed_,
$sel:userSub:SignUpResponse' :: Text
userSub = Text
pUserSub_
}
signUpResponse_codeDeliveryDetails :: Lens.Lens' SignUpResponse (Prelude.Maybe CodeDeliveryDetailsType)
signUpResponse_codeDeliveryDetails :: (Maybe CodeDeliveryDetailsType
-> f (Maybe CodeDeliveryDetailsType))
-> SignUpResponse -> f SignUpResponse
signUpResponse_codeDeliveryDetails = (SignUpResponse -> Maybe CodeDeliveryDetailsType)
-> (SignUpResponse
-> Maybe CodeDeliveryDetailsType -> SignUpResponse)
-> Lens
SignUpResponse
SignUpResponse
(Maybe CodeDeliveryDetailsType)
(Maybe CodeDeliveryDetailsType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUpResponse' {Maybe CodeDeliveryDetailsType
codeDeliveryDetails :: Maybe CodeDeliveryDetailsType
$sel:codeDeliveryDetails:SignUpResponse' :: SignUpResponse -> Maybe CodeDeliveryDetailsType
codeDeliveryDetails} -> Maybe CodeDeliveryDetailsType
codeDeliveryDetails) (\s :: SignUpResponse
s@SignUpResponse' {} Maybe CodeDeliveryDetailsType
a -> SignUpResponse
s {$sel:codeDeliveryDetails:SignUpResponse' :: Maybe CodeDeliveryDetailsType
codeDeliveryDetails = Maybe CodeDeliveryDetailsType
a} :: SignUpResponse)
signUpResponse_httpStatus :: Lens.Lens' SignUpResponse Prelude.Int
signUpResponse_httpStatus :: (Int -> f Int) -> SignUpResponse -> f SignUpResponse
signUpResponse_httpStatus = (SignUpResponse -> Int)
-> (SignUpResponse -> Int -> SignUpResponse)
-> Lens SignUpResponse SignUpResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUpResponse' {Int
httpStatus :: Int
$sel:httpStatus:SignUpResponse' :: SignUpResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SignUpResponse
s@SignUpResponse' {} Int
a -> SignUpResponse
s {$sel:httpStatus:SignUpResponse' :: Int
httpStatus = Int
a} :: SignUpResponse)
signUpResponse_userConfirmed :: Lens.Lens' SignUpResponse Prelude.Bool
signUpResponse_userConfirmed :: (Bool -> f Bool) -> SignUpResponse -> f SignUpResponse
signUpResponse_userConfirmed = (SignUpResponse -> Bool)
-> (SignUpResponse -> Bool -> SignUpResponse)
-> Lens SignUpResponse SignUpResponse Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUpResponse' {Bool
userConfirmed :: Bool
$sel:userConfirmed:SignUpResponse' :: SignUpResponse -> Bool
userConfirmed} -> Bool
userConfirmed) (\s :: SignUpResponse
s@SignUpResponse' {} Bool
a -> SignUpResponse
s {$sel:userConfirmed:SignUpResponse' :: Bool
userConfirmed = Bool
a} :: SignUpResponse)
signUpResponse_userSub :: Lens.Lens' SignUpResponse Prelude.Text
signUpResponse_userSub :: (Text -> f Text) -> SignUpResponse -> f SignUpResponse
signUpResponse_userSub = (SignUpResponse -> Text)
-> (SignUpResponse -> Text -> SignUpResponse)
-> Lens SignUpResponse SignUpResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUpResponse' {Text
userSub :: Text
$sel:userSub:SignUpResponse' :: SignUpResponse -> Text
userSub} -> Text
userSub) (\s :: SignUpResponse
s@SignUpResponse' {} Text
a -> SignUpResponse
s {$sel:userSub:SignUpResponse' :: Text
userSub = Text
a} :: SignUpResponse)
instance Prelude.NFData SignUpResponse