{-# 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.AndroidPushNotificationTemplate 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 AndroidPushNotificationTemplate = AndroidPushNotificationTemplate'
{
AndroidPushNotificationTemplate -> Maybe Text
imageIconUrl :: Prelude.Maybe Prelude.Text,
AndroidPushNotificationTemplate -> Maybe Text
rawContent :: Prelude.Maybe Prelude.Text,
AndroidPushNotificationTemplate -> Maybe Text
smallImageIconUrl :: Prelude.Maybe Prelude.Text,
AndroidPushNotificationTemplate -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
AndroidPushNotificationTemplate -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
AndroidPushNotificationTemplate -> Maybe Text
sound :: Prelude.Maybe Prelude.Text,
AndroidPushNotificationTemplate -> Maybe Action
action :: Prelude.Maybe Action,
AndroidPushNotificationTemplate -> Maybe Text
imageUrl :: Prelude.Maybe Prelude.Text,
AndroidPushNotificationTemplate -> Maybe Text
title :: Prelude.Maybe Prelude.Text
}
deriving (AndroidPushNotificationTemplate
-> AndroidPushNotificationTemplate -> Bool
(AndroidPushNotificationTemplate
-> AndroidPushNotificationTemplate -> Bool)
-> (AndroidPushNotificationTemplate
-> AndroidPushNotificationTemplate -> Bool)
-> Eq AndroidPushNotificationTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AndroidPushNotificationTemplate
-> AndroidPushNotificationTemplate -> Bool
$c/= :: AndroidPushNotificationTemplate
-> AndroidPushNotificationTemplate -> Bool
== :: AndroidPushNotificationTemplate
-> AndroidPushNotificationTemplate -> Bool
$c== :: AndroidPushNotificationTemplate
-> AndroidPushNotificationTemplate -> Bool
Prelude.Eq, ReadPrec [AndroidPushNotificationTemplate]
ReadPrec AndroidPushNotificationTemplate
Int -> ReadS AndroidPushNotificationTemplate
ReadS [AndroidPushNotificationTemplate]
(Int -> ReadS AndroidPushNotificationTemplate)
-> ReadS [AndroidPushNotificationTemplate]
-> ReadPrec AndroidPushNotificationTemplate
-> ReadPrec [AndroidPushNotificationTemplate]
-> Read AndroidPushNotificationTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AndroidPushNotificationTemplate]
$creadListPrec :: ReadPrec [AndroidPushNotificationTemplate]
readPrec :: ReadPrec AndroidPushNotificationTemplate
$creadPrec :: ReadPrec AndroidPushNotificationTemplate
readList :: ReadS [AndroidPushNotificationTemplate]
$creadList :: ReadS [AndroidPushNotificationTemplate]
readsPrec :: Int -> ReadS AndroidPushNotificationTemplate
$creadsPrec :: Int -> ReadS AndroidPushNotificationTemplate
Prelude.Read, Int -> AndroidPushNotificationTemplate -> ShowS
[AndroidPushNotificationTemplate] -> ShowS
AndroidPushNotificationTemplate -> String
(Int -> AndroidPushNotificationTemplate -> ShowS)
-> (AndroidPushNotificationTemplate -> String)
-> ([AndroidPushNotificationTemplate] -> ShowS)
-> Show AndroidPushNotificationTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AndroidPushNotificationTemplate] -> ShowS
$cshowList :: [AndroidPushNotificationTemplate] -> ShowS
show :: AndroidPushNotificationTemplate -> String
$cshow :: AndroidPushNotificationTemplate -> String
showsPrec :: Int -> AndroidPushNotificationTemplate -> ShowS
$cshowsPrec :: Int -> AndroidPushNotificationTemplate -> ShowS
Prelude.Show, (forall x.
AndroidPushNotificationTemplate
-> Rep AndroidPushNotificationTemplate x)
-> (forall x.
Rep AndroidPushNotificationTemplate x
-> AndroidPushNotificationTemplate)
-> Generic AndroidPushNotificationTemplate
forall x.
Rep AndroidPushNotificationTemplate x
-> AndroidPushNotificationTemplate
forall x.
AndroidPushNotificationTemplate
-> Rep AndroidPushNotificationTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AndroidPushNotificationTemplate x
-> AndroidPushNotificationTemplate
$cfrom :: forall x.
AndroidPushNotificationTemplate
-> Rep AndroidPushNotificationTemplate x
Prelude.Generic)
newAndroidPushNotificationTemplate ::
AndroidPushNotificationTemplate
newAndroidPushNotificationTemplate :: AndroidPushNotificationTemplate
newAndroidPushNotificationTemplate =
AndroidPushNotificationTemplate' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> AndroidPushNotificationTemplate
AndroidPushNotificationTemplate'
{ $sel:imageIconUrl:AndroidPushNotificationTemplate' :: Maybe Text
imageIconUrl =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:rawContent:AndroidPushNotificationTemplate' :: Maybe Text
rawContent = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:smallImageIconUrl:AndroidPushNotificationTemplate' :: Maybe Text
smallImageIconUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:body:AndroidPushNotificationTemplate' :: Maybe Text
body = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:url:AndroidPushNotificationTemplate' :: Maybe Text
url = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sound:AndroidPushNotificationTemplate' :: Maybe Text
sound = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:action:AndroidPushNotificationTemplate' :: Maybe Action
action = Maybe Action
forall a. Maybe a
Prelude.Nothing,
$sel:imageUrl:AndroidPushNotificationTemplate' :: Maybe Text
imageUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:title:AndroidPushNotificationTemplate' :: Maybe Text
title = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
androidPushNotificationTemplate_imageIconUrl :: Lens.Lens' AndroidPushNotificationTemplate (Prelude.Maybe Prelude.Text)
androidPushNotificationTemplate_imageIconUrl :: (Maybe Text -> f (Maybe Text))
-> AndroidPushNotificationTemplate
-> f AndroidPushNotificationTemplate
androidPushNotificationTemplate_imageIconUrl = (AndroidPushNotificationTemplate -> Maybe Text)
-> (AndroidPushNotificationTemplate
-> Maybe Text -> AndroidPushNotificationTemplate)
-> Lens
AndroidPushNotificationTemplate
AndroidPushNotificationTemplate
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AndroidPushNotificationTemplate' {Maybe Text
imageIconUrl :: Maybe Text
$sel:imageIconUrl:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
imageIconUrl} -> Maybe Text
imageIconUrl) (\s :: AndroidPushNotificationTemplate
s@AndroidPushNotificationTemplate' {} Maybe Text
a -> AndroidPushNotificationTemplate
s {$sel:imageIconUrl:AndroidPushNotificationTemplate' :: Maybe Text
imageIconUrl = Maybe Text
a} :: AndroidPushNotificationTemplate)
androidPushNotificationTemplate_rawContent :: Lens.Lens' AndroidPushNotificationTemplate (Prelude.Maybe Prelude.Text)
androidPushNotificationTemplate_rawContent :: (Maybe Text -> f (Maybe Text))
-> AndroidPushNotificationTemplate
-> f AndroidPushNotificationTemplate
androidPushNotificationTemplate_rawContent = (AndroidPushNotificationTemplate -> Maybe Text)
-> (AndroidPushNotificationTemplate
-> Maybe Text -> AndroidPushNotificationTemplate)
-> Lens
AndroidPushNotificationTemplate
AndroidPushNotificationTemplate
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AndroidPushNotificationTemplate' {Maybe Text
rawContent :: Maybe Text
$sel:rawContent:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
rawContent} -> Maybe Text
rawContent) (\s :: AndroidPushNotificationTemplate
s@AndroidPushNotificationTemplate' {} Maybe Text
a -> AndroidPushNotificationTemplate
s {$sel:rawContent:AndroidPushNotificationTemplate' :: Maybe Text
rawContent = Maybe Text
a} :: AndroidPushNotificationTemplate)
androidPushNotificationTemplate_smallImageIconUrl :: Lens.Lens' AndroidPushNotificationTemplate (Prelude.Maybe Prelude.Text)
androidPushNotificationTemplate_smallImageIconUrl :: (Maybe Text -> f (Maybe Text))
-> AndroidPushNotificationTemplate
-> f AndroidPushNotificationTemplate
androidPushNotificationTemplate_smallImageIconUrl = (AndroidPushNotificationTemplate -> Maybe Text)
-> (AndroidPushNotificationTemplate
-> Maybe Text -> AndroidPushNotificationTemplate)
-> Lens
AndroidPushNotificationTemplate
AndroidPushNotificationTemplate
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AndroidPushNotificationTemplate' {Maybe Text
smallImageIconUrl :: Maybe Text
$sel:smallImageIconUrl:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
smallImageIconUrl} -> Maybe Text
smallImageIconUrl) (\s :: AndroidPushNotificationTemplate
s@AndroidPushNotificationTemplate' {} Maybe Text
a -> AndroidPushNotificationTemplate
s {$sel:smallImageIconUrl:AndroidPushNotificationTemplate' :: Maybe Text
smallImageIconUrl = Maybe Text
a} :: AndroidPushNotificationTemplate)
androidPushNotificationTemplate_body :: Lens.Lens' AndroidPushNotificationTemplate (Prelude.Maybe Prelude.Text)
androidPushNotificationTemplate_body :: (Maybe Text -> f (Maybe Text))
-> AndroidPushNotificationTemplate
-> f AndroidPushNotificationTemplate
androidPushNotificationTemplate_body = (AndroidPushNotificationTemplate -> Maybe Text)
-> (AndroidPushNotificationTemplate
-> Maybe Text -> AndroidPushNotificationTemplate)
-> Lens
AndroidPushNotificationTemplate
AndroidPushNotificationTemplate
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AndroidPushNotificationTemplate' {Maybe Text
body :: Maybe Text
$sel:body:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
body} -> Maybe Text
body) (\s :: AndroidPushNotificationTemplate
s@AndroidPushNotificationTemplate' {} Maybe Text
a -> AndroidPushNotificationTemplate
s {$sel:body:AndroidPushNotificationTemplate' :: Maybe Text
body = Maybe Text
a} :: AndroidPushNotificationTemplate)
androidPushNotificationTemplate_url :: Lens.Lens' AndroidPushNotificationTemplate (Prelude.Maybe Prelude.Text)
androidPushNotificationTemplate_url :: (Maybe Text -> f (Maybe Text))
-> AndroidPushNotificationTemplate
-> f AndroidPushNotificationTemplate
androidPushNotificationTemplate_url = (AndroidPushNotificationTemplate -> Maybe Text)
-> (AndroidPushNotificationTemplate
-> Maybe Text -> AndroidPushNotificationTemplate)
-> Lens
AndroidPushNotificationTemplate
AndroidPushNotificationTemplate
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AndroidPushNotificationTemplate' {Maybe Text
url :: Maybe Text
$sel:url:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
url} -> Maybe Text
url) (\s :: AndroidPushNotificationTemplate
s@AndroidPushNotificationTemplate' {} Maybe Text
a -> AndroidPushNotificationTemplate
s {$sel:url:AndroidPushNotificationTemplate' :: Maybe Text
url = Maybe Text
a} :: AndroidPushNotificationTemplate)
androidPushNotificationTemplate_sound :: Lens.Lens' AndroidPushNotificationTemplate (Prelude.Maybe Prelude.Text)
androidPushNotificationTemplate_sound :: (Maybe Text -> f (Maybe Text))
-> AndroidPushNotificationTemplate
-> f AndroidPushNotificationTemplate
androidPushNotificationTemplate_sound = (AndroidPushNotificationTemplate -> Maybe Text)
-> (AndroidPushNotificationTemplate
-> Maybe Text -> AndroidPushNotificationTemplate)
-> Lens
AndroidPushNotificationTemplate
AndroidPushNotificationTemplate
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AndroidPushNotificationTemplate' {Maybe Text
sound :: Maybe Text
$sel:sound:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
sound} -> Maybe Text
sound) (\s :: AndroidPushNotificationTemplate
s@AndroidPushNotificationTemplate' {} Maybe Text
a -> AndroidPushNotificationTemplate
s {$sel:sound:AndroidPushNotificationTemplate' :: Maybe Text
sound = Maybe Text
a} :: AndroidPushNotificationTemplate)
androidPushNotificationTemplate_action :: Lens.Lens' AndroidPushNotificationTemplate (Prelude.Maybe Action)
androidPushNotificationTemplate_action :: (Maybe Action -> f (Maybe Action))
-> AndroidPushNotificationTemplate
-> f AndroidPushNotificationTemplate
androidPushNotificationTemplate_action = (AndroidPushNotificationTemplate -> Maybe Action)
-> (AndroidPushNotificationTemplate
-> Maybe Action -> AndroidPushNotificationTemplate)
-> Lens
AndroidPushNotificationTemplate
AndroidPushNotificationTemplate
(Maybe Action)
(Maybe Action)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AndroidPushNotificationTemplate' {Maybe Action
action :: Maybe Action
$sel:action:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Action
action} -> Maybe Action
action) (\s :: AndroidPushNotificationTemplate
s@AndroidPushNotificationTemplate' {} Maybe Action
a -> AndroidPushNotificationTemplate
s {$sel:action:AndroidPushNotificationTemplate' :: Maybe Action
action = Maybe Action
a} :: AndroidPushNotificationTemplate)
androidPushNotificationTemplate_imageUrl :: Lens.Lens' AndroidPushNotificationTemplate (Prelude.Maybe Prelude.Text)
androidPushNotificationTemplate_imageUrl :: (Maybe Text -> f (Maybe Text))
-> AndroidPushNotificationTemplate
-> f AndroidPushNotificationTemplate
androidPushNotificationTemplate_imageUrl = (AndroidPushNotificationTemplate -> Maybe Text)
-> (AndroidPushNotificationTemplate
-> Maybe Text -> AndroidPushNotificationTemplate)
-> Lens
AndroidPushNotificationTemplate
AndroidPushNotificationTemplate
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AndroidPushNotificationTemplate' {Maybe Text
imageUrl :: Maybe Text
$sel:imageUrl:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
imageUrl} -> Maybe Text
imageUrl) (\s :: AndroidPushNotificationTemplate
s@AndroidPushNotificationTemplate' {} Maybe Text
a -> AndroidPushNotificationTemplate
s {$sel:imageUrl:AndroidPushNotificationTemplate' :: Maybe Text
imageUrl = Maybe Text
a} :: AndroidPushNotificationTemplate)
androidPushNotificationTemplate_title :: Lens.Lens' AndroidPushNotificationTemplate (Prelude.Maybe Prelude.Text)
androidPushNotificationTemplate_title :: (Maybe Text -> f (Maybe Text))
-> AndroidPushNotificationTemplate
-> f AndroidPushNotificationTemplate
androidPushNotificationTemplate_title = (AndroidPushNotificationTemplate -> Maybe Text)
-> (AndroidPushNotificationTemplate
-> Maybe Text -> AndroidPushNotificationTemplate)
-> Lens
AndroidPushNotificationTemplate
AndroidPushNotificationTemplate
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AndroidPushNotificationTemplate' {Maybe Text
title :: Maybe Text
$sel:title:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
title} -> Maybe Text
title) (\s :: AndroidPushNotificationTemplate
s@AndroidPushNotificationTemplate' {} Maybe Text
a -> AndroidPushNotificationTemplate
s {$sel:title:AndroidPushNotificationTemplate' :: Maybe Text
title = Maybe Text
a} :: AndroidPushNotificationTemplate)
instance
Core.FromJSON
AndroidPushNotificationTemplate
where
parseJSON :: Value -> Parser AndroidPushNotificationTemplate
parseJSON =
String
-> (Object -> Parser AndroidPushNotificationTemplate)
-> Value
-> Parser AndroidPushNotificationTemplate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AndroidPushNotificationTemplate"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> AndroidPushNotificationTemplate
AndroidPushNotificationTemplate'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> AndroidPushNotificationTemplate)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> AndroidPushNotificationTemplate)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ImageIconUrl")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> AndroidPushNotificationTemplate)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> AndroidPushNotificationTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RawContent")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> AndroidPushNotificationTemplate)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> AndroidPushNotificationTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SmallImageIconUrl")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> AndroidPushNotificationTemplate)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> AndroidPushNotificationTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Body")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> AndroidPushNotificationTemplate)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> AndroidPushNotificationTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Url")
Parser
(Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> AndroidPushNotificationTemplate)
-> Parser (Maybe Text)
-> Parser
(Maybe Action
-> Maybe Text -> Maybe Text -> AndroidPushNotificationTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Sound")
Parser
(Maybe Action
-> Maybe Text -> Maybe Text -> AndroidPushNotificationTemplate)
-> Parser (Maybe Action)
-> Parser
(Maybe Text -> Maybe Text -> AndroidPushNotificationTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Action)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Action")
Parser
(Maybe Text -> Maybe Text -> AndroidPushNotificationTemplate)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AndroidPushNotificationTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ImageUrl")
Parser (Maybe Text -> AndroidPushNotificationTemplate)
-> Parser (Maybe Text) -> Parser AndroidPushNotificationTemplate
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Title")
)
instance
Prelude.Hashable
AndroidPushNotificationTemplate
instance
Prelude.NFData
AndroidPushNotificationTemplate
instance Core.ToJSON AndroidPushNotificationTemplate where
toJSON :: AndroidPushNotificationTemplate -> Value
toJSON AndroidPushNotificationTemplate' {Maybe Text
Maybe Action
title :: Maybe Text
imageUrl :: Maybe Text
action :: Maybe Action
sound :: Maybe Text
url :: Maybe Text
body :: Maybe Text
smallImageIconUrl :: Maybe Text
rawContent :: Maybe Text
imageIconUrl :: Maybe Text
$sel:title:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:imageUrl:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:action:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Action
$sel:sound:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:url:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:body:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:smallImageIconUrl:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:rawContent:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:imageIconUrl:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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
"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
"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
]
)