{-# 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.ContinueAsNewWorkflowExecutionDecisionAttributes
-- 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.ContinueAsNewWorkflowExecutionDecisionAttributes 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

-- | Provides the details of the @ContinueAsNewWorkflowExecution@ decision.
--
-- __Access Control__
--
-- You can use IAM policies to control this decision\'s access to Amazon
-- SWF resources as follows:
--
-- -   Use a @Resource@ element with the domain name to limit the action to
--     only specified domains.
--
-- -   Use an @Action@ element to allow or deny permission to call this
--     action.
--
-- -   Constrain the following parameters by using a @Condition@ element
--     with the appropriate keys.
--
--     -   @tag@ – A tag used to identify the workflow execution
--
--     -   @taskList@ – String constraint. The key is @swf:taskList.name@.
--
--     -   @workflowType.version@ – String constraint. The key is
--         @swf:workflowType.version@.
--
-- If the caller doesn\'t have sufficient permissions to invoke the action,
-- or the parameter values fall outside the specified constraints, the
-- action fails. The associated event attribute\'s @cause@ parameter is set
-- to @OPERATION_NOT_PERMITTED@. For details and example IAM policies, see
-- <https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html Using IAM to Manage Access to Amazon SWF Workflows>
-- in the /Amazon SWF Developer Guide/.
--
-- /See:/ 'newContinueAsNewWorkflowExecutionDecisionAttributes' smart constructor.
data ContinueAsNewWorkflowExecutionDecisionAttributes = ContinueAsNewWorkflowExecutionDecisionAttributes'
  { -- | The list of tags to associate with the new workflow execution. A maximum
    -- of 5 tags can be specified. You can list workflow executions with a
    -- specific tag by calling ListOpenWorkflowExecutions or
    -- ListClosedWorkflowExecutions and specifying a TagFilter.
    ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe [Text]
tagList :: Prelude.Maybe [Prelude.Text],
    -- | Specifies the maximum duration of decision tasks for the new workflow
    -- execution. This parameter overrides the @defaultTaskStartToCloseTimout@
    -- specified when registering the workflow type using RegisterWorkflowType.
    --
    -- The duration is specified in seconds, an integer greater than or equal
    -- to @0@. You can use @NONE@ to specify unlimited duration.
    --
    -- A task start-to-close timeout for the new workflow execution must be
    -- specified either as a default for the workflow type or through this
    -- parameter. If neither this parameter is set nor a default task
    -- start-to-close timeout was specified at registration time then a fault
    -- is returned.
    ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text
taskStartToCloseTimeout :: Prelude.Maybe Prelude.Text,
    -- | The IAM role to attach to the new (continued) execution.
    ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text
lambdaRole :: Prelude.Maybe Prelude.Text,
    -- | The input provided to the new workflow execution.
    ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text
input :: Prelude.Maybe Prelude.Text,
    -- | The version of the workflow to start.
    ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text
workflowTypeVersion :: Prelude.Maybe Prelude.Text,
    -- | If set, specifies the total duration for this workflow execution. This
    -- overrides the @defaultExecutionStartToCloseTimeout@ specified when
    -- registering the workflow type.
    --
    -- The duration is specified in seconds, an integer greater than or equal
    -- to @0@. You can use @NONE@ to specify unlimited duration.
    --
    -- An execution start-to-close timeout for this workflow execution must be
    -- specified either as a default for the workflow type or through this
    -- field. If neither this field is set nor a default execution
    -- start-to-close timeout was specified at registration time then a fault
    -- is returned.
    ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text
executionStartToCloseTimeout :: Prelude.Maybe Prelude.Text,
    -- | The task list to use for the decisions of the new (continued) workflow
    -- execution.
    ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe TaskList
taskList :: Prelude.Maybe TaskList,
    -- | The task priority that, if set, specifies the priority for the decision
    -- tasks for this workflow execution. This overrides the
    -- defaultTaskPriority specified when registering the workflow type. Valid
    -- values are integers that range from Java\'s @Integer.MIN_VALUE@
    -- (-2147483648) to @Integer.MAX_VALUE@ (2147483647). Higher numbers
    -- indicate higher priority.
    --
    -- For more information about setting task priority, see
    -- <https://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html Setting Task Priority>
    -- in the /Amazon SWF Developer Guide/.
    ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text
taskPriority :: Prelude.Maybe Prelude.Text,
    -- | If set, specifies the policy to use for the child workflow executions of
    -- the new execution if it is terminated by calling the
    -- TerminateWorkflowExecution action explicitly or due to an expired
    -- timeout. This policy overrides the default child policy specified when
    -- registering the workflow type using RegisterWorkflowType.
    --
    -- 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.
    --
    -- A child policy for this workflow execution must be specified either as a
    -- default for the workflow type or through this parameter. If neither this
    -- parameter is set nor a default child policy was specified at
    -- registration time then a fault is returned.
    ContinueAsNewWorkflowExecutionDecisionAttributes
-> Maybe ChildPolicy
childPolicy :: Prelude.Maybe ChildPolicy
  }
  deriving (ContinueAsNewWorkflowExecutionDecisionAttributes
-> ContinueAsNewWorkflowExecutionDecisionAttributes -> Bool
(ContinueAsNewWorkflowExecutionDecisionAttributes
 -> ContinueAsNewWorkflowExecutionDecisionAttributes -> Bool)
-> (ContinueAsNewWorkflowExecutionDecisionAttributes
    -> ContinueAsNewWorkflowExecutionDecisionAttributes -> Bool)
-> Eq ContinueAsNewWorkflowExecutionDecisionAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContinueAsNewWorkflowExecutionDecisionAttributes
-> ContinueAsNewWorkflowExecutionDecisionAttributes -> Bool
$c/= :: ContinueAsNewWorkflowExecutionDecisionAttributes
-> ContinueAsNewWorkflowExecutionDecisionAttributes -> Bool
== :: ContinueAsNewWorkflowExecutionDecisionAttributes
-> ContinueAsNewWorkflowExecutionDecisionAttributes -> Bool
$c== :: ContinueAsNewWorkflowExecutionDecisionAttributes
-> ContinueAsNewWorkflowExecutionDecisionAttributes -> Bool
Prelude.Eq, ReadPrec [ContinueAsNewWorkflowExecutionDecisionAttributes]
ReadPrec ContinueAsNewWorkflowExecutionDecisionAttributes
Int -> ReadS ContinueAsNewWorkflowExecutionDecisionAttributes
ReadS [ContinueAsNewWorkflowExecutionDecisionAttributes]
(Int -> ReadS ContinueAsNewWorkflowExecutionDecisionAttributes)
-> ReadS [ContinueAsNewWorkflowExecutionDecisionAttributes]
-> ReadPrec ContinueAsNewWorkflowExecutionDecisionAttributes
-> ReadPrec [ContinueAsNewWorkflowExecutionDecisionAttributes]
-> Read ContinueAsNewWorkflowExecutionDecisionAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContinueAsNewWorkflowExecutionDecisionAttributes]
$creadListPrec :: ReadPrec [ContinueAsNewWorkflowExecutionDecisionAttributes]
readPrec :: ReadPrec ContinueAsNewWorkflowExecutionDecisionAttributes
$creadPrec :: ReadPrec ContinueAsNewWorkflowExecutionDecisionAttributes
readList :: ReadS [ContinueAsNewWorkflowExecutionDecisionAttributes]
$creadList :: ReadS [ContinueAsNewWorkflowExecutionDecisionAttributes]
readsPrec :: Int -> ReadS ContinueAsNewWorkflowExecutionDecisionAttributes
$creadsPrec :: Int -> ReadS ContinueAsNewWorkflowExecutionDecisionAttributes
Prelude.Read, Int -> ContinueAsNewWorkflowExecutionDecisionAttributes -> ShowS
[ContinueAsNewWorkflowExecutionDecisionAttributes] -> ShowS
ContinueAsNewWorkflowExecutionDecisionAttributes -> String
(Int -> ContinueAsNewWorkflowExecutionDecisionAttributes -> ShowS)
-> (ContinueAsNewWorkflowExecutionDecisionAttributes -> String)
-> ([ContinueAsNewWorkflowExecutionDecisionAttributes] -> ShowS)
-> Show ContinueAsNewWorkflowExecutionDecisionAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContinueAsNewWorkflowExecutionDecisionAttributes] -> ShowS
$cshowList :: [ContinueAsNewWorkflowExecutionDecisionAttributes] -> ShowS
show :: ContinueAsNewWorkflowExecutionDecisionAttributes -> String
$cshow :: ContinueAsNewWorkflowExecutionDecisionAttributes -> String
showsPrec :: Int -> ContinueAsNewWorkflowExecutionDecisionAttributes -> ShowS
$cshowsPrec :: Int -> ContinueAsNewWorkflowExecutionDecisionAttributes -> ShowS
Prelude.Show, (forall x.
 ContinueAsNewWorkflowExecutionDecisionAttributes
 -> Rep ContinueAsNewWorkflowExecutionDecisionAttributes x)
-> (forall x.
    Rep ContinueAsNewWorkflowExecutionDecisionAttributes x
    -> ContinueAsNewWorkflowExecutionDecisionAttributes)
-> Generic ContinueAsNewWorkflowExecutionDecisionAttributes
forall x.
Rep ContinueAsNewWorkflowExecutionDecisionAttributes x
-> ContinueAsNewWorkflowExecutionDecisionAttributes
forall x.
ContinueAsNewWorkflowExecutionDecisionAttributes
-> Rep ContinueAsNewWorkflowExecutionDecisionAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ContinueAsNewWorkflowExecutionDecisionAttributes x
-> ContinueAsNewWorkflowExecutionDecisionAttributes
$cfrom :: forall x.
ContinueAsNewWorkflowExecutionDecisionAttributes
-> Rep ContinueAsNewWorkflowExecutionDecisionAttributes x
Prelude.Generic)

-- |
-- Create a value of 'ContinueAsNewWorkflowExecutionDecisionAttributes' 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:
--
-- 'tagList', 'continueAsNewWorkflowExecutionDecisionAttributes_tagList' - The list of tags to associate with the new workflow execution. A maximum
-- of 5 tags can be specified. You can list workflow executions with a
-- specific tag by calling ListOpenWorkflowExecutions or
-- ListClosedWorkflowExecutions and specifying a TagFilter.
--
-- 'taskStartToCloseTimeout', 'continueAsNewWorkflowExecutionDecisionAttributes_taskStartToCloseTimeout' - Specifies the maximum duration of decision tasks for the new workflow
-- execution. This parameter overrides the @defaultTaskStartToCloseTimout@
-- specified when registering the workflow type using RegisterWorkflowType.
--
-- The duration is specified in seconds, an integer greater than or equal
-- to @0@. You can use @NONE@ to specify unlimited duration.
--
-- A task start-to-close timeout for the new workflow execution must be
-- specified either as a default for the workflow type or through this
-- parameter. If neither this parameter is set nor a default task
-- start-to-close timeout was specified at registration time then a fault
-- is returned.
--
-- 'lambdaRole', 'continueAsNewWorkflowExecutionDecisionAttributes_lambdaRole' - The IAM role to attach to the new (continued) execution.
--
-- 'input', 'continueAsNewWorkflowExecutionDecisionAttributes_input' - The input provided to the new workflow execution.
--
-- 'workflowTypeVersion', 'continueAsNewWorkflowExecutionDecisionAttributes_workflowTypeVersion' - The version of the workflow to start.
--
-- 'executionStartToCloseTimeout', 'continueAsNewWorkflowExecutionDecisionAttributes_executionStartToCloseTimeout' - If set, specifies the total duration for this workflow execution. This
-- overrides the @defaultExecutionStartToCloseTimeout@ specified when
-- registering the workflow type.
--
-- The duration is specified in seconds, an integer greater than or equal
-- to @0@. You can use @NONE@ to specify unlimited duration.
--
-- An execution start-to-close timeout for this workflow execution must be
-- specified either as a default for the workflow type or through this
-- field. If neither this field is set nor a default execution
-- start-to-close timeout was specified at registration time then a fault
-- is returned.
--
-- 'taskList', 'continueAsNewWorkflowExecutionDecisionAttributes_taskList' - The task list to use for the decisions of the new (continued) workflow
-- execution.
--
-- 'taskPriority', 'continueAsNewWorkflowExecutionDecisionAttributes_taskPriority' - The task priority that, if set, specifies the priority for the decision
-- tasks for this workflow execution. This overrides the
-- defaultTaskPriority specified when registering the workflow type. Valid
-- values are integers that range from Java\'s @Integer.MIN_VALUE@
-- (-2147483648) to @Integer.MAX_VALUE@ (2147483647). Higher numbers
-- indicate higher priority.
--
-- For more information about setting task priority, see
-- <https://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html Setting Task Priority>
-- in the /Amazon SWF Developer Guide/.
--
-- 'childPolicy', 'continueAsNewWorkflowExecutionDecisionAttributes_childPolicy' - If set, specifies the policy to use for the child workflow executions of
-- the new execution if it is terminated by calling the
-- TerminateWorkflowExecution action explicitly or due to an expired
-- timeout. This policy overrides the default child policy specified when
-- registering the workflow type using RegisterWorkflowType.
--
-- 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.
--
-- A child policy for this workflow execution must be specified either as a
-- default for the workflow type or through this parameter. If neither this
-- parameter is set nor a default child policy was specified at
-- registration time then a fault is returned.
newContinueAsNewWorkflowExecutionDecisionAttributes ::
  ContinueAsNewWorkflowExecutionDecisionAttributes
newContinueAsNewWorkflowExecutionDecisionAttributes :: ContinueAsNewWorkflowExecutionDecisionAttributes
newContinueAsNewWorkflowExecutionDecisionAttributes =
  ContinueAsNewWorkflowExecutionDecisionAttributes' :: Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe TaskList
-> Maybe Text
-> Maybe ChildPolicy
-> ContinueAsNewWorkflowExecutionDecisionAttributes
ContinueAsNewWorkflowExecutionDecisionAttributes'
    { $sel:tagList:ContinueAsNewWorkflowExecutionDecisionAttributes' :: Maybe [Text]
tagList =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:taskStartToCloseTimeout:ContinueAsNewWorkflowExecutionDecisionAttributes' :: Maybe Text
taskStartToCloseTimeout =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lambdaRole:ContinueAsNewWorkflowExecutionDecisionAttributes' :: Maybe Text
lambdaRole =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:input:ContinueAsNewWorkflowExecutionDecisionAttributes' :: Maybe Text
input = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:workflowTypeVersion:ContinueAsNewWorkflowExecutionDecisionAttributes' :: Maybe Text
workflowTypeVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:executionStartToCloseTimeout:ContinueAsNewWorkflowExecutionDecisionAttributes' :: Maybe Text
executionStartToCloseTimeout =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:taskList:ContinueAsNewWorkflowExecutionDecisionAttributes' :: Maybe TaskList
taskList =
        Maybe TaskList
forall a. Maybe a
Prelude.Nothing,
      $sel:taskPriority:ContinueAsNewWorkflowExecutionDecisionAttributes' :: Maybe Text
taskPriority =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:childPolicy:ContinueAsNewWorkflowExecutionDecisionAttributes' :: Maybe ChildPolicy
childPolicy =
        Maybe ChildPolicy
forall a. Maybe a
Prelude.Nothing
    }

-- | The list of tags to associate with the new workflow execution. A maximum
-- of 5 tags can be specified. You can list workflow executions with a
-- specific tag by calling ListOpenWorkflowExecutions or
-- ListClosedWorkflowExecutions and specifying a TagFilter.
continueAsNewWorkflowExecutionDecisionAttributes_tagList :: Lens.Lens' ContinueAsNewWorkflowExecutionDecisionAttributes (Prelude.Maybe [Prelude.Text])
continueAsNewWorkflowExecutionDecisionAttributes_tagList :: (Maybe [Text] -> f (Maybe [Text]))
-> ContinueAsNewWorkflowExecutionDecisionAttributes
-> f ContinueAsNewWorkflowExecutionDecisionAttributes
continueAsNewWorkflowExecutionDecisionAttributes_tagList = (ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe [Text])
-> (ContinueAsNewWorkflowExecutionDecisionAttributes
    -> Maybe [Text]
    -> ContinueAsNewWorkflowExecutionDecisionAttributes)
-> Lens
     ContinueAsNewWorkflowExecutionDecisionAttributes
     ContinueAsNewWorkflowExecutionDecisionAttributes
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinueAsNewWorkflowExecutionDecisionAttributes' {Maybe [Text]
tagList :: Maybe [Text]
$sel:tagList:ContinueAsNewWorkflowExecutionDecisionAttributes' :: ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe [Text]
tagList} -> Maybe [Text]
tagList) (\s :: ContinueAsNewWorkflowExecutionDecisionAttributes
s@ContinueAsNewWorkflowExecutionDecisionAttributes' {} Maybe [Text]
a -> ContinueAsNewWorkflowExecutionDecisionAttributes
s {$sel:tagList:ContinueAsNewWorkflowExecutionDecisionAttributes' :: Maybe [Text]
tagList = Maybe [Text]
a} :: ContinueAsNewWorkflowExecutionDecisionAttributes) ((Maybe [Text] -> f (Maybe [Text]))
 -> ContinueAsNewWorkflowExecutionDecisionAttributes
 -> f ContinueAsNewWorkflowExecutionDecisionAttributes)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ContinueAsNewWorkflowExecutionDecisionAttributes
-> f ContinueAsNewWorkflowExecutionDecisionAttributes
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

-- | Specifies the maximum duration of decision tasks for the new workflow
-- execution. This parameter overrides the @defaultTaskStartToCloseTimout@
-- specified when registering the workflow type using RegisterWorkflowType.
--
-- The duration is specified in seconds, an integer greater than or equal
-- to @0@. You can use @NONE@ to specify unlimited duration.
--
-- A task start-to-close timeout for the new workflow execution must be
-- specified either as a default for the workflow type or through this
-- parameter. If neither this parameter is set nor a default task
-- start-to-close timeout was specified at registration time then a fault
-- is returned.
continueAsNewWorkflowExecutionDecisionAttributes_taskStartToCloseTimeout :: Lens.Lens' ContinueAsNewWorkflowExecutionDecisionAttributes (Prelude.Maybe Prelude.Text)
continueAsNewWorkflowExecutionDecisionAttributes_taskStartToCloseTimeout :: (Maybe Text -> f (Maybe Text))
-> ContinueAsNewWorkflowExecutionDecisionAttributes
-> f ContinueAsNewWorkflowExecutionDecisionAttributes
continueAsNewWorkflowExecutionDecisionAttributes_taskStartToCloseTimeout = (ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text)
-> (ContinueAsNewWorkflowExecutionDecisionAttributes
    -> Maybe Text -> ContinueAsNewWorkflowExecutionDecisionAttributes)
-> Lens
     ContinueAsNewWorkflowExecutionDecisionAttributes
     ContinueAsNewWorkflowExecutionDecisionAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinueAsNewWorkflowExecutionDecisionAttributes' {Maybe Text
taskStartToCloseTimeout :: Maybe Text
$sel:taskStartToCloseTimeout:ContinueAsNewWorkflowExecutionDecisionAttributes' :: ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text
taskStartToCloseTimeout} -> Maybe Text
taskStartToCloseTimeout) (\s :: ContinueAsNewWorkflowExecutionDecisionAttributes
s@ContinueAsNewWorkflowExecutionDecisionAttributes' {} Maybe Text
a -> ContinueAsNewWorkflowExecutionDecisionAttributes
s {$sel:taskStartToCloseTimeout:ContinueAsNewWorkflowExecutionDecisionAttributes' :: Maybe Text
taskStartToCloseTimeout = Maybe Text
a} :: ContinueAsNewWorkflowExecutionDecisionAttributes)

-- | The IAM role to attach to the new (continued) execution.
continueAsNewWorkflowExecutionDecisionAttributes_lambdaRole :: Lens.Lens' ContinueAsNewWorkflowExecutionDecisionAttributes (Prelude.Maybe Prelude.Text)
continueAsNewWorkflowExecutionDecisionAttributes_lambdaRole :: (Maybe Text -> f (Maybe Text))
-> ContinueAsNewWorkflowExecutionDecisionAttributes
-> f ContinueAsNewWorkflowExecutionDecisionAttributes
continueAsNewWorkflowExecutionDecisionAttributes_lambdaRole = (ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text)
-> (ContinueAsNewWorkflowExecutionDecisionAttributes
    -> Maybe Text -> ContinueAsNewWorkflowExecutionDecisionAttributes)
-> Lens
     ContinueAsNewWorkflowExecutionDecisionAttributes
     ContinueAsNewWorkflowExecutionDecisionAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinueAsNewWorkflowExecutionDecisionAttributes' {Maybe Text
lambdaRole :: Maybe Text
$sel:lambdaRole:ContinueAsNewWorkflowExecutionDecisionAttributes' :: ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text
lambdaRole} -> Maybe Text
lambdaRole) (\s :: ContinueAsNewWorkflowExecutionDecisionAttributes
s@ContinueAsNewWorkflowExecutionDecisionAttributes' {} Maybe Text
a -> ContinueAsNewWorkflowExecutionDecisionAttributes
s {$sel:lambdaRole:ContinueAsNewWorkflowExecutionDecisionAttributes' :: Maybe Text
lambdaRole = Maybe Text
a} :: ContinueAsNewWorkflowExecutionDecisionAttributes)

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

-- | The version of the workflow to start.
continueAsNewWorkflowExecutionDecisionAttributes_workflowTypeVersion :: Lens.Lens' ContinueAsNewWorkflowExecutionDecisionAttributes (Prelude.Maybe Prelude.Text)
continueAsNewWorkflowExecutionDecisionAttributes_workflowTypeVersion :: (Maybe Text -> f (Maybe Text))
-> ContinueAsNewWorkflowExecutionDecisionAttributes
-> f ContinueAsNewWorkflowExecutionDecisionAttributes
continueAsNewWorkflowExecutionDecisionAttributes_workflowTypeVersion = (ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text)
-> (ContinueAsNewWorkflowExecutionDecisionAttributes
    -> Maybe Text -> ContinueAsNewWorkflowExecutionDecisionAttributes)
-> Lens
     ContinueAsNewWorkflowExecutionDecisionAttributes
     ContinueAsNewWorkflowExecutionDecisionAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinueAsNewWorkflowExecutionDecisionAttributes' {Maybe Text
workflowTypeVersion :: Maybe Text
$sel:workflowTypeVersion:ContinueAsNewWorkflowExecutionDecisionAttributes' :: ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text
workflowTypeVersion} -> Maybe Text
workflowTypeVersion) (\s :: ContinueAsNewWorkflowExecutionDecisionAttributes
s@ContinueAsNewWorkflowExecutionDecisionAttributes' {} Maybe Text
a -> ContinueAsNewWorkflowExecutionDecisionAttributes
s {$sel:workflowTypeVersion:ContinueAsNewWorkflowExecutionDecisionAttributes' :: Maybe Text
workflowTypeVersion = Maybe Text
a} :: ContinueAsNewWorkflowExecutionDecisionAttributes)

-- | If set, specifies the total duration for this workflow execution. This
-- overrides the @defaultExecutionStartToCloseTimeout@ specified when
-- registering the workflow type.
--
-- The duration is specified in seconds, an integer greater than or equal
-- to @0@. You can use @NONE@ to specify unlimited duration.
--
-- An execution start-to-close timeout for this workflow execution must be
-- specified either as a default for the workflow type or through this
-- field. If neither this field is set nor a default execution
-- start-to-close timeout was specified at registration time then a fault
-- is returned.
continueAsNewWorkflowExecutionDecisionAttributes_executionStartToCloseTimeout :: Lens.Lens' ContinueAsNewWorkflowExecutionDecisionAttributes (Prelude.Maybe Prelude.Text)
continueAsNewWorkflowExecutionDecisionAttributes_executionStartToCloseTimeout :: (Maybe Text -> f (Maybe Text))
-> ContinueAsNewWorkflowExecutionDecisionAttributes
-> f ContinueAsNewWorkflowExecutionDecisionAttributes
continueAsNewWorkflowExecutionDecisionAttributes_executionStartToCloseTimeout = (ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text)
-> (ContinueAsNewWorkflowExecutionDecisionAttributes
    -> Maybe Text -> ContinueAsNewWorkflowExecutionDecisionAttributes)
-> Lens
     ContinueAsNewWorkflowExecutionDecisionAttributes
     ContinueAsNewWorkflowExecutionDecisionAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinueAsNewWorkflowExecutionDecisionAttributes' {Maybe Text
executionStartToCloseTimeout :: Maybe Text
$sel:executionStartToCloseTimeout:ContinueAsNewWorkflowExecutionDecisionAttributes' :: ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text
executionStartToCloseTimeout} -> Maybe Text
executionStartToCloseTimeout) (\s :: ContinueAsNewWorkflowExecutionDecisionAttributes
s@ContinueAsNewWorkflowExecutionDecisionAttributes' {} Maybe Text
a -> ContinueAsNewWorkflowExecutionDecisionAttributes
s {$sel:executionStartToCloseTimeout:ContinueAsNewWorkflowExecutionDecisionAttributes' :: Maybe Text
executionStartToCloseTimeout = Maybe Text
a} :: ContinueAsNewWorkflowExecutionDecisionAttributes)

-- | The task list to use for the decisions of the new (continued) workflow
-- execution.
continueAsNewWorkflowExecutionDecisionAttributes_taskList :: Lens.Lens' ContinueAsNewWorkflowExecutionDecisionAttributes (Prelude.Maybe TaskList)
continueAsNewWorkflowExecutionDecisionAttributes_taskList :: (Maybe TaskList -> f (Maybe TaskList))
-> ContinueAsNewWorkflowExecutionDecisionAttributes
-> f ContinueAsNewWorkflowExecutionDecisionAttributes
continueAsNewWorkflowExecutionDecisionAttributes_taskList = (ContinueAsNewWorkflowExecutionDecisionAttributes
 -> Maybe TaskList)
-> (ContinueAsNewWorkflowExecutionDecisionAttributes
    -> Maybe TaskList
    -> ContinueAsNewWorkflowExecutionDecisionAttributes)
-> Lens
     ContinueAsNewWorkflowExecutionDecisionAttributes
     ContinueAsNewWorkflowExecutionDecisionAttributes
     (Maybe TaskList)
     (Maybe TaskList)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinueAsNewWorkflowExecutionDecisionAttributes' {Maybe TaskList
taskList :: Maybe TaskList
$sel:taskList:ContinueAsNewWorkflowExecutionDecisionAttributes' :: ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe TaskList
taskList} -> Maybe TaskList
taskList) (\s :: ContinueAsNewWorkflowExecutionDecisionAttributes
s@ContinueAsNewWorkflowExecutionDecisionAttributes' {} Maybe TaskList
a -> ContinueAsNewWorkflowExecutionDecisionAttributes
s {$sel:taskList:ContinueAsNewWorkflowExecutionDecisionAttributes' :: Maybe TaskList
taskList = Maybe TaskList
a} :: ContinueAsNewWorkflowExecutionDecisionAttributes)

-- | The task priority that, if set, specifies the priority for the decision
-- tasks for this workflow execution. This overrides the
-- defaultTaskPriority specified when registering the workflow type. Valid
-- values are integers that range from Java\'s @Integer.MIN_VALUE@
-- (-2147483648) to @Integer.MAX_VALUE@ (2147483647). Higher numbers
-- indicate higher priority.
--
-- For more information about setting task priority, see
-- <https://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html Setting Task Priority>
-- in the /Amazon SWF Developer Guide/.
continueAsNewWorkflowExecutionDecisionAttributes_taskPriority :: Lens.Lens' ContinueAsNewWorkflowExecutionDecisionAttributes (Prelude.Maybe Prelude.Text)
continueAsNewWorkflowExecutionDecisionAttributes_taskPriority :: (Maybe Text -> f (Maybe Text))
-> ContinueAsNewWorkflowExecutionDecisionAttributes
-> f ContinueAsNewWorkflowExecutionDecisionAttributes
continueAsNewWorkflowExecutionDecisionAttributes_taskPriority = (ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text)
-> (ContinueAsNewWorkflowExecutionDecisionAttributes
    -> Maybe Text -> ContinueAsNewWorkflowExecutionDecisionAttributes)
-> Lens
     ContinueAsNewWorkflowExecutionDecisionAttributes
     ContinueAsNewWorkflowExecutionDecisionAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinueAsNewWorkflowExecutionDecisionAttributes' {Maybe Text
taskPriority :: Maybe Text
$sel:taskPriority:ContinueAsNewWorkflowExecutionDecisionAttributes' :: ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text
taskPriority} -> Maybe Text
taskPriority) (\s :: ContinueAsNewWorkflowExecutionDecisionAttributes
s@ContinueAsNewWorkflowExecutionDecisionAttributes' {} Maybe Text
a -> ContinueAsNewWorkflowExecutionDecisionAttributes
s {$sel:taskPriority:ContinueAsNewWorkflowExecutionDecisionAttributes' :: Maybe Text
taskPriority = Maybe Text
a} :: ContinueAsNewWorkflowExecutionDecisionAttributes)

-- | If set, specifies the policy to use for the child workflow executions of
-- the new execution if it is terminated by calling the
-- TerminateWorkflowExecution action explicitly or due to an expired
-- timeout. This policy overrides the default child policy specified when
-- registering the workflow type using RegisterWorkflowType.
--
-- 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.
--
-- A child policy for this workflow execution must be specified either as a
-- default for the workflow type or through this parameter. If neither this
-- parameter is set nor a default child policy was specified at
-- registration time then a fault is returned.
continueAsNewWorkflowExecutionDecisionAttributes_childPolicy :: Lens.Lens' ContinueAsNewWorkflowExecutionDecisionAttributes (Prelude.Maybe ChildPolicy)
continueAsNewWorkflowExecutionDecisionAttributes_childPolicy :: (Maybe ChildPolicy -> f (Maybe ChildPolicy))
-> ContinueAsNewWorkflowExecutionDecisionAttributes
-> f ContinueAsNewWorkflowExecutionDecisionAttributes
continueAsNewWorkflowExecutionDecisionAttributes_childPolicy = (ContinueAsNewWorkflowExecutionDecisionAttributes
 -> Maybe ChildPolicy)
-> (ContinueAsNewWorkflowExecutionDecisionAttributes
    -> Maybe ChildPolicy
    -> ContinueAsNewWorkflowExecutionDecisionAttributes)
-> Lens
     ContinueAsNewWorkflowExecutionDecisionAttributes
     ContinueAsNewWorkflowExecutionDecisionAttributes
     (Maybe ChildPolicy)
     (Maybe ChildPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinueAsNewWorkflowExecutionDecisionAttributes' {Maybe ChildPolicy
childPolicy :: Maybe ChildPolicy
$sel:childPolicy:ContinueAsNewWorkflowExecutionDecisionAttributes' :: ContinueAsNewWorkflowExecutionDecisionAttributes
-> Maybe ChildPolicy
childPolicy} -> Maybe ChildPolicy
childPolicy) (\s :: ContinueAsNewWorkflowExecutionDecisionAttributes
s@ContinueAsNewWorkflowExecutionDecisionAttributes' {} Maybe ChildPolicy
a -> ContinueAsNewWorkflowExecutionDecisionAttributes
s {$sel:childPolicy:ContinueAsNewWorkflowExecutionDecisionAttributes' :: Maybe ChildPolicy
childPolicy = Maybe ChildPolicy
a} :: ContinueAsNewWorkflowExecutionDecisionAttributes)

instance
  Prelude.Hashable
    ContinueAsNewWorkflowExecutionDecisionAttributes

instance
  Prelude.NFData
    ContinueAsNewWorkflowExecutionDecisionAttributes

instance
  Core.ToJSON
    ContinueAsNewWorkflowExecutionDecisionAttributes
  where
  toJSON :: ContinueAsNewWorkflowExecutionDecisionAttributes -> Value
toJSON
    ContinueAsNewWorkflowExecutionDecisionAttributes' {Maybe [Text]
Maybe Text
Maybe ChildPolicy
Maybe TaskList
childPolicy :: Maybe ChildPolicy
taskPriority :: Maybe Text
taskList :: Maybe TaskList
executionStartToCloseTimeout :: Maybe Text
workflowTypeVersion :: Maybe Text
input :: Maybe Text
lambdaRole :: Maybe Text
taskStartToCloseTimeout :: Maybe Text
tagList :: Maybe [Text]
$sel:childPolicy:ContinueAsNewWorkflowExecutionDecisionAttributes' :: ContinueAsNewWorkflowExecutionDecisionAttributes
-> Maybe ChildPolicy
$sel:taskPriority:ContinueAsNewWorkflowExecutionDecisionAttributes' :: ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text
$sel:taskList:ContinueAsNewWorkflowExecutionDecisionAttributes' :: ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe TaskList
$sel:executionStartToCloseTimeout:ContinueAsNewWorkflowExecutionDecisionAttributes' :: ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text
$sel:workflowTypeVersion:ContinueAsNewWorkflowExecutionDecisionAttributes' :: ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text
$sel:input:ContinueAsNewWorkflowExecutionDecisionAttributes' :: ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text
$sel:lambdaRole:ContinueAsNewWorkflowExecutionDecisionAttributes' :: ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text
$sel:taskStartToCloseTimeout:ContinueAsNewWorkflowExecutionDecisionAttributes' :: ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe Text
$sel:tagList:ContinueAsNewWorkflowExecutionDecisionAttributes' :: ContinueAsNewWorkflowExecutionDecisionAttributes -> Maybe [Text]
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"tagList" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
tagList,
              (Text
"taskStartToCloseTimeout" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
                (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
taskStartToCloseTimeout,
              (Text
"lambdaRole" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
lambdaRole,
              (Text
"input" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
input,
              (Text
"workflowTypeVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
                (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
workflowTypeVersion,
              (Text
"executionStartToCloseTimeout" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
                (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
executionStartToCloseTimeout,
              (Text
"taskList" Text -> TaskList -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TaskList -> Pair) -> Maybe TaskList -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TaskList
taskList,
              (Text
"taskPriority" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
taskPriority,
              (Text
"childPolicy" Text -> ChildPolicy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ChildPolicy -> Pair) -> Maybe ChildPolicy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ChildPolicy
childPolicy
            ]
        )