{-# 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.DefaultPushNotificationMessage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.Action
import qualified Amazonka.Prelude as Prelude
data DefaultPushNotificationMessage = DefaultPushNotificationMessage'
{
DefaultPushNotificationMessage -> Maybe (HashMap Text [Text])
substitutions :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
DefaultPushNotificationMessage -> Maybe Bool
silentPush :: Prelude.Maybe Prelude.Bool,
DefaultPushNotificationMessage -> Maybe (HashMap Text Text)
data' :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
DefaultPushNotificationMessage -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
DefaultPushNotificationMessage -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
DefaultPushNotificationMessage -> Maybe Action
action :: Prelude.Maybe Action,
DefaultPushNotificationMessage -> Maybe Text
title :: Prelude.Maybe Prelude.Text
}
deriving (DefaultPushNotificationMessage
-> DefaultPushNotificationMessage -> Bool
(DefaultPushNotificationMessage
-> DefaultPushNotificationMessage -> Bool)
-> (DefaultPushNotificationMessage
-> DefaultPushNotificationMessage -> Bool)
-> Eq DefaultPushNotificationMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DefaultPushNotificationMessage
-> DefaultPushNotificationMessage -> Bool
$c/= :: DefaultPushNotificationMessage
-> DefaultPushNotificationMessage -> Bool
== :: DefaultPushNotificationMessage
-> DefaultPushNotificationMessage -> Bool
$c== :: DefaultPushNotificationMessage
-> DefaultPushNotificationMessage -> Bool
Prelude.Eq, ReadPrec [DefaultPushNotificationMessage]
ReadPrec DefaultPushNotificationMessage
Int -> ReadS DefaultPushNotificationMessage
ReadS [DefaultPushNotificationMessage]
(Int -> ReadS DefaultPushNotificationMessage)
-> ReadS [DefaultPushNotificationMessage]
-> ReadPrec DefaultPushNotificationMessage
-> ReadPrec [DefaultPushNotificationMessage]
-> Read DefaultPushNotificationMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DefaultPushNotificationMessage]
$creadListPrec :: ReadPrec [DefaultPushNotificationMessage]
readPrec :: ReadPrec DefaultPushNotificationMessage
$creadPrec :: ReadPrec DefaultPushNotificationMessage
readList :: ReadS [DefaultPushNotificationMessage]
$creadList :: ReadS [DefaultPushNotificationMessage]
readsPrec :: Int -> ReadS DefaultPushNotificationMessage
$creadsPrec :: Int -> ReadS DefaultPushNotificationMessage
Prelude.Read, Int -> DefaultPushNotificationMessage -> ShowS
[DefaultPushNotificationMessage] -> ShowS
DefaultPushNotificationMessage -> String
(Int -> DefaultPushNotificationMessage -> ShowS)
-> (DefaultPushNotificationMessage -> String)
-> ([DefaultPushNotificationMessage] -> ShowS)
-> Show DefaultPushNotificationMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DefaultPushNotificationMessage] -> ShowS
$cshowList :: [DefaultPushNotificationMessage] -> ShowS
show :: DefaultPushNotificationMessage -> String
$cshow :: DefaultPushNotificationMessage -> String
showsPrec :: Int -> DefaultPushNotificationMessage -> ShowS
$cshowsPrec :: Int -> DefaultPushNotificationMessage -> ShowS
Prelude.Show, (forall x.
DefaultPushNotificationMessage
-> Rep DefaultPushNotificationMessage x)
-> (forall x.
Rep DefaultPushNotificationMessage x
-> DefaultPushNotificationMessage)
-> Generic DefaultPushNotificationMessage
forall x.
Rep DefaultPushNotificationMessage x
-> DefaultPushNotificationMessage
forall x.
DefaultPushNotificationMessage
-> Rep DefaultPushNotificationMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DefaultPushNotificationMessage x
-> DefaultPushNotificationMessage
$cfrom :: forall x.
DefaultPushNotificationMessage
-> Rep DefaultPushNotificationMessage x
Prelude.Generic)
newDefaultPushNotificationMessage ::
DefaultPushNotificationMessage
newDefaultPushNotificationMessage :: DefaultPushNotificationMessage
newDefaultPushNotificationMessage =
DefaultPushNotificationMessage' :: Maybe (HashMap Text [Text])
-> Maybe Bool
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe Action
-> Maybe Text
-> DefaultPushNotificationMessage
DefaultPushNotificationMessage'
{ $sel:substitutions:DefaultPushNotificationMessage' :: Maybe (HashMap Text [Text])
substitutions =
Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
$sel:silentPush:DefaultPushNotificationMessage' :: Maybe Bool
silentPush = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:data':DefaultPushNotificationMessage' :: Maybe (HashMap Text Text)
data' = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:body:DefaultPushNotificationMessage' :: Maybe Text
body = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:url:DefaultPushNotificationMessage' :: Maybe Text
url = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:action:DefaultPushNotificationMessage' :: Maybe Action
action = Maybe Action
forall a. Maybe a
Prelude.Nothing,
$sel:title:DefaultPushNotificationMessage' :: Maybe Text
title = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
defaultPushNotificationMessage_substitutions :: Lens.Lens' DefaultPushNotificationMessage (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
defaultPushNotificationMessage_substitutions :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> DefaultPushNotificationMessage
-> f DefaultPushNotificationMessage
defaultPushNotificationMessage_substitutions = (DefaultPushNotificationMessage -> Maybe (HashMap Text [Text]))
-> (DefaultPushNotificationMessage
-> Maybe (HashMap Text [Text]) -> DefaultPushNotificationMessage)
-> Lens
DefaultPushNotificationMessage
DefaultPushNotificationMessage
(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 (\DefaultPushNotificationMessage' {Maybe (HashMap Text [Text])
substitutions :: Maybe (HashMap Text [Text])
$sel:substitutions:DefaultPushNotificationMessage' :: DefaultPushNotificationMessage -> Maybe (HashMap Text [Text])
substitutions} -> Maybe (HashMap Text [Text])
substitutions) (\s :: DefaultPushNotificationMessage
s@DefaultPushNotificationMessage' {} Maybe (HashMap Text [Text])
a -> DefaultPushNotificationMessage
s {$sel:substitutions:DefaultPushNotificationMessage' :: Maybe (HashMap Text [Text])
substitutions = Maybe (HashMap Text [Text])
a} :: DefaultPushNotificationMessage) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> DefaultPushNotificationMessage
-> f DefaultPushNotificationMessage)
-> ((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])))
-> DefaultPushNotificationMessage
-> f DefaultPushNotificationMessage
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
defaultPushNotificationMessage_silentPush :: Lens.Lens' DefaultPushNotificationMessage (Prelude.Maybe Prelude.Bool)
defaultPushNotificationMessage_silentPush :: (Maybe Bool -> f (Maybe Bool))
-> DefaultPushNotificationMessage
-> f DefaultPushNotificationMessage
defaultPushNotificationMessage_silentPush = (DefaultPushNotificationMessage -> Maybe Bool)
-> (DefaultPushNotificationMessage
-> Maybe Bool -> DefaultPushNotificationMessage)
-> Lens
DefaultPushNotificationMessage
DefaultPushNotificationMessage
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DefaultPushNotificationMessage' {Maybe Bool
silentPush :: Maybe Bool
$sel:silentPush:DefaultPushNotificationMessage' :: DefaultPushNotificationMessage -> Maybe Bool
silentPush} -> Maybe Bool
silentPush) (\s :: DefaultPushNotificationMessage
s@DefaultPushNotificationMessage' {} Maybe Bool
a -> DefaultPushNotificationMessage
s {$sel:silentPush:DefaultPushNotificationMessage' :: Maybe Bool
silentPush = Maybe Bool
a} :: DefaultPushNotificationMessage)
defaultPushNotificationMessage_data :: Lens.Lens' DefaultPushNotificationMessage (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
defaultPushNotificationMessage_data :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DefaultPushNotificationMessage
-> f DefaultPushNotificationMessage
defaultPushNotificationMessage_data = (DefaultPushNotificationMessage -> Maybe (HashMap Text Text))
-> (DefaultPushNotificationMessage
-> Maybe (HashMap Text Text) -> DefaultPushNotificationMessage)
-> Lens
DefaultPushNotificationMessage
DefaultPushNotificationMessage
(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 (\DefaultPushNotificationMessage' {Maybe (HashMap Text Text)
data' :: Maybe (HashMap Text Text)
$sel:data':DefaultPushNotificationMessage' :: DefaultPushNotificationMessage -> Maybe (HashMap Text Text)
data'} -> Maybe (HashMap Text Text)
data') (\s :: DefaultPushNotificationMessage
s@DefaultPushNotificationMessage' {} Maybe (HashMap Text Text)
a -> DefaultPushNotificationMessage
s {$sel:data':DefaultPushNotificationMessage' :: Maybe (HashMap Text Text)
data' = Maybe (HashMap Text Text)
a} :: DefaultPushNotificationMessage) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DefaultPushNotificationMessage
-> f DefaultPushNotificationMessage)
-> ((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)))
-> DefaultPushNotificationMessage
-> f DefaultPushNotificationMessage
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
defaultPushNotificationMessage_body :: Lens.Lens' DefaultPushNotificationMessage (Prelude.Maybe Prelude.Text)
defaultPushNotificationMessage_body :: (Maybe Text -> f (Maybe Text))
-> DefaultPushNotificationMessage
-> f DefaultPushNotificationMessage
defaultPushNotificationMessage_body = (DefaultPushNotificationMessage -> Maybe Text)
-> (DefaultPushNotificationMessage
-> Maybe Text -> DefaultPushNotificationMessage)
-> Lens
DefaultPushNotificationMessage
DefaultPushNotificationMessage
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DefaultPushNotificationMessage' {Maybe Text
body :: Maybe Text
$sel:body:DefaultPushNotificationMessage' :: DefaultPushNotificationMessage -> Maybe Text
body} -> Maybe Text
body) (\s :: DefaultPushNotificationMessage
s@DefaultPushNotificationMessage' {} Maybe Text
a -> DefaultPushNotificationMessage
s {$sel:body:DefaultPushNotificationMessage' :: Maybe Text
body = Maybe Text
a} :: DefaultPushNotificationMessage)
defaultPushNotificationMessage_url :: Lens.Lens' DefaultPushNotificationMessage (Prelude.Maybe Prelude.Text)
defaultPushNotificationMessage_url :: (Maybe Text -> f (Maybe Text))
-> DefaultPushNotificationMessage
-> f DefaultPushNotificationMessage
defaultPushNotificationMessage_url = (DefaultPushNotificationMessage -> Maybe Text)
-> (DefaultPushNotificationMessage
-> Maybe Text -> DefaultPushNotificationMessage)
-> Lens
DefaultPushNotificationMessage
DefaultPushNotificationMessage
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DefaultPushNotificationMessage' {Maybe Text
url :: Maybe Text
$sel:url:DefaultPushNotificationMessage' :: DefaultPushNotificationMessage -> Maybe Text
url} -> Maybe Text
url) (\s :: DefaultPushNotificationMessage
s@DefaultPushNotificationMessage' {} Maybe Text
a -> DefaultPushNotificationMessage
s {$sel:url:DefaultPushNotificationMessage' :: Maybe Text
url = Maybe Text
a} :: DefaultPushNotificationMessage)
defaultPushNotificationMessage_action :: Lens.Lens' DefaultPushNotificationMessage (Prelude.Maybe Action)
defaultPushNotificationMessage_action :: (Maybe Action -> f (Maybe Action))
-> DefaultPushNotificationMessage
-> f DefaultPushNotificationMessage
defaultPushNotificationMessage_action = (DefaultPushNotificationMessage -> Maybe Action)
-> (DefaultPushNotificationMessage
-> Maybe Action -> DefaultPushNotificationMessage)
-> Lens
DefaultPushNotificationMessage
DefaultPushNotificationMessage
(Maybe Action)
(Maybe Action)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DefaultPushNotificationMessage' {Maybe Action
action :: Maybe Action
$sel:action:DefaultPushNotificationMessage' :: DefaultPushNotificationMessage -> Maybe Action
action} -> Maybe Action
action) (\s :: DefaultPushNotificationMessage
s@DefaultPushNotificationMessage' {} Maybe Action
a -> DefaultPushNotificationMessage
s {$sel:action:DefaultPushNotificationMessage' :: Maybe Action
action = Maybe Action
a} :: DefaultPushNotificationMessage)
defaultPushNotificationMessage_title :: Lens.Lens' DefaultPushNotificationMessage (Prelude.Maybe Prelude.Text)
defaultPushNotificationMessage_title :: (Maybe Text -> f (Maybe Text))
-> DefaultPushNotificationMessage
-> f DefaultPushNotificationMessage
defaultPushNotificationMessage_title = (DefaultPushNotificationMessage -> Maybe Text)
-> (DefaultPushNotificationMessage
-> Maybe Text -> DefaultPushNotificationMessage)
-> Lens
DefaultPushNotificationMessage
DefaultPushNotificationMessage
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DefaultPushNotificationMessage' {Maybe Text
title :: Maybe Text
$sel:title:DefaultPushNotificationMessage' :: DefaultPushNotificationMessage -> Maybe Text
title} -> Maybe Text
title) (\s :: DefaultPushNotificationMessage
s@DefaultPushNotificationMessage' {} Maybe Text
a -> DefaultPushNotificationMessage
s {$sel:title:DefaultPushNotificationMessage' :: Maybe Text
title = Maybe Text
a} :: DefaultPushNotificationMessage)
instance
Prelude.Hashable
DefaultPushNotificationMessage
instance
Prelude.NFData
DefaultPushNotificationMessage
instance Core.ToJSON DefaultPushNotificationMessage where
toJSON :: DefaultPushNotificationMessage -> Value
toJSON DefaultPushNotificationMessage' {Maybe Bool
Maybe Text
Maybe (HashMap Text [Text])
Maybe (HashMap Text Text)
Maybe Action
title :: Maybe Text
action :: Maybe Action
url :: Maybe Text
body :: Maybe Text
data' :: Maybe (HashMap Text Text)
silentPush :: Maybe Bool
substitutions :: Maybe (HashMap Text [Text])
$sel:title:DefaultPushNotificationMessage' :: DefaultPushNotificationMessage -> Maybe Text
$sel:action:DefaultPushNotificationMessage' :: DefaultPushNotificationMessage -> Maybe Action
$sel:url:DefaultPushNotificationMessage' :: DefaultPushNotificationMessage -> Maybe Text
$sel:body:DefaultPushNotificationMessage' :: DefaultPushNotificationMessage -> Maybe Text
$sel:data':DefaultPushNotificationMessage' :: DefaultPushNotificationMessage -> Maybe (HashMap Text Text)
$sel:silentPush:DefaultPushNotificationMessage' :: DefaultPushNotificationMessage -> Maybe Bool
$sel:substitutions:DefaultPushNotificationMessage' :: DefaultPushNotificationMessage -> 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
"SilentPush" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
silentPush,
(Text
"Data" 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)
data',
(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,
(Text
"Url" 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
url,
(Text
"Action" Text -> Action -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Action -> Pair) -> Maybe Action -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Action
action,
(Text
"Title" 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
title
]
)