{-# 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.BaiduMessage
-- 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.BaiduMessage 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 settings for a one-time message that\'s sent directly to
-- an endpoint through the Baidu (Baidu Cloud Push) channel.
--
-- /See:/ 'newBaiduMessage' smart constructor.
data BaiduMessage = BaiduMessage'
  { -- | The default message variables to use in the notification message. You
    -- can override the default variables with individual address variables.
    BaiduMessage -> Maybe (HashMap Text [Text])
substitutions :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
    -- | Specifies whether the 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 supporting phone home functionality.
    BaiduMessage -> Maybe Bool
silentPush :: Prelude.Maybe Prelude.Bool,
    -- | The URL of the large icon image to display in the content view of the
    -- push notification.
    BaiduMessage -> Maybe Text
imageIconUrl :: Prelude.Maybe Prelude.Text,
    -- | The raw, JSON-formatted string to use as the payload for the
    -- notification message. If specified, this value overrides all other
    -- content for the message.
    BaiduMessage -> Maybe Text
rawContent :: Prelude.Maybe Prelude.Text,
    -- | The JSON data payload to use for the push notification, if the
    -- notification is a silent push notification. This payload is added to the
    -- data.pinpoint.jsonBody object of the notification.
    BaiduMessage -> Maybe (HashMap Text Text)
data' :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The URL of the small icon image to display in the status bar and the
    -- content view of the push notification.
    BaiduMessage -> Maybe Text
smallImageIconUrl :: Prelude.Maybe Prelude.Text,
    -- | The body of the notification message.
    BaiduMessage -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
    -- | The amount of time, in seconds, that the Baidu Cloud Push service should
    -- store the message if the recipient\'s device is offline. The default
    -- value and maximum supported time is 604,800 seconds (7 days).
    BaiduMessage -> Maybe Int
timeToLive :: Prelude.Maybe Prelude.Int,
    -- | The URL to open in the recipient\'s default mobile browser, if a
    -- recipient taps the push notification and the value of the Action
    -- property is URL.
    BaiduMessage -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
    -- | The sound to play when the recipient receives the push notification. You
    -- can use the default stream or specify the file name of a sound resource
    -- that\'s bundled in your app. On an Android platform, the sound file must
    -- reside in \/res\/raw\/.
    BaiduMessage -> Maybe Text
sound :: Prelude.Maybe Prelude.Text,
    -- | The action to occur if the 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 action uses the deep-linking features of the
    --     Android platform.
    --
    -- -   URL - The default mobile browser on the recipient\'s device opens
    --     and loads the web page at a URL that you specify.
    BaiduMessage -> Maybe Action
action :: Prelude.Maybe Action,
    -- | The URL of an image to display in the push notification.
    BaiduMessage -> Maybe Text
imageUrl :: Prelude.Maybe Prelude.Text,
    -- | The title to display above the notification message on the recipient\'s
    -- device.
    BaiduMessage -> Maybe Text
title :: Prelude.Maybe Prelude.Text,
    -- | The icon image name of the asset saved in your app.
    BaiduMessage -> Maybe Text
iconReference :: Prelude.Maybe Prelude.Text
  }
  deriving (BaiduMessage -> BaiduMessage -> Bool
(BaiduMessage -> BaiduMessage -> Bool)
-> (BaiduMessage -> BaiduMessage -> Bool) -> Eq BaiduMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BaiduMessage -> BaiduMessage -> Bool
$c/= :: BaiduMessage -> BaiduMessage -> Bool
== :: BaiduMessage -> BaiduMessage -> Bool
$c== :: BaiduMessage -> BaiduMessage -> Bool
Prelude.Eq, ReadPrec [BaiduMessage]
ReadPrec BaiduMessage
Int -> ReadS BaiduMessage
ReadS [BaiduMessage]
(Int -> ReadS BaiduMessage)
-> ReadS [BaiduMessage]
-> ReadPrec BaiduMessage
-> ReadPrec [BaiduMessage]
-> Read BaiduMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BaiduMessage]
$creadListPrec :: ReadPrec [BaiduMessage]
readPrec :: ReadPrec BaiduMessage
$creadPrec :: ReadPrec BaiduMessage
readList :: ReadS [BaiduMessage]
$creadList :: ReadS [BaiduMessage]
readsPrec :: Int -> ReadS BaiduMessage
$creadsPrec :: Int -> ReadS BaiduMessage
Prelude.Read, Int -> BaiduMessage -> ShowS
[BaiduMessage] -> ShowS
BaiduMessage -> String
(Int -> BaiduMessage -> ShowS)
-> (BaiduMessage -> String)
-> ([BaiduMessage] -> ShowS)
-> Show BaiduMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BaiduMessage] -> ShowS
$cshowList :: [BaiduMessage] -> ShowS
show :: BaiduMessage -> String
$cshow :: BaiduMessage -> String
showsPrec :: Int -> BaiduMessage -> ShowS
$cshowsPrec :: Int -> BaiduMessage -> ShowS
Prelude.Show, (forall x. BaiduMessage -> Rep BaiduMessage x)
-> (forall x. Rep BaiduMessage x -> BaiduMessage)
-> Generic BaiduMessage
forall x. Rep BaiduMessage x -> BaiduMessage
forall x. BaiduMessage -> Rep BaiduMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BaiduMessage x -> BaiduMessage
$cfrom :: forall x. BaiduMessage -> Rep BaiduMessage x
Prelude.Generic)

-- |
-- Create a value of 'BaiduMessage' 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', 'baiduMessage_substitutions' - The default message variables to use in the notification message. You
-- can override the default variables with individual address variables.
--
-- 'silentPush', 'baiduMessage_silentPush' - Specifies whether the 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 supporting phone home functionality.
--
-- 'imageIconUrl', 'baiduMessage_imageIconUrl' - The URL of the large icon image to display in the content view of the
-- push notification.
--
-- 'rawContent', 'baiduMessage_rawContent' - The raw, JSON-formatted string to use as the payload for the
-- notification message. If specified, this value overrides all other
-- content for the message.
--
-- 'data'', 'baiduMessage_data' - The JSON data payload to use for the push notification, if the
-- notification is a silent push notification. This payload is added to the
-- data.pinpoint.jsonBody object of the notification.
--
-- 'smallImageIconUrl', 'baiduMessage_smallImageIconUrl' - The URL of the small icon image to display in the status bar and the
-- content view of the push notification.
--
-- 'body', 'baiduMessage_body' - The body of the notification message.
--
-- 'timeToLive', 'baiduMessage_timeToLive' - The amount of time, in seconds, that the Baidu Cloud Push service should
-- store the message if the recipient\'s device is offline. The default
-- value and maximum supported time is 604,800 seconds (7 days).
--
-- 'url', 'baiduMessage_url' - The URL to open in the recipient\'s default mobile browser, if a
-- recipient taps the push notification and the value of the Action
-- property is URL.
--
-- 'sound', 'baiduMessage_sound' - The sound to play when the recipient receives the push notification. You
-- can use the default stream or specify the file name of a sound resource
-- that\'s bundled in your app. On an Android platform, the sound file must
-- reside in \/res\/raw\/.
--
-- 'action', 'baiduMessage_action' - The action to occur if the 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 action uses the deep-linking features of the
--     Android platform.
--
-- -   URL - The default mobile browser on the recipient\'s device opens
--     and loads the web page at a URL that you specify.
--
-- 'imageUrl', 'baiduMessage_imageUrl' - The URL of an image to display in the push notification.
--
-- 'title', 'baiduMessage_title' - The title to display above the notification message on the recipient\'s
-- device.
--
-- 'iconReference', 'baiduMessage_iconReference' - The icon image name of the asset saved in your app.
newBaiduMessage ::
  BaiduMessage
newBaiduMessage :: BaiduMessage
newBaiduMessage =
  BaiduMessage' :: Maybe (HashMap Text [Text])
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> BaiduMessage
BaiduMessage'
    { $sel:substitutions:BaiduMessage' :: Maybe (HashMap Text [Text])
substitutions = Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
      $sel:silentPush:BaiduMessage' :: Maybe Bool
silentPush = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:imageIconUrl:BaiduMessage' :: Maybe Text
imageIconUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:rawContent:BaiduMessage' :: Maybe Text
rawContent = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:data':BaiduMessage' :: Maybe (HashMap Text Text)
data' = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:smallImageIconUrl:BaiduMessage' :: Maybe Text
smallImageIconUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:body:BaiduMessage' :: Maybe Text
body = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:timeToLive:BaiduMessage' :: Maybe Int
timeToLive = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:url:BaiduMessage' :: Maybe Text
url = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sound:BaiduMessage' :: Maybe Text
sound = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:action:BaiduMessage' :: Maybe Action
action = Maybe Action
forall a. Maybe a
Prelude.Nothing,
      $sel:imageUrl:BaiduMessage' :: Maybe Text
imageUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:title:BaiduMessage' :: Maybe Text
title = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:iconReference:BaiduMessage' :: Maybe Text
iconReference = 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.
baiduMessage_substitutions :: Lens.Lens' BaiduMessage (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
baiduMessage_substitutions :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> BaiduMessage -> f BaiduMessage
baiduMessage_substitutions = (BaiduMessage -> Maybe (HashMap Text [Text]))
-> (BaiduMessage -> Maybe (HashMap Text [Text]) -> BaiduMessage)
-> Lens
     BaiduMessage
     BaiduMessage
     (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 (\BaiduMessage' {Maybe (HashMap Text [Text])
substitutions :: Maybe (HashMap Text [Text])
$sel:substitutions:BaiduMessage' :: BaiduMessage -> Maybe (HashMap Text [Text])
substitutions} -> Maybe (HashMap Text [Text])
substitutions) (\s :: BaiduMessage
s@BaiduMessage' {} Maybe (HashMap Text [Text])
a -> BaiduMessage
s {$sel:substitutions:BaiduMessage' :: Maybe (HashMap Text [Text])
substitutions = Maybe (HashMap Text [Text])
a} :: BaiduMessage) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
 -> BaiduMessage -> f BaiduMessage)
-> ((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])))
-> BaiduMessage
-> f BaiduMessage
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 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 supporting phone home functionality.
baiduMessage_silentPush :: Lens.Lens' BaiduMessage (Prelude.Maybe Prelude.Bool)
baiduMessage_silentPush :: (Maybe Bool -> f (Maybe Bool)) -> BaiduMessage -> f BaiduMessage
baiduMessage_silentPush = (BaiduMessage -> Maybe Bool)
-> (BaiduMessage -> Maybe Bool -> BaiduMessage)
-> Lens BaiduMessage BaiduMessage (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaiduMessage' {Maybe Bool
silentPush :: Maybe Bool
$sel:silentPush:BaiduMessage' :: BaiduMessage -> Maybe Bool
silentPush} -> Maybe Bool
silentPush) (\s :: BaiduMessage
s@BaiduMessage' {} Maybe Bool
a -> BaiduMessage
s {$sel:silentPush:BaiduMessage' :: Maybe Bool
silentPush = Maybe Bool
a} :: BaiduMessage)

-- | The URL of the large icon image to display in the content view of the
-- push notification.
baiduMessage_imageIconUrl :: Lens.Lens' BaiduMessage (Prelude.Maybe Prelude.Text)
baiduMessage_imageIconUrl :: (Maybe Text -> f (Maybe Text)) -> BaiduMessage -> f BaiduMessage
baiduMessage_imageIconUrl = (BaiduMessage -> Maybe Text)
-> (BaiduMessage -> Maybe Text -> BaiduMessage)
-> Lens BaiduMessage BaiduMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaiduMessage' {Maybe Text
imageIconUrl :: Maybe Text
$sel:imageIconUrl:BaiduMessage' :: BaiduMessage -> Maybe Text
imageIconUrl} -> Maybe Text
imageIconUrl) (\s :: BaiduMessage
s@BaiduMessage' {} Maybe Text
a -> BaiduMessage
s {$sel:imageIconUrl:BaiduMessage' :: Maybe Text
imageIconUrl = Maybe Text
a} :: BaiduMessage)

-- | The raw, JSON-formatted string to use as the payload for the
-- notification message. If specified, this value overrides all other
-- content for the message.
baiduMessage_rawContent :: Lens.Lens' BaiduMessage (Prelude.Maybe Prelude.Text)
baiduMessage_rawContent :: (Maybe Text -> f (Maybe Text)) -> BaiduMessage -> f BaiduMessage
baiduMessage_rawContent = (BaiduMessage -> Maybe Text)
-> (BaiduMessage -> Maybe Text -> BaiduMessage)
-> Lens BaiduMessage BaiduMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaiduMessage' {Maybe Text
rawContent :: Maybe Text
$sel:rawContent:BaiduMessage' :: BaiduMessage -> Maybe Text
rawContent} -> Maybe Text
rawContent) (\s :: BaiduMessage
s@BaiduMessage' {} Maybe Text
a -> BaiduMessage
s {$sel:rawContent:BaiduMessage' :: Maybe Text
rawContent = Maybe Text
a} :: BaiduMessage)

-- | The JSON data payload to use for the push notification, if the
-- notification is a silent push notification. This payload is added to the
-- data.pinpoint.jsonBody object of the notification.
baiduMessage_data :: Lens.Lens' BaiduMessage (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
baiduMessage_data :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> BaiduMessage -> f BaiduMessage
baiduMessage_data = (BaiduMessage -> Maybe (HashMap Text Text))
-> (BaiduMessage -> Maybe (HashMap Text Text) -> BaiduMessage)
-> Lens
     BaiduMessage
     BaiduMessage
     (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 (\BaiduMessage' {Maybe (HashMap Text Text)
data' :: Maybe (HashMap Text Text)
$sel:data':BaiduMessage' :: BaiduMessage -> Maybe (HashMap Text Text)
data'} -> Maybe (HashMap Text Text)
data') (\s :: BaiduMessage
s@BaiduMessage' {} Maybe (HashMap Text Text)
a -> BaiduMessage
s {$sel:data':BaiduMessage' :: Maybe (HashMap Text Text)
data' = Maybe (HashMap Text Text)
a} :: BaiduMessage) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> BaiduMessage -> f BaiduMessage)
-> ((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)))
-> BaiduMessage
-> f BaiduMessage
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 URL of the small icon image to display in the status bar and the
-- content view of the push notification.
baiduMessage_smallImageIconUrl :: Lens.Lens' BaiduMessage (Prelude.Maybe Prelude.Text)
baiduMessage_smallImageIconUrl :: (Maybe Text -> f (Maybe Text)) -> BaiduMessage -> f BaiduMessage
baiduMessage_smallImageIconUrl = (BaiduMessage -> Maybe Text)
-> (BaiduMessage -> Maybe Text -> BaiduMessage)
-> Lens BaiduMessage BaiduMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaiduMessage' {Maybe Text
smallImageIconUrl :: Maybe Text
$sel:smallImageIconUrl:BaiduMessage' :: BaiduMessage -> Maybe Text
smallImageIconUrl} -> Maybe Text
smallImageIconUrl) (\s :: BaiduMessage
s@BaiduMessage' {} Maybe Text
a -> BaiduMessage
s {$sel:smallImageIconUrl:BaiduMessage' :: Maybe Text
smallImageIconUrl = Maybe Text
a} :: BaiduMessage)

-- | The body of the notification message.
baiduMessage_body :: Lens.Lens' BaiduMessage (Prelude.Maybe Prelude.Text)
baiduMessage_body :: (Maybe Text -> f (Maybe Text)) -> BaiduMessage -> f BaiduMessage
baiduMessage_body = (BaiduMessage -> Maybe Text)
-> (BaiduMessage -> Maybe Text -> BaiduMessage)
-> Lens BaiduMessage BaiduMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaiduMessage' {Maybe Text
body :: Maybe Text
$sel:body:BaiduMessage' :: BaiduMessage -> Maybe Text
body} -> Maybe Text
body) (\s :: BaiduMessage
s@BaiduMessage' {} Maybe Text
a -> BaiduMessage
s {$sel:body:BaiduMessage' :: Maybe Text
body = Maybe Text
a} :: BaiduMessage)

-- | The amount of time, in seconds, that the Baidu Cloud Push service should
-- store the message if the recipient\'s device is offline. The default
-- value and maximum supported time is 604,800 seconds (7 days).
baiduMessage_timeToLive :: Lens.Lens' BaiduMessage (Prelude.Maybe Prelude.Int)
baiduMessage_timeToLive :: (Maybe Int -> f (Maybe Int)) -> BaiduMessage -> f BaiduMessage
baiduMessage_timeToLive = (BaiduMessage -> Maybe Int)
-> (BaiduMessage -> Maybe Int -> BaiduMessage)
-> Lens BaiduMessage BaiduMessage (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaiduMessage' {Maybe Int
timeToLive :: Maybe Int
$sel:timeToLive:BaiduMessage' :: BaiduMessage -> Maybe Int
timeToLive} -> Maybe Int
timeToLive) (\s :: BaiduMessage
s@BaiduMessage' {} Maybe Int
a -> BaiduMessage
s {$sel:timeToLive:BaiduMessage' :: Maybe Int
timeToLive = Maybe Int
a} :: BaiduMessage)

-- | The URL to open in the recipient\'s default mobile browser, if a
-- recipient taps the push notification and the value of the Action
-- property is URL.
baiduMessage_url :: Lens.Lens' BaiduMessage (Prelude.Maybe Prelude.Text)
baiduMessage_url :: (Maybe Text -> f (Maybe Text)) -> BaiduMessage -> f BaiduMessage
baiduMessage_url = (BaiduMessage -> Maybe Text)
-> (BaiduMessage -> Maybe Text -> BaiduMessage)
-> Lens BaiduMessage BaiduMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaiduMessage' {Maybe Text
url :: Maybe Text
$sel:url:BaiduMessage' :: BaiduMessage -> Maybe Text
url} -> Maybe Text
url) (\s :: BaiduMessage
s@BaiduMessage' {} Maybe Text
a -> BaiduMessage
s {$sel:url:BaiduMessage' :: Maybe Text
url = Maybe Text
a} :: BaiduMessage)

-- | The sound to play when the recipient receives the push notification. You
-- can use the default stream or specify the file name of a sound resource
-- that\'s bundled in your app. On an Android platform, the sound file must
-- reside in \/res\/raw\/.
baiduMessage_sound :: Lens.Lens' BaiduMessage (Prelude.Maybe Prelude.Text)
baiduMessage_sound :: (Maybe Text -> f (Maybe Text)) -> BaiduMessage -> f BaiduMessage
baiduMessage_sound = (BaiduMessage -> Maybe Text)
-> (BaiduMessage -> Maybe Text -> BaiduMessage)
-> Lens BaiduMessage BaiduMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaiduMessage' {Maybe Text
sound :: Maybe Text
$sel:sound:BaiduMessage' :: BaiduMessage -> Maybe Text
sound} -> Maybe Text
sound) (\s :: BaiduMessage
s@BaiduMessage' {} Maybe Text
a -> BaiduMessage
s {$sel:sound:BaiduMessage' :: Maybe Text
sound = Maybe Text
a} :: BaiduMessage)

-- | The action to occur if the 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 action uses the deep-linking features of the
--     Android platform.
--
-- -   URL - The default mobile browser on the recipient\'s device opens
--     and loads the web page at a URL that you specify.
baiduMessage_action :: Lens.Lens' BaiduMessage (Prelude.Maybe Action)
baiduMessage_action :: (Maybe Action -> f (Maybe Action))
-> BaiduMessage -> f BaiduMessage
baiduMessage_action = (BaiduMessage -> Maybe Action)
-> (BaiduMessage -> Maybe Action -> BaiduMessage)
-> Lens BaiduMessage BaiduMessage (Maybe Action) (Maybe Action)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaiduMessage' {Maybe Action
action :: Maybe Action
$sel:action:BaiduMessage' :: BaiduMessage -> Maybe Action
action} -> Maybe Action
action) (\s :: BaiduMessage
s@BaiduMessage' {} Maybe Action
a -> BaiduMessage
s {$sel:action:BaiduMessage' :: Maybe Action
action = Maybe Action
a} :: BaiduMessage)

-- | The URL of an image to display in the push notification.
baiduMessage_imageUrl :: Lens.Lens' BaiduMessage (Prelude.Maybe Prelude.Text)
baiduMessage_imageUrl :: (Maybe Text -> f (Maybe Text)) -> BaiduMessage -> f BaiduMessage
baiduMessage_imageUrl = (BaiduMessage -> Maybe Text)
-> (BaiduMessage -> Maybe Text -> BaiduMessage)
-> Lens BaiduMessage BaiduMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaiduMessage' {Maybe Text
imageUrl :: Maybe Text
$sel:imageUrl:BaiduMessage' :: BaiduMessage -> Maybe Text
imageUrl} -> Maybe Text
imageUrl) (\s :: BaiduMessage
s@BaiduMessage' {} Maybe Text
a -> BaiduMessage
s {$sel:imageUrl:BaiduMessage' :: Maybe Text
imageUrl = Maybe Text
a} :: BaiduMessage)

-- | The title to display above the notification message on the recipient\'s
-- device.
baiduMessage_title :: Lens.Lens' BaiduMessage (Prelude.Maybe Prelude.Text)
baiduMessage_title :: (Maybe Text -> f (Maybe Text)) -> BaiduMessage -> f BaiduMessage
baiduMessage_title = (BaiduMessage -> Maybe Text)
-> (BaiduMessage -> Maybe Text -> BaiduMessage)
-> Lens BaiduMessage BaiduMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaiduMessage' {Maybe Text
title :: Maybe Text
$sel:title:BaiduMessage' :: BaiduMessage -> Maybe Text
title} -> Maybe Text
title) (\s :: BaiduMessage
s@BaiduMessage' {} Maybe Text
a -> BaiduMessage
s {$sel:title:BaiduMessage' :: Maybe Text
title = Maybe Text
a} :: BaiduMessage)

-- | The icon image name of the asset saved in your app.
baiduMessage_iconReference :: Lens.Lens' BaiduMessage (Prelude.Maybe Prelude.Text)
baiduMessage_iconReference :: (Maybe Text -> f (Maybe Text)) -> BaiduMessage -> f BaiduMessage
baiduMessage_iconReference = (BaiduMessage -> Maybe Text)
-> (BaiduMessage -> Maybe Text -> BaiduMessage)
-> Lens BaiduMessage BaiduMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaiduMessage' {Maybe Text
iconReference :: Maybe Text
$sel:iconReference:BaiduMessage' :: BaiduMessage -> Maybe Text
iconReference} -> Maybe Text
iconReference) (\s :: BaiduMessage
s@BaiduMessage' {} Maybe Text
a -> BaiduMessage
s {$sel:iconReference:BaiduMessage' :: Maybe Text
iconReference = Maybe Text
a} :: BaiduMessage)

instance Prelude.Hashable BaiduMessage

instance Prelude.NFData BaiduMessage

instance Core.ToJSON BaiduMessage where
  toJSON :: BaiduMessage -> Value
toJSON BaiduMessage' {Maybe Bool
Maybe Int
Maybe Text
Maybe (HashMap Text [Text])
Maybe (HashMap Text Text)
Maybe Action
iconReference :: Maybe Text
title :: Maybe Text
imageUrl :: Maybe Text
action :: Maybe Action
sound :: Maybe Text
url :: Maybe Text
timeToLive :: Maybe Int
body :: Maybe Text
smallImageIconUrl :: Maybe Text
data' :: Maybe (HashMap Text Text)
rawContent :: Maybe Text
imageIconUrl :: Maybe Text
silentPush :: Maybe Bool
substitutions :: Maybe (HashMap Text [Text])
$sel:iconReference:BaiduMessage' :: BaiduMessage -> Maybe Text
$sel:title:BaiduMessage' :: BaiduMessage -> Maybe Text
$sel:imageUrl:BaiduMessage' :: BaiduMessage -> Maybe Text
$sel:action:BaiduMessage' :: BaiduMessage -> Maybe Action
$sel:sound:BaiduMessage' :: BaiduMessage -> Maybe Text
$sel:url:BaiduMessage' :: BaiduMessage -> Maybe Text
$sel:timeToLive:BaiduMessage' :: BaiduMessage -> Maybe Int
$sel:body:BaiduMessage' :: BaiduMessage -> Maybe Text
$sel:smallImageIconUrl:BaiduMessage' :: BaiduMessage -> Maybe Text
$sel:data':BaiduMessage' :: BaiduMessage -> Maybe (HashMap Text Text)
$sel:rawContent:BaiduMessage' :: BaiduMessage -> Maybe Text
$sel:imageIconUrl:BaiduMessage' :: BaiduMessage -> Maybe Text
$sel:silentPush:BaiduMessage' :: BaiduMessage -> Maybe Bool
$sel:substitutions:BaiduMessage' :: BaiduMessage -> 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
"ImageIconUrl" 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
imageIconUrl,
            (Text
"RawContent" 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
rawContent,
            (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
"SmallImageIconUrl" 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
smallImageIconUrl,
            (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
"TimeToLive" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
timeToLive,
            (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
"Sound" 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
sound,
            (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
"ImageUrl" 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
imageUrl,
            (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,
            (Text
"IconReference" 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
iconReference
          ]
      )