{-# 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.AdminConfirmSignUp
(
AdminConfirmSignUp (..),
newAdminConfirmSignUp,
adminConfirmSignUp_clientMetadata,
adminConfirmSignUp_userPoolId,
adminConfirmSignUp_username,
AdminConfirmSignUpResponse (..),
newAdminConfirmSignUpResponse,
adminConfirmSignUpResponse_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 AdminConfirmSignUp = AdminConfirmSignUp'
{
AdminConfirmSignUp -> Maybe (HashMap Text Text)
clientMetadata :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
AdminConfirmSignUp -> Text
userPoolId :: Prelude.Text,
AdminConfirmSignUp -> Sensitive Text
username :: Core.Sensitive Prelude.Text
}
deriving (AdminConfirmSignUp -> AdminConfirmSignUp -> Bool
(AdminConfirmSignUp -> AdminConfirmSignUp -> Bool)
-> (AdminConfirmSignUp -> AdminConfirmSignUp -> Bool)
-> Eq AdminConfirmSignUp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdminConfirmSignUp -> AdminConfirmSignUp -> Bool
$c/= :: AdminConfirmSignUp -> AdminConfirmSignUp -> Bool
== :: AdminConfirmSignUp -> AdminConfirmSignUp -> Bool
$c== :: AdminConfirmSignUp -> AdminConfirmSignUp -> Bool
Prelude.Eq, Int -> AdminConfirmSignUp -> ShowS
[AdminConfirmSignUp] -> ShowS
AdminConfirmSignUp -> String
(Int -> AdminConfirmSignUp -> ShowS)
-> (AdminConfirmSignUp -> String)
-> ([AdminConfirmSignUp] -> ShowS)
-> Show AdminConfirmSignUp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdminConfirmSignUp] -> ShowS
$cshowList :: [AdminConfirmSignUp] -> ShowS
show :: AdminConfirmSignUp -> String
$cshow :: AdminConfirmSignUp -> String
showsPrec :: Int -> AdminConfirmSignUp -> ShowS
$cshowsPrec :: Int -> AdminConfirmSignUp -> ShowS
Prelude.Show, (forall x. AdminConfirmSignUp -> Rep AdminConfirmSignUp x)
-> (forall x. Rep AdminConfirmSignUp x -> AdminConfirmSignUp)
-> Generic AdminConfirmSignUp
forall x. Rep AdminConfirmSignUp x -> AdminConfirmSignUp
forall x. AdminConfirmSignUp -> Rep AdminConfirmSignUp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AdminConfirmSignUp x -> AdminConfirmSignUp
$cfrom :: forall x. AdminConfirmSignUp -> Rep AdminConfirmSignUp x
Prelude.Generic)
newAdminConfirmSignUp ::
Prelude.Text ->
Prelude.Text ->
AdminConfirmSignUp
newAdminConfirmSignUp :: Text -> Text -> AdminConfirmSignUp
newAdminConfirmSignUp Text
pUserPoolId_ Text
pUsername_ =
AdminConfirmSignUp' :: Maybe (HashMap Text Text)
-> Text -> Sensitive Text -> AdminConfirmSignUp
AdminConfirmSignUp'
{ $sel:clientMetadata:AdminConfirmSignUp' :: Maybe (HashMap Text Text)
clientMetadata =
Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:userPoolId:AdminConfirmSignUp' :: Text
userPoolId = Text
pUserPoolId_,
$sel:username:AdminConfirmSignUp' :: 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_
}
adminConfirmSignUp_clientMetadata :: Lens.Lens' AdminConfirmSignUp (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
adminConfirmSignUp_clientMetadata :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AdminConfirmSignUp -> f AdminConfirmSignUp
adminConfirmSignUp_clientMetadata = (AdminConfirmSignUp -> Maybe (HashMap Text Text))
-> (AdminConfirmSignUp
-> Maybe (HashMap Text Text) -> AdminConfirmSignUp)
-> Lens
AdminConfirmSignUp
AdminConfirmSignUp
(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 (\AdminConfirmSignUp' {Maybe (HashMap Text Text)
clientMetadata :: Maybe (HashMap Text Text)
$sel:clientMetadata:AdminConfirmSignUp' :: AdminConfirmSignUp -> Maybe (HashMap Text Text)
clientMetadata} -> Maybe (HashMap Text Text)
clientMetadata) (\s :: AdminConfirmSignUp
s@AdminConfirmSignUp' {} Maybe (HashMap Text Text)
a -> AdminConfirmSignUp
s {$sel:clientMetadata:AdminConfirmSignUp' :: Maybe (HashMap Text Text)
clientMetadata = Maybe (HashMap Text Text)
a} :: AdminConfirmSignUp) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AdminConfirmSignUp -> f AdminConfirmSignUp)
-> ((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)))
-> AdminConfirmSignUp
-> f AdminConfirmSignUp
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
adminConfirmSignUp_userPoolId :: Lens.Lens' AdminConfirmSignUp Prelude.Text
adminConfirmSignUp_userPoolId :: (Text -> f Text) -> AdminConfirmSignUp -> f AdminConfirmSignUp
adminConfirmSignUp_userPoolId = (AdminConfirmSignUp -> Text)
-> (AdminConfirmSignUp -> Text -> AdminConfirmSignUp)
-> Lens AdminConfirmSignUp AdminConfirmSignUp Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminConfirmSignUp' {Text
userPoolId :: Text
$sel:userPoolId:AdminConfirmSignUp' :: AdminConfirmSignUp -> Text
userPoolId} -> Text
userPoolId) (\s :: AdminConfirmSignUp
s@AdminConfirmSignUp' {} Text
a -> AdminConfirmSignUp
s {$sel:userPoolId:AdminConfirmSignUp' :: Text
userPoolId = Text
a} :: AdminConfirmSignUp)
adminConfirmSignUp_username :: Lens.Lens' AdminConfirmSignUp Prelude.Text
adminConfirmSignUp_username :: (Text -> f Text) -> AdminConfirmSignUp -> f AdminConfirmSignUp
adminConfirmSignUp_username = (AdminConfirmSignUp -> Sensitive Text)
-> (AdminConfirmSignUp -> Sensitive Text -> AdminConfirmSignUp)
-> Lens
AdminConfirmSignUp
AdminConfirmSignUp
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminConfirmSignUp' {Sensitive Text
username :: Sensitive Text
$sel:username:AdminConfirmSignUp' :: AdminConfirmSignUp -> Sensitive Text
username} -> Sensitive Text
username) (\s :: AdminConfirmSignUp
s@AdminConfirmSignUp' {} Sensitive Text
a -> AdminConfirmSignUp
s {$sel:username:AdminConfirmSignUp' :: Sensitive Text
username = Sensitive Text
a} :: AdminConfirmSignUp) ((Sensitive Text -> f (Sensitive Text))
-> AdminConfirmSignUp -> f AdminConfirmSignUp)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> AdminConfirmSignUp
-> f AdminConfirmSignUp
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 AdminConfirmSignUp where
type
AWSResponse AdminConfirmSignUp =
AdminConfirmSignUpResponse
request :: AdminConfirmSignUp -> Request AdminConfirmSignUp
request = Service -> AdminConfirmSignUp -> Request AdminConfirmSignUp
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AdminConfirmSignUp
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AdminConfirmSignUp)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse AdminConfirmSignUp))
-> Logger
-> Service
-> Proxy AdminConfirmSignUp
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AdminConfirmSignUp)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> AdminConfirmSignUpResponse
AdminConfirmSignUpResponse'
(Int -> AdminConfirmSignUpResponse)
-> Either String Int -> Either String AdminConfirmSignUpResponse
forall (f :: * -> *) a b. Functor 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 AdminConfirmSignUp
instance Prelude.NFData AdminConfirmSignUp
instance Core.ToHeaders AdminConfirmSignUp where
toHeaders :: AdminConfirmSignUp -> ResponseHeaders
toHeaders =
ResponseHeaders -> AdminConfirmSignUp -> 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.AdminConfirmSignUp" ::
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 AdminConfirmSignUp where
toJSON :: AdminConfirmSignUp -> Value
toJSON AdminConfirmSignUp' {Maybe (HashMap Text Text)
Text
Sensitive Text
username :: Sensitive Text
userPoolId :: Text
clientMetadata :: Maybe (HashMap Text Text)
$sel:username:AdminConfirmSignUp' :: AdminConfirmSignUp -> Sensitive Text
$sel:userPoolId:AdminConfirmSignUp' :: AdminConfirmSignUp -> Text
$sel:clientMetadata:AdminConfirmSignUp' :: AdminConfirmSignUp -> Maybe (HashMap Text Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ClientMetadata" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
clientMetadata,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"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
"Username" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
username)
]
)
instance Core.ToPath AdminConfirmSignUp where
toPath :: AdminConfirmSignUp -> ByteString
toPath = ByteString -> AdminConfirmSignUp -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AdminConfirmSignUp where
toQuery :: AdminConfirmSignUp -> QueryString
toQuery = QueryString -> AdminConfirmSignUp -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AdminConfirmSignUpResponse = AdminConfirmSignUpResponse'
{
AdminConfirmSignUpResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AdminConfirmSignUpResponse -> AdminConfirmSignUpResponse -> Bool
(AdminConfirmSignUpResponse -> AdminConfirmSignUpResponse -> Bool)
-> (AdminConfirmSignUpResponse
-> AdminConfirmSignUpResponse -> Bool)
-> Eq AdminConfirmSignUpResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdminConfirmSignUpResponse -> AdminConfirmSignUpResponse -> Bool
$c/= :: AdminConfirmSignUpResponse -> AdminConfirmSignUpResponse -> Bool
== :: AdminConfirmSignUpResponse -> AdminConfirmSignUpResponse -> Bool
$c== :: AdminConfirmSignUpResponse -> AdminConfirmSignUpResponse -> Bool
Prelude.Eq, ReadPrec [AdminConfirmSignUpResponse]
ReadPrec AdminConfirmSignUpResponse
Int -> ReadS AdminConfirmSignUpResponse
ReadS [AdminConfirmSignUpResponse]
(Int -> ReadS AdminConfirmSignUpResponse)
-> ReadS [AdminConfirmSignUpResponse]
-> ReadPrec AdminConfirmSignUpResponse
-> ReadPrec [AdminConfirmSignUpResponse]
-> Read AdminConfirmSignUpResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AdminConfirmSignUpResponse]
$creadListPrec :: ReadPrec [AdminConfirmSignUpResponse]
readPrec :: ReadPrec AdminConfirmSignUpResponse
$creadPrec :: ReadPrec AdminConfirmSignUpResponse
readList :: ReadS [AdminConfirmSignUpResponse]
$creadList :: ReadS [AdminConfirmSignUpResponse]
readsPrec :: Int -> ReadS AdminConfirmSignUpResponse
$creadsPrec :: Int -> ReadS AdminConfirmSignUpResponse
Prelude.Read, Int -> AdminConfirmSignUpResponse -> ShowS
[AdminConfirmSignUpResponse] -> ShowS
AdminConfirmSignUpResponse -> String
(Int -> AdminConfirmSignUpResponse -> ShowS)
-> (AdminConfirmSignUpResponse -> String)
-> ([AdminConfirmSignUpResponse] -> ShowS)
-> Show AdminConfirmSignUpResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdminConfirmSignUpResponse] -> ShowS
$cshowList :: [AdminConfirmSignUpResponse] -> ShowS
show :: AdminConfirmSignUpResponse -> String
$cshow :: AdminConfirmSignUpResponse -> String
showsPrec :: Int -> AdminConfirmSignUpResponse -> ShowS
$cshowsPrec :: Int -> AdminConfirmSignUpResponse -> ShowS
Prelude.Show, (forall x.
AdminConfirmSignUpResponse -> Rep AdminConfirmSignUpResponse x)
-> (forall x.
Rep AdminConfirmSignUpResponse x -> AdminConfirmSignUpResponse)
-> Generic AdminConfirmSignUpResponse
forall x.
Rep AdminConfirmSignUpResponse x -> AdminConfirmSignUpResponse
forall x.
AdminConfirmSignUpResponse -> Rep AdminConfirmSignUpResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AdminConfirmSignUpResponse x -> AdminConfirmSignUpResponse
$cfrom :: forall x.
AdminConfirmSignUpResponse -> Rep AdminConfirmSignUpResponse x
Prelude.Generic)
newAdminConfirmSignUpResponse ::
Prelude.Int ->
AdminConfirmSignUpResponse
newAdminConfirmSignUpResponse :: Int -> AdminConfirmSignUpResponse
newAdminConfirmSignUpResponse Int
pHttpStatus_ =
AdminConfirmSignUpResponse' :: Int -> AdminConfirmSignUpResponse
AdminConfirmSignUpResponse'
{ $sel:httpStatus:AdminConfirmSignUpResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
adminConfirmSignUpResponse_httpStatus :: Lens.Lens' AdminConfirmSignUpResponse Prelude.Int
adminConfirmSignUpResponse_httpStatus :: (Int -> f Int)
-> AdminConfirmSignUpResponse -> f AdminConfirmSignUpResponse
adminConfirmSignUpResponse_httpStatus = (AdminConfirmSignUpResponse -> Int)
-> (AdminConfirmSignUpResponse
-> Int -> AdminConfirmSignUpResponse)
-> Lens
AdminConfirmSignUpResponse AdminConfirmSignUpResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminConfirmSignUpResponse' {Int
httpStatus :: Int
$sel:httpStatus:AdminConfirmSignUpResponse' :: AdminConfirmSignUpResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AdminConfirmSignUpResponse
s@AdminConfirmSignUpResponse' {} Int
a -> AdminConfirmSignUpResponse
s {$sel:httpStatus:AdminConfirmSignUpResponse' :: Int
httpStatus = Int
a} :: AdminConfirmSignUpResponse)
instance Prelude.NFData AdminConfirmSignUpResponse