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