{-# 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.APNSMessage
-- 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.APNSMessage 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 the settings for a one-time message that\'s sent directly to
-- an endpoint through the APNs (Apple Push Notification service) channel.
--
-- /See:/ 'newAPNSMessage' smart constructor.
data APNSMessage = APNSMessage'
  { -- | The type of push notification to send. Valid values are:
    --
    -- -   alert - For a standard notification that\'s displayed on
    --     recipients\' devices and prompts a recipient to interact with the
    --     notification.
    --
    -- -   background - For a silent notification that delivers content in the
    --     background and isn\'t displayed on recipients\' devices.
    --
    -- -   complication - For a notification that contains update information
    --     for an app’s complication timeline.
    --
    -- -   fileprovider - For a notification that signals changes to a File
    --     Provider extension.
    --
    -- -   mdm - For a notification that tells managed devices to contact the
    --     MDM server.
    --
    -- -   voip - For a notification that provides information about an
    --     incoming VoIP call.
    --
    -- Amazon Pinpoint specifies this value in the apns-push-type request
    -- header when it sends the notification message to APNs. If you don\'t
    -- specify a value for this property, Amazon Pinpoint sets the value to
    -- alert or background automatically, based on the value that you specify
    -- for the SilentPush or RawContent property of the message.
    --
    -- For more information about the apns-push-type request header, see
    -- <https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns Sending Notification Requests to APNs>
    -- on the Apple Developer website.
    APNSMessage -> Maybe Text
aPNSPushType :: Prelude.Maybe Prelude.Text,
    -- | The action to occur if the recipient taps the push notification. 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.
    APNSMessage -> Maybe Action
action :: Prelude.Maybe Action,
    -- | The key that indicates whether and how to modify the badge of your
    -- app\'s icon when the recipient receives the push notification. If this
    -- key isn\'t included in the dictionary, the badge doesn\'t change. To
    -- remove the badge, set this value to 0.
    APNSMessage -> Maybe Int
badge :: Prelude.Maybe Prelude.Int,
    -- | The body of the notification message.
    APNSMessage -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
    -- | The key that indicates the notification type for the push notification.
    -- This key is a value that\'s defined by the identifier property of one of
    -- your app\'s registered categories.
    APNSMessage -> Maybe Text
category :: Prelude.Maybe Prelude.Text,
    -- | An arbitrary identifier that, if assigned to multiple messages, APNs
    -- uses to coalesce the messages into a single push notification instead of
    -- delivering each message individually. This value can\'t exceed 64 bytes.
    --
    -- Amazon Pinpoint specifies this value in the apns-collapse-id request
    -- header when it sends the notification message to APNs.
    APNSMessage -> Maybe Text
collapseId :: Prelude.Maybe Prelude.Text,
    -- | The JSON payload to use for a silent push notification. This payload is
    -- added to the data.pinpoint.jsonBody object of the notification.
    APNSMessage -> Maybe (HashMap Text Text)
data' :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The URL of an image or video to display in the push notification.
    APNSMessage -> Maybe Text
mediaUrl :: Prelude.Maybe Prelude.Text,
    -- | The authentication method that you want Amazon Pinpoint to use when
    -- authenticating with APNs, CERTIFICATE or TOKEN.
    APNSMessage -> Maybe Text
preferredAuthenticationMethod :: Prelude.Maybe Prelude.Text,
    -- | para>5 - Low priority, the notification might be delayed, delivered as
    -- part of a group, or throttled.
    --
    -- \/listitem>
    --
    -- 10 - High priority, the notification is sent immediately. This is the
    -- default value. A high priority notification should trigger an alert,
    -- play a sound, or badge your app\'s icon on the recipient\'s device.
    --
    -- \/para>
    --
    -- Amazon Pinpoint specifies this value in the apns-priority request header
    -- when it sends the notification message to APNs.
    --
    -- The equivalent values for Firebase Cloud Messaging (FCM), formerly
    -- Google Cloud Messaging (GCM), are normal, for 5, and high, for 10. If
    -- you specify an FCM value for this property, Amazon Pinpoint accepts and
    -- converts the value to the corresponding APNs value.
    APNSMessage -> Maybe Text
priority :: Prelude.Maybe Prelude.Text,
    -- | The raw, JSON-formatted string to use as the payload for the
    -- notification message. If specified, this value overrides all other
    -- content for the message.
    --
    -- If you specify the raw content of an APNs push notification, the message
    -- payload has to include the content-available key. The value of the
    -- content-available key has to be an integer, and can only be 0 or 1. If
    -- you\'re sending a standard notification, set the value of
    -- content-available to 0. If you\'re sending a silent (background)
    -- notification, set the value of content-available to 1. Additionally,
    -- silent notification payloads can\'t include the alert, badge, or sound
    -- keys. For more information, see
    -- <https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification Generating a Remote Notification>
    -- and
    -- <https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app Pushing Background Updates to Your App>
    -- on the Apple Developer website.
    APNSMessage -> Maybe Text
rawContent :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether the notification is a silent push notification. A
    -- silent (or background) push notification isn\'t displayed on
    -- recipients\' devices. You can use silent push notifications to make
    -- small updates to your app, or to display messages in an in-app message
    -- center.
    --
    -- Amazon Pinpoint uses this property to determine the correct value for
    -- the apns-push-type request header when it sends the notification message
    -- to APNs. If you specify a value of true for this property, Amazon
    -- Pinpoint sets the value for the apns-push-type header field to
    -- background.
    --
    -- If you specify the raw content of an APNs push notification, the message
    -- payload has to include the content-available key. For silent
    -- (background) notifications, set the value of content-available to 1.
    -- Additionally, the message payload for a silent notification can\'t
    -- include the alert, badge, or sound keys. For more information, see
    -- <https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification Generating a Remote Notification>
    -- and
    -- <https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app Pushing Background Updates to Your App>
    -- on the Apple Developer website.
    --
    -- Apple has indicated that they will throttle \"excessive\" background
    -- notifications based on current traffic volumes. To prevent your
    -- notifications being throttled, Apple recommends that you send no more
    -- than 3 silent push notifications to each recipient per hour.
    APNSMessage -> Maybe Bool
silentPush :: Prelude.Maybe Prelude.Bool,
    -- | The key for the sound to play when the recipient receives the push
    -- notification. 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.
    APNSMessage -> Maybe Text
sound :: Prelude.Maybe Prelude.Text,
    -- | The default message variables to use in the notification message. You
    -- can override these default variables with individual address variables.
    APNSMessage -> Maybe (HashMap Text [Text])
substitutions :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
    -- | The key that represents your app-specific identifier for grouping
    -- notifications. If you provide a Notification Content app extension, you
    -- can use this value to group your notifications together.
    APNSMessage -> Maybe Text
threadId :: Prelude.Maybe Prelude.Text,
    -- | The amount of time, in seconds, that APNs should store and attempt to
    -- deliver the push notification, if the service is unable to deliver the
    -- notification the first time. If this value is 0, APNs treats the
    -- notification as if it expires immediately and the service doesn\'t store
    -- or try to deliver the notification again.
    --
    -- Amazon Pinpoint specifies this value in the apns-expiration request
    -- header when it sends the notification message to APNs.
    APNSMessage -> Maybe Int
timeToLive :: Prelude.Maybe Prelude.Int,
    -- | The title to display above the notification message on the recipient\'s
    -- device.
    APNSMessage -> Maybe Text
title :: Prelude.Maybe Prelude.Text,
    -- | The URL to open in the recipient\'s default mobile browser, if a
    -- recipient taps the push notification and the value of the Action
    -- property is URL.
    APNSMessage -> Maybe Text
url :: Prelude.Maybe Prelude.Text
  }
  deriving (APNSMessage -> APNSMessage -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: APNSMessage -> APNSMessage -> Bool
$c/= :: APNSMessage -> APNSMessage -> Bool
== :: APNSMessage -> APNSMessage -> Bool
$c== :: APNSMessage -> APNSMessage -> Bool
Prelude.Eq, ReadPrec [APNSMessage]
ReadPrec APNSMessage
Int -> ReadS APNSMessage
ReadS [APNSMessage]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [APNSMessage]
$creadListPrec :: ReadPrec [APNSMessage]
readPrec :: ReadPrec APNSMessage
$creadPrec :: ReadPrec APNSMessage
readList :: ReadS [APNSMessage]
$creadList :: ReadS [APNSMessage]
readsPrec :: Int -> ReadS APNSMessage
$creadsPrec :: Int -> ReadS APNSMessage
Prelude.Read, Int -> APNSMessage -> ShowS
[APNSMessage] -> ShowS
APNSMessage -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [APNSMessage] -> ShowS
$cshowList :: [APNSMessage] -> ShowS
show :: APNSMessage -> String
$cshow :: APNSMessage -> String
showsPrec :: Int -> APNSMessage -> ShowS
$cshowsPrec :: Int -> APNSMessage -> ShowS
Prelude.Show, forall x. Rep APNSMessage x -> APNSMessage
forall x. APNSMessage -> Rep APNSMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep APNSMessage x -> APNSMessage
$cfrom :: forall x. APNSMessage -> Rep APNSMessage x
Prelude.Generic)

-- |
-- Create a value of 'APNSMessage' 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:
--
-- 'aPNSPushType', 'aPNSMessage_aPNSPushType' - The type of push notification to send. Valid values are:
--
-- -   alert - For a standard notification that\'s displayed on
--     recipients\' devices and prompts a recipient to interact with the
--     notification.
--
-- -   background - For a silent notification that delivers content in the
--     background and isn\'t displayed on recipients\' devices.
--
-- -   complication - For a notification that contains update information
--     for an app’s complication timeline.
--
-- -   fileprovider - For a notification that signals changes to a File
--     Provider extension.
--
-- -   mdm - For a notification that tells managed devices to contact the
--     MDM server.
--
-- -   voip - For a notification that provides information about an
--     incoming VoIP call.
--
-- Amazon Pinpoint specifies this value in the apns-push-type request
-- header when it sends the notification message to APNs. If you don\'t
-- specify a value for this property, Amazon Pinpoint sets the value to
-- alert or background automatically, based on the value that you specify
-- for the SilentPush or RawContent property of the message.
--
-- For more information about the apns-push-type request header, see
-- <https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns Sending Notification Requests to APNs>
-- on the Apple Developer website.
--
-- 'action', 'aPNSMessage_action' - The action to occur if the recipient taps the push notification. 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.
--
-- 'badge', 'aPNSMessage_badge' - The key that indicates whether and how to modify the badge of your
-- app\'s icon when the recipient receives the push notification. If this
-- key isn\'t included in the dictionary, the badge doesn\'t change. To
-- remove the badge, set this value to 0.
--
-- 'body', 'aPNSMessage_body' - The body of the notification message.
--
-- 'category', 'aPNSMessage_category' - The key that indicates the notification type for the push notification.
-- This key is a value that\'s defined by the identifier property of one of
-- your app\'s registered categories.
--
-- 'collapseId', 'aPNSMessage_collapseId' - An arbitrary identifier that, if assigned to multiple messages, APNs
-- uses to coalesce the messages into a single push notification instead of
-- delivering each message individually. This value can\'t exceed 64 bytes.
--
-- Amazon Pinpoint specifies this value in the apns-collapse-id request
-- header when it sends the notification message to APNs.
--
-- 'data'', 'aPNSMessage_data' - The JSON payload to use for a silent push notification. This payload is
-- added to the data.pinpoint.jsonBody object of the notification.
--
-- 'mediaUrl', 'aPNSMessage_mediaUrl' - The URL of an image or video to display in the push notification.
--
-- 'preferredAuthenticationMethod', 'aPNSMessage_preferredAuthenticationMethod' - The authentication method that you want Amazon Pinpoint to use when
-- authenticating with APNs, CERTIFICATE or TOKEN.
--
-- 'priority', 'aPNSMessage_priority' - para>5 - Low priority, the notification might be delayed, delivered as
-- part of a group, or throttled.
--
-- \/listitem>
--
-- 10 - High priority, the notification is sent immediately. This is the
-- default value. A high priority notification should trigger an alert,
-- play a sound, or badge your app\'s icon on the recipient\'s device.
--
-- \/para>
--
-- Amazon Pinpoint specifies this value in the apns-priority request header
-- when it sends the notification message to APNs.
--
-- The equivalent values for Firebase Cloud Messaging (FCM), formerly
-- Google Cloud Messaging (GCM), are normal, for 5, and high, for 10. If
-- you specify an FCM value for this property, Amazon Pinpoint accepts and
-- converts the value to the corresponding APNs value.
--
-- 'rawContent', 'aPNSMessage_rawContent' - The raw, JSON-formatted string to use as the payload for the
-- notification message. If specified, this value overrides all other
-- content for the message.
--
-- If you specify the raw content of an APNs push notification, the message
-- payload has to include the content-available key. The value of the
-- content-available key has to be an integer, and can only be 0 or 1. If
-- you\'re sending a standard notification, set the value of
-- content-available to 0. If you\'re sending a silent (background)
-- notification, set the value of content-available to 1. Additionally,
-- silent notification payloads can\'t include the alert, badge, or sound
-- keys. For more information, see
-- <https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification Generating a Remote Notification>
-- and
-- <https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app Pushing Background Updates to Your App>
-- on the Apple Developer website.
--
-- 'silentPush', 'aPNSMessage_silentPush' - Specifies whether the notification is a silent push notification. A
-- silent (or background) push notification isn\'t displayed on
-- recipients\' devices. You can use silent push notifications to make
-- small updates to your app, or to display messages in an in-app message
-- center.
--
-- Amazon Pinpoint uses this property to determine the correct value for
-- the apns-push-type request header when it sends the notification message
-- to APNs. If you specify a value of true for this property, Amazon
-- Pinpoint sets the value for the apns-push-type header field to
-- background.
--
-- If you specify the raw content of an APNs push notification, the message
-- payload has to include the content-available key. For silent
-- (background) notifications, set the value of content-available to 1.
-- Additionally, the message payload for a silent notification can\'t
-- include the alert, badge, or sound keys. For more information, see
-- <https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification Generating a Remote Notification>
-- and
-- <https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app Pushing Background Updates to Your App>
-- on the Apple Developer website.
--
-- Apple has indicated that they will throttle \"excessive\" background
-- notifications based on current traffic volumes. To prevent your
-- notifications being throttled, Apple recommends that you send no more
-- than 3 silent push notifications to each recipient per hour.
--
-- 'sound', 'aPNSMessage_sound' - The key for the sound to play when the recipient receives the push
-- notification. 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.
--
-- 'substitutions', 'aPNSMessage_substitutions' - The default message variables to use in the notification message. You
-- can override these default variables with individual address variables.
--
-- 'threadId', 'aPNSMessage_threadId' - The key that represents your app-specific identifier for grouping
-- notifications. If you provide a Notification Content app extension, you
-- can use this value to group your notifications together.
--
-- 'timeToLive', 'aPNSMessage_timeToLive' - The amount of time, in seconds, that APNs should store and attempt to
-- deliver the push notification, if the service is unable to deliver the
-- notification the first time. If this value is 0, APNs treats the
-- notification as if it expires immediately and the service doesn\'t store
-- or try to deliver the notification again.
--
-- Amazon Pinpoint specifies this value in the apns-expiration request
-- header when it sends the notification message to APNs.
--
-- 'title', 'aPNSMessage_title' - The title to display above the notification message on the recipient\'s
-- device.
--
-- 'url', 'aPNSMessage_url' - The URL to open in the recipient\'s default mobile browser, if a
-- recipient taps the push notification and the value of the Action
-- property is URL.
newAPNSMessage ::
  APNSMessage
newAPNSMessage :: APNSMessage
newAPNSMessage =
  APNSMessage'
    { $sel:aPNSPushType:APNSMessage' :: Maybe Text
aPNSPushType = forall a. Maybe a
Prelude.Nothing,
      $sel:action:APNSMessage' :: Maybe Action
action = forall a. Maybe a
Prelude.Nothing,
      $sel:badge:APNSMessage' :: Maybe Int
badge = forall a. Maybe a
Prelude.Nothing,
      $sel:body:APNSMessage' :: Maybe Text
body = forall a. Maybe a
Prelude.Nothing,
      $sel:category:APNSMessage' :: Maybe Text
category = forall a. Maybe a
Prelude.Nothing,
      $sel:collapseId:APNSMessage' :: Maybe Text
collapseId = forall a. Maybe a
Prelude.Nothing,
      $sel:data':APNSMessage' :: Maybe (HashMap Text Text)
data' = forall a. Maybe a
Prelude.Nothing,
      $sel:mediaUrl:APNSMessage' :: Maybe Text
mediaUrl = forall a. Maybe a
Prelude.Nothing,
      $sel:preferredAuthenticationMethod:APNSMessage' :: Maybe Text
preferredAuthenticationMethod = forall a. Maybe a
Prelude.Nothing,
      $sel:priority:APNSMessage' :: Maybe Text
priority = forall a. Maybe a
Prelude.Nothing,
      $sel:rawContent:APNSMessage' :: Maybe Text
rawContent = forall a. Maybe a
Prelude.Nothing,
      $sel:silentPush:APNSMessage' :: Maybe Bool
silentPush = forall a. Maybe a
Prelude.Nothing,
      $sel:sound:APNSMessage' :: Maybe Text
sound = forall a. Maybe a
Prelude.Nothing,
      $sel:substitutions:APNSMessage' :: Maybe (HashMap Text [Text])
substitutions = forall a. Maybe a
Prelude.Nothing,
      $sel:threadId:APNSMessage' :: Maybe Text
threadId = forall a. Maybe a
Prelude.Nothing,
      $sel:timeToLive:APNSMessage' :: Maybe Int
timeToLive = forall a. Maybe a
Prelude.Nothing,
      $sel:title:APNSMessage' :: Maybe Text
title = forall a. Maybe a
Prelude.Nothing,
      $sel:url:APNSMessage' :: Maybe Text
url = forall a. Maybe a
Prelude.Nothing
    }

-- | The type of push notification to send. Valid values are:
--
-- -   alert - For a standard notification that\'s displayed on
--     recipients\' devices and prompts a recipient to interact with the
--     notification.
--
-- -   background - For a silent notification that delivers content in the
--     background and isn\'t displayed on recipients\' devices.
--
-- -   complication - For a notification that contains update information
--     for an app’s complication timeline.
--
-- -   fileprovider - For a notification that signals changes to a File
--     Provider extension.
--
-- -   mdm - For a notification that tells managed devices to contact the
--     MDM server.
--
-- -   voip - For a notification that provides information about an
--     incoming VoIP call.
--
-- Amazon Pinpoint specifies this value in the apns-push-type request
-- header when it sends the notification message to APNs. If you don\'t
-- specify a value for this property, Amazon Pinpoint sets the value to
-- alert or background automatically, based on the value that you specify
-- for the SilentPush or RawContent property of the message.
--
-- For more information about the apns-push-type request header, see
-- <https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns Sending Notification Requests to APNs>
-- on the Apple Developer website.
aPNSMessage_aPNSPushType :: Lens.Lens' APNSMessage (Prelude.Maybe Prelude.Text)
aPNSMessage_aPNSPushType :: Lens' APNSMessage (Maybe Text)
aPNSMessage_aPNSPushType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSMessage' {Maybe Text
aPNSPushType :: Maybe Text
$sel:aPNSPushType:APNSMessage' :: APNSMessage -> Maybe Text
aPNSPushType} -> Maybe Text
aPNSPushType) (\s :: APNSMessage
s@APNSMessage' {} Maybe Text
a -> APNSMessage
s {$sel:aPNSPushType:APNSMessage' :: Maybe Text
aPNSPushType = Maybe Text
a} :: APNSMessage)

-- | The action to occur if the recipient taps the push notification. 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.
aPNSMessage_action :: Lens.Lens' APNSMessage (Prelude.Maybe Action)
aPNSMessage_action :: Lens' APNSMessage (Maybe Action)
aPNSMessage_action = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSMessage' {Maybe Action
action :: Maybe Action
$sel:action:APNSMessage' :: APNSMessage -> Maybe Action
action} -> Maybe Action
action) (\s :: APNSMessage
s@APNSMessage' {} Maybe Action
a -> APNSMessage
s {$sel:action:APNSMessage' :: Maybe Action
action = Maybe Action
a} :: APNSMessage)

-- | The key that indicates whether and how to modify the badge of your
-- app\'s icon when the recipient receives the push notification. If this
-- key isn\'t included in the dictionary, the badge doesn\'t change. To
-- remove the badge, set this value to 0.
aPNSMessage_badge :: Lens.Lens' APNSMessage (Prelude.Maybe Prelude.Int)
aPNSMessage_badge :: Lens' APNSMessage (Maybe Int)
aPNSMessage_badge = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSMessage' {Maybe Int
badge :: Maybe Int
$sel:badge:APNSMessage' :: APNSMessage -> Maybe Int
badge} -> Maybe Int
badge) (\s :: APNSMessage
s@APNSMessage' {} Maybe Int
a -> APNSMessage
s {$sel:badge:APNSMessage' :: Maybe Int
badge = Maybe Int
a} :: APNSMessage)

-- | The body of the notification message.
aPNSMessage_body :: Lens.Lens' APNSMessage (Prelude.Maybe Prelude.Text)
aPNSMessage_body :: Lens' APNSMessage (Maybe Text)
aPNSMessage_body = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSMessage' {Maybe Text
body :: Maybe Text
$sel:body:APNSMessage' :: APNSMessage -> Maybe Text
body} -> Maybe Text
body) (\s :: APNSMessage
s@APNSMessage' {} Maybe Text
a -> APNSMessage
s {$sel:body:APNSMessage' :: Maybe Text
body = Maybe Text
a} :: APNSMessage)

-- | The key that indicates the notification type for the push notification.
-- This key is a value that\'s defined by the identifier property of one of
-- your app\'s registered categories.
aPNSMessage_category :: Lens.Lens' APNSMessage (Prelude.Maybe Prelude.Text)
aPNSMessage_category :: Lens' APNSMessage (Maybe Text)
aPNSMessage_category = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSMessage' {Maybe Text
category :: Maybe Text
$sel:category:APNSMessage' :: APNSMessage -> Maybe Text
category} -> Maybe Text
category) (\s :: APNSMessage
s@APNSMessage' {} Maybe Text
a -> APNSMessage
s {$sel:category:APNSMessage' :: Maybe Text
category = Maybe Text
a} :: APNSMessage)

-- | An arbitrary identifier that, if assigned to multiple messages, APNs
-- uses to coalesce the messages into a single push notification instead of
-- delivering each message individually. This value can\'t exceed 64 bytes.
--
-- Amazon Pinpoint specifies this value in the apns-collapse-id request
-- header when it sends the notification message to APNs.
aPNSMessage_collapseId :: Lens.Lens' APNSMessage (Prelude.Maybe Prelude.Text)
aPNSMessage_collapseId :: Lens' APNSMessage (Maybe Text)
aPNSMessage_collapseId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSMessage' {Maybe Text
collapseId :: Maybe Text
$sel:collapseId:APNSMessage' :: APNSMessage -> Maybe Text
collapseId} -> Maybe Text
collapseId) (\s :: APNSMessage
s@APNSMessage' {} Maybe Text
a -> APNSMessage
s {$sel:collapseId:APNSMessage' :: Maybe Text
collapseId = Maybe Text
a} :: APNSMessage)

-- | The JSON payload to use for a silent push notification. This payload is
-- added to the data.pinpoint.jsonBody object of the notification.
aPNSMessage_data :: Lens.Lens' APNSMessage (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
aPNSMessage_data :: Lens' APNSMessage (Maybe (HashMap Text Text))
aPNSMessage_data = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSMessage' {Maybe (HashMap Text Text)
data' :: Maybe (HashMap Text Text)
$sel:data':APNSMessage' :: APNSMessage -> Maybe (HashMap Text Text)
data'} -> Maybe (HashMap Text Text)
data') (\s :: APNSMessage
s@APNSMessage' {} Maybe (HashMap Text Text)
a -> APNSMessage
s {$sel:data':APNSMessage' :: Maybe (HashMap Text Text)
data' = Maybe (HashMap Text Text)
a} :: APNSMessage) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The URL of an image or video to display in the push notification.
aPNSMessage_mediaUrl :: Lens.Lens' APNSMessage (Prelude.Maybe Prelude.Text)
aPNSMessage_mediaUrl :: Lens' APNSMessage (Maybe Text)
aPNSMessage_mediaUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSMessage' {Maybe Text
mediaUrl :: Maybe Text
$sel:mediaUrl:APNSMessage' :: APNSMessage -> Maybe Text
mediaUrl} -> Maybe Text
mediaUrl) (\s :: APNSMessage
s@APNSMessage' {} Maybe Text
a -> APNSMessage
s {$sel:mediaUrl:APNSMessage' :: Maybe Text
mediaUrl = Maybe Text
a} :: APNSMessage)

-- | The authentication method that you want Amazon Pinpoint to use when
-- authenticating with APNs, CERTIFICATE or TOKEN.
aPNSMessage_preferredAuthenticationMethod :: Lens.Lens' APNSMessage (Prelude.Maybe Prelude.Text)
aPNSMessage_preferredAuthenticationMethod :: Lens' APNSMessage (Maybe Text)
aPNSMessage_preferredAuthenticationMethod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSMessage' {Maybe Text
preferredAuthenticationMethod :: Maybe Text
$sel:preferredAuthenticationMethod:APNSMessage' :: APNSMessage -> Maybe Text
preferredAuthenticationMethod} -> Maybe Text
preferredAuthenticationMethod) (\s :: APNSMessage
s@APNSMessage' {} Maybe Text
a -> APNSMessage
s {$sel:preferredAuthenticationMethod:APNSMessage' :: Maybe Text
preferredAuthenticationMethod = Maybe Text
a} :: APNSMessage)

-- | para>5 - Low priority, the notification might be delayed, delivered as
-- part of a group, or throttled.
--
-- \/listitem>
--
-- 10 - High priority, the notification is sent immediately. This is the
-- default value. A high priority notification should trigger an alert,
-- play a sound, or badge your app\'s icon on the recipient\'s device.
--
-- \/para>
--
-- Amazon Pinpoint specifies this value in the apns-priority request header
-- when it sends the notification message to APNs.
--
-- The equivalent values for Firebase Cloud Messaging (FCM), formerly
-- Google Cloud Messaging (GCM), are normal, for 5, and high, for 10. If
-- you specify an FCM value for this property, Amazon Pinpoint accepts and
-- converts the value to the corresponding APNs value.
aPNSMessage_priority :: Lens.Lens' APNSMessage (Prelude.Maybe Prelude.Text)
aPNSMessage_priority :: Lens' APNSMessage (Maybe Text)
aPNSMessage_priority = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSMessage' {Maybe Text
priority :: Maybe Text
$sel:priority:APNSMessage' :: APNSMessage -> Maybe Text
priority} -> Maybe Text
priority) (\s :: APNSMessage
s@APNSMessage' {} Maybe Text
a -> APNSMessage
s {$sel:priority:APNSMessage' :: Maybe Text
priority = Maybe Text
a} :: APNSMessage)

-- | The raw, JSON-formatted string to use as the payload for the
-- notification message. If specified, this value overrides all other
-- content for the message.
--
-- If you specify the raw content of an APNs push notification, the message
-- payload has to include the content-available key. The value of the
-- content-available key has to be an integer, and can only be 0 or 1. If
-- you\'re sending a standard notification, set the value of
-- content-available to 0. If you\'re sending a silent (background)
-- notification, set the value of content-available to 1. Additionally,
-- silent notification payloads can\'t include the alert, badge, or sound
-- keys. For more information, see
-- <https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification Generating a Remote Notification>
-- and
-- <https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app Pushing Background Updates to Your App>
-- on the Apple Developer website.
aPNSMessage_rawContent :: Lens.Lens' APNSMessage (Prelude.Maybe Prelude.Text)
aPNSMessage_rawContent :: Lens' APNSMessage (Maybe Text)
aPNSMessage_rawContent = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSMessage' {Maybe Text
rawContent :: Maybe Text
$sel:rawContent:APNSMessage' :: APNSMessage -> Maybe Text
rawContent} -> Maybe Text
rawContent) (\s :: APNSMessage
s@APNSMessage' {} Maybe Text
a -> APNSMessage
s {$sel:rawContent:APNSMessage' :: Maybe Text
rawContent = Maybe Text
a} :: APNSMessage)

-- | Specifies whether the notification is a silent push notification. A
-- silent (or background) push notification isn\'t displayed on
-- recipients\' devices. You can use silent push notifications to make
-- small updates to your app, or to display messages in an in-app message
-- center.
--
-- Amazon Pinpoint uses this property to determine the correct value for
-- the apns-push-type request header when it sends the notification message
-- to APNs. If you specify a value of true for this property, Amazon
-- Pinpoint sets the value for the apns-push-type header field to
-- background.
--
-- If you specify the raw content of an APNs push notification, the message
-- payload has to include the content-available key. For silent
-- (background) notifications, set the value of content-available to 1.
-- Additionally, the message payload for a silent notification can\'t
-- include the alert, badge, or sound keys. For more information, see
-- <https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification Generating a Remote Notification>
-- and
-- <https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app Pushing Background Updates to Your App>
-- on the Apple Developer website.
--
-- Apple has indicated that they will throttle \"excessive\" background
-- notifications based on current traffic volumes. To prevent your
-- notifications being throttled, Apple recommends that you send no more
-- than 3 silent push notifications to each recipient per hour.
aPNSMessage_silentPush :: Lens.Lens' APNSMessage (Prelude.Maybe Prelude.Bool)
aPNSMessage_silentPush :: Lens' APNSMessage (Maybe Bool)
aPNSMessage_silentPush = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSMessage' {Maybe Bool
silentPush :: Maybe Bool
$sel:silentPush:APNSMessage' :: APNSMessage -> Maybe Bool
silentPush} -> Maybe Bool
silentPush) (\s :: APNSMessage
s@APNSMessage' {} Maybe Bool
a -> APNSMessage
s {$sel:silentPush:APNSMessage' :: Maybe Bool
silentPush = Maybe Bool
a} :: APNSMessage)

-- | The key for the sound to play when the recipient receives the push
-- notification. 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.
aPNSMessage_sound :: Lens.Lens' APNSMessage (Prelude.Maybe Prelude.Text)
aPNSMessage_sound :: Lens' APNSMessage (Maybe Text)
aPNSMessage_sound = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSMessage' {Maybe Text
sound :: Maybe Text
$sel:sound:APNSMessage' :: APNSMessage -> Maybe Text
sound} -> Maybe Text
sound) (\s :: APNSMessage
s@APNSMessage' {} Maybe Text
a -> APNSMessage
s {$sel:sound:APNSMessage' :: Maybe Text
sound = Maybe Text
a} :: APNSMessage)

-- | The default message variables to use in the notification message. You
-- can override these default variables with individual address variables.
aPNSMessage_substitutions :: Lens.Lens' APNSMessage (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
aPNSMessage_substitutions :: Lens' APNSMessage (Maybe (HashMap Text [Text]))
aPNSMessage_substitutions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSMessage' {Maybe (HashMap Text [Text])
substitutions :: Maybe (HashMap Text [Text])
$sel:substitutions:APNSMessage' :: APNSMessage -> Maybe (HashMap Text [Text])
substitutions} -> Maybe (HashMap Text [Text])
substitutions) (\s :: APNSMessage
s@APNSMessage' {} Maybe (HashMap Text [Text])
a -> APNSMessage
s {$sel:substitutions:APNSMessage' :: Maybe (HashMap Text [Text])
substitutions = Maybe (HashMap Text [Text])
a} :: APNSMessage) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The key that represents your app-specific identifier for grouping
-- notifications. If you provide a Notification Content app extension, you
-- can use this value to group your notifications together.
aPNSMessage_threadId :: Lens.Lens' APNSMessage (Prelude.Maybe Prelude.Text)
aPNSMessage_threadId :: Lens' APNSMessage (Maybe Text)
aPNSMessage_threadId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSMessage' {Maybe Text
threadId :: Maybe Text
$sel:threadId:APNSMessage' :: APNSMessage -> Maybe Text
threadId} -> Maybe Text
threadId) (\s :: APNSMessage
s@APNSMessage' {} Maybe Text
a -> APNSMessage
s {$sel:threadId:APNSMessage' :: Maybe Text
threadId = Maybe Text
a} :: APNSMessage)

-- | The amount of time, in seconds, that APNs should store and attempt to
-- deliver the push notification, if the service is unable to deliver the
-- notification the first time. If this value is 0, APNs treats the
-- notification as if it expires immediately and the service doesn\'t store
-- or try to deliver the notification again.
--
-- Amazon Pinpoint specifies this value in the apns-expiration request
-- header when it sends the notification message to APNs.
aPNSMessage_timeToLive :: Lens.Lens' APNSMessage (Prelude.Maybe Prelude.Int)
aPNSMessage_timeToLive :: Lens' APNSMessage (Maybe Int)
aPNSMessage_timeToLive = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSMessage' {Maybe Int
timeToLive :: Maybe Int
$sel:timeToLive:APNSMessage' :: APNSMessage -> Maybe Int
timeToLive} -> Maybe Int
timeToLive) (\s :: APNSMessage
s@APNSMessage' {} Maybe Int
a -> APNSMessage
s {$sel:timeToLive:APNSMessage' :: Maybe Int
timeToLive = Maybe Int
a} :: APNSMessage)

-- | The title to display above the notification message on the recipient\'s
-- device.
aPNSMessage_title :: Lens.Lens' APNSMessage (Prelude.Maybe Prelude.Text)
aPNSMessage_title :: Lens' APNSMessage (Maybe Text)
aPNSMessage_title = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSMessage' {Maybe Text
title :: Maybe Text
$sel:title:APNSMessage' :: APNSMessage -> Maybe Text
title} -> Maybe Text
title) (\s :: APNSMessage
s@APNSMessage' {} Maybe Text
a -> APNSMessage
s {$sel:title:APNSMessage' :: Maybe Text
title = Maybe Text
a} :: APNSMessage)

-- | The URL to open in the recipient\'s default mobile browser, if a
-- recipient taps the push notification and the value of the Action
-- property is URL.
aPNSMessage_url :: Lens.Lens' APNSMessage (Prelude.Maybe Prelude.Text)
aPNSMessage_url :: Lens' APNSMessage (Maybe Text)
aPNSMessage_url = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSMessage' {Maybe Text
url :: Maybe Text
$sel:url:APNSMessage' :: APNSMessage -> Maybe Text
url} -> Maybe Text
url) (\s :: APNSMessage
s@APNSMessage' {} Maybe Text
a -> APNSMessage
s {$sel:url:APNSMessage' :: Maybe Text
url = Maybe Text
a} :: APNSMessage)

instance Prelude.Hashable APNSMessage where
  hashWithSalt :: Int -> APNSMessage -> Int
hashWithSalt Int
_salt APNSMessage' {Maybe Bool
Maybe Int
Maybe Text
Maybe (HashMap Text [Text])
Maybe (HashMap Text Text)
Maybe Action
url :: Maybe Text
title :: Maybe Text
timeToLive :: Maybe Int
threadId :: Maybe Text
substitutions :: Maybe (HashMap Text [Text])
sound :: Maybe Text
silentPush :: Maybe Bool
rawContent :: Maybe Text
priority :: Maybe Text
preferredAuthenticationMethod :: Maybe Text
mediaUrl :: Maybe Text
data' :: Maybe (HashMap Text Text)
collapseId :: Maybe Text
category :: Maybe Text
body :: Maybe Text
badge :: Maybe Int
action :: Maybe Action
aPNSPushType :: Maybe Text
$sel:url:APNSMessage' :: APNSMessage -> Maybe Text
$sel:title:APNSMessage' :: APNSMessage -> Maybe Text
$sel:timeToLive:APNSMessage' :: APNSMessage -> Maybe Int
$sel:threadId:APNSMessage' :: APNSMessage -> Maybe Text
$sel:substitutions:APNSMessage' :: APNSMessage -> Maybe (HashMap Text [Text])
$sel:sound:APNSMessage' :: APNSMessage -> Maybe Text
$sel:silentPush:APNSMessage' :: APNSMessage -> Maybe Bool
$sel:rawContent:APNSMessage' :: APNSMessage -> Maybe Text
$sel:priority:APNSMessage' :: APNSMessage -> Maybe Text
$sel:preferredAuthenticationMethod:APNSMessage' :: APNSMessage -> Maybe Text
$sel:mediaUrl:APNSMessage' :: APNSMessage -> Maybe Text
$sel:data':APNSMessage' :: APNSMessage -> Maybe (HashMap Text Text)
$sel:collapseId:APNSMessage' :: APNSMessage -> Maybe Text
$sel:category:APNSMessage' :: APNSMessage -> Maybe Text
$sel:body:APNSMessage' :: APNSMessage -> Maybe Text
$sel:badge:APNSMessage' :: APNSMessage -> Maybe Int
$sel:action:APNSMessage' :: APNSMessage -> Maybe Action
$sel:aPNSPushType:APNSMessage' :: APNSMessage -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
aPNSPushType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Action
action
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
badge
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
body
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
category
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
collapseId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
data'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
mediaUrl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
preferredAuthenticationMethod
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
priority
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
rawContent
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
silentPush
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sound
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text [Text])
substitutions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
threadId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
timeToLive
      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 APNSMessage where
  rnf :: APNSMessage -> ()
rnf APNSMessage' {Maybe Bool
Maybe Int
Maybe Text
Maybe (HashMap Text [Text])
Maybe (HashMap Text Text)
Maybe Action
url :: Maybe Text
title :: Maybe Text
timeToLive :: Maybe Int
threadId :: Maybe Text
substitutions :: Maybe (HashMap Text [Text])
sound :: Maybe Text
silentPush :: Maybe Bool
rawContent :: Maybe Text
priority :: Maybe Text
preferredAuthenticationMethod :: Maybe Text
mediaUrl :: Maybe Text
data' :: Maybe (HashMap Text Text)
collapseId :: Maybe Text
category :: Maybe Text
body :: Maybe Text
badge :: Maybe Int
action :: Maybe Action
aPNSPushType :: Maybe Text
$sel:url:APNSMessage' :: APNSMessage -> Maybe Text
$sel:title:APNSMessage' :: APNSMessage -> Maybe Text
$sel:timeToLive:APNSMessage' :: APNSMessage -> Maybe Int
$sel:threadId:APNSMessage' :: APNSMessage -> Maybe Text
$sel:substitutions:APNSMessage' :: APNSMessage -> Maybe (HashMap Text [Text])
$sel:sound:APNSMessage' :: APNSMessage -> Maybe Text
$sel:silentPush:APNSMessage' :: APNSMessage -> Maybe Bool
$sel:rawContent:APNSMessage' :: APNSMessage -> Maybe Text
$sel:priority:APNSMessage' :: APNSMessage -> Maybe Text
$sel:preferredAuthenticationMethod:APNSMessage' :: APNSMessage -> Maybe Text
$sel:mediaUrl:APNSMessage' :: APNSMessage -> Maybe Text
$sel:data':APNSMessage' :: APNSMessage -> Maybe (HashMap Text Text)
$sel:collapseId:APNSMessage' :: APNSMessage -> Maybe Text
$sel:category:APNSMessage' :: APNSMessage -> Maybe Text
$sel:body:APNSMessage' :: APNSMessage -> Maybe Text
$sel:badge:APNSMessage' :: APNSMessage -> Maybe Int
$sel:action:APNSMessage' :: APNSMessage -> Maybe Action
$sel:aPNSPushType:APNSMessage' :: APNSMessage -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
aPNSPushType
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Int
badge
      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
category
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
collapseId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
data'
      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
preferredAuthenticationMethod
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
priority
      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 Bool
silentPush
      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 (HashMap Text [Text])
substitutions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
threadId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
timeToLive
      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 APNSMessage where
  toJSON :: APNSMessage -> Value
toJSON APNSMessage' {Maybe Bool
Maybe Int
Maybe Text
Maybe (HashMap Text [Text])
Maybe (HashMap Text Text)
Maybe Action
url :: Maybe Text
title :: Maybe Text
timeToLive :: Maybe Int
threadId :: Maybe Text
substitutions :: Maybe (HashMap Text [Text])
sound :: Maybe Text
silentPush :: Maybe Bool
rawContent :: Maybe Text
priority :: Maybe Text
preferredAuthenticationMethod :: Maybe Text
mediaUrl :: Maybe Text
data' :: Maybe (HashMap Text Text)
collapseId :: Maybe Text
category :: Maybe Text
body :: Maybe Text
badge :: Maybe Int
action :: Maybe Action
aPNSPushType :: Maybe Text
$sel:url:APNSMessage' :: APNSMessage -> Maybe Text
$sel:title:APNSMessage' :: APNSMessage -> Maybe Text
$sel:timeToLive:APNSMessage' :: APNSMessage -> Maybe Int
$sel:threadId:APNSMessage' :: APNSMessage -> Maybe Text
$sel:substitutions:APNSMessage' :: APNSMessage -> Maybe (HashMap Text [Text])
$sel:sound:APNSMessage' :: APNSMessage -> Maybe Text
$sel:silentPush:APNSMessage' :: APNSMessage -> Maybe Bool
$sel:rawContent:APNSMessage' :: APNSMessage -> Maybe Text
$sel:priority:APNSMessage' :: APNSMessage -> Maybe Text
$sel:preferredAuthenticationMethod:APNSMessage' :: APNSMessage -> Maybe Text
$sel:mediaUrl:APNSMessage' :: APNSMessage -> Maybe Text
$sel:data':APNSMessage' :: APNSMessage -> Maybe (HashMap Text Text)
$sel:collapseId:APNSMessage' :: APNSMessage -> Maybe Text
$sel:category:APNSMessage' :: APNSMessage -> Maybe Text
$sel:body:APNSMessage' :: APNSMessage -> Maybe Text
$sel:badge:APNSMessage' :: APNSMessage -> Maybe Int
$sel:action:APNSMessage' :: APNSMessage -> Maybe Action
$sel:aPNSPushType:APNSMessage' :: APNSMessage -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"APNSPushType" 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
aPNSPushType,
            (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
"Badge" 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 Int
badge,
            (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
"Category" 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
category,
            (Key
"CollapseId" 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
collapseId,
            (Key
"Data" 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 (HashMap Text Text)
data',
            (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
"PreferredAuthenticationMethod" 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
preferredAuthenticationMethod,
            (Key
"Priority" 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
priority,
            (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
"SilentPush" 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 Bool
silentPush,
            (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
"Substitutions" 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 (HashMap Text [Text])
substitutions,
            (Key
"ThreadId" 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
threadId,
            (Key
"TimeToLive" 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 Int
timeToLive,
            (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
          ]
      )