{-# 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.ElastiCache.DeleteUser
(
DeleteUser (..),
newDeleteUser,
deleteUser_userId,
User (..),
newUser,
user_status,
user_arn,
user_userGroupIds,
user_authentication,
user_engine,
user_userName,
user_accessString,
user_userId,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ElastiCache.Types
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 -> Text
userId :: 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, ReadPrec [DeleteUser]
ReadPrec DeleteUser
Int -> ReadS DeleteUser
ReadS [DeleteUser]
(Int -> ReadS DeleteUser)
-> ReadS [DeleteUser]
-> ReadPrec DeleteUser
-> ReadPrec [DeleteUser]
-> Read DeleteUser
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteUser]
$creadListPrec :: ReadPrec [DeleteUser]
readPrec :: ReadPrec DeleteUser
$creadPrec :: ReadPrec DeleteUser
readList :: ReadS [DeleteUser]
$creadList :: ReadS [DeleteUser]
readsPrec :: Int -> ReadS DeleteUser
$creadsPrec :: Int -> ReadS DeleteUser
Prelude.Read, 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
pUserId_ =
DeleteUser' :: Text -> DeleteUser
DeleteUser' {$sel:userId:DeleteUser' :: Text
userId = Text
pUserId_}
deleteUser_userId :: Lens.Lens' DeleteUser Prelude.Text
deleteUser_userId :: (Text -> f Text) -> DeleteUser -> f DeleteUser
deleteUser_userId = (DeleteUser -> Text)
-> (DeleteUser -> Text -> DeleteUser)
-> Lens DeleteUser DeleteUser Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUser' {Text
userId :: Text
$sel:userId:DeleteUser' :: DeleteUser -> Text
userId} -> Text
userId) (\s :: DeleteUser
s@DeleteUser' {} Text
a -> DeleteUser
s {$sel:userId:DeleteUser' :: Text
userId = Text
a} :: DeleteUser)
instance Core.AWSRequest DeleteUser where
type AWSResponse DeleteUser = User
request :: DeleteUser -> Request DeleteUser
request = Service -> DeleteUser -> Request DeleteUser
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteUser
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteUser)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DeleteUser))
-> Logger
-> Service
-> Proxy DeleteUser
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteUser)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"DeleteUserResult"
(\Int
s ResponseHeaders
h [Node]
x -> [Node] -> Either String User
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
instance Prelude.Hashable DeleteUser
instance Prelude.NFData DeleteUser
instance Core.ToHeaders DeleteUser where
toHeaders :: DeleteUser -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteUser -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
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 DeleteUser' {Text
userId :: Text
$sel:userId:DeleteUser' :: DeleteUser -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DeleteUser" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
ByteString
"UserId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
userId
]