{-# 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.SSM.Types.StepExecution
-- 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.SSM.Types.StepExecution where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.AutomationExecutionStatus
import Amazonka.SSM.Types.FailureDetails
import Amazonka.SSM.Types.Target
import Amazonka.SSM.Types.TargetLocation

-- | Detailed information about an the execution state of an Automation step.
--
-- /See:/ 'newStepExecution' smart constructor.
data StepExecution = StepExecution'
  { -- | Information about the Automation failure.
    StepExecution -> Maybe FailureDetails
failureDetails :: Prelude.Maybe FailureDetails,
    -- | The flag which can be used to end automation no matter whether the step
    -- succeeds or fails.
    StepExecution -> Maybe Bool
isEnd :: Prelude.Maybe Prelude.Bool,
    -- | Fully-resolved values passed into the step before execution.
    StepExecution -> Maybe (HashMap Text Text)
inputs :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of this execution step.
    StepExecution -> Maybe Text
stepName :: Prelude.Maybe Prelude.Text,
    -- | If a step has finished execution, this contains the time the execution
    -- ended. If the step hasn\'t yet concluded, this field isn\'t populated.
    StepExecution -> Maybe POSIX
executionEndTime :: Prelude.Maybe Core.POSIX,
    -- | If a step failed, this message explains why the execution failed.
    StepExecution -> Maybe Text
failureMessage :: Prelude.Maybe Prelude.Text,
    -- | A message associated with the response code for an execution.
    StepExecution -> Maybe Text
response :: Prelude.Maybe Prelude.Text,
    -- | The action this step performs. The action determines the behavior of the
    -- step.
    StepExecution -> Maybe Text
action :: Prelude.Maybe Prelude.Text,
    -- | The response code returned by the execution of the step.
    StepExecution -> Maybe Text
responseCode :: Prelude.Maybe Prelude.Text,
    -- | The execution status for this step.
    StepExecution -> Maybe AutomationExecutionStatus
stepStatus :: Prelude.Maybe AutomationExecutionStatus,
    -- | The combination of Amazon Web Services Regions and Amazon Web Services
    -- accounts targeted by the current Automation execution.
    StepExecution -> Maybe TargetLocation
targetLocation :: Prelude.Maybe TargetLocation,
    -- | A user-specified list of parameters to override when running a step.
    StepExecution -> Maybe (HashMap Text [Text])
overriddenParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
    -- | Returned values from the execution of the step.
    StepExecution -> Maybe (HashMap Text [Text])
outputs :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
    -- | If a step has begun execution, this contains the time the step started.
    -- If the step is in Pending status, this field isn\'t populated.
    StepExecution -> Maybe POSIX
executionStartTime :: Prelude.Maybe Core.POSIX,
    -- | The maximum number of tries to run the action of the step. The default
    -- value is @1@.
    StepExecution -> Maybe Int
maxAttempts :: Prelude.Maybe Prelude.Int,
    -- | The targets for the step execution.
    StepExecution -> Maybe [Target]
targets :: Prelude.Maybe [Target],
    -- | The next step after the step succeeds.
    StepExecution -> Maybe Text
nextStep :: Prelude.Maybe Prelude.Text,
    -- | The unique ID of a step execution.
    StepExecution -> Maybe Text
stepExecutionId :: Prelude.Maybe Prelude.Text,
    -- | Strategies used when step fails, we support Continue and Abort. Abort
    -- will fail the automation when the step fails. Continue will ignore the
    -- failure of current step and allow automation to run the next step. With
    -- conditional branching, we add step:stepName to support the automation to
    -- go to another specific step.
    StepExecution -> Maybe [Text]
validNextSteps :: Prelude.Maybe [Prelude.Text],
    -- | The timeout seconds of the step.
    StepExecution -> Maybe Integer
timeoutSeconds :: Prelude.Maybe Prelude.Integer,
    -- | The action to take if the step fails. The default value is @Abort@.
    StepExecution -> Maybe Text
onFailure :: Prelude.Maybe Prelude.Text,
    -- | The flag which can be used to help decide whether the failure of current
    -- step leads to the Automation failure.
    StepExecution -> Maybe Bool
isCritical :: Prelude.Maybe Prelude.Bool
  }
  deriving (StepExecution -> StepExecution -> Bool
(StepExecution -> StepExecution -> Bool)
-> (StepExecution -> StepExecution -> Bool) -> Eq StepExecution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StepExecution -> StepExecution -> Bool
$c/= :: StepExecution -> StepExecution -> Bool
== :: StepExecution -> StepExecution -> Bool
$c== :: StepExecution -> StepExecution -> Bool
Prelude.Eq, ReadPrec [StepExecution]
ReadPrec StepExecution
Int -> ReadS StepExecution
ReadS [StepExecution]
(Int -> ReadS StepExecution)
-> ReadS [StepExecution]
-> ReadPrec StepExecution
-> ReadPrec [StepExecution]
-> Read StepExecution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StepExecution]
$creadListPrec :: ReadPrec [StepExecution]
readPrec :: ReadPrec StepExecution
$creadPrec :: ReadPrec StepExecution
readList :: ReadS [StepExecution]
$creadList :: ReadS [StepExecution]
readsPrec :: Int -> ReadS StepExecution
$creadsPrec :: Int -> ReadS StepExecution
Prelude.Read, Int -> StepExecution -> ShowS
[StepExecution] -> ShowS
StepExecution -> String
(Int -> StepExecution -> ShowS)
-> (StepExecution -> String)
-> ([StepExecution] -> ShowS)
-> Show StepExecution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StepExecution] -> ShowS
$cshowList :: [StepExecution] -> ShowS
show :: StepExecution -> String
$cshow :: StepExecution -> String
showsPrec :: Int -> StepExecution -> ShowS
$cshowsPrec :: Int -> StepExecution -> ShowS
Prelude.Show, (forall x. StepExecution -> Rep StepExecution x)
-> (forall x. Rep StepExecution x -> StepExecution)
-> Generic StepExecution
forall x. Rep StepExecution x -> StepExecution
forall x. StepExecution -> Rep StepExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StepExecution x -> StepExecution
$cfrom :: forall x. StepExecution -> Rep StepExecution x
Prelude.Generic)

-- |
-- Create a value of 'StepExecution' 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:
--
-- 'failureDetails', 'stepExecution_failureDetails' - Information about the Automation failure.
--
-- 'isEnd', 'stepExecution_isEnd' - The flag which can be used to end automation no matter whether the step
-- succeeds or fails.
--
-- 'inputs', 'stepExecution_inputs' - Fully-resolved values passed into the step before execution.
--
-- 'stepName', 'stepExecution_stepName' - The name of this execution step.
--
-- 'executionEndTime', 'stepExecution_executionEndTime' - If a step has finished execution, this contains the time the execution
-- ended. If the step hasn\'t yet concluded, this field isn\'t populated.
--
-- 'failureMessage', 'stepExecution_failureMessage' - If a step failed, this message explains why the execution failed.
--
-- 'response', 'stepExecution_response' - A message associated with the response code for an execution.
--
-- 'action', 'stepExecution_action' - The action this step performs. The action determines the behavior of the
-- step.
--
-- 'responseCode', 'stepExecution_responseCode' - The response code returned by the execution of the step.
--
-- 'stepStatus', 'stepExecution_stepStatus' - The execution status for this step.
--
-- 'targetLocation', 'stepExecution_targetLocation' - The combination of Amazon Web Services Regions and Amazon Web Services
-- accounts targeted by the current Automation execution.
--
-- 'overriddenParameters', 'stepExecution_overriddenParameters' - A user-specified list of parameters to override when running a step.
--
-- 'outputs', 'stepExecution_outputs' - Returned values from the execution of the step.
--
-- 'executionStartTime', 'stepExecution_executionStartTime' - If a step has begun execution, this contains the time the step started.
-- If the step is in Pending status, this field isn\'t populated.
--
-- 'maxAttempts', 'stepExecution_maxAttempts' - The maximum number of tries to run the action of the step. The default
-- value is @1@.
--
-- 'targets', 'stepExecution_targets' - The targets for the step execution.
--
-- 'nextStep', 'stepExecution_nextStep' - The next step after the step succeeds.
--
-- 'stepExecutionId', 'stepExecution_stepExecutionId' - The unique ID of a step execution.
--
-- 'validNextSteps', 'stepExecution_validNextSteps' - Strategies used when step fails, we support Continue and Abort. Abort
-- will fail the automation when the step fails. Continue will ignore the
-- failure of current step and allow automation to run the next step. With
-- conditional branching, we add step:stepName to support the automation to
-- go to another specific step.
--
-- 'timeoutSeconds', 'stepExecution_timeoutSeconds' - The timeout seconds of the step.
--
-- 'onFailure', 'stepExecution_onFailure' - The action to take if the step fails. The default value is @Abort@.
--
-- 'isCritical', 'stepExecution_isCritical' - The flag which can be used to help decide whether the failure of current
-- step leads to the Automation failure.
newStepExecution ::
  StepExecution
newStepExecution :: StepExecution
newStepExecution =
  StepExecution' :: Maybe FailureDetails
-> Maybe Bool
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AutomationExecutionStatus
-> Maybe TargetLocation
-> Maybe (HashMap Text [Text])
-> Maybe (HashMap Text [Text])
-> Maybe POSIX
-> Maybe Int
-> Maybe [Target]
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Integer
-> Maybe Text
-> Maybe Bool
-> StepExecution
StepExecution'
    { $sel:failureDetails:StepExecution' :: Maybe FailureDetails
failureDetails = Maybe FailureDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:isEnd:StepExecution' :: Maybe Bool
isEnd = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:inputs:StepExecution' :: Maybe (HashMap Text Text)
inputs = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:stepName:StepExecution' :: Maybe Text
stepName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:executionEndTime:StepExecution' :: Maybe POSIX
executionEndTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:failureMessage:StepExecution' :: Maybe Text
failureMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:response:StepExecution' :: Maybe Text
response = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:action:StepExecution' :: Maybe Text
action = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:responseCode:StepExecution' :: Maybe Text
responseCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stepStatus:StepExecution' :: Maybe AutomationExecutionStatus
stepStatus = Maybe AutomationExecutionStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:targetLocation:StepExecution' :: Maybe TargetLocation
targetLocation = Maybe TargetLocation
forall a. Maybe a
Prelude.Nothing,
      $sel:overriddenParameters:StepExecution' :: Maybe (HashMap Text [Text])
overriddenParameters = Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
      $sel:outputs:StepExecution' :: Maybe (HashMap Text [Text])
outputs = Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
      $sel:executionStartTime:StepExecution' :: Maybe POSIX
executionStartTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:maxAttempts:StepExecution' :: Maybe Int
maxAttempts = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:targets:StepExecution' :: Maybe [Target]
targets = Maybe [Target]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextStep:StepExecution' :: Maybe Text
nextStep = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stepExecutionId:StepExecution' :: Maybe Text
stepExecutionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:validNextSteps:StepExecution' :: Maybe [Text]
validNextSteps = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:timeoutSeconds:StepExecution' :: Maybe Integer
timeoutSeconds = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:onFailure:StepExecution' :: Maybe Text
onFailure = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isCritical:StepExecution' :: Maybe Bool
isCritical = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | Information about the Automation failure.
stepExecution_failureDetails :: Lens.Lens' StepExecution (Prelude.Maybe FailureDetails)
stepExecution_failureDetails :: (Maybe FailureDetails -> f (Maybe FailureDetails))
-> StepExecution -> f StepExecution
stepExecution_failureDetails = (StepExecution -> Maybe FailureDetails)
-> (StepExecution -> Maybe FailureDetails -> StepExecution)
-> Lens
     StepExecution
     StepExecution
     (Maybe FailureDetails)
     (Maybe FailureDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe FailureDetails
failureDetails :: Maybe FailureDetails
$sel:failureDetails:StepExecution' :: StepExecution -> Maybe FailureDetails
failureDetails} -> Maybe FailureDetails
failureDetails) (\s :: StepExecution
s@StepExecution' {} Maybe FailureDetails
a -> StepExecution
s {$sel:failureDetails:StepExecution' :: Maybe FailureDetails
failureDetails = Maybe FailureDetails
a} :: StepExecution)

-- | The flag which can be used to end automation no matter whether the step
-- succeeds or fails.
stepExecution_isEnd :: Lens.Lens' StepExecution (Prelude.Maybe Prelude.Bool)
stepExecution_isEnd :: (Maybe Bool -> f (Maybe Bool)) -> StepExecution -> f StepExecution
stepExecution_isEnd = (StepExecution -> Maybe Bool)
-> (StepExecution -> Maybe Bool -> StepExecution)
-> Lens StepExecution StepExecution (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe Bool
isEnd :: Maybe Bool
$sel:isEnd:StepExecution' :: StepExecution -> Maybe Bool
isEnd} -> Maybe Bool
isEnd) (\s :: StepExecution
s@StepExecution' {} Maybe Bool
a -> StepExecution
s {$sel:isEnd:StepExecution' :: Maybe Bool
isEnd = Maybe Bool
a} :: StepExecution)

-- | Fully-resolved values passed into the step before execution.
stepExecution_inputs :: Lens.Lens' StepExecution (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
stepExecution_inputs :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> StepExecution -> f StepExecution
stepExecution_inputs = (StepExecution -> Maybe (HashMap Text Text))
-> (StepExecution -> Maybe (HashMap Text Text) -> StepExecution)
-> Lens
     StepExecution
     StepExecution
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe (HashMap Text Text)
inputs :: Maybe (HashMap Text Text)
$sel:inputs:StepExecution' :: StepExecution -> Maybe (HashMap Text Text)
inputs} -> Maybe (HashMap Text Text)
inputs) (\s :: StepExecution
s@StepExecution' {} Maybe (HashMap Text Text)
a -> StepExecution
s {$sel:inputs:StepExecution' :: Maybe (HashMap Text Text)
inputs = Maybe (HashMap Text Text)
a} :: StepExecution) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> StepExecution -> f StepExecution)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> StepExecution
-> f StepExecution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of this execution step.
stepExecution_stepName :: Lens.Lens' StepExecution (Prelude.Maybe Prelude.Text)
stepExecution_stepName :: (Maybe Text -> f (Maybe Text)) -> StepExecution -> f StepExecution
stepExecution_stepName = (StepExecution -> Maybe Text)
-> (StepExecution -> Maybe Text -> StepExecution)
-> Lens StepExecution StepExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe Text
stepName :: Maybe Text
$sel:stepName:StepExecution' :: StepExecution -> Maybe Text
stepName} -> Maybe Text
stepName) (\s :: StepExecution
s@StepExecution' {} Maybe Text
a -> StepExecution
s {$sel:stepName:StepExecution' :: Maybe Text
stepName = Maybe Text
a} :: StepExecution)

-- | If a step has finished execution, this contains the time the execution
-- ended. If the step hasn\'t yet concluded, this field isn\'t populated.
stepExecution_executionEndTime :: Lens.Lens' StepExecution (Prelude.Maybe Prelude.UTCTime)
stepExecution_executionEndTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> StepExecution -> f StepExecution
stepExecution_executionEndTime = (StepExecution -> Maybe POSIX)
-> (StepExecution -> Maybe POSIX -> StepExecution)
-> Lens StepExecution StepExecution (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe POSIX
executionEndTime :: Maybe POSIX
$sel:executionEndTime:StepExecution' :: StepExecution -> Maybe POSIX
executionEndTime} -> Maybe POSIX
executionEndTime) (\s :: StepExecution
s@StepExecution' {} Maybe POSIX
a -> StepExecution
s {$sel:executionEndTime:StepExecution' :: Maybe POSIX
executionEndTime = Maybe POSIX
a} :: StepExecution) ((Maybe POSIX -> f (Maybe POSIX))
 -> StepExecution -> f StepExecution)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StepExecution
-> f StepExecution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | If a step failed, this message explains why the execution failed.
stepExecution_failureMessage :: Lens.Lens' StepExecution (Prelude.Maybe Prelude.Text)
stepExecution_failureMessage :: (Maybe Text -> f (Maybe Text)) -> StepExecution -> f StepExecution
stepExecution_failureMessage = (StepExecution -> Maybe Text)
-> (StepExecution -> Maybe Text -> StepExecution)
-> Lens StepExecution StepExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe Text
failureMessage :: Maybe Text
$sel:failureMessage:StepExecution' :: StepExecution -> Maybe Text
failureMessage} -> Maybe Text
failureMessage) (\s :: StepExecution
s@StepExecution' {} Maybe Text
a -> StepExecution
s {$sel:failureMessage:StepExecution' :: Maybe Text
failureMessage = Maybe Text
a} :: StepExecution)

-- | A message associated with the response code for an execution.
stepExecution_response :: Lens.Lens' StepExecution (Prelude.Maybe Prelude.Text)
stepExecution_response :: (Maybe Text -> f (Maybe Text)) -> StepExecution -> f StepExecution
stepExecution_response = (StepExecution -> Maybe Text)
-> (StepExecution -> Maybe Text -> StepExecution)
-> Lens StepExecution StepExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe Text
response :: Maybe Text
$sel:response:StepExecution' :: StepExecution -> Maybe Text
response} -> Maybe Text
response) (\s :: StepExecution
s@StepExecution' {} Maybe Text
a -> StepExecution
s {$sel:response:StepExecution' :: Maybe Text
response = Maybe Text
a} :: StepExecution)

-- | The action this step performs. The action determines the behavior of the
-- step.
stepExecution_action :: Lens.Lens' StepExecution (Prelude.Maybe Prelude.Text)
stepExecution_action :: (Maybe Text -> f (Maybe Text)) -> StepExecution -> f StepExecution
stepExecution_action = (StepExecution -> Maybe Text)
-> (StepExecution -> Maybe Text -> StepExecution)
-> Lens StepExecution StepExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe Text
action :: Maybe Text
$sel:action:StepExecution' :: StepExecution -> Maybe Text
action} -> Maybe Text
action) (\s :: StepExecution
s@StepExecution' {} Maybe Text
a -> StepExecution
s {$sel:action:StepExecution' :: Maybe Text
action = Maybe Text
a} :: StepExecution)

-- | The response code returned by the execution of the step.
stepExecution_responseCode :: Lens.Lens' StepExecution (Prelude.Maybe Prelude.Text)
stepExecution_responseCode :: (Maybe Text -> f (Maybe Text)) -> StepExecution -> f StepExecution
stepExecution_responseCode = (StepExecution -> Maybe Text)
-> (StepExecution -> Maybe Text -> StepExecution)
-> Lens StepExecution StepExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe Text
responseCode :: Maybe Text
$sel:responseCode:StepExecution' :: StepExecution -> Maybe Text
responseCode} -> Maybe Text
responseCode) (\s :: StepExecution
s@StepExecution' {} Maybe Text
a -> StepExecution
s {$sel:responseCode:StepExecution' :: Maybe Text
responseCode = Maybe Text
a} :: StepExecution)

-- | The execution status for this step.
stepExecution_stepStatus :: Lens.Lens' StepExecution (Prelude.Maybe AutomationExecutionStatus)
stepExecution_stepStatus :: (Maybe AutomationExecutionStatus
 -> f (Maybe AutomationExecutionStatus))
-> StepExecution -> f StepExecution
stepExecution_stepStatus = (StepExecution -> Maybe AutomationExecutionStatus)
-> (StepExecution
    -> Maybe AutomationExecutionStatus -> StepExecution)
-> Lens
     StepExecution
     StepExecution
     (Maybe AutomationExecutionStatus)
     (Maybe AutomationExecutionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe AutomationExecutionStatus
stepStatus :: Maybe AutomationExecutionStatus
$sel:stepStatus:StepExecution' :: StepExecution -> Maybe AutomationExecutionStatus
stepStatus} -> Maybe AutomationExecutionStatus
stepStatus) (\s :: StepExecution
s@StepExecution' {} Maybe AutomationExecutionStatus
a -> StepExecution
s {$sel:stepStatus:StepExecution' :: Maybe AutomationExecutionStatus
stepStatus = Maybe AutomationExecutionStatus
a} :: StepExecution)

-- | The combination of Amazon Web Services Regions and Amazon Web Services
-- accounts targeted by the current Automation execution.
stepExecution_targetLocation :: Lens.Lens' StepExecution (Prelude.Maybe TargetLocation)
stepExecution_targetLocation :: (Maybe TargetLocation -> f (Maybe TargetLocation))
-> StepExecution -> f StepExecution
stepExecution_targetLocation = (StepExecution -> Maybe TargetLocation)
-> (StepExecution -> Maybe TargetLocation -> StepExecution)
-> Lens
     StepExecution
     StepExecution
     (Maybe TargetLocation)
     (Maybe TargetLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe TargetLocation
targetLocation :: Maybe TargetLocation
$sel:targetLocation:StepExecution' :: StepExecution -> Maybe TargetLocation
targetLocation} -> Maybe TargetLocation
targetLocation) (\s :: StepExecution
s@StepExecution' {} Maybe TargetLocation
a -> StepExecution
s {$sel:targetLocation:StepExecution' :: Maybe TargetLocation
targetLocation = Maybe TargetLocation
a} :: StepExecution)

-- | A user-specified list of parameters to override when running a step.
stepExecution_overriddenParameters :: Lens.Lens' StepExecution (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
stepExecution_overriddenParameters :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> StepExecution -> f StepExecution
stepExecution_overriddenParameters = (StepExecution -> Maybe (HashMap Text [Text]))
-> (StepExecution -> Maybe (HashMap Text [Text]) -> StepExecution)
-> Lens
     StepExecution
     StepExecution
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe (HashMap Text [Text])
overriddenParameters :: Maybe (HashMap Text [Text])
$sel:overriddenParameters:StepExecution' :: StepExecution -> Maybe (HashMap Text [Text])
overriddenParameters} -> Maybe (HashMap Text [Text])
overriddenParameters) (\s :: StepExecution
s@StepExecution' {} Maybe (HashMap Text [Text])
a -> StepExecution
s {$sel:overriddenParameters:StepExecution' :: Maybe (HashMap Text [Text])
overriddenParameters = Maybe (HashMap Text [Text])
a} :: StepExecution) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
 -> StepExecution -> f StepExecution)
-> ((Maybe (HashMap Text [Text])
     -> f (Maybe (HashMap Text [Text])))
    -> Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> StepExecution
-> f StepExecution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
-> Iso
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Returned values from the execution of the step.
stepExecution_outputs :: Lens.Lens' StepExecution (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
stepExecution_outputs :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> StepExecution -> f StepExecution
stepExecution_outputs = (StepExecution -> Maybe (HashMap Text [Text]))
-> (StepExecution -> Maybe (HashMap Text [Text]) -> StepExecution)
-> Lens
     StepExecution
     StepExecution
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe (HashMap Text [Text])
outputs :: Maybe (HashMap Text [Text])
$sel:outputs:StepExecution' :: StepExecution -> Maybe (HashMap Text [Text])
outputs} -> Maybe (HashMap Text [Text])
outputs) (\s :: StepExecution
s@StepExecution' {} Maybe (HashMap Text [Text])
a -> StepExecution
s {$sel:outputs:StepExecution' :: Maybe (HashMap Text [Text])
outputs = Maybe (HashMap Text [Text])
a} :: StepExecution) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
 -> StepExecution -> f StepExecution)
-> ((Maybe (HashMap Text [Text])
     -> f (Maybe (HashMap Text [Text])))
    -> Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> StepExecution
-> f StepExecution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
-> Iso
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If a step has begun execution, this contains the time the step started.
-- If the step is in Pending status, this field isn\'t populated.
stepExecution_executionStartTime :: Lens.Lens' StepExecution (Prelude.Maybe Prelude.UTCTime)
stepExecution_executionStartTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> StepExecution -> f StepExecution
stepExecution_executionStartTime = (StepExecution -> Maybe POSIX)
-> (StepExecution -> Maybe POSIX -> StepExecution)
-> Lens StepExecution StepExecution (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe POSIX
executionStartTime :: Maybe POSIX
$sel:executionStartTime:StepExecution' :: StepExecution -> Maybe POSIX
executionStartTime} -> Maybe POSIX
executionStartTime) (\s :: StepExecution
s@StepExecution' {} Maybe POSIX
a -> StepExecution
s {$sel:executionStartTime:StepExecution' :: Maybe POSIX
executionStartTime = Maybe POSIX
a} :: StepExecution) ((Maybe POSIX -> f (Maybe POSIX))
 -> StepExecution -> f StepExecution)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StepExecution
-> f StepExecution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The maximum number of tries to run the action of the step. The default
-- value is @1@.
stepExecution_maxAttempts :: Lens.Lens' StepExecution (Prelude.Maybe Prelude.Int)
stepExecution_maxAttempts :: (Maybe Int -> f (Maybe Int)) -> StepExecution -> f StepExecution
stepExecution_maxAttempts = (StepExecution -> Maybe Int)
-> (StepExecution -> Maybe Int -> StepExecution)
-> Lens StepExecution StepExecution (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe Int
maxAttempts :: Maybe Int
$sel:maxAttempts:StepExecution' :: StepExecution -> Maybe Int
maxAttempts} -> Maybe Int
maxAttempts) (\s :: StepExecution
s@StepExecution' {} Maybe Int
a -> StepExecution
s {$sel:maxAttempts:StepExecution' :: Maybe Int
maxAttempts = Maybe Int
a} :: StepExecution)

-- | The targets for the step execution.
stepExecution_targets :: Lens.Lens' StepExecution (Prelude.Maybe [Target])
stepExecution_targets :: (Maybe [Target] -> f (Maybe [Target]))
-> StepExecution -> f StepExecution
stepExecution_targets = (StepExecution -> Maybe [Target])
-> (StepExecution -> Maybe [Target] -> StepExecution)
-> Lens
     StepExecution StepExecution (Maybe [Target]) (Maybe [Target])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe [Target]
targets :: Maybe [Target]
$sel:targets:StepExecution' :: StepExecution -> Maybe [Target]
targets} -> Maybe [Target]
targets) (\s :: StepExecution
s@StepExecution' {} Maybe [Target]
a -> StepExecution
s {$sel:targets:StepExecution' :: Maybe [Target]
targets = Maybe [Target]
a} :: StepExecution) ((Maybe [Target] -> f (Maybe [Target]))
 -> StepExecution -> f StepExecution)
-> ((Maybe [Target] -> f (Maybe [Target]))
    -> Maybe [Target] -> f (Maybe [Target]))
-> (Maybe [Target] -> f (Maybe [Target]))
-> StepExecution
-> f StepExecution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Target] [Target] [Target] [Target]
-> Iso
     (Maybe [Target]) (Maybe [Target]) (Maybe [Target]) (Maybe [Target])
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 [Target] [Target] [Target] [Target]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The next step after the step succeeds.
stepExecution_nextStep :: Lens.Lens' StepExecution (Prelude.Maybe Prelude.Text)
stepExecution_nextStep :: (Maybe Text -> f (Maybe Text)) -> StepExecution -> f StepExecution
stepExecution_nextStep = (StepExecution -> Maybe Text)
-> (StepExecution -> Maybe Text -> StepExecution)
-> Lens StepExecution StepExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe Text
nextStep :: Maybe Text
$sel:nextStep:StepExecution' :: StepExecution -> Maybe Text
nextStep} -> Maybe Text
nextStep) (\s :: StepExecution
s@StepExecution' {} Maybe Text
a -> StepExecution
s {$sel:nextStep:StepExecution' :: Maybe Text
nextStep = Maybe Text
a} :: StepExecution)

-- | The unique ID of a step execution.
stepExecution_stepExecutionId :: Lens.Lens' StepExecution (Prelude.Maybe Prelude.Text)
stepExecution_stepExecutionId :: (Maybe Text -> f (Maybe Text)) -> StepExecution -> f StepExecution
stepExecution_stepExecutionId = (StepExecution -> Maybe Text)
-> (StepExecution -> Maybe Text -> StepExecution)
-> Lens StepExecution StepExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe Text
stepExecutionId :: Maybe Text
$sel:stepExecutionId:StepExecution' :: StepExecution -> Maybe Text
stepExecutionId} -> Maybe Text
stepExecutionId) (\s :: StepExecution
s@StepExecution' {} Maybe Text
a -> StepExecution
s {$sel:stepExecutionId:StepExecution' :: Maybe Text
stepExecutionId = Maybe Text
a} :: StepExecution)

-- | Strategies used when step fails, we support Continue and Abort. Abort
-- will fail the automation when the step fails. Continue will ignore the
-- failure of current step and allow automation to run the next step. With
-- conditional branching, we add step:stepName to support the automation to
-- go to another specific step.
stepExecution_validNextSteps :: Lens.Lens' StepExecution (Prelude.Maybe [Prelude.Text])
stepExecution_validNextSteps :: (Maybe [Text] -> f (Maybe [Text]))
-> StepExecution -> f StepExecution
stepExecution_validNextSteps = (StepExecution -> Maybe [Text])
-> (StepExecution -> Maybe [Text] -> StepExecution)
-> Lens StepExecution StepExecution (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe [Text]
validNextSteps :: Maybe [Text]
$sel:validNextSteps:StepExecution' :: StepExecution -> Maybe [Text]
validNextSteps} -> Maybe [Text]
validNextSteps) (\s :: StepExecution
s@StepExecution' {} Maybe [Text]
a -> StepExecution
s {$sel:validNextSteps:StepExecution' :: Maybe [Text]
validNextSteps = Maybe [Text]
a} :: StepExecution) ((Maybe [Text] -> f (Maybe [Text]))
 -> StepExecution -> f StepExecution)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> StepExecution
-> f StepExecution
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 timeout seconds of the step.
stepExecution_timeoutSeconds :: Lens.Lens' StepExecution (Prelude.Maybe Prelude.Integer)
stepExecution_timeoutSeconds :: (Maybe Integer -> f (Maybe Integer))
-> StepExecution -> f StepExecution
stepExecution_timeoutSeconds = (StepExecution -> Maybe Integer)
-> (StepExecution -> Maybe Integer -> StepExecution)
-> Lens StepExecution StepExecution (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe Integer
timeoutSeconds :: Maybe Integer
$sel:timeoutSeconds:StepExecution' :: StepExecution -> Maybe Integer
timeoutSeconds} -> Maybe Integer
timeoutSeconds) (\s :: StepExecution
s@StepExecution' {} Maybe Integer
a -> StepExecution
s {$sel:timeoutSeconds:StepExecution' :: Maybe Integer
timeoutSeconds = Maybe Integer
a} :: StepExecution)

-- | The action to take if the step fails. The default value is @Abort@.
stepExecution_onFailure :: Lens.Lens' StepExecution (Prelude.Maybe Prelude.Text)
stepExecution_onFailure :: (Maybe Text -> f (Maybe Text)) -> StepExecution -> f StepExecution
stepExecution_onFailure = (StepExecution -> Maybe Text)
-> (StepExecution -> Maybe Text -> StepExecution)
-> Lens StepExecution StepExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe Text
onFailure :: Maybe Text
$sel:onFailure:StepExecution' :: StepExecution -> Maybe Text
onFailure} -> Maybe Text
onFailure) (\s :: StepExecution
s@StepExecution' {} Maybe Text
a -> StepExecution
s {$sel:onFailure:StepExecution' :: Maybe Text
onFailure = Maybe Text
a} :: StepExecution)

-- | The flag which can be used to help decide whether the failure of current
-- step leads to the Automation failure.
stepExecution_isCritical :: Lens.Lens' StepExecution (Prelude.Maybe Prelude.Bool)
stepExecution_isCritical :: (Maybe Bool -> f (Maybe Bool)) -> StepExecution -> f StepExecution
stepExecution_isCritical = (StepExecution -> Maybe Bool)
-> (StepExecution -> Maybe Bool -> StepExecution)
-> Lens StepExecution StepExecution (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepExecution' {Maybe Bool
isCritical :: Maybe Bool
$sel:isCritical:StepExecution' :: StepExecution -> Maybe Bool
isCritical} -> Maybe Bool
isCritical) (\s :: StepExecution
s@StepExecution' {} Maybe Bool
a -> StepExecution
s {$sel:isCritical:StepExecution' :: Maybe Bool
isCritical = Maybe Bool
a} :: StepExecution)

instance Core.FromJSON StepExecution where
  parseJSON :: Value -> Parser StepExecution
parseJSON =
    String
-> (Object -> Parser StepExecution)
-> Value
-> Parser StepExecution
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"StepExecution"
      ( \Object
x ->
          Maybe FailureDetails
-> Maybe Bool
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AutomationExecutionStatus
-> Maybe TargetLocation
-> Maybe (HashMap Text [Text])
-> Maybe (HashMap Text [Text])
-> Maybe POSIX
-> Maybe Int
-> Maybe [Target]
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Integer
-> Maybe Text
-> Maybe Bool
-> StepExecution
StepExecution'
            (Maybe FailureDetails
 -> Maybe Bool
 -> Maybe (HashMap Text Text)
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe AutomationExecutionStatus
 -> Maybe TargetLocation
 -> Maybe (HashMap Text [Text])
 -> Maybe (HashMap Text [Text])
 -> Maybe POSIX
 -> Maybe Int
 -> Maybe [Target]
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Integer
 -> Maybe Text
 -> Maybe Bool
 -> StepExecution)
-> Parser (Maybe FailureDetails)
-> Parser
     (Maybe Bool
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AutomationExecutionStatus
      -> Maybe TargetLocation
      -> Maybe (HashMap Text [Text])
      -> Maybe (HashMap Text [Text])
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe [Target]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Bool
      -> StepExecution)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe FailureDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FailureDetails")
            Parser
  (Maybe Bool
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AutomationExecutionStatus
   -> Maybe TargetLocation
   -> Maybe (HashMap Text [Text])
   -> Maybe (HashMap Text [Text])
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe [Target]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Bool
   -> StepExecution)
-> Parser (Maybe Bool)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AutomationExecutionStatus
      -> Maybe TargetLocation
      -> Maybe (HashMap Text [Text])
      -> Maybe (HashMap Text [Text])
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe [Target]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Bool
      -> StepExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IsEnd")
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AutomationExecutionStatus
   -> Maybe TargetLocation
   -> Maybe (HashMap Text [Text])
   -> Maybe (HashMap Text [Text])
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe [Target]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Bool
   -> StepExecution)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AutomationExecutionStatus
      -> Maybe TargetLocation
      -> Maybe (HashMap Text [Text])
      -> Maybe (HashMap Text [Text])
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe [Target]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Bool
      -> StepExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Inputs" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AutomationExecutionStatus
   -> Maybe TargetLocation
   -> Maybe (HashMap Text [Text])
   -> Maybe (HashMap Text [Text])
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe [Target]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Bool
   -> StepExecution)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AutomationExecutionStatus
      -> Maybe TargetLocation
      -> Maybe (HashMap Text [Text])
      -> Maybe (HashMap Text [Text])
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe [Target]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Bool
      -> StepExecution)
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
"StepName")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AutomationExecutionStatus
   -> Maybe TargetLocation
   -> Maybe (HashMap Text [Text])
   -> Maybe (HashMap Text [Text])
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe [Target]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Bool
   -> StepExecution)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AutomationExecutionStatus
      -> Maybe TargetLocation
      -> Maybe (HashMap Text [Text])
      -> Maybe (HashMap Text [Text])
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe [Target]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Bool
      -> StepExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExecutionEndTime")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AutomationExecutionStatus
   -> Maybe TargetLocation
   -> Maybe (HashMap Text [Text])
   -> Maybe (HashMap Text [Text])
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe [Target]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Bool
   -> StepExecution)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AutomationExecutionStatus
      -> Maybe TargetLocation
      -> Maybe (HashMap Text [Text])
      -> Maybe (HashMap Text [Text])
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe [Target]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Bool
      -> StepExecution)
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
"FailureMessage")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AutomationExecutionStatus
   -> Maybe TargetLocation
   -> Maybe (HashMap Text [Text])
   -> Maybe (HashMap Text [Text])
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe [Target]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Bool
   -> StepExecution)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe AutomationExecutionStatus
      -> Maybe TargetLocation
      -> Maybe (HashMap Text [Text])
      -> Maybe (HashMap Text [Text])
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe [Target]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Bool
      -> StepExecution)
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
"Response")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe AutomationExecutionStatus
   -> Maybe TargetLocation
   -> Maybe (HashMap Text [Text])
   -> Maybe (HashMap Text [Text])
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe [Target]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Bool
   -> StepExecution)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe AutomationExecutionStatus
      -> Maybe TargetLocation
      -> Maybe (HashMap Text [Text])
      -> Maybe (HashMap Text [Text])
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe [Target]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Bool
      -> StepExecution)
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
"Action")
            Parser
  (Maybe Text
   -> Maybe AutomationExecutionStatus
   -> Maybe TargetLocation
   -> Maybe (HashMap Text [Text])
   -> Maybe (HashMap Text [Text])
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe [Target]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Bool
   -> StepExecution)
-> Parser (Maybe Text)
-> Parser
     (Maybe AutomationExecutionStatus
      -> Maybe TargetLocation
      -> Maybe (HashMap Text [Text])
      -> Maybe (HashMap Text [Text])
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe [Target]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Bool
      -> StepExecution)
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
"ResponseCode")
            Parser
  (Maybe AutomationExecutionStatus
   -> Maybe TargetLocation
   -> Maybe (HashMap Text [Text])
   -> Maybe (HashMap Text [Text])
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe [Target]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Bool
   -> StepExecution)
-> Parser (Maybe AutomationExecutionStatus)
-> Parser
     (Maybe TargetLocation
      -> Maybe (HashMap Text [Text])
      -> Maybe (HashMap Text [Text])
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe [Target]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Bool
      -> StepExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AutomationExecutionStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StepStatus")
            Parser
  (Maybe TargetLocation
   -> Maybe (HashMap Text [Text])
   -> Maybe (HashMap Text [Text])
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe [Target]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Bool
   -> StepExecution)
-> Parser (Maybe TargetLocation)
-> Parser
     (Maybe (HashMap Text [Text])
      -> Maybe (HashMap Text [Text])
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe [Target]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Bool
      -> StepExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TargetLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TargetLocation")
            Parser
  (Maybe (HashMap Text [Text])
   -> Maybe (HashMap Text [Text])
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe [Target]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Bool
   -> StepExecution)
-> Parser (Maybe (HashMap Text [Text]))
-> Parser
     (Maybe (HashMap Text [Text])
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe [Target]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Bool
      -> StepExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text [Text])))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OverriddenParameters"
                            Parser (Maybe (Maybe (HashMap Text [Text])))
-> Maybe (HashMap Text [Text])
-> Parser (Maybe (HashMap Text [Text]))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text [Text])
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe (HashMap Text [Text])
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe [Target]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Bool
   -> StepExecution)
-> Parser (Maybe (HashMap Text [Text]))
-> Parser
     (Maybe POSIX
      -> Maybe Int
      -> Maybe [Target]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Bool
      -> StepExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text [Text])))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Outputs" Parser (Maybe (Maybe (HashMap Text [Text])))
-> Maybe (HashMap Text [Text])
-> Parser (Maybe (HashMap Text [Text]))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text [Text])
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe POSIX
   -> Maybe Int
   -> Maybe [Target]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Bool
   -> StepExecution)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Int
      -> Maybe [Target]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Bool
      -> StepExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExecutionStartTime")
            Parser
  (Maybe Int
   -> Maybe [Target]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Bool
   -> StepExecution)
-> Parser (Maybe Int)
-> Parser
     (Maybe [Target]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Bool
      -> StepExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaxAttempts")
            Parser
  (Maybe [Target]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Bool
   -> StepExecution)
-> Parser (Maybe [Target])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Bool
      -> StepExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Target]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Targets" Parser (Maybe (Maybe [Target]))
-> Maybe [Target] -> Parser (Maybe [Target])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Target]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Bool
   -> StepExecution)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Bool
      -> StepExecution)
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
"NextStep")
            Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Bool
   -> StepExecution)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe Integer -> Maybe Text -> Maybe Bool -> StepExecution)
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
"StepExecutionId")
            Parser
  (Maybe [Text]
   -> Maybe Integer -> Maybe Text -> Maybe Bool -> StepExecution)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Integer -> Maybe Text -> Maybe Bool -> StepExecution)
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
"ValidNextSteps" 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 Integer -> Maybe Text -> Maybe Bool -> StepExecution)
-> Parser (Maybe Integer)
-> Parser (Maybe Text -> Maybe Bool -> StepExecution)
forall (f :: * -> *) a b. Applicative f => 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
"TimeoutSeconds")
            Parser (Maybe Text -> Maybe Bool -> StepExecution)
-> Parser (Maybe Text) -> Parser (Maybe Bool -> StepExecution)
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
"OnFailure")
            Parser (Maybe Bool -> StepExecution)
-> Parser (Maybe Bool) -> Parser StepExecution
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IsCritical")
      )

instance Prelude.Hashable StepExecution

instance Prelude.NFData StepExecution