{-# 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.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
data BaiduMessage = BaiduMessage'
{
BaiduMessage -> Maybe (HashMap Text [Text])
substitutions :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
BaiduMessage -> Maybe Bool
silentPush :: Prelude.Maybe Prelude.Bool,
BaiduMessage -> Maybe Text
imageIconUrl :: Prelude.Maybe Prelude.Text,
BaiduMessage -> Maybe Text
rawContent :: Prelude.Maybe Prelude.Text,
BaiduMessage -> Maybe (HashMap Text Text)
data' :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
BaiduMessage -> Maybe Text
smallImageIconUrl :: Prelude.Maybe Prelude.Text,
BaiduMessage -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
BaiduMessage -> Maybe Int
timeToLive :: Prelude.Maybe Prelude.Int,
BaiduMessage -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
BaiduMessage -> Maybe Text
sound :: Prelude.Maybe Prelude.Text,
BaiduMessage -> Maybe Action
action :: Prelude.Maybe Action,
BaiduMessage -> Maybe Text
imageUrl :: Prelude.Maybe Prelude.Text,
BaiduMessage -> Maybe Text
title :: Prelude.Maybe Prelude.Text,
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)
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
}
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
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)
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)
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)
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
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)
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)
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)
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)
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)
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)
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)
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)
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
]
)