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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.Activity
import Amazonka.Pinpoint.Types.JourneyChannelSettings
import Amazonka.Pinpoint.Types.JourneyLimits
import Amazonka.Pinpoint.Types.JourneySchedule
import Amazonka.Pinpoint.Types.QuietTime
import Amazonka.Pinpoint.Types.StartCondition
import Amazonka.Pinpoint.Types.State
import qualified Amazonka.Prelude as Prelude

-- | Provides information about the status, configuration, and other settings
-- for a journey.
--
-- /See:/ 'newJourneyResponse' smart constructor.
data JourneyResponse = JourneyResponse'
  { -- | The current status of the journey. Possible values are:
    --
    -- -   DRAFT - The journey is being developed and hasn\'t been published
    --     yet.
    --
    -- -   ACTIVE - The journey has been developed and published. Depending on
    --     the journey\'s schedule, the journey may currently be running or
    --     scheduled to start running at a later time. If a journey\'s status
    --     is ACTIVE, you can\'t add, change, or remove activities from it.
    --
    -- -   COMPLETED - The journey has been published and has finished running.
    --     All participants have entered the journey and no participants are
    --     waiting to complete the journey or any activities in the journey.
    --
    -- -   CANCELLED - The journey has been stopped. If a journey\'s status is
    --     CANCELLED, you can\'t add, change, or remove activities or segment
    --     settings from the journey.
    --
    -- -   CLOSED - The journey has been published and has started running. It
    --     may have also passed its scheduled end time, or passed its scheduled
    --     start time and a refresh frequency hasn\'t been specified for it. If
    --     a journey\'s status is CLOSED, you can\'t add participants to it,
    --     and no existing participants can enter the journey for the first
    --     time. However, any existing participants who are currently waiting
    --     to start an activity may continue the journey.
    JourneyResponse -> Maybe State
state :: Prelude.Maybe State,
    -- | The date, in ISO 8601 format, when the journey was last modified.
    JourneyResponse -> Maybe Text
lastModifiedDate :: Prelude.Maybe Prelude.Text,
    -- | The schedule settings for the journey.
    JourneyResponse -> Maybe JourneySchedule
schedule :: Prelude.Maybe JourneySchedule,
    -- | Specifies whether the journey\'s scheduled start and end times use each
    -- participant\'s local time. If this value is true, the schedule uses each
    -- participant\'s local time.
    JourneyResponse -> Maybe Bool
localTime :: Prelude.Maybe Prelude.Bool,
    -- | A map that contains a set of Activity objects, one object for each
    -- activity in the journey. For each Activity object, the key is the unique
    -- identifier (string) for an activity and the value is the settings for
    -- the activity.
    JourneyResponse -> Maybe (HashMap Text Activity)
activities :: Prelude.Maybe (Prelude.HashMap Prelude.Text Activity),
    -- | Specifies whether a journey should be refreshed on segment update.
    JourneyResponse -> Maybe Bool
refreshOnSegmentUpdate :: Prelude.Maybe Prelude.Bool,
    -- | The messaging and entry limits for the journey.
    JourneyResponse -> Maybe JourneyLimits
limits :: Prelude.Maybe JourneyLimits,
    -- | Specifies whether endpoints in quiet hours should enter a wait till the
    -- end of their quiet hours.
    JourneyResponse -> Maybe Bool
waitForQuietTime :: Prelude.Maybe Prelude.Bool,
    -- | The quiet time settings for the journey. Quiet time is a specific time
    -- range when a journey doesn\'t send messages to participants, if all the
    -- following conditions are met:
    --
    -- -   The EndpointDemographic.Timezone property of the endpoint for the
    --     participant is set to a valid value.
    --
    -- -   The current time in the participant\'s time zone is later than or
    --     equal to the time specified by the QuietTime.Start property for the
    --     journey.
    --
    -- -   The current time in the participant\'s time zone is earlier than or
    --     equal to the time specified by the QuietTime.End property for the
    --     journey.
    --
    -- If any of the preceding conditions isn\'t met, the participant will
    -- receive messages from the journey, even if quiet time is enabled.
    JourneyResponse -> Maybe QuietTime
quietTime :: Prelude.Maybe QuietTime,
    -- | The unique identifier for the first activity in the journey.
    JourneyResponse -> Maybe Text
startActivity :: Prelude.Maybe Prelude.Text,
    -- | The date, in ISO 8601 format, when the journey was created.
    JourneyResponse -> Maybe Text
creationDate :: Prelude.Maybe Prelude.Text,
    -- | The segment that defines which users are participants in the journey.
    JourneyResponse -> Maybe StartCondition
startCondition :: Prelude.Maybe StartCondition,
    -- | The channel-specific configurations for the journey.
    JourneyResponse -> Maybe JourneyChannelSettings
journeyChannelSettings :: Prelude.Maybe JourneyChannelSettings,
    -- | The frequency with which Amazon Pinpoint evaluates segment and event
    -- data for the journey, as a duration in ISO 8601 format.
    JourneyResponse -> Maybe Text
refreshFrequency :: Prelude.Maybe Prelude.Text,
    -- | This object is not used or supported.
    JourneyResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the journey.
    JourneyResponse -> Text
name :: Prelude.Text,
    -- | The unique identifier for the journey.
    JourneyResponse -> Text
id :: Prelude.Text,
    -- | The unique identifier for the application that the journey applies to.
    JourneyResponse -> Text
applicationId :: Prelude.Text
  }
  deriving (JourneyResponse -> JourneyResponse -> Bool
(JourneyResponse -> JourneyResponse -> Bool)
-> (JourneyResponse -> JourneyResponse -> Bool)
-> Eq JourneyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JourneyResponse -> JourneyResponse -> Bool
$c/= :: JourneyResponse -> JourneyResponse -> Bool
== :: JourneyResponse -> JourneyResponse -> Bool
$c== :: JourneyResponse -> JourneyResponse -> Bool
Prelude.Eq, ReadPrec [JourneyResponse]
ReadPrec JourneyResponse
Int -> ReadS JourneyResponse
ReadS [JourneyResponse]
(Int -> ReadS JourneyResponse)
-> ReadS [JourneyResponse]
-> ReadPrec JourneyResponse
-> ReadPrec [JourneyResponse]
-> Read JourneyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JourneyResponse]
$creadListPrec :: ReadPrec [JourneyResponse]
readPrec :: ReadPrec JourneyResponse
$creadPrec :: ReadPrec JourneyResponse
readList :: ReadS [JourneyResponse]
$creadList :: ReadS [JourneyResponse]
readsPrec :: Int -> ReadS JourneyResponse
$creadsPrec :: Int -> ReadS JourneyResponse
Prelude.Read, Int -> JourneyResponse -> ShowS
[JourneyResponse] -> ShowS
JourneyResponse -> String
(Int -> JourneyResponse -> ShowS)
-> (JourneyResponse -> String)
-> ([JourneyResponse] -> ShowS)
-> Show JourneyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JourneyResponse] -> ShowS
$cshowList :: [JourneyResponse] -> ShowS
show :: JourneyResponse -> String
$cshow :: JourneyResponse -> String
showsPrec :: Int -> JourneyResponse -> ShowS
$cshowsPrec :: Int -> JourneyResponse -> ShowS
Prelude.Show, (forall x. JourneyResponse -> Rep JourneyResponse x)
-> (forall x. Rep JourneyResponse x -> JourneyResponse)
-> Generic JourneyResponse
forall x. Rep JourneyResponse x -> JourneyResponse
forall x. JourneyResponse -> Rep JourneyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JourneyResponse x -> JourneyResponse
$cfrom :: forall x. JourneyResponse -> Rep JourneyResponse x
Prelude.Generic)

-- |
-- Create a value of 'JourneyResponse' 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:
--
-- 'state', 'journeyResponse_state' - The current status of the journey. Possible values are:
--
-- -   DRAFT - The journey is being developed and hasn\'t been published
--     yet.
--
-- -   ACTIVE - The journey has been developed and published. Depending on
--     the journey\'s schedule, the journey may currently be running or
--     scheduled to start running at a later time. If a journey\'s status
--     is ACTIVE, you can\'t add, change, or remove activities from it.
--
-- -   COMPLETED - The journey has been published and has finished running.
--     All participants have entered the journey and no participants are
--     waiting to complete the journey or any activities in the journey.
--
-- -   CANCELLED - The journey has been stopped. If a journey\'s status is
--     CANCELLED, you can\'t add, change, or remove activities or segment
--     settings from the journey.
--
-- -   CLOSED - The journey has been published and has started running. It
--     may have also passed its scheduled end time, or passed its scheduled
--     start time and a refresh frequency hasn\'t been specified for it. If
--     a journey\'s status is CLOSED, you can\'t add participants to it,
--     and no existing participants can enter the journey for the first
--     time. However, any existing participants who are currently waiting
--     to start an activity may continue the journey.
--
-- 'lastModifiedDate', 'journeyResponse_lastModifiedDate' - The date, in ISO 8601 format, when the journey was last modified.
--
-- 'schedule', 'journeyResponse_schedule' - The schedule settings for the journey.
--
-- 'localTime', 'journeyResponse_localTime' - Specifies whether the journey\'s scheduled start and end times use each
-- participant\'s local time. If this value is true, the schedule uses each
-- participant\'s local time.
--
-- 'activities', 'journeyResponse_activities' - A map that contains a set of Activity objects, one object for each
-- activity in the journey. For each Activity object, the key is the unique
-- identifier (string) for an activity and the value is the settings for
-- the activity.
--
-- 'refreshOnSegmentUpdate', 'journeyResponse_refreshOnSegmentUpdate' - Specifies whether a journey should be refreshed on segment update.
--
-- 'limits', 'journeyResponse_limits' - The messaging and entry limits for the journey.
--
-- 'waitForQuietTime', 'journeyResponse_waitForQuietTime' - Specifies whether endpoints in quiet hours should enter a wait till the
-- end of their quiet hours.
--
-- 'quietTime', 'journeyResponse_quietTime' - The quiet time settings for the journey. Quiet time is a specific time
-- range when a journey doesn\'t send messages to participants, if all the
-- following conditions are met:
--
-- -   The EndpointDemographic.Timezone property of the endpoint for the
--     participant is set to a valid value.
--
-- -   The current time in the participant\'s time zone is later than or
--     equal to the time specified by the QuietTime.Start property for the
--     journey.
--
-- -   The current time in the participant\'s time zone is earlier than or
--     equal to the time specified by the QuietTime.End property for the
--     journey.
--
-- If any of the preceding conditions isn\'t met, the participant will
-- receive messages from the journey, even if quiet time is enabled.
--
-- 'startActivity', 'journeyResponse_startActivity' - The unique identifier for the first activity in the journey.
--
-- 'creationDate', 'journeyResponse_creationDate' - The date, in ISO 8601 format, when the journey was created.
--
-- 'startCondition', 'journeyResponse_startCondition' - The segment that defines which users are participants in the journey.
--
-- 'journeyChannelSettings', 'journeyResponse_journeyChannelSettings' - The channel-specific configurations for the journey.
--
-- 'refreshFrequency', 'journeyResponse_refreshFrequency' - The frequency with which Amazon Pinpoint evaluates segment and event
-- data for the journey, as a duration in ISO 8601 format.
--
-- 'tags', 'journeyResponse_tags' - This object is not used or supported.
--
-- 'name', 'journeyResponse_name' - The name of the journey.
--
-- 'id', 'journeyResponse_id' - The unique identifier for the journey.
--
-- 'applicationId', 'journeyResponse_applicationId' - The unique identifier for the application that the journey applies to.
newJourneyResponse ::
  -- | 'name'
  Prelude.Text ->
  -- | 'id'
  Prelude.Text ->
  -- | 'applicationId'
  Prelude.Text ->
  JourneyResponse
newJourneyResponse :: Text -> Text -> Text -> JourneyResponse
newJourneyResponse Text
pName_ Text
pId_ Text
pApplicationId_ =
  JourneyResponse' :: Maybe State
-> Maybe Text
-> Maybe JourneySchedule
-> Maybe Bool
-> Maybe (HashMap Text Activity)
-> Maybe Bool
-> Maybe JourneyLimits
-> Maybe Bool
-> Maybe QuietTime
-> Maybe Text
-> Maybe Text
-> Maybe StartCondition
-> Maybe JourneyChannelSettings
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> JourneyResponse
JourneyResponse'
    { $sel:state:JourneyResponse' :: Maybe State
state = Maybe State
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedDate:JourneyResponse' :: Maybe Text
lastModifiedDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:schedule:JourneyResponse' :: Maybe JourneySchedule
schedule = Maybe JourneySchedule
forall a. Maybe a
Prelude.Nothing,
      $sel:localTime:JourneyResponse' :: Maybe Bool
localTime = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:activities:JourneyResponse' :: Maybe (HashMap Text Activity)
activities = Maybe (HashMap Text Activity)
forall a. Maybe a
Prelude.Nothing,
      $sel:refreshOnSegmentUpdate:JourneyResponse' :: Maybe Bool
refreshOnSegmentUpdate = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:limits:JourneyResponse' :: Maybe JourneyLimits
limits = Maybe JourneyLimits
forall a. Maybe a
Prelude.Nothing,
      $sel:waitForQuietTime:JourneyResponse' :: Maybe Bool
waitForQuietTime = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:quietTime:JourneyResponse' :: Maybe QuietTime
quietTime = Maybe QuietTime
forall a. Maybe a
Prelude.Nothing,
      $sel:startActivity:JourneyResponse' :: Maybe Text
startActivity = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:JourneyResponse' :: Maybe Text
creationDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startCondition:JourneyResponse' :: Maybe StartCondition
startCondition = Maybe StartCondition
forall a. Maybe a
Prelude.Nothing,
      $sel:journeyChannelSettings:JourneyResponse' :: Maybe JourneyChannelSettings
journeyChannelSettings = Maybe JourneyChannelSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:refreshFrequency:JourneyResponse' :: Maybe Text
refreshFrequency = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:JourneyResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:name:JourneyResponse' :: Text
name = Text
pName_,
      $sel:id:JourneyResponse' :: Text
id = Text
pId_,
      $sel:applicationId:JourneyResponse' :: Text
applicationId = Text
pApplicationId_
    }

-- | The current status of the journey. Possible values are:
--
-- -   DRAFT - The journey is being developed and hasn\'t been published
--     yet.
--
-- -   ACTIVE - The journey has been developed and published. Depending on
--     the journey\'s schedule, the journey may currently be running or
--     scheduled to start running at a later time. If a journey\'s status
--     is ACTIVE, you can\'t add, change, or remove activities from it.
--
-- -   COMPLETED - The journey has been published and has finished running.
--     All participants have entered the journey and no participants are
--     waiting to complete the journey or any activities in the journey.
--
-- -   CANCELLED - The journey has been stopped. If a journey\'s status is
--     CANCELLED, you can\'t add, change, or remove activities or segment
--     settings from the journey.
--
-- -   CLOSED - The journey has been published and has started running. It
--     may have also passed its scheduled end time, or passed its scheduled
--     start time and a refresh frequency hasn\'t been specified for it. If
--     a journey\'s status is CLOSED, you can\'t add participants to it,
--     and no existing participants can enter the journey for the first
--     time. However, any existing participants who are currently waiting
--     to start an activity may continue the journey.
journeyResponse_state :: Lens.Lens' JourneyResponse (Prelude.Maybe State)
journeyResponse_state :: (Maybe State -> f (Maybe State))
-> JourneyResponse -> f JourneyResponse
journeyResponse_state = (JourneyResponse -> Maybe State)
-> (JourneyResponse -> Maybe State -> JourneyResponse)
-> Lens JourneyResponse JourneyResponse (Maybe State) (Maybe State)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JourneyResponse' {Maybe State
state :: Maybe State
$sel:state:JourneyResponse' :: JourneyResponse -> Maybe State
state} -> Maybe State
state) (\s :: JourneyResponse
s@JourneyResponse' {} Maybe State
a -> JourneyResponse
s {$sel:state:JourneyResponse' :: Maybe State
state = Maybe State
a} :: JourneyResponse)

-- | The date, in ISO 8601 format, when the journey was last modified.
journeyResponse_lastModifiedDate :: Lens.Lens' JourneyResponse (Prelude.Maybe Prelude.Text)
journeyResponse_lastModifiedDate :: (Maybe Text -> f (Maybe Text))
-> JourneyResponse -> f JourneyResponse
journeyResponse_lastModifiedDate = (JourneyResponse -> Maybe Text)
-> (JourneyResponse -> Maybe Text -> JourneyResponse)
-> Lens JourneyResponse JourneyResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JourneyResponse' {Maybe Text
lastModifiedDate :: Maybe Text
$sel:lastModifiedDate:JourneyResponse' :: JourneyResponse -> Maybe Text
lastModifiedDate} -> Maybe Text
lastModifiedDate) (\s :: JourneyResponse
s@JourneyResponse' {} Maybe Text
a -> JourneyResponse
s {$sel:lastModifiedDate:JourneyResponse' :: Maybe Text
lastModifiedDate = Maybe Text
a} :: JourneyResponse)

-- | The schedule settings for the journey.
journeyResponse_schedule :: Lens.Lens' JourneyResponse (Prelude.Maybe JourneySchedule)
journeyResponse_schedule :: (Maybe JourneySchedule -> f (Maybe JourneySchedule))
-> JourneyResponse -> f JourneyResponse
journeyResponse_schedule = (JourneyResponse -> Maybe JourneySchedule)
-> (JourneyResponse -> Maybe JourneySchedule -> JourneyResponse)
-> Lens
     JourneyResponse
     JourneyResponse
     (Maybe JourneySchedule)
     (Maybe JourneySchedule)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JourneyResponse' {Maybe JourneySchedule
schedule :: Maybe JourneySchedule
$sel:schedule:JourneyResponse' :: JourneyResponse -> Maybe JourneySchedule
schedule} -> Maybe JourneySchedule
schedule) (\s :: JourneyResponse
s@JourneyResponse' {} Maybe JourneySchedule
a -> JourneyResponse
s {$sel:schedule:JourneyResponse' :: Maybe JourneySchedule
schedule = Maybe JourneySchedule
a} :: JourneyResponse)

-- | Specifies whether the journey\'s scheduled start and end times use each
-- participant\'s local time. If this value is true, the schedule uses each
-- participant\'s local time.
journeyResponse_localTime :: Lens.Lens' JourneyResponse (Prelude.Maybe Prelude.Bool)
journeyResponse_localTime :: (Maybe Bool -> f (Maybe Bool))
-> JourneyResponse -> f JourneyResponse
journeyResponse_localTime = (JourneyResponse -> Maybe Bool)
-> (JourneyResponse -> Maybe Bool -> JourneyResponse)
-> Lens JourneyResponse JourneyResponse (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JourneyResponse' {Maybe Bool
localTime :: Maybe Bool
$sel:localTime:JourneyResponse' :: JourneyResponse -> Maybe Bool
localTime} -> Maybe Bool
localTime) (\s :: JourneyResponse
s@JourneyResponse' {} Maybe Bool
a -> JourneyResponse
s {$sel:localTime:JourneyResponse' :: Maybe Bool
localTime = Maybe Bool
a} :: JourneyResponse)

-- | A map that contains a set of Activity objects, one object for each
-- activity in the journey. For each Activity object, the key is the unique
-- identifier (string) for an activity and the value is the settings for
-- the activity.
journeyResponse_activities :: Lens.Lens' JourneyResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Activity))
journeyResponse_activities :: (Maybe (HashMap Text Activity)
 -> f (Maybe (HashMap Text Activity)))
-> JourneyResponse -> f JourneyResponse
journeyResponse_activities = (JourneyResponse -> Maybe (HashMap Text Activity))
-> (JourneyResponse
    -> Maybe (HashMap Text Activity) -> JourneyResponse)
-> Lens
     JourneyResponse
     JourneyResponse
     (Maybe (HashMap Text Activity))
     (Maybe (HashMap Text Activity))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JourneyResponse' {Maybe (HashMap Text Activity)
activities :: Maybe (HashMap Text Activity)
$sel:activities:JourneyResponse' :: JourneyResponse -> Maybe (HashMap Text Activity)
activities} -> Maybe (HashMap Text Activity)
activities) (\s :: JourneyResponse
s@JourneyResponse' {} Maybe (HashMap Text Activity)
a -> JourneyResponse
s {$sel:activities:JourneyResponse' :: Maybe (HashMap Text Activity)
activities = Maybe (HashMap Text Activity)
a} :: JourneyResponse) ((Maybe (HashMap Text Activity)
  -> f (Maybe (HashMap Text Activity)))
 -> JourneyResponse -> f JourneyResponse)
-> ((Maybe (HashMap Text Activity)
     -> f (Maybe (HashMap Text Activity)))
    -> Maybe (HashMap Text Activity)
    -> f (Maybe (HashMap Text Activity)))
-> (Maybe (HashMap Text Activity)
    -> f (Maybe (HashMap Text Activity)))
-> JourneyResponse
-> f JourneyResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Activity)
  (HashMap Text Activity)
  (HashMap Text Activity)
  (HashMap Text Activity)
-> Iso
     (Maybe (HashMap Text Activity))
     (Maybe (HashMap Text Activity))
     (Maybe (HashMap Text Activity))
     (Maybe (HashMap Text Activity))
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 Activity)
  (HashMap Text Activity)
  (HashMap Text Activity)
  (HashMap Text Activity)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies whether a journey should be refreshed on segment update.
journeyResponse_refreshOnSegmentUpdate :: Lens.Lens' JourneyResponse (Prelude.Maybe Prelude.Bool)
journeyResponse_refreshOnSegmentUpdate :: (Maybe Bool -> f (Maybe Bool))
-> JourneyResponse -> f JourneyResponse
journeyResponse_refreshOnSegmentUpdate = (JourneyResponse -> Maybe Bool)
-> (JourneyResponse -> Maybe Bool -> JourneyResponse)
-> Lens JourneyResponse JourneyResponse (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JourneyResponse' {Maybe Bool
refreshOnSegmentUpdate :: Maybe Bool
$sel:refreshOnSegmentUpdate:JourneyResponse' :: JourneyResponse -> Maybe Bool
refreshOnSegmentUpdate} -> Maybe Bool
refreshOnSegmentUpdate) (\s :: JourneyResponse
s@JourneyResponse' {} Maybe Bool
a -> JourneyResponse
s {$sel:refreshOnSegmentUpdate:JourneyResponse' :: Maybe Bool
refreshOnSegmentUpdate = Maybe Bool
a} :: JourneyResponse)

-- | The messaging and entry limits for the journey.
journeyResponse_limits :: Lens.Lens' JourneyResponse (Prelude.Maybe JourneyLimits)
journeyResponse_limits :: (Maybe JourneyLimits -> f (Maybe JourneyLimits))
-> JourneyResponse -> f JourneyResponse
journeyResponse_limits = (JourneyResponse -> Maybe JourneyLimits)
-> (JourneyResponse -> Maybe JourneyLimits -> JourneyResponse)
-> Lens
     JourneyResponse
     JourneyResponse
     (Maybe JourneyLimits)
     (Maybe JourneyLimits)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JourneyResponse' {Maybe JourneyLimits
limits :: Maybe JourneyLimits
$sel:limits:JourneyResponse' :: JourneyResponse -> Maybe JourneyLimits
limits} -> Maybe JourneyLimits
limits) (\s :: JourneyResponse
s@JourneyResponse' {} Maybe JourneyLimits
a -> JourneyResponse
s {$sel:limits:JourneyResponse' :: Maybe JourneyLimits
limits = Maybe JourneyLimits
a} :: JourneyResponse)

-- | Specifies whether endpoints in quiet hours should enter a wait till the
-- end of their quiet hours.
journeyResponse_waitForQuietTime :: Lens.Lens' JourneyResponse (Prelude.Maybe Prelude.Bool)
journeyResponse_waitForQuietTime :: (Maybe Bool -> f (Maybe Bool))
-> JourneyResponse -> f JourneyResponse
journeyResponse_waitForQuietTime = (JourneyResponse -> Maybe Bool)
-> (JourneyResponse -> Maybe Bool -> JourneyResponse)
-> Lens JourneyResponse JourneyResponse (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JourneyResponse' {Maybe Bool
waitForQuietTime :: Maybe Bool
$sel:waitForQuietTime:JourneyResponse' :: JourneyResponse -> Maybe Bool
waitForQuietTime} -> Maybe Bool
waitForQuietTime) (\s :: JourneyResponse
s@JourneyResponse' {} Maybe Bool
a -> JourneyResponse
s {$sel:waitForQuietTime:JourneyResponse' :: Maybe Bool
waitForQuietTime = Maybe Bool
a} :: JourneyResponse)

-- | The quiet time settings for the journey. Quiet time is a specific time
-- range when a journey doesn\'t send messages to participants, if all the
-- following conditions are met:
--
-- -   The EndpointDemographic.Timezone property of the endpoint for the
--     participant is set to a valid value.
--
-- -   The current time in the participant\'s time zone is later than or
--     equal to the time specified by the QuietTime.Start property for the
--     journey.
--
-- -   The current time in the participant\'s time zone is earlier than or
--     equal to the time specified by the QuietTime.End property for the
--     journey.
--
-- If any of the preceding conditions isn\'t met, the participant will
-- receive messages from the journey, even if quiet time is enabled.
journeyResponse_quietTime :: Lens.Lens' JourneyResponse (Prelude.Maybe QuietTime)
journeyResponse_quietTime :: (Maybe QuietTime -> f (Maybe QuietTime))
-> JourneyResponse -> f JourneyResponse
journeyResponse_quietTime = (JourneyResponse -> Maybe QuietTime)
-> (JourneyResponse -> Maybe QuietTime -> JourneyResponse)
-> Lens
     JourneyResponse JourneyResponse (Maybe QuietTime) (Maybe QuietTime)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JourneyResponse' {Maybe QuietTime
quietTime :: Maybe QuietTime
$sel:quietTime:JourneyResponse' :: JourneyResponse -> Maybe QuietTime
quietTime} -> Maybe QuietTime
quietTime) (\s :: JourneyResponse
s@JourneyResponse' {} Maybe QuietTime
a -> JourneyResponse
s {$sel:quietTime:JourneyResponse' :: Maybe QuietTime
quietTime = Maybe QuietTime
a} :: JourneyResponse)

-- | The unique identifier for the first activity in the journey.
journeyResponse_startActivity :: Lens.Lens' JourneyResponse (Prelude.Maybe Prelude.Text)
journeyResponse_startActivity :: (Maybe Text -> f (Maybe Text))
-> JourneyResponse -> f JourneyResponse
journeyResponse_startActivity = (JourneyResponse -> Maybe Text)
-> (JourneyResponse -> Maybe Text -> JourneyResponse)
-> Lens JourneyResponse JourneyResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JourneyResponse' {Maybe Text
startActivity :: Maybe Text
$sel:startActivity:JourneyResponse' :: JourneyResponse -> Maybe Text
startActivity} -> Maybe Text
startActivity) (\s :: JourneyResponse
s@JourneyResponse' {} Maybe Text
a -> JourneyResponse
s {$sel:startActivity:JourneyResponse' :: Maybe Text
startActivity = Maybe Text
a} :: JourneyResponse)

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

-- | The segment that defines which users are participants in the journey.
journeyResponse_startCondition :: Lens.Lens' JourneyResponse (Prelude.Maybe StartCondition)
journeyResponse_startCondition :: (Maybe StartCondition -> f (Maybe StartCondition))
-> JourneyResponse -> f JourneyResponse
journeyResponse_startCondition = (JourneyResponse -> Maybe StartCondition)
-> (JourneyResponse -> Maybe StartCondition -> JourneyResponse)
-> Lens
     JourneyResponse
     JourneyResponse
     (Maybe StartCondition)
     (Maybe StartCondition)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JourneyResponse' {Maybe StartCondition
startCondition :: Maybe StartCondition
$sel:startCondition:JourneyResponse' :: JourneyResponse -> Maybe StartCondition
startCondition} -> Maybe StartCondition
startCondition) (\s :: JourneyResponse
s@JourneyResponse' {} Maybe StartCondition
a -> JourneyResponse
s {$sel:startCondition:JourneyResponse' :: Maybe StartCondition
startCondition = Maybe StartCondition
a} :: JourneyResponse)

-- | The channel-specific configurations for the journey.
journeyResponse_journeyChannelSettings :: Lens.Lens' JourneyResponse (Prelude.Maybe JourneyChannelSettings)
journeyResponse_journeyChannelSettings :: (Maybe JourneyChannelSettings -> f (Maybe JourneyChannelSettings))
-> JourneyResponse -> f JourneyResponse
journeyResponse_journeyChannelSettings = (JourneyResponse -> Maybe JourneyChannelSettings)
-> (JourneyResponse
    -> Maybe JourneyChannelSettings -> JourneyResponse)
-> Lens
     JourneyResponse
     JourneyResponse
     (Maybe JourneyChannelSettings)
     (Maybe JourneyChannelSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JourneyResponse' {Maybe JourneyChannelSettings
journeyChannelSettings :: Maybe JourneyChannelSettings
$sel:journeyChannelSettings:JourneyResponse' :: JourneyResponse -> Maybe JourneyChannelSettings
journeyChannelSettings} -> Maybe JourneyChannelSettings
journeyChannelSettings) (\s :: JourneyResponse
s@JourneyResponse' {} Maybe JourneyChannelSettings
a -> JourneyResponse
s {$sel:journeyChannelSettings:JourneyResponse' :: Maybe JourneyChannelSettings
journeyChannelSettings = Maybe JourneyChannelSettings
a} :: JourneyResponse)

-- | The frequency with which Amazon Pinpoint evaluates segment and event
-- data for the journey, as a duration in ISO 8601 format.
journeyResponse_refreshFrequency :: Lens.Lens' JourneyResponse (Prelude.Maybe Prelude.Text)
journeyResponse_refreshFrequency :: (Maybe Text -> f (Maybe Text))
-> JourneyResponse -> f JourneyResponse
journeyResponse_refreshFrequency = (JourneyResponse -> Maybe Text)
-> (JourneyResponse -> Maybe Text -> JourneyResponse)
-> Lens JourneyResponse JourneyResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JourneyResponse' {Maybe Text
refreshFrequency :: Maybe Text
$sel:refreshFrequency:JourneyResponse' :: JourneyResponse -> Maybe Text
refreshFrequency} -> Maybe Text
refreshFrequency) (\s :: JourneyResponse
s@JourneyResponse' {} Maybe Text
a -> JourneyResponse
s {$sel:refreshFrequency:JourneyResponse' :: Maybe Text
refreshFrequency = Maybe Text
a} :: JourneyResponse)

-- | This object is not used or supported.
journeyResponse_tags :: Lens.Lens' JourneyResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
journeyResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> JourneyResponse -> f JourneyResponse
journeyResponse_tags = (JourneyResponse -> Maybe (HashMap Text Text))
-> (JourneyResponse
    -> Maybe (HashMap Text Text) -> JourneyResponse)
-> Lens
     JourneyResponse
     JourneyResponse
     (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 (\JourneyResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:JourneyResponse' :: JourneyResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: JourneyResponse
s@JourneyResponse' {} Maybe (HashMap Text Text)
a -> JourneyResponse
s {$sel:tags:JourneyResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: JourneyResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> JourneyResponse -> f JourneyResponse)
-> ((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)))
-> JourneyResponse
-> f JourneyResponse
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 name of the journey.
journeyResponse_name :: Lens.Lens' JourneyResponse Prelude.Text
journeyResponse_name :: (Text -> f Text) -> JourneyResponse -> f JourneyResponse
journeyResponse_name = (JourneyResponse -> Text)
-> (JourneyResponse -> Text -> JourneyResponse)
-> Lens JourneyResponse JourneyResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JourneyResponse' {Text
name :: Text
$sel:name:JourneyResponse' :: JourneyResponse -> Text
name} -> Text
name) (\s :: JourneyResponse
s@JourneyResponse' {} Text
a -> JourneyResponse
s {$sel:name:JourneyResponse' :: Text
name = Text
a} :: JourneyResponse)

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

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

instance Core.FromJSON JourneyResponse where
  parseJSON :: Value -> Parser JourneyResponse
parseJSON =
    String
-> (Object -> Parser JourneyResponse)
-> Value
-> Parser JourneyResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"JourneyResponse"
      ( \Object
x ->
          Maybe State
-> Maybe Text
-> Maybe JourneySchedule
-> Maybe Bool
-> Maybe (HashMap Text Activity)
-> Maybe Bool
-> Maybe JourneyLimits
-> Maybe Bool
-> Maybe QuietTime
-> Maybe Text
-> Maybe Text
-> Maybe StartCondition
-> Maybe JourneyChannelSettings
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> JourneyResponse
JourneyResponse'
            (Maybe State
 -> Maybe Text
 -> Maybe JourneySchedule
 -> Maybe Bool
 -> Maybe (HashMap Text Activity)
 -> Maybe Bool
 -> Maybe JourneyLimits
 -> Maybe Bool
 -> Maybe QuietTime
 -> Maybe Text
 -> Maybe Text
 -> Maybe StartCondition
 -> Maybe JourneyChannelSettings
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Text
 -> Text
 -> Text
 -> JourneyResponse)
-> Parser (Maybe State)
-> Parser
     (Maybe Text
      -> Maybe JourneySchedule
      -> Maybe Bool
      -> Maybe (HashMap Text Activity)
      -> Maybe Bool
      -> Maybe JourneyLimits
      -> Maybe Bool
      -> Maybe QuietTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe StartCondition
      -> Maybe JourneyChannelSettings
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JourneyResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe State)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
            Parser
  (Maybe Text
   -> Maybe JourneySchedule
   -> Maybe Bool
   -> Maybe (HashMap Text Activity)
   -> Maybe Bool
   -> Maybe JourneyLimits
   -> Maybe Bool
   -> Maybe QuietTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe StartCondition
   -> Maybe JourneyChannelSettings
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JourneyResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe JourneySchedule
      -> Maybe Bool
      -> Maybe (HashMap Text Activity)
      -> Maybe Bool
      -> Maybe JourneyLimits
      -> Maybe Bool
      -> Maybe QuietTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe StartCondition
      -> Maybe JourneyChannelSettings
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JourneyResponse)
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
"LastModifiedDate")
            Parser
  (Maybe JourneySchedule
   -> Maybe Bool
   -> Maybe (HashMap Text Activity)
   -> Maybe Bool
   -> Maybe JourneyLimits
   -> Maybe Bool
   -> Maybe QuietTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe StartCondition
   -> Maybe JourneyChannelSettings
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JourneyResponse)
-> Parser (Maybe JourneySchedule)
-> Parser
     (Maybe Bool
      -> Maybe (HashMap Text Activity)
      -> Maybe Bool
      -> Maybe JourneyLimits
      -> Maybe Bool
      -> Maybe QuietTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe StartCondition
      -> Maybe JourneyChannelSettings
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JourneyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JourneySchedule)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Schedule")
            Parser
  (Maybe Bool
   -> Maybe (HashMap Text Activity)
   -> Maybe Bool
   -> Maybe JourneyLimits
   -> Maybe Bool
   -> Maybe QuietTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe StartCondition
   -> Maybe JourneyChannelSettings
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JourneyResponse)
-> Parser (Maybe Bool)
-> Parser
     (Maybe (HashMap Text Activity)
      -> Maybe Bool
      -> Maybe JourneyLimits
      -> Maybe Bool
      -> Maybe QuietTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe StartCondition
      -> Maybe JourneyChannelSettings
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JourneyResponse)
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
"LocalTime")
            Parser
  (Maybe (HashMap Text Activity)
   -> Maybe Bool
   -> Maybe JourneyLimits
   -> Maybe Bool
   -> Maybe QuietTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe StartCondition
   -> Maybe JourneyChannelSettings
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JourneyResponse)
-> Parser (Maybe (HashMap Text Activity))
-> Parser
     (Maybe Bool
      -> Maybe JourneyLimits
      -> Maybe Bool
      -> Maybe QuietTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe StartCondition
      -> Maybe JourneyChannelSettings
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JourneyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Activity)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Activities" Parser (Maybe (Maybe (HashMap Text Activity)))
-> Maybe (HashMap Text Activity)
-> Parser (Maybe (HashMap Text Activity))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Activity)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Bool
   -> Maybe JourneyLimits
   -> Maybe Bool
   -> Maybe QuietTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe StartCondition
   -> Maybe JourneyChannelSettings
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JourneyResponse)
-> Parser (Maybe Bool)
-> Parser
     (Maybe JourneyLimits
      -> Maybe Bool
      -> Maybe QuietTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe StartCondition
      -> Maybe JourneyChannelSettings
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JourneyResponse)
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
"RefreshOnSegmentUpdate")
            Parser
  (Maybe JourneyLimits
   -> Maybe Bool
   -> Maybe QuietTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe StartCondition
   -> Maybe JourneyChannelSettings
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JourneyResponse)
-> Parser (Maybe JourneyLimits)
-> Parser
     (Maybe Bool
      -> Maybe QuietTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe StartCondition
      -> Maybe JourneyChannelSettings
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JourneyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JourneyLimits)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Limits")
            Parser
  (Maybe Bool
   -> Maybe QuietTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe StartCondition
   -> Maybe JourneyChannelSettings
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JourneyResponse)
-> Parser (Maybe Bool)
-> Parser
     (Maybe QuietTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe StartCondition
      -> Maybe JourneyChannelSettings
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JourneyResponse)
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
"WaitForQuietTime")
            Parser
  (Maybe QuietTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe StartCondition
   -> Maybe JourneyChannelSettings
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JourneyResponse)
-> Parser (Maybe QuietTime)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe StartCondition
      -> Maybe JourneyChannelSettings
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JourneyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe QuietTime)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QuietTime")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe StartCondition
   -> Maybe JourneyChannelSettings
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JourneyResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe StartCondition
      -> Maybe JourneyChannelSettings
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JourneyResponse)
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
"StartActivity")
            Parser
  (Maybe Text
   -> Maybe StartCondition
   -> Maybe JourneyChannelSettings
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JourneyResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe StartCondition
      -> Maybe JourneyChannelSettings
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JourneyResponse)
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
"CreationDate")
            Parser
  (Maybe StartCondition
   -> Maybe JourneyChannelSettings
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JourneyResponse)
-> Parser (Maybe StartCondition)
-> Parser
     (Maybe JourneyChannelSettings
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JourneyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe StartCondition)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StartCondition")
            Parser
  (Maybe JourneyChannelSettings
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JourneyResponse)
-> Parser (Maybe JourneyChannelSettings)
-> Parser
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JourneyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JourneyChannelSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"JourneyChannelSettings")
            Parser
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JourneyResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap Text Text)
      -> Text -> Text -> Text -> JourneyResponse)
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
"RefreshFrequency")
            Parser
  (Maybe (HashMap Text Text)
   -> Text -> Text -> Text -> JourneyResponse)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Text -> Text -> Text -> JourneyResponse)
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 -> JourneyResponse)
-> Parser Text -> Parser (Text -> Text -> JourneyResponse)
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
"Name")
            Parser (Text -> Text -> JourneyResponse)
-> Parser Text -> Parser (Text -> JourneyResponse)
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 -> JourneyResponse)
-> Parser Text -> Parser JourneyResponse
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 JourneyResponse

instance Prelude.NFData JourneyResponse