{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Pinpoint.Types.DefaultPushNotificationMessage
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Specifies the default settings and content for a push notification
-- that\'s sent directly to an endpoint.
--
-- /See:/ 'newDefaultPushNotificationMessage' smart constructor.
data DefaultPushNotificationMessage = DefaultPushNotificationMessage'
  { -- | The default message variables to use in the notification message. You
    -- can override the default variables with individual address variables.
    DefaultPushNotificationMessage -> Maybe (HashMap Text [Text])
substitutions :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
    -- | Specifies whether the default notification is a silent push
    -- notification, which is a push notification that doesn\'t display on a
    -- recipient\'s device. Silent push notifications can be used for cases
    -- such as updating an app\'s configuration or delivering messages to an
    -- in-app notification center.
    DefaultPushNotificationMessage -> Maybe Bool
silentPush :: Prelude.Maybe Prelude.Bool,
    -- | The JSON data payload to use for the default push notification, if the
    -- notification is a silent push notification. This payload is added to the
    -- data.pinpoint.jsonBody object of the notification.
    DefaultPushNotificationMessage -> Maybe (HashMap Text Text)
data' :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The default body of the notification message.
    DefaultPushNotificationMessage -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
    -- | The default URL to open in a recipient\'s default mobile browser, if a
    -- recipient taps the push notification and the value of the Action
    -- property is URL.
    DefaultPushNotificationMessage -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
    -- | The default action to occur if a recipient taps the push notification.
    -- Valid values are:
    --
    -- -   OPEN_APP - Your app opens or it becomes the foreground app if it was
    --     sent to the background. This is the default action.
    --
    -- -   DEEP_LINK - Your app opens and displays a designated user interface
    --     in the app. This setting uses the deep-linking features of the iOS
    --     and Android platforms.
    --
    -- -   URL - The default mobile browser on the recipient\'s device opens
    --     and loads the web page at a URL that you specify.
    DefaultPushNotificationMessage -> Maybe Action
action :: Prelude.Maybe Action,
    -- | The default title to display above the notification message on a
    -- recipient\'s device.
    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)

-- |
-- Create a value of 'DefaultPushNotificationMessage' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'substitutions', 'defaultPushNotificationMessage_substitutions' - The default message variables to use in the notification message. You
-- can override the default variables with individual address variables.
--
-- 'silentPush', 'defaultPushNotificationMessage_silentPush' - Specifies whether the default notification is a silent push
-- notification, which is a push notification that doesn\'t display on a
-- recipient\'s device. Silent push notifications can be used for cases
-- such as updating an app\'s configuration or delivering messages to an
-- in-app notification center.
--
-- 'data'', 'defaultPushNotificationMessage_data' - The JSON data payload to use for the default push notification, if the
-- notification is a silent push notification. This payload is added to the
-- data.pinpoint.jsonBody object of the notification.
--
-- 'body', 'defaultPushNotificationMessage_body' - The default body of the notification message.
--
-- 'url', 'defaultPushNotificationMessage_url' - The default URL to open in a recipient\'s default mobile browser, if a
-- recipient taps the push notification and the value of the Action
-- property is URL.
--
-- 'action', 'defaultPushNotificationMessage_action' - The default action to occur if a recipient taps the push notification.
-- Valid values are:
--
-- -   OPEN_APP - Your app opens or it becomes the foreground app if it was
--     sent to the background. This is the default action.
--
-- -   DEEP_LINK - Your app opens and displays a designated user interface
--     in the app. This setting uses the deep-linking features of the iOS
--     and Android platforms.
--
-- -   URL - The default mobile browser on the recipient\'s device opens
--     and loads the web page at a URL that you specify.
--
-- 'title', 'defaultPushNotificationMessage_title' - The default title to display above the notification message on a
-- recipient\'s device.
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
    }

-- | The default message variables to use in the notification message. You
-- can override the default variables with individual address variables.
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

-- | Specifies whether the default notification is a silent push
-- notification, which is a push notification that doesn\'t display on a
-- recipient\'s device. Silent push notifications can be used for cases
-- such as updating an app\'s configuration or delivering messages to an
-- in-app notification center.
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)

-- | The JSON data payload to use for the default push notification, if the
-- notification is a silent push notification. This payload is added to the
-- data.pinpoint.jsonBody object of the notification.
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

-- | The default body of the notification message.
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)

-- | The default URL to open in a recipient\'s default mobile browser, if a
-- recipient taps the push notification and the value of the Action
-- property is URL.
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)

-- | The default action to occur if a recipient taps the push notification.
-- Valid values are:
--
-- -   OPEN_APP - Your app opens or it becomes the foreground app if it was
--     sent to the background. This is the default action.
--
-- -   DEEP_LINK - Your app opens and displays a designated user interface
--     in the app. This setting uses the deep-linking features of the iOS
--     and Android platforms.
--
-- -   URL - The default mobile browser on the recipient\'s device opens
--     and loads the web page at a URL that you specify.
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)

-- | The default title to display above the notification message on a
-- recipient\'s device.
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
          ]
      )