{-# 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.SWF.Types.WorkflowExecutionStartedEventAttributes
-- 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.SWF.Types.WorkflowExecutionStartedEventAttributes where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SWF.Types.ChildPolicy
import Amazonka.SWF.Types.TaskList
import Amazonka.SWF.Types.WorkflowExecution
import Amazonka.SWF.Types.WorkflowType

-- | Provides details of @WorkflowExecutionStarted@ event.
--
-- /See:/ 'newWorkflowExecutionStartedEventAttributes' smart constructor.
data WorkflowExecutionStartedEventAttributes = WorkflowExecutionStartedEventAttributes'
  { -- | The ID of the @StartChildWorkflowExecutionInitiated@ event corresponding
    -- to the @StartChildWorkflowExecution@ Decision to start this workflow
    -- execution. The source event with this ID can be found in the history of
    -- the source workflow execution. This information can be useful for
    -- diagnosing problems by tracing back the chain of events leading up to
    -- this event.
    WorkflowExecutionStartedEventAttributes -> Maybe Integer
parentInitiatedEventId :: Prelude.Maybe Prelude.Integer,
    -- | The list of tags associated with this workflow execution. An execution
    -- can have up to 5 tags.
    WorkflowExecutionStartedEventAttributes -> Maybe [Text]
tagList :: Prelude.Maybe [Prelude.Text],
    -- | The maximum duration of decision tasks for this workflow type.
    --
    -- The duration is specified in seconds, an integer greater than or equal
    -- to @0@. You can use @NONE@ to specify unlimited duration.
    WorkflowExecutionStartedEventAttributes -> Maybe Text
taskStartToCloseTimeout :: Prelude.Maybe Prelude.Text,
    -- | The IAM role attached to the workflow execution.
    WorkflowExecutionStartedEventAttributes -> Maybe Text
lambdaRole :: Prelude.Maybe Prelude.Text,
    -- | The input provided to the workflow execution.
    WorkflowExecutionStartedEventAttributes -> Maybe Text
input :: Prelude.Maybe Prelude.Text,
    -- | The maximum duration for this workflow execution.
    --
    -- The duration is specified in seconds, an integer greater than or equal
    -- to @0@. You can use @NONE@ to specify unlimited duration.
    WorkflowExecutionStartedEventAttributes -> Maybe Text
executionStartToCloseTimeout :: Prelude.Maybe Prelude.Text,
    -- | The priority of the decision tasks in the workflow execution.
    WorkflowExecutionStartedEventAttributes -> Maybe Text
taskPriority :: Prelude.Maybe Prelude.Text,
    -- | The source workflow execution that started this workflow execution. The
    -- member isn\'t set if the workflow execution was not started by a
    -- workflow.
    WorkflowExecutionStartedEventAttributes -> Maybe WorkflowExecution
parentWorkflowExecution :: Prelude.Maybe WorkflowExecution,
    -- | If this workflow execution was started due to a
    -- @ContinueAsNewWorkflowExecution@ decision, then it contains the @runId@
    -- of the previous workflow execution that was closed and continued as this
    -- execution.
    WorkflowExecutionStartedEventAttributes -> Maybe Text
continuedExecutionRunId :: Prelude.Maybe Prelude.Text,
    -- | The policy to use for the child workflow executions if this workflow
    -- execution is terminated, by calling the TerminateWorkflowExecution
    -- action explicitly or due to an expired timeout.
    --
    -- The supported child policies are:
    --
    -- -   @TERMINATE@ – The child executions are terminated.
    --
    -- -   @REQUEST_CANCEL@ – A request to cancel is attempted for each child
    --     execution by recording a @WorkflowExecutionCancelRequested@ event in
    --     its history. It is up to the decider to take appropriate actions
    --     when it receives an execution history with this event.
    --
    -- -   @ABANDON@ – No action is taken. The child executions continue to
    --     run.
    WorkflowExecutionStartedEventAttributes -> ChildPolicy
childPolicy :: ChildPolicy,
    -- | The name of the task list for scheduling the decision tasks for this
    -- workflow execution.
    WorkflowExecutionStartedEventAttributes -> TaskList
taskList :: TaskList,
    -- | The workflow type of this execution.
    WorkflowExecutionStartedEventAttributes -> WorkflowType
workflowType :: WorkflowType
  }
  deriving (WorkflowExecutionStartedEventAttributes
-> WorkflowExecutionStartedEventAttributes -> Bool
(WorkflowExecutionStartedEventAttributes
 -> WorkflowExecutionStartedEventAttributes -> Bool)
-> (WorkflowExecutionStartedEventAttributes
    -> WorkflowExecutionStartedEventAttributes -> Bool)
-> Eq WorkflowExecutionStartedEventAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkflowExecutionStartedEventAttributes
-> WorkflowExecutionStartedEventAttributes -> Bool
$c/= :: WorkflowExecutionStartedEventAttributes
-> WorkflowExecutionStartedEventAttributes -> Bool
== :: WorkflowExecutionStartedEventAttributes
-> WorkflowExecutionStartedEventAttributes -> Bool
$c== :: WorkflowExecutionStartedEventAttributes
-> WorkflowExecutionStartedEventAttributes -> Bool
Prelude.Eq, ReadPrec [WorkflowExecutionStartedEventAttributes]
ReadPrec WorkflowExecutionStartedEventAttributes
Int -> ReadS WorkflowExecutionStartedEventAttributes
ReadS [WorkflowExecutionStartedEventAttributes]
(Int -> ReadS WorkflowExecutionStartedEventAttributes)
-> ReadS [WorkflowExecutionStartedEventAttributes]
-> ReadPrec WorkflowExecutionStartedEventAttributes
-> ReadPrec [WorkflowExecutionStartedEventAttributes]
-> Read WorkflowExecutionStartedEventAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkflowExecutionStartedEventAttributes]
$creadListPrec :: ReadPrec [WorkflowExecutionStartedEventAttributes]
readPrec :: ReadPrec WorkflowExecutionStartedEventAttributes
$creadPrec :: ReadPrec WorkflowExecutionStartedEventAttributes
readList :: ReadS [WorkflowExecutionStartedEventAttributes]
$creadList :: ReadS [WorkflowExecutionStartedEventAttributes]
readsPrec :: Int -> ReadS WorkflowExecutionStartedEventAttributes
$creadsPrec :: Int -> ReadS WorkflowExecutionStartedEventAttributes
Prelude.Read, Int -> WorkflowExecutionStartedEventAttributes -> ShowS
[WorkflowExecutionStartedEventAttributes] -> ShowS
WorkflowExecutionStartedEventAttributes -> String
(Int -> WorkflowExecutionStartedEventAttributes -> ShowS)
-> (WorkflowExecutionStartedEventAttributes -> String)
-> ([WorkflowExecutionStartedEventAttributes] -> ShowS)
-> Show WorkflowExecutionStartedEventAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkflowExecutionStartedEventAttributes] -> ShowS
$cshowList :: [WorkflowExecutionStartedEventAttributes] -> ShowS
show :: WorkflowExecutionStartedEventAttributes -> String
$cshow :: WorkflowExecutionStartedEventAttributes -> String
showsPrec :: Int -> WorkflowExecutionStartedEventAttributes -> ShowS
$cshowsPrec :: Int -> WorkflowExecutionStartedEventAttributes -> ShowS
Prelude.Show, (forall x.
 WorkflowExecutionStartedEventAttributes
 -> Rep WorkflowExecutionStartedEventAttributes x)
-> (forall x.
    Rep WorkflowExecutionStartedEventAttributes x
    -> WorkflowExecutionStartedEventAttributes)
-> Generic WorkflowExecutionStartedEventAttributes
forall x.
Rep WorkflowExecutionStartedEventAttributes x
-> WorkflowExecutionStartedEventAttributes
forall x.
WorkflowExecutionStartedEventAttributes
-> Rep WorkflowExecutionStartedEventAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WorkflowExecutionStartedEventAttributes x
-> WorkflowExecutionStartedEventAttributes
$cfrom :: forall x.
WorkflowExecutionStartedEventAttributes
-> Rep WorkflowExecutionStartedEventAttributes x
Prelude.Generic)

-- |
-- Create a value of 'WorkflowExecutionStartedEventAttributes' 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:
--
-- 'parentInitiatedEventId', 'workflowExecutionStartedEventAttributes_parentInitiatedEventId' - The ID of the @StartChildWorkflowExecutionInitiated@ event corresponding
-- to the @StartChildWorkflowExecution@ Decision to start this workflow
-- execution. The source event with this ID can be found in the history of
-- the source workflow execution. This information can be useful for
-- diagnosing problems by tracing back the chain of events leading up to
-- this event.
--
-- 'tagList', 'workflowExecutionStartedEventAttributes_tagList' - The list of tags associated with this workflow execution. An execution
-- can have up to 5 tags.
--
-- 'taskStartToCloseTimeout', 'workflowExecutionStartedEventAttributes_taskStartToCloseTimeout' - The maximum duration of decision tasks for this workflow type.
--
-- The duration is specified in seconds, an integer greater than or equal
-- to @0@. You can use @NONE@ to specify unlimited duration.
--
-- 'lambdaRole', 'workflowExecutionStartedEventAttributes_lambdaRole' - The IAM role attached to the workflow execution.
--
-- 'input', 'workflowExecutionStartedEventAttributes_input' - The input provided to the workflow execution.
--
-- 'executionStartToCloseTimeout', 'workflowExecutionStartedEventAttributes_executionStartToCloseTimeout' - The maximum duration for this workflow execution.
--
-- The duration is specified in seconds, an integer greater than or equal
-- to @0@. You can use @NONE@ to specify unlimited duration.
--
-- 'taskPriority', 'workflowExecutionStartedEventAttributes_taskPriority' - The priority of the decision tasks in the workflow execution.
--
-- 'parentWorkflowExecution', 'workflowExecutionStartedEventAttributes_parentWorkflowExecution' - The source workflow execution that started this workflow execution. The
-- member isn\'t set if the workflow execution was not started by a
-- workflow.
--
-- 'continuedExecutionRunId', 'workflowExecutionStartedEventAttributes_continuedExecutionRunId' - If this workflow execution was started due to a
-- @ContinueAsNewWorkflowExecution@ decision, then it contains the @runId@
-- of the previous workflow execution that was closed and continued as this
-- execution.
--
-- 'childPolicy', 'workflowExecutionStartedEventAttributes_childPolicy' - The policy to use for the child workflow executions if this workflow
-- execution is terminated, by calling the TerminateWorkflowExecution
-- action explicitly or due to an expired timeout.
--
-- The supported child policies are:
--
-- -   @TERMINATE@ – The child executions are terminated.
--
-- -   @REQUEST_CANCEL@ – A request to cancel is attempted for each child
--     execution by recording a @WorkflowExecutionCancelRequested@ event in
--     its history. It is up to the decider to take appropriate actions
--     when it receives an execution history with this event.
--
-- -   @ABANDON@ – No action is taken. The child executions continue to
--     run.
--
-- 'taskList', 'workflowExecutionStartedEventAttributes_taskList' - The name of the task list for scheduling the decision tasks for this
-- workflow execution.
--
-- 'workflowType', 'workflowExecutionStartedEventAttributes_workflowType' - The workflow type of this execution.
newWorkflowExecutionStartedEventAttributes ::
  -- | 'childPolicy'
  ChildPolicy ->
  -- | 'taskList'
  TaskList ->
  -- | 'workflowType'
  WorkflowType ->
  WorkflowExecutionStartedEventAttributes
newWorkflowExecutionStartedEventAttributes :: ChildPolicy
-> TaskList
-> WorkflowType
-> WorkflowExecutionStartedEventAttributes
newWorkflowExecutionStartedEventAttributes
  ChildPolicy
pChildPolicy_
  TaskList
pTaskList_
  WorkflowType
pWorkflowType_ =
    WorkflowExecutionStartedEventAttributes' :: Maybe Integer
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe WorkflowExecution
-> Maybe Text
-> ChildPolicy
-> TaskList
-> WorkflowType
-> WorkflowExecutionStartedEventAttributes
WorkflowExecutionStartedEventAttributes'
      { $sel:parentInitiatedEventId:WorkflowExecutionStartedEventAttributes' :: Maybe Integer
parentInitiatedEventId =
          Maybe Integer
forall a. Maybe a
Prelude.Nothing,
        $sel:tagList:WorkflowExecutionStartedEventAttributes' :: Maybe [Text]
tagList = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:taskStartToCloseTimeout:WorkflowExecutionStartedEventAttributes' :: Maybe Text
taskStartToCloseTimeout =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:lambdaRole:WorkflowExecutionStartedEventAttributes' :: Maybe Text
lambdaRole = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:input:WorkflowExecutionStartedEventAttributes' :: Maybe Text
input = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:executionStartToCloseTimeout:WorkflowExecutionStartedEventAttributes' :: Maybe Text
executionStartToCloseTimeout =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:taskPriority:WorkflowExecutionStartedEventAttributes' :: Maybe Text
taskPriority = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:parentWorkflowExecution:WorkflowExecutionStartedEventAttributes' :: Maybe WorkflowExecution
parentWorkflowExecution =
          Maybe WorkflowExecution
forall a. Maybe a
Prelude.Nothing,
        $sel:continuedExecutionRunId:WorkflowExecutionStartedEventAttributes' :: Maybe Text
continuedExecutionRunId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:childPolicy:WorkflowExecutionStartedEventAttributes' :: ChildPolicy
childPolicy = ChildPolicy
pChildPolicy_,
        $sel:taskList:WorkflowExecutionStartedEventAttributes' :: TaskList
taskList = TaskList
pTaskList_,
        $sel:workflowType:WorkflowExecutionStartedEventAttributes' :: WorkflowType
workflowType = WorkflowType
pWorkflowType_
      }

-- | The ID of the @StartChildWorkflowExecutionInitiated@ event corresponding
-- to the @StartChildWorkflowExecution@ Decision to start this workflow
-- execution. The source event with this ID can be found in the history of
-- the source workflow execution. This information can be useful for
-- diagnosing problems by tracing back the chain of events leading up to
-- this event.
workflowExecutionStartedEventAttributes_parentInitiatedEventId :: Lens.Lens' WorkflowExecutionStartedEventAttributes (Prelude.Maybe Prelude.Integer)
workflowExecutionStartedEventAttributes_parentInitiatedEventId :: (Maybe Integer -> f (Maybe Integer))
-> WorkflowExecutionStartedEventAttributes
-> f WorkflowExecutionStartedEventAttributes
workflowExecutionStartedEventAttributes_parentInitiatedEventId = (WorkflowExecutionStartedEventAttributes -> Maybe Integer)
-> (WorkflowExecutionStartedEventAttributes
    -> Maybe Integer -> WorkflowExecutionStartedEventAttributes)
-> Lens
     WorkflowExecutionStartedEventAttributes
     WorkflowExecutionStartedEventAttributes
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionStartedEventAttributes' {Maybe Integer
parentInitiatedEventId :: Maybe Integer
$sel:parentInitiatedEventId:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Integer
parentInitiatedEventId} -> Maybe Integer
parentInitiatedEventId) (\s :: WorkflowExecutionStartedEventAttributes
s@WorkflowExecutionStartedEventAttributes' {} Maybe Integer
a -> WorkflowExecutionStartedEventAttributes
s {$sel:parentInitiatedEventId:WorkflowExecutionStartedEventAttributes' :: Maybe Integer
parentInitiatedEventId = Maybe Integer
a} :: WorkflowExecutionStartedEventAttributes)

-- | The list of tags associated with this workflow execution. An execution
-- can have up to 5 tags.
workflowExecutionStartedEventAttributes_tagList :: Lens.Lens' WorkflowExecutionStartedEventAttributes (Prelude.Maybe [Prelude.Text])
workflowExecutionStartedEventAttributes_tagList :: (Maybe [Text] -> f (Maybe [Text]))
-> WorkflowExecutionStartedEventAttributes
-> f WorkflowExecutionStartedEventAttributes
workflowExecutionStartedEventAttributes_tagList = (WorkflowExecutionStartedEventAttributes -> Maybe [Text])
-> (WorkflowExecutionStartedEventAttributes
    -> Maybe [Text] -> WorkflowExecutionStartedEventAttributes)
-> Lens
     WorkflowExecutionStartedEventAttributes
     WorkflowExecutionStartedEventAttributes
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionStartedEventAttributes' {Maybe [Text]
tagList :: Maybe [Text]
$sel:tagList:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe [Text]
tagList} -> Maybe [Text]
tagList) (\s :: WorkflowExecutionStartedEventAttributes
s@WorkflowExecutionStartedEventAttributes' {} Maybe [Text]
a -> WorkflowExecutionStartedEventAttributes
s {$sel:tagList:WorkflowExecutionStartedEventAttributes' :: Maybe [Text]
tagList = Maybe [Text]
a} :: WorkflowExecutionStartedEventAttributes) ((Maybe [Text] -> f (Maybe [Text]))
 -> WorkflowExecutionStartedEventAttributes
 -> f WorkflowExecutionStartedEventAttributes)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> WorkflowExecutionStartedEventAttributes
-> f WorkflowExecutionStartedEventAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum duration of decision tasks for this workflow type.
--
-- The duration is specified in seconds, an integer greater than or equal
-- to @0@. You can use @NONE@ to specify unlimited duration.
workflowExecutionStartedEventAttributes_taskStartToCloseTimeout :: Lens.Lens' WorkflowExecutionStartedEventAttributes (Prelude.Maybe Prelude.Text)
workflowExecutionStartedEventAttributes_taskStartToCloseTimeout :: (Maybe Text -> f (Maybe Text))
-> WorkflowExecutionStartedEventAttributes
-> f WorkflowExecutionStartedEventAttributes
workflowExecutionStartedEventAttributes_taskStartToCloseTimeout = (WorkflowExecutionStartedEventAttributes -> Maybe Text)
-> (WorkflowExecutionStartedEventAttributes
    -> Maybe Text -> WorkflowExecutionStartedEventAttributes)
-> Lens
     WorkflowExecutionStartedEventAttributes
     WorkflowExecutionStartedEventAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionStartedEventAttributes' {Maybe Text
taskStartToCloseTimeout :: Maybe Text
$sel:taskStartToCloseTimeout:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Text
taskStartToCloseTimeout} -> Maybe Text
taskStartToCloseTimeout) (\s :: WorkflowExecutionStartedEventAttributes
s@WorkflowExecutionStartedEventAttributes' {} Maybe Text
a -> WorkflowExecutionStartedEventAttributes
s {$sel:taskStartToCloseTimeout:WorkflowExecutionStartedEventAttributes' :: Maybe Text
taskStartToCloseTimeout = Maybe Text
a} :: WorkflowExecutionStartedEventAttributes)

-- | The IAM role attached to the workflow execution.
workflowExecutionStartedEventAttributes_lambdaRole :: Lens.Lens' WorkflowExecutionStartedEventAttributes (Prelude.Maybe Prelude.Text)
workflowExecutionStartedEventAttributes_lambdaRole :: (Maybe Text -> f (Maybe Text))
-> WorkflowExecutionStartedEventAttributes
-> f WorkflowExecutionStartedEventAttributes
workflowExecutionStartedEventAttributes_lambdaRole = (WorkflowExecutionStartedEventAttributes -> Maybe Text)
-> (WorkflowExecutionStartedEventAttributes
    -> Maybe Text -> WorkflowExecutionStartedEventAttributes)
-> Lens
     WorkflowExecutionStartedEventAttributes
     WorkflowExecutionStartedEventAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionStartedEventAttributes' {Maybe Text
lambdaRole :: Maybe Text
$sel:lambdaRole:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Text
lambdaRole} -> Maybe Text
lambdaRole) (\s :: WorkflowExecutionStartedEventAttributes
s@WorkflowExecutionStartedEventAttributes' {} Maybe Text
a -> WorkflowExecutionStartedEventAttributes
s {$sel:lambdaRole:WorkflowExecutionStartedEventAttributes' :: Maybe Text
lambdaRole = Maybe Text
a} :: WorkflowExecutionStartedEventAttributes)

-- | The input provided to the workflow execution.
workflowExecutionStartedEventAttributes_input :: Lens.Lens' WorkflowExecutionStartedEventAttributes (Prelude.Maybe Prelude.Text)
workflowExecutionStartedEventAttributes_input :: (Maybe Text -> f (Maybe Text))
-> WorkflowExecutionStartedEventAttributes
-> f WorkflowExecutionStartedEventAttributes
workflowExecutionStartedEventAttributes_input = (WorkflowExecutionStartedEventAttributes -> Maybe Text)
-> (WorkflowExecutionStartedEventAttributes
    -> Maybe Text -> WorkflowExecutionStartedEventAttributes)
-> Lens
     WorkflowExecutionStartedEventAttributes
     WorkflowExecutionStartedEventAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionStartedEventAttributes' {Maybe Text
input :: Maybe Text
$sel:input:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Text
input} -> Maybe Text
input) (\s :: WorkflowExecutionStartedEventAttributes
s@WorkflowExecutionStartedEventAttributes' {} Maybe Text
a -> WorkflowExecutionStartedEventAttributes
s {$sel:input:WorkflowExecutionStartedEventAttributes' :: Maybe Text
input = Maybe Text
a} :: WorkflowExecutionStartedEventAttributes)

-- | The maximum duration for this workflow execution.
--
-- The duration is specified in seconds, an integer greater than or equal
-- to @0@. You can use @NONE@ to specify unlimited duration.
workflowExecutionStartedEventAttributes_executionStartToCloseTimeout :: Lens.Lens' WorkflowExecutionStartedEventAttributes (Prelude.Maybe Prelude.Text)
workflowExecutionStartedEventAttributes_executionStartToCloseTimeout :: (Maybe Text -> f (Maybe Text))
-> WorkflowExecutionStartedEventAttributes
-> f WorkflowExecutionStartedEventAttributes
workflowExecutionStartedEventAttributes_executionStartToCloseTimeout = (WorkflowExecutionStartedEventAttributes -> Maybe Text)
-> (WorkflowExecutionStartedEventAttributes
    -> Maybe Text -> WorkflowExecutionStartedEventAttributes)
-> Lens
     WorkflowExecutionStartedEventAttributes
     WorkflowExecutionStartedEventAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionStartedEventAttributes' {Maybe Text
executionStartToCloseTimeout :: Maybe Text
$sel:executionStartToCloseTimeout:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Text
executionStartToCloseTimeout} -> Maybe Text
executionStartToCloseTimeout) (\s :: WorkflowExecutionStartedEventAttributes
s@WorkflowExecutionStartedEventAttributes' {} Maybe Text
a -> WorkflowExecutionStartedEventAttributes
s {$sel:executionStartToCloseTimeout:WorkflowExecutionStartedEventAttributes' :: Maybe Text
executionStartToCloseTimeout = Maybe Text
a} :: WorkflowExecutionStartedEventAttributes)

-- | The priority of the decision tasks in the workflow execution.
workflowExecutionStartedEventAttributes_taskPriority :: Lens.Lens' WorkflowExecutionStartedEventAttributes (Prelude.Maybe Prelude.Text)
workflowExecutionStartedEventAttributes_taskPriority :: (Maybe Text -> f (Maybe Text))
-> WorkflowExecutionStartedEventAttributes
-> f WorkflowExecutionStartedEventAttributes
workflowExecutionStartedEventAttributes_taskPriority = (WorkflowExecutionStartedEventAttributes -> Maybe Text)
-> (WorkflowExecutionStartedEventAttributes
    -> Maybe Text -> WorkflowExecutionStartedEventAttributes)
-> Lens
     WorkflowExecutionStartedEventAttributes
     WorkflowExecutionStartedEventAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionStartedEventAttributes' {Maybe Text
taskPriority :: Maybe Text
$sel:taskPriority:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Text
taskPriority} -> Maybe Text
taskPriority) (\s :: WorkflowExecutionStartedEventAttributes
s@WorkflowExecutionStartedEventAttributes' {} Maybe Text
a -> WorkflowExecutionStartedEventAttributes
s {$sel:taskPriority:WorkflowExecutionStartedEventAttributes' :: Maybe Text
taskPriority = Maybe Text
a} :: WorkflowExecutionStartedEventAttributes)

-- | The source workflow execution that started this workflow execution. The
-- member isn\'t set if the workflow execution was not started by a
-- workflow.
workflowExecutionStartedEventAttributes_parentWorkflowExecution :: Lens.Lens' WorkflowExecutionStartedEventAttributes (Prelude.Maybe WorkflowExecution)
workflowExecutionStartedEventAttributes_parentWorkflowExecution :: (Maybe WorkflowExecution -> f (Maybe WorkflowExecution))
-> WorkflowExecutionStartedEventAttributes
-> f WorkflowExecutionStartedEventAttributes
workflowExecutionStartedEventAttributes_parentWorkflowExecution = (WorkflowExecutionStartedEventAttributes
 -> Maybe WorkflowExecution)
-> (WorkflowExecutionStartedEventAttributes
    -> Maybe WorkflowExecution
    -> WorkflowExecutionStartedEventAttributes)
-> Lens
     WorkflowExecutionStartedEventAttributes
     WorkflowExecutionStartedEventAttributes
     (Maybe WorkflowExecution)
     (Maybe WorkflowExecution)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionStartedEventAttributes' {Maybe WorkflowExecution
parentWorkflowExecution :: Maybe WorkflowExecution
$sel:parentWorkflowExecution:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe WorkflowExecution
parentWorkflowExecution} -> Maybe WorkflowExecution
parentWorkflowExecution) (\s :: WorkflowExecutionStartedEventAttributes
s@WorkflowExecutionStartedEventAttributes' {} Maybe WorkflowExecution
a -> WorkflowExecutionStartedEventAttributes
s {$sel:parentWorkflowExecution:WorkflowExecutionStartedEventAttributes' :: Maybe WorkflowExecution
parentWorkflowExecution = Maybe WorkflowExecution
a} :: WorkflowExecutionStartedEventAttributes)

-- | If this workflow execution was started due to a
-- @ContinueAsNewWorkflowExecution@ decision, then it contains the @runId@
-- of the previous workflow execution that was closed and continued as this
-- execution.
workflowExecutionStartedEventAttributes_continuedExecutionRunId :: Lens.Lens' WorkflowExecutionStartedEventAttributes (Prelude.Maybe Prelude.Text)
workflowExecutionStartedEventAttributes_continuedExecutionRunId :: (Maybe Text -> f (Maybe Text))
-> WorkflowExecutionStartedEventAttributes
-> f WorkflowExecutionStartedEventAttributes
workflowExecutionStartedEventAttributes_continuedExecutionRunId = (WorkflowExecutionStartedEventAttributes -> Maybe Text)
-> (WorkflowExecutionStartedEventAttributes
    -> Maybe Text -> WorkflowExecutionStartedEventAttributes)
-> Lens
     WorkflowExecutionStartedEventAttributes
     WorkflowExecutionStartedEventAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionStartedEventAttributes' {Maybe Text
continuedExecutionRunId :: Maybe Text
$sel:continuedExecutionRunId:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Text
continuedExecutionRunId} -> Maybe Text
continuedExecutionRunId) (\s :: WorkflowExecutionStartedEventAttributes
s@WorkflowExecutionStartedEventAttributes' {} Maybe Text
a -> WorkflowExecutionStartedEventAttributes
s {$sel:continuedExecutionRunId:WorkflowExecutionStartedEventAttributes' :: Maybe Text
continuedExecutionRunId = Maybe Text
a} :: WorkflowExecutionStartedEventAttributes)

-- | The policy to use for the child workflow executions if this workflow
-- execution is terminated, by calling the TerminateWorkflowExecution
-- action explicitly or due to an expired timeout.
--
-- The supported child policies are:
--
-- -   @TERMINATE@ – The child executions are terminated.
--
-- -   @REQUEST_CANCEL@ – A request to cancel is attempted for each child
--     execution by recording a @WorkflowExecutionCancelRequested@ event in
--     its history. It is up to the decider to take appropriate actions
--     when it receives an execution history with this event.
--
-- -   @ABANDON@ – No action is taken. The child executions continue to
--     run.
workflowExecutionStartedEventAttributes_childPolicy :: Lens.Lens' WorkflowExecutionStartedEventAttributes ChildPolicy
workflowExecutionStartedEventAttributes_childPolicy :: (ChildPolicy -> f ChildPolicy)
-> WorkflowExecutionStartedEventAttributes
-> f WorkflowExecutionStartedEventAttributes
workflowExecutionStartedEventAttributes_childPolicy = (WorkflowExecutionStartedEventAttributes -> ChildPolicy)
-> (WorkflowExecutionStartedEventAttributes
    -> ChildPolicy -> WorkflowExecutionStartedEventAttributes)
-> Lens
     WorkflowExecutionStartedEventAttributes
     WorkflowExecutionStartedEventAttributes
     ChildPolicy
     ChildPolicy
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionStartedEventAttributes' {ChildPolicy
childPolicy :: ChildPolicy
$sel:childPolicy:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> ChildPolicy
childPolicy} -> ChildPolicy
childPolicy) (\s :: WorkflowExecutionStartedEventAttributes
s@WorkflowExecutionStartedEventAttributes' {} ChildPolicy
a -> WorkflowExecutionStartedEventAttributes
s {$sel:childPolicy:WorkflowExecutionStartedEventAttributes' :: ChildPolicy
childPolicy = ChildPolicy
a} :: WorkflowExecutionStartedEventAttributes)

-- | The name of the task list for scheduling the decision tasks for this
-- workflow execution.
workflowExecutionStartedEventAttributes_taskList :: Lens.Lens' WorkflowExecutionStartedEventAttributes TaskList
workflowExecutionStartedEventAttributes_taskList :: (TaskList -> f TaskList)
-> WorkflowExecutionStartedEventAttributes
-> f WorkflowExecutionStartedEventAttributes
workflowExecutionStartedEventAttributes_taskList = (WorkflowExecutionStartedEventAttributes -> TaskList)
-> (WorkflowExecutionStartedEventAttributes
    -> TaskList -> WorkflowExecutionStartedEventAttributes)
-> Lens
     WorkflowExecutionStartedEventAttributes
     WorkflowExecutionStartedEventAttributes
     TaskList
     TaskList
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionStartedEventAttributes' {TaskList
taskList :: TaskList
$sel:taskList:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> TaskList
taskList} -> TaskList
taskList) (\s :: WorkflowExecutionStartedEventAttributes
s@WorkflowExecutionStartedEventAttributes' {} TaskList
a -> WorkflowExecutionStartedEventAttributes
s {$sel:taskList:WorkflowExecutionStartedEventAttributes' :: TaskList
taskList = TaskList
a} :: WorkflowExecutionStartedEventAttributes)

-- | The workflow type of this execution.
workflowExecutionStartedEventAttributes_workflowType :: Lens.Lens' WorkflowExecutionStartedEventAttributes WorkflowType
workflowExecutionStartedEventAttributes_workflowType :: (WorkflowType -> f WorkflowType)
-> WorkflowExecutionStartedEventAttributes
-> f WorkflowExecutionStartedEventAttributes
workflowExecutionStartedEventAttributes_workflowType = (WorkflowExecutionStartedEventAttributes -> WorkflowType)
-> (WorkflowExecutionStartedEventAttributes
    -> WorkflowType -> WorkflowExecutionStartedEventAttributes)
-> Lens
     WorkflowExecutionStartedEventAttributes
     WorkflowExecutionStartedEventAttributes
     WorkflowType
     WorkflowType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionStartedEventAttributes' {WorkflowType
workflowType :: WorkflowType
$sel:workflowType:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> WorkflowType
workflowType} -> WorkflowType
workflowType) (\s :: WorkflowExecutionStartedEventAttributes
s@WorkflowExecutionStartedEventAttributes' {} WorkflowType
a -> WorkflowExecutionStartedEventAttributes
s {$sel:workflowType:WorkflowExecutionStartedEventAttributes' :: WorkflowType
workflowType = WorkflowType
a} :: WorkflowExecutionStartedEventAttributes)

instance
  Core.FromJSON
    WorkflowExecutionStartedEventAttributes
  where
  parseJSON :: Value -> Parser WorkflowExecutionStartedEventAttributes
parseJSON =
    String
-> (Object -> Parser WorkflowExecutionStartedEventAttributes)
-> Value
-> Parser WorkflowExecutionStartedEventAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"WorkflowExecutionStartedEventAttributes"
      ( \Object
x ->
          Maybe Integer
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe WorkflowExecution
-> Maybe Text
-> ChildPolicy
-> TaskList
-> WorkflowType
-> WorkflowExecutionStartedEventAttributes
WorkflowExecutionStartedEventAttributes'
            (Maybe Integer
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe WorkflowExecution
 -> Maybe Text
 -> ChildPolicy
 -> TaskList
 -> WorkflowType
 -> WorkflowExecutionStartedEventAttributes)
-> Parser (Maybe Integer)
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe WorkflowExecution
      -> Maybe Text
      -> ChildPolicy
      -> TaskList
      -> WorkflowType
      -> WorkflowExecutionStartedEventAttributes)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"parentInitiatedEventId")
            Parser
  (Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe WorkflowExecution
   -> Maybe Text
   -> ChildPolicy
   -> TaskList
   -> WorkflowType
   -> WorkflowExecutionStartedEventAttributes)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe WorkflowExecution
      -> Maybe Text
      -> ChildPolicy
      -> TaskList
      -> WorkflowType
      -> WorkflowExecutionStartedEventAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tagList" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe WorkflowExecution
   -> Maybe Text
   -> ChildPolicy
   -> TaskList
   -> WorkflowType
   -> WorkflowExecutionStartedEventAttributes)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe WorkflowExecution
      -> Maybe Text
      -> ChildPolicy
      -> TaskList
      -> WorkflowType
      -> WorkflowExecutionStartedEventAttributes)
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
"taskStartToCloseTimeout")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe WorkflowExecution
   -> Maybe Text
   -> ChildPolicy
   -> TaskList
   -> WorkflowType
   -> WorkflowExecutionStartedEventAttributes)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe WorkflowExecution
      -> Maybe Text
      -> ChildPolicy
      -> TaskList
      -> WorkflowType
      -> WorkflowExecutionStartedEventAttributes)
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
"lambdaRole")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe WorkflowExecution
   -> Maybe Text
   -> ChildPolicy
   -> TaskList
   -> WorkflowType
   -> WorkflowExecutionStartedEventAttributes)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe WorkflowExecution
      -> Maybe Text
      -> ChildPolicy
      -> TaskList
      -> WorkflowType
      -> WorkflowExecutionStartedEventAttributes)
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
"input")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe WorkflowExecution
   -> Maybe Text
   -> ChildPolicy
   -> TaskList
   -> WorkflowType
   -> WorkflowExecutionStartedEventAttributes)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe WorkflowExecution
      -> Maybe Text
      -> ChildPolicy
      -> TaskList
      -> WorkflowType
      -> WorkflowExecutionStartedEventAttributes)
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
"executionStartToCloseTimeout")
            Parser
  (Maybe Text
   -> Maybe WorkflowExecution
   -> Maybe Text
   -> ChildPolicy
   -> TaskList
   -> WorkflowType
   -> WorkflowExecutionStartedEventAttributes)
-> Parser (Maybe Text)
-> Parser
     (Maybe WorkflowExecution
      -> Maybe Text
      -> ChildPolicy
      -> TaskList
      -> WorkflowType
      -> WorkflowExecutionStartedEventAttributes)
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
"taskPriority")
            Parser
  (Maybe WorkflowExecution
   -> Maybe Text
   -> ChildPolicy
   -> TaskList
   -> WorkflowType
   -> WorkflowExecutionStartedEventAttributes)
-> Parser (Maybe WorkflowExecution)
-> Parser
     (Maybe Text
      -> ChildPolicy
      -> TaskList
      -> WorkflowType
      -> WorkflowExecutionStartedEventAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe WorkflowExecution)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"parentWorkflowExecution")
            Parser
  (Maybe Text
   -> ChildPolicy
   -> TaskList
   -> WorkflowType
   -> WorkflowExecutionStartedEventAttributes)
-> Parser (Maybe Text)
-> Parser
     (ChildPolicy
      -> TaskList
      -> WorkflowType
      -> WorkflowExecutionStartedEventAttributes)
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
"continuedExecutionRunId")
            Parser
  (ChildPolicy
   -> TaskList
   -> WorkflowType
   -> WorkflowExecutionStartedEventAttributes)
-> Parser ChildPolicy
-> Parser
     (TaskList
      -> WorkflowType -> WorkflowExecutionStartedEventAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ChildPolicy
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"childPolicy")
            Parser
  (TaskList
   -> WorkflowType -> WorkflowExecutionStartedEventAttributes)
-> Parser TaskList
-> Parser (WorkflowType -> WorkflowExecutionStartedEventAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser TaskList
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"taskList")
            Parser (WorkflowType -> WorkflowExecutionStartedEventAttributes)
-> Parser WorkflowType
-> Parser WorkflowExecutionStartedEventAttributes
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser WorkflowType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"workflowType")
      )

instance
  Prelude.Hashable
    WorkflowExecutionStartedEventAttributes

instance
  Prelude.NFData
    WorkflowExecutionStartedEventAttributes