{-# 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.MessageDsn where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SES.Types.ExtensionField
data MessageDsn = MessageDsn'
{
MessageDsn -> Maybe ISO8601
arrivalDate :: Prelude.Maybe Core.ISO8601,
MessageDsn -> Maybe [ExtensionField]
extensionFields :: Prelude.Maybe [ExtensionField],
MessageDsn -> Text
reportingMta :: Prelude.Text
}
deriving (MessageDsn -> MessageDsn -> Bool
(MessageDsn -> MessageDsn -> Bool)
-> (MessageDsn -> MessageDsn -> Bool) -> Eq MessageDsn
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MessageDsn -> MessageDsn -> Bool
$c/= :: MessageDsn -> MessageDsn -> Bool
== :: MessageDsn -> MessageDsn -> Bool
$c== :: MessageDsn -> MessageDsn -> Bool
Prelude.Eq, ReadPrec [MessageDsn]
ReadPrec MessageDsn
Int -> ReadS MessageDsn
ReadS [MessageDsn]
(Int -> ReadS MessageDsn)
-> ReadS [MessageDsn]
-> ReadPrec MessageDsn
-> ReadPrec [MessageDsn]
-> Read MessageDsn
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MessageDsn]
$creadListPrec :: ReadPrec [MessageDsn]
readPrec :: ReadPrec MessageDsn
$creadPrec :: ReadPrec MessageDsn
readList :: ReadS [MessageDsn]
$creadList :: ReadS [MessageDsn]
readsPrec :: Int -> ReadS MessageDsn
$creadsPrec :: Int -> ReadS MessageDsn
Prelude.Read, Int -> MessageDsn -> ShowS
[MessageDsn] -> ShowS
MessageDsn -> String
(Int -> MessageDsn -> ShowS)
-> (MessageDsn -> String)
-> ([MessageDsn] -> ShowS)
-> Show MessageDsn
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MessageDsn] -> ShowS
$cshowList :: [MessageDsn] -> ShowS
show :: MessageDsn -> String
$cshow :: MessageDsn -> String
showsPrec :: Int -> MessageDsn -> ShowS
$cshowsPrec :: Int -> MessageDsn -> ShowS
Prelude.Show, (forall x. MessageDsn -> Rep MessageDsn x)
-> (forall x. Rep MessageDsn x -> MessageDsn) -> Generic MessageDsn
forall x. Rep MessageDsn x -> MessageDsn
forall x. MessageDsn -> Rep MessageDsn x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MessageDsn x -> MessageDsn
$cfrom :: forall x. MessageDsn -> Rep MessageDsn x
Prelude.Generic)
newMessageDsn ::
Prelude.Text ->
MessageDsn
newMessageDsn :: Text -> MessageDsn
newMessageDsn Text
pReportingMta_ =
MessageDsn' :: Maybe ISO8601 -> Maybe [ExtensionField] -> Text -> MessageDsn
MessageDsn'
{ $sel:arrivalDate:MessageDsn' :: Maybe ISO8601
arrivalDate = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
$sel:extensionFields:MessageDsn' :: Maybe [ExtensionField]
extensionFields = Maybe [ExtensionField]
forall a. Maybe a
Prelude.Nothing,
$sel:reportingMta:MessageDsn' :: Text
reportingMta = Text
pReportingMta_
}
messageDsn_arrivalDate :: Lens.Lens' MessageDsn (Prelude.Maybe Prelude.UTCTime)
messageDsn_arrivalDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> MessageDsn -> f MessageDsn
messageDsn_arrivalDate = (MessageDsn -> Maybe ISO8601)
-> (MessageDsn -> Maybe ISO8601 -> MessageDsn)
-> Lens MessageDsn MessageDsn (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MessageDsn' {Maybe ISO8601
arrivalDate :: Maybe ISO8601
$sel:arrivalDate:MessageDsn' :: MessageDsn -> Maybe ISO8601
arrivalDate} -> Maybe ISO8601
arrivalDate) (\s :: MessageDsn
s@MessageDsn' {} Maybe ISO8601
a -> MessageDsn
s {$sel:arrivalDate:MessageDsn' :: Maybe ISO8601
arrivalDate = Maybe ISO8601
a} :: MessageDsn) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> MessageDsn -> f MessageDsn)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> MessageDsn
-> f MessageDsn
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
(Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
messageDsn_extensionFields :: Lens.Lens' MessageDsn (Prelude.Maybe [ExtensionField])
messageDsn_extensionFields :: (Maybe [ExtensionField] -> f (Maybe [ExtensionField]))
-> MessageDsn -> f MessageDsn
messageDsn_extensionFields = (MessageDsn -> Maybe [ExtensionField])
-> (MessageDsn -> Maybe [ExtensionField] -> MessageDsn)
-> Lens
MessageDsn
MessageDsn
(Maybe [ExtensionField])
(Maybe [ExtensionField])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MessageDsn' {Maybe [ExtensionField]
extensionFields :: Maybe [ExtensionField]
$sel:extensionFields:MessageDsn' :: MessageDsn -> Maybe [ExtensionField]
extensionFields} -> Maybe [ExtensionField]
extensionFields) (\s :: MessageDsn
s@MessageDsn' {} Maybe [ExtensionField]
a -> MessageDsn
s {$sel:extensionFields:MessageDsn' :: Maybe [ExtensionField]
extensionFields = Maybe [ExtensionField]
a} :: MessageDsn) ((Maybe [ExtensionField] -> f (Maybe [ExtensionField]))
-> MessageDsn -> f MessageDsn)
-> ((Maybe [ExtensionField] -> f (Maybe [ExtensionField]))
-> Maybe [ExtensionField] -> f (Maybe [ExtensionField]))
-> (Maybe [ExtensionField] -> f (Maybe [ExtensionField]))
-> MessageDsn
-> f MessageDsn
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ExtensionField] [ExtensionField] [ExtensionField] [ExtensionField]
-> Iso
(Maybe [ExtensionField])
(Maybe [ExtensionField])
(Maybe [ExtensionField])
(Maybe [ExtensionField])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[ExtensionField] [ExtensionField] [ExtensionField] [ExtensionField]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
messageDsn_reportingMta :: Lens.Lens' MessageDsn Prelude.Text
messageDsn_reportingMta :: (Text -> f Text) -> MessageDsn -> f MessageDsn
messageDsn_reportingMta = (MessageDsn -> Text)
-> (MessageDsn -> Text -> MessageDsn)
-> Lens MessageDsn MessageDsn Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MessageDsn' {Text
reportingMta :: Text
$sel:reportingMta:MessageDsn' :: MessageDsn -> Text
reportingMta} -> Text
reportingMta) (\s :: MessageDsn
s@MessageDsn' {} Text
a -> MessageDsn
s {$sel:reportingMta:MessageDsn' :: Text
reportingMta = Text
a} :: MessageDsn)
instance Prelude.Hashable MessageDsn
instance Prelude.NFData MessageDsn
instance Core.ToQuery MessageDsn where
toQuery :: MessageDsn -> QueryString
toQuery MessageDsn' {Maybe [ExtensionField]
Maybe ISO8601
Text
reportingMta :: Text
extensionFields :: Maybe [ExtensionField]
arrivalDate :: Maybe ISO8601
$sel:reportingMta:MessageDsn' :: MessageDsn -> Text
$sel:extensionFields:MessageDsn' :: MessageDsn -> Maybe [ExtensionField]
$sel:arrivalDate:MessageDsn' :: MessageDsn -> Maybe ISO8601
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"ArrivalDate" ByteString -> Maybe ISO8601 -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ISO8601
arrivalDate,
ByteString
"ExtensionFields"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
( ByteString -> [ExtensionField] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
([ExtensionField] -> QueryString)
-> Maybe [ExtensionField] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ExtensionField]
extensionFields
),
ByteString
"ReportingMta" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
reportingMta
]