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