{-# 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.IoTEvents.Types.EmailContent 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 EmailContent = EmailContent'
{
EmailContent -> Maybe Text
additionalMessage :: Prelude.Maybe Prelude.Text,
EmailContent -> Maybe Text
subject :: Prelude.Maybe Prelude.Text
}
deriving (EmailContent -> EmailContent -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EmailContent -> EmailContent -> Bool
$c/= :: EmailContent -> EmailContent -> Bool
== :: EmailContent -> EmailContent -> Bool
$c== :: EmailContent -> EmailContent -> Bool
Prelude.Eq, ReadPrec [EmailContent]
ReadPrec EmailContent
Int -> ReadS EmailContent
ReadS [EmailContent]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EmailContent]
$creadListPrec :: ReadPrec [EmailContent]
readPrec :: ReadPrec EmailContent
$creadPrec :: ReadPrec EmailContent
readList :: ReadS [EmailContent]
$creadList :: ReadS [EmailContent]
readsPrec :: Int -> ReadS EmailContent
$creadsPrec :: Int -> ReadS EmailContent
Prelude.Read, Int -> EmailContent -> ShowS
[EmailContent] -> ShowS
EmailContent -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EmailContent] -> ShowS
$cshowList :: [EmailContent] -> ShowS
show :: EmailContent -> String
$cshow :: EmailContent -> String
showsPrec :: Int -> EmailContent -> ShowS
$cshowsPrec :: Int -> EmailContent -> ShowS
Prelude.Show, forall x. Rep EmailContent x -> EmailContent
forall x. EmailContent -> Rep EmailContent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EmailContent x -> EmailContent
$cfrom :: forall x. EmailContent -> Rep EmailContent x
Prelude.Generic)
newEmailContent ::
EmailContent
newEmailContent :: EmailContent
newEmailContent =
EmailContent'
{ $sel:additionalMessage:EmailContent' :: Maybe Text
additionalMessage = forall a. Maybe a
Prelude.Nothing,
$sel:subject:EmailContent' :: Maybe Text
subject = forall a. Maybe a
Prelude.Nothing
}
emailContent_additionalMessage :: Lens.Lens' EmailContent (Prelude.Maybe Prelude.Text)
emailContent_additionalMessage :: Lens' EmailContent (Maybe Text)
emailContent_additionalMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailContent' {Maybe Text
additionalMessage :: Maybe Text
$sel:additionalMessage:EmailContent' :: EmailContent -> Maybe Text
additionalMessage} -> Maybe Text
additionalMessage) (\s :: EmailContent
s@EmailContent' {} Maybe Text
a -> EmailContent
s {$sel:additionalMessage:EmailContent' :: Maybe Text
additionalMessage = Maybe Text
a} :: EmailContent)
emailContent_subject :: Lens.Lens' EmailContent (Prelude.Maybe Prelude.Text)
emailContent_subject :: Lens' EmailContent (Maybe Text)
emailContent_subject = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailContent' {Maybe Text
subject :: Maybe Text
$sel:subject:EmailContent' :: EmailContent -> Maybe Text
subject} -> Maybe Text
subject) (\s :: EmailContent
s@EmailContent' {} Maybe Text
a -> EmailContent
s {$sel:subject:EmailContent' :: Maybe Text
subject = Maybe Text
a} :: EmailContent)
instance Data.FromJSON EmailContent where
parseJSON :: Value -> Parser EmailContent
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EmailContent"
( \Object
x ->
Maybe Text -> Maybe Text -> EmailContent
EmailContent'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"additionalMessage")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"subject")
)
instance Prelude.Hashable EmailContent where
hashWithSalt :: Int -> EmailContent -> Int
hashWithSalt Int
_salt EmailContent' {Maybe Text
subject :: Maybe Text
additionalMessage :: Maybe Text
$sel:subject:EmailContent' :: EmailContent -> Maybe Text
$sel:additionalMessage:EmailContent' :: EmailContent -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
additionalMessage
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subject
instance Prelude.NFData EmailContent where
rnf :: EmailContent -> ()
rnf EmailContent' {Maybe Text
subject :: Maybe Text
additionalMessage :: Maybe Text
$sel:subject:EmailContent' :: EmailContent -> Maybe Text
$sel:additionalMessage:EmailContent' :: EmailContent -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
additionalMessage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subject
instance Data.ToJSON EmailContent where
toJSON :: EmailContent -> Value
toJSON EmailContent' {Maybe Text
subject :: Maybe Text
additionalMessage :: Maybe Text
$sel:subject:EmailContent' :: EmailContent -> Maybe Text
$sel:additionalMessage:EmailContent' :: EmailContent -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"additionalMessage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
additionalMessage,
(Key
"subject" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
subject
]
)