{-# 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.AdminUserGlobalSignOut
(
AdminUserGlobalSignOut (..),
newAdminUserGlobalSignOut,
adminUserGlobalSignOut_userPoolId,
adminUserGlobalSignOut_username,
AdminUserGlobalSignOutResponse (..),
newAdminUserGlobalSignOutResponse,
adminUserGlobalSignOutResponse_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 AdminUserGlobalSignOut = AdminUserGlobalSignOut'
{
AdminUserGlobalSignOut -> Text
userPoolId :: Prelude.Text,
AdminUserGlobalSignOut -> Sensitive Text
username :: Core.Sensitive Prelude.Text
}
deriving (AdminUserGlobalSignOut -> AdminUserGlobalSignOut -> Bool
(AdminUserGlobalSignOut -> AdminUserGlobalSignOut -> Bool)
-> (AdminUserGlobalSignOut -> AdminUserGlobalSignOut -> Bool)
-> Eq AdminUserGlobalSignOut
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdminUserGlobalSignOut -> AdminUserGlobalSignOut -> Bool
$c/= :: AdminUserGlobalSignOut -> AdminUserGlobalSignOut -> Bool
== :: AdminUserGlobalSignOut -> AdminUserGlobalSignOut -> Bool
$c== :: AdminUserGlobalSignOut -> AdminUserGlobalSignOut -> Bool
Prelude.Eq, Int -> AdminUserGlobalSignOut -> ShowS
[AdminUserGlobalSignOut] -> ShowS
AdminUserGlobalSignOut -> String
(Int -> AdminUserGlobalSignOut -> ShowS)
-> (AdminUserGlobalSignOut -> String)
-> ([AdminUserGlobalSignOut] -> ShowS)
-> Show AdminUserGlobalSignOut
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdminUserGlobalSignOut] -> ShowS
$cshowList :: [AdminUserGlobalSignOut] -> ShowS
show :: AdminUserGlobalSignOut -> String
$cshow :: AdminUserGlobalSignOut -> String
showsPrec :: Int -> AdminUserGlobalSignOut -> ShowS
$cshowsPrec :: Int -> AdminUserGlobalSignOut -> ShowS
Prelude.Show, (forall x. AdminUserGlobalSignOut -> Rep AdminUserGlobalSignOut x)
-> (forall x.
Rep AdminUserGlobalSignOut x -> AdminUserGlobalSignOut)
-> Generic AdminUserGlobalSignOut
forall x. Rep AdminUserGlobalSignOut x -> AdminUserGlobalSignOut
forall x. AdminUserGlobalSignOut -> Rep AdminUserGlobalSignOut x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AdminUserGlobalSignOut x -> AdminUserGlobalSignOut
$cfrom :: forall x. AdminUserGlobalSignOut -> Rep AdminUserGlobalSignOut x
Prelude.Generic)
newAdminUserGlobalSignOut ::
Prelude.Text ->
Prelude.Text ->
AdminUserGlobalSignOut
newAdminUserGlobalSignOut :: Text -> Text -> AdminUserGlobalSignOut
newAdminUserGlobalSignOut Text
pUserPoolId_ Text
pUsername_ =
AdminUserGlobalSignOut' :: Text -> Sensitive Text -> AdminUserGlobalSignOut
AdminUserGlobalSignOut'
{ $sel:userPoolId:AdminUserGlobalSignOut' :: Text
userPoolId = Text
pUserPoolId_,
$sel:username:AdminUserGlobalSignOut' :: 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_
}
adminUserGlobalSignOut_userPoolId :: Lens.Lens' AdminUserGlobalSignOut Prelude.Text
adminUserGlobalSignOut_userPoolId :: (Text -> f Text)
-> AdminUserGlobalSignOut -> f AdminUserGlobalSignOut
adminUserGlobalSignOut_userPoolId = (AdminUserGlobalSignOut -> Text)
-> (AdminUserGlobalSignOut -> Text -> AdminUserGlobalSignOut)
-> Lens AdminUserGlobalSignOut AdminUserGlobalSignOut Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminUserGlobalSignOut' {Text
userPoolId :: Text
$sel:userPoolId:AdminUserGlobalSignOut' :: AdminUserGlobalSignOut -> Text
userPoolId} -> Text
userPoolId) (\s :: AdminUserGlobalSignOut
s@AdminUserGlobalSignOut' {} Text
a -> AdminUserGlobalSignOut
s {$sel:userPoolId:AdminUserGlobalSignOut' :: Text
userPoolId = Text
a} :: AdminUserGlobalSignOut)
adminUserGlobalSignOut_username :: Lens.Lens' AdminUserGlobalSignOut Prelude.Text
adminUserGlobalSignOut_username :: (Text -> f Text)
-> AdminUserGlobalSignOut -> f AdminUserGlobalSignOut
adminUserGlobalSignOut_username = (AdminUserGlobalSignOut -> Sensitive Text)
-> (AdminUserGlobalSignOut
-> Sensitive Text -> AdminUserGlobalSignOut)
-> Lens
AdminUserGlobalSignOut
AdminUserGlobalSignOut
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminUserGlobalSignOut' {Sensitive Text
username :: Sensitive Text
$sel:username:AdminUserGlobalSignOut' :: AdminUserGlobalSignOut -> Sensitive Text
username} -> Sensitive Text
username) (\s :: AdminUserGlobalSignOut
s@AdminUserGlobalSignOut' {} Sensitive Text
a -> AdminUserGlobalSignOut
s {$sel:username:AdminUserGlobalSignOut' :: Sensitive Text
username = Sensitive Text
a} :: AdminUserGlobalSignOut) ((Sensitive Text -> f (Sensitive Text))
-> AdminUserGlobalSignOut -> f AdminUserGlobalSignOut)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> AdminUserGlobalSignOut
-> f AdminUserGlobalSignOut
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 AdminUserGlobalSignOut where
type
AWSResponse AdminUserGlobalSignOut =
AdminUserGlobalSignOutResponse
request :: AdminUserGlobalSignOut -> Request AdminUserGlobalSignOut
request = Service -> AdminUserGlobalSignOut -> Request AdminUserGlobalSignOut
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AdminUserGlobalSignOut
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AdminUserGlobalSignOut)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse AdminUserGlobalSignOut))
-> Logger
-> Service
-> Proxy AdminUserGlobalSignOut
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AdminUserGlobalSignOut)))
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 -> AdminUserGlobalSignOutResponse
AdminUserGlobalSignOutResponse'
(Int -> AdminUserGlobalSignOutResponse)
-> Either String Int
-> Either String AdminUserGlobalSignOutResponse
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 AdminUserGlobalSignOut
instance Prelude.NFData AdminUserGlobalSignOut
instance Core.ToHeaders AdminUserGlobalSignOut where
toHeaders :: AdminUserGlobalSignOut -> ResponseHeaders
toHeaders =
ResponseHeaders -> AdminUserGlobalSignOut -> 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.AdminUserGlobalSignOut" ::
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 AdminUserGlobalSignOut where
toJSON :: AdminUserGlobalSignOut -> Value
toJSON AdminUserGlobalSignOut' {Text
Sensitive Text
username :: Sensitive Text
userPoolId :: Text
$sel:username:AdminUserGlobalSignOut' :: AdminUserGlobalSignOut -> Sensitive Text
$sel:userPoolId:AdminUserGlobalSignOut' :: AdminUserGlobalSignOut -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ 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 AdminUserGlobalSignOut where
toPath :: AdminUserGlobalSignOut -> ByteString
toPath = ByteString -> AdminUserGlobalSignOut -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AdminUserGlobalSignOut where
toQuery :: AdminUserGlobalSignOut -> QueryString
toQuery = QueryString -> AdminUserGlobalSignOut -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AdminUserGlobalSignOutResponse = AdminUserGlobalSignOutResponse'
{
AdminUserGlobalSignOutResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AdminUserGlobalSignOutResponse
-> AdminUserGlobalSignOutResponse -> Bool
(AdminUserGlobalSignOutResponse
-> AdminUserGlobalSignOutResponse -> Bool)
-> (AdminUserGlobalSignOutResponse
-> AdminUserGlobalSignOutResponse -> Bool)
-> Eq AdminUserGlobalSignOutResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdminUserGlobalSignOutResponse
-> AdminUserGlobalSignOutResponse -> Bool
$c/= :: AdminUserGlobalSignOutResponse
-> AdminUserGlobalSignOutResponse -> Bool
== :: AdminUserGlobalSignOutResponse
-> AdminUserGlobalSignOutResponse -> Bool
$c== :: AdminUserGlobalSignOutResponse
-> AdminUserGlobalSignOutResponse -> Bool
Prelude.Eq, ReadPrec [AdminUserGlobalSignOutResponse]
ReadPrec AdminUserGlobalSignOutResponse
Int -> ReadS AdminUserGlobalSignOutResponse
ReadS [AdminUserGlobalSignOutResponse]
(Int -> ReadS AdminUserGlobalSignOutResponse)
-> ReadS [AdminUserGlobalSignOutResponse]
-> ReadPrec AdminUserGlobalSignOutResponse
-> ReadPrec [AdminUserGlobalSignOutResponse]
-> Read AdminUserGlobalSignOutResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AdminUserGlobalSignOutResponse]
$creadListPrec :: ReadPrec [AdminUserGlobalSignOutResponse]
readPrec :: ReadPrec AdminUserGlobalSignOutResponse
$creadPrec :: ReadPrec AdminUserGlobalSignOutResponse
readList :: ReadS [AdminUserGlobalSignOutResponse]
$creadList :: ReadS [AdminUserGlobalSignOutResponse]
readsPrec :: Int -> ReadS AdminUserGlobalSignOutResponse
$creadsPrec :: Int -> ReadS AdminUserGlobalSignOutResponse
Prelude.Read, Int -> AdminUserGlobalSignOutResponse -> ShowS
[AdminUserGlobalSignOutResponse] -> ShowS
AdminUserGlobalSignOutResponse -> String
(Int -> AdminUserGlobalSignOutResponse -> ShowS)
-> (AdminUserGlobalSignOutResponse -> String)
-> ([AdminUserGlobalSignOutResponse] -> ShowS)
-> Show AdminUserGlobalSignOutResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdminUserGlobalSignOutResponse] -> ShowS
$cshowList :: [AdminUserGlobalSignOutResponse] -> ShowS
show :: AdminUserGlobalSignOutResponse -> String
$cshow :: AdminUserGlobalSignOutResponse -> String
showsPrec :: Int -> AdminUserGlobalSignOutResponse -> ShowS
$cshowsPrec :: Int -> AdminUserGlobalSignOutResponse -> ShowS
Prelude.Show, (forall x.
AdminUserGlobalSignOutResponse
-> Rep AdminUserGlobalSignOutResponse x)
-> (forall x.
Rep AdminUserGlobalSignOutResponse x
-> AdminUserGlobalSignOutResponse)
-> Generic AdminUserGlobalSignOutResponse
forall x.
Rep AdminUserGlobalSignOutResponse x
-> AdminUserGlobalSignOutResponse
forall x.
AdminUserGlobalSignOutResponse
-> Rep AdminUserGlobalSignOutResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AdminUserGlobalSignOutResponse x
-> AdminUserGlobalSignOutResponse
$cfrom :: forall x.
AdminUserGlobalSignOutResponse
-> Rep AdminUserGlobalSignOutResponse x
Prelude.Generic)
newAdminUserGlobalSignOutResponse ::
Prelude.Int ->
AdminUserGlobalSignOutResponse
newAdminUserGlobalSignOutResponse :: Int -> AdminUserGlobalSignOutResponse
newAdminUserGlobalSignOutResponse Int
pHttpStatus_ =
AdminUserGlobalSignOutResponse' :: Int -> AdminUserGlobalSignOutResponse
AdminUserGlobalSignOutResponse'
{ $sel:httpStatus:AdminUserGlobalSignOutResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
adminUserGlobalSignOutResponse_httpStatus :: Lens.Lens' AdminUserGlobalSignOutResponse Prelude.Int
adminUserGlobalSignOutResponse_httpStatus :: (Int -> f Int)
-> AdminUserGlobalSignOutResponse
-> f AdminUserGlobalSignOutResponse
adminUserGlobalSignOutResponse_httpStatus = (AdminUserGlobalSignOutResponse -> Int)
-> (AdminUserGlobalSignOutResponse
-> Int -> AdminUserGlobalSignOutResponse)
-> Lens
AdminUserGlobalSignOutResponse
AdminUserGlobalSignOutResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminUserGlobalSignOutResponse' {Int
httpStatus :: Int
$sel:httpStatus:AdminUserGlobalSignOutResponse' :: AdminUserGlobalSignOutResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AdminUserGlobalSignOutResponse
s@AdminUserGlobalSignOutResponse' {} Int
a -> AdminUserGlobalSignOutResponse
s {$sel:httpStatus:AdminUserGlobalSignOutResponse' :: Int
httpStatus = Int
a} :: AdminUserGlobalSignOutResponse)
instance
Prelude.NFData
AdminUserGlobalSignOutResponse