{-# 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.RDS.AddSourceIdentifierToSubscription
(
AddSourceIdentifierToSubscription (..),
newAddSourceIdentifierToSubscription,
addSourceIdentifierToSubscription_subscriptionName,
addSourceIdentifierToSubscription_sourceIdentifier,
AddSourceIdentifierToSubscriptionResponse (..),
newAddSourceIdentifierToSubscriptionResponse,
addSourceIdentifierToSubscriptionResponse_eventSubscription,
addSourceIdentifierToSubscriptionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data AddSourceIdentifierToSubscription = AddSourceIdentifierToSubscription'
{
AddSourceIdentifierToSubscription -> Text
subscriptionName :: Prelude.Text,
AddSourceIdentifierToSubscription -> Text
sourceIdentifier :: Prelude.Text
}
deriving (AddSourceIdentifierToSubscription
-> AddSourceIdentifierToSubscription -> Bool
(AddSourceIdentifierToSubscription
-> AddSourceIdentifierToSubscription -> Bool)
-> (AddSourceIdentifierToSubscription
-> AddSourceIdentifierToSubscription -> Bool)
-> Eq AddSourceIdentifierToSubscription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddSourceIdentifierToSubscription
-> AddSourceIdentifierToSubscription -> Bool
$c/= :: AddSourceIdentifierToSubscription
-> AddSourceIdentifierToSubscription -> Bool
== :: AddSourceIdentifierToSubscription
-> AddSourceIdentifierToSubscription -> Bool
$c== :: AddSourceIdentifierToSubscription
-> AddSourceIdentifierToSubscription -> Bool
Prelude.Eq, ReadPrec [AddSourceIdentifierToSubscription]
ReadPrec AddSourceIdentifierToSubscription
Int -> ReadS AddSourceIdentifierToSubscription
ReadS [AddSourceIdentifierToSubscription]
(Int -> ReadS AddSourceIdentifierToSubscription)
-> ReadS [AddSourceIdentifierToSubscription]
-> ReadPrec AddSourceIdentifierToSubscription
-> ReadPrec [AddSourceIdentifierToSubscription]
-> Read AddSourceIdentifierToSubscription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddSourceIdentifierToSubscription]
$creadListPrec :: ReadPrec [AddSourceIdentifierToSubscription]
readPrec :: ReadPrec AddSourceIdentifierToSubscription
$creadPrec :: ReadPrec AddSourceIdentifierToSubscription
readList :: ReadS [AddSourceIdentifierToSubscription]
$creadList :: ReadS [AddSourceIdentifierToSubscription]
readsPrec :: Int -> ReadS AddSourceIdentifierToSubscription
$creadsPrec :: Int -> ReadS AddSourceIdentifierToSubscription
Prelude.Read, Int -> AddSourceIdentifierToSubscription -> ShowS
[AddSourceIdentifierToSubscription] -> ShowS
AddSourceIdentifierToSubscription -> String
(Int -> AddSourceIdentifierToSubscription -> ShowS)
-> (AddSourceIdentifierToSubscription -> String)
-> ([AddSourceIdentifierToSubscription] -> ShowS)
-> Show AddSourceIdentifierToSubscription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddSourceIdentifierToSubscription] -> ShowS
$cshowList :: [AddSourceIdentifierToSubscription] -> ShowS
show :: AddSourceIdentifierToSubscription -> String
$cshow :: AddSourceIdentifierToSubscription -> String
showsPrec :: Int -> AddSourceIdentifierToSubscription -> ShowS
$cshowsPrec :: Int -> AddSourceIdentifierToSubscription -> ShowS
Prelude.Show, (forall x.
AddSourceIdentifierToSubscription
-> Rep AddSourceIdentifierToSubscription x)
-> (forall x.
Rep AddSourceIdentifierToSubscription x
-> AddSourceIdentifierToSubscription)
-> Generic AddSourceIdentifierToSubscription
forall x.
Rep AddSourceIdentifierToSubscription x
-> AddSourceIdentifierToSubscription
forall x.
AddSourceIdentifierToSubscription
-> Rep AddSourceIdentifierToSubscription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AddSourceIdentifierToSubscription x
-> AddSourceIdentifierToSubscription
$cfrom :: forall x.
AddSourceIdentifierToSubscription
-> Rep AddSourceIdentifierToSubscription x
Prelude.Generic)
newAddSourceIdentifierToSubscription ::
Prelude.Text ->
Prelude.Text ->
AddSourceIdentifierToSubscription
newAddSourceIdentifierToSubscription :: Text -> Text -> AddSourceIdentifierToSubscription
newAddSourceIdentifierToSubscription
Text
pSubscriptionName_
Text
pSourceIdentifier_ =
AddSourceIdentifierToSubscription' :: Text -> Text -> AddSourceIdentifierToSubscription
AddSourceIdentifierToSubscription'
{ $sel:subscriptionName:AddSourceIdentifierToSubscription' :: Text
subscriptionName =
Text
pSubscriptionName_,
$sel:sourceIdentifier:AddSourceIdentifierToSubscription' :: Text
sourceIdentifier = Text
pSourceIdentifier_
}
addSourceIdentifierToSubscription_subscriptionName :: Lens.Lens' AddSourceIdentifierToSubscription Prelude.Text
addSourceIdentifierToSubscription_subscriptionName :: (Text -> f Text)
-> AddSourceIdentifierToSubscription
-> f AddSourceIdentifierToSubscription
addSourceIdentifierToSubscription_subscriptionName = (AddSourceIdentifierToSubscription -> Text)
-> (AddSourceIdentifierToSubscription
-> Text -> AddSourceIdentifierToSubscription)
-> Lens
AddSourceIdentifierToSubscription
AddSourceIdentifierToSubscription
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddSourceIdentifierToSubscription' {Text
subscriptionName :: Text
$sel:subscriptionName:AddSourceIdentifierToSubscription' :: AddSourceIdentifierToSubscription -> Text
subscriptionName} -> Text
subscriptionName) (\s :: AddSourceIdentifierToSubscription
s@AddSourceIdentifierToSubscription' {} Text
a -> AddSourceIdentifierToSubscription
s {$sel:subscriptionName:AddSourceIdentifierToSubscription' :: Text
subscriptionName = Text
a} :: AddSourceIdentifierToSubscription)
addSourceIdentifierToSubscription_sourceIdentifier :: Lens.Lens' AddSourceIdentifierToSubscription Prelude.Text
addSourceIdentifierToSubscription_sourceIdentifier :: (Text -> f Text)
-> AddSourceIdentifierToSubscription
-> f AddSourceIdentifierToSubscription
addSourceIdentifierToSubscription_sourceIdentifier = (AddSourceIdentifierToSubscription -> Text)
-> (AddSourceIdentifierToSubscription
-> Text -> AddSourceIdentifierToSubscription)
-> Lens
AddSourceIdentifierToSubscription
AddSourceIdentifierToSubscription
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddSourceIdentifierToSubscription' {Text
sourceIdentifier :: Text
$sel:sourceIdentifier:AddSourceIdentifierToSubscription' :: AddSourceIdentifierToSubscription -> Text
sourceIdentifier} -> Text
sourceIdentifier) (\s :: AddSourceIdentifierToSubscription
s@AddSourceIdentifierToSubscription' {} Text
a -> AddSourceIdentifierToSubscription
s {$sel:sourceIdentifier:AddSourceIdentifierToSubscription' :: Text
sourceIdentifier = Text
a} :: AddSourceIdentifierToSubscription)
instance
Core.AWSRequest
AddSourceIdentifierToSubscription
where
type
AWSResponse AddSourceIdentifierToSubscription =
AddSourceIdentifierToSubscriptionResponse
request :: AddSourceIdentifierToSubscription
-> Request AddSourceIdentifierToSubscription
request = Service
-> AddSourceIdentifierToSubscription
-> Request AddSourceIdentifierToSubscription
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy AddSourceIdentifierToSubscription
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AddSourceIdentifierToSubscription)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse AddSourceIdentifierToSubscription))
-> Logger
-> Service
-> Proxy AddSourceIdentifierToSubscription
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AddSourceIdentifierToSubscription)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"AddSourceIdentifierToSubscriptionResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe EventSubscription
-> Int -> AddSourceIdentifierToSubscriptionResponse
AddSourceIdentifierToSubscriptionResponse'
(Maybe EventSubscription
-> Int -> AddSourceIdentifierToSubscriptionResponse)
-> Either String (Maybe EventSubscription)
-> Either String (Int -> AddSourceIdentifierToSubscriptionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe EventSubscription)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EventSubscription")
Either String (Int -> AddSourceIdentifierToSubscriptionResponse)
-> Either String Int
-> Either String AddSourceIdentifierToSubscriptionResponse
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
AddSourceIdentifierToSubscription
instance
Prelude.NFData
AddSourceIdentifierToSubscription
instance
Core.ToHeaders
AddSourceIdentifierToSubscription
where
toHeaders :: AddSourceIdentifierToSubscription -> ResponseHeaders
toHeaders = ResponseHeaders
-> AddSourceIdentifierToSubscription -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance
Core.ToPath
AddSourceIdentifierToSubscription
where
toPath :: AddSourceIdentifierToSubscription -> ByteString
toPath = ByteString -> AddSourceIdentifierToSubscription -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Core.ToQuery
AddSourceIdentifierToSubscription
where
toQuery :: AddSourceIdentifierToSubscription -> QueryString
toQuery AddSourceIdentifierToSubscription' {Text
sourceIdentifier :: Text
subscriptionName :: Text
$sel:sourceIdentifier:AddSourceIdentifierToSubscription' :: AddSourceIdentifierToSubscription -> Text
$sel:subscriptionName:AddSourceIdentifierToSubscription' :: AddSourceIdentifierToSubscription -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"AddSourceIdentifierToSubscription" ::
Prelude.ByteString
),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
ByteString
"SubscriptionName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
subscriptionName,
ByteString
"SourceIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
sourceIdentifier
]
data AddSourceIdentifierToSubscriptionResponse = AddSourceIdentifierToSubscriptionResponse'
{ AddSourceIdentifierToSubscriptionResponse
-> Maybe EventSubscription
eventSubscription :: Prelude.Maybe EventSubscription,
AddSourceIdentifierToSubscriptionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AddSourceIdentifierToSubscriptionResponse
-> AddSourceIdentifierToSubscriptionResponse -> Bool
(AddSourceIdentifierToSubscriptionResponse
-> AddSourceIdentifierToSubscriptionResponse -> Bool)
-> (AddSourceIdentifierToSubscriptionResponse
-> AddSourceIdentifierToSubscriptionResponse -> Bool)
-> Eq AddSourceIdentifierToSubscriptionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddSourceIdentifierToSubscriptionResponse
-> AddSourceIdentifierToSubscriptionResponse -> Bool
$c/= :: AddSourceIdentifierToSubscriptionResponse
-> AddSourceIdentifierToSubscriptionResponse -> Bool
== :: AddSourceIdentifierToSubscriptionResponse
-> AddSourceIdentifierToSubscriptionResponse -> Bool
$c== :: AddSourceIdentifierToSubscriptionResponse
-> AddSourceIdentifierToSubscriptionResponse -> Bool
Prelude.Eq, ReadPrec [AddSourceIdentifierToSubscriptionResponse]
ReadPrec AddSourceIdentifierToSubscriptionResponse
Int -> ReadS AddSourceIdentifierToSubscriptionResponse
ReadS [AddSourceIdentifierToSubscriptionResponse]
(Int -> ReadS AddSourceIdentifierToSubscriptionResponse)
-> ReadS [AddSourceIdentifierToSubscriptionResponse]
-> ReadPrec AddSourceIdentifierToSubscriptionResponse
-> ReadPrec [AddSourceIdentifierToSubscriptionResponse]
-> Read AddSourceIdentifierToSubscriptionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddSourceIdentifierToSubscriptionResponse]
$creadListPrec :: ReadPrec [AddSourceIdentifierToSubscriptionResponse]
readPrec :: ReadPrec AddSourceIdentifierToSubscriptionResponse
$creadPrec :: ReadPrec AddSourceIdentifierToSubscriptionResponse
readList :: ReadS [AddSourceIdentifierToSubscriptionResponse]
$creadList :: ReadS [AddSourceIdentifierToSubscriptionResponse]
readsPrec :: Int -> ReadS AddSourceIdentifierToSubscriptionResponse
$creadsPrec :: Int -> ReadS AddSourceIdentifierToSubscriptionResponse
Prelude.Read, Int -> AddSourceIdentifierToSubscriptionResponse -> ShowS
[AddSourceIdentifierToSubscriptionResponse] -> ShowS
AddSourceIdentifierToSubscriptionResponse -> String
(Int -> AddSourceIdentifierToSubscriptionResponse -> ShowS)
-> (AddSourceIdentifierToSubscriptionResponse -> String)
-> ([AddSourceIdentifierToSubscriptionResponse] -> ShowS)
-> Show AddSourceIdentifierToSubscriptionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddSourceIdentifierToSubscriptionResponse] -> ShowS
$cshowList :: [AddSourceIdentifierToSubscriptionResponse] -> ShowS
show :: AddSourceIdentifierToSubscriptionResponse -> String
$cshow :: AddSourceIdentifierToSubscriptionResponse -> String
showsPrec :: Int -> AddSourceIdentifierToSubscriptionResponse -> ShowS
$cshowsPrec :: Int -> AddSourceIdentifierToSubscriptionResponse -> ShowS
Prelude.Show, (forall x.
AddSourceIdentifierToSubscriptionResponse
-> Rep AddSourceIdentifierToSubscriptionResponse x)
-> (forall x.
Rep AddSourceIdentifierToSubscriptionResponse x
-> AddSourceIdentifierToSubscriptionResponse)
-> Generic AddSourceIdentifierToSubscriptionResponse
forall x.
Rep AddSourceIdentifierToSubscriptionResponse x
-> AddSourceIdentifierToSubscriptionResponse
forall x.
AddSourceIdentifierToSubscriptionResponse
-> Rep AddSourceIdentifierToSubscriptionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AddSourceIdentifierToSubscriptionResponse x
-> AddSourceIdentifierToSubscriptionResponse
$cfrom :: forall x.
AddSourceIdentifierToSubscriptionResponse
-> Rep AddSourceIdentifierToSubscriptionResponse x
Prelude.Generic)
newAddSourceIdentifierToSubscriptionResponse ::
Prelude.Int ->
AddSourceIdentifierToSubscriptionResponse
newAddSourceIdentifierToSubscriptionResponse :: Int -> AddSourceIdentifierToSubscriptionResponse
newAddSourceIdentifierToSubscriptionResponse
Int
pHttpStatus_ =
AddSourceIdentifierToSubscriptionResponse' :: Maybe EventSubscription
-> Int -> AddSourceIdentifierToSubscriptionResponse
AddSourceIdentifierToSubscriptionResponse'
{ $sel:eventSubscription:AddSourceIdentifierToSubscriptionResponse' :: Maybe EventSubscription
eventSubscription =
Maybe EventSubscription
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:AddSourceIdentifierToSubscriptionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
addSourceIdentifierToSubscriptionResponse_eventSubscription :: Lens.Lens' AddSourceIdentifierToSubscriptionResponse (Prelude.Maybe EventSubscription)
addSourceIdentifierToSubscriptionResponse_eventSubscription :: (Maybe EventSubscription -> f (Maybe EventSubscription))
-> AddSourceIdentifierToSubscriptionResponse
-> f AddSourceIdentifierToSubscriptionResponse
addSourceIdentifierToSubscriptionResponse_eventSubscription = (AddSourceIdentifierToSubscriptionResponse
-> Maybe EventSubscription)
-> (AddSourceIdentifierToSubscriptionResponse
-> Maybe EventSubscription
-> AddSourceIdentifierToSubscriptionResponse)
-> Lens
AddSourceIdentifierToSubscriptionResponse
AddSourceIdentifierToSubscriptionResponse
(Maybe EventSubscription)
(Maybe EventSubscription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddSourceIdentifierToSubscriptionResponse' {Maybe EventSubscription
eventSubscription :: Maybe EventSubscription
$sel:eventSubscription:AddSourceIdentifierToSubscriptionResponse' :: AddSourceIdentifierToSubscriptionResponse
-> Maybe EventSubscription
eventSubscription} -> Maybe EventSubscription
eventSubscription) (\s :: AddSourceIdentifierToSubscriptionResponse
s@AddSourceIdentifierToSubscriptionResponse' {} Maybe EventSubscription
a -> AddSourceIdentifierToSubscriptionResponse
s {$sel:eventSubscription:AddSourceIdentifierToSubscriptionResponse' :: Maybe EventSubscription
eventSubscription = Maybe EventSubscription
a} :: AddSourceIdentifierToSubscriptionResponse)
addSourceIdentifierToSubscriptionResponse_httpStatus :: Lens.Lens' AddSourceIdentifierToSubscriptionResponse Prelude.Int
addSourceIdentifierToSubscriptionResponse_httpStatus :: (Int -> f Int)
-> AddSourceIdentifierToSubscriptionResponse
-> f AddSourceIdentifierToSubscriptionResponse
addSourceIdentifierToSubscriptionResponse_httpStatus = (AddSourceIdentifierToSubscriptionResponse -> Int)
-> (AddSourceIdentifierToSubscriptionResponse
-> Int -> AddSourceIdentifierToSubscriptionResponse)
-> Lens
AddSourceIdentifierToSubscriptionResponse
AddSourceIdentifierToSubscriptionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddSourceIdentifierToSubscriptionResponse' {Int
httpStatus :: Int
$sel:httpStatus:AddSourceIdentifierToSubscriptionResponse' :: AddSourceIdentifierToSubscriptionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AddSourceIdentifierToSubscriptionResponse
s@AddSourceIdentifierToSubscriptionResponse' {} Int
a -> AddSourceIdentifierToSubscriptionResponse
s {$sel:httpStatus:AddSourceIdentifierToSubscriptionResponse' :: Int
httpStatus = Int
a} :: AddSourceIdentifierToSubscriptionResponse)
instance
Prelude.NFData
AddSourceIdentifierToSubscriptionResponse