{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
{ $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 :: Lens' DisassociateDelegateFromResource Text
disassociateDelegateFromResource_organizationId = 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 :: Lens' DisassociateDelegateFromResource Text
disassociateDelegateFromResource_resourceId = 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 :: Lens' DisassociateDelegateFromResource Text
disassociateDelegateFromResource_entityId = 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 :: (Service -> Service)
-> DisassociateDelegateFromResource
-> Request DisassociateDelegateFromResource
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DisassociateDelegateFromResource
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DisassociateDelegateFromResource)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DisassociateDelegateFromResourceResponse
DisassociateDelegateFromResourceResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
DisassociateDelegateFromResource
where
hashWithSalt :: Int -> DisassociateDelegateFromResource -> Int
hashWithSalt
Int
_salt
DisassociateDelegateFromResource' {Text
entityId :: Text
resourceId :: Text
organizationId :: Text
$sel:entityId:DisassociateDelegateFromResource' :: DisassociateDelegateFromResource -> Text
$sel:resourceId:DisassociateDelegateFromResource' :: DisassociateDelegateFromResource -> Text
$sel:organizationId:DisassociateDelegateFromResource' :: DisassociateDelegateFromResource -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
organizationId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
entityId
instance
Prelude.NFData
DisassociateDelegateFromResource
where
rnf :: DisassociateDelegateFromResource -> ()
rnf DisassociateDelegateFromResource' {Text
entityId :: Text
resourceId :: Text
organizationId :: Text
$sel:entityId:DisassociateDelegateFromResource' :: DisassociateDelegateFromResource -> Text
$sel:resourceId:DisassociateDelegateFromResource' :: DisassociateDelegateFromResource -> Text
$sel:organizationId:DisassociateDelegateFromResource' :: DisassociateDelegateFromResource -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
organizationId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
entityId
instance
Data.ToHeaders
DisassociateDelegateFromResource
where
toHeaders :: DisassociateDelegateFromResource -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"WorkMailService.DisassociateDelegateFromResource" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"OrganizationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
organizationId),
forall a. a -> Maybe a
Prelude.Just (Key
"ResourceId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
resourceId),
forall a. a -> Maybe a
Prelude.Just (Key
"EntityId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
entityId)
]
)
instance Data.ToPath DisassociateDelegateFromResource where
toPath :: DisassociateDelegateFromResource -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Data.ToQuery
DisassociateDelegateFromResource
where
toQuery :: DisassociateDelegateFromResource -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DisassociateDelegateFromResourceResponse = DisassociateDelegateFromResourceResponse'
{
DisassociateDelegateFromResourceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DisassociateDelegateFromResourceResponse
-> DisassociateDelegateFromResourceResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:DisassociateDelegateFromResourceResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
disassociateDelegateFromResourceResponse_httpStatus :: Lens.Lens' DisassociateDelegateFromResourceResponse Prelude.Int
disassociateDelegateFromResourceResponse_httpStatus :: Lens' DisassociateDelegateFromResourceResponse Int
disassociateDelegateFromResourceResponse_httpStatus = 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
where
rnf :: DisassociateDelegateFromResourceResponse -> ()
rnf DisassociateDelegateFromResourceResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateDelegateFromResourceResponse' :: DisassociateDelegateFromResourceResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus