{-# 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.InAppMessageHeaderConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.Alignment
import qualified Amazonka.Prelude as Prelude
data =
{
:: Alignment,
:: Prelude.Text,
:: Prelude.Text
}
deriving (InAppMessageHeaderConfig -> InAppMessageHeaderConfig -> Bool
(InAppMessageHeaderConfig -> InAppMessageHeaderConfig -> Bool)
-> (InAppMessageHeaderConfig -> InAppMessageHeaderConfig -> Bool)
-> Eq InAppMessageHeaderConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InAppMessageHeaderConfig -> InAppMessageHeaderConfig -> Bool
$c/= :: InAppMessageHeaderConfig -> InAppMessageHeaderConfig -> Bool
== :: InAppMessageHeaderConfig -> InAppMessageHeaderConfig -> Bool
$c== :: InAppMessageHeaderConfig -> InAppMessageHeaderConfig -> Bool
Prelude.Eq, ReadPrec [InAppMessageHeaderConfig]
ReadPrec InAppMessageHeaderConfig
Int -> ReadS InAppMessageHeaderConfig
ReadS [InAppMessageHeaderConfig]
(Int -> ReadS InAppMessageHeaderConfig)
-> ReadS [InAppMessageHeaderConfig]
-> ReadPrec InAppMessageHeaderConfig
-> ReadPrec [InAppMessageHeaderConfig]
-> Read InAppMessageHeaderConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InAppMessageHeaderConfig]
$creadListPrec :: ReadPrec [InAppMessageHeaderConfig]
readPrec :: ReadPrec InAppMessageHeaderConfig
$creadPrec :: ReadPrec InAppMessageHeaderConfig
readList :: ReadS [InAppMessageHeaderConfig]
$creadList :: ReadS [InAppMessageHeaderConfig]
readsPrec :: Int -> ReadS InAppMessageHeaderConfig
$creadsPrec :: Int -> ReadS InAppMessageHeaderConfig
Prelude.Read, Int -> InAppMessageHeaderConfig -> ShowS
[InAppMessageHeaderConfig] -> ShowS
InAppMessageHeaderConfig -> String
(Int -> InAppMessageHeaderConfig -> ShowS)
-> (InAppMessageHeaderConfig -> String)
-> ([InAppMessageHeaderConfig] -> ShowS)
-> Show InAppMessageHeaderConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InAppMessageHeaderConfig] -> ShowS
$cshowList :: [InAppMessageHeaderConfig] -> ShowS
show :: InAppMessageHeaderConfig -> String
$cshow :: InAppMessageHeaderConfig -> String
showsPrec :: Int -> InAppMessageHeaderConfig -> ShowS
$cshowsPrec :: Int -> InAppMessageHeaderConfig -> ShowS
Prelude.Show, (forall x.
InAppMessageHeaderConfig -> Rep InAppMessageHeaderConfig x)
-> (forall x.
Rep InAppMessageHeaderConfig x -> InAppMessageHeaderConfig)
-> Generic InAppMessageHeaderConfig
forall x.
Rep InAppMessageHeaderConfig x -> InAppMessageHeaderConfig
forall x.
InAppMessageHeaderConfig -> Rep InAppMessageHeaderConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InAppMessageHeaderConfig x -> InAppMessageHeaderConfig
$cfrom :: forall x.
InAppMessageHeaderConfig -> Rep InAppMessageHeaderConfig x
Prelude.Generic)
newInAppMessageHeaderConfig ::
Alignment ->
Prelude.Text ->
Prelude.Text ->
InAppMessageHeaderConfig
Alignment
pAlignment_
Text
pHeader_
Text
pTextColor_ =
InAppMessageHeaderConfig' :: Alignment -> Text -> Text -> InAppMessageHeaderConfig
InAppMessageHeaderConfig'
{ $sel:alignment:InAppMessageHeaderConfig' :: Alignment
alignment = Alignment
pAlignment_,
$sel:header:InAppMessageHeaderConfig' :: Text
header = Text
pHeader_,
$sel:textColor:InAppMessageHeaderConfig' :: Text
textColor = Text
pTextColor_
}
inAppMessageHeaderConfig_alignment :: Lens.Lens' InAppMessageHeaderConfig Alignment
= (InAppMessageHeaderConfig -> Alignment)
-> (InAppMessageHeaderConfig
-> Alignment -> InAppMessageHeaderConfig)
-> Lens
InAppMessageHeaderConfig
InAppMessageHeaderConfig
Alignment
Alignment
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InAppMessageHeaderConfig' {Alignment
alignment :: Alignment
$sel:alignment:InAppMessageHeaderConfig' :: InAppMessageHeaderConfig -> Alignment
alignment} -> Alignment
alignment) (\s :: InAppMessageHeaderConfig
s@InAppMessageHeaderConfig' {} Alignment
a -> InAppMessageHeaderConfig
s {$sel:alignment:InAppMessageHeaderConfig' :: Alignment
alignment = Alignment
a} :: InAppMessageHeaderConfig)
inAppMessageHeaderConfig_header :: Lens.Lens' InAppMessageHeaderConfig Prelude.Text
= (InAppMessageHeaderConfig -> Text)
-> (InAppMessageHeaderConfig -> Text -> InAppMessageHeaderConfig)
-> Lens InAppMessageHeaderConfig InAppMessageHeaderConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InAppMessageHeaderConfig' {Text
header :: Text
$sel:header:InAppMessageHeaderConfig' :: InAppMessageHeaderConfig -> Text
header} -> Text
header) (\s :: InAppMessageHeaderConfig
s@InAppMessageHeaderConfig' {} Text
a -> InAppMessageHeaderConfig
s {$sel:header:InAppMessageHeaderConfig' :: Text
header = Text
a} :: InAppMessageHeaderConfig)
inAppMessageHeaderConfig_textColor :: Lens.Lens' InAppMessageHeaderConfig Prelude.Text
= (InAppMessageHeaderConfig -> Text)
-> (InAppMessageHeaderConfig -> Text -> InAppMessageHeaderConfig)
-> Lens InAppMessageHeaderConfig InAppMessageHeaderConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InAppMessageHeaderConfig' {Text
textColor :: Text
$sel:textColor:InAppMessageHeaderConfig' :: InAppMessageHeaderConfig -> Text
textColor} -> Text
textColor) (\s :: InAppMessageHeaderConfig
s@InAppMessageHeaderConfig' {} Text
a -> InAppMessageHeaderConfig
s {$sel:textColor:InAppMessageHeaderConfig' :: Text
textColor = Text
a} :: InAppMessageHeaderConfig)
instance Core.FromJSON InAppMessageHeaderConfig where
parseJSON :: Value -> Parser InAppMessageHeaderConfig
parseJSON =
String
-> (Object -> Parser InAppMessageHeaderConfig)
-> Value
-> Parser InAppMessageHeaderConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InAppMessageHeaderConfig"
( \Object
x ->
Alignment -> Text -> Text -> InAppMessageHeaderConfig
InAppMessageHeaderConfig'
(Alignment -> Text -> Text -> InAppMessageHeaderConfig)
-> Parser Alignment
-> Parser (Text -> Text -> InAppMessageHeaderConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Alignment
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Alignment")
Parser (Text -> Text -> InAppMessageHeaderConfig)
-> Parser Text -> Parser (Text -> InAppMessageHeaderConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Header")
Parser (Text -> InAppMessageHeaderConfig)
-> Parser Text -> Parser InAppMessageHeaderConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TextColor")
)
instance Prelude.Hashable InAppMessageHeaderConfig
instance Prelude.NFData InAppMessageHeaderConfig
instance Core.ToJSON InAppMessageHeaderConfig where
toJSON :: InAppMessageHeaderConfig -> Value
toJSON InAppMessageHeaderConfig' {Text
Alignment
textColor :: Text
header :: Text
alignment :: Alignment
$sel:textColor:InAppMessageHeaderConfig' :: InAppMessageHeaderConfig -> Text
$sel:header:InAppMessageHeaderConfig' :: InAppMessageHeaderConfig -> Text
$sel:alignment:InAppMessageHeaderConfig' :: InAppMessageHeaderConfig -> Alignment
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Alignment" Text -> Alignment -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Alignment
alignment),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Header" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
header),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TextColor" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
textColor)
]
)