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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.CampaignHook
import Amazonka.Pinpoint.Types.CampaignLimits
import Amazonka.Pinpoint.Types.CustomDeliveryConfiguration
import Amazonka.Pinpoint.Types.MessageConfiguration
import Amazonka.Pinpoint.Types.Schedule
import Amazonka.Pinpoint.Types.TemplateConfiguration
import Amazonka.Pinpoint.Types.WriteTreatmentResource
import qualified Amazonka.Prelude as Prelude

-- | Specifies the configuration and other settings for a campaign.
--
-- /See:/ 'newWriteCampaignRequest' smart constructor.
data WriteCampaignRequest = WriteCampaignRequest'
  { -- | The delivery configuration settings for sending the campaign through a
    -- custom channel. This object is required if the MessageConfiguration
    -- object for the campaign specifies a CustomMessage object.
    WriteCampaignRequest -> Maybe CustomDeliveryConfiguration
customDeliveryConfiguration :: Prelude.Maybe CustomDeliveryConfiguration,
    -- | Defines the priority of the campaign, used to decide the order of
    -- messages displayed to user if there are multiple messages scheduled to
    -- be displayed at the same moment.
    WriteCampaignRequest -> Maybe Int
priority :: Prelude.Maybe Prelude.Int,
    -- | The schedule settings for the campaign.
    WriteCampaignRequest -> Maybe Schedule
schedule :: Prelude.Maybe Schedule,
    -- | The message template to use for the campaign.
    WriteCampaignRequest -> Maybe TemplateConfiguration
templateConfiguration :: Prelude.Maybe TemplateConfiguration,
    -- | The settings for the AWS Lambda function to invoke as a code hook for
    -- the campaign. You can use this hook to customize the segment that\'s
    -- used by the campaign.
    WriteCampaignRequest -> Maybe CampaignHook
hook :: Prelude.Maybe CampaignHook,
    -- | A custom name of the default treatment for the campaign, if the campaign
    -- has multiple treatments. A /treatment/ is a variation of a campaign
    -- that\'s used for A\/B testing.
    WriteCampaignRequest -> Maybe Text
treatmentName :: Prelude.Maybe Prelude.Text,
    -- | The messaging limits for the campaign.
    WriteCampaignRequest -> Maybe CampaignLimits
limits :: Prelude.Maybe CampaignLimits,
    -- | Specifies whether to pause the campaign. A paused campaign doesn\'t run
    -- unless you resume it by changing this value to false.
    WriteCampaignRequest -> Maybe Bool
isPaused :: Prelude.Maybe Prelude.Bool,
    -- | A custom name for the campaign.
    WriteCampaignRequest -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The allocated percentage of users (segment members) who shouldn\'t
    -- receive messages from the campaign.
    WriteCampaignRequest -> Maybe Int
holdoutPercent :: Prelude.Maybe Prelude.Int,
    -- | A custom description of the default treatment for the campaign.
    WriteCampaignRequest -> Maybe Text
treatmentDescription :: Prelude.Maybe Prelude.Text,
    -- | The message configuration settings for the campaign.
    WriteCampaignRequest -> Maybe MessageConfiguration
messageConfiguration :: Prelude.Maybe MessageConfiguration,
    -- | A custom description of the campaign.
    WriteCampaignRequest -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the segment to associate with the campaign.
    WriteCampaignRequest -> Maybe Text
segmentId :: Prelude.Maybe Prelude.Text,
    -- | An array of requests that defines additional treatments for the
    -- campaign, in addition to the default treatment for the campaign.
    WriteCampaignRequest -> Maybe [WriteTreatmentResource]
additionalTreatments :: Prelude.Maybe [WriteTreatmentResource],
    -- | A string-to-string map of key-value pairs that defines the tags to
    -- associate with the campaign. Each tag consists of a required tag key and
    -- an associated tag value.
    WriteCampaignRequest -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The version of the segment to associate with the campaign.
    WriteCampaignRequest -> Maybe Int
segmentVersion :: Prelude.Maybe Prelude.Int
  }
  deriving (WriteCampaignRequest -> WriteCampaignRequest -> Bool
(WriteCampaignRequest -> WriteCampaignRequest -> Bool)
-> (WriteCampaignRequest -> WriteCampaignRequest -> Bool)
-> Eq WriteCampaignRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WriteCampaignRequest -> WriteCampaignRequest -> Bool
$c/= :: WriteCampaignRequest -> WriteCampaignRequest -> Bool
== :: WriteCampaignRequest -> WriteCampaignRequest -> Bool
$c== :: WriteCampaignRequest -> WriteCampaignRequest -> Bool
Prelude.Eq, ReadPrec [WriteCampaignRequest]
ReadPrec WriteCampaignRequest
Int -> ReadS WriteCampaignRequest
ReadS [WriteCampaignRequest]
(Int -> ReadS WriteCampaignRequest)
-> ReadS [WriteCampaignRequest]
-> ReadPrec WriteCampaignRequest
-> ReadPrec [WriteCampaignRequest]
-> Read WriteCampaignRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WriteCampaignRequest]
$creadListPrec :: ReadPrec [WriteCampaignRequest]
readPrec :: ReadPrec WriteCampaignRequest
$creadPrec :: ReadPrec WriteCampaignRequest
readList :: ReadS [WriteCampaignRequest]
$creadList :: ReadS [WriteCampaignRequest]
readsPrec :: Int -> ReadS WriteCampaignRequest
$creadsPrec :: Int -> ReadS WriteCampaignRequest
Prelude.Read, Int -> WriteCampaignRequest -> ShowS
[WriteCampaignRequest] -> ShowS
WriteCampaignRequest -> String
(Int -> WriteCampaignRequest -> ShowS)
-> (WriteCampaignRequest -> String)
-> ([WriteCampaignRequest] -> ShowS)
-> Show WriteCampaignRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WriteCampaignRequest] -> ShowS
$cshowList :: [WriteCampaignRequest] -> ShowS
show :: WriteCampaignRequest -> String
$cshow :: WriteCampaignRequest -> String
showsPrec :: Int -> WriteCampaignRequest -> ShowS
$cshowsPrec :: Int -> WriteCampaignRequest -> ShowS
Prelude.Show, (forall x. WriteCampaignRequest -> Rep WriteCampaignRequest x)
-> (forall x. Rep WriteCampaignRequest x -> WriteCampaignRequest)
-> Generic WriteCampaignRequest
forall x. Rep WriteCampaignRequest x -> WriteCampaignRequest
forall x. WriteCampaignRequest -> Rep WriteCampaignRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WriteCampaignRequest x -> WriteCampaignRequest
$cfrom :: forall x. WriteCampaignRequest -> Rep WriteCampaignRequest x
Prelude.Generic)

-- |
-- Create a value of 'WriteCampaignRequest' 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:
--
-- 'customDeliveryConfiguration', 'writeCampaignRequest_customDeliveryConfiguration' - The delivery configuration settings for sending the campaign through a
-- custom channel. This object is required if the MessageConfiguration
-- object for the campaign specifies a CustomMessage object.
--
-- 'priority', 'writeCampaignRequest_priority' - Defines the priority of the campaign, used to decide the order of
-- messages displayed to user if there are multiple messages scheduled to
-- be displayed at the same moment.
--
-- 'schedule', 'writeCampaignRequest_schedule' - The schedule settings for the campaign.
--
-- 'templateConfiguration', 'writeCampaignRequest_templateConfiguration' - The message template to use for the campaign.
--
-- 'hook', 'writeCampaignRequest_hook' - The settings for the AWS Lambda function to invoke as a code hook for
-- the campaign. You can use this hook to customize the segment that\'s
-- used by the campaign.
--
-- 'treatmentName', 'writeCampaignRequest_treatmentName' - A custom name of the default treatment for the campaign, if the campaign
-- has multiple treatments. A /treatment/ is a variation of a campaign
-- that\'s used for A\/B testing.
--
-- 'limits', 'writeCampaignRequest_limits' - The messaging limits for the campaign.
--
-- 'isPaused', 'writeCampaignRequest_isPaused' - Specifies whether to pause the campaign. A paused campaign doesn\'t run
-- unless you resume it by changing this value to false.
--
-- 'name', 'writeCampaignRequest_name' - A custom name for the campaign.
--
-- 'holdoutPercent', 'writeCampaignRequest_holdoutPercent' - The allocated percentage of users (segment members) who shouldn\'t
-- receive messages from the campaign.
--
-- 'treatmentDescription', 'writeCampaignRequest_treatmentDescription' - A custom description of the default treatment for the campaign.
--
-- 'messageConfiguration', 'writeCampaignRequest_messageConfiguration' - The message configuration settings for the campaign.
--
-- 'description', 'writeCampaignRequest_description' - A custom description of the campaign.
--
-- 'segmentId', 'writeCampaignRequest_segmentId' - The unique identifier for the segment to associate with the campaign.
--
-- 'additionalTreatments', 'writeCampaignRequest_additionalTreatments' - An array of requests that defines additional treatments for the
-- campaign, in addition to the default treatment for the campaign.
--
-- 'tags', 'writeCampaignRequest_tags' - A string-to-string map of key-value pairs that defines the tags to
-- associate with the campaign. Each tag consists of a required tag key and
-- an associated tag value.
--
-- 'segmentVersion', 'writeCampaignRequest_segmentVersion' - The version of the segment to associate with the campaign.
newWriteCampaignRequest ::
  WriteCampaignRequest
newWriteCampaignRequest :: WriteCampaignRequest
newWriteCampaignRequest =
  WriteCampaignRequest' :: Maybe CustomDeliveryConfiguration
-> Maybe Int
-> Maybe Schedule
-> Maybe TemplateConfiguration
-> Maybe CampaignHook
-> Maybe Text
-> Maybe CampaignLimits
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe MessageConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe [WriteTreatmentResource]
-> Maybe (HashMap Text Text)
-> Maybe Int
-> WriteCampaignRequest
WriteCampaignRequest'
    { $sel:customDeliveryConfiguration:WriteCampaignRequest' :: Maybe CustomDeliveryConfiguration
customDeliveryConfiguration =
        Maybe CustomDeliveryConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:priority:WriteCampaignRequest' :: Maybe Int
priority = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:schedule:WriteCampaignRequest' :: Maybe Schedule
schedule = Maybe Schedule
forall a. Maybe a
Prelude.Nothing,
      $sel:templateConfiguration:WriteCampaignRequest' :: Maybe TemplateConfiguration
templateConfiguration = Maybe TemplateConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:hook:WriteCampaignRequest' :: Maybe CampaignHook
hook = Maybe CampaignHook
forall a. Maybe a
Prelude.Nothing,
      $sel:treatmentName:WriteCampaignRequest' :: Maybe Text
treatmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limits:WriteCampaignRequest' :: Maybe CampaignLimits
limits = Maybe CampaignLimits
forall a. Maybe a
Prelude.Nothing,
      $sel:isPaused:WriteCampaignRequest' :: Maybe Bool
isPaused = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:name:WriteCampaignRequest' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:holdoutPercent:WriteCampaignRequest' :: Maybe Int
holdoutPercent = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:treatmentDescription:WriteCampaignRequest' :: Maybe Text
treatmentDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:messageConfiguration:WriteCampaignRequest' :: Maybe MessageConfiguration
messageConfiguration = Maybe MessageConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:description:WriteCampaignRequest' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:segmentId:WriteCampaignRequest' :: Maybe Text
segmentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:additionalTreatments:WriteCampaignRequest' :: Maybe [WriteTreatmentResource]
additionalTreatments = Maybe [WriteTreatmentResource]
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:WriteCampaignRequest' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:segmentVersion:WriteCampaignRequest' :: Maybe Int
segmentVersion = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The delivery configuration settings for sending the campaign through a
-- custom channel. This object is required if the MessageConfiguration
-- object for the campaign specifies a CustomMessage object.
writeCampaignRequest_customDeliveryConfiguration :: Lens.Lens' WriteCampaignRequest (Prelude.Maybe CustomDeliveryConfiguration)
writeCampaignRequest_customDeliveryConfiguration :: (Maybe CustomDeliveryConfiguration
 -> f (Maybe CustomDeliveryConfiguration))
-> WriteCampaignRequest -> f WriteCampaignRequest
writeCampaignRequest_customDeliveryConfiguration = (WriteCampaignRequest -> Maybe CustomDeliveryConfiguration)
-> (WriteCampaignRequest
    -> Maybe CustomDeliveryConfiguration -> WriteCampaignRequest)
-> Lens
     WriteCampaignRequest
     WriteCampaignRequest
     (Maybe CustomDeliveryConfiguration)
     (Maybe CustomDeliveryConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WriteCampaignRequest' {Maybe CustomDeliveryConfiguration
customDeliveryConfiguration :: Maybe CustomDeliveryConfiguration
$sel:customDeliveryConfiguration:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe CustomDeliveryConfiguration
customDeliveryConfiguration} -> Maybe CustomDeliveryConfiguration
customDeliveryConfiguration) (\s :: WriteCampaignRequest
s@WriteCampaignRequest' {} Maybe CustomDeliveryConfiguration
a -> WriteCampaignRequest
s {$sel:customDeliveryConfiguration:WriteCampaignRequest' :: Maybe CustomDeliveryConfiguration
customDeliveryConfiguration = Maybe CustomDeliveryConfiguration
a} :: WriteCampaignRequest)

-- | Defines the priority of the campaign, used to decide the order of
-- messages displayed to user if there are multiple messages scheduled to
-- be displayed at the same moment.
writeCampaignRequest_priority :: Lens.Lens' WriteCampaignRequest (Prelude.Maybe Prelude.Int)
writeCampaignRequest_priority :: (Maybe Int -> f (Maybe Int))
-> WriteCampaignRequest -> f WriteCampaignRequest
writeCampaignRequest_priority = (WriteCampaignRequest -> Maybe Int)
-> (WriteCampaignRequest -> Maybe Int -> WriteCampaignRequest)
-> Lens
     WriteCampaignRequest WriteCampaignRequest (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WriteCampaignRequest' {Maybe Int
priority :: Maybe Int
$sel:priority:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Int
priority} -> Maybe Int
priority) (\s :: WriteCampaignRequest
s@WriteCampaignRequest' {} Maybe Int
a -> WriteCampaignRequest
s {$sel:priority:WriteCampaignRequest' :: Maybe Int
priority = Maybe Int
a} :: WriteCampaignRequest)

-- | The schedule settings for the campaign.
writeCampaignRequest_schedule :: Lens.Lens' WriteCampaignRequest (Prelude.Maybe Schedule)
writeCampaignRequest_schedule :: (Maybe Schedule -> f (Maybe Schedule))
-> WriteCampaignRequest -> f WriteCampaignRequest
writeCampaignRequest_schedule = (WriteCampaignRequest -> Maybe Schedule)
-> (WriteCampaignRequest -> Maybe Schedule -> WriteCampaignRequest)
-> Lens
     WriteCampaignRequest
     WriteCampaignRequest
     (Maybe Schedule)
     (Maybe Schedule)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WriteCampaignRequest' {Maybe Schedule
schedule :: Maybe Schedule
$sel:schedule:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Schedule
schedule} -> Maybe Schedule
schedule) (\s :: WriteCampaignRequest
s@WriteCampaignRequest' {} Maybe Schedule
a -> WriteCampaignRequest
s {$sel:schedule:WriteCampaignRequest' :: Maybe Schedule
schedule = Maybe Schedule
a} :: WriteCampaignRequest)

-- | The message template to use for the campaign.
writeCampaignRequest_templateConfiguration :: Lens.Lens' WriteCampaignRequest (Prelude.Maybe TemplateConfiguration)
writeCampaignRequest_templateConfiguration :: (Maybe TemplateConfiguration -> f (Maybe TemplateConfiguration))
-> WriteCampaignRequest -> f WriteCampaignRequest
writeCampaignRequest_templateConfiguration = (WriteCampaignRequest -> Maybe TemplateConfiguration)
-> (WriteCampaignRequest
    -> Maybe TemplateConfiguration -> WriteCampaignRequest)
-> Lens
     WriteCampaignRequest
     WriteCampaignRequest
     (Maybe TemplateConfiguration)
     (Maybe TemplateConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WriteCampaignRequest' {Maybe TemplateConfiguration
templateConfiguration :: Maybe TemplateConfiguration
$sel:templateConfiguration:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe TemplateConfiguration
templateConfiguration} -> Maybe TemplateConfiguration
templateConfiguration) (\s :: WriteCampaignRequest
s@WriteCampaignRequest' {} Maybe TemplateConfiguration
a -> WriteCampaignRequest
s {$sel:templateConfiguration:WriteCampaignRequest' :: Maybe TemplateConfiguration
templateConfiguration = Maybe TemplateConfiguration
a} :: WriteCampaignRequest)

-- | The settings for the AWS Lambda function to invoke as a code hook for
-- the campaign. You can use this hook to customize the segment that\'s
-- used by the campaign.
writeCampaignRequest_hook :: Lens.Lens' WriteCampaignRequest (Prelude.Maybe CampaignHook)
writeCampaignRequest_hook :: (Maybe CampaignHook -> f (Maybe CampaignHook))
-> WriteCampaignRequest -> f WriteCampaignRequest
writeCampaignRequest_hook = (WriteCampaignRequest -> Maybe CampaignHook)
-> (WriteCampaignRequest
    -> Maybe CampaignHook -> WriteCampaignRequest)
-> Lens
     WriteCampaignRequest
     WriteCampaignRequest
     (Maybe CampaignHook)
     (Maybe CampaignHook)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WriteCampaignRequest' {Maybe CampaignHook
hook :: Maybe CampaignHook
$sel:hook:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe CampaignHook
hook} -> Maybe CampaignHook
hook) (\s :: WriteCampaignRequest
s@WriteCampaignRequest' {} Maybe CampaignHook
a -> WriteCampaignRequest
s {$sel:hook:WriteCampaignRequest' :: Maybe CampaignHook
hook = Maybe CampaignHook
a} :: WriteCampaignRequest)

-- | A custom name of the default treatment for the campaign, if the campaign
-- has multiple treatments. A /treatment/ is a variation of a campaign
-- that\'s used for A\/B testing.
writeCampaignRequest_treatmentName :: Lens.Lens' WriteCampaignRequest (Prelude.Maybe Prelude.Text)
writeCampaignRequest_treatmentName :: (Maybe Text -> f (Maybe Text))
-> WriteCampaignRequest -> f WriteCampaignRequest
writeCampaignRequest_treatmentName = (WriteCampaignRequest -> Maybe Text)
-> (WriteCampaignRequest -> Maybe Text -> WriteCampaignRequest)
-> Lens
     WriteCampaignRequest WriteCampaignRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WriteCampaignRequest' {Maybe Text
treatmentName :: Maybe Text
$sel:treatmentName:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Text
treatmentName} -> Maybe Text
treatmentName) (\s :: WriteCampaignRequest
s@WriteCampaignRequest' {} Maybe Text
a -> WriteCampaignRequest
s {$sel:treatmentName:WriteCampaignRequest' :: Maybe Text
treatmentName = Maybe Text
a} :: WriteCampaignRequest)

-- | The messaging limits for the campaign.
writeCampaignRequest_limits :: Lens.Lens' WriteCampaignRequest (Prelude.Maybe CampaignLimits)
writeCampaignRequest_limits :: (Maybe CampaignLimits -> f (Maybe CampaignLimits))
-> WriteCampaignRequest -> f WriteCampaignRequest
writeCampaignRequest_limits = (WriteCampaignRequest -> Maybe CampaignLimits)
-> (WriteCampaignRequest
    -> Maybe CampaignLimits -> WriteCampaignRequest)
-> Lens
     WriteCampaignRequest
     WriteCampaignRequest
     (Maybe CampaignLimits)
     (Maybe CampaignLimits)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WriteCampaignRequest' {Maybe CampaignLimits
limits :: Maybe CampaignLimits
$sel:limits:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe CampaignLimits
limits} -> Maybe CampaignLimits
limits) (\s :: WriteCampaignRequest
s@WriteCampaignRequest' {} Maybe CampaignLimits
a -> WriteCampaignRequest
s {$sel:limits:WriteCampaignRequest' :: Maybe CampaignLimits
limits = Maybe CampaignLimits
a} :: WriteCampaignRequest)

-- | Specifies whether to pause the campaign. A paused campaign doesn\'t run
-- unless you resume it by changing this value to false.
writeCampaignRequest_isPaused :: Lens.Lens' WriteCampaignRequest (Prelude.Maybe Prelude.Bool)
writeCampaignRequest_isPaused :: (Maybe Bool -> f (Maybe Bool))
-> WriteCampaignRequest -> f WriteCampaignRequest
writeCampaignRequest_isPaused = (WriteCampaignRequest -> Maybe Bool)
-> (WriteCampaignRequest -> Maybe Bool -> WriteCampaignRequest)
-> Lens
     WriteCampaignRequest WriteCampaignRequest (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WriteCampaignRequest' {Maybe Bool
isPaused :: Maybe Bool
$sel:isPaused:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Bool
isPaused} -> Maybe Bool
isPaused) (\s :: WriteCampaignRequest
s@WriteCampaignRequest' {} Maybe Bool
a -> WriteCampaignRequest
s {$sel:isPaused:WriteCampaignRequest' :: Maybe Bool
isPaused = Maybe Bool
a} :: WriteCampaignRequest)

-- | A custom name for the campaign.
writeCampaignRequest_name :: Lens.Lens' WriteCampaignRequest (Prelude.Maybe Prelude.Text)
writeCampaignRequest_name :: (Maybe Text -> f (Maybe Text))
-> WriteCampaignRequest -> f WriteCampaignRequest
writeCampaignRequest_name = (WriteCampaignRequest -> Maybe Text)
-> (WriteCampaignRequest -> Maybe Text -> WriteCampaignRequest)
-> Lens
     WriteCampaignRequest WriteCampaignRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WriteCampaignRequest' {Maybe Text
name :: Maybe Text
$sel:name:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Text
name} -> Maybe Text
name) (\s :: WriteCampaignRequest
s@WriteCampaignRequest' {} Maybe Text
a -> WriteCampaignRequest
s {$sel:name:WriteCampaignRequest' :: Maybe Text
name = Maybe Text
a} :: WriteCampaignRequest)

-- | The allocated percentage of users (segment members) who shouldn\'t
-- receive messages from the campaign.
writeCampaignRequest_holdoutPercent :: Lens.Lens' WriteCampaignRequest (Prelude.Maybe Prelude.Int)
writeCampaignRequest_holdoutPercent :: (Maybe Int -> f (Maybe Int))
-> WriteCampaignRequest -> f WriteCampaignRequest
writeCampaignRequest_holdoutPercent = (WriteCampaignRequest -> Maybe Int)
-> (WriteCampaignRequest -> Maybe Int -> WriteCampaignRequest)
-> Lens
     WriteCampaignRequest WriteCampaignRequest (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WriteCampaignRequest' {Maybe Int
holdoutPercent :: Maybe Int
$sel:holdoutPercent:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Int
holdoutPercent} -> Maybe Int
holdoutPercent) (\s :: WriteCampaignRequest
s@WriteCampaignRequest' {} Maybe Int
a -> WriteCampaignRequest
s {$sel:holdoutPercent:WriteCampaignRequest' :: Maybe Int
holdoutPercent = Maybe Int
a} :: WriteCampaignRequest)

-- | A custom description of the default treatment for the campaign.
writeCampaignRequest_treatmentDescription :: Lens.Lens' WriteCampaignRequest (Prelude.Maybe Prelude.Text)
writeCampaignRequest_treatmentDescription :: (Maybe Text -> f (Maybe Text))
-> WriteCampaignRequest -> f WriteCampaignRequest
writeCampaignRequest_treatmentDescription = (WriteCampaignRequest -> Maybe Text)
-> (WriteCampaignRequest -> Maybe Text -> WriteCampaignRequest)
-> Lens
     WriteCampaignRequest WriteCampaignRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WriteCampaignRequest' {Maybe Text
treatmentDescription :: Maybe Text
$sel:treatmentDescription:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Text
treatmentDescription} -> Maybe Text
treatmentDescription) (\s :: WriteCampaignRequest
s@WriteCampaignRequest' {} Maybe Text
a -> WriteCampaignRequest
s {$sel:treatmentDescription:WriteCampaignRequest' :: Maybe Text
treatmentDescription = Maybe Text
a} :: WriteCampaignRequest)

-- | The message configuration settings for the campaign.
writeCampaignRequest_messageConfiguration :: Lens.Lens' WriteCampaignRequest (Prelude.Maybe MessageConfiguration)
writeCampaignRequest_messageConfiguration :: (Maybe MessageConfiguration -> f (Maybe MessageConfiguration))
-> WriteCampaignRequest -> f WriteCampaignRequest
writeCampaignRequest_messageConfiguration = (WriteCampaignRequest -> Maybe MessageConfiguration)
-> (WriteCampaignRequest
    -> Maybe MessageConfiguration -> WriteCampaignRequest)
-> Lens
     WriteCampaignRequest
     WriteCampaignRequest
     (Maybe MessageConfiguration)
     (Maybe MessageConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WriteCampaignRequest' {Maybe MessageConfiguration
messageConfiguration :: Maybe MessageConfiguration
$sel:messageConfiguration:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe MessageConfiguration
messageConfiguration} -> Maybe MessageConfiguration
messageConfiguration) (\s :: WriteCampaignRequest
s@WriteCampaignRequest' {} Maybe MessageConfiguration
a -> WriteCampaignRequest
s {$sel:messageConfiguration:WriteCampaignRequest' :: Maybe MessageConfiguration
messageConfiguration = Maybe MessageConfiguration
a} :: WriteCampaignRequest)

-- | A custom description of the campaign.
writeCampaignRequest_description :: Lens.Lens' WriteCampaignRequest (Prelude.Maybe Prelude.Text)
writeCampaignRequest_description :: (Maybe Text -> f (Maybe Text))
-> WriteCampaignRequest -> f WriteCampaignRequest
writeCampaignRequest_description = (WriteCampaignRequest -> Maybe Text)
-> (WriteCampaignRequest -> Maybe Text -> WriteCampaignRequest)
-> Lens
     WriteCampaignRequest WriteCampaignRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WriteCampaignRequest' {Maybe Text
description :: Maybe Text
$sel:description:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Text
description} -> Maybe Text
description) (\s :: WriteCampaignRequest
s@WriteCampaignRequest' {} Maybe Text
a -> WriteCampaignRequest
s {$sel:description:WriteCampaignRequest' :: Maybe Text
description = Maybe Text
a} :: WriteCampaignRequest)

-- | The unique identifier for the segment to associate with the campaign.
writeCampaignRequest_segmentId :: Lens.Lens' WriteCampaignRequest (Prelude.Maybe Prelude.Text)
writeCampaignRequest_segmentId :: (Maybe Text -> f (Maybe Text))
-> WriteCampaignRequest -> f WriteCampaignRequest
writeCampaignRequest_segmentId = (WriteCampaignRequest -> Maybe Text)
-> (WriteCampaignRequest -> Maybe Text -> WriteCampaignRequest)
-> Lens
     WriteCampaignRequest WriteCampaignRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WriteCampaignRequest' {Maybe Text
segmentId :: Maybe Text
$sel:segmentId:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Text
segmentId} -> Maybe Text
segmentId) (\s :: WriteCampaignRequest
s@WriteCampaignRequest' {} Maybe Text
a -> WriteCampaignRequest
s {$sel:segmentId:WriteCampaignRequest' :: Maybe Text
segmentId = Maybe Text
a} :: WriteCampaignRequest)

-- | An array of requests that defines additional treatments for the
-- campaign, in addition to the default treatment for the campaign.
writeCampaignRequest_additionalTreatments :: Lens.Lens' WriteCampaignRequest (Prelude.Maybe [WriteTreatmentResource])
writeCampaignRequest_additionalTreatments :: (Maybe [WriteTreatmentResource]
 -> f (Maybe [WriteTreatmentResource]))
-> WriteCampaignRequest -> f WriteCampaignRequest
writeCampaignRequest_additionalTreatments = (WriteCampaignRequest -> Maybe [WriteTreatmentResource])
-> (WriteCampaignRequest
    -> Maybe [WriteTreatmentResource] -> WriteCampaignRequest)
-> Lens
     WriteCampaignRequest
     WriteCampaignRequest
     (Maybe [WriteTreatmentResource])
     (Maybe [WriteTreatmentResource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WriteCampaignRequest' {Maybe [WriteTreatmentResource]
additionalTreatments :: Maybe [WriteTreatmentResource]
$sel:additionalTreatments:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe [WriteTreatmentResource]
additionalTreatments} -> Maybe [WriteTreatmentResource]
additionalTreatments) (\s :: WriteCampaignRequest
s@WriteCampaignRequest' {} Maybe [WriteTreatmentResource]
a -> WriteCampaignRequest
s {$sel:additionalTreatments:WriteCampaignRequest' :: Maybe [WriteTreatmentResource]
additionalTreatments = Maybe [WriteTreatmentResource]
a} :: WriteCampaignRequest) ((Maybe [WriteTreatmentResource]
  -> f (Maybe [WriteTreatmentResource]))
 -> WriteCampaignRequest -> f WriteCampaignRequest)
-> ((Maybe [WriteTreatmentResource]
     -> f (Maybe [WriteTreatmentResource]))
    -> Maybe [WriteTreatmentResource]
    -> f (Maybe [WriteTreatmentResource]))
-> (Maybe [WriteTreatmentResource]
    -> f (Maybe [WriteTreatmentResource]))
-> WriteCampaignRequest
-> f WriteCampaignRequest
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [WriteTreatmentResource]
  [WriteTreatmentResource]
  [WriteTreatmentResource]
  [WriteTreatmentResource]
-> Iso
     (Maybe [WriteTreatmentResource])
     (Maybe [WriteTreatmentResource])
     (Maybe [WriteTreatmentResource])
     (Maybe [WriteTreatmentResource])
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
  [WriteTreatmentResource]
  [WriteTreatmentResource]
  [WriteTreatmentResource]
  [WriteTreatmentResource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The version of the segment to associate with the campaign.
writeCampaignRequest_segmentVersion :: Lens.Lens' WriteCampaignRequest (Prelude.Maybe Prelude.Int)
writeCampaignRequest_segmentVersion :: (Maybe Int -> f (Maybe Int))
-> WriteCampaignRequest -> f WriteCampaignRequest
writeCampaignRequest_segmentVersion = (WriteCampaignRequest -> Maybe Int)
-> (WriteCampaignRequest -> Maybe Int -> WriteCampaignRequest)
-> Lens
     WriteCampaignRequest WriteCampaignRequest (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WriteCampaignRequest' {Maybe Int
segmentVersion :: Maybe Int
$sel:segmentVersion:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Int
segmentVersion} -> Maybe Int
segmentVersion) (\s :: WriteCampaignRequest
s@WriteCampaignRequest' {} Maybe Int
a -> WriteCampaignRequest
s {$sel:segmentVersion:WriteCampaignRequest' :: Maybe Int
segmentVersion = Maybe Int
a} :: WriteCampaignRequest)

instance Prelude.Hashable WriteCampaignRequest

instance Prelude.NFData WriteCampaignRequest

instance Core.ToJSON WriteCampaignRequest where
  toJSON :: WriteCampaignRequest -> Value
toJSON WriteCampaignRequest' {Maybe Bool
Maybe Int
Maybe [WriteTreatmentResource]
Maybe Text
Maybe (HashMap Text Text)
Maybe CampaignLimits
Maybe CustomDeliveryConfiguration
Maybe CampaignHook
Maybe MessageConfiguration
Maybe Schedule
Maybe TemplateConfiguration
segmentVersion :: Maybe Int
tags :: Maybe (HashMap Text Text)
additionalTreatments :: Maybe [WriteTreatmentResource]
segmentId :: Maybe Text
description :: Maybe Text
messageConfiguration :: Maybe MessageConfiguration
treatmentDescription :: Maybe Text
holdoutPercent :: Maybe Int
name :: Maybe Text
isPaused :: Maybe Bool
limits :: Maybe CampaignLimits
treatmentName :: Maybe Text
hook :: Maybe CampaignHook
templateConfiguration :: Maybe TemplateConfiguration
schedule :: Maybe Schedule
priority :: Maybe Int
customDeliveryConfiguration :: Maybe CustomDeliveryConfiguration
$sel:segmentVersion:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Int
$sel:tags:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe (HashMap Text Text)
$sel:additionalTreatments:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe [WriteTreatmentResource]
$sel:segmentId:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Text
$sel:description:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Text
$sel:messageConfiguration:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe MessageConfiguration
$sel:treatmentDescription:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Text
$sel:holdoutPercent:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Int
$sel:name:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Text
$sel:isPaused:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Bool
$sel:limits:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe CampaignLimits
$sel:treatmentName:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Text
$sel:hook:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe CampaignHook
$sel:templateConfiguration:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe TemplateConfiguration
$sel:schedule:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Schedule
$sel:priority:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe Int
$sel:customDeliveryConfiguration:WriteCampaignRequest' :: WriteCampaignRequest -> Maybe CustomDeliveryConfiguration
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"CustomDeliveryConfiguration" Text -> CustomDeliveryConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (CustomDeliveryConfiguration -> Pair)
-> Maybe CustomDeliveryConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CustomDeliveryConfiguration
customDeliveryConfiguration,
            (Text
"Priority" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
priority,
            (Text
"Schedule" Text -> Schedule -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Schedule -> Pair) -> Maybe Schedule -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Schedule
schedule,
            (Text
"TemplateConfiguration" Text -> TemplateConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (TemplateConfiguration -> Pair)
-> Maybe TemplateConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TemplateConfiguration
templateConfiguration,
            (Text
"Hook" Text -> CampaignHook -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CampaignHook -> Pair) -> Maybe CampaignHook -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CampaignHook
hook,
            (Text
"TreatmentName" 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
treatmentName,
            (Text
"Limits" Text -> CampaignLimits -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CampaignLimits -> Pair) -> Maybe CampaignLimits -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CampaignLimits
limits,
            (Text
"IsPaused" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
isPaused,
            (Text
"Name" 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
name,
            (Text
"HoldoutPercent" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
holdoutPercent,
            (Text
"TreatmentDescription" 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
treatmentDescription,
            (Text
"MessageConfiguration" Text -> MessageConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (MessageConfiguration -> Pair)
-> Maybe MessageConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MessageConfiguration
messageConfiguration,
            (Text
"Description" 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
description,
            (Text
"SegmentId" 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
segmentId,
            (Text
"AdditionalTreatments" Text -> [WriteTreatmentResource] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([WriteTreatmentResource] -> Pair)
-> Maybe [WriteTreatmentResource] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [WriteTreatmentResource]
additionalTreatments,
            (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,
            (Text
"SegmentVersion" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
segmentVersion
          ]
      )