{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.SES.Types.SNSDestination where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SNSDestination = SNSDestination'
{
SNSDestination -> Text
topicARN :: Prelude.Text
}
deriving (SNSDestination -> SNSDestination -> Bool
(SNSDestination -> SNSDestination -> Bool)
-> (SNSDestination -> SNSDestination -> Bool) -> Eq SNSDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SNSDestination -> SNSDestination -> Bool
$c/= :: SNSDestination -> SNSDestination -> Bool
== :: SNSDestination -> SNSDestination -> Bool
$c== :: SNSDestination -> SNSDestination -> Bool
Prelude.Eq, ReadPrec [SNSDestination]
ReadPrec SNSDestination
Int -> ReadS SNSDestination
ReadS [SNSDestination]
(Int -> ReadS SNSDestination)
-> ReadS [SNSDestination]
-> ReadPrec SNSDestination
-> ReadPrec [SNSDestination]
-> Read SNSDestination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SNSDestination]
$creadListPrec :: ReadPrec [SNSDestination]
readPrec :: ReadPrec SNSDestination
$creadPrec :: ReadPrec SNSDestination
readList :: ReadS [SNSDestination]
$creadList :: ReadS [SNSDestination]
readsPrec :: Int -> ReadS SNSDestination
$creadsPrec :: Int -> ReadS SNSDestination
Prelude.Read, Int -> SNSDestination -> ShowS
[SNSDestination] -> ShowS
SNSDestination -> String
(Int -> SNSDestination -> ShowS)
-> (SNSDestination -> String)
-> ([SNSDestination] -> ShowS)
-> Show SNSDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SNSDestination] -> ShowS
$cshowList :: [SNSDestination] -> ShowS
show :: SNSDestination -> String
$cshow :: SNSDestination -> String
showsPrec :: Int -> SNSDestination -> ShowS
$cshowsPrec :: Int -> SNSDestination -> ShowS
Prelude.Show, (forall x. SNSDestination -> Rep SNSDestination x)
-> (forall x. Rep SNSDestination x -> SNSDestination)
-> Generic SNSDestination
forall x. Rep SNSDestination x -> SNSDestination
forall x. SNSDestination -> Rep SNSDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SNSDestination x -> SNSDestination
$cfrom :: forall x. SNSDestination -> Rep SNSDestination x
Prelude.Generic)
newSNSDestination ::
Prelude.Text ->
SNSDestination
newSNSDestination :: Text -> SNSDestination
newSNSDestination Text
pTopicARN_ =
SNSDestination' :: Text -> SNSDestination
SNSDestination' {$sel:topicARN:SNSDestination' :: Text
topicARN = Text
pTopicARN_}
sNSDestination_topicARN :: Lens.Lens' SNSDestination Prelude.Text
sNSDestination_topicARN :: (Text -> f Text) -> SNSDestination -> f SNSDestination
sNSDestination_topicARN = (SNSDestination -> Text)
-> (SNSDestination -> Text -> SNSDestination)
-> Lens SNSDestination SNSDestination Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SNSDestination' {Text
topicARN :: Text
$sel:topicARN:SNSDestination' :: SNSDestination -> Text
topicARN} -> Text
topicARN) (\s :: SNSDestination
s@SNSDestination' {} Text
a -> SNSDestination
s {$sel:topicARN:SNSDestination' :: Text
topicARN = Text
a} :: SNSDestination)
instance Core.FromXML SNSDestination where
parseXML :: [Node] -> Either String SNSDestination
parseXML [Node]
x =
Text -> SNSDestination
SNSDestination' (Text -> SNSDestination)
-> Either String Text -> Either String SNSDestination
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"TopicARN")
instance Prelude.Hashable SNSDestination
instance Prelude.NFData SNSDestination
instance Core.ToQuery SNSDestination where
toQuery :: SNSDestination -> QueryString
toQuery SNSDestination' {Text
topicARN :: Text
$sel:topicARN:SNSDestination' :: SNSDestination -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"TopicARN" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
topicARN]