{-# 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.PushNotificationTemplateRequest
-- 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.PushNotificationTemplateRequest 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.APNSPushNotificationTemplate
import Amazonka.Pinpoint.Types.AndroidPushNotificationTemplate
import Amazonka.Pinpoint.Types.DefaultPushNotificationTemplate
import qualified Amazonka.Prelude as Prelude

-- | Specifies the content and settings for a message template that can be
-- used in messages that are sent through a push notification channel.
--
-- /See:/ 'newPushNotificationTemplateRequest' smart constructor.
data PushNotificationTemplateRequest = PushNotificationTemplateRequest'
  { -- | The message template to use for the ADM (Amazon Device Messaging)
    -- channel. This message template overrides the default template for push
    -- notification channels (DefaultPushNotificationTemplate).
    PushNotificationTemplateRequest
-> Maybe AndroidPushNotificationTemplate
adm :: Prelude.Maybe AndroidPushNotificationTemplate,
    -- | The message template to use for the APNs (Apple Push Notification
    -- service) channel. This message template overrides the default template
    -- for push notification channels (DefaultPushNotificationTemplate).
    PushNotificationTemplateRequest
-> Maybe APNSPushNotificationTemplate
apns :: Prelude.Maybe APNSPushNotificationTemplate,
    -- | The message template to use for the Baidu (Baidu Cloud Push) channel.
    -- This message template overrides the default template for push
    -- notification channels (DefaultPushNotificationTemplate).
    PushNotificationTemplateRequest
-> Maybe AndroidPushNotificationTemplate
baidu :: Prelude.Maybe AndroidPushNotificationTemplate,
    -- | The default message template to use for push notification channels.
    PushNotificationTemplateRequest
-> Maybe DefaultPushNotificationTemplate
default' :: Prelude.Maybe DefaultPushNotificationTemplate,
    -- | A JSON object that specifies the default values to use for message
    -- variables in the message template. This object is a set of key-value
    -- pairs. Each key defines a message variable in the template. The
    -- corresponding value defines the default value for that variable. When
    -- you create a message that\'s based on the template, you can override
    -- these defaults with message-specific and address-specific variables and
    -- values.
    PushNotificationTemplateRequest -> Maybe Text
defaultSubstitutions :: Prelude.Maybe Prelude.Text,
    -- | The message template to use for the GCM channel, which is used to send
    -- notifications through the Firebase Cloud Messaging (FCM), formerly
    -- Google Cloud Messaging (GCM), service. This message template overrides
    -- the default template for push notification channels
    -- (DefaultPushNotificationTemplate).
    PushNotificationTemplateRequest
-> Maybe AndroidPushNotificationTemplate
gcm :: Prelude.Maybe AndroidPushNotificationTemplate,
    -- | The unique identifier for the recommender model to use for the message
    -- template. Amazon Pinpoint uses this value to determine how to retrieve
    -- and process data from a recommender model when it sends messages that
    -- use the template, if the template contains message variables for
    -- recommendation data.
    PushNotificationTemplateRequest -> Maybe Text
recommenderId :: Prelude.Maybe Prelude.Text,
    -- | A custom description of the message template.
    PushNotificationTemplateRequest -> Maybe Text
templateDescription :: Prelude.Maybe Prelude.Text,
    -- | A string-to-string map of key-value pairs that defines the tags to
    -- associate with the message template. Each tag consists of a required tag
    -- key and an associated tag value.
    PushNotificationTemplateRequest -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (PushNotificationTemplateRequest
-> PushNotificationTemplateRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PushNotificationTemplateRequest
-> PushNotificationTemplateRequest -> Bool
$c/= :: PushNotificationTemplateRequest
-> PushNotificationTemplateRequest -> Bool
== :: PushNotificationTemplateRequest
-> PushNotificationTemplateRequest -> Bool
$c== :: PushNotificationTemplateRequest
-> PushNotificationTemplateRequest -> Bool
Prelude.Eq, ReadPrec [PushNotificationTemplateRequest]
ReadPrec PushNotificationTemplateRequest
Int -> ReadS PushNotificationTemplateRequest
ReadS [PushNotificationTemplateRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PushNotificationTemplateRequest]
$creadListPrec :: ReadPrec [PushNotificationTemplateRequest]
readPrec :: ReadPrec PushNotificationTemplateRequest
$creadPrec :: ReadPrec PushNotificationTemplateRequest
readList :: ReadS [PushNotificationTemplateRequest]
$creadList :: ReadS [PushNotificationTemplateRequest]
readsPrec :: Int -> ReadS PushNotificationTemplateRequest
$creadsPrec :: Int -> ReadS PushNotificationTemplateRequest
Prelude.Read, Int -> PushNotificationTemplateRequest -> ShowS
[PushNotificationTemplateRequest] -> ShowS
PushNotificationTemplateRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PushNotificationTemplateRequest] -> ShowS
$cshowList :: [PushNotificationTemplateRequest] -> ShowS
show :: PushNotificationTemplateRequest -> String
$cshow :: PushNotificationTemplateRequest -> String
showsPrec :: Int -> PushNotificationTemplateRequest -> ShowS
$cshowsPrec :: Int -> PushNotificationTemplateRequest -> ShowS
Prelude.Show, forall x.
Rep PushNotificationTemplateRequest x
-> PushNotificationTemplateRequest
forall x.
PushNotificationTemplateRequest
-> Rep PushNotificationTemplateRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PushNotificationTemplateRequest x
-> PushNotificationTemplateRequest
$cfrom :: forall x.
PushNotificationTemplateRequest
-> Rep PushNotificationTemplateRequest x
Prelude.Generic)

-- |
-- Create a value of 'PushNotificationTemplateRequest' 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:
--
-- 'adm', 'pushNotificationTemplateRequest_adm' - The message template to use for the ADM (Amazon Device Messaging)
-- channel. This message template overrides the default template for push
-- notification channels (DefaultPushNotificationTemplate).
--
-- 'apns', 'pushNotificationTemplateRequest_apns' - The message template to use for the APNs (Apple Push Notification
-- service) channel. This message template overrides the default template
-- for push notification channels (DefaultPushNotificationTemplate).
--
-- 'baidu', 'pushNotificationTemplateRequest_baidu' - The message template to use for the Baidu (Baidu Cloud Push) channel.
-- This message template overrides the default template for push
-- notification channels (DefaultPushNotificationTemplate).
--
-- 'default'', 'pushNotificationTemplateRequest_default' - The default message template to use for push notification channels.
--
-- 'defaultSubstitutions', 'pushNotificationTemplateRequest_defaultSubstitutions' - A JSON object that specifies the default values to use for message
-- variables in the message template. This object is a set of key-value
-- pairs. Each key defines a message variable in the template. The
-- corresponding value defines the default value for that variable. When
-- you create a message that\'s based on the template, you can override
-- these defaults with message-specific and address-specific variables and
-- values.
--
-- 'gcm', 'pushNotificationTemplateRequest_gcm' - The message template to use for the GCM channel, which is used to send
-- notifications through the Firebase Cloud Messaging (FCM), formerly
-- Google Cloud Messaging (GCM), service. This message template overrides
-- the default template for push notification channels
-- (DefaultPushNotificationTemplate).
--
-- 'recommenderId', 'pushNotificationTemplateRequest_recommenderId' - The unique identifier for the recommender model to use for the message
-- template. Amazon Pinpoint uses this value to determine how to retrieve
-- and process data from a recommender model when it sends messages that
-- use the template, if the template contains message variables for
-- recommendation data.
--
-- 'templateDescription', 'pushNotificationTemplateRequest_templateDescription' - A custom description of the message template.
--
-- 'tags', 'pushNotificationTemplateRequest_tags' - A string-to-string map of key-value pairs that defines the tags to
-- associate with the message template. Each tag consists of a required tag
-- key and an associated tag value.
newPushNotificationTemplateRequest ::
  PushNotificationTemplateRequest
newPushNotificationTemplateRequest :: PushNotificationTemplateRequest
newPushNotificationTemplateRequest =
  PushNotificationTemplateRequest'
    { $sel:adm:PushNotificationTemplateRequest' :: Maybe AndroidPushNotificationTemplate
adm =
        forall a. Maybe a
Prelude.Nothing,
      $sel:apns:PushNotificationTemplateRequest' :: Maybe APNSPushNotificationTemplate
apns = forall a. Maybe a
Prelude.Nothing,
      $sel:baidu:PushNotificationTemplateRequest' :: Maybe AndroidPushNotificationTemplate
baidu = forall a. Maybe a
Prelude.Nothing,
      $sel:default':PushNotificationTemplateRequest' :: Maybe DefaultPushNotificationTemplate
default' = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultSubstitutions:PushNotificationTemplateRequest' :: Maybe Text
defaultSubstitutions = forall a. Maybe a
Prelude.Nothing,
      $sel:gcm:PushNotificationTemplateRequest' :: Maybe AndroidPushNotificationTemplate
gcm = forall a. Maybe a
Prelude.Nothing,
      $sel:recommenderId:PushNotificationTemplateRequest' :: Maybe Text
recommenderId = forall a. Maybe a
Prelude.Nothing,
      $sel:templateDescription:PushNotificationTemplateRequest' :: Maybe Text
templateDescription = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:PushNotificationTemplateRequest' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing
    }

-- | The message template to use for the ADM (Amazon Device Messaging)
-- channel. This message template overrides the default template for push
-- notification channels (DefaultPushNotificationTemplate).
pushNotificationTemplateRequest_adm :: Lens.Lens' PushNotificationTemplateRequest (Prelude.Maybe AndroidPushNotificationTemplate)
pushNotificationTemplateRequest_adm :: Lens'
  PushNotificationTemplateRequest
  (Maybe AndroidPushNotificationTemplate)
pushNotificationTemplateRequest_adm = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PushNotificationTemplateRequest' {Maybe AndroidPushNotificationTemplate
adm :: Maybe AndroidPushNotificationTemplate
$sel:adm:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe AndroidPushNotificationTemplate
adm} -> Maybe AndroidPushNotificationTemplate
adm) (\s :: PushNotificationTemplateRequest
s@PushNotificationTemplateRequest' {} Maybe AndroidPushNotificationTemplate
a -> PushNotificationTemplateRequest
s {$sel:adm:PushNotificationTemplateRequest' :: Maybe AndroidPushNotificationTemplate
adm = Maybe AndroidPushNotificationTemplate
a} :: PushNotificationTemplateRequest)

-- | The message template to use for the APNs (Apple Push Notification
-- service) channel. This message template overrides the default template
-- for push notification channels (DefaultPushNotificationTemplate).
pushNotificationTemplateRequest_apns :: Lens.Lens' PushNotificationTemplateRequest (Prelude.Maybe APNSPushNotificationTemplate)
pushNotificationTemplateRequest_apns :: Lens'
  PushNotificationTemplateRequest
  (Maybe APNSPushNotificationTemplate)
pushNotificationTemplateRequest_apns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PushNotificationTemplateRequest' {Maybe APNSPushNotificationTemplate
apns :: Maybe APNSPushNotificationTemplate
$sel:apns:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe APNSPushNotificationTemplate
apns} -> Maybe APNSPushNotificationTemplate
apns) (\s :: PushNotificationTemplateRequest
s@PushNotificationTemplateRequest' {} Maybe APNSPushNotificationTemplate
a -> PushNotificationTemplateRequest
s {$sel:apns:PushNotificationTemplateRequest' :: Maybe APNSPushNotificationTemplate
apns = Maybe APNSPushNotificationTemplate
a} :: PushNotificationTemplateRequest)

-- | The message template to use for the Baidu (Baidu Cloud Push) channel.
-- This message template overrides the default template for push
-- notification channels (DefaultPushNotificationTemplate).
pushNotificationTemplateRequest_baidu :: Lens.Lens' PushNotificationTemplateRequest (Prelude.Maybe AndroidPushNotificationTemplate)
pushNotificationTemplateRequest_baidu :: Lens'
  PushNotificationTemplateRequest
  (Maybe AndroidPushNotificationTemplate)
pushNotificationTemplateRequest_baidu = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PushNotificationTemplateRequest' {Maybe AndroidPushNotificationTemplate
baidu :: Maybe AndroidPushNotificationTemplate
$sel:baidu:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe AndroidPushNotificationTemplate
baidu} -> Maybe AndroidPushNotificationTemplate
baidu) (\s :: PushNotificationTemplateRequest
s@PushNotificationTemplateRequest' {} Maybe AndroidPushNotificationTemplate
a -> PushNotificationTemplateRequest
s {$sel:baidu:PushNotificationTemplateRequest' :: Maybe AndroidPushNotificationTemplate
baidu = Maybe AndroidPushNotificationTemplate
a} :: PushNotificationTemplateRequest)

-- | The default message template to use for push notification channels.
pushNotificationTemplateRequest_default :: Lens.Lens' PushNotificationTemplateRequest (Prelude.Maybe DefaultPushNotificationTemplate)
pushNotificationTemplateRequest_default :: Lens'
  PushNotificationTemplateRequest
  (Maybe DefaultPushNotificationTemplate)
pushNotificationTemplateRequest_default = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PushNotificationTemplateRequest' {Maybe DefaultPushNotificationTemplate
default' :: Maybe DefaultPushNotificationTemplate
$sel:default':PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe DefaultPushNotificationTemplate
default'} -> Maybe DefaultPushNotificationTemplate
default') (\s :: PushNotificationTemplateRequest
s@PushNotificationTemplateRequest' {} Maybe DefaultPushNotificationTemplate
a -> PushNotificationTemplateRequest
s {$sel:default':PushNotificationTemplateRequest' :: Maybe DefaultPushNotificationTemplate
default' = Maybe DefaultPushNotificationTemplate
a} :: PushNotificationTemplateRequest)

-- | A JSON object that specifies the default values to use for message
-- variables in the message template. This object is a set of key-value
-- pairs. Each key defines a message variable in the template. The
-- corresponding value defines the default value for that variable. When
-- you create a message that\'s based on the template, you can override
-- these defaults with message-specific and address-specific variables and
-- values.
pushNotificationTemplateRequest_defaultSubstitutions :: Lens.Lens' PushNotificationTemplateRequest (Prelude.Maybe Prelude.Text)
pushNotificationTemplateRequest_defaultSubstitutions :: Lens' PushNotificationTemplateRequest (Maybe Text)
pushNotificationTemplateRequest_defaultSubstitutions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PushNotificationTemplateRequest' {Maybe Text
defaultSubstitutions :: Maybe Text
$sel:defaultSubstitutions:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest -> Maybe Text
defaultSubstitutions} -> Maybe Text
defaultSubstitutions) (\s :: PushNotificationTemplateRequest
s@PushNotificationTemplateRequest' {} Maybe Text
a -> PushNotificationTemplateRequest
s {$sel:defaultSubstitutions:PushNotificationTemplateRequest' :: Maybe Text
defaultSubstitutions = Maybe Text
a} :: PushNotificationTemplateRequest)

-- | The message template to use for the GCM channel, which is used to send
-- notifications through the Firebase Cloud Messaging (FCM), formerly
-- Google Cloud Messaging (GCM), service. This message template overrides
-- the default template for push notification channels
-- (DefaultPushNotificationTemplate).
pushNotificationTemplateRequest_gcm :: Lens.Lens' PushNotificationTemplateRequest (Prelude.Maybe AndroidPushNotificationTemplate)
pushNotificationTemplateRequest_gcm :: Lens'
  PushNotificationTemplateRequest
  (Maybe AndroidPushNotificationTemplate)
pushNotificationTemplateRequest_gcm = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PushNotificationTemplateRequest' {Maybe AndroidPushNotificationTemplate
gcm :: Maybe AndroidPushNotificationTemplate
$sel:gcm:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe AndroidPushNotificationTemplate
gcm} -> Maybe AndroidPushNotificationTemplate
gcm) (\s :: PushNotificationTemplateRequest
s@PushNotificationTemplateRequest' {} Maybe AndroidPushNotificationTemplate
a -> PushNotificationTemplateRequest
s {$sel:gcm:PushNotificationTemplateRequest' :: Maybe AndroidPushNotificationTemplate
gcm = Maybe AndroidPushNotificationTemplate
a} :: PushNotificationTemplateRequest)

-- | The unique identifier for the recommender model to use for the message
-- template. Amazon Pinpoint uses this value to determine how to retrieve
-- and process data from a recommender model when it sends messages that
-- use the template, if the template contains message variables for
-- recommendation data.
pushNotificationTemplateRequest_recommenderId :: Lens.Lens' PushNotificationTemplateRequest (Prelude.Maybe Prelude.Text)
pushNotificationTemplateRequest_recommenderId :: Lens' PushNotificationTemplateRequest (Maybe Text)
pushNotificationTemplateRequest_recommenderId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PushNotificationTemplateRequest' {Maybe Text
recommenderId :: Maybe Text
$sel:recommenderId:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest -> Maybe Text
recommenderId} -> Maybe Text
recommenderId) (\s :: PushNotificationTemplateRequest
s@PushNotificationTemplateRequest' {} Maybe Text
a -> PushNotificationTemplateRequest
s {$sel:recommenderId:PushNotificationTemplateRequest' :: Maybe Text
recommenderId = Maybe Text
a} :: PushNotificationTemplateRequest)

-- | A custom description of the message template.
pushNotificationTemplateRequest_templateDescription :: Lens.Lens' PushNotificationTemplateRequest (Prelude.Maybe Prelude.Text)
pushNotificationTemplateRequest_templateDescription :: Lens' PushNotificationTemplateRequest (Maybe Text)
pushNotificationTemplateRequest_templateDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PushNotificationTemplateRequest' {Maybe Text
templateDescription :: Maybe Text
$sel:templateDescription:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest -> Maybe Text
templateDescription} -> Maybe Text
templateDescription) (\s :: PushNotificationTemplateRequest
s@PushNotificationTemplateRequest' {} Maybe Text
a -> PushNotificationTemplateRequest
s {$sel:templateDescription:PushNotificationTemplateRequest' :: Maybe Text
templateDescription = Maybe Text
a} :: PushNotificationTemplateRequest)

-- | A string-to-string map of key-value pairs that defines the tags to
-- associate with the message template. Each tag consists of a required tag
-- key and an associated tag value.
pushNotificationTemplateRequest_tags :: Lens.Lens' PushNotificationTemplateRequest (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
pushNotificationTemplateRequest_tags :: Lens' PushNotificationTemplateRequest (Maybe (HashMap Text Text))
pushNotificationTemplateRequest_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PushNotificationTemplateRequest' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: PushNotificationTemplateRequest
s@PushNotificationTemplateRequest' {} Maybe (HashMap Text Text)
a -> PushNotificationTemplateRequest
s {$sel:tags:PushNotificationTemplateRequest' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: PushNotificationTemplateRequest) 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

instance
  Prelude.Hashable
    PushNotificationTemplateRequest
  where
  hashWithSalt :: Int -> PushNotificationTemplateRequest -> Int
hashWithSalt
    Int
_salt
    PushNotificationTemplateRequest' {Maybe Text
Maybe (HashMap Text Text)
Maybe APNSPushNotificationTemplate
Maybe AndroidPushNotificationTemplate
Maybe DefaultPushNotificationTemplate
tags :: Maybe (HashMap Text Text)
templateDescription :: Maybe Text
recommenderId :: Maybe Text
gcm :: Maybe AndroidPushNotificationTemplate
defaultSubstitutions :: Maybe Text
default' :: Maybe DefaultPushNotificationTemplate
baidu :: Maybe AndroidPushNotificationTemplate
apns :: Maybe APNSPushNotificationTemplate
adm :: Maybe AndroidPushNotificationTemplate
$sel:tags:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest -> Maybe (HashMap Text Text)
$sel:templateDescription:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest -> Maybe Text
$sel:recommenderId:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest -> Maybe Text
$sel:gcm:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe AndroidPushNotificationTemplate
$sel:defaultSubstitutions:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest -> Maybe Text
$sel:default':PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe DefaultPushNotificationTemplate
$sel:baidu:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe AndroidPushNotificationTemplate
$sel:apns:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe APNSPushNotificationTemplate
$sel:adm:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe AndroidPushNotificationTemplate
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AndroidPushNotificationTemplate
adm
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe APNSPushNotificationTemplate
apns
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AndroidPushNotificationTemplate
baidu
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DefaultPushNotificationTemplate
default'
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultSubstitutions
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AndroidPushNotificationTemplate
gcm
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
recommenderId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
templateDescription
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags

instance
  Prelude.NFData
    PushNotificationTemplateRequest
  where
  rnf :: PushNotificationTemplateRequest -> ()
rnf PushNotificationTemplateRequest' {Maybe Text
Maybe (HashMap Text Text)
Maybe APNSPushNotificationTemplate
Maybe AndroidPushNotificationTemplate
Maybe DefaultPushNotificationTemplate
tags :: Maybe (HashMap Text Text)
templateDescription :: Maybe Text
recommenderId :: Maybe Text
gcm :: Maybe AndroidPushNotificationTemplate
defaultSubstitutions :: Maybe Text
default' :: Maybe DefaultPushNotificationTemplate
baidu :: Maybe AndroidPushNotificationTemplate
apns :: Maybe APNSPushNotificationTemplate
adm :: Maybe AndroidPushNotificationTemplate
$sel:tags:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest -> Maybe (HashMap Text Text)
$sel:templateDescription:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest -> Maybe Text
$sel:recommenderId:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest -> Maybe Text
$sel:gcm:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe AndroidPushNotificationTemplate
$sel:defaultSubstitutions:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest -> Maybe Text
$sel:default':PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe DefaultPushNotificationTemplate
$sel:baidu:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe AndroidPushNotificationTemplate
$sel:apns:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe APNSPushNotificationTemplate
$sel:adm:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe AndroidPushNotificationTemplate
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AndroidPushNotificationTemplate
adm
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe APNSPushNotificationTemplate
apns
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AndroidPushNotificationTemplate
baidu
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DefaultPushNotificationTemplate
default'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultSubstitutions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AndroidPushNotificationTemplate
gcm
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
recommenderId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
templateDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags

instance Data.ToJSON PushNotificationTemplateRequest where
  toJSON :: PushNotificationTemplateRequest -> Value
toJSON PushNotificationTemplateRequest' {Maybe Text
Maybe (HashMap Text Text)
Maybe APNSPushNotificationTemplate
Maybe AndroidPushNotificationTemplate
Maybe DefaultPushNotificationTemplate
tags :: Maybe (HashMap Text Text)
templateDescription :: Maybe Text
recommenderId :: Maybe Text
gcm :: Maybe AndroidPushNotificationTemplate
defaultSubstitutions :: Maybe Text
default' :: Maybe DefaultPushNotificationTemplate
baidu :: Maybe AndroidPushNotificationTemplate
apns :: Maybe APNSPushNotificationTemplate
adm :: Maybe AndroidPushNotificationTemplate
$sel:tags:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest -> Maybe (HashMap Text Text)
$sel:templateDescription:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest -> Maybe Text
$sel:recommenderId:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest -> Maybe Text
$sel:gcm:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe AndroidPushNotificationTemplate
$sel:defaultSubstitutions:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest -> Maybe Text
$sel:default':PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe DefaultPushNotificationTemplate
$sel:baidu:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe AndroidPushNotificationTemplate
$sel:apns:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe APNSPushNotificationTemplate
$sel:adm:PushNotificationTemplateRequest' :: PushNotificationTemplateRequest
-> Maybe AndroidPushNotificationTemplate
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ADM" 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 AndroidPushNotificationTemplate
adm,
            (Key
"APNS" 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 APNSPushNotificationTemplate
apns,
            (Key
"Baidu" 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 AndroidPushNotificationTemplate
baidu,
            (Key
"Default" 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 DefaultPushNotificationTemplate
default',
            (Key
"DefaultSubstitutions" 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
defaultSubstitutions,
            (Key
"GCM" 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 AndroidPushNotificationTemplate
gcm,
            (Key
"RecommenderId" 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
recommenderId,
            (Key
"TemplateDescription" 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
templateDescription,
            (Key
"tags" 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)
tags
          ]
      )