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