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