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