{-# 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.CampaignResponse
-- 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.CampaignResponse 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.CampaignState
import Amazonka.Pinpoint.Types.CustomDeliveryConfiguration
import Amazonka.Pinpoint.Types.MessageConfiguration
import Amazonka.Pinpoint.Types.Schedule
import Amazonka.Pinpoint.Types.TemplateConfiguration
import Amazonka.Pinpoint.Types.TreatmentResource
import qualified Amazonka.Prelude as Prelude

-- | Provides information about the status, configuration, and other settings
-- for a campaign.
--
-- /See:/ 'newCampaignResponse' smart constructor.
data CampaignResponse = CampaignResponse'
  { -- | The delivery configuration settings for sending the campaign through a
    -- custom channel.
    CampaignResponse -> Maybe CustomDeliveryConfiguration
customDeliveryConfiguration :: Prelude.Maybe CustomDeliveryConfiguration,
    -- | The current status of the campaign.
    CampaignResponse -> Maybe CampaignState
state :: Prelude.Maybe CampaignState,
    -- | 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.
    CampaignResponse -> Maybe Int
priority :: Prelude.Maybe Prelude.Int,
    -- | The schedule settings for the campaign.
    CampaignResponse -> Maybe Schedule
schedule :: Prelude.Maybe Schedule,
    -- | The message template that’s used for the campaign.
    CampaignResponse -> Maybe TemplateConfiguration
templateConfiguration :: Prelude.Maybe TemplateConfiguration,
    -- | The settings for the AWS Lambda function to use as a code hook for the
    -- campaign. You can use this hook to customize the segment that\'s used by
    -- the campaign.
    CampaignResponse -> Maybe CampaignHook
hook :: Prelude.Maybe CampaignHook,
    -- | The 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.
    CampaignResponse -> Maybe Text
treatmentName :: Prelude.Maybe Prelude.Text,
    -- | The messaging limits for the campaign.
    CampaignResponse -> Maybe CampaignLimits
limits :: Prelude.Maybe CampaignLimits,
    -- | Specifies whether the campaign is paused. A paused campaign doesn\'t run
    -- unless you resume it by changing this value to false.
    CampaignResponse -> Maybe Bool
isPaused :: Prelude.Maybe Prelude.Bool,
    -- | The current status of the campaign\'s default treatment. This value
    -- exists only for campaigns that have more than one treatment.
    CampaignResponse -> Maybe CampaignState
defaultState :: Prelude.Maybe CampaignState,
    -- | The name of the campaign.
    CampaignResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The version number of the campaign.
    CampaignResponse -> Maybe Int
version :: Prelude.Maybe Prelude.Int,
    -- | The allocated percentage of users (segment members) who shouldn\'t
    -- receive messages from the campaign.
    CampaignResponse -> Maybe Int
holdoutPercent :: Prelude.Maybe Prelude.Int,
    -- | The custom description of the default treatment for the campaign.
    CampaignResponse -> Maybe Text
treatmentDescription :: Prelude.Maybe Prelude.Text,
    -- | The message configuration settings for the campaign.
    CampaignResponse -> Maybe MessageConfiguration
messageConfiguration :: Prelude.Maybe MessageConfiguration,
    -- | The custom description of the campaign.
    CampaignResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | An array of responses, one for each treatment that you defined for the
    -- campaign, in addition to the default treatment.
    CampaignResponse -> Maybe [TreatmentResource]
additionalTreatments :: Prelude.Maybe [TreatmentResource],
    -- | A string-to-string map of key-value pairs that identifies the tags that
    -- are associated with the campaign. Each tag consists of a required tag
    -- key and an associated tag value.
    CampaignResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The date, in ISO 8601 format, when the campaign was last modified.
    CampaignResponse -> Text
lastModifiedDate :: Prelude.Text,
    -- | The date, in ISO 8601 format, when the campaign was created.
    CampaignResponse -> Text
creationDate :: Prelude.Text,
    -- | The unique identifier for the segment that\'s associated with the
    -- campaign.
    CampaignResponse -> Text
segmentId :: Prelude.Text,
    -- | The version number of the segment that\'s associated with the campaign.
    CampaignResponse -> Int
segmentVersion :: Prelude.Int,
    -- | The unique identifier for the campaign.
    CampaignResponse -> Text
id :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the campaign.
    CampaignResponse -> Text
arn :: Prelude.Text,
    -- | The unique identifier for the application that the campaign applies to.
    CampaignResponse -> Text
applicationId :: Prelude.Text
  }
  deriving (CampaignResponse -> CampaignResponse -> Bool
(CampaignResponse -> CampaignResponse -> Bool)
-> (CampaignResponse -> CampaignResponse -> Bool)
-> Eq CampaignResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CampaignResponse -> CampaignResponse -> Bool
$c/= :: CampaignResponse -> CampaignResponse -> Bool
== :: CampaignResponse -> CampaignResponse -> Bool
$c== :: CampaignResponse -> CampaignResponse -> Bool
Prelude.Eq, ReadPrec [CampaignResponse]
ReadPrec CampaignResponse
Int -> ReadS CampaignResponse
ReadS [CampaignResponse]
(Int -> ReadS CampaignResponse)
-> ReadS [CampaignResponse]
-> ReadPrec CampaignResponse
-> ReadPrec [CampaignResponse]
-> Read CampaignResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CampaignResponse]
$creadListPrec :: ReadPrec [CampaignResponse]
readPrec :: ReadPrec CampaignResponse
$creadPrec :: ReadPrec CampaignResponse
readList :: ReadS [CampaignResponse]
$creadList :: ReadS [CampaignResponse]
readsPrec :: Int -> ReadS CampaignResponse
$creadsPrec :: Int -> ReadS CampaignResponse
Prelude.Read, Int -> CampaignResponse -> ShowS
[CampaignResponse] -> ShowS
CampaignResponse -> String
(Int -> CampaignResponse -> ShowS)
-> (CampaignResponse -> String)
-> ([CampaignResponse] -> ShowS)
-> Show CampaignResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CampaignResponse] -> ShowS
$cshowList :: [CampaignResponse] -> ShowS
show :: CampaignResponse -> String
$cshow :: CampaignResponse -> String
showsPrec :: Int -> CampaignResponse -> ShowS
$cshowsPrec :: Int -> CampaignResponse -> ShowS
Prelude.Show, (forall x. CampaignResponse -> Rep CampaignResponse x)
-> (forall x. Rep CampaignResponse x -> CampaignResponse)
-> Generic CampaignResponse
forall x. Rep CampaignResponse x -> CampaignResponse
forall x. CampaignResponse -> Rep CampaignResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CampaignResponse x -> CampaignResponse
$cfrom :: forall x. CampaignResponse -> Rep CampaignResponse x
Prelude.Generic)

-- |
-- Create a value of 'CampaignResponse' 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', 'campaignResponse_customDeliveryConfiguration' - The delivery configuration settings for sending the campaign through a
-- custom channel.
--
-- 'state', 'campaignResponse_state' - The current status of the campaign.
--
-- 'priority', 'campaignResponse_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', 'campaignResponse_schedule' - The schedule settings for the campaign.
--
-- 'templateConfiguration', 'campaignResponse_templateConfiguration' - The message template that’s used for the campaign.
--
-- 'hook', 'campaignResponse_hook' - The settings for the AWS Lambda function to use as a code hook for the
-- campaign. You can use this hook to customize the segment that\'s used by
-- the campaign.
--
-- 'treatmentName', 'campaignResponse_treatmentName' - The 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', 'campaignResponse_limits' - The messaging limits for the campaign.
--
-- 'isPaused', 'campaignResponse_isPaused' - Specifies whether the campaign is paused. A paused campaign doesn\'t run
-- unless you resume it by changing this value to false.
--
-- 'defaultState', 'campaignResponse_defaultState' - The current status of the campaign\'s default treatment. This value
-- exists only for campaigns that have more than one treatment.
--
-- 'name', 'campaignResponse_name' - The name of the campaign.
--
-- 'version', 'campaignResponse_version' - The version number of the campaign.
--
-- 'holdoutPercent', 'campaignResponse_holdoutPercent' - The allocated percentage of users (segment members) who shouldn\'t
-- receive messages from the campaign.
--
-- 'treatmentDescription', 'campaignResponse_treatmentDescription' - The custom description of the default treatment for the campaign.
--
-- 'messageConfiguration', 'campaignResponse_messageConfiguration' - The message configuration settings for the campaign.
--
-- 'description', 'campaignResponse_description' - The custom description of the campaign.
--
-- 'additionalTreatments', 'campaignResponse_additionalTreatments' - An array of responses, one for each treatment that you defined for the
-- campaign, in addition to the default treatment.
--
-- 'tags', 'campaignResponse_tags' - A string-to-string map of key-value pairs that identifies the tags that
-- are associated with the campaign. Each tag consists of a required tag
-- key and an associated tag value.
--
-- 'lastModifiedDate', 'campaignResponse_lastModifiedDate' - The date, in ISO 8601 format, when the campaign was last modified.
--
-- 'creationDate', 'campaignResponse_creationDate' - The date, in ISO 8601 format, when the campaign was created.
--
-- 'segmentId', 'campaignResponse_segmentId' - The unique identifier for the segment that\'s associated with the
-- campaign.
--
-- 'segmentVersion', 'campaignResponse_segmentVersion' - The version number of the segment that\'s associated with the campaign.
--
-- 'id', 'campaignResponse_id' - The unique identifier for the campaign.
--
-- 'arn', 'campaignResponse_arn' - The Amazon Resource Name (ARN) of the campaign.
--
-- 'applicationId', 'campaignResponse_applicationId' - The unique identifier for the application that the campaign applies to.
newCampaignResponse ::
  -- | 'lastModifiedDate'
  Prelude.Text ->
  -- | 'creationDate'
  Prelude.Text ->
  -- | 'segmentId'
  Prelude.Text ->
  -- | 'segmentVersion'
  Prelude.Int ->
  -- | 'id'
  Prelude.Text ->
  -- | 'arn'
  Prelude.Text ->
  -- | 'applicationId'
  Prelude.Text ->
  CampaignResponse
newCampaignResponse :: Text
-> Text -> Text -> Int -> Text -> Text -> Text -> CampaignResponse
newCampaignResponse
  Text
pLastModifiedDate_
  Text
pCreationDate_
  Text
pSegmentId_
  Int
pSegmentVersion_
  Text
pId_
  Text
pArn_
  Text
pApplicationId_ =
    CampaignResponse' :: Maybe CustomDeliveryConfiguration
-> Maybe CampaignState
-> Maybe Int
-> Maybe Schedule
-> Maybe TemplateConfiguration
-> Maybe CampaignHook
-> Maybe Text
-> Maybe CampaignLimits
-> Maybe Bool
-> Maybe CampaignState
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe MessageConfiguration
-> Maybe Text
-> Maybe [TreatmentResource]
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> Int
-> Text
-> Text
-> Text
-> CampaignResponse
CampaignResponse'
      { $sel:customDeliveryConfiguration:CampaignResponse' :: Maybe CustomDeliveryConfiguration
customDeliveryConfiguration =
          Maybe CustomDeliveryConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:state:CampaignResponse' :: Maybe CampaignState
state = Maybe CampaignState
forall a. Maybe a
Prelude.Nothing,
        $sel:priority:CampaignResponse' :: Maybe Int
priority = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:schedule:CampaignResponse' :: Maybe Schedule
schedule = Maybe Schedule
forall a. Maybe a
Prelude.Nothing,
        $sel:templateConfiguration:CampaignResponse' :: Maybe TemplateConfiguration
templateConfiguration = Maybe TemplateConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:hook:CampaignResponse' :: Maybe CampaignHook
hook = Maybe CampaignHook
forall a. Maybe a
Prelude.Nothing,
        $sel:treatmentName:CampaignResponse' :: Maybe Text
treatmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:limits:CampaignResponse' :: Maybe CampaignLimits
limits = Maybe CampaignLimits
forall a. Maybe a
Prelude.Nothing,
        $sel:isPaused:CampaignResponse' :: Maybe Bool
isPaused = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:defaultState:CampaignResponse' :: Maybe CampaignState
defaultState = Maybe CampaignState
forall a. Maybe a
Prelude.Nothing,
        $sel:name:CampaignResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:version:CampaignResponse' :: Maybe Int
version = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:holdoutPercent:CampaignResponse' :: Maybe Int
holdoutPercent = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:treatmentDescription:CampaignResponse' :: Maybe Text
treatmentDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:messageConfiguration:CampaignResponse' :: Maybe MessageConfiguration
messageConfiguration = Maybe MessageConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:description:CampaignResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:additionalTreatments:CampaignResponse' :: Maybe [TreatmentResource]
additionalTreatments = Maybe [TreatmentResource]
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CampaignResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:lastModifiedDate:CampaignResponse' :: Text
lastModifiedDate = Text
pLastModifiedDate_,
        $sel:creationDate:CampaignResponse' :: Text
creationDate = Text
pCreationDate_,
        $sel:segmentId:CampaignResponse' :: Text
segmentId = Text
pSegmentId_,
        $sel:segmentVersion:CampaignResponse' :: Int
segmentVersion = Int
pSegmentVersion_,
        $sel:id:CampaignResponse' :: Text
id = Text
pId_,
        $sel:arn:CampaignResponse' :: Text
arn = Text
pArn_,
        $sel:applicationId:CampaignResponse' :: Text
applicationId = Text
pApplicationId_
      }

-- | The delivery configuration settings for sending the campaign through a
-- custom channel.
campaignResponse_customDeliveryConfiguration :: Lens.Lens' CampaignResponse (Prelude.Maybe CustomDeliveryConfiguration)
campaignResponse_customDeliveryConfiguration :: (Maybe CustomDeliveryConfiguration
 -> f (Maybe CustomDeliveryConfiguration))
-> CampaignResponse -> f CampaignResponse
campaignResponse_customDeliveryConfiguration = (CampaignResponse -> Maybe CustomDeliveryConfiguration)
-> (CampaignResponse
    -> Maybe CustomDeliveryConfiguration -> CampaignResponse)
-> Lens
     CampaignResponse
     CampaignResponse
     (Maybe CustomDeliveryConfiguration)
     (Maybe CustomDeliveryConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignResponse' {Maybe CustomDeliveryConfiguration
customDeliveryConfiguration :: Maybe CustomDeliveryConfiguration
$sel:customDeliveryConfiguration:CampaignResponse' :: CampaignResponse -> Maybe CustomDeliveryConfiguration
customDeliveryConfiguration} -> Maybe CustomDeliveryConfiguration
customDeliveryConfiguration) (\s :: CampaignResponse
s@CampaignResponse' {} Maybe CustomDeliveryConfiguration
a -> CampaignResponse
s {$sel:customDeliveryConfiguration:CampaignResponse' :: Maybe CustomDeliveryConfiguration
customDeliveryConfiguration = Maybe CustomDeliveryConfiguration
a} :: CampaignResponse)

-- | The current status of the campaign.
campaignResponse_state :: Lens.Lens' CampaignResponse (Prelude.Maybe CampaignState)
campaignResponse_state :: (Maybe CampaignState -> f (Maybe CampaignState))
-> CampaignResponse -> f CampaignResponse
campaignResponse_state = (CampaignResponse -> Maybe CampaignState)
-> (CampaignResponse -> Maybe CampaignState -> CampaignResponse)
-> Lens
     CampaignResponse
     CampaignResponse
     (Maybe CampaignState)
     (Maybe CampaignState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignResponse' {Maybe CampaignState
state :: Maybe CampaignState
$sel:state:CampaignResponse' :: CampaignResponse -> Maybe CampaignState
state} -> Maybe CampaignState
state) (\s :: CampaignResponse
s@CampaignResponse' {} Maybe CampaignState
a -> CampaignResponse
s {$sel:state:CampaignResponse' :: Maybe CampaignState
state = Maybe CampaignState
a} :: CampaignResponse)

-- | 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.
campaignResponse_priority :: Lens.Lens' CampaignResponse (Prelude.Maybe Prelude.Int)
campaignResponse_priority :: (Maybe Int -> f (Maybe Int))
-> CampaignResponse -> f CampaignResponse
campaignResponse_priority = (CampaignResponse -> Maybe Int)
-> (CampaignResponse -> Maybe Int -> CampaignResponse)
-> Lens CampaignResponse CampaignResponse (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignResponse' {Maybe Int
priority :: Maybe Int
$sel:priority:CampaignResponse' :: CampaignResponse -> Maybe Int
priority} -> Maybe Int
priority) (\s :: CampaignResponse
s@CampaignResponse' {} Maybe Int
a -> CampaignResponse
s {$sel:priority:CampaignResponse' :: Maybe Int
priority = Maybe Int
a} :: CampaignResponse)

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

-- | The message template that’s used for the campaign.
campaignResponse_templateConfiguration :: Lens.Lens' CampaignResponse (Prelude.Maybe TemplateConfiguration)
campaignResponse_templateConfiguration :: (Maybe TemplateConfiguration -> f (Maybe TemplateConfiguration))
-> CampaignResponse -> f CampaignResponse
campaignResponse_templateConfiguration = (CampaignResponse -> Maybe TemplateConfiguration)
-> (CampaignResponse
    -> Maybe TemplateConfiguration -> CampaignResponse)
-> Lens
     CampaignResponse
     CampaignResponse
     (Maybe TemplateConfiguration)
     (Maybe TemplateConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignResponse' {Maybe TemplateConfiguration
templateConfiguration :: Maybe TemplateConfiguration
$sel:templateConfiguration:CampaignResponse' :: CampaignResponse -> Maybe TemplateConfiguration
templateConfiguration} -> Maybe TemplateConfiguration
templateConfiguration) (\s :: CampaignResponse
s@CampaignResponse' {} Maybe TemplateConfiguration
a -> CampaignResponse
s {$sel:templateConfiguration:CampaignResponse' :: Maybe TemplateConfiguration
templateConfiguration = Maybe TemplateConfiguration
a} :: CampaignResponse)

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

-- | The 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.
campaignResponse_treatmentName :: Lens.Lens' CampaignResponse (Prelude.Maybe Prelude.Text)
campaignResponse_treatmentName :: (Maybe Text -> f (Maybe Text))
-> CampaignResponse -> f CampaignResponse
campaignResponse_treatmentName = (CampaignResponse -> Maybe Text)
-> (CampaignResponse -> Maybe Text -> CampaignResponse)
-> Lens CampaignResponse CampaignResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignResponse' {Maybe Text
treatmentName :: Maybe Text
$sel:treatmentName:CampaignResponse' :: CampaignResponse -> Maybe Text
treatmentName} -> Maybe Text
treatmentName) (\s :: CampaignResponse
s@CampaignResponse' {} Maybe Text
a -> CampaignResponse
s {$sel:treatmentName:CampaignResponse' :: Maybe Text
treatmentName = Maybe Text
a} :: CampaignResponse)

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

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

-- | The current status of the campaign\'s default treatment. This value
-- exists only for campaigns that have more than one treatment.
campaignResponse_defaultState :: Lens.Lens' CampaignResponse (Prelude.Maybe CampaignState)
campaignResponse_defaultState :: (Maybe CampaignState -> f (Maybe CampaignState))
-> CampaignResponse -> f CampaignResponse
campaignResponse_defaultState = (CampaignResponse -> Maybe CampaignState)
-> (CampaignResponse -> Maybe CampaignState -> CampaignResponse)
-> Lens
     CampaignResponse
     CampaignResponse
     (Maybe CampaignState)
     (Maybe CampaignState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignResponse' {Maybe CampaignState
defaultState :: Maybe CampaignState
$sel:defaultState:CampaignResponse' :: CampaignResponse -> Maybe CampaignState
defaultState} -> Maybe CampaignState
defaultState) (\s :: CampaignResponse
s@CampaignResponse' {} Maybe CampaignState
a -> CampaignResponse
s {$sel:defaultState:CampaignResponse' :: Maybe CampaignState
defaultState = Maybe CampaignState
a} :: CampaignResponse)

-- | The name of the campaign.
campaignResponse_name :: Lens.Lens' CampaignResponse (Prelude.Maybe Prelude.Text)
campaignResponse_name :: (Maybe Text -> f (Maybe Text))
-> CampaignResponse -> f CampaignResponse
campaignResponse_name = (CampaignResponse -> Maybe Text)
-> (CampaignResponse -> Maybe Text -> CampaignResponse)
-> Lens CampaignResponse CampaignResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignResponse' {Maybe Text
name :: Maybe Text
$sel:name:CampaignResponse' :: CampaignResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: CampaignResponse
s@CampaignResponse' {} Maybe Text
a -> CampaignResponse
s {$sel:name:CampaignResponse' :: Maybe Text
name = Maybe Text
a} :: CampaignResponse)

-- | The version number of the campaign.
campaignResponse_version :: Lens.Lens' CampaignResponse (Prelude.Maybe Prelude.Int)
campaignResponse_version :: (Maybe Int -> f (Maybe Int))
-> CampaignResponse -> f CampaignResponse
campaignResponse_version = (CampaignResponse -> Maybe Int)
-> (CampaignResponse -> Maybe Int -> CampaignResponse)
-> Lens CampaignResponse CampaignResponse (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignResponse' {Maybe Int
version :: Maybe Int
$sel:version:CampaignResponse' :: CampaignResponse -> Maybe Int
version} -> Maybe Int
version) (\s :: CampaignResponse
s@CampaignResponse' {} Maybe Int
a -> CampaignResponse
s {$sel:version:CampaignResponse' :: Maybe Int
version = Maybe Int
a} :: CampaignResponse)

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

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

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

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

-- | An array of responses, one for each treatment that you defined for the
-- campaign, in addition to the default treatment.
campaignResponse_additionalTreatments :: Lens.Lens' CampaignResponse (Prelude.Maybe [TreatmentResource])
campaignResponse_additionalTreatments :: (Maybe [TreatmentResource] -> f (Maybe [TreatmentResource]))
-> CampaignResponse -> f CampaignResponse
campaignResponse_additionalTreatments = (CampaignResponse -> Maybe [TreatmentResource])
-> (CampaignResponse
    -> Maybe [TreatmentResource] -> CampaignResponse)
-> Lens
     CampaignResponse
     CampaignResponse
     (Maybe [TreatmentResource])
     (Maybe [TreatmentResource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignResponse' {Maybe [TreatmentResource]
additionalTreatments :: Maybe [TreatmentResource]
$sel:additionalTreatments:CampaignResponse' :: CampaignResponse -> Maybe [TreatmentResource]
additionalTreatments} -> Maybe [TreatmentResource]
additionalTreatments) (\s :: CampaignResponse
s@CampaignResponse' {} Maybe [TreatmentResource]
a -> CampaignResponse
s {$sel:additionalTreatments:CampaignResponse' :: Maybe [TreatmentResource]
additionalTreatments = Maybe [TreatmentResource]
a} :: CampaignResponse) ((Maybe [TreatmentResource] -> f (Maybe [TreatmentResource]))
 -> CampaignResponse -> f CampaignResponse)
-> ((Maybe [TreatmentResource] -> f (Maybe [TreatmentResource]))
    -> Maybe [TreatmentResource] -> f (Maybe [TreatmentResource]))
-> (Maybe [TreatmentResource] -> f (Maybe [TreatmentResource]))
-> CampaignResponse
-> f CampaignResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [TreatmentResource]
  [TreatmentResource]
  [TreatmentResource]
  [TreatmentResource]
-> Iso
     (Maybe [TreatmentResource])
     (Maybe [TreatmentResource])
     (Maybe [TreatmentResource])
     (Maybe [TreatmentResource])
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
  [TreatmentResource]
  [TreatmentResource]
  [TreatmentResource]
  [TreatmentResource]
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 identifies the tags that
-- are associated with the campaign. Each tag consists of a required tag
-- key and an associated tag value.
campaignResponse_tags :: Lens.Lens' CampaignResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
campaignResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CampaignResponse -> f CampaignResponse
campaignResponse_tags = (CampaignResponse -> Maybe (HashMap Text Text))
-> (CampaignResponse
    -> Maybe (HashMap Text Text) -> CampaignResponse)
-> Lens
     CampaignResponse
     CampaignResponse
     (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 (\CampaignResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CampaignResponse' :: CampaignResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CampaignResponse
s@CampaignResponse' {} Maybe (HashMap Text Text)
a -> CampaignResponse
s {$sel:tags:CampaignResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CampaignResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CampaignResponse -> f CampaignResponse)
-> ((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)))
-> CampaignResponse
-> f CampaignResponse
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 date, in ISO 8601 format, when the campaign was last modified.
campaignResponse_lastModifiedDate :: Lens.Lens' CampaignResponse Prelude.Text
campaignResponse_lastModifiedDate :: (Text -> f Text) -> CampaignResponse -> f CampaignResponse
campaignResponse_lastModifiedDate = (CampaignResponse -> Text)
-> (CampaignResponse -> Text -> CampaignResponse)
-> Lens CampaignResponse CampaignResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignResponse' {Text
lastModifiedDate :: Text
$sel:lastModifiedDate:CampaignResponse' :: CampaignResponse -> Text
lastModifiedDate} -> Text
lastModifiedDate) (\s :: CampaignResponse
s@CampaignResponse' {} Text
a -> CampaignResponse
s {$sel:lastModifiedDate:CampaignResponse' :: Text
lastModifiedDate = Text
a} :: CampaignResponse)

-- | The date, in ISO 8601 format, when the campaign was created.
campaignResponse_creationDate :: Lens.Lens' CampaignResponse Prelude.Text
campaignResponse_creationDate :: (Text -> f Text) -> CampaignResponse -> f CampaignResponse
campaignResponse_creationDate = (CampaignResponse -> Text)
-> (CampaignResponse -> Text -> CampaignResponse)
-> Lens CampaignResponse CampaignResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignResponse' {Text
creationDate :: Text
$sel:creationDate:CampaignResponse' :: CampaignResponse -> Text
creationDate} -> Text
creationDate) (\s :: CampaignResponse
s@CampaignResponse' {} Text
a -> CampaignResponse
s {$sel:creationDate:CampaignResponse' :: Text
creationDate = Text
a} :: CampaignResponse)

-- | The unique identifier for the segment that\'s associated with the
-- campaign.
campaignResponse_segmentId :: Lens.Lens' CampaignResponse Prelude.Text
campaignResponse_segmentId :: (Text -> f Text) -> CampaignResponse -> f CampaignResponse
campaignResponse_segmentId = (CampaignResponse -> Text)
-> (CampaignResponse -> Text -> CampaignResponse)
-> Lens CampaignResponse CampaignResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignResponse' {Text
segmentId :: Text
$sel:segmentId:CampaignResponse' :: CampaignResponse -> Text
segmentId} -> Text
segmentId) (\s :: CampaignResponse
s@CampaignResponse' {} Text
a -> CampaignResponse
s {$sel:segmentId:CampaignResponse' :: Text
segmentId = Text
a} :: CampaignResponse)

-- | The version number of the segment that\'s associated with the campaign.
campaignResponse_segmentVersion :: Lens.Lens' CampaignResponse Prelude.Int
campaignResponse_segmentVersion :: (Int -> f Int) -> CampaignResponse -> f CampaignResponse
campaignResponse_segmentVersion = (CampaignResponse -> Int)
-> (CampaignResponse -> Int -> CampaignResponse)
-> Lens CampaignResponse CampaignResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignResponse' {Int
segmentVersion :: Int
$sel:segmentVersion:CampaignResponse' :: CampaignResponse -> Int
segmentVersion} -> Int
segmentVersion) (\s :: CampaignResponse
s@CampaignResponse' {} Int
a -> CampaignResponse
s {$sel:segmentVersion:CampaignResponse' :: Int
segmentVersion = Int
a} :: CampaignResponse)

-- | The unique identifier for the campaign.
campaignResponse_id :: Lens.Lens' CampaignResponse Prelude.Text
campaignResponse_id :: (Text -> f Text) -> CampaignResponse -> f CampaignResponse
campaignResponse_id = (CampaignResponse -> Text)
-> (CampaignResponse -> Text -> CampaignResponse)
-> Lens CampaignResponse CampaignResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignResponse' {Text
id :: Text
$sel:id:CampaignResponse' :: CampaignResponse -> Text
id} -> Text
id) (\s :: CampaignResponse
s@CampaignResponse' {} Text
a -> CampaignResponse
s {$sel:id:CampaignResponse' :: Text
id = Text
a} :: CampaignResponse)

-- | The Amazon Resource Name (ARN) of the campaign.
campaignResponse_arn :: Lens.Lens' CampaignResponse Prelude.Text
campaignResponse_arn :: (Text -> f Text) -> CampaignResponse -> f CampaignResponse
campaignResponse_arn = (CampaignResponse -> Text)
-> (CampaignResponse -> Text -> CampaignResponse)
-> Lens CampaignResponse CampaignResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignResponse' {Text
arn :: Text
$sel:arn:CampaignResponse' :: CampaignResponse -> Text
arn} -> Text
arn) (\s :: CampaignResponse
s@CampaignResponse' {} Text
a -> CampaignResponse
s {$sel:arn:CampaignResponse' :: Text
arn = Text
a} :: CampaignResponse)

-- | The unique identifier for the application that the campaign applies to.
campaignResponse_applicationId :: Lens.Lens' CampaignResponse Prelude.Text
campaignResponse_applicationId :: (Text -> f Text) -> CampaignResponse -> f CampaignResponse
campaignResponse_applicationId = (CampaignResponse -> Text)
-> (CampaignResponse -> Text -> CampaignResponse)
-> Lens CampaignResponse CampaignResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignResponse' {Text
applicationId :: Text
$sel:applicationId:CampaignResponse' :: CampaignResponse -> Text
applicationId} -> Text
applicationId) (\s :: CampaignResponse
s@CampaignResponse' {} Text
a -> CampaignResponse
s {$sel:applicationId:CampaignResponse' :: Text
applicationId = Text
a} :: CampaignResponse)

instance Core.FromJSON CampaignResponse where
  parseJSON :: Value -> Parser CampaignResponse
parseJSON =
    String
-> (Object -> Parser CampaignResponse)
-> Value
-> Parser CampaignResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CampaignResponse"
      ( \Object
x ->
          Maybe CustomDeliveryConfiguration
-> Maybe CampaignState
-> Maybe Int
-> Maybe Schedule
-> Maybe TemplateConfiguration
-> Maybe CampaignHook
-> Maybe Text
-> Maybe CampaignLimits
-> Maybe Bool
-> Maybe CampaignState
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe MessageConfiguration
-> Maybe Text
-> Maybe [TreatmentResource]
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> Int
-> Text
-> Text
-> Text
-> CampaignResponse
CampaignResponse'
            (Maybe CustomDeliveryConfiguration
 -> Maybe CampaignState
 -> Maybe Int
 -> Maybe Schedule
 -> Maybe TemplateConfiguration
 -> Maybe CampaignHook
 -> Maybe Text
 -> Maybe CampaignLimits
 -> Maybe Bool
 -> Maybe CampaignState
 -> Maybe Text
 -> Maybe Int
 -> Maybe Int
 -> Maybe Text
 -> Maybe MessageConfiguration
 -> Maybe Text
 -> Maybe [TreatmentResource]
 -> Maybe (HashMap Text Text)
 -> Text
 -> Text
 -> Text
 -> Int
 -> Text
 -> Text
 -> Text
 -> CampaignResponse)
-> Parser (Maybe CustomDeliveryConfiguration)
-> Parser
     (Maybe CampaignState
      -> Maybe Int
      -> Maybe Schedule
      -> Maybe TemplateConfiguration
      -> Maybe CampaignHook
      -> Maybe Text
      -> Maybe CampaignLimits
      -> Maybe Bool
      -> Maybe CampaignState
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe MessageConfiguration
      -> Maybe Text
      -> Maybe [TreatmentResource]
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> CampaignResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe CustomDeliveryConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CustomDeliveryConfiguration")
            Parser
  (Maybe CampaignState
   -> Maybe Int
   -> Maybe Schedule
   -> Maybe TemplateConfiguration
   -> Maybe CampaignHook
   -> Maybe Text
   -> Maybe CampaignLimits
   -> Maybe Bool
   -> Maybe CampaignState
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe MessageConfiguration
   -> Maybe Text
   -> Maybe [TreatmentResource]
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> CampaignResponse)
-> Parser (Maybe CampaignState)
-> Parser
     (Maybe Int
      -> Maybe Schedule
      -> Maybe TemplateConfiguration
      -> Maybe CampaignHook
      -> Maybe Text
      -> Maybe CampaignLimits
      -> Maybe Bool
      -> Maybe CampaignState
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe MessageConfiguration
      -> Maybe Text
      -> Maybe [TreatmentResource]
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CampaignState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
            Parser
  (Maybe Int
   -> Maybe Schedule
   -> Maybe TemplateConfiguration
   -> Maybe CampaignHook
   -> Maybe Text
   -> Maybe CampaignLimits
   -> Maybe Bool
   -> Maybe CampaignState
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe MessageConfiguration
   -> Maybe Text
   -> Maybe [TreatmentResource]
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> CampaignResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe Schedule
      -> Maybe TemplateConfiguration
      -> Maybe CampaignHook
      -> Maybe Text
      -> Maybe CampaignLimits
      -> Maybe Bool
      -> Maybe CampaignState
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe MessageConfiguration
      -> Maybe Text
      -> Maybe [TreatmentResource]
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Priority")
            Parser
  (Maybe Schedule
   -> Maybe TemplateConfiguration
   -> Maybe CampaignHook
   -> Maybe Text
   -> Maybe CampaignLimits
   -> Maybe Bool
   -> Maybe CampaignState
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe MessageConfiguration
   -> Maybe Text
   -> Maybe [TreatmentResource]
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> CampaignResponse)
-> Parser (Maybe Schedule)
-> Parser
     (Maybe TemplateConfiguration
      -> Maybe CampaignHook
      -> Maybe Text
      -> Maybe CampaignLimits
      -> Maybe Bool
      -> Maybe CampaignState
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe MessageConfiguration
      -> Maybe Text
      -> Maybe [TreatmentResource]
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Schedule)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Schedule")
            Parser
  (Maybe TemplateConfiguration
   -> Maybe CampaignHook
   -> Maybe Text
   -> Maybe CampaignLimits
   -> Maybe Bool
   -> Maybe CampaignState
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe MessageConfiguration
   -> Maybe Text
   -> Maybe [TreatmentResource]
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> CampaignResponse)
-> Parser (Maybe TemplateConfiguration)
-> Parser
     (Maybe CampaignHook
      -> Maybe Text
      -> Maybe CampaignLimits
      -> Maybe Bool
      -> Maybe CampaignState
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe MessageConfiguration
      -> Maybe Text
      -> Maybe [TreatmentResource]
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TemplateConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TemplateConfiguration")
            Parser
  (Maybe CampaignHook
   -> Maybe Text
   -> Maybe CampaignLimits
   -> Maybe Bool
   -> Maybe CampaignState
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe MessageConfiguration
   -> Maybe Text
   -> Maybe [TreatmentResource]
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> CampaignResponse)
-> Parser (Maybe CampaignHook)
-> Parser
     (Maybe Text
      -> Maybe CampaignLimits
      -> Maybe Bool
      -> Maybe CampaignState
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe MessageConfiguration
      -> Maybe Text
      -> Maybe [TreatmentResource]
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CampaignHook)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Hook")
            Parser
  (Maybe Text
   -> Maybe CampaignLimits
   -> Maybe Bool
   -> Maybe CampaignState
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe MessageConfiguration
   -> Maybe Text
   -> Maybe [TreatmentResource]
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> CampaignResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe CampaignLimits
      -> Maybe Bool
      -> Maybe CampaignState
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe MessageConfiguration
      -> Maybe Text
      -> Maybe [TreatmentResource]
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> CampaignResponse)
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
"TreatmentName")
            Parser
  (Maybe CampaignLimits
   -> Maybe Bool
   -> Maybe CampaignState
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe MessageConfiguration
   -> Maybe Text
   -> Maybe [TreatmentResource]
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> CampaignResponse)
-> Parser (Maybe CampaignLimits)
-> Parser
     (Maybe Bool
      -> Maybe CampaignState
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe MessageConfiguration
      -> Maybe Text
      -> Maybe [TreatmentResource]
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CampaignLimits)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Limits")
            Parser
  (Maybe Bool
   -> Maybe CampaignState
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe MessageConfiguration
   -> Maybe Text
   -> Maybe [TreatmentResource]
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> CampaignResponse)
-> Parser (Maybe Bool)
-> Parser
     (Maybe CampaignState
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe MessageConfiguration
      -> Maybe Text
      -> Maybe [TreatmentResource]
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IsPaused")
            Parser
  (Maybe CampaignState
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe MessageConfiguration
   -> Maybe Text
   -> Maybe [TreatmentResource]
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> CampaignResponse)
-> Parser (Maybe CampaignState)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe MessageConfiguration
      -> Maybe Text
      -> Maybe [TreatmentResource]
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CampaignState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DefaultState")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe MessageConfiguration
   -> Maybe Text
   -> Maybe [TreatmentResource]
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> CampaignResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe MessageConfiguration
      -> Maybe Text
      -> Maybe [TreatmentResource]
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> CampaignResponse)
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
"Name")
            Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe MessageConfiguration
   -> Maybe Text
   -> Maybe [TreatmentResource]
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> CampaignResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe MessageConfiguration
      -> Maybe Text
      -> Maybe [TreatmentResource]
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Version")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe MessageConfiguration
   -> Maybe Text
   -> Maybe [TreatmentResource]
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> CampaignResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe MessageConfiguration
      -> Maybe Text
      -> Maybe [TreatmentResource]
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HoldoutPercent")
            Parser
  (Maybe Text
   -> Maybe MessageConfiguration
   -> Maybe Text
   -> Maybe [TreatmentResource]
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> CampaignResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe MessageConfiguration
      -> Maybe Text
      -> Maybe [TreatmentResource]
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> CampaignResponse)
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
"TreatmentDescription")
            Parser
  (Maybe MessageConfiguration
   -> Maybe Text
   -> Maybe [TreatmentResource]
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> CampaignResponse)
-> Parser (Maybe MessageConfiguration)
-> Parser
     (Maybe Text
      -> Maybe [TreatmentResource]
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MessageConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MessageConfiguration")
            Parser
  (Maybe Text
   -> Maybe [TreatmentResource]
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> CampaignResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe [TreatmentResource]
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> CampaignResponse)
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
"Description")
            Parser
  (Maybe [TreatmentResource]
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> CampaignResponse)
-> Parser (Maybe [TreatmentResource])
-> Parser
     (Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [TreatmentResource]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AdditionalTreatments"
                            Parser (Maybe (Maybe [TreatmentResource]))
-> Maybe [TreatmentResource] -> Parser (Maybe [TreatmentResource])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [TreatmentResource]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> CampaignResponse)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Text
      -> Text -> Text -> Int -> Text -> Text -> Text -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Text
   -> Text -> Text -> Int -> Text -> Text -> Text -> CampaignResponse)
-> Parser Text
-> Parser
     (Text -> Text -> Int -> Text -> Text -> Text -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"LastModifiedDate")
            Parser
  (Text -> Text -> Int -> Text -> Text -> Text -> CampaignResponse)
-> Parser Text
-> Parser (Text -> Int -> Text -> Text -> Text -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CreationDate")
            Parser (Text -> Int -> Text -> Text -> Text -> CampaignResponse)
-> Parser Text
-> Parser (Int -> Text -> Text -> Text -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SegmentId")
            Parser (Int -> Text -> Text -> Text -> CampaignResponse)
-> Parser Int -> Parser (Text -> Text -> Text -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SegmentVersion")
            Parser (Text -> Text -> Text -> CampaignResponse)
-> Parser Text -> Parser (Text -> Text -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Id")
            Parser (Text -> Text -> CampaignResponse)
-> Parser Text -> Parser (Text -> CampaignResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Arn")
            Parser (Text -> CampaignResponse)
-> Parser Text -> Parser CampaignResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ApplicationId")
      )

instance Prelude.Hashable CampaignResponse

instance Prelude.NFData CampaignResponse