{-# 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.DeleteUserByPrincipalId
(
DeleteUserByPrincipalId (..),
newDeleteUserByPrincipalId,
deleteUserByPrincipalId_principalId,
deleteUserByPrincipalId_awsAccountId,
deleteUserByPrincipalId_namespace,
DeleteUserByPrincipalIdResponse (..),
newDeleteUserByPrincipalIdResponse,
deleteUserByPrincipalIdResponse_requestId,
deleteUserByPrincipalIdResponse_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 DeleteUserByPrincipalId = DeleteUserByPrincipalId'
{
DeleteUserByPrincipalId -> Text
principalId :: Prelude.Text,
DeleteUserByPrincipalId -> Text
awsAccountId :: Prelude.Text,
DeleteUserByPrincipalId -> Text
namespace :: Prelude.Text
}
deriving (DeleteUserByPrincipalId -> DeleteUserByPrincipalId -> Bool
(DeleteUserByPrincipalId -> DeleteUserByPrincipalId -> Bool)
-> (DeleteUserByPrincipalId -> DeleteUserByPrincipalId -> Bool)
-> Eq DeleteUserByPrincipalId
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteUserByPrincipalId -> DeleteUserByPrincipalId -> Bool
$c/= :: DeleteUserByPrincipalId -> DeleteUserByPrincipalId -> Bool
== :: DeleteUserByPrincipalId -> DeleteUserByPrincipalId -> Bool
$c== :: DeleteUserByPrincipalId -> DeleteUserByPrincipalId -> Bool
Prelude.Eq, ReadPrec [DeleteUserByPrincipalId]
ReadPrec DeleteUserByPrincipalId
Int -> ReadS DeleteUserByPrincipalId
ReadS [DeleteUserByPrincipalId]
(Int -> ReadS DeleteUserByPrincipalId)
-> ReadS [DeleteUserByPrincipalId]
-> ReadPrec DeleteUserByPrincipalId
-> ReadPrec [DeleteUserByPrincipalId]
-> Read DeleteUserByPrincipalId
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteUserByPrincipalId]
$creadListPrec :: ReadPrec [DeleteUserByPrincipalId]
readPrec :: ReadPrec DeleteUserByPrincipalId
$creadPrec :: ReadPrec DeleteUserByPrincipalId
readList :: ReadS [DeleteUserByPrincipalId]
$creadList :: ReadS [DeleteUserByPrincipalId]
readsPrec :: Int -> ReadS DeleteUserByPrincipalId
$creadsPrec :: Int -> ReadS DeleteUserByPrincipalId
Prelude.Read, Int -> DeleteUserByPrincipalId -> ShowS
[DeleteUserByPrincipalId] -> ShowS
DeleteUserByPrincipalId -> String
(Int -> DeleteUserByPrincipalId -> ShowS)
-> (DeleteUserByPrincipalId -> String)
-> ([DeleteUserByPrincipalId] -> ShowS)
-> Show DeleteUserByPrincipalId
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteUserByPrincipalId] -> ShowS
$cshowList :: [DeleteUserByPrincipalId] -> ShowS
show :: DeleteUserByPrincipalId -> String
$cshow :: DeleteUserByPrincipalId -> String
showsPrec :: Int -> DeleteUserByPrincipalId -> ShowS
$cshowsPrec :: Int -> DeleteUserByPrincipalId -> ShowS
Prelude.Show, (forall x.
DeleteUserByPrincipalId -> Rep DeleteUserByPrincipalId x)
-> (forall x.
Rep DeleteUserByPrincipalId x -> DeleteUserByPrincipalId)
-> Generic DeleteUserByPrincipalId
forall x. Rep DeleteUserByPrincipalId x -> DeleteUserByPrincipalId
forall x. DeleteUserByPrincipalId -> Rep DeleteUserByPrincipalId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteUserByPrincipalId x -> DeleteUserByPrincipalId
$cfrom :: forall x. DeleteUserByPrincipalId -> Rep DeleteUserByPrincipalId x
Prelude.Generic)
newDeleteUserByPrincipalId ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DeleteUserByPrincipalId
newDeleteUserByPrincipalId :: Text -> Text -> Text -> DeleteUserByPrincipalId
newDeleteUserByPrincipalId
Text
pPrincipalId_
Text
pAwsAccountId_
Text
pNamespace_ =
DeleteUserByPrincipalId' :: Text -> Text -> Text -> DeleteUserByPrincipalId
DeleteUserByPrincipalId'
{ $sel:principalId:DeleteUserByPrincipalId' :: Text
principalId =
Text
pPrincipalId_,
$sel:awsAccountId:DeleteUserByPrincipalId' :: Text
awsAccountId = Text
pAwsAccountId_,
$sel:namespace:DeleteUserByPrincipalId' :: Text
namespace = Text
pNamespace_
}
deleteUserByPrincipalId_principalId :: Lens.Lens' DeleteUserByPrincipalId Prelude.Text
deleteUserByPrincipalId_principalId :: (Text -> f Text)
-> DeleteUserByPrincipalId -> f DeleteUserByPrincipalId
deleteUserByPrincipalId_principalId = (DeleteUserByPrincipalId -> Text)
-> (DeleteUserByPrincipalId -> Text -> DeleteUserByPrincipalId)
-> Lens DeleteUserByPrincipalId DeleteUserByPrincipalId Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUserByPrincipalId' {Text
principalId :: Text
$sel:principalId:DeleteUserByPrincipalId' :: DeleteUserByPrincipalId -> Text
principalId} -> Text
principalId) (\s :: DeleteUserByPrincipalId
s@DeleteUserByPrincipalId' {} Text
a -> DeleteUserByPrincipalId
s {$sel:principalId:DeleteUserByPrincipalId' :: Text
principalId = Text
a} :: DeleteUserByPrincipalId)
deleteUserByPrincipalId_awsAccountId :: Lens.Lens' DeleteUserByPrincipalId Prelude.Text
deleteUserByPrincipalId_awsAccountId :: (Text -> f Text)
-> DeleteUserByPrincipalId -> f DeleteUserByPrincipalId
deleteUserByPrincipalId_awsAccountId = (DeleteUserByPrincipalId -> Text)
-> (DeleteUserByPrincipalId -> Text -> DeleteUserByPrincipalId)
-> Lens DeleteUserByPrincipalId DeleteUserByPrincipalId Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUserByPrincipalId' {Text
awsAccountId :: Text
$sel:awsAccountId:DeleteUserByPrincipalId' :: DeleteUserByPrincipalId -> Text
awsAccountId} -> Text
awsAccountId) (\s :: DeleteUserByPrincipalId
s@DeleteUserByPrincipalId' {} Text
a -> DeleteUserByPrincipalId
s {$sel:awsAccountId:DeleteUserByPrincipalId' :: Text
awsAccountId = Text
a} :: DeleteUserByPrincipalId)
deleteUserByPrincipalId_namespace :: Lens.Lens' DeleteUserByPrincipalId Prelude.Text
deleteUserByPrincipalId_namespace :: (Text -> f Text)
-> DeleteUserByPrincipalId -> f DeleteUserByPrincipalId
deleteUserByPrincipalId_namespace = (DeleteUserByPrincipalId -> Text)
-> (DeleteUserByPrincipalId -> Text -> DeleteUserByPrincipalId)
-> Lens DeleteUserByPrincipalId DeleteUserByPrincipalId Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUserByPrincipalId' {Text
namespace :: Text
$sel:namespace:DeleteUserByPrincipalId' :: DeleteUserByPrincipalId -> Text
namespace} -> Text
namespace) (\s :: DeleteUserByPrincipalId
s@DeleteUserByPrincipalId' {} Text
a -> DeleteUserByPrincipalId
s {$sel:namespace:DeleteUserByPrincipalId' :: Text
namespace = Text
a} :: DeleteUserByPrincipalId)
instance Core.AWSRequest DeleteUserByPrincipalId where
type
AWSResponse DeleteUserByPrincipalId =
DeleteUserByPrincipalIdResponse
request :: DeleteUserByPrincipalId -> Request DeleteUserByPrincipalId
request = Service
-> DeleteUserByPrincipalId -> Request DeleteUserByPrincipalId
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteUserByPrincipalId
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteUserByPrincipalId)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteUserByPrincipalId))
-> Logger
-> Service
-> Proxy DeleteUserByPrincipalId
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteUserByPrincipalId)))
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 -> DeleteUserByPrincipalIdResponse
DeleteUserByPrincipalIdResponse'
(Maybe Text -> Int -> DeleteUserByPrincipalIdResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteUserByPrincipalIdResponse)
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 -> DeleteUserByPrincipalIdResponse)
-> Either String Int
-> Either String DeleteUserByPrincipalIdResponse
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 DeleteUserByPrincipalId
instance Prelude.NFData DeleteUserByPrincipalId
instance Core.ToHeaders DeleteUserByPrincipalId where
toHeaders :: DeleteUserByPrincipalId -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteUserByPrincipalId -> 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 DeleteUserByPrincipalId where
toPath :: DeleteUserByPrincipalId -> ByteString
toPath DeleteUserByPrincipalId' {Text
namespace :: Text
awsAccountId :: Text
principalId :: Text
$sel:namespace:DeleteUserByPrincipalId' :: DeleteUserByPrincipalId -> Text
$sel:awsAccountId:DeleteUserByPrincipalId' :: DeleteUserByPrincipalId -> Text
$sel:principalId:DeleteUserByPrincipalId' :: DeleteUserByPrincipalId -> 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
"/user-principals/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
principalId
]
instance Core.ToQuery DeleteUserByPrincipalId where
toQuery :: DeleteUserByPrincipalId -> QueryString
toQuery = QueryString -> DeleteUserByPrincipalId -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteUserByPrincipalIdResponse = DeleteUserByPrincipalIdResponse'
{
DeleteUserByPrincipalIdResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
DeleteUserByPrincipalIdResponse -> Int
status :: Prelude.Int
}
deriving (DeleteUserByPrincipalIdResponse
-> DeleteUserByPrincipalIdResponse -> Bool
(DeleteUserByPrincipalIdResponse
-> DeleteUserByPrincipalIdResponse -> Bool)
-> (DeleteUserByPrincipalIdResponse
-> DeleteUserByPrincipalIdResponse -> Bool)
-> Eq DeleteUserByPrincipalIdResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteUserByPrincipalIdResponse
-> DeleteUserByPrincipalIdResponse -> Bool
$c/= :: DeleteUserByPrincipalIdResponse
-> DeleteUserByPrincipalIdResponse -> Bool
== :: DeleteUserByPrincipalIdResponse
-> DeleteUserByPrincipalIdResponse -> Bool
$c== :: DeleteUserByPrincipalIdResponse
-> DeleteUserByPrincipalIdResponse -> Bool
Prelude.Eq, ReadPrec [DeleteUserByPrincipalIdResponse]
ReadPrec DeleteUserByPrincipalIdResponse
Int -> ReadS DeleteUserByPrincipalIdResponse
ReadS [DeleteUserByPrincipalIdResponse]
(Int -> ReadS DeleteUserByPrincipalIdResponse)
-> ReadS [DeleteUserByPrincipalIdResponse]
-> ReadPrec DeleteUserByPrincipalIdResponse
-> ReadPrec [DeleteUserByPrincipalIdResponse]
-> Read DeleteUserByPrincipalIdResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteUserByPrincipalIdResponse]
$creadListPrec :: ReadPrec [DeleteUserByPrincipalIdResponse]
readPrec :: ReadPrec DeleteUserByPrincipalIdResponse
$creadPrec :: ReadPrec DeleteUserByPrincipalIdResponse
readList :: ReadS [DeleteUserByPrincipalIdResponse]
$creadList :: ReadS [DeleteUserByPrincipalIdResponse]
readsPrec :: Int -> ReadS DeleteUserByPrincipalIdResponse
$creadsPrec :: Int -> ReadS DeleteUserByPrincipalIdResponse
Prelude.Read, Int -> DeleteUserByPrincipalIdResponse -> ShowS
[DeleteUserByPrincipalIdResponse] -> ShowS
DeleteUserByPrincipalIdResponse -> String
(Int -> DeleteUserByPrincipalIdResponse -> ShowS)
-> (DeleteUserByPrincipalIdResponse -> String)
-> ([DeleteUserByPrincipalIdResponse] -> ShowS)
-> Show DeleteUserByPrincipalIdResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteUserByPrincipalIdResponse] -> ShowS
$cshowList :: [DeleteUserByPrincipalIdResponse] -> ShowS
show :: DeleteUserByPrincipalIdResponse -> String
$cshow :: DeleteUserByPrincipalIdResponse -> String
showsPrec :: Int -> DeleteUserByPrincipalIdResponse -> ShowS
$cshowsPrec :: Int -> DeleteUserByPrincipalIdResponse -> ShowS
Prelude.Show, (forall x.
DeleteUserByPrincipalIdResponse
-> Rep DeleteUserByPrincipalIdResponse x)
-> (forall x.
Rep DeleteUserByPrincipalIdResponse x
-> DeleteUserByPrincipalIdResponse)
-> Generic DeleteUserByPrincipalIdResponse
forall x.
Rep DeleteUserByPrincipalIdResponse x
-> DeleteUserByPrincipalIdResponse
forall x.
DeleteUserByPrincipalIdResponse
-> Rep DeleteUserByPrincipalIdResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteUserByPrincipalIdResponse x
-> DeleteUserByPrincipalIdResponse
$cfrom :: forall x.
DeleteUserByPrincipalIdResponse
-> Rep DeleteUserByPrincipalIdResponse x
Prelude.Generic)
newDeleteUserByPrincipalIdResponse ::
Prelude.Int ->
DeleteUserByPrincipalIdResponse
newDeleteUserByPrincipalIdResponse :: Int -> DeleteUserByPrincipalIdResponse
newDeleteUserByPrincipalIdResponse Int
pStatus_ =
DeleteUserByPrincipalIdResponse' :: Maybe Text -> Int -> DeleteUserByPrincipalIdResponse
DeleteUserByPrincipalIdResponse'
{ $sel:requestId:DeleteUserByPrincipalIdResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:DeleteUserByPrincipalIdResponse' :: Int
status = Int
pStatus_
}
deleteUserByPrincipalIdResponse_requestId :: Lens.Lens' DeleteUserByPrincipalIdResponse (Prelude.Maybe Prelude.Text)
deleteUserByPrincipalIdResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> DeleteUserByPrincipalIdResponse
-> f DeleteUserByPrincipalIdResponse
deleteUserByPrincipalIdResponse_requestId = (DeleteUserByPrincipalIdResponse -> Maybe Text)
-> (DeleteUserByPrincipalIdResponse
-> Maybe Text -> DeleteUserByPrincipalIdResponse)
-> Lens
DeleteUserByPrincipalIdResponse
DeleteUserByPrincipalIdResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUserByPrincipalIdResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:DeleteUserByPrincipalIdResponse' :: DeleteUserByPrincipalIdResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: DeleteUserByPrincipalIdResponse
s@DeleteUserByPrincipalIdResponse' {} Maybe Text
a -> DeleteUserByPrincipalIdResponse
s {$sel:requestId:DeleteUserByPrincipalIdResponse' :: Maybe Text
requestId = Maybe Text
a} :: DeleteUserByPrincipalIdResponse)
deleteUserByPrincipalIdResponse_status :: Lens.Lens' DeleteUserByPrincipalIdResponse Prelude.Int
deleteUserByPrincipalIdResponse_status :: (Int -> f Int)
-> DeleteUserByPrincipalIdResponse
-> f DeleteUserByPrincipalIdResponse
deleteUserByPrincipalIdResponse_status = (DeleteUserByPrincipalIdResponse -> Int)
-> (DeleteUserByPrincipalIdResponse
-> Int -> DeleteUserByPrincipalIdResponse)
-> Lens
DeleteUserByPrincipalIdResponse
DeleteUserByPrincipalIdResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUserByPrincipalIdResponse' {Int
status :: Int
$sel:status:DeleteUserByPrincipalIdResponse' :: DeleteUserByPrincipalIdResponse -> Int
status} -> Int
status) (\s :: DeleteUserByPrincipalIdResponse
s@DeleteUserByPrincipalIdResponse' {} Int
a -> DeleteUserByPrincipalIdResponse
s {$sel:status:DeleteUserByPrincipalIdResponse' :: Int
status = Int
a} :: DeleteUserByPrincipalIdResponse)
instance
Prelude.NFData
DeleteUserByPrincipalIdResponse