{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Pinpoint.Types.PushNotificationTemplateRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 default message template to use for push notification channels.
    PushNotificationTemplateRequest
-> Maybe DefaultPushNotificationTemplate
default' :: Prelude.Maybe DefaultPushNotificationTemplate,
    -- | A custom description of the message template.
    PushNotificationTemplateRequest -> Maybe Text
templateDescription :: 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 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,
    -- | 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 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 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 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 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
(PushNotificationTemplateRequest
 -> PushNotificationTemplateRequest -> Bool)
-> (PushNotificationTemplateRequest
    -> PushNotificationTemplateRequest -> Bool)
-> Eq PushNotificationTemplateRequest
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]
(Int -> ReadS PushNotificationTemplateRequest)
-> ReadS [PushNotificationTemplateRequest]
-> ReadPrec PushNotificationTemplateRequest
-> ReadPrec [PushNotificationTemplateRequest]
-> Read 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
(Int -> PushNotificationTemplateRequest -> ShowS)
-> (PushNotificationTemplateRequest -> String)
-> ([PushNotificationTemplateRequest] -> ShowS)
-> Show PushNotificationTemplateRequest
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.
 PushNotificationTemplateRequest
 -> Rep PushNotificationTemplateRequest x)
-> (forall x.
    Rep PushNotificationTemplateRequest x
    -> PushNotificationTemplateRequest)
-> Generic PushNotificationTemplateRequest
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:
--
-- 'default'', 'pushNotificationTemplateRequest_default' - The default message template to use for push notification channels.
--
-- 'templateDescription', 'pushNotificationTemplateRequest_templateDescription' - A custom description of the message template.
--
-- '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).
--
-- '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).
--
-- '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.
--
-- '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).
--
-- '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).
--
-- '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.
--
-- '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' :: Maybe DefaultPushNotificationTemplate
-> Maybe Text
-> Maybe AndroidPushNotificationTemplate
-> Maybe APNSPushNotificationTemplate
-> Maybe Text
-> Maybe AndroidPushNotificationTemplate
-> Maybe AndroidPushNotificationTemplate
-> Maybe Text
-> Maybe (HashMap Text Text)
-> PushNotificationTemplateRequest
PushNotificationTemplateRequest'
    { $sel:default':PushNotificationTemplateRequest' :: Maybe DefaultPushNotificationTemplate
default' =
        Maybe DefaultPushNotificationTemplate
forall a. Maybe a
Prelude.Nothing,
      $sel:templateDescription:PushNotificationTemplateRequest' :: Maybe Text
templateDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:gcm:PushNotificationTemplateRequest' :: Maybe AndroidPushNotificationTemplate
gcm = Maybe AndroidPushNotificationTemplate
forall a. Maybe a
Prelude.Nothing,
      $sel:apns:PushNotificationTemplateRequest' :: Maybe APNSPushNotificationTemplate
apns = Maybe APNSPushNotificationTemplate
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultSubstitutions:PushNotificationTemplateRequest' :: Maybe Text
defaultSubstitutions = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:adm:PushNotificationTemplateRequest' :: Maybe AndroidPushNotificationTemplate
adm = Maybe AndroidPushNotificationTemplate
forall a. Maybe a
Prelude.Nothing,
      $sel:baidu:PushNotificationTemplateRequest' :: Maybe AndroidPushNotificationTemplate
baidu = Maybe AndroidPushNotificationTemplate
forall a. Maybe a
Prelude.Nothing,
      $sel:recommenderId:PushNotificationTemplateRequest' :: Maybe Text
recommenderId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:PushNotificationTemplateRequest' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The default message template to use for push notification channels.
pushNotificationTemplateRequest_default :: Lens.Lens' PushNotificationTemplateRequest (Prelude.Maybe DefaultPushNotificationTemplate)
pushNotificationTemplateRequest_default :: (Maybe DefaultPushNotificationTemplate
 -> f (Maybe DefaultPushNotificationTemplate))
-> PushNotificationTemplateRequest
-> f PushNotificationTemplateRequest
pushNotificationTemplateRequest_default = (PushNotificationTemplateRequest
 -> Maybe DefaultPushNotificationTemplate)
-> (PushNotificationTemplateRequest
    -> Maybe DefaultPushNotificationTemplate
    -> PushNotificationTemplateRequest)
-> Lens
     PushNotificationTemplateRequest
     PushNotificationTemplateRequest
     (Maybe DefaultPushNotificationTemplate)
     (Maybe DefaultPushNotificationTemplate)
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 custom description of the message template.
pushNotificationTemplateRequest_templateDescription :: Lens.Lens' PushNotificationTemplateRequest (Prelude.Maybe Prelude.Text)
pushNotificationTemplateRequest_templateDescription :: (Maybe Text -> f (Maybe Text))
-> PushNotificationTemplateRequest
-> f PushNotificationTemplateRequest
pushNotificationTemplateRequest_templateDescription = (PushNotificationTemplateRequest -> Maybe Text)
-> (PushNotificationTemplateRequest
    -> Maybe Text -> PushNotificationTemplateRequest)
-> Lens
     PushNotificationTemplateRequest
     PushNotificationTemplateRequest
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe AndroidPushNotificationTemplate
 -> f (Maybe AndroidPushNotificationTemplate))
-> PushNotificationTemplateRequest
-> f PushNotificationTemplateRequest
pushNotificationTemplateRequest_gcm = (PushNotificationTemplateRequest
 -> Maybe AndroidPushNotificationTemplate)
-> (PushNotificationTemplateRequest
    -> Maybe AndroidPushNotificationTemplate
    -> PushNotificationTemplateRequest)
-> Lens
     PushNotificationTemplateRequest
     PushNotificationTemplateRequest
     (Maybe AndroidPushNotificationTemplate)
     (Maybe AndroidPushNotificationTemplate)
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 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 :: (Maybe APNSPushNotificationTemplate
 -> f (Maybe APNSPushNotificationTemplate))
-> PushNotificationTemplateRequest
-> f PushNotificationTemplateRequest
pushNotificationTemplateRequest_apns = (PushNotificationTemplateRequest
 -> Maybe APNSPushNotificationTemplate)
-> (PushNotificationTemplateRequest
    -> Maybe APNSPushNotificationTemplate
    -> PushNotificationTemplateRequest)
-> Lens
     PushNotificationTemplateRequest
     PushNotificationTemplateRequest
     (Maybe APNSPushNotificationTemplate)
     (Maybe APNSPushNotificationTemplate)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> PushNotificationTemplateRequest
-> f PushNotificationTemplateRequest
pushNotificationTemplateRequest_defaultSubstitutions = (PushNotificationTemplateRequest -> Maybe Text)
-> (PushNotificationTemplateRequest
    -> Maybe Text -> PushNotificationTemplateRequest)
-> Lens
     PushNotificationTemplateRequest
     PushNotificationTemplateRequest
     (Maybe Text)
     (Maybe Text)
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 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 :: (Maybe AndroidPushNotificationTemplate
 -> f (Maybe AndroidPushNotificationTemplate))
-> PushNotificationTemplateRequest
-> f PushNotificationTemplateRequest
pushNotificationTemplateRequest_adm = (PushNotificationTemplateRequest
 -> Maybe AndroidPushNotificationTemplate)
-> (PushNotificationTemplateRequest
    -> Maybe AndroidPushNotificationTemplate
    -> PushNotificationTemplateRequest)
-> Lens
     PushNotificationTemplateRequest
     PushNotificationTemplateRequest
     (Maybe AndroidPushNotificationTemplate)
     (Maybe AndroidPushNotificationTemplate)
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 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 :: (Maybe AndroidPushNotificationTemplate
 -> f (Maybe AndroidPushNotificationTemplate))
-> PushNotificationTemplateRequest
-> f PushNotificationTemplateRequest
pushNotificationTemplateRequest_baidu = (PushNotificationTemplateRequest
 -> Maybe AndroidPushNotificationTemplate)
-> (PushNotificationTemplateRequest
    -> Maybe AndroidPushNotificationTemplate
    -> PushNotificationTemplateRequest)
-> Lens
     PushNotificationTemplateRequest
     PushNotificationTemplateRequest
     (Maybe AndroidPushNotificationTemplate)
     (Maybe AndroidPushNotificationTemplate)
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 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 :: (Maybe Text -> f (Maybe Text))
-> PushNotificationTemplateRequest
-> f PushNotificationTemplateRequest
pushNotificationTemplateRequest_recommenderId = (PushNotificationTemplateRequest -> Maybe Text)
-> (PushNotificationTemplateRequest
    -> Maybe Text -> PushNotificationTemplateRequest)
-> Lens
     PushNotificationTemplateRequest
     PushNotificationTemplateRequest
     (Maybe Text)
     (Maybe Text)
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 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 :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PushNotificationTemplateRequest
-> f PushNotificationTemplateRequest
pushNotificationTemplateRequest_tags = (PushNotificationTemplateRequest -> Maybe (HashMap Text Text))
-> (PushNotificationTemplateRequest
    -> Maybe (HashMap Text Text) -> PushNotificationTemplateRequest)
-> Lens
     PushNotificationTemplateRequest
     PushNotificationTemplateRequest
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> PushNotificationTemplateRequest
 -> f PushNotificationTemplateRequest)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PushNotificationTemplateRequest
-> f PushNotificationTemplateRequest
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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 AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.Hashable
    PushNotificationTemplateRequest

instance
  Prelude.NFData
    PushNotificationTemplateRequest

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