{-# 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.WorkMail.DisassociateDelegateFromResource
(
DisassociateDelegateFromResource (..),
newDisassociateDelegateFromResource,
disassociateDelegateFromResource_organizationId,
disassociateDelegateFromResource_resourceId,
disassociateDelegateFromResource_entityId,
DisassociateDelegateFromResourceResponse (..),
newDisassociateDelegateFromResourceResponse,
disassociateDelegateFromResourceResponse_httpStatus,
)
where
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
import Amazonka.WorkMail.Types
data DisassociateDelegateFromResource = DisassociateDelegateFromResource'
{
DisassociateDelegateFromResource -> Text
organizationId :: Prelude.Text,
DisassociateDelegateFromResource -> Text
resourceId :: Prelude.Text,
DisassociateDelegateFromResource -> Text
entityId :: Prelude.Text
}
deriving (DisassociateDelegateFromResource
-> DisassociateDelegateFromResource -> Bool
(DisassociateDelegateFromResource
-> DisassociateDelegateFromResource -> Bool)
-> (DisassociateDelegateFromResource
-> DisassociateDelegateFromResource -> Bool)
-> Eq DisassociateDelegateFromResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateDelegateFromResource
-> DisassociateDelegateFromResource -> Bool
$c/= :: DisassociateDelegateFromResource
-> DisassociateDelegateFromResource -> Bool
== :: DisassociateDelegateFromResource
-> DisassociateDelegateFromResource -> Bool
$c== :: DisassociateDelegateFromResource
-> DisassociateDelegateFromResource -> Bool
Prelude.Eq, ReadPrec [DisassociateDelegateFromResource]
ReadPrec DisassociateDelegateFromResource
Int -> ReadS DisassociateDelegateFromResource
ReadS [DisassociateDelegateFromResource]
(Int -> ReadS DisassociateDelegateFromResource)
-> ReadS [DisassociateDelegateFromResource]
-> ReadPrec DisassociateDelegateFromResource
-> ReadPrec [DisassociateDelegateFromResource]
-> Read DisassociateDelegateFromResource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateDelegateFromResource]
$creadListPrec :: ReadPrec [DisassociateDelegateFromResource]
readPrec :: ReadPrec DisassociateDelegateFromResource
$creadPrec :: ReadPrec DisassociateDelegateFromResource
readList :: ReadS [DisassociateDelegateFromResource]
$creadList :: ReadS [DisassociateDelegateFromResource]
readsPrec :: Int -> ReadS DisassociateDelegateFromResource
$creadsPrec :: Int -> ReadS DisassociateDelegateFromResource
Prelude.Read, Int -> DisassociateDelegateFromResource -> ShowS
[DisassociateDelegateFromResource] -> ShowS
DisassociateDelegateFromResource -> String
(Int -> DisassociateDelegateFromResource -> ShowS)
-> (DisassociateDelegateFromResource -> String)
-> ([DisassociateDelegateFromResource] -> ShowS)
-> Show DisassociateDelegateFromResource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateDelegateFromResource] -> ShowS
$cshowList :: [DisassociateDelegateFromResource] -> ShowS
show :: DisassociateDelegateFromResource -> String
$cshow :: DisassociateDelegateFromResource -> String
showsPrec :: Int -> DisassociateDelegateFromResource -> ShowS
$cshowsPrec :: Int -> DisassociateDelegateFromResource -> ShowS
Prelude.Show, (forall x.
DisassociateDelegateFromResource
-> Rep DisassociateDelegateFromResource x)
-> (forall x.
Rep DisassociateDelegateFromResource x
-> DisassociateDelegateFromResource)
-> Generic DisassociateDelegateFromResource
forall x.
Rep DisassociateDelegateFromResource x
-> DisassociateDelegateFromResource
forall x.
DisassociateDelegateFromResource
-> Rep DisassociateDelegateFromResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateDelegateFromResource x
-> DisassociateDelegateFromResource
$cfrom :: forall x.
DisassociateDelegateFromResource
-> Rep DisassociateDelegateFromResource x
Prelude.Generic)
newDisassociateDelegateFromResource ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DisassociateDelegateFromResource
newDisassociateDelegateFromResource :: Text -> Text -> Text -> DisassociateDelegateFromResource
newDisassociateDelegateFromResource
Text
pOrganizationId_
Text
pResourceId_
Text
pEntityId_ =
DisassociateDelegateFromResource' :: Text -> Text -> Text -> DisassociateDelegateFromResource
DisassociateDelegateFromResource'
{ $sel:organizationId:DisassociateDelegateFromResource' :: Text
organizationId =
Text
pOrganizationId_,
$sel:resourceId:DisassociateDelegateFromResource' :: Text
resourceId = Text
pResourceId_,
$sel:entityId:DisassociateDelegateFromResource' :: Text
entityId = Text
pEntityId_
}
disassociateDelegateFromResource_organizationId :: Lens.Lens' DisassociateDelegateFromResource Prelude.Text
disassociateDelegateFromResource_organizationId :: (Text -> f Text)
-> DisassociateDelegateFromResource
-> f DisassociateDelegateFromResource
disassociateDelegateFromResource_organizationId = (DisassociateDelegateFromResource -> Text)
-> (DisassociateDelegateFromResource
-> Text -> DisassociateDelegateFromResource)
-> Lens
DisassociateDelegateFromResource
DisassociateDelegateFromResource
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateDelegateFromResource' {Text
organizationId :: Text
$sel:organizationId:DisassociateDelegateFromResource' :: DisassociateDelegateFromResource -> Text
organizationId} -> Text
organizationId) (\s :: DisassociateDelegateFromResource
s@DisassociateDelegateFromResource' {} Text
a -> DisassociateDelegateFromResource
s {$sel:organizationId:DisassociateDelegateFromResource' :: Text
organizationId = Text
a} :: DisassociateDelegateFromResource)
disassociateDelegateFromResource_resourceId :: Lens.Lens' DisassociateDelegateFromResource Prelude.Text
disassociateDelegateFromResource_resourceId :: (Text -> f Text)
-> DisassociateDelegateFromResource
-> f DisassociateDelegateFromResource
disassociateDelegateFromResource_resourceId = (DisassociateDelegateFromResource -> Text)
-> (DisassociateDelegateFromResource
-> Text -> DisassociateDelegateFromResource)
-> Lens
DisassociateDelegateFromResource
DisassociateDelegateFromResource
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateDelegateFromResource' {Text
resourceId :: Text
$sel:resourceId:DisassociateDelegateFromResource' :: DisassociateDelegateFromResource -> Text
resourceId} -> Text
resourceId) (\s :: DisassociateDelegateFromResource
s@DisassociateDelegateFromResource' {} Text
a -> DisassociateDelegateFromResource
s {$sel:resourceId:DisassociateDelegateFromResource' :: Text
resourceId = Text
a} :: DisassociateDelegateFromResource)
disassociateDelegateFromResource_entityId :: Lens.Lens' DisassociateDelegateFromResource Prelude.Text
disassociateDelegateFromResource_entityId :: (Text -> f Text)
-> DisassociateDelegateFromResource
-> f DisassociateDelegateFromResource
disassociateDelegateFromResource_entityId = (DisassociateDelegateFromResource -> Text)
-> (DisassociateDelegateFromResource
-> Text -> DisassociateDelegateFromResource)
-> Lens
DisassociateDelegateFromResource
DisassociateDelegateFromResource
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateDelegateFromResource' {Text
entityId :: Text
$sel:entityId:DisassociateDelegateFromResource' :: DisassociateDelegateFromResource -> Text
entityId} -> Text
entityId) (\s :: DisassociateDelegateFromResource
s@DisassociateDelegateFromResource' {} Text
a -> DisassociateDelegateFromResource
s {$sel:entityId:DisassociateDelegateFromResource' :: Text
entityId = Text
a} :: DisassociateDelegateFromResource)
instance
Core.AWSRequest
DisassociateDelegateFromResource
where
type
AWSResponse DisassociateDelegateFromResource =
DisassociateDelegateFromResourceResponse
request :: DisassociateDelegateFromResource
-> Request DisassociateDelegateFromResource
request = Service
-> DisassociateDelegateFromResource
-> Request DisassociateDelegateFromResource
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DisassociateDelegateFromResource
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DisassociateDelegateFromResource)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DisassociateDelegateFromResource))
-> Logger
-> Service
-> Proxy DisassociateDelegateFromResource
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DisassociateDelegateFromResource)))
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 -> DisassociateDelegateFromResourceResponse
DisassociateDelegateFromResourceResponse'
(Int -> DisassociateDelegateFromResourceResponse)
-> Either String Int
-> Either String DisassociateDelegateFromResourceResponse
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
DisassociateDelegateFromResource
instance
Prelude.NFData
DisassociateDelegateFromResource
instance
Core.ToHeaders
DisassociateDelegateFromResource
where
toHeaders :: DisassociateDelegateFromResource -> ResponseHeaders
toHeaders =
ResponseHeaders
-> DisassociateDelegateFromResource -> 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
"WorkMailService.DisassociateDelegateFromResource" ::
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 DisassociateDelegateFromResource where
toJSON :: DisassociateDelegateFromResource -> Value
toJSON DisassociateDelegateFromResource' {Text
entityId :: Text
resourceId :: Text
organizationId :: Text
$sel:entityId:DisassociateDelegateFromResource' :: DisassociateDelegateFromResource -> Text
$sel:resourceId:DisassociateDelegateFromResource' :: DisassociateDelegateFromResource -> Text
$sel:organizationId:DisassociateDelegateFromResource' :: DisassociateDelegateFromResource -> 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
"OrganizationId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
organizationId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"EntityId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
entityId)
]
)
instance Core.ToPath DisassociateDelegateFromResource where
toPath :: DisassociateDelegateFromResource -> ByteString
toPath = ByteString -> DisassociateDelegateFromResource -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Core.ToQuery
DisassociateDelegateFromResource
where
toQuery :: DisassociateDelegateFromResource -> QueryString
toQuery = QueryString -> DisassociateDelegateFromResource -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DisassociateDelegateFromResourceResponse = DisassociateDelegateFromResourceResponse'
{
DisassociateDelegateFromResourceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DisassociateDelegateFromResourceResponse
-> DisassociateDelegateFromResourceResponse -> Bool
(DisassociateDelegateFromResourceResponse
-> DisassociateDelegateFromResourceResponse -> Bool)
-> (DisassociateDelegateFromResourceResponse
-> DisassociateDelegateFromResourceResponse -> Bool)
-> Eq DisassociateDelegateFromResourceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateDelegateFromResourceResponse
-> DisassociateDelegateFromResourceResponse -> Bool
$c/= :: DisassociateDelegateFromResourceResponse
-> DisassociateDelegateFromResourceResponse -> Bool
== :: DisassociateDelegateFromResourceResponse
-> DisassociateDelegateFromResourceResponse -> Bool
$c== :: DisassociateDelegateFromResourceResponse
-> DisassociateDelegateFromResourceResponse -> Bool
Prelude.Eq, ReadPrec [DisassociateDelegateFromResourceResponse]
ReadPrec DisassociateDelegateFromResourceResponse
Int -> ReadS DisassociateDelegateFromResourceResponse
ReadS [DisassociateDelegateFromResourceResponse]
(Int -> ReadS DisassociateDelegateFromResourceResponse)
-> ReadS [DisassociateDelegateFromResourceResponse]
-> ReadPrec DisassociateDelegateFromResourceResponse
-> ReadPrec [DisassociateDelegateFromResourceResponse]
-> Read DisassociateDelegateFromResourceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateDelegateFromResourceResponse]
$creadListPrec :: ReadPrec [DisassociateDelegateFromResourceResponse]
readPrec :: ReadPrec DisassociateDelegateFromResourceResponse
$creadPrec :: ReadPrec DisassociateDelegateFromResourceResponse
readList :: ReadS [DisassociateDelegateFromResourceResponse]
$creadList :: ReadS [DisassociateDelegateFromResourceResponse]
readsPrec :: Int -> ReadS DisassociateDelegateFromResourceResponse
$creadsPrec :: Int -> ReadS DisassociateDelegateFromResourceResponse
Prelude.Read, Int -> DisassociateDelegateFromResourceResponse -> ShowS
[DisassociateDelegateFromResourceResponse] -> ShowS
DisassociateDelegateFromResourceResponse -> String
(Int -> DisassociateDelegateFromResourceResponse -> ShowS)
-> (DisassociateDelegateFromResourceResponse -> String)
-> ([DisassociateDelegateFromResourceResponse] -> ShowS)
-> Show DisassociateDelegateFromResourceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateDelegateFromResourceResponse] -> ShowS
$cshowList :: [DisassociateDelegateFromResourceResponse] -> ShowS
show :: DisassociateDelegateFromResourceResponse -> String
$cshow :: DisassociateDelegateFromResourceResponse -> String
showsPrec :: Int -> DisassociateDelegateFromResourceResponse -> ShowS
$cshowsPrec :: Int -> DisassociateDelegateFromResourceResponse -> ShowS
Prelude.Show, (forall x.
DisassociateDelegateFromResourceResponse
-> Rep DisassociateDelegateFromResourceResponse x)
-> (forall x.
Rep DisassociateDelegateFromResourceResponse x
-> DisassociateDelegateFromResourceResponse)
-> Generic DisassociateDelegateFromResourceResponse
forall x.
Rep DisassociateDelegateFromResourceResponse x
-> DisassociateDelegateFromResourceResponse
forall x.
DisassociateDelegateFromResourceResponse
-> Rep DisassociateDelegateFromResourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateDelegateFromResourceResponse x
-> DisassociateDelegateFromResourceResponse
$cfrom :: forall x.
DisassociateDelegateFromResourceResponse
-> Rep DisassociateDelegateFromResourceResponse x
Prelude.Generic)
newDisassociateDelegateFromResourceResponse ::
Prelude.Int ->
DisassociateDelegateFromResourceResponse
newDisassociateDelegateFromResourceResponse :: Int -> DisassociateDelegateFromResourceResponse
newDisassociateDelegateFromResourceResponse
Int
pHttpStatus_ =
DisassociateDelegateFromResourceResponse' :: Int -> DisassociateDelegateFromResourceResponse
DisassociateDelegateFromResourceResponse'
{ $sel:httpStatus:DisassociateDelegateFromResourceResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
disassociateDelegateFromResourceResponse_httpStatus :: Lens.Lens' DisassociateDelegateFromResourceResponse Prelude.Int
disassociateDelegateFromResourceResponse_httpStatus :: (Int -> f Int)
-> DisassociateDelegateFromResourceResponse
-> f DisassociateDelegateFromResourceResponse
disassociateDelegateFromResourceResponse_httpStatus = (DisassociateDelegateFromResourceResponse -> Int)
-> (DisassociateDelegateFromResourceResponse
-> Int -> DisassociateDelegateFromResourceResponse)
-> Lens
DisassociateDelegateFromResourceResponse
DisassociateDelegateFromResourceResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateDelegateFromResourceResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateDelegateFromResourceResponse' :: DisassociateDelegateFromResourceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisassociateDelegateFromResourceResponse
s@DisassociateDelegateFromResourceResponse' {} Int
a -> DisassociateDelegateFromResourceResponse
s {$sel:httpStatus:DisassociateDelegateFromResourceResponse' :: Int
httpStatus = Int
a} :: DisassociateDelegateFromResourceResponse)
instance
Prelude.NFData
DisassociateDelegateFromResourceResponse