{-# 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.BounceAction where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data BounceAction = BounceAction'
{
BounceAction -> Maybe Text
statusCode :: Prelude.Maybe Prelude.Text,
BounceAction -> Maybe Text
topicArn :: Prelude.Maybe Prelude.Text,
BounceAction -> Text
smtpReplyCode :: Prelude.Text,
BounceAction -> Text
message :: Prelude.Text,
BounceAction -> Text
sender :: Prelude.Text
}
deriving (BounceAction -> BounceAction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BounceAction -> BounceAction -> Bool
$c/= :: BounceAction -> BounceAction -> Bool
== :: BounceAction -> BounceAction -> Bool
$c== :: BounceAction -> BounceAction -> Bool
Prelude.Eq, ReadPrec [BounceAction]
ReadPrec BounceAction
Int -> ReadS BounceAction
ReadS [BounceAction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BounceAction]
$creadListPrec :: ReadPrec [BounceAction]
readPrec :: ReadPrec BounceAction
$creadPrec :: ReadPrec BounceAction
readList :: ReadS [BounceAction]
$creadList :: ReadS [BounceAction]
readsPrec :: Int -> ReadS BounceAction
$creadsPrec :: Int -> ReadS BounceAction
Prelude.Read, Int -> BounceAction -> ShowS
[BounceAction] -> ShowS
BounceAction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BounceAction] -> ShowS
$cshowList :: [BounceAction] -> ShowS
show :: BounceAction -> String
$cshow :: BounceAction -> String
showsPrec :: Int -> BounceAction -> ShowS
$cshowsPrec :: Int -> BounceAction -> ShowS
Prelude.Show, forall x. Rep BounceAction x -> BounceAction
forall x. BounceAction -> Rep BounceAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BounceAction x -> BounceAction
$cfrom :: forall x. BounceAction -> Rep BounceAction x
Prelude.Generic)
newBounceAction ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
BounceAction
newBounceAction :: Text -> Text -> Text -> BounceAction
newBounceAction Text
pSmtpReplyCode_ Text
pMessage_ Text
pSender_ =
BounceAction'
{ $sel:statusCode:BounceAction' :: Maybe Text
statusCode = forall a. Maybe a
Prelude.Nothing,
$sel:topicArn:BounceAction' :: Maybe Text
topicArn = forall a. Maybe a
Prelude.Nothing,
$sel:smtpReplyCode:BounceAction' :: Text
smtpReplyCode = Text
pSmtpReplyCode_,
$sel:message:BounceAction' :: Text
message = Text
pMessage_,
$sel:sender:BounceAction' :: Text
sender = Text
pSender_
}
bounceAction_statusCode :: Lens.Lens' BounceAction (Prelude.Maybe Prelude.Text)
bounceAction_statusCode :: Lens' BounceAction (Maybe Text)
bounceAction_statusCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BounceAction' {Maybe Text
statusCode :: Maybe Text
$sel:statusCode:BounceAction' :: BounceAction -> Maybe Text
statusCode} -> Maybe Text
statusCode) (\s :: BounceAction
s@BounceAction' {} Maybe Text
a -> BounceAction
s {$sel:statusCode:BounceAction' :: Maybe Text
statusCode = Maybe Text
a} :: BounceAction)
bounceAction_topicArn :: Lens.Lens' BounceAction (Prelude.Maybe Prelude.Text)
bounceAction_topicArn :: Lens' BounceAction (Maybe Text)
bounceAction_topicArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BounceAction' {Maybe Text
topicArn :: Maybe Text
$sel:topicArn:BounceAction' :: BounceAction -> Maybe Text
topicArn} -> Maybe Text
topicArn) (\s :: BounceAction
s@BounceAction' {} Maybe Text
a -> BounceAction
s {$sel:topicArn:BounceAction' :: Maybe Text
topicArn = Maybe Text
a} :: BounceAction)
bounceAction_smtpReplyCode :: Lens.Lens' BounceAction Prelude.Text
bounceAction_smtpReplyCode :: Lens' BounceAction Text
bounceAction_smtpReplyCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BounceAction' {Text
smtpReplyCode :: Text
$sel:smtpReplyCode:BounceAction' :: BounceAction -> Text
smtpReplyCode} -> Text
smtpReplyCode) (\s :: BounceAction
s@BounceAction' {} Text
a -> BounceAction
s {$sel:smtpReplyCode:BounceAction' :: Text
smtpReplyCode = Text
a} :: BounceAction)
bounceAction_message :: Lens.Lens' BounceAction Prelude.Text
bounceAction_message :: Lens' BounceAction Text
bounceAction_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BounceAction' {Text
message :: Text
$sel:message:BounceAction' :: BounceAction -> Text
message} -> Text
message) (\s :: BounceAction
s@BounceAction' {} Text
a -> BounceAction
s {$sel:message:BounceAction' :: Text
message = Text
a} :: BounceAction)
bounceAction_sender :: Lens.Lens' BounceAction Prelude.Text
bounceAction_sender :: Lens' BounceAction Text
bounceAction_sender = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BounceAction' {Text
sender :: Text
$sel:sender:BounceAction' :: BounceAction -> Text
sender} -> Text
sender) (\s :: BounceAction
s@BounceAction' {} Text
a -> BounceAction
s {$sel:sender:BounceAction' :: Text
sender = Text
a} :: BounceAction)
instance Data.FromXML BounceAction where
parseXML :: [Node] -> Either String BounceAction
parseXML [Node]
x =
Maybe Text -> Maybe Text -> Text -> Text -> Text -> BounceAction
BounceAction'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"StatusCode")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"TopicArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"SmtpReplyCode")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Message")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Sender")
instance Prelude.Hashable BounceAction where
hashWithSalt :: Int -> BounceAction -> Int
hashWithSalt Int
_salt BounceAction' {Maybe Text
Text
sender :: Text
message :: Text
smtpReplyCode :: Text
topicArn :: Maybe Text
statusCode :: Maybe Text
$sel:sender:BounceAction' :: BounceAction -> Text
$sel:message:BounceAction' :: BounceAction -> Text
$sel:smtpReplyCode:BounceAction' :: BounceAction -> Text
$sel:topicArn:BounceAction' :: BounceAction -> Maybe Text
$sel:statusCode:BounceAction' :: BounceAction -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
topicArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
smtpReplyCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
message
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sender
instance Prelude.NFData BounceAction where
rnf :: BounceAction -> ()
rnf BounceAction' {Maybe Text
Text
sender :: Text
message :: Text
smtpReplyCode :: Text
topicArn :: Maybe Text
statusCode :: Maybe Text
$sel:sender:BounceAction' :: BounceAction -> Text
$sel:message:BounceAction' :: BounceAction -> Text
$sel:smtpReplyCode:BounceAction' :: BounceAction -> Text
$sel:topicArn:BounceAction' :: BounceAction -> Maybe Text
$sel:statusCode:BounceAction' :: BounceAction -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
topicArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
smtpReplyCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
message
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sender
instance Data.ToQuery BounceAction where
toQuery :: BounceAction -> QueryString
toQuery BounceAction' {Maybe Text
Text
sender :: Text
message :: Text
smtpReplyCode :: Text
topicArn :: Maybe Text
statusCode :: Maybe Text
$sel:sender:BounceAction' :: BounceAction -> Text
$sel:message:BounceAction' :: BounceAction -> Text
$sel:smtpReplyCode:BounceAction' :: BounceAction -> Text
$sel:topicArn:BounceAction' :: BounceAction -> Maybe Text
$sel:statusCode:BounceAction' :: BounceAction -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"StatusCode" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
statusCode,
ByteString
"TopicArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
topicArn,
ByteString
"SmtpReplyCode" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
smtpReplyCode,
ByteString
"Message" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
message,
ByteString
"Sender" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
sender
]