{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data DefaultMessage = DefaultMessage'
{
DefaultMessage -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
DefaultMessage -> Maybe (HashMap Text [Text])
substitutions :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text])
}
deriving (DefaultMessage -> DefaultMessage -> Bool
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]
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
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. 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'
{ $sel:body:DefaultMessage' :: Maybe Text
body = forall a. Maybe a
Prelude.Nothing,
$sel:substitutions:DefaultMessage' :: Maybe (HashMap Text [Text])
substitutions = forall a. Maybe a
Prelude.Nothing
}
defaultMessage_body :: Lens.Lens' DefaultMessage (Prelude.Maybe Prelude.Text)
defaultMessage_body :: Lens' DefaultMessage (Maybe Text)
defaultMessage_body = 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)
defaultMessage_substitutions :: Lens.Lens' DefaultMessage (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
defaultMessage_substitutions :: Lens' DefaultMessage (Maybe (HashMap Text [Text]))
defaultMessage_substitutions = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable DefaultMessage where
hashWithSalt :: Int -> DefaultMessage -> Int
hashWithSalt Int
_salt DefaultMessage' {Maybe Text
Maybe (HashMap Text [Text])
substitutions :: Maybe (HashMap Text [Text])
body :: Maybe Text
$sel:substitutions:DefaultMessage' :: DefaultMessage -> Maybe (HashMap Text [Text])
$sel:body:DefaultMessage' :: DefaultMessage -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
body
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text [Text])
substitutions
instance Prelude.NFData DefaultMessage where
rnf :: DefaultMessage -> ()
rnf DefaultMessage' {Maybe Text
Maybe (HashMap Text [Text])
substitutions :: Maybe (HashMap Text [Text])
body :: Maybe Text
$sel:substitutions:DefaultMessage' :: DefaultMessage -> Maybe (HashMap Text [Text])
$sel:body:DefaultMessage' :: DefaultMessage -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
body
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text [Text])
substitutions
instance Data.ToJSON DefaultMessage where
toJSON :: DefaultMessage -> Value
toJSON DefaultMessage' {Maybe Text
Maybe (HashMap Text [Text])
substitutions :: Maybe (HashMap Text [Text])
body :: Maybe Text
$sel:substitutions:DefaultMessage' :: DefaultMessage -> Maybe (HashMap Text [Text])
$sel:body:DefaultMessage' :: DefaultMessage -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Body" 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
body,
(Key
"Substitutions" 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 (HashMap Text [Text])
substitutions
]
)