{-# 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 #-}
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
data WriteCampaignRequest = WriteCampaignRequest'
{
WriteCampaignRequest -> Maybe CustomDeliveryConfiguration
customDeliveryConfiguration :: Prelude.Maybe CustomDeliveryConfiguration,
WriteCampaignRequest -> Maybe Int
priority :: Prelude.Maybe Prelude.Int,
WriteCampaignRequest -> Maybe Schedule
schedule :: Prelude.Maybe Schedule,
WriteCampaignRequest -> Maybe TemplateConfiguration
templateConfiguration :: Prelude.Maybe TemplateConfiguration,
WriteCampaignRequest -> Maybe CampaignHook
hook :: Prelude.Maybe CampaignHook,
WriteCampaignRequest -> Maybe Text
treatmentName :: Prelude.Maybe Prelude.Text,
WriteCampaignRequest -> Maybe CampaignLimits
limits :: Prelude.Maybe CampaignLimits,
WriteCampaignRequest -> Maybe Bool
isPaused :: Prelude.Maybe Prelude.Bool,
WriteCampaignRequest -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
WriteCampaignRequest -> Maybe Int
holdoutPercent :: Prelude.Maybe Prelude.Int,
WriteCampaignRequest -> Maybe Text
treatmentDescription :: Prelude.Maybe Prelude.Text,
WriteCampaignRequest -> Maybe MessageConfiguration
messageConfiguration :: Prelude.Maybe MessageConfiguration,
WriteCampaignRequest -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
WriteCampaignRequest -> Maybe Text
segmentId :: Prelude.Maybe Prelude.Text,
WriteCampaignRequest -> Maybe [WriteTreatmentResource]
additionalTreatments :: Prelude.Maybe [WriteTreatmentResource],
WriteCampaignRequest -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
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)
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
}
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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
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
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
]
)