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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SWF.Types.StartChildWorkflowExecutionFailedCause
import Amazonka.SWF.Types.WorkflowType

-- | Provides the details of the @StartChildWorkflowExecutionFailed@ event.
--
-- /See:/ 'newStartChildWorkflowExecutionFailedEventAttributes' smart constructor.
data StartChildWorkflowExecutionFailedEventAttributes = StartChildWorkflowExecutionFailedEventAttributes'
  { -- | The data attached to the event that the decider can use in subsequent
    -- workflow tasks. This data isn\'t sent to the child workflow execution.
    StartChildWorkflowExecutionFailedEventAttributes -> Maybe Text
control :: Prelude.Maybe Prelude.Text,
    -- | The workflow type provided in the @StartChildWorkflowExecution@ Decision
    -- that failed.
    StartChildWorkflowExecutionFailedEventAttributes -> WorkflowType
workflowType :: WorkflowType,
    -- | The cause of the failure. This information is generated by the system
    -- and can be useful for diagnostic purposes.
    --
    -- When @cause@ is set to @OPERATION_NOT_PERMITTED@, the decision fails
    -- because it lacks sufficient permissions. 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/.
    StartChildWorkflowExecutionFailedEventAttributes
-> StartChildWorkflowExecutionFailedCause
cause :: StartChildWorkflowExecutionFailedCause,
    -- | The @workflowId@ of the child workflow execution.
    StartChildWorkflowExecutionFailedEventAttributes -> Text
workflowId :: Prelude.Text,
    -- | When the @cause@ is @WORKFLOW_ALREADY_RUNNING@, @initiatedEventId@ is
    -- the ID of the @StartChildWorkflowExecutionInitiated@ event that
    -- corresponds to the @StartChildWorkflowExecution@ Decision to start the
    -- workflow execution. You can use this information to diagnose problems by
    -- tracing back the chain of events leading up to this event.
    --
    -- When the @cause@ isn\'t @WORKFLOW_ALREADY_RUNNING@, @initiatedEventId@
    -- is set to @0@ because the @StartChildWorkflowExecutionInitiated@ event
    -- doesn\'t exist.
    StartChildWorkflowExecutionFailedEventAttributes -> Integer
initiatedEventId :: Prelude.Integer,
    -- | The ID of the @DecisionTaskCompleted@ event corresponding to the
    -- decision task that resulted in the @StartChildWorkflowExecution@
    -- Decision to request this child workflow execution. This information can
    -- be useful for diagnosing problems by tracing back the chain of events.
    StartChildWorkflowExecutionFailedEventAttributes -> Integer
decisionTaskCompletedEventId :: Prelude.Integer
  }
  deriving (StartChildWorkflowExecutionFailedEventAttributes
-> StartChildWorkflowExecutionFailedEventAttributes -> Bool
(StartChildWorkflowExecutionFailedEventAttributes
 -> StartChildWorkflowExecutionFailedEventAttributes -> Bool)
-> (StartChildWorkflowExecutionFailedEventAttributes
    -> StartChildWorkflowExecutionFailedEventAttributes -> Bool)
-> Eq StartChildWorkflowExecutionFailedEventAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartChildWorkflowExecutionFailedEventAttributes
-> StartChildWorkflowExecutionFailedEventAttributes -> Bool
$c/= :: StartChildWorkflowExecutionFailedEventAttributes
-> StartChildWorkflowExecutionFailedEventAttributes -> Bool
== :: StartChildWorkflowExecutionFailedEventAttributes
-> StartChildWorkflowExecutionFailedEventAttributes -> Bool
$c== :: StartChildWorkflowExecutionFailedEventAttributes
-> StartChildWorkflowExecutionFailedEventAttributes -> Bool
Prelude.Eq, ReadPrec [StartChildWorkflowExecutionFailedEventAttributes]
ReadPrec StartChildWorkflowExecutionFailedEventAttributes
Int -> ReadS StartChildWorkflowExecutionFailedEventAttributes
ReadS [StartChildWorkflowExecutionFailedEventAttributes]
(Int -> ReadS StartChildWorkflowExecutionFailedEventAttributes)
-> ReadS [StartChildWorkflowExecutionFailedEventAttributes]
-> ReadPrec StartChildWorkflowExecutionFailedEventAttributes
-> ReadPrec [StartChildWorkflowExecutionFailedEventAttributes]
-> Read StartChildWorkflowExecutionFailedEventAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartChildWorkflowExecutionFailedEventAttributes]
$creadListPrec :: ReadPrec [StartChildWorkflowExecutionFailedEventAttributes]
readPrec :: ReadPrec StartChildWorkflowExecutionFailedEventAttributes
$creadPrec :: ReadPrec StartChildWorkflowExecutionFailedEventAttributes
readList :: ReadS [StartChildWorkflowExecutionFailedEventAttributes]
$creadList :: ReadS [StartChildWorkflowExecutionFailedEventAttributes]
readsPrec :: Int -> ReadS StartChildWorkflowExecutionFailedEventAttributes
$creadsPrec :: Int -> ReadS StartChildWorkflowExecutionFailedEventAttributes
Prelude.Read, Int -> StartChildWorkflowExecutionFailedEventAttributes -> ShowS
[StartChildWorkflowExecutionFailedEventAttributes] -> ShowS
StartChildWorkflowExecutionFailedEventAttributes -> String
(Int -> StartChildWorkflowExecutionFailedEventAttributes -> ShowS)
-> (StartChildWorkflowExecutionFailedEventAttributes -> String)
-> ([StartChildWorkflowExecutionFailedEventAttributes] -> ShowS)
-> Show StartChildWorkflowExecutionFailedEventAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartChildWorkflowExecutionFailedEventAttributes] -> ShowS
$cshowList :: [StartChildWorkflowExecutionFailedEventAttributes] -> ShowS
show :: StartChildWorkflowExecutionFailedEventAttributes -> String
$cshow :: StartChildWorkflowExecutionFailedEventAttributes -> String
showsPrec :: Int -> StartChildWorkflowExecutionFailedEventAttributes -> ShowS
$cshowsPrec :: Int -> StartChildWorkflowExecutionFailedEventAttributes -> ShowS
Prelude.Show, (forall x.
 StartChildWorkflowExecutionFailedEventAttributes
 -> Rep StartChildWorkflowExecutionFailedEventAttributes x)
-> (forall x.
    Rep StartChildWorkflowExecutionFailedEventAttributes x
    -> StartChildWorkflowExecutionFailedEventAttributes)
-> Generic StartChildWorkflowExecutionFailedEventAttributes
forall x.
Rep StartChildWorkflowExecutionFailedEventAttributes x
-> StartChildWorkflowExecutionFailedEventAttributes
forall x.
StartChildWorkflowExecutionFailedEventAttributes
-> Rep StartChildWorkflowExecutionFailedEventAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartChildWorkflowExecutionFailedEventAttributes x
-> StartChildWorkflowExecutionFailedEventAttributes
$cfrom :: forall x.
StartChildWorkflowExecutionFailedEventAttributes
-> Rep StartChildWorkflowExecutionFailedEventAttributes x
Prelude.Generic)

-- |
-- Create a value of 'StartChildWorkflowExecutionFailedEventAttributes' 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:
--
-- 'control', 'startChildWorkflowExecutionFailedEventAttributes_control' - The data attached to the event that the decider can use in subsequent
-- workflow tasks. This data isn\'t sent to the child workflow execution.
--
-- 'workflowType', 'startChildWorkflowExecutionFailedEventAttributes_workflowType' - The workflow type provided in the @StartChildWorkflowExecution@ Decision
-- that failed.
--
-- 'cause', 'startChildWorkflowExecutionFailedEventAttributes_cause' - The cause of the failure. This information is generated by the system
-- and can be useful for diagnostic purposes.
--
-- When @cause@ is set to @OPERATION_NOT_PERMITTED@, the decision fails
-- because it lacks sufficient permissions. 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/.
--
-- 'workflowId', 'startChildWorkflowExecutionFailedEventAttributes_workflowId' - The @workflowId@ of the child workflow execution.
--
-- 'initiatedEventId', 'startChildWorkflowExecutionFailedEventAttributes_initiatedEventId' - When the @cause@ is @WORKFLOW_ALREADY_RUNNING@, @initiatedEventId@ is
-- the ID of the @StartChildWorkflowExecutionInitiated@ event that
-- corresponds to the @StartChildWorkflowExecution@ Decision to start the
-- workflow execution. You can use this information to diagnose problems by
-- tracing back the chain of events leading up to this event.
--
-- When the @cause@ isn\'t @WORKFLOW_ALREADY_RUNNING@, @initiatedEventId@
-- is set to @0@ because the @StartChildWorkflowExecutionInitiated@ event
-- doesn\'t exist.
--
-- 'decisionTaskCompletedEventId', 'startChildWorkflowExecutionFailedEventAttributes_decisionTaskCompletedEventId' - The ID of the @DecisionTaskCompleted@ event corresponding to the
-- decision task that resulted in the @StartChildWorkflowExecution@
-- Decision to request this child workflow execution. This information can
-- be useful for diagnosing problems by tracing back the chain of events.
newStartChildWorkflowExecutionFailedEventAttributes ::
  -- | 'workflowType'
  WorkflowType ->
  -- | 'cause'
  StartChildWorkflowExecutionFailedCause ->
  -- | 'workflowId'
  Prelude.Text ->
  -- | 'initiatedEventId'
  Prelude.Integer ->
  -- | 'decisionTaskCompletedEventId'
  Prelude.Integer ->
  StartChildWorkflowExecutionFailedEventAttributes
newStartChildWorkflowExecutionFailedEventAttributes :: WorkflowType
-> StartChildWorkflowExecutionFailedCause
-> Text
-> Integer
-> Integer
-> StartChildWorkflowExecutionFailedEventAttributes
newStartChildWorkflowExecutionFailedEventAttributes
  WorkflowType
pWorkflowType_
  StartChildWorkflowExecutionFailedCause
pCause_
  Text
pWorkflowId_
  Integer
pInitiatedEventId_
  Integer
pDecisionTaskCompletedEventId_ =
    StartChildWorkflowExecutionFailedEventAttributes' :: Maybe Text
-> WorkflowType
-> StartChildWorkflowExecutionFailedCause
-> Text
-> Integer
-> Integer
-> StartChildWorkflowExecutionFailedEventAttributes
StartChildWorkflowExecutionFailedEventAttributes'
      { $sel:control:StartChildWorkflowExecutionFailedEventAttributes' :: Maybe Text
control =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:workflowType:StartChildWorkflowExecutionFailedEventAttributes' :: WorkflowType
workflowType =
          WorkflowType
pWorkflowType_,
        $sel:cause:StartChildWorkflowExecutionFailedEventAttributes' :: StartChildWorkflowExecutionFailedCause
cause = StartChildWorkflowExecutionFailedCause
pCause_,
        $sel:workflowId:StartChildWorkflowExecutionFailedEventAttributes' :: Text
workflowId = Text
pWorkflowId_,
        $sel:initiatedEventId:StartChildWorkflowExecutionFailedEventAttributes' :: Integer
initiatedEventId =
          Integer
pInitiatedEventId_,
        $sel:decisionTaskCompletedEventId:StartChildWorkflowExecutionFailedEventAttributes' :: Integer
decisionTaskCompletedEventId =
          Integer
pDecisionTaskCompletedEventId_
      }

-- | The data attached to the event that the decider can use in subsequent
-- workflow tasks. This data isn\'t sent to the child workflow execution.
startChildWorkflowExecutionFailedEventAttributes_control :: Lens.Lens' StartChildWorkflowExecutionFailedEventAttributes (Prelude.Maybe Prelude.Text)
startChildWorkflowExecutionFailedEventAttributes_control :: (Maybe Text -> f (Maybe Text))
-> StartChildWorkflowExecutionFailedEventAttributes
-> f StartChildWorkflowExecutionFailedEventAttributes
startChildWorkflowExecutionFailedEventAttributes_control = (StartChildWorkflowExecutionFailedEventAttributes -> Maybe Text)
-> (StartChildWorkflowExecutionFailedEventAttributes
    -> Maybe Text -> StartChildWorkflowExecutionFailedEventAttributes)
-> Lens
     StartChildWorkflowExecutionFailedEventAttributes
     StartChildWorkflowExecutionFailedEventAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChildWorkflowExecutionFailedEventAttributes' {Maybe Text
control :: Maybe Text
$sel:control:StartChildWorkflowExecutionFailedEventAttributes' :: StartChildWorkflowExecutionFailedEventAttributes -> Maybe Text
control} -> Maybe Text
control) (\s :: StartChildWorkflowExecutionFailedEventAttributes
s@StartChildWorkflowExecutionFailedEventAttributes' {} Maybe Text
a -> StartChildWorkflowExecutionFailedEventAttributes
s {$sel:control:StartChildWorkflowExecutionFailedEventAttributes' :: Maybe Text
control = Maybe Text
a} :: StartChildWorkflowExecutionFailedEventAttributes)

-- | The workflow type provided in the @StartChildWorkflowExecution@ Decision
-- that failed.
startChildWorkflowExecutionFailedEventAttributes_workflowType :: Lens.Lens' StartChildWorkflowExecutionFailedEventAttributes WorkflowType
startChildWorkflowExecutionFailedEventAttributes_workflowType :: (WorkflowType -> f WorkflowType)
-> StartChildWorkflowExecutionFailedEventAttributes
-> f StartChildWorkflowExecutionFailedEventAttributes
startChildWorkflowExecutionFailedEventAttributes_workflowType = (StartChildWorkflowExecutionFailedEventAttributes -> WorkflowType)
-> (StartChildWorkflowExecutionFailedEventAttributes
    -> WorkflowType
    -> StartChildWorkflowExecutionFailedEventAttributes)
-> Lens
     StartChildWorkflowExecutionFailedEventAttributes
     StartChildWorkflowExecutionFailedEventAttributes
     WorkflowType
     WorkflowType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChildWorkflowExecutionFailedEventAttributes' {WorkflowType
workflowType :: WorkflowType
$sel:workflowType:StartChildWorkflowExecutionFailedEventAttributes' :: StartChildWorkflowExecutionFailedEventAttributes -> WorkflowType
workflowType} -> WorkflowType
workflowType) (\s :: StartChildWorkflowExecutionFailedEventAttributes
s@StartChildWorkflowExecutionFailedEventAttributes' {} WorkflowType
a -> StartChildWorkflowExecutionFailedEventAttributes
s {$sel:workflowType:StartChildWorkflowExecutionFailedEventAttributes' :: WorkflowType
workflowType = WorkflowType
a} :: StartChildWorkflowExecutionFailedEventAttributes)

-- | The cause of the failure. This information is generated by the system
-- and can be useful for diagnostic purposes.
--
-- When @cause@ is set to @OPERATION_NOT_PERMITTED@, the decision fails
-- because it lacks sufficient permissions. 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/.
startChildWorkflowExecutionFailedEventAttributes_cause :: Lens.Lens' StartChildWorkflowExecutionFailedEventAttributes StartChildWorkflowExecutionFailedCause
startChildWorkflowExecutionFailedEventAttributes_cause :: (StartChildWorkflowExecutionFailedCause
 -> f StartChildWorkflowExecutionFailedCause)
-> StartChildWorkflowExecutionFailedEventAttributes
-> f StartChildWorkflowExecutionFailedEventAttributes
startChildWorkflowExecutionFailedEventAttributes_cause = (StartChildWorkflowExecutionFailedEventAttributes
 -> StartChildWorkflowExecutionFailedCause)
-> (StartChildWorkflowExecutionFailedEventAttributes
    -> StartChildWorkflowExecutionFailedCause
    -> StartChildWorkflowExecutionFailedEventAttributes)
-> Lens
     StartChildWorkflowExecutionFailedEventAttributes
     StartChildWorkflowExecutionFailedEventAttributes
     StartChildWorkflowExecutionFailedCause
     StartChildWorkflowExecutionFailedCause
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChildWorkflowExecutionFailedEventAttributes' {StartChildWorkflowExecutionFailedCause
cause :: StartChildWorkflowExecutionFailedCause
$sel:cause:StartChildWorkflowExecutionFailedEventAttributes' :: StartChildWorkflowExecutionFailedEventAttributes
-> StartChildWorkflowExecutionFailedCause
cause} -> StartChildWorkflowExecutionFailedCause
cause) (\s :: StartChildWorkflowExecutionFailedEventAttributes
s@StartChildWorkflowExecutionFailedEventAttributes' {} StartChildWorkflowExecutionFailedCause
a -> StartChildWorkflowExecutionFailedEventAttributes
s {$sel:cause:StartChildWorkflowExecutionFailedEventAttributes' :: StartChildWorkflowExecutionFailedCause
cause = StartChildWorkflowExecutionFailedCause
a} :: StartChildWorkflowExecutionFailedEventAttributes)

-- | The @workflowId@ of the child workflow execution.
startChildWorkflowExecutionFailedEventAttributes_workflowId :: Lens.Lens' StartChildWorkflowExecutionFailedEventAttributes Prelude.Text
startChildWorkflowExecutionFailedEventAttributes_workflowId :: (Text -> f Text)
-> StartChildWorkflowExecutionFailedEventAttributes
-> f StartChildWorkflowExecutionFailedEventAttributes
startChildWorkflowExecutionFailedEventAttributes_workflowId = (StartChildWorkflowExecutionFailedEventAttributes -> Text)
-> (StartChildWorkflowExecutionFailedEventAttributes
    -> Text -> StartChildWorkflowExecutionFailedEventAttributes)
-> Lens
     StartChildWorkflowExecutionFailedEventAttributes
     StartChildWorkflowExecutionFailedEventAttributes
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChildWorkflowExecutionFailedEventAttributes' {Text
workflowId :: Text
$sel:workflowId:StartChildWorkflowExecutionFailedEventAttributes' :: StartChildWorkflowExecutionFailedEventAttributes -> Text
workflowId} -> Text
workflowId) (\s :: StartChildWorkflowExecutionFailedEventAttributes
s@StartChildWorkflowExecutionFailedEventAttributes' {} Text
a -> StartChildWorkflowExecutionFailedEventAttributes
s {$sel:workflowId:StartChildWorkflowExecutionFailedEventAttributes' :: Text
workflowId = Text
a} :: StartChildWorkflowExecutionFailedEventAttributes)

-- | When the @cause@ is @WORKFLOW_ALREADY_RUNNING@, @initiatedEventId@ is
-- the ID of the @StartChildWorkflowExecutionInitiated@ event that
-- corresponds to the @StartChildWorkflowExecution@ Decision to start the
-- workflow execution. You can use this information to diagnose problems by
-- tracing back the chain of events leading up to this event.
--
-- When the @cause@ isn\'t @WORKFLOW_ALREADY_RUNNING@, @initiatedEventId@
-- is set to @0@ because the @StartChildWorkflowExecutionInitiated@ event
-- doesn\'t exist.
startChildWorkflowExecutionFailedEventAttributes_initiatedEventId :: Lens.Lens' StartChildWorkflowExecutionFailedEventAttributes Prelude.Integer
startChildWorkflowExecutionFailedEventAttributes_initiatedEventId :: (Integer -> f Integer)
-> StartChildWorkflowExecutionFailedEventAttributes
-> f StartChildWorkflowExecutionFailedEventAttributes
startChildWorkflowExecutionFailedEventAttributes_initiatedEventId = (StartChildWorkflowExecutionFailedEventAttributes -> Integer)
-> (StartChildWorkflowExecutionFailedEventAttributes
    -> Integer -> StartChildWorkflowExecutionFailedEventAttributes)
-> Lens
     StartChildWorkflowExecutionFailedEventAttributes
     StartChildWorkflowExecutionFailedEventAttributes
     Integer
     Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChildWorkflowExecutionFailedEventAttributes' {Integer
initiatedEventId :: Integer
$sel:initiatedEventId:StartChildWorkflowExecutionFailedEventAttributes' :: StartChildWorkflowExecutionFailedEventAttributes -> Integer
initiatedEventId} -> Integer
initiatedEventId) (\s :: StartChildWorkflowExecutionFailedEventAttributes
s@StartChildWorkflowExecutionFailedEventAttributes' {} Integer
a -> StartChildWorkflowExecutionFailedEventAttributes
s {$sel:initiatedEventId:StartChildWorkflowExecutionFailedEventAttributes' :: Integer
initiatedEventId = Integer
a} :: StartChildWorkflowExecutionFailedEventAttributes)

-- | The ID of the @DecisionTaskCompleted@ event corresponding to the
-- decision task that resulted in the @StartChildWorkflowExecution@
-- Decision to request this child workflow execution. This information can
-- be useful for diagnosing problems by tracing back the chain of events.
startChildWorkflowExecutionFailedEventAttributes_decisionTaskCompletedEventId :: Lens.Lens' StartChildWorkflowExecutionFailedEventAttributes Prelude.Integer
startChildWorkflowExecutionFailedEventAttributes_decisionTaskCompletedEventId :: (Integer -> f Integer)
-> StartChildWorkflowExecutionFailedEventAttributes
-> f StartChildWorkflowExecutionFailedEventAttributes
startChildWorkflowExecutionFailedEventAttributes_decisionTaskCompletedEventId = (StartChildWorkflowExecutionFailedEventAttributes -> Integer)
-> (StartChildWorkflowExecutionFailedEventAttributes
    -> Integer -> StartChildWorkflowExecutionFailedEventAttributes)
-> Lens
     StartChildWorkflowExecutionFailedEventAttributes
     StartChildWorkflowExecutionFailedEventAttributes
     Integer
     Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChildWorkflowExecutionFailedEventAttributes' {Integer
decisionTaskCompletedEventId :: Integer
$sel:decisionTaskCompletedEventId:StartChildWorkflowExecutionFailedEventAttributes' :: StartChildWorkflowExecutionFailedEventAttributes -> Integer
decisionTaskCompletedEventId} -> Integer
decisionTaskCompletedEventId) (\s :: StartChildWorkflowExecutionFailedEventAttributes
s@StartChildWorkflowExecutionFailedEventAttributes' {} Integer
a -> StartChildWorkflowExecutionFailedEventAttributes
s {$sel:decisionTaskCompletedEventId:StartChildWorkflowExecutionFailedEventAttributes' :: Integer
decisionTaskCompletedEventId = Integer
a} :: StartChildWorkflowExecutionFailedEventAttributes)

instance
  Core.FromJSON
    StartChildWorkflowExecutionFailedEventAttributes
  where
  parseJSON :: Value -> Parser StartChildWorkflowExecutionFailedEventAttributes
parseJSON =
    String
-> (Object
    -> Parser StartChildWorkflowExecutionFailedEventAttributes)
-> Value
-> Parser StartChildWorkflowExecutionFailedEventAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"StartChildWorkflowExecutionFailedEventAttributes"
      ( \Object
x ->
          Maybe Text
-> WorkflowType
-> StartChildWorkflowExecutionFailedCause
-> Text
-> Integer
-> Integer
-> StartChildWorkflowExecutionFailedEventAttributes
StartChildWorkflowExecutionFailedEventAttributes'
            (Maybe Text
 -> WorkflowType
 -> StartChildWorkflowExecutionFailedCause
 -> Text
 -> Integer
 -> Integer
 -> StartChildWorkflowExecutionFailedEventAttributes)
-> Parser (Maybe Text)
-> Parser
     (WorkflowType
      -> StartChildWorkflowExecutionFailedCause
      -> Text
      -> Integer
      -> Integer
      -> StartChildWorkflowExecutionFailedEventAttributes)
forall (f :: * -> *) a b. Functor 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
"control")
              Parser
  (WorkflowType
   -> StartChildWorkflowExecutionFailedCause
   -> Text
   -> Integer
   -> Integer
   -> StartChildWorkflowExecutionFailedEventAttributes)
-> Parser WorkflowType
-> Parser
     (StartChildWorkflowExecutionFailedCause
      -> Text
      -> Integer
      -> Integer
      -> StartChildWorkflowExecutionFailedEventAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser WorkflowType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"workflowType")
              Parser
  (StartChildWorkflowExecutionFailedCause
   -> Text
   -> Integer
   -> Integer
   -> StartChildWorkflowExecutionFailedEventAttributes)
-> Parser StartChildWorkflowExecutionFailedCause
-> Parser
     (Text
      -> Integer
      -> Integer
      -> StartChildWorkflowExecutionFailedEventAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser StartChildWorkflowExecutionFailedCause
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"cause")
              Parser
  (Text
   -> Integer
   -> Integer
   -> StartChildWorkflowExecutionFailedEventAttributes)
-> Parser Text
-> Parser
     (Integer
      -> Integer -> StartChildWorkflowExecutionFailedEventAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"workflowId")
              Parser
  (Integer
   -> Integer -> StartChildWorkflowExecutionFailedEventAttributes)
-> Parser Integer
-> Parser
     (Integer -> StartChildWorkflowExecutionFailedEventAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Integer
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"initiatedEventId")
              Parser
  (Integer -> StartChildWorkflowExecutionFailedEventAttributes)
-> Parser Integer
-> Parser StartChildWorkflowExecutionFailedEventAttributes
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Integer
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"decisionTaskCompletedEventId")
      )

instance
  Prelude.Hashable
    StartChildWorkflowExecutionFailedEventAttributes

instance
  Prelude.NFData
    StartChildWorkflowExecutionFailedEventAttributes