{-# 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.SES.SetIdentityNotificationTopic
(
SetIdentityNotificationTopic (..),
newSetIdentityNotificationTopic,
setIdentityNotificationTopic_snsTopic,
setIdentityNotificationTopic_identity,
setIdentityNotificationTopic_notificationType,
SetIdentityNotificationTopicResponse (..),
newSetIdentityNotificationTopicResponse,
setIdentityNotificationTopicResponse_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.SES.Types
data SetIdentityNotificationTopic = SetIdentityNotificationTopic'
{
SetIdentityNotificationTopic -> Maybe Text
snsTopic :: Prelude.Maybe Prelude.Text,
SetIdentityNotificationTopic -> Text
identity :: Prelude.Text,
SetIdentityNotificationTopic -> NotificationType
notificationType :: NotificationType
}
deriving (SetIdentityNotificationTopic
-> SetIdentityNotificationTopic -> Bool
(SetIdentityNotificationTopic
-> SetIdentityNotificationTopic -> Bool)
-> (SetIdentityNotificationTopic
-> SetIdentityNotificationTopic -> Bool)
-> Eq SetIdentityNotificationTopic
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetIdentityNotificationTopic
-> SetIdentityNotificationTopic -> Bool
$c/= :: SetIdentityNotificationTopic
-> SetIdentityNotificationTopic -> Bool
== :: SetIdentityNotificationTopic
-> SetIdentityNotificationTopic -> Bool
$c== :: SetIdentityNotificationTopic
-> SetIdentityNotificationTopic -> Bool
Prelude.Eq, ReadPrec [SetIdentityNotificationTopic]
ReadPrec SetIdentityNotificationTopic
Int -> ReadS SetIdentityNotificationTopic
ReadS [SetIdentityNotificationTopic]
(Int -> ReadS SetIdentityNotificationTopic)
-> ReadS [SetIdentityNotificationTopic]
-> ReadPrec SetIdentityNotificationTopic
-> ReadPrec [SetIdentityNotificationTopic]
-> Read SetIdentityNotificationTopic
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetIdentityNotificationTopic]
$creadListPrec :: ReadPrec [SetIdentityNotificationTopic]
readPrec :: ReadPrec SetIdentityNotificationTopic
$creadPrec :: ReadPrec SetIdentityNotificationTopic
readList :: ReadS [SetIdentityNotificationTopic]
$creadList :: ReadS [SetIdentityNotificationTopic]
readsPrec :: Int -> ReadS SetIdentityNotificationTopic
$creadsPrec :: Int -> ReadS SetIdentityNotificationTopic
Prelude.Read, Int -> SetIdentityNotificationTopic -> ShowS
[SetIdentityNotificationTopic] -> ShowS
SetIdentityNotificationTopic -> String
(Int -> SetIdentityNotificationTopic -> ShowS)
-> (SetIdentityNotificationTopic -> String)
-> ([SetIdentityNotificationTopic] -> ShowS)
-> Show SetIdentityNotificationTopic
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetIdentityNotificationTopic] -> ShowS
$cshowList :: [SetIdentityNotificationTopic] -> ShowS
show :: SetIdentityNotificationTopic -> String
$cshow :: SetIdentityNotificationTopic -> String
showsPrec :: Int -> SetIdentityNotificationTopic -> ShowS
$cshowsPrec :: Int -> SetIdentityNotificationTopic -> ShowS
Prelude.Show, (forall x.
SetIdentityNotificationTopic -> Rep SetIdentityNotificationTopic x)
-> (forall x.
Rep SetIdentityNotificationTopic x -> SetIdentityNotificationTopic)
-> Generic SetIdentityNotificationTopic
forall x.
Rep SetIdentityNotificationTopic x -> SetIdentityNotificationTopic
forall x.
SetIdentityNotificationTopic -> Rep SetIdentityNotificationTopic x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SetIdentityNotificationTopic x -> SetIdentityNotificationTopic
$cfrom :: forall x.
SetIdentityNotificationTopic -> Rep SetIdentityNotificationTopic x
Prelude.Generic)
newSetIdentityNotificationTopic ::
Prelude.Text ->
NotificationType ->
SetIdentityNotificationTopic
newSetIdentityNotificationTopic :: Text -> NotificationType -> SetIdentityNotificationTopic
newSetIdentityNotificationTopic
Text
pIdentity_
NotificationType
pNotificationType_ =
SetIdentityNotificationTopic' :: Maybe Text
-> Text -> NotificationType -> SetIdentityNotificationTopic
SetIdentityNotificationTopic'
{ $sel:snsTopic:SetIdentityNotificationTopic' :: Maybe Text
snsTopic =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:identity:SetIdentityNotificationTopic' :: Text
identity = Text
pIdentity_,
$sel:notificationType:SetIdentityNotificationTopic' :: NotificationType
notificationType = NotificationType
pNotificationType_
}
setIdentityNotificationTopic_snsTopic :: Lens.Lens' SetIdentityNotificationTopic (Prelude.Maybe Prelude.Text)
setIdentityNotificationTopic_snsTopic :: (Maybe Text -> f (Maybe Text))
-> SetIdentityNotificationTopic -> f SetIdentityNotificationTopic
setIdentityNotificationTopic_snsTopic = (SetIdentityNotificationTopic -> Maybe Text)
-> (SetIdentityNotificationTopic
-> Maybe Text -> SetIdentityNotificationTopic)
-> Lens
SetIdentityNotificationTopic
SetIdentityNotificationTopic
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetIdentityNotificationTopic' {Maybe Text
snsTopic :: Maybe Text
$sel:snsTopic:SetIdentityNotificationTopic' :: SetIdentityNotificationTopic -> Maybe Text
snsTopic} -> Maybe Text
snsTopic) (\s :: SetIdentityNotificationTopic
s@SetIdentityNotificationTopic' {} Maybe Text
a -> SetIdentityNotificationTopic
s {$sel:snsTopic:SetIdentityNotificationTopic' :: Maybe Text
snsTopic = Maybe Text
a} :: SetIdentityNotificationTopic)
setIdentityNotificationTopic_identity :: Lens.Lens' SetIdentityNotificationTopic Prelude.Text
setIdentityNotificationTopic_identity :: (Text -> f Text)
-> SetIdentityNotificationTopic -> f SetIdentityNotificationTopic
setIdentityNotificationTopic_identity = (SetIdentityNotificationTopic -> Text)
-> (SetIdentityNotificationTopic
-> Text -> SetIdentityNotificationTopic)
-> Lens
SetIdentityNotificationTopic SetIdentityNotificationTopic Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetIdentityNotificationTopic' {Text
identity :: Text
$sel:identity:SetIdentityNotificationTopic' :: SetIdentityNotificationTopic -> Text
identity} -> Text
identity) (\s :: SetIdentityNotificationTopic
s@SetIdentityNotificationTopic' {} Text
a -> SetIdentityNotificationTopic
s {$sel:identity:SetIdentityNotificationTopic' :: Text
identity = Text
a} :: SetIdentityNotificationTopic)
setIdentityNotificationTopic_notificationType :: Lens.Lens' SetIdentityNotificationTopic NotificationType
setIdentityNotificationTopic_notificationType :: (NotificationType -> f NotificationType)
-> SetIdentityNotificationTopic -> f SetIdentityNotificationTopic
setIdentityNotificationTopic_notificationType = (SetIdentityNotificationTopic -> NotificationType)
-> (SetIdentityNotificationTopic
-> NotificationType -> SetIdentityNotificationTopic)
-> Lens
SetIdentityNotificationTopic
SetIdentityNotificationTopic
NotificationType
NotificationType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetIdentityNotificationTopic' {NotificationType
notificationType :: NotificationType
$sel:notificationType:SetIdentityNotificationTopic' :: SetIdentityNotificationTopic -> NotificationType
notificationType} -> NotificationType
notificationType) (\s :: SetIdentityNotificationTopic
s@SetIdentityNotificationTopic' {} NotificationType
a -> SetIdentityNotificationTopic
s {$sel:notificationType:SetIdentityNotificationTopic' :: NotificationType
notificationType = NotificationType
a} :: SetIdentityNotificationTopic)
instance Core.AWSRequest SetIdentityNotificationTopic where
type
AWSResponse SetIdentityNotificationTopic =
SetIdentityNotificationTopicResponse
request :: SetIdentityNotificationTopic
-> Request SetIdentityNotificationTopic
request = Service
-> SetIdentityNotificationTopic
-> Request SetIdentityNotificationTopic
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy SetIdentityNotificationTopic
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetIdentityNotificationTopic)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse SetIdentityNotificationTopic))
-> Logger
-> Service
-> Proxy SetIdentityNotificationTopic
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetIdentityNotificationTopic)))
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
"SetIdentityNotificationTopicResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> SetIdentityNotificationTopicResponse
SetIdentityNotificationTopicResponse'
(Int -> SetIdentityNotificationTopicResponse)
-> Either String Int
-> Either String SetIdentityNotificationTopicResponse
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
SetIdentityNotificationTopic
instance Prelude.NFData SetIdentityNotificationTopic
instance Core.ToHeaders SetIdentityNotificationTopic where
toHeaders :: SetIdentityNotificationTopic -> ResponseHeaders
toHeaders = ResponseHeaders -> SetIdentityNotificationTopic -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath SetIdentityNotificationTopic where
toPath :: SetIdentityNotificationTopic -> ByteString
toPath = ByteString -> SetIdentityNotificationTopic -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SetIdentityNotificationTopic where
toQuery :: SetIdentityNotificationTopic -> QueryString
toQuery SetIdentityNotificationTopic' {Maybe Text
Text
NotificationType
notificationType :: NotificationType
identity :: Text
snsTopic :: Maybe Text
$sel:notificationType:SetIdentityNotificationTopic' :: SetIdentityNotificationTopic -> NotificationType
$sel:identity:SetIdentityNotificationTopic' :: SetIdentityNotificationTopic -> Text
$sel:snsTopic:SetIdentityNotificationTopic' :: SetIdentityNotificationTopic -> Maybe 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
"SetIdentityNotificationTopic" ::
Prelude.ByteString
),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"SnsTopic" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
snsTopic,
ByteString
"Identity" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
identity,
ByteString
"NotificationType" ByteString -> NotificationType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: NotificationType
notificationType
]
data SetIdentityNotificationTopicResponse = SetIdentityNotificationTopicResponse'
{
SetIdentityNotificationTopicResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SetIdentityNotificationTopicResponse
-> SetIdentityNotificationTopicResponse -> Bool
(SetIdentityNotificationTopicResponse
-> SetIdentityNotificationTopicResponse -> Bool)
-> (SetIdentityNotificationTopicResponse
-> SetIdentityNotificationTopicResponse -> Bool)
-> Eq SetIdentityNotificationTopicResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetIdentityNotificationTopicResponse
-> SetIdentityNotificationTopicResponse -> Bool
$c/= :: SetIdentityNotificationTopicResponse
-> SetIdentityNotificationTopicResponse -> Bool
== :: SetIdentityNotificationTopicResponse
-> SetIdentityNotificationTopicResponse -> Bool
$c== :: SetIdentityNotificationTopicResponse
-> SetIdentityNotificationTopicResponse -> Bool
Prelude.Eq, ReadPrec [SetIdentityNotificationTopicResponse]
ReadPrec SetIdentityNotificationTopicResponse
Int -> ReadS SetIdentityNotificationTopicResponse
ReadS [SetIdentityNotificationTopicResponse]
(Int -> ReadS SetIdentityNotificationTopicResponse)
-> ReadS [SetIdentityNotificationTopicResponse]
-> ReadPrec SetIdentityNotificationTopicResponse
-> ReadPrec [SetIdentityNotificationTopicResponse]
-> Read SetIdentityNotificationTopicResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetIdentityNotificationTopicResponse]
$creadListPrec :: ReadPrec [SetIdentityNotificationTopicResponse]
readPrec :: ReadPrec SetIdentityNotificationTopicResponse
$creadPrec :: ReadPrec SetIdentityNotificationTopicResponse
readList :: ReadS [SetIdentityNotificationTopicResponse]
$creadList :: ReadS [SetIdentityNotificationTopicResponse]
readsPrec :: Int -> ReadS SetIdentityNotificationTopicResponse
$creadsPrec :: Int -> ReadS SetIdentityNotificationTopicResponse
Prelude.Read, Int -> SetIdentityNotificationTopicResponse -> ShowS
[SetIdentityNotificationTopicResponse] -> ShowS
SetIdentityNotificationTopicResponse -> String
(Int -> SetIdentityNotificationTopicResponse -> ShowS)
-> (SetIdentityNotificationTopicResponse -> String)
-> ([SetIdentityNotificationTopicResponse] -> ShowS)
-> Show SetIdentityNotificationTopicResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetIdentityNotificationTopicResponse] -> ShowS
$cshowList :: [SetIdentityNotificationTopicResponse] -> ShowS
show :: SetIdentityNotificationTopicResponse -> String
$cshow :: SetIdentityNotificationTopicResponse -> String
showsPrec :: Int -> SetIdentityNotificationTopicResponse -> ShowS
$cshowsPrec :: Int -> SetIdentityNotificationTopicResponse -> ShowS
Prelude.Show, (forall x.
SetIdentityNotificationTopicResponse
-> Rep SetIdentityNotificationTopicResponse x)
-> (forall x.
Rep SetIdentityNotificationTopicResponse x
-> SetIdentityNotificationTopicResponse)
-> Generic SetIdentityNotificationTopicResponse
forall x.
Rep SetIdentityNotificationTopicResponse x
-> SetIdentityNotificationTopicResponse
forall x.
SetIdentityNotificationTopicResponse
-> Rep SetIdentityNotificationTopicResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SetIdentityNotificationTopicResponse x
-> SetIdentityNotificationTopicResponse
$cfrom :: forall x.
SetIdentityNotificationTopicResponse
-> Rep SetIdentityNotificationTopicResponse x
Prelude.Generic)
newSetIdentityNotificationTopicResponse ::
Prelude.Int ->
SetIdentityNotificationTopicResponse
newSetIdentityNotificationTopicResponse :: Int -> SetIdentityNotificationTopicResponse
newSetIdentityNotificationTopicResponse Int
pHttpStatus_ =
SetIdentityNotificationTopicResponse' :: Int -> SetIdentityNotificationTopicResponse
SetIdentityNotificationTopicResponse'
{ $sel:httpStatus:SetIdentityNotificationTopicResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
setIdentityNotificationTopicResponse_httpStatus :: Lens.Lens' SetIdentityNotificationTopicResponse Prelude.Int
setIdentityNotificationTopicResponse_httpStatus :: (Int -> f Int)
-> SetIdentityNotificationTopicResponse
-> f SetIdentityNotificationTopicResponse
setIdentityNotificationTopicResponse_httpStatus = (SetIdentityNotificationTopicResponse -> Int)
-> (SetIdentityNotificationTopicResponse
-> Int -> SetIdentityNotificationTopicResponse)
-> Lens
SetIdentityNotificationTopicResponse
SetIdentityNotificationTopicResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetIdentityNotificationTopicResponse' {Int
httpStatus :: Int
$sel:httpStatus:SetIdentityNotificationTopicResponse' :: SetIdentityNotificationTopicResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SetIdentityNotificationTopicResponse
s@SetIdentityNotificationTopicResponse' {} Int
a -> SetIdentityNotificationTopicResponse
s {$sel:httpStatus:SetIdentityNotificationTopicResponse' :: Int
httpStatus = Int
a} :: SetIdentityNotificationTopicResponse)
instance
Prelude.NFData
SetIdentityNotificationTopicResponse