{-# 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.DeleteUser
(
DeleteUser (..),
newDeleteUser,
deleteUser_accessToken,
DeleteUserResponse (..),
newDeleteUserResponse,
)
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 DeleteUser = DeleteUser'
{
DeleteUser -> Sensitive Text
accessToken :: Core.Sensitive Prelude.Text
}
deriving (DeleteUser -> DeleteUser -> Bool
(DeleteUser -> DeleteUser -> Bool)
-> (DeleteUser -> DeleteUser -> Bool) -> Eq DeleteUser
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteUser -> DeleteUser -> Bool
$c/= :: DeleteUser -> DeleteUser -> Bool
== :: DeleteUser -> DeleteUser -> Bool
$c== :: DeleteUser -> DeleteUser -> Bool
Prelude.Eq, Int -> DeleteUser -> ShowS
[DeleteUser] -> ShowS
DeleteUser -> String
(Int -> DeleteUser -> ShowS)
-> (DeleteUser -> String)
-> ([DeleteUser] -> ShowS)
-> Show DeleteUser
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteUser] -> ShowS
$cshowList :: [DeleteUser] -> ShowS
show :: DeleteUser -> String
$cshow :: DeleteUser -> String
showsPrec :: Int -> DeleteUser -> ShowS
$cshowsPrec :: Int -> DeleteUser -> ShowS
Prelude.Show, (forall x. DeleteUser -> Rep DeleteUser x)
-> (forall x. Rep DeleteUser x -> DeleteUser) -> Generic DeleteUser
forall x. Rep DeleteUser x -> DeleteUser
forall x. DeleteUser -> Rep DeleteUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteUser x -> DeleteUser
$cfrom :: forall x. DeleteUser -> Rep DeleteUser x
Prelude.Generic)
newDeleteUser ::
Prelude.Text ->
DeleteUser
newDeleteUser :: Text -> DeleteUser
newDeleteUser Text
pAccessToken_ =
DeleteUser' :: Sensitive Text -> DeleteUser
DeleteUser'
{ $sel:accessToken:DeleteUser' :: Sensitive Text
accessToken =
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
pAccessToken_
}
deleteUser_accessToken :: Lens.Lens' DeleteUser Prelude.Text
deleteUser_accessToken :: (Text -> f Text) -> DeleteUser -> f DeleteUser
deleteUser_accessToken = (DeleteUser -> Sensitive Text)
-> (DeleteUser -> Sensitive Text -> DeleteUser)
-> Lens DeleteUser DeleteUser (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUser' {Sensitive Text
accessToken :: Sensitive Text
$sel:accessToken:DeleteUser' :: DeleteUser -> Sensitive Text
accessToken} -> Sensitive Text
accessToken) (\s :: DeleteUser
s@DeleteUser' {} Sensitive Text
a -> DeleteUser
s {$sel:accessToken:DeleteUser' :: Sensitive Text
accessToken = Sensitive Text
a} :: DeleteUser) ((Sensitive Text -> f (Sensitive Text))
-> DeleteUser -> f DeleteUser)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> DeleteUser
-> f DeleteUser
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 DeleteUser where
type AWSResponse DeleteUser = DeleteUserResponse
request :: DeleteUser -> Request DeleteUser
request = Service -> DeleteUser -> Request DeleteUser
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteUser
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteUser)))
response = AWSResponse DeleteUser
-> Logger
-> Service
-> Proxy DeleteUser
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteUser)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteUser
DeleteUserResponse
DeleteUserResponse'
instance Prelude.Hashable DeleteUser
instance Prelude.NFData DeleteUser
instance Core.ToHeaders DeleteUser where
toHeaders :: DeleteUser -> [Header]
toHeaders =
[Header] -> DeleteUser -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"AWSCognitoIdentityProviderService.DeleteUser" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DeleteUser where
toJSON :: DeleteUser -> Value
toJSON DeleteUser' {Sensitive Text
accessToken :: Sensitive Text
$sel:accessToken:DeleteUser' :: DeleteUser -> Sensitive 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
"AccessToken" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
accessToken)]
)
instance Core.ToPath DeleteUser where
toPath :: DeleteUser -> ByteString
toPath = ByteString -> DeleteUser -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteUser where
toQuery :: DeleteUser -> QueryString
toQuery = QueryString -> DeleteUser -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteUserResponse = DeleteUserResponse'
{
}
deriving (DeleteUserResponse -> DeleteUserResponse -> Bool
(DeleteUserResponse -> DeleteUserResponse -> Bool)
-> (DeleteUserResponse -> DeleteUserResponse -> Bool)
-> Eq DeleteUserResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteUserResponse -> DeleteUserResponse -> Bool
$c/= :: DeleteUserResponse -> DeleteUserResponse -> Bool
== :: DeleteUserResponse -> DeleteUserResponse -> Bool
$c== :: DeleteUserResponse -> DeleteUserResponse -> Bool
Prelude.Eq, ReadPrec [DeleteUserResponse]
ReadPrec DeleteUserResponse
Int -> ReadS DeleteUserResponse
ReadS [DeleteUserResponse]
(Int -> ReadS DeleteUserResponse)
-> ReadS [DeleteUserResponse]
-> ReadPrec DeleteUserResponse
-> ReadPrec [DeleteUserResponse]
-> Read DeleteUserResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteUserResponse]
$creadListPrec :: ReadPrec [DeleteUserResponse]
readPrec :: ReadPrec DeleteUserResponse
$creadPrec :: ReadPrec DeleteUserResponse
readList :: ReadS [DeleteUserResponse]
$creadList :: ReadS [DeleteUserResponse]
readsPrec :: Int -> ReadS DeleteUserResponse
$creadsPrec :: Int -> ReadS DeleteUserResponse
Prelude.Read, Int -> DeleteUserResponse -> ShowS
[DeleteUserResponse] -> ShowS
DeleteUserResponse -> String
(Int -> DeleteUserResponse -> ShowS)
-> (DeleteUserResponse -> String)
-> ([DeleteUserResponse] -> ShowS)
-> Show DeleteUserResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteUserResponse] -> ShowS
$cshowList :: [DeleteUserResponse] -> ShowS
show :: DeleteUserResponse -> String
$cshow :: DeleteUserResponse -> String
showsPrec :: Int -> DeleteUserResponse -> ShowS
$cshowsPrec :: Int -> DeleteUserResponse -> ShowS
Prelude.Show, (forall x. DeleteUserResponse -> Rep DeleteUserResponse x)
-> (forall x. Rep DeleteUserResponse x -> DeleteUserResponse)
-> Generic DeleteUserResponse
forall x. Rep DeleteUserResponse x -> DeleteUserResponse
forall x. DeleteUserResponse -> Rep DeleteUserResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteUserResponse x -> DeleteUserResponse
$cfrom :: forall x. DeleteUserResponse -> Rep DeleteUserResponse x
Prelude.Generic)
newDeleteUserResponse ::
DeleteUserResponse
newDeleteUserResponse :: DeleteUserResponse
newDeleteUserResponse = DeleteUserResponse
DeleteUserResponse'
instance Prelude.NFData DeleteUserResponse