{-# 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.DMS.DeleteEventSubscription
(
DeleteEventSubscription (..),
newDeleteEventSubscription,
deleteEventSubscription_subscriptionName,
DeleteEventSubscriptionResponse (..),
newDeleteEventSubscriptionResponse,
deleteEventSubscriptionResponse_eventSubscription,
deleteEventSubscriptionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DMS.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 DeleteEventSubscription = DeleteEventSubscription'
{
DeleteEventSubscription -> Text
subscriptionName :: Prelude.Text
}
deriving (DeleteEventSubscription -> DeleteEventSubscription -> Bool
(DeleteEventSubscription -> DeleteEventSubscription -> Bool)
-> (DeleteEventSubscription -> DeleteEventSubscription -> Bool)
-> Eq DeleteEventSubscription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteEventSubscription -> DeleteEventSubscription -> Bool
$c/= :: DeleteEventSubscription -> DeleteEventSubscription -> Bool
== :: DeleteEventSubscription -> DeleteEventSubscription -> Bool
$c== :: DeleteEventSubscription -> DeleteEventSubscription -> Bool
Prelude.Eq, ReadPrec [DeleteEventSubscription]
ReadPrec DeleteEventSubscription
Int -> ReadS DeleteEventSubscription
ReadS [DeleteEventSubscription]
(Int -> ReadS DeleteEventSubscription)
-> ReadS [DeleteEventSubscription]
-> ReadPrec DeleteEventSubscription
-> ReadPrec [DeleteEventSubscription]
-> Read DeleteEventSubscription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteEventSubscription]
$creadListPrec :: ReadPrec [DeleteEventSubscription]
readPrec :: ReadPrec DeleteEventSubscription
$creadPrec :: ReadPrec DeleteEventSubscription
readList :: ReadS [DeleteEventSubscription]
$creadList :: ReadS [DeleteEventSubscription]
readsPrec :: Int -> ReadS DeleteEventSubscription
$creadsPrec :: Int -> ReadS DeleteEventSubscription
Prelude.Read, Int -> DeleteEventSubscription -> ShowS
[DeleteEventSubscription] -> ShowS
DeleteEventSubscription -> String
(Int -> DeleteEventSubscription -> ShowS)
-> (DeleteEventSubscription -> String)
-> ([DeleteEventSubscription] -> ShowS)
-> Show DeleteEventSubscription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteEventSubscription] -> ShowS
$cshowList :: [DeleteEventSubscription] -> ShowS
show :: DeleteEventSubscription -> String
$cshow :: DeleteEventSubscription -> String
showsPrec :: Int -> DeleteEventSubscription -> ShowS
$cshowsPrec :: Int -> DeleteEventSubscription -> ShowS
Prelude.Show, (forall x.
DeleteEventSubscription -> Rep DeleteEventSubscription x)
-> (forall x.
Rep DeleteEventSubscription x -> DeleteEventSubscription)
-> Generic DeleteEventSubscription
forall x. Rep DeleteEventSubscription x -> DeleteEventSubscription
forall x. DeleteEventSubscription -> Rep DeleteEventSubscription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteEventSubscription x -> DeleteEventSubscription
$cfrom :: forall x. DeleteEventSubscription -> Rep DeleteEventSubscription x
Prelude.Generic)
newDeleteEventSubscription ::
Prelude.Text ->
DeleteEventSubscription
newDeleteEventSubscription :: Text -> DeleteEventSubscription
newDeleteEventSubscription Text
pSubscriptionName_ =
DeleteEventSubscription' :: Text -> DeleteEventSubscription
DeleteEventSubscription'
{ $sel:subscriptionName:DeleteEventSubscription' :: Text
subscriptionName =
Text
pSubscriptionName_
}
deleteEventSubscription_subscriptionName :: Lens.Lens' DeleteEventSubscription Prelude.Text
deleteEventSubscription_subscriptionName :: (Text -> f Text)
-> DeleteEventSubscription -> f DeleteEventSubscription
deleteEventSubscription_subscriptionName = (DeleteEventSubscription -> Text)
-> (DeleteEventSubscription -> Text -> DeleteEventSubscription)
-> Lens DeleteEventSubscription DeleteEventSubscription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteEventSubscription' {Text
subscriptionName :: Text
$sel:subscriptionName:DeleteEventSubscription' :: DeleteEventSubscription -> Text
subscriptionName} -> Text
subscriptionName) (\s :: DeleteEventSubscription
s@DeleteEventSubscription' {} Text
a -> DeleteEventSubscription
s {$sel:subscriptionName:DeleteEventSubscription' :: Text
subscriptionName = Text
a} :: DeleteEventSubscription)
instance Core.AWSRequest DeleteEventSubscription where
type
AWSResponse DeleteEventSubscription =
DeleteEventSubscriptionResponse
request :: DeleteEventSubscription -> Request DeleteEventSubscription
request = Service
-> DeleteEventSubscription -> Request DeleteEventSubscription
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteEventSubscription
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteEventSubscription)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteEventSubscription))
-> Logger
-> Service
-> Proxy DeleteEventSubscription
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteEventSubscription)))
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 EventSubscription -> Int -> DeleteEventSubscriptionResponse
DeleteEventSubscriptionResponse'
(Maybe EventSubscription -> Int -> DeleteEventSubscriptionResponse)
-> Either String (Maybe EventSubscription)
-> Either String (Int -> DeleteEventSubscriptionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe EventSubscription)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EventSubscription")
Either String (Int -> DeleteEventSubscriptionResponse)
-> Either String Int
-> Either String DeleteEventSubscriptionResponse
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 DeleteEventSubscription
instance Prelude.NFData DeleteEventSubscription
instance Core.ToHeaders DeleteEventSubscription where
toHeaders :: DeleteEventSubscription -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteEventSubscription -> 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
"AmazonDMSv20160101.DeleteEventSubscription" ::
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 DeleteEventSubscription where
toJSON :: DeleteEventSubscription -> Value
toJSON DeleteEventSubscription' {Text
subscriptionName :: Text
$sel:subscriptionName:DeleteEventSubscription' :: DeleteEventSubscription -> 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
"SubscriptionName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
subscriptionName)
]
)
instance Core.ToPath DeleteEventSubscription where
toPath :: DeleteEventSubscription -> ByteString
toPath = ByteString -> DeleteEventSubscription -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteEventSubscription where
toQuery :: DeleteEventSubscription -> QueryString
toQuery = QueryString -> DeleteEventSubscription -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteEventSubscriptionResponse = DeleteEventSubscriptionResponse'
{
DeleteEventSubscriptionResponse -> Maybe EventSubscription
eventSubscription :: Prelude.Maybe EventSubscription,
DeleteEventSubscriptionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteEventSubscriptionResponse
-> DeleteEventSubscriptionResponse -> Bool
(DeleteEventSubscriptionResponse
-> DeleteEventSubscriptionResponse -> Bool)
-> (DeleteEventSubscriptionResponse
-> DeleteEventSubscriptionResponse -> Bool)
-> Eq DeleteEventSubscriptionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteEventSubscriptionResponse
-> DeleteEventSubscriptionResponse -> Bool
$c/= :: DeleteEventSubscriptionResponse
-> DeleteEventSubscriptionResponse -> Bool
== :: DeleteEventSubscriptionResponse
-> DeleteEventSubscriptionResponse -> Bool
$c== :: DeleteEventSubscriptionResponse
-> DeleteEventSubscriptionResponse -> Bool
Prelude.Eq, ReadPrec [DeleteEventSubscriptionResponse]
ReadPrec DeleteEventSubscriptionResponse
Int -> ReadS DeleteEventSubscriptionResponse
ReadS [DeleteEventSubscriptionResponse]
(Int -> ReadS DeleteEventSubscriptionResponse)
-> ReadS [DeleteEventSubscriptionResponse]
-> ReadPrec DeleteEventSubscriptionResponse
-> ReadPrec [DeleteEventSubscriptionResponse]
-> Read DeleteEventSubscriptionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteEventSubscriptionResponse]
$creadListPrec :: ReadPrec [DeleteEventSubscriptionResponse]
readPrec :: ReadPrec DeleteEventSubscriptionResponse
$creadPrec :: ReadPrec DeleteEventSubscriptionResponse
readList :: ReadS [DeleteEventSubscriptionResponse]
$creadList :: ReadS [DeleteEventSubscriptionResponse]
readsPrec :: Int -> ReadS DeleteEventSubscriptionResponse
$creadsPrec :: Int -> ReadS DeleteEventSubscriptionResponse
Prelude.Read, Int -> DeleteEventSubscriptionResponse -> ShowS
[DeleteEventSubscriptionResponse] -> ShowS
DeleteEventSubscriptionResponse -> String
(Int -> DeleteEventSubscriptionResponse -> ShowS)
-> (DeleteEventSubscriptionResponse -> String)
-> ([DeleteEventSubscriptionResponse] -> ShowS)
-> Show DeleteEventSubscriptionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteEventSubscriptionResponse] -> ShowS
$cshowList :: [DeleteEventSubscriptionResponse] -> ShowS
show :: DeleteEventSubscriptionResponse -> String
$cshow :: DeleteEventSubscriptionResponse -> String
showsPrec :: Int -> DeleteEventSubscriptionResponse -> ShowS
$cshowsPrec :: Int -> DeleteEventSubscriptionResponse -> ShowS
Prelude.Show, (forall x.
DeleteEventSubscriptionResponse
-> Rep DeleteEventSubscriptionResponse x)
-> (forall x.
Rep DeleteEventSubscriptionResponse x
-> DeleteEventSubscriptionResponse)
-> Generic DeleteEventSubscriptionResponse
forall x.
Rep DeleteEventSubscriptionResponse x
-> DeleteEventSubscriptionResponse
forall x.
DeleteEventSubscriptionResponse
-> Rep DeleteEventSubscriptionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteEventSubscriptionResponse x
-> DeleteEventSubscriptionResponse
$cfrom :: forall x.
DeleteEventSubscriptionResponse
-> Rep DeleteEventSubscriptionResponse x
Prelude.Generic)
newDeleteEventSubscriptionResponse ::
Prelude.Int ->
DeleteEventSubscriptionResponse
newDeleteEventSubscriptionResponse :: Int -> DeleteEventSubscriptionResponse
newDeleteEventSubscriptionResponse Int
pHttpStatus_ =
DeleteEventSubscriptionResponse' :: Maybe EventSubscription -> Int -> DeleteEventSubscriptionResponse
DeleteEventSubscriptionResponse'
{ $sel:eventSubscription:DeleteEventSubscriptionResponse' :: Maybe EventSubscription
eventSubscription =
Maybe EventSubscription
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteEventSubscriptionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteEventSubscriptionResponse_eventSubscription :: Lens.Lens' DeleteEventSubscriptionResponse (Prelude.Maybe EventSubscription)
deleteEventSubscriptionResponse_eventSubscription :: (Maybe EventSubscription -> f (Maybe EventSubscription))
-> DeleteEventSubscriptionResponse
-> f DeleteEventSubscriptionResponse
deleteEventSubscriptionResponse_eventSubscription = (DeleteEventSubscriptionResponse -> Maybe EventSubscription)
-> (DeleteEventSubscriptionResponse
-> Maybe EventSubscription -> DeleteEventSubscriptionResponse)
-> Lens
DeleteEventSubscriptionResponse
DeleteEventSubscriptionResponse
(Maybe EventSubscription)
(Maybe EventSubscription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteEventSubscriptionResponse' {Maybe EventSubscription
eventSubscription :: Maybe EventSubscription
$sel:eventSubscription:DeleteEventSubscriptionResponse' :: DeleteEventSubscriptionResponse -> Maybe EventSubscription
eventSubscription} -> Maybe EventSubscription
eventSubscription) (\s :: DeleteEventSubscriptionResponse
s@DeleteEventSubscriptionResponse' {} Maybe EventSubscription
a -> DeleteEventSubscriptionResponse
s {$sel:eventSubscription:DeleteEventSubscriptionResponse' :: Maybe EventSubscription
eventSubscription = Maybe EventSubscription
a} :: DeleteEventSubscriptionResponse)
deleteEventSubscriptionResponse_httpStatus :: Lens.Lens' DeleteEventSubscriptionResponse Prelude.Int
deleteEventSubscriptionResponse_httpStatus :: (Int -> f Int)
-> DeleteEventSubscriptionResponse
-> f DeleteEventSubscriptionResponse
deleteEventSubscriptionResponse_httpStatus = (DeleteEventSubscriptionResponse -> Int)
-> (DeleteEventSubscriptionResponse
-> Int -> DeleteEventSubscriptionResponse)
-> Lens
DeleteEventSubscriptionResponse
DeleteEventSubscriptionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteEventSubscriptionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteEventSubscriptionResponse' :: DeleteEventSubscriptionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteEventSubscriptionResponse
s@DeleteEventSubscriptionResponse' {} Int
a -> DeleteEventSubscriptionResponse
s {$sel:httpStatus:DeleteEventSubscriptionResponse' :: Int
httpStatus = Int
a} :: DeleteEventSubscriptionResponse)
instance
Prelude.NFData
DeleteEventSubscriptionResponse