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