{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SWF.Types.WorkflowExecutionStartedEventAttributes where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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'
  { -- | 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 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 input provided to the workflow execution.
    WorkflowExecutionStartedEventAttributes -> Maybe Text
input :: Prelude.Maybe Prelude.Text,
    -- | The IAM role attached to the workflow execution.
    WorkflowExecutionStartedEventAttributes -> Maybe Text
lambdaRole :: Prelude.Maybe Prelude.Text,
    -- | 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 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,
    -- | 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 priority of the decision tasks in the workflow execution.
    WorkflowExecutionStartedEventAttributes -> Maybe Text
taskPriority :: 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 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
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]
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
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.
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:
--
-- '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.
--
-- '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.
--
-- 'input', 'workflowExecutionStartedEventAttributes_input' - The input provided to the workflow execution.
--
-- 'lambdaRole', 'workflowExecutionStartedEventAttributes_lambdaRole' - The IAM role attached to the workflow execution.
--
-- '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.
--
-- '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.
--
-- 'tagList', 'workflowExecutionStartedEventAttributes_tagList' - The list of tags associated with this workflow execution. An execution
-- can have up to 5 tags.
--
-- 'taskPriority', 'workflowExecutionStartedEventAttributes_taskPriority' - The priority of the decision tasks in the workflow execution.
--
-- '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.
--
-- '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'
      { $sel:continuedExecutionRunId:WorkflowExecutionStartedEventAttributes' :: Maybe Text
continuedExecutionRunId =
          forall a. Maybe a
Prelude.Nothing,
        $sel:executionStartToCloseTimeout:WorkflowExecutionStartedEventAttributes' :: Maybe Text
executionStartToCloseTimeout =
          forall a. Maybe a
Prelude.Nothing,
        $sel:input:WorkflowExecutionStartedEventAttributes' :: Maybe Text
input = forall a. Maybe a
Prelude.Nothing,
        $sel:lambdaRole:WorkflowExecutionStartedEventAttributes' :: Maybe Text
lambdaRole = forall a. Maybe a
Prelude.Nothing,
        $sel:parentInitiatedEventId:WorkflowExecutionStartedEventAttributes' :: Maybe Integer
parentInitiatedEventId =
          forall a. Maybe a
Prelude.Nothing,
        $sel:parentWorkflowExecution:WorkflowExecutionStartedEventAttributes' :: Maybe WorkflowExecution
parentWorkflowExecution =
          forall a. Maybe a
Prelude.Nothing,
        $sel:tagList:WorkflowExecutionStartedEventAttributes' :: Maybe [Text]
tagList = forall a. Maybe a
Prelude.Nothing,
        $sel:taskPriority:WorkflowExecutionStartedEventAttributes' :: Maybe Text
taskPriority = forall a. Maybe a
Prelude.Nothing,
        $sel:taskStartToCloseTimeout:WorkflowExecutionStartedEventAttributes' :: Maybe Text
taskStartToCloseTimeout =
          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_
      }

-- | 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 :: Lens' WorkflowExecutionStartedEventAttributes (Maybe Text)
workflowExecutionStartedEventAttributes_continuedExecutionRunId = 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 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 :: Lens' WorkflowExecutionStartedEventAttributes (Maybe Text)
workflowExecutionStartedEventAttributes_executionStartToCloseTimeout = 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 input provided to the workflow execution.
workflowExecutionStartedEventAttributes_input :: Lens.Lens' WorkflowExecutionStartedEventAttributes (Prelude.Maybe Prelude.Text)
workflowExecutionStartedEventAttributes_input :: Lens' WorkflowExecutionStartedEventAttributes (Maybe Text)
workflowExecutionStartedEventAttributes_input = 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 IAM role attached to the workflow execution.
workflowExecutionStartedEventAttributes_lambdaRole :: Lens.Lens' WorkflowExecutionStartedEventAttributes (Prelude.Maybe Prelude.Text)
workflowExecutionStartedEventAttributes_lambdaRole :: Lens' WorkflowExecutionStartedEventAttributes (Maybe Text)
workflowExecutionStartedEventAttributes_lambdaRole = 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 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 :: Lens' WorkflowExecutionStartedEventAttributes (Maybe Integer)
workflowExecutionStartedEventAttributes_parentInitiatedEventId = 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 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 :: Lens'
  WorkflowExecutionStartedEventAttributes (Maybe WorkflowExecution)
workflowExecutionStartedEventAttributes_parentWorkflowExecution = 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)

-- | 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 :: Lens' WorkflowExecutionStartedEventAttributes (Maybe [Text])
workflowExecutionStartedEventAttributes_tagList = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The priority of the decision tasks in the workflow execution.
workflowExecutionStartedEventAttributes_taskPriority :: Lens.Lens' WorkflowExecutionStartedEventAttributes (Prelude.Maybe Prelude.Text)
workflowExecutionStartedEventAttributes_taskPriority :: Lens' WorkflowExecutionStartedEventAttributes (Maybe Text)
workflowExecutionStartedEventAttributes_taskPriority = 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 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 :: Lens' WorkflowExecutionStartedEventAttributes (Maybe Text)
workflowExecutionStartedEventAttributes_taskStartToCloseTimeout = 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 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 :: Lens' WorkflowExecutionStartedEventAttributes ChildPolicy
workflowExecutionStartedEventAttributes_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 :: Lens' WorkflowExecutionStartedEventAttributes TaskList
workflowExecutionStartedEventAttributes_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 :: Lens' WorkflowExecutionStartedEventAttributes WorkflowType
workflowExecutionStartedEventAttributes_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
  Data.FromJSON
    WorkflowExecutionStartedEventAttributes
  where
  parseJSON :: Value -> Parser WorkflowExecutionStartedEventAttributes
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"WorkflowExecutionStartedEventAttributes"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe WorkflowExecution
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> ChildPolicy
-> TaskList
-> WorkflowType
-> WorkflowExecutionStartedEventAttributes
WorkflowExecutionStartedEventAttributes'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"continuedExecutionRunId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"executionStartToCloseTimeout")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"input")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lambdaRole")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"parentInitiatedEventId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"parentWorkflowExecution")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"tagList" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"taskPriority")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"taskStartToCloseTimeout")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"childPolicy")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"taskList")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"workflowType")
      )

instance
  Prelude.Hashable
    WorkflowExecutionStartedEventAttributes
  where
  hashWithSalt :: Int -> WorkflowExecutionStartedEventAttributes -> Int
hashWithSalt
    Int
_salt
    WorkflowExecutionStartedEventAttributes' {Maybe Integer
Maybe [Text]
Maybe Text
Maybe WorkflowExecution
ChildPolicy
TaskList
WorkflowType
workflowType :: WorkflowType
taskList :: TaskList
childPolicy :: ChildPolicy
taskStartToCloseTimeout :: Maybe Text
taskPriority :: Maybe Text
tagList :: Maybe [Text]
parentWorkflowExecution :: Maybe WorkflowExecution
parentInitiatedEventId :: Maybe Integer
lambdaRole :: Maybe Text
input :: Maybe Text
executionStartToCloseTimeout :: Maybe Text
continuedExecutionRunId :: Maybe Text
$sel:workflowType:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> WorkflowType
$sel:taskList:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> TaskList
$sel:childPolicy:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> ChildPolicy
$sel:taskStartToCloseTimeout:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Text
$sel:taskPriority:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Text
$sel:tagList:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe [Text]
$sel:parentWorkflowExecution:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe WorkflowExecution
$sel:parentInitiatedEventId:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Integer
$sel:lambdaRole:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Text
$sel:input:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Text
$sel:executionStartToCloseTimeout:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Text
$sel:continuedExecutionRunId:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
continuedExecutionRunId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
executionStartToCloseTimeout
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
input
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lambdaRole
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
parentInitiatedEventId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WorkflowExecution
parentWorkflowExecution
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
tagList
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
taskPriority
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
taskStartToCloseTimeout
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ChildPolicy
childPolicy
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` TaskList
taskList
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` WorkflowType
workflowType

instance
  Prelude.NFData
    WorkflowExecutionStartedEventAttributes
  where
  rnf :: WorkflowExecutionStartedEventAttributes -> ()
rnf WorkflowExecutionStartedEventAttributes' {Maybe Integer
Maybe [Text]
Maybe Text
Maybe WorkflowExecution
ChildPolicy
TaskList
WorkflowType
workflowType :: WorkflowType
taskList :: TaskList
childPolicy :: ChildPolicy
taskStartToCloseTimeout :: Maybe Text
taskPriority :: Maybe Text
tagList :: Maybe [Text]
parentWorkflowExecution :: Maybe WorkflowExecution
parentInitiatedEventId :: Maybe Integer
lambdaRole :: Maybe Text
input :: Maybe Text
executionStartToCloseTimeout :: Maybe Text
continuedExecutionRunId :: Maybe Text
$sel:workflowType:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> WorkflowType
$sel:taskList:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> TaskList
$sel:childPolicy:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> ChildPolicy
$sel:taskStartToCloseTimeout:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Text
$sel:taskPriority:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Text
$sel:tagList:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe [Text]
$sel:parentWorkflowExecution:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe WorkflowExecution
$sel:parentInitiatedEventId:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Integer
$sel:lambdaRole:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Text
$sel:input:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Text
$sel:executionStartToCloseTimeout:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Text
$sel:continuedExecutionRunId:WorkflowExecutionStartedEventAttributes' :: WorkflowExecutionStartedEventAttributes -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
continuedExecutionRunId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
executionStartToCloseTimeout
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
input
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lambdaRole
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
parentInitiatedEventId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WorkflowExecution
parentWorkflowExecution
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
tagList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
taskPriority
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
taskStartToCloseTimeout
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ChildPolicy
childPolicy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf TaskList
taskList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf WorkflowType
workflowType