{-# 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.SESV2.Types.BulkEmailEntry where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SESV2.Types.Destination
import Amazonka.SESV2.Types.MessageTag
import Amazonka.SESV2.Types.ReplacementEmailContent
data BulkEmailEntry = BulkEmailEntry'
{
BulkEmailEntry -> Maybe ReplacementEmailContent
replacementEmailContent :: Prelude.Maybe ReplacementEmailContent,
BulkEmailEntry -> Maybe [MessageTag]
replacementTags :: Prelude.Maybe [MessageTag],
BulkEmailEntry -> Destination
destination :: Destination
}
deriving (BulkEmailEntry -> BulkEmailEntry -> Bool
(BulkEmailEntry -> BulkEmailEntry -> Bool)
-> (BulkEmailEntry -> BulkEmailEntry -> Bool) -> Eq BulkEmailEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BulkEmailEntry -> BulkEmailEntry -> Bool
$c/= :: BulkEmailEntry -> BulkEmailEntry -> Bool
== :: BulkEmailEntry -> BulkEmailEntry -> Bool
$c== :: BulkEmailEntry -> BulkEmailEntry -> Bool
Prelude.Eq, ReadPrec [BulkEmailEntry]
ReadPrec BulkEmailEntry
Int -> ReadS BulkEmailEntry
ReadS [BulkEmailEntry]
(Int -> ReadS BulkEmailEntry)
-> ReadS [BulkEmailEntry]
-> ReadPrec BulkEmailEntry
-> ReadPrec [BulkEmailEntry]
-> Read BulkEmailEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BulkEmailEntry]
$creadListPrec :: ReadPrec [BulkEmailEntry]
readPrec :: ReadPrec BulkEmailEntry
$creadPrec :: ReadPrec BulkEmailEntry
readList :: ReadS [BulkEmailEntry]
$creadList :: ReadS [BulkEmailEntry]
readsPrec :: Int -> ReadS BulkEmailEntry
$creadsPrec :: Int -> ReadS BulkEmailEntry
Prelude.Read, Int -> BulkEmailEntry -> ShowS
[BulkEmailEntry] -> ShowS
BulkEmailEntry -> String
(Int -> BulkEmailEntry -> ShowS)
-> (BulkEmailEntry -> String)
-> ([BulkEmailEntry] -> ShowS)
-> Show BulkEmailEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BulkEmailEntry] -> ShowS
$cshowList :: [BulkEmailEntry] -> ShowS
show :: BulkEmailEntry -> String
$cshow :: BulkEmailEntry -> String
showsPrec :: Int -> BulkEmailEntry -> ShowS
$cshowsPrec :: Int -> BulkEmailEntry -> ShowS
Prelude.Show, (forall x. BulkEmailEntry -> Rep BulkEmailEntry x)
-> (forall x. Rep BulkEmailEntry x -> BulkEmailEntry)
-> Generic BulkEmailEntry
forall x. Rep BulkEmailEntry x -> BulkEmailEntry
forall x. BulkEmailEntry -> Rep BulkEmailEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BulkEmailEntry x -> BulkEmailEntry
$cfrom :: forall x. BulkEmailEntry -> Rep BulkEmailEntry x
Prelude.Generic)
newBulkEmailEntry ::
Destination ->
BulkEmailEntry
newBulkEmailEntry :: Destination -> BulkEmailEntry
newBulkEmailEntry Destination
pDestination_ =
BulkEmailEntry' :: Maybe ReplacementEmailContent
-> Maybe [MessageTag] -> Destination -> BulkEmailEntry
BulkEmailEntry'
{ $sel:replacementEmailContent:BulkEmailEntry' :: Maybe ReplacementEmailContent
replacementEmailContent =
Maybe ReplacementEmailContent
forall a. Maybe a
Prelude.Nothing,
$sel:replacementTags:BulkEmailEntry' :: Maybe [MessageTag]
replacementTags = Maybe [MessageTag]
forall a. Maybe a
Prelude.Nothing,
$sel:destination:BulkEmailEntry' :: Destination
destination = Destination
pDestination_
}
bulkEmailEntry_replacementEmailContent :: Lens.Lens' BulkEmailEntry (Prelude.Maybe ReplacementEmailContent)
bulkEmailEntry_replacementEmailContent :: (Maybe ReplacementEmailContent
-> f (Maybe ReplacementEmailContent))
-> BulkEmailEntry -> f BulkEmailEntry
bulkEmailEntry_replacementEmailContent = (BulkEmailEntry -> Maybe ReplacementEmailContent)
-> (BulkEmailEntry
-> Maybe ReplacementEmailContent -> BulkEmailEntry)
-> Lens
BulkEmailEntry
BulkEmailEntry
(Maybe ReplacementEmailContent)
(Maybe ReplacementEmailContent)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BulkEmailEntry' {Maybe ReplacementEmailContent
replacementEmailContent :: Maybe ReplacementEmailContent
$sel:replacementEmailContent:BulkEmailEntry' :: BulkEmailEntry -> Maybe ReplacementEmailContent
replacementEmailContent} -> Maybe ReplacementEmailContent
replacementEmailContent) (\s :: BulkEmailEntry
s@BulkEmailEntry' {} Maybe ReplacementEmailContent
a -> BulkEmailEntry
s {$sel:replacementEmailContent:BulkEmailEntry' :: Maybe ReplacementEmailContent
replacementEmailContent = Maybe ReplacementEmailContent
a} :: BulkEmailEntry)
bulkEmailEntry_replacementTags :: Lens.Lens' BulkEmailEntry (Prelude.Maybe [MessageTag])
bulkEmailEntry_replacementTags :: (Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> BulkEmailEntry -> f BulkEmailEntry
bulkEmailEntry_replacementTags = (BulkEmailEntry -> Maybe [MessageTag])
-> (BulkEmailEntry -> Maybe [MessageTag] -> BulkEmailEntry)
-> Lens
BulkEmailEntry
BulkEmailEntry
(Maybe [MessageTag])
(Maybe [MessageTag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BulkEmailEntry' {Maybe [MessageTag]
replacementTags :: Maybe [MessageTag]
$sel:replacementTags:BulkEmailEntry' :: BulkEmailEntry -> Maybe [MessageTag]
replacementTags} -> Maybe [MessageTag]
replacementTags) (\s :: BulkEmailEntry
s@BulkEmailEntry' {} Maybe [MessageTag]
a -> BulkEmailEntry
s {$sel:replacementTags:BulkEmailEntry' :: Maybe [MessageTag]
replacementTags = Maybe [MessageTag]
a} :: BulkEmailEntry) ((Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> BulkEmailEntry -> f BulkEmailEntry)
-> ((Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> (Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> BulkEmailEntry
-> f BulkEmailEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [MessageTag] [MessageTag] [MessageTag] [MessageTag]
-> Iso
(Maybe [MessageTag])
(Maybe [MessageTag])
(Maybe [MessageTag])
(Maybe [MessageTag])
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 [MessageTag] [MessageTag] [MessageTag] [MessageTag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
bulkEmailEntry_destination :: Lens.Lens' BulkEmailEntry Destination
bulkEmailEntry_destination :: (Destination -> f Destination)
-> BulkEmailEntry -> f BulkEmailEntry
bulkEmailEntry_destination = (BulkEmailEntry -> Destination)
-> (BulkEmailEntry -> Destination -> BulkEmailEntry)
-> Lens BulkEmailEntry BulkEmailEntry Destination Destination
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BulkEmailEntry' {Destination
destination :: Destination
$sel:destination:BulkEmailEntry' :: BulkEmailEntry -> Destination
destination} -> Destination
destination) (\s :: BulkEmailEntry
s@BulkEmailEntry' {} Destination
a -> BulkEmailEntry
s {$sel:destination:BulkEmailEntry' :: Destination
destination = Destination
a} :: BulkEmailEntry)
instance Prelude.Hashable BulkEmailEntry
instance Prelude.NFData BulkEmailEntry
instance Core.ToJSON BulkEmailEntry where
toJSON :: BulkEmailEntry -> Value
toJSON BulkEmailEntry' {Maybe [MessageTag]
Maybe ReplacementEmailContent
Destination
destination :: Destination
replacementTags :: Maybe [MessageTag]
replacementEmailContent :: Maybe ReplacementEmailContent
$sel:destination:BulkEmailEntry' :: BulkEmailEntry -> Destination
$sel:replacementTags:BulkEmailEntry' :: BulkEmailEntry -> Maybe [MessageTag]
$sel:replacementEmailContent:BulkEmailEntry' :: BulkEmailEntry -> Maybe ReplacementEmailContent
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ReplacementEmailContent" Text -> ReplacementEmailContent -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ReplacementEmailContent -> Pair)
-> Maybe ReplacementEmailContent -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReplacementEmailContent
replacementEmailContent,
(Text
"ReplacementTags" Text -> [MessageTag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([MessageTag] -> Pair) -> Maybe [MessageTag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MessageTag]
replacementTags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Destination" Text -> Destination -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Destination
destination)
]
)