{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Pinpoint.Types.AndroidPushNotificationTemplate where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 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 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 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 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 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 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 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,
    -- | 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
  }
  deriving (AndroidPushNotificationTemplate
-> AndroidPushNotificationTemplate -> Bool
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]
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
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.
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:
--
-- '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.
--
-- 'body', 'androidPushNotificationTemplate_body' - The message body to use in a push notification that\'s based on the
-- message template.
--
-- '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.
--
-- 'imageUrl', 'androidPushNotificationTemplate_imageUrl' - The URL of an image to display in 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.
--
-- '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\/.
--
-- '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.
--
-- '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.
newAndroidPushNotificationTemplate ::
  AndroidPushNotificationTemplate
newAndroidPushNotificationTemplate :: AndroidPushNotificationTemplate
newAndroidPushNotificationTemplate =
  AndroidPushNotificationTemplate'
    { $sel:action:AndroidPushNotificationTemplate' :: Maybe Action
action =
        forall a. Maybe a
Prelude.Nothing,
      $sel:body:AndroidPushNotificationTemplate' :: Maybe Text
body = forall a. Maybe a
Prelude.Nothing,
      $sel:imageIconUrl:AndroidPushNotificationTemplate' :: Maybe Text
imageIconUrl = forall a. Maybe a
Prelude.Nothing,
      $sel:imageUrl:AndroidPushNotificationTemplate' :: Maybe Text
imageUrl = forall a. Maybe a
Prelude.Nothing,
      $sel:rawContent:AndroidPushNotificationTemplate' :: Maybe Text
rawContent = forall a. Maybe a
Prelude.Nothing,
      $sel:smallImageIconUrl:AndroidPushNotificationTemplate' :: Maybe Text
smallImageIconUrl = forall a. Maybe a
Prelude.Nothing,
      $sel:sound:AndroidPushNotificationTemplate' :: Maybe Text
sound = forall a. Maybe a
Prelude.Nothing,
      $sel:title:AndroidPushNotificationTemplate' :: Maybe Text
title = forall a. Maybe a
Prelude.Nothing,
      $sel:url:AndroidPushNotificationTemplate' :: Maybe Text
url = forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: Lens' AndroidPushNotificationTemplate (Maybe Action)
androidPushNotificationTemplate_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 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 :: Lens' AndroidPushNotificationTemplate (Maybe Text)
androidPushNotificationTemplate_body = 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 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 :: Lens' AndroidPushNotificationTemplate (Maybe Text)
androidPushNotificationTemplate_imageIconUrl = 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 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 :: Lens' AndroidPushNotificationTemplate (Maybe Text)
androidPushNotificationTemplate_imageUrl = 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 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 :: Lens' AndroidPushNotificationTemplate (Maybe Text)
androidPushNotificationTemplate_rawContent = 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 :: Lens' AndroidPushNotificationTemplate (Maybe Text)
androidPushNotificationTemplate_smallImageIconUrl = 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 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 :: Lens' AndroidPushNotificationTemplate (Maybe Text)
androidPushNotificationTemplate_sound = 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 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 :: Lens' AndroidPushNotificationTemplate (Maybe Text)
androidPushNotificationTemplate_title = 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)

-- | 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 :: Lens' AndroidPushNotificationTemplate (Maybe Text)
androidPushNotificationTemplate_url = 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)

instance
  Data.FromJSON
    AndroidPushNotificationTemplate
  where
  parseJSON :: Value -> Parser AndroidPushNotificationTemplate
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AndroidPushNotificationTemplate"
      ( \Object
x ->
          Maybe Action
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AndroidPushNotificationTemplate
AndroidPushNotificationTemplate'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Action")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Body")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ImageIconUrl")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ImageUrl")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RawContent")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SmallImageIconUrl")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Sound")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Title")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Url")
      )

instance
  Prelude.Hashable
    AndroidPushNotificationTemplate
  where
  hashWithSalt :: Int -> AndroidPushNotificationTemplate -> Int
hashWithSalt
    Int
_salt
    AndroidPushNotificationTemplate' {Maybe Text
Maybe Action
url :: Maybe Text
title :: Maybe Text
sound :: Maybe Text
smallImageIconUrl :: Maybe Text
rawContent :: Maybe Text
imageUrl :: Maybe Text
imageIconUrl :: Maybe Text
body :: Maybe Text
action :: Maybe Action
$sel:url:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:title:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:sound:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:smallImageIconUrl:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:rawContent:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:imageUrl:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:imageIconUrl:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:body:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:action:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Action
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Action
action
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
body
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
imageIconUrl
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
imageUrl
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
rawContent
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
smallImageIconUrl
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sound
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
title
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
url

instance
  Prelude.NFData
    AndroidPushNotificationTemplate
  where
  rnf :: AndroidPushNotificationTemplate -> ()
rnf AndroidPushNotificationTemplate' {Maybe Text
Maybe Action
url :: Maybe Text
title :: Maybe Text
sound :: Maybe Text
smallImageIconUrl :: Maybe Text
rawContent :: Maybe Text
imageUrl :: Maybe Text
imageIconUrl :: Maybe Text
body :: Maybe Text
action :: Maybe Action
$sel:url:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:title:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:sound:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:smallImageIconUrl:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:rawContent:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:imageUrl:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:imageIconUrl:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:body:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:action:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Action
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Action
action
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
body
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
imageIconUrl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
imageUrl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
rawContent
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
smallImageIconUrl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sound
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
title
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
url

instance Data.ToJSON AndroidPushNotificationTemplate where
  toJSON :: AndroidPushNotificationTemplate -> Value
toJSON AndroidPushNotificationTemplate' {Maybe Text
Maybe Action
url :: Maybe Text
title :: Maybe Text
sound :: Maybe Text
smallImageIconUrl :: Maybe Text
rawContent :: Maybe Text
imageUrl :: Maybe Text
imageIconUrl :: Maybe Text
body :: Maybe Text
action :: Maybe Action
$sel:url:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:title:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:sound:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:smallImageIconUrl:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:rawContent:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:imageUrl:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:imageIconUrl:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:body:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Text
$sel:action:AndroidPushNotificationTemplate' :: AndroidPushNotificationTemplate -> Maybe Action
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Action" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Action
action,
            (Key
"Body" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
body,
            (Key
"ImageIconUrl" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
imageIconUrl,
            (Key
"ImageUrl" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
imageUrl,
            (Key
"RawContent" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
rawContent,
            (Key
"SmallImageIconUrl" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
smallImageIconUrl,
            (Key
"Sound" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sound,
            (Key
"Title" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
title,
            (Key
"Url" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
url
          ]
      )