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