{-# 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.QuickSight.DeleteUser
(
DeleteUser (..),
newDeleteUser,
deleteUser_userName,
deleteUser_awsAccountId,
deleteUser_namespace,
DeleteUserResponse (..),
newDeleteUserResponse,
deleteUserResponse_requestId,
deleteUserResponse_status,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteUser = DeleteUser'
{
DeleteUser -> Text
userName :: Prelude.Text,
DeleteUser -> Text
awsAccountId :: Prelude.Text,
DeleteUser -> Text
namespace :: 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 ->
Prelude.Text ->
Prelude.Text ->
DeleteUser
newDeleteUser :: Text -> Text -> Text -> DeleteUser
newDeleteUser Text
pUserName_ Text
pAwsAccountId_ Text
pNamespace_ =
DeleteUser' :: Text -> Text -> Text -> DeleteUser
DeleteUser'
{ $sel:userName:DeleteUser' :: Text
userName = Text
pUserName_,
$sel:awsAccountId:DeleteUser' :: Text
awsAccountId = Text
pAwsAccountId_,
$sel:namespace:DeleteUser' :: Text
namespace = Text
pNamespace_
}
deleteUser_userName :: Lens.Lens' DeleteUser Prelude.Text
deleteUser_userName :: (Text -> f Text) -> DeleteUser -> f DeleteUser
deleteUser_userName = (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
userName :: Text
$sel:userName:DeleteUser' :: DeleteUser -> Text
userName} -> Text
userName) (\s :: DeleteUser
s@DeleteUser' {} Text
a -> DeleteUser
s {$sel:userName:DeleteUser' :: Text
userName = Text
a} :: DeleteUser)
deleteUser_awsAccountId :: Lens.Lens' DeleteUser Prelude.Text
deleteUser_awsAccountId :: (Text -> f Text) -> DeleteUser -> f DeleteUser
deleteUser_awsAccountId = (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
awsAccountId :: Text
$sel:awsAccountId:DeleteUser' :: DeleteUser -> Text
awsAccountId} -> Text
awsAccountId) (\s :: DeleteUser
s@DeleteUser' {} Text
a -> DeleteUser
s {$sel:awsAccountId:DeleteUser' :: Text
awsAccountId = Text
a} :: DeleteUser)
deleteUser_namespace :: Lens.Lens' DeleteUser Prelude.Text
deleteUser_namespace :: (Text -> f Text) -> DeleteUser -> f DeleteUser
deleteUser_namespace = (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
namespace :: Text
$sel:namespace:DeleteUser' :: DeleteUser -> Text
namespace} -> Text
namespace) (\s :: DeleteUser
s@DeleteUser' {} Text
a -> DeleteUser
s {$sel:namespace:DeleteUser' :: Text
namespace = Text
a} :: DeleteUser)
instance Core.AWSRequest DeleteUser where
type AWSResponse DeleteUser = DeleteUserResponse
request :: DeleteUser -> Request DeleteUser
request = Service -> DeleteUser -> Request DeleteUser
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteUser
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteUser)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteUser))
-> Logger
-> Service
-> Proxy DeleteUser
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteUser)))
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 Text -> Int -> DeleteUserResponse
DeleteUserResponse'
(Maybe Text -> Int -> DeleteUserResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteUserResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RequestId")
Either String (Int -> DeleteUserResponse)
-> Either String Int -> Either String DeleteUserResponse
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))
)
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] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToPath DeleteUser where
toPath :: DeleteUser -> ByteString
toPath DeleteUser' {Text
namespace :: Text
awsAccountId :: Text
userName :: Text
$sel:namespace:DeleteUser' :: DeleteUser -> Text
$sel:awsAccountId:DeleteUser' :: DeleteUser -> Text
$sel:userName:DeleteUser' :: DeleteUser -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/accounts/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId,
ByteString
"/namespaces/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
namespace,
ByteString
"/users/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
userName
]
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'
{
DeleteUserResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
DeleteUserResponse -> Int
status :: Prelude.Int
}
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 ::
Prelude.Int ->
DeleteUserResponse
newDeleteUserResponse :: Int -> DeleteUserResponse
newDeleteUserResponse Int
pStatus_ =
DeleteUserResponse' :: Maybe Text -> Int -> DeleteUserResponse
DeleteUserResponse'
{ $sel:requestId:DeleteUserResponse' :: Maybe Text
requestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:DeleteUserResponse' :: Int
status = Int
pStatus_
}
deleteUserResponse_requestId :: Lens.Lens' DeleteUserResponse (Prelude.Maybe Prelude.Text)
deleteUserResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> DeleteUserResponse -> f DeleteUserResponse
deleteUserResponse_requestId = (DeleteUserResponse -> Maybe Text)
-> (DeleteUserResponse -> Maybe Text -> DeleteUserResponse)
-> Lens
DeleteUserResponse DeleteUserResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUserResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:DeleteUserResponse' :: DeleteUserResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: DeleteUserResponse
s@DeleteUserResponse' {} Maybe Text
a -> DeleteUserResponse
s {$sel:requestId:DeleteUserResponse' :: Maybe Text
requestId = Maybe Text
a} :: DeleteUserResponse)
deleteUserResponse_status :: Lens.Lens' DeleteUserResponse Prelude.Int
deleteUserResponse_status :: (Int -> f Int) -> DeleteUserResponse -> f DeleteUserResponse
deleteUserResponse_status = (DeleteUserResponse -> Int)
-> (DeleteUserResponse -> Int -> DeleteUserResponse)
-> Lens DeleteUserResponse DeleteUserResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUserResponse' {Int
status :: Int
$sel:status:DeleteUserResponse' :: DeleteUserResponse -> Int
status} -> Int
status) (\s :: DeleteUserResponse
s@DeleteUserResponse' {} Int
a -> DeleteUserResponse
s {$sel:status:DeleteUserResponse' :: Int
status = Int
a} :: DeleteUserResponse)
instance Prelude.NFData DeleteUserResponse