{-# 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.CustomMessageActivity
-- 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.CustomMessageActivity where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.EndpointTypesElement
import Amazonka.Pinpoint.Types.JourneyCustomMessage
import qualified Amazonka.Prelude as Prelude

-- | The settings for a custom message activity. This type of activity calls
-- an AWS Lambda function or web hook that sends messages to participants.
--
-- /See:/ 'newCustomMessageActivity' smart constructor.
data CustomMessageActivity = CustomMessageActivity'
  { -- | The name of the custom message template to use for the message. If
    -- specified, this value must match the name of an existing message
    -- template.
    CustomMessageActivity -> Maybe Text
templateName :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the version of the message template to use for
    -- the message. If specified, this value must match the identifier for an
    -- existing template version. To retrieve a list of versions and version
    -- identifiers for a template, use the Template Versions resource.
    --
    -- If you don\'t specify a value for this property, Amazon Pinpoint uses
    -- the /active version/ of the template. The /active version/ is typically
    -- the version of a template that\'s been most recently reviewed and
    -- approved for use, depending on your workflow. It isn\'t necessarily the
    -- latest version of a template.
    CustomMessageActivity -> Maybe Text
templateVersion :: Prelude.Maybe Prelude.Text,
    -- | The types of endpoints to send the custom message to. Each valid value
    -- maps to a type of channel that you can associate with an endpoint by
    -- using the ChannelType property of an endpoint.
    CustomMessageActivity -> Maybe [EndpointTypesElement]
endpointTypes :: Prelude.Maybe [EndpointTypesElement],
    -- | The unique identifier for the next activity to perform, after Amazon
    -- Pinpoint calls the AWS Lambda function or web hook.
    CustomMessageActivity -> Maybe Text
nextActivity :: Prelude.Maybe Prelude.Text,
    -- | The destination to send the campaign or treatment to. This value can be
    -- one of the following:
    --
    -- -   The name or Amazon Resource Name (ARN) of an AWS Lambda function to
    --     invoke to handle delivery of the campaign or treatment.
    --
    -- -   The URL for a web application or service that supports HTTPS and can
    --     receive the message. The URL has to be a full URL, including the
    --     HTTPS protocol.
    CustomMessageActivity -> Maybe Text
deliveryUri :: Prelude.Maybe Prelude.Text,
    -- | Specifies the message data included in a custom channel message that\'s
    -- sent to participants in a journey.
    CustomMessageActivity -> Maybe JourneyCustomMessage
messageConfig :: Prelude.Maybe JourneyCustomMessage
  }
  deriving (CustomMessageActivity -> CustomMessageActivity -> Bool
(CustomMessageActivity -> CustomMessageActivity -> Bool)
-> (CustomMessageActivity -> CustomMessageActivity -> Bool)
-> Eq CustomMessageActivity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomMessageActivity -> CustomMessageActivity -> Bool
$c/= :: CustomMessageActivity -> CustomMessageActivity -> Bool
== :: CustomMessageActivity -> CustomMessageActivity -> Bool
$c== :: CustomMessageActivity -> CustomMessageActivity -> Bool
Prelude.Eq, ReadPrec [CustomMessageActivity]
ReadPrec CustomMessageActivity
Int -> ReadS CustomMessageActivity
ReadS [CustomMessageActivity]
(Int -> ReadS CustomMessageActivity)
-> ReadS [CustomMessageActivity]
-> ReadPrec CustomMessageActivity
-> ReadPrec [CustomMessageActivity]
-> Read CustomMessageActivity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomMessageActivity]
$creadListPrec :: ReadPrec [CustomMessageActivity]
readPrec :: ReadPrec CustomMessageActivity
$creadPrec :: ReadPrec CustomMessageActivity
readList :: ReadS [CustomMessageActivity]
$creadList :: ReadS [CustomMessageActivity]
readsPrec :: Int -> ReadS CustomMessageActivity
$creadsPrec :: Int -> ReadS CustomMessageActivity
Prelude.Read, Int -> CustomMessageActivity -> ShowS
[CustomMessageActivity] -> ShowS
CustomMessageActivity -> String
(Int -> CustomMessageActivity -> ShowS)
-> (CustomMessageActivity -> String)
-> ([CustomMessageActivity] -> ShowS)
-> Show CustomMessageActivity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomMessageActivity] -> ShowS
$cshowList :: [CustomMessageActivity] -> ShowS
show :: CustomMessageActivity -> String
$cshow :: CustomMessageActivity -> String
showsPrec :: Int -> CustomMessageActivity -> ShowS
$cshowsPrec :: Int -> CustomMessageActivity -> ShowS
Prelude.Show, (forall x. CustomMessageActivity -> Rep CustomMessageActivity x)
-> (forall x. Rep CustomMessageActivity x -> CustomMessageActivity)
-> Generic CustomMessageActivity
forall x. Rep CustomMessageActivity x -> CustomMessageActivity
forall x. CustomMessageActivity -> Rep CustomMessageActivity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CustomMessageActivity x -> CustomMessageActivity
$cfrom :: forall x. CustomMessageActivity -> Rep CustomMessageActivity x
Prelude.Generic)

-- |
-- Create a value of 'CustomMessageActivity' 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:
--
-- 'templateName', 'customMessageActivity_templateName' - The name of the custom message template to use for the message. If
-- specified, this value must match the name of an existing message
-- template.
--
-- 'templateVersion', 'customMessageActivity_templateVersion' - The unique identifier for the version of the message template to use for
-- the message. If specified, this value must match the identifier for an
-- existing template version. To retrieve a list of versions and version
-- identifiers for a template, use the Template Versions resource.
--
-- If you don\'t specify a value for this property, Amazon Pinpoint uses
-- the /active version/ of the template. The /active version/ is typically
-- the version of a template that\'s been most recently reviewed and
-- approved for use, depending on your workflow. It isn\'t necessarily the
-- latest version of a template.
--
-- 'endpointTypes', 'customMessageActivity_endpointTypes' - The types of endpoints to send the custom message to. Each valid value
-- maps to a type of channel that you can associate with an endpoint by
-- using the ChannelType property of an endpoint.
--
-- 'nextActivity', 'customMessageActivity_nextActivity' - The unique identifier for the next activity to perform, after Amazon
-- Pinpoint calls the AWS Lambda function or web hook.
--
-- 'deliveryUri', 'customMessageActivity_deliveryUri' - The destination to send the campaign or treatment to. This value can be
-- one of the following:
--
-- -   The name or Amazon Resource Name (ARN) of an AWS Lambda function to
--     invoke to handle delivery of the campaign or treatment.
--
-- -   The URL for a web application or service that supports HTTPS and can
--     receive the message. The URL has to be a full URL, including the
--     HTTPS protocol.
--
-- 'messageConfig', 'customMessageActivity_messageConfig' - Specifies the message data included in a custom channel message that\'s
-- sent to participants in a journey.
newCustomMessageActivity ::
  CustomMessageActivity
newCustomMessageActivity :: CustomMessageActivity
newCustomMessageActivity =
  CustomMessageActivity' :: Maybe Text
-> Maybe Text
-> Maybe [EndpointTypesElement]
-> Maybe Text
-> Maybe Text
-> Maybe JourneyCustomMessage
-> CustomMessageActivity
CustomMessageActivity'
    { $sel:templateName:CustomMessageActivity' :: Maybe Text
templateName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateVersion:CustomMessageActivity' :: Maybe Text
templateVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endpointTypes:CustomMessageActivity' :: Maybe [EndpointTypesElement]
endpointTypes = Maybe [EndpointTypesElement]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextActivity:CustomMessageActivity' :: Maybe Text
nextActivity = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deliveryUri:CustomMessageActivity' :: Maybe Text
deliveryUri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:messageConfig:CustomMessageActivity' :: Maybe JourneyCustomMessage
messageConfig = Maybe JourneyCustomMessage
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the custom message template to use for the message. If
-- specified, this value must match the name of an existing message
-- template.
customMessageActivity_templateName :: Lens.Lens' CustomMessageActivity (Prelude.Maybe Prelude.Text)
customMessageActivity_templateName :: (Maybe Text -> f (Maybe Text))
-> CustomMessageActivity -> f CustomMessageActivity
customMessageActivity_templateName = (CustomMessageActivity -> Maybe Text)
-> (CustomMessageActivity -> Maybe Text -> CustomMessageActivity)
-> Lens
     CustomMessageActivity
     CustomMessageActivity
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomMessageActivity' {Maybe Text
templateName :: Maybe Text
$sel:templateName:CustomMessageActivity' :: CustomMessageActivity -> Maybe Text
templateName} -> Maybe Text
templateName) (\s :: CustomMessageActivity
s@CustomMessageActivity' {} Maybe Text
a -> CustomMessageActivity
s {$sel:templateName:CustomMessageActivity' :: Maybe Text
templateName = Maybe Text
a} :: CustomMessageActivity)

-- | The unique identifier for the version of the message template to use for
-- the message. If specified, this value must match the identifier for an
-- existing template version. To retrieve a list of versions and version
-- identifiers for a template, use the Template Versions resource.
--
-- If you don\'t specify a value for this property, Amazon Pinpoint uses
-- the /active version/ of the template. The /active version/ is typically
-- the version of a template that\'s been most recently reviewed and
-- approved for use, depending on your workflow. It isn\'t necessarily the
-- latest version of a template.
customMessageActivity_templateVersion :: Lens.Lens' CustomMessageActivity (Prelude.Maybe Prelude.Text)
customMessageActivity_templateVersion :: (Maybe Text -> f (Maybe Text))
-> CustomMessageActivity -> f CustomMessageActivity
customMessageActivity_templateVersion = (CustomMessageActivity -> Maybe Text)
-> (CustomMessageActivity -> Maybe Text -> CustomMessageActivity)
-> Lens
     CustomMessageActivity
     CustomMessageActivity
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomMessageActivity' {Maybe Text
templateVersion :: Maybe Text
$sel:templateVersion:CustomMessageActivity' :: CustomMessageActivity -> Maybe Text
templateVersion} -> Maybe Text
templateVersion) (\s :: CustomMessageActivity
s@CustomMessageActivity' {} Maybe Text
a -> CustomMessageActivity
s {$sel:templateVersion:CustomMessageActivity' :: Maybe Text
templateVersion = Maybe Text
a} :: CustomMessageActivity)

-- | The types of endpoints to send the custom message to. Each valid value
-- maps to a type of channel that you can associate with an endpoint by
-- using the ChannelType property of an endpoint.
customMessageActivity_endpointTypes :: Lens.Lens' CustomMessageActivity (Prelude.Maybe [EndpointTypesElement])
customMessageActivity_endpointTypes :: (Maybe [EndpointTypesElement] -> f (Maybe [EndpointTypesElement]))
-> CustomMessageActivity -> f CustomMessageActivity
customMessageActivity_endpointTypes = (CustomMessageActivity -> Maybe [EndpointTypesElement])
-> (CustomMessageActivity
    -> Maybe [EndpointTypesElement] -> CustomMessageActivity)
-> Lens
     CustomMessageActivity
     CustomMessageActivity
     (Maybe [EndpointTypesElement])
     (Maybe [EndpointTypesElement])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomMessageActivity' {Maybe [EndpointTypesElement]
endpointTypes :: Maybe [EndpointTypesElement]
$sel:endpointTypes:CustomMessageActivity' :: CustomMessageActivity -> Maybe [EndpointTypesElement]
endpointTypes} -> Maybe [EndpointTypesElement]
endpointTypes) (\s :: CustomMessageActivity
s@CustomMessageActivity' {} Maybe [EndpointTypesElement]
a -> CustomMessageActivity
s {$sel:endpointTypes:CustomMessageActivity' :: Maybe [EndpointTypesElement]
endpointTypes = Maybe [EndpointTypesElement]
a} :: CustomMessageActivity) ((Maybe [EndpointTypesElement] -> f (Maybe [EndpointTypesElement]))
 -> CustomMessageActivity -> f CustomMessageActivity)
-> ((Maybe [EndpointTypesElement]
     -> f (Maybe [EndpointTypesElement]))
    -> Maybe [EndpointTypesElement]
    -> f (Maybe [EndpointTypesElement]))
-> (Maybe [EndpointTypesElement]
    -> f (Maybe [EndpointTypesElement]))
-> CustomMessageActivity
-> f CustomMessageActivity
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [EndpointTypesElement]
  [EndpointTypesElement]
  [EndpointTypesElement]
  [EndpointTypesElement]
-> Iso
     (Maybe [EndpointTypesElement])
     (Maybe [EndpointTypesElement])
     (Maybe [EndpointTypesElement])
     (Maybe [EndpointTypesElement])
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
  [EndpointTypesElement]
  [EndpointTypesElement]
  [EndpointTypesElement]
  [EndpointTypesElement]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The unique identifier for the next activity to perform, after Amazon
-- Pinpoint calls the AWS Lambda function or web hook.
customMessageActivity_nextActivity :: Lens.Lens' CustomMessageActivity (Prelude.Maybe Prelude.Text)
customMessageActivity_nextActivity :: (Maybe Text -> f (Maybe Text))
-> CustomMessageActivity -> f CustomMessageActivity
customMessageActivity_nextActivity = (CustomMessageActivity -> Maybe Text)
-> (CustomMessageActivity -> Maybe Text -> CustomMessageActivity)
-> Lens
     CustomMessageActivity
     CustomMessageActivity
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomMessageActivity' {Maybe Text
nextActivity :: Maybe Text
$sel:nextActivity:CustomMessageActivity' :: CustomMessageActivity -> Maybe Text
nextActivity} -> Maybe Text
nextActivity) (\s :: CustomMessageActivity
s@CustomMessageActivity' {} Maybe Text
a -> CustomMessageActivity
s {$sel:nextActivity:CustomMessageActivity' :: Maybe Text
nextActivity = Maybe Text
a} :: CustomMessageActivity)

-- | The destination to send the campaign or treatment to. This value can be
-- one of the following:
--
-- -   The name or Amazon Resource Name (ARN) of an AWS Lambda function to
--     invoke to handle delivery of the campaign or treatment.
--
-- -   The URL for a web application or service that supports HTTPS and can
--     receive the message. The URL has to be a full URL, including the
--     HTTPS protocol.
customMessageActivity_deliveryUri :: Lens.Lens' CustomMessageActivity (Prelude.Maybe Prelude.Text)
customMessageActivity_deliveryUri :: (Maybe Text -> f (Maybe Text))
-> CustomMessageActivity -> f CustomMessageActivity
customMessageActivity_deliveryUri = (CustomMessageActivity -> Maybe Text)
-> (CustomMessageActivity -> Maybe Text -> CustomMessageActivity)
-> Lens
     CustomMessageActivity
     CustomMessageActivity
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomMessageActivity' {Maybe Text
deliveryUri :: Maybe Text
$sel:deliveryUri:CustomMessageActivity' :: CustomMessageActivity -> Maybe Text
deliveryUri} -> Maybe Text
deliveryUri) (\s :: CustomMessageActivity
s@CustomMessageActivity' {} Maybe Text
a -> CustomMessageActivity
s {$sel:deliveryUri:CustomMessageActivity' :: Maybe Text
deliveryUri = Maybe Text
a} :: CustomMessageActivity)

-- | Specifies the message data included in a custom channel message that\'s
-- sent to participants in a journey.
customMessageActivity_messageConfig :: Lens.Lens' CustomMessageActivity (Prelude.Maybe JourneyCustomMessage)
customMessageActivity_messageConfig :: (Maybe JourneyCustomMessage -> f (Maybe JourneyCustomMessage))
-> CustomMessageActivity -> f CustomMessageActivity
customMessageActivity_messageConfig = (CustomMessageActivity -> Maybe JourneyCustomMessage)
-> (CustomMessageActivity
    -> Maybe JourneyCustomMessage -> CustomMessageActivity)
-> Lens
     CustomMessageActivity
     CustomMessageActivity
     (Maybe JourneyCustomMessage)
     (Maybe JourneyCustomMessage)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomMessageActivity' {Maybe JourneyCustomMessage
messageConfig :: Maybe JourneyCustomMessage
$sel:messageConfig:CustomMessageActivity' :: CustomMessageActivity -> Maybe JourneyCustomMessage
messageConfig} -> Maybe JourneyCustomMessage
messageConfig) (\s :: CustomMessageActivity
s@CustomMessageActivity' {} Maybe JourneyCustomMessage
a -> CustomMessageActivity
s {$sel:messageConfig:CustomMessageActivity' :: Maybe JourneyCustomMessage
messageConfig = Maybe JourneyCustomMessage
a} :: CustomMessageActivity)

instance Core.FromJSON CustomMessageActivity where
  parseJSON :: Value -> Parser CustomMessageActivity
parseJSON =
    String
-> (Object -> Parser CustomMessageActivity)
-> Value
-> Parser CustomMessageActivity
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CustomMessageActivity"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [EndpointTypesElement]
-> Maybe Text
-> Maybe Text
-> Maybe JourneyCustomMessage
-> CustomMessageActivity
CustomMessageActivity'
            (Maybe Text
 -> Maybe Text
 -> Maybe [EndpointTypesElement]
 -> Maybe Text
 -> Maybe Text
 -> Maybe JourneyCustomMessage
 -> CustomMessageActivity)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [EndpointTypesElement]
      -> Maybe Text
      -> Maybe Text
      -> Maybe JourneyCustomMessage
      -> CustomMessageActivity)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TemplateName")
            Parser
  (Maybe Text
   -> Maybe [EndpointTypesElement]
   -> Maybe Text
   -> Maybe Text
   -> Maybe JourneyCustomMessage
   -> CustomMessageActivity)
-> Parser (Maybe Text)
-> Parser
     (Maybe [EndpointTypesElement]
      -> Maybe Text
      -> Maybe Text
      -> Maybe JourneyCustomMessage
      -> CustomMessageActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TemplateVersion")
            Parser
  (Maybe [EndpointTypesElement]
   -> Maybe Text
   -> Maybe Text
   -> Maybe JourneyCustomMessage
   -> CustomMessageActivity)
-> Parser (Maybe [EndpointTypesElement])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe JourneyCustomMessage
      -> CustomMessageActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [EndpointTypesElement]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndpointTypes" Parser (Maybe (Maybe [EndpointTypesElement]))
-> Maybe [EndpointTypesElement]
-> Parser (Maybe [EndpointTypesElement])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [EndpointTypesElement]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe JourneyCustomMessage
   -> CustomMessageActivity)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe JourneyCustomMessage -> CustomMessageActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NextActivity")
            Parser
  (Maybe Text -> Maybe JourneyCustomMessage -> CustomMessageActivity)
-> Parser (Maybe Text)
-> Parser (Maybe JourneyCustomMessage -> CustomMessageActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DeliveryUri")
            Parser (Maybe JourneyCustomMessage -> CustomMessageActivity)
-> Parser (Maybe JourneyCustomMessage)
-> Parser CustomMessageActivity
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JourneyCustomMessage)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MessageConfig")
      )

instance Prelude.Hashable CustomMessageActivity

instance Prelude.NFData CustomMessageActivity

instance Core.ToJSON CustomMessageActivity where
  toJSON :: CustomMessageActivity -> Value
toJSON CustomMessageActivity' {Maybe [EndpointTypesElement]
Maybe Text
Maybe JourneyCustomMessage
messageConfig :: Maybe JourneyCustomMessage
deliveryUri :: Maybe Text
nextActivity :: Maybe Text
endpointTypes :: Maybe [EndpointTypesElement]
templateVersion :: Maybe Text
templateName :: Maybe Text
$sel:messageConfig:CustomMessageActivity' :: CustomMessageActivity -> Maybe JourneyCustomMessage
$sel:deliveryUri:CustomMessageActivity' :: CustomMessageActivity -> Maybe Text
$sel:nextActivity:CustomMessageActivity' :: CustomMessageActivity -> Maybe Text
$sel:endpointTypes:CustomMessageActivity' :: CustomMessageActivity -> Maybe [EndpointTypesElement]
$sel:templateVersion:CustomMessageActivity' :: CustomMessageActivity -> Maybe Text
$sel:templateName:CustomMessageActivity' :: CustomMessageActivity -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"TemplateName" 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
templateName,
            (Text
"TemplateVersion" 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
templateVersion,
            (Text
"EndpointTypes" Text -> [EndpointTypesElement] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([EndpointTypesElement] -> Pair)
-> Maybe [EndpointTypesElement] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [EndpointTypesElement]
endpointTypes,
            (Text
"NextActivity" 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
nextActivity,
            (Text
"DeliveryUri" 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
deliveryUri,
            (Text
"MessageConfig" Text -> JourneyCustomMessage -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (JourneyCustomMessage -> Pair)
-> Maybe JourneyCustomMessage -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JourneyCustomMessage
messageConfig
          ]
      )