{-# 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.AndroidPushNotificationTemplate
-- 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.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

-- | Specifies channel-specific content and settings for a message template
-- that can be used in push notifications that are sent through the ADM
-- (Amazon Device Messaging), Baidu (Baidu Cloud Push), or GCM (Firebase
-- Cloud Messaging, formerly Google Cloud Messaging) channel.
--
-- /See:/ 'newAndroidPushNotificationTemplate' smart constructor.
data AndroidPushNotificationTemplate = AndroidPushNotificationTemplate'
  { -- | The URL of the large icon image to display in the content view of a push
    -- notification that\'s based on the message template.
    AndroidPushNotificationTemplate -> Maybe Text
imageIconUrl :: Prelude.Maybe Prelude.Text,
    -- | The raw, JSON-formatted string to use as the payload for a push
    -- notification that\'s based on the message template. If specified, this
    -- value overrides all other content for the message template.
    AndroidPushNotificationTemplate -> Maybe Text
rawContent :: Prelude.Maybe Prelude.Text,
    -- | The URL of the small icon image to display in the status bar and the
    -- content view of a push notification that\'s based on the message
    -- template.
    AndroidPushNotificationTemplate -> Maybe Text
smallImageIconUrl :: Prelude.Maybe Prelude.Text,
    -- | The message body to use in a push notification that\'s based on the
    -- message template.
    AndroidPushNotificationTemplate -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
    -- | The URL to open in a recipient\'s default mobile browser, if a recipient
    -- taps a push notification that\'s based on the message template and the
    -- value of the Action property is URL.
    AndroidPushNotificationTemplate -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
    -- | The sound to play when a recipient receives a push notification that\'s
    -- based on the message template. 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\/.
    AndroidPushNotificationTemplate -> Maybe Text
sound :: Prelude.Maybe Prelude.Text,
    -- | The action to occur if a recipient taps a push notification that\'s
    -- based on the message template. 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.
    AndroidPushNotificationTemplate -> Maybe Action
action :: Prelude.Maybe Action,
    -- | The URL of an image to display in a push notification that\'s based on
    -- the message template.
    AndroidPushNotificationTemplate -> Maybe Text
imageUrl :: Prelude.Maybe Prelude.Text,
    -- | The title to use in a push notification that\'s based on the message
    -- template. This title appears above the notification message on a
    -- recipient\'s device.
    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)

-- |
-- Create a value of 'AndroidPushNotificationTemplate' 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:
--
-- 'imageIconUrl', 'androidPushNotificationTemplate_imageIconUrl' - The URL of the large icon image to display in the content view of a push
-- notification that\'s based on the message template.
--
-- 'rawContent', 'androidPushNotificationTemplate_rawContent' - The raw, JSON-formatted string to use as the payload for a push
-- notification that\'s based on the message template. If specified, this
-- value overrides all other content for the message template.
--
-- 'smallImageIconUrl', 'androidPushNotificationTemplate_smallImageIconUrl' - The URL of the small icon image to display in the status bar and the
-- content view of a push notification that\'s based on the message
-- template.
--
-- 'body', 'androidPushNotificationTemplate_body' - The message body to use in a push notification that\'s based on the
-- message template.
--
-- 'url', 'androidPushNotificationTemplate_url' - The URL to open in a recipient\'s default mobile browser, if a recipient
-- taps a push notification that\'s based on the message template and the
-- value of the Action property is URL.
--
-- 'sound', 'androidPushNotificationTemplate_sound' - The sound to play when a recipient receives a push notification that\'s
-- based on the message template. 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', 'androidPushNotificationTemplate_action' - The action to occur if a recipient taps a push notification that\'s
-- based on the message template. 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', 'androidPushNotificationTemplate_imageUrl' - The URL of an image to display in a push notification that\'s based on
-- the message template.
--
-- 'title', 'androidPushNotificationTemplate_title' - The title to use in a push notification that\'s based on the message
-- template. This title appears above the notification message on a
-- recipient\'s device.
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
    }

-- | The URL of the large icon image to display in the content view of a push
-- notification that\'s based on the message template.
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)

-- | The raw, JSON-formatted string to use as the payload for a push
-- notification that\'s based on the message template. If specified, this
-- value overrides all other content for the message template.
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)

-- | The URL of the small icon image to display in the status bar and the
-- content view of a push notification that\'s based on the message
-- template.
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)

-- | The message body to use in a push notification that\'s based on the
-- message template.
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)

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

-- | The sound to play when a recipient receives a push notification that\'s
-- based on the message template. 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\/.
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)

-- | The action to occur if a recipient taps a push notification that\'s
-- based on the message template. 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.
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)

-- | The URL of an image to display in a push notification that\'s based on
-- the message template.
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)

-- | The title to use in a push notification that\'s based on the message
-- template. This title appears above the notification message on a
-- recipient\'s device.
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
          ]
      )