{-# 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.APNSPushNotificationTemplate
-- 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.APNSPushNotificationTemplate 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 APNs
-- (Apple Push Notification service) channel.
--
-- /See:/ 'newAPNSPushNotificationTemplate' smart constructor.
data APNSPushNotificationTemplate = APNSPushNotificationTemplate'
  { -- | 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 setting uses the deep-linking features of the iOS
    --     platform.
    --
    -- -   URL - The default mobile browser on the recipient\'s device opens
    --     and loads the web page at a URL that you specify.
    APNSPushNotificationTemplate -> Maybe Action
action :: Prelude.Maybe Action,
    -- | The message body to use in push notifications that are based on the
    -- message template.
    APNSPushNotificationTemplate -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
    -- | The URL of an image or video to display in push notifications that are
    -- based on the message template.
    APNSPushNotificationTemplate -> Maybe Text
mediaUrl :: Prelude.Maybe Prelude.Text,
    -- | The raw, JSON-formatted string to use as the payload for push
    -- notifications that are based on the message template. If specified, this
    -- value overrides all other content for the message template.
    APNSPushNotificationTemplate -> Maybe Text
rawContent :: Prelude.Maybe Prelude.Text,
    -- | The key for the sound to play when the recipient receives a push
    -- notification that\'s based on the message template. The value for this
    -- key is the name of a sound file in your app\'s main bundle or the
    -- Library\/Sounds folder in your app\'s data container. If the sound file
    -- can\'t be found or you specify default for the value, the system plays
    -- the default alert sound.
    APNSPushNotificationTemplate -> Maybe Text
sound :: Prelude.Maybe Prelude.Text,
    -- | The title to use in push notifications that are based on the message
    -- template. This title appears above the notification message on a
    -- recipient\'s device.
    APNSPushNotificationTemplate -> Maybe Text
title :: Prelude.Maybe Prelude.Text,
    -- | The URL to open in the 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.
    APNSPushNotificationTemplate -> Maybe Text
url :: Prelude.Maybe Prelude.Text
  }
  deriving (APNSPushNotificationTemplate
-> APNSPushNotificationTemplate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: APNSPushNotificationTemplate
-> APNSPushNotificationTemplate -> Bool
$c/= :: APNSPushNotificationTemplate
-> APNSPushNotificationTemplate -> Bool
== :: APNSPushNotificationTemplate
-> APNSPushNotificationTemplate -> Bool
$c== :: APNSPushNotificationTemplate
-> APNSPushNotificationTemplate -> Bool
Prelude.Eq, ReadPrec [APNSPushNotificationTemplate]
ReadPrec APNSPushNotificationTemplate
Int -> ReadS APNSPushNotificationTemplate
ReadS [APNSPushNotificationTemplate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [APNSPushNotificationTemplate]
$creadListPrec :: ReadPrec [APNSPushNotificationTemplate]
readPrec :: ReadPrec APNSPushNotificationTemplate
$creadPrec :: ReadPrec APNSPushNotificationTemplate
readList :: ReadS [APNSPushNotificationTemplate]
$creadList :: ReadS [APNSPushNotificationTemplate]
readsPrec :: Int -> ReadS APNSPushNotificationTemplate
$creadsPrec :: Int -> ReadS APNSPushNotificationTemplate
Prelude.Read, Int -> APNSPushNotificationTemplate -> ShowS
[APNSPushNotificationTemplate] -> ShowS
APNSPushNotificationTemplate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [APNSPushNotificationTemplate] -> ShowS
$cshowList :: [APNSPushNotificationTemplate] -> ShowS
show :: APNSPushNotificationTemplate -> String
$cshow :: APNSPushNotificationTemplate -> String
showsPrec :: Int -> APNSPushNotificationTemplate -> ShowS
$cshowsPrec :: Int -> APNSPushNotificationTemplate -> ShowS
Prelude.Show, forall x.
Rep APNSPushNotificationTemplate x -> APNSPushNotificationTemplate
forall x.
APNSPushNotificationTemplate -> Rep APNSPushNotificationTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep APNSPushNotificationTemplate x -> APNSPushNotificationTemplate
$cfrom :: forall x.
APNSPushNotificationTemplate -> Rep APNSPushNotificationTemplate x
Prelude.Generic)

-- |
-- Create a value of 'APNSPushNotificationTemplate' 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', 'aPNSPushNotificationTemplate_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 setting uses the deep-linking features of the iOS
--     platform.
--
-- -   URL - The default mobile browser on the recipient\'s device opens
--     and loads the web page at a URL that you specify.
--
-- 'body', 'aPNSPushNotificationTemplate_body' - The message body to use in push notifications that are based on the
-- message template.
--
-- 'mediaUrl', 'aPNSPushNotificationTemplate_mediaUrl' - The URL of an image or video to display in push notifications that are
-- based on the message template.
--
-- 'rawContent', 'aPNSPushNotificationTemplate_rawContent' - The raw, JSON-formatted string to use as the payload for push
-- notifications that are based on the message template. If specified, this
-- value overrides all other content for the message template.
--
-- 'sound', 'aPNSPushNotificationTemplate_sound' - The key for the sound to play when the recipient receives a push
-- notification that\'s based on the message template. The value for this
-- key is the name of a sound file in your app\'s main bundle or the
-- Library\/Sounds folder in your app\'s data container. If the sound file
-- can\'t be found or you specify default for the value, the system plays
-- the default alert sound.
--
-- 'title', 'aPNSPushNotificationTemplate_title' - The title to use in push notifications that are based on the message
-- template. This title appears above the notification message on a
-- recipient\'s device.
--
-- 'url', 'aPNSPushNotificationTemplate_url' - The URL to open in the 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.
newAPNSPushNotificationTemplate ::
  APNSPushNotificationTemplate
newAPNSPushNotificationTemplate :: APNSPushNotificationTemplate
newAPNSPushNotificationTemplate =
  APNSPushNotificationTemplate'
    { $sel:action:APNSPushNotificationTemplate' :: Maybe Action
action =
        forall a. Maybe a
Prelude.Nothing,
      $sel:body:APNSPushNotificationTemplate' :: Maybe Text
body = forall a. Maybe a
Prelude.Nothing,
      $sel:mediaUrl:APNSPushNotificationTemplate' :: Maybe Text
mediaUrl = forall a. Maybe a
Prelude.Nothing,
      $sel:rawContent:APNSPushNotificationTemplate' :: Maybe Text
rawContent = forall a. Maybe a
Prelude.Nothing,
      $sel:sound:APNSPushNotificationTemplate' :: Maybe Text
sound = forall a. Maybe a
Prelude.Nothing,
      $sel:title:APNSPushNotificationTemplate' :: Maybe Text
title = forall a. Maybe a
Prelude.Nothing,
      $sel:url:APNSPushNotificationTemplate' :: 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 setting uses the deep-linking features of the iOS
--     platform.
--
-- -   URL - The default mobile browser on the recipient\'s device opens
--     and loads the web page at a URL that you specify.
aPNSPushNotificationTemplate_action :: Lens.Lens' APNSPushNotificationTemplate (Prelude.Maybe Action)
aPNSPushNotificationTemplate_action :: Lens' APNSPushNotificationTemplate (Maybe Action)
aPNSPushNotificationTemplate_action = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSPushNotificationTemplate' {Maybe Action
action :: Maybe Action
$sel:action:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Action
action} -> Maybe Action
action) (\s :: APNSPushNotificationTemplate
s@APNSPushNotificationTemplate' {} Maybe Action
a -> APNSPushNotificationTemplate
s {$sel:action:APNSPushNotificationTemplate' :: Maybe Action
action = Maybe Action
a} :: APNSPushNotificationTemplate)

-- | The message body to use in push notifications that are based on the
-- message template.
aPNSPushNotificationTemplate_body :: Lens.Lens' APNSPushNotificationTemplate (Prelude.Maybe Prelude.Text)
aPNSPushNotificationTemplate_body :: Lens' APNSPushNotificationTemplate (Maybe Text)
aPNSPushNotificationTemplate_body = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSPushNotificationTemplate' {Maybe Text
body :: Maybe Text
$sel:body:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
body} -> Maybe Text
body) (\s :: APNSPushNotificationTemplate
s@APNSPushNotificationTemplate' {} Maybe Text
a -> APNSPushNotificationTemplate
s {$sel:body:APNSPushNotificationTemplate' :: Maybe Text
body = Maybe Text
a} :: APNSPushNotificationTemplate)

-- | The URL of an image or video to display in push notifications that are
-- based on the message template.
aPNSPushNotificationTemplate_mediaUrl :: Lens.Lens' APNSPushNotificationTemplate (Prelude.Maybe Prelude.Text)
aPNSPushNotificationTemplate_mediaUrl :: Lens' APNSPushNotificationTemplate (Maybe Text)
aPNSPushNotificationTemplate_mediaUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSPushNotificationTemplate' {Maybe Text
mediaUrl :: Maybe Text
$sel:mediaUrl:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
mediaUrl} -> Maybe Text
mediaUrl) (\s :: APNSPushNotificationTemplate
s@APNSPushNotificationTemplate' {} Maybe Text
a -> APNSPushNotificationTemplate
s {$sel:mediaUrl:APNSPushNotificationTemplate' :: Maybe Text
mediaUrl = Maybe Text
a} :: APNSPushNotificationTemplate)

-- | The raw, JSON-formatted string to use as the payload for push
-- notifications that are based on the message template. If specified, this
-- value overrides all other content for the message template.
aPNSPushNotificationTemplate_rawContent :: Lens.Lens' APNSPushNotificationTemplate (Prelude.Maybe Prelude.Text)
aPNSPushNotificationTemplate_rawContent :: Lens' APNSPushNotificationTemplate (Maybe Text)
aPNSPushNotificationTemplate_rawContent = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSPushNotificationTemplate' {Maybe Text
rawContent :: Maybe Text
$sel:rawContent:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
rawContent} -> Maybe Text
rawContent) (\s :: APNSPushNotificationTemplate
s@APNSPushNotificationTemplate' {} Maybe Text
a -> APNSPushNotificationTemplate
s {$sel:rawContent:APNSPushNotificationTemplate' :: Maybe Text
rawContent = Maybe Text
a} :: APNSPushNotificationTemplate)

-- | The key for the sound to play when the recipient receives a push
-- notification that\'s based on the message template. The value for this
-- key is the name of a sound file in your app\'s main bundle or the
-- Library\/Sounds folder in your app\'s data container. If the sound file
-- can\'t be found or you specify default for the value, the system plays
-- the default alert sound.
aPNSPushNotificationTemplate_sound :: Lens.Lens' APNSPushNotificationTemplate (Prelude.Maybe Prelude.Text)
aPNSPushNotificationTemplate_sound :: Lens' APNSPushNotificationTemplate (Maybe Text)
aPNSPushNotificationTemplate_sound = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSPushNotificationTemplate' {Maybe Text
sound :: Maybe Text
$sel:sound:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
sound} -> Maybe Text
sound) (\s :: APNSPushNotificationTemplate
s@APNSPushNotificationTemplate' {} Maybe Text
a -> APNSPushNotificationTemplate
s {$sel:sound:APNSPushNotificationTemplate' :: Maybe Text
sound = Maybe Text
a} :: APNSPushNotificationTemplate)

-- | The title to use in push notifications that are based on the message
-- template. This title appears above the notification message on a
-- recipient\'s device.
aPNSPushNotificationTemplate_title :: Lens.Lens' APNSPushNotificationTemplate (Prelude.Maybe Prelude.Text)
aPNSPushNotificationTemplate_title :: Lens' APNSPushNotificationTemplate (Maybe Text)
aPNSPushNotificationTemplate_title = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSPushNotificationTemplate' {Maybe Text
title :: Maybe Text
$sel:title:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
title} -> Maybe Text
title) (\s :: APNSPushNotificationTemplate
s@APNSPushNotificationTemplate' {} Maybe Text
a -> APNSPushNotificationTemplate
s {$sel:title:APNSPushNotificationTemplate' :: Maybe Text
title = Maybe Text
a} :: APNSPushNotificationTemplate)

-- | The URL to open in the 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.
aPNSPushNotificationTemplate_url :: Lens.Lens' APNSPushNotificationTemplate (Prelude.Maybe Prelude.Text)
aPNSPushNotificationTemplate_url :: Lens' APNSPushNotificationTemplate (Maybe Text)
aPNSPushNotificationTemplate_url = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSPushNotificationTemplate' {Maybe Text
url :: Maybe Text
$sel:url:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
url} -> Maybe Text
url) (\s :: APNSPushNotificationTemplate
s@APNSPushNotificationTemplate' {} Maybe Text
a -> APNSPushNotificationTemplate
s {$sel:url:APNSPushNotificationTemplate' :: Maybe Text
url = Maybe Text
a} :: APNSPushNotificationTemplate)

instance Data.FromJSON APNSPushNotificationTemplate where
  parseJSON :: Value -> Parser APNSPushNotificationTemplate
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"APNSPushNotificationTemplate"
      ( \Object
x ->
          Maybe Action
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> APNSPushNotificationTemplate
APNSPushNotificationTemplate'
            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
"MediaUrl")
            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
"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
    APNSPushNotificationTemplate
  where
  hashWithSalt :: Int -> APNSPushNotificationTemplate -> Int
hashWithSalt Int
_salt APNSPushNotificationTemplate' {Maybe Text
Maybe Action
url :: Maybe Text
title :: Maybe Text
sound :: Maybe Text
rawContent :: Maybe Text
mediaUrl :: Maybe Text
body :: Maybe Text
action :: Maybe Action
$sel:url:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:title:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:sound:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:rawContent:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:mediaUrl:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:body:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:action:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> 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
mediaUrl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
rawContent
      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 APNSPushNotificationTemplate where
  rnf :: APNSPushNotificationTemplate -> ()
rnf APNSPushNotificationTemplate' {Maybe Text
Maybe Action
url :: Maybe Text
title :: Maybe Text
sound :: Maybe Text
rawContent :: Maybe Text
mediaUrl :: Maybe Text
body :: Maybe Text
action :: Maybe Action
$sel:url:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:title:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:sound:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:rawContent:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:mediaUrl:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:body:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:action:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> 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
mediaUrl
      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
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 APNSPushNotificationTemplate where
  toJSON :: APNSPushNotificationTemplate -> Value
toJSON APNSPushNotificationTemplate' {Maybe Text
Maybe Action
url :: Maybe Text
title :: Maybe Text
sound :: Maybe Text
rawContent :: Maybe Text
mediaUrl :: Maybe Text
body :: Maybe Text
action :: Maybe Action
$sel:url:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:title:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:sound:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:rawContent:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:mediaUrl:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:body:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:action:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> 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
"MediaUrl" 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
mediaUrl,
            (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
"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
          ]
      )