{-# 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.DirectoryService.DeregisterEventTopic
(
DeregisterEventTopic (..),
newDeregisterEventTopic,
deregisterEventTopic_directoryId,
deregisterEventTopic_topicName,
DeregisterEventTopicResponse (..),
newDeregisterEventTopicResponse,
deregisterEventTopicResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DirectoryService.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeregisterEventTopic = DeregisterEventTopic'
{
DeregisterEventTopic -> Text
directoryId :: Prelude.Text,
DeregisterEventTopic -> Text
topicName :: Prelude.Text
}
deriving (DeregisterEventTopic -> DeregisterEventTopic -> Bool
(DeregisterEventTopic -> DeregisterEventTopic -> Bool)
-> (DeregisterEventTopic -> DeregisterEventTopic -> Bool)
-> Eq DeregisterEventTopic
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeregisterEventTopic -> DeregisterEventTopic -> Bool
$c/= :: DeregisterEventTopic -> DeregisterEventTopic -> Bool
== :: DeregisterEventTopic -> DeregisterEventTopic -> Bool
$c== :: DeregisterEventTopic -> DeregisterEventTopic -> Bool
Prelude.Eq, ReadPrec [DeregisterEventTopic]
ReadPrec DeregisterEventTopic
Int -> ReadS DeregisterEventTopic
ReadS [DeregisterEventTopic]
(Int -> ReadS DeregisterEventTopic)
-> ReadS [DeregisterEventTopic]
-> ReadPrec DeregisterEventTopic
-> ReadPrec [DeregisterEventTopic]
-> Read DeregisterEventTopic
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeregisterEventTopic]
$creadListPrec :: ReadPrec [DeregisterEventTopic]
readPrec :: ReadPrec DeregisterEventTopic
$creadPrec :: ReadPrec DeregisterEventTopic
readList :: ReadS [DeregisterEventTopic]
$creadList :: ReadS [DeregisterEventTopic]
readsPrec :: Int -> ReadS DeregisterEventTopic
$creadsPrec :: Int -> ReadS DeregisterEventTopic
Prelude.Read, Int -> DeregisterEventTopic -> ShowS
[DeregisterEventTopic] -> ShowS
DeregisterEventTopic -> String
(Int -> DeregisterEventTopic -> ShowS)
-> (DeregisterEventTopic -> String)
-> ([DeregisterEventTopic] -> ShowS)
-> Show DeregisterEventTopic
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeregisterEventTopic] -> ShowS
$cshowList :: [DeregisterEventTopic] -> ShowS
show :: DeregisterEventTopic -> String
$cshow :: DeregisterEventTopic -> String
showsPrec :: Int -> DeregisterEventTopic -> ShowS
$cshowsPrec :: Int -> DeregisterEventTopic -> ShowS
Prelude.Show, (forall x. DeregisterEventTopic -> Rep DeregisterEventTopic x)
-> (forall x. Rep DeregisterEventTopic x -> DeregisterEventTopic)
-> Generic DeregisterEventTopic
forall x. Rep DeregisterEventTopic x -> DeregisterEventTopic
forall x. DeregisterEventTopic -> Rep DeregisterEventTopic x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeregisterEventTopic x -> DeregisterEventTopic
$cfrom :: forall x. DeregisterEventTopic -> Rep DeregisterEventTopic x
Prelude.Generic)
newDeregisterEventTopic ::
Prelude.Text ->
Prelude.Text ->
DeregisterEventTopic
newDeregisterEventTopic :: Text -> Text -> DeregisterEventTopic
newDeregisterEventTopic Text
pDirectoryId_ Text
pTopicName_ =
DeregisterEventTopic' :: Text -> Text -> DeregisterEventTopic
DeregisterEventTopic'
{ $sel:directoryId:DeregisterEventTopic' :: Text
directoryId = Text
pDirectoryId_,
$sel:topicName:DeregisterEventTopic' :: Text
topicName = Text
pTopicName_
}
deregisterEventTopic_directoryId :: Lens.Lens' DeregisterEventTopic Prelude.Text
deregisterEventTopic_directoryId :: (Text -> f Text) -> DeregisterEventTopic -> f DeregisterEventTopic
deregisterEventTopic_directoryId = (DeregisterEventTopic -> Text)
-> (DeregisterEventTopic -> Text -> DeregisterEventTopic)
-> Lens DeregisterEventTopic DeregisterEventTopic Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterEventTopic' {Text
directoryId :: Text
$sel:directoryId:DeregisterEventTopic' :: DeregisterEventTopic -> Text
directoryId} -> Text
directoryId) (\s :: DeregisterEventTopic
s@DeregisterEventTopic' {} Text
a -> DeregisterEventTopic
s {$sel:directoryId:DeregisterEventTopic' :: Text
directoryId = Text
a} :: DeregisterEventTopic)
deregisterEventTopic_topicName :: Lens.Lens' DeregisterEventTopic Prelude.Text
deregisterEventTopic_topicName :: (Text -> f Text) -> DeregisterEventTopic -> f DeregisterEventTopic
deregisterEventTopic_topicName = (DeregisterEventTopic -> Text)
-> (DeregisterEventTopic -> Text -> DeregisterEventTopic)
-> Lens DeregisterEventTopic DeregisterEventTopic Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterEventTopic' {Text
topicName :: Text
$sel:topicName:DeregisterEventTopic' :: DeregisterEventTopic -> Text
topicName} -> Text
topicName) (\s :: DeregisterEventTopic
s@DeregisterEventTopic' {} Text
a -> DeregisterEventTopic
s {$sel:topicName:DeregisterEventTopic' :: Text
topicName = Text
a} :: DeregisterEventTopic)
instance Core.AWSRequest DeregisterEventTopic where
type
AWSResponse DeregisterEventTopic =
DeregisterEventTopicResponse
request :: DeregisterEventTopic -> Request DeregisterEventTopic
request = Service -> DeregisterEventTopic -> Request DeregisterEventTopic
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeregisterEventTopic
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeregisterEventTopic)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeregisterEventTopic))
-> Logger
-> Service
-> Proxy DeregisterEventTopic
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeregisterEventTopic)))
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 -> DeregisterEventTopicResponse
DeregisterEventTopicResponse'
(Int -> DeregisterEventTopicResponse)
-> Either String Int -> Either String DeregisterEventTopicResponse
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 DeregisterEventTopic
instance Prelude.NFData DeregisterEventTopic
instance Core.ToHeaders DeregisterEventTopic where
toHeaders :: DeregisterEventTopic -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeregisterEventTopic -> 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
"DirectoryService_20150416.DeregisterEventTopic" ::
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 DeregisterEventTopic where
toJSON :: DeregisterEventTopic -> Value
toJSON DeregisterEventTopic' {Text
topicName :: Text
directoryId :: Text
$sel:topicName:DeregisterEventTopic' :: DeregisterEventTopic -> Text
$sel:directoryId:DeregisterEventTopic' :: DeregisterEventTopic -> 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
"DirectoryId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
directoryId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TopicName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
topicName)
]
)
instance Core.ToPath DeregisterEventTopic where
toPath :: DeregisterEventTopic -> ByteString
toPath = ByteString -> DeregisterEventTopic -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeregisterEventTopic where
toQuery :: DeregisterEventTopic -> QueryString
toQuery = QueryString -> DeregisterEventTopic -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeregisterEventTopicResponse = DeregisterEventTopicResponse'
{
DeregisterEventTopicResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeregisterEventTopicResponse
-> DeregisterEventTopicResponse -> Bool
(DeregisterEventTopicResponse
-> DeregisterEventTopicResponse -> Bool)
-> (DeregisterEventTopicResponse
-> DeregisterEventTopicResponse -> Bool)
-> Eq DeregisterEventTopicResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeregisterEventTopicResponse
-> DeregisterEventTopicResponse -> Bool
$c/= :: DeregisterEventTopicResponse
-> DeregisterEventTopicResponse -> Bool
== :: DeregisterEventTopicResponse
-> DeregisterEventTopicResponse -> Bool
$c== :: DeregisterEventTopicResponse
-> DeregisterEventTopicResponse -> Bool
Prelude.Eq, ReadPrec [DeregisterEventTopicResponse]
ReadPrec DeregisterEventTopicResponse
Int -> ReadS DeregisterEventTopicResponse
ReadS [DeregisterEventTopicResponse]
(Int -> ReadS DeregisterEventTopicResponse)
-> ReadS [DeregisterEventTopicResponse]
-> ReadPrec DeregisterEventTopicResponse
-> ReadPrec [DeregisterEventTopicResponse]
-> Read DeregisterEventTopicResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeregisterEventTopicResponse]
$creadListPrec :: ReadPrec [DeregisterEventTopicResponse]
readPrec :: ReadPrec DeregisterEventTopicResponse
$creadPrec :: ReadPrec DeregisterEventTopicResponse
readList :: ReadS [DeregisterEventTopicResponse]
$creadList :: ReadS [DeregisterEventTopicResponse]
readsPrec :: Int -> ReadS DeregisterEventTopicResponse
$creadsPrec :: Int -> ReadS DeregisterEventTopicResponse
Prelude.Read, Int -> DeregisterEventTopicResponse -> ShowS
[DeregisterEventTopicResponse] -> ShowS
DeregisterEventTopicResponse -> String
(Int -> DeregisterEventTopicResponse -> ShowS)
-> (DeregisterEventTopicResponse -> String)
-> ([DeregisterEventTopicResponse] -> ShowS)
-> Show DeregisterEventTopicResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeregisterEventTopicResponse] -> ShowS
$cshowList :: [DeregisterEventTopicResponse] -> ShowS
show :: DeregisterEventTopicResponse -> String
$cshow :: DeregisterEventTopicResponse -> String
showsPrec :: Int -> DeregisterEventTopicResponse -> ShowS
$cshowsPrec :: Int -> DeregisterEventTopicResponse -> ShowS
Prelude.Show, (forall x.
DeregisterEventTopicResponse -> Rep DeregisterEventTopicResponse x)
-> (forall x.
Rep DeregisterEventTopicResponse x -> DeregisterEventTopicResponse)
-> Generic DeregisterEventTopicResponse
forall x.
Rep DeregisterEventTopicResponse x -> DeregisterEventTopicResponse
forall x.
DeregisterEventTopicResponse -> Rep DeregisterEventTopicResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeregisterEventTopicResponse x -> DeregisterEventTopicResponse
$cfrom :: forall x.
DeregisterEventTopicResponse -> Rep DeregisterEventTopicResponse x
Prelude.Generic)
newDeregisterEventTopicResponse ::
Prelude.Int ->
DeregisterEventTopicResponse
newDeregisterEventTopicResponse :: Int -> DeregisterEventTopicResponse
newDeregisterEventTopicResponse Int
pHttpStatus_ =
DeregisterEventTopicResponse' :: Int -> DeregisterEventTopicResponse
DeregisterEventTopicResponse'
{ $sel:httpStatus:DeregisterEventTopicResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deregisterEventTopicResponse_httpStatus :: Lens.Lens' DeregisterEventTopicResponse Prelude.Int
deregisterEventTopicResponse_httpStatus :: (Int -> f Int)
-> DeregisterEventTopicResponse -> f DeregisterEventTopicResponse
deregisterEventTopicResponse_httpStatus = (DeregisterEventTopicResponse -> Int)
-> (DeregisterEventTopicResponse
-> Int -> DeregisterEventTopicResponse)
-> Lens
DeregisterEventTopicResponse DeregisterEventTopicResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterEventTopicResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeregisterEventTopicResponse' :: DeregisterEventTopicResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeregisterEventTopicResponse
s@DeregisterEventTopicResponse' {} Int
a -> DeregisterEventTopicResponse
s {$sel:httpStatus:DeregisterEventTopicResponse' :: Int
httpStatus = Int
a} :: DeregisterEventTopicResponse)
instance Prelude.NFData DeregisterEventTopicResponse