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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SWF.Types.RequestCancelExternalWorkflowExecutionFailedCause

-- | Provides the details of the
-- @RequestCancelExternalWorkflowExecutionFailed@ event.
--
-- /See:/ 'newRequestCancelExternalWorkflowExecutionFailedEventAttributes' smart constructor.
data RequestCancelExternalWorkflowExecutionFailedEventAttributes = RequestCancelExternalWorkflowExecutionFailedEventAttributes'
  { -- | The data attached to the event that the decider can use in subsequent
    -- workflow tasks. This data isn\'t sent to the workflow execution.
    RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> Maybe Text
control :: Prelude.Maybe Prelude.Text,
    -- | The @runId@ of the external workflow execution.
    RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> Maybe Text
runId :: Prelude.Maybe Prelude.Text,
    -- | The @workflowId@ of the external workflow to which the cancel request
    -- was to be delivered.
    RequestCancelExternalWorkflowExecutionFailedEventAttributes -> Text
workflowId :: Prelude.Text,
    -- | The cause of the failure. This information is generated by the system
    -- and can be useful for diagnostic purposes.
    --
    -- If @cause@ is set to @OPERATION_NOT_PERMITTED@, the decision failed
    -- because it lacked 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/.
    RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> RequestCancelExternalWorkflowExecutionFailedCause
cause :: RequestCancelExternalWorkflowExecutionFailedCause,
    -- | The ID of the @RequestCancelExternalWorkflowExecutionInitiated@ event
    -- corresponding to the @RequestCancelExternalWorkflowExecution@ decision
    -- to cancel this external workflow execution. This information can be
    -- useful for diagnosing problems by tracing back the chain of events
    -- leading up to this event.
    RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> Integer
initiatedEventId :: Prelude.Integer,
    -- | The ID of the @DecisionTaskCompleted@ event corresponding to the
    -- decision task that resulted in the
    -- @RequestCancelExternalWorkflowExecution@ decision for this cancellation
    -- request. This information can be useful for diagnosing problems by
    -- tracing back the chain of events leading up to this event.
    RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> Integer
decisionTaskCompletedEventId :: Prelude.Integer
  }
  deriving (RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> Bool
(RequestCancelExternalWorkflowExecutionFailedEventAttributes
 -> RequestCancelExternalWorkflowExecutionFailedEventAttributes
 -> Bool)
-> (RequestCancelExternalWorkflowExecutionFailedEventAttributes
    -> RequestCancelExternalWorkflowExecutionFailedEventAttributes
    -> Bool)
-> Eq RequestCancelExternalWorkflowExecutionFailedEventAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> Bool
$c/= :: RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> Bool
== :: RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> Bool
$c== :: RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> Bool
Prelude.Eq, ReadPrec
  [RequestCancelExternalWorkflowExecutionFailedEventAttributes]
ReadPrec
  RequestCancelExternalWorkflowExecutionFailedEventAttributes
Int
-> ReadS
     RequestCancelExternalWorkflowExecutionFailedEventAttributes
ReadS [RequestCancelExternalWorkflowExecutionFailedEventAttributes]
(Int
 -> ReadS
      RequestCancelExternalWorkflowExecutionFailedEventAttributes)
-> ReadS
     [RequestCancelExternalWorkflowExecutionFailedEventAttributes]
-> ReadPrec
     RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> ReadPrec
     [RequestCancelExternalWorkflowExecutionFailedEventAttributes]
-> Read RequestCancelExternalWorkflowExecutionFailedEventAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec
  [RequestCancelExternalWorkflowExecutionFailedEventAttributes]
$creadListPrec :: ReadPrec
  [RequestCancelExternalWorkflowExecutionFailedEventAttributes]
readPrec :: ReadPrec
  RequestCancelExternalWorkflowExecutionFailedEventAttributes
$creadPrec :: ReadPrec
  RequestCancelExternalWorkflowExecutionFailedEventAttributes
readList :: ReadS [RequestCancelExternalWorkflowExecutionFailedEventAttributes]
$creadList :: ReadS [RequestCancelExternalWorkflowExecutionFailedEventAttributes]
readsPrec :: Int
-> ReadS
     RequestCancelExternalWorkflowExecutionFailedEventAttributes
$creadsPrec :: Int
-> ReadS
     RequestCancelExternalWorkflowExecutionFailedEventAttributes
Prelude.Read, Int
-> RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> ShowS
[RequestCancelExternalWorkflowExecutionFailedEventAttributes]
-> ShowS
RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> String
(Int
 -> RequestCancelExternalWorkflowExecutionFailedEventAttributes
 -> ShowS)
-> (RequestCancelExternalWorkflowExecutionFailedEventAttributes
    -> String)
-> ([RequestCancelExternalWorkflowExecutionFailedEventAttributes]
    -> ShowS)
-> Show RequestCancelExternalWorkflowExecutionFailedEventAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RequestCancelExternalWorkflowExecutionFailedEventAttributes]
-> ShowS
$cshowList :: [RequestCancelExternalWorkflowExecutionFailedEventAttributes]
-> ShowS
show :: RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> String
$cshow :: RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> String
showsPrec :: Int
-> RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> ShowS
$cshowsPrec :: Int
-> RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> ShowS
Prelude.Show, (forall x.
 RequestCancelExternalWorkflowExecutionFailedEventAttributes
 -> Rep
      RequestCancelExternalWorkflowExecutionFailedEventAttributes x)
-> (forall x.
    Rep RequestCancelExternalWorkflowExecutionFailedEventAttributes x
    -> RequestCancelExternalWorkflowExecutionFailedEventAttributes)
-> Generic
     RequestCancelExternalWorkflowExecutionFailedEventAttributes
forall x.
Rep RequestCancelExternalWorkflowExecutionFailedEventAttributes x
-> RequestCancelExternalWorkflowExecutionFailedEventAttributes
forall x.
RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> Rep
     RequestCancelExternalWorkflowExecutionFailedEventAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RequestCancelExternalWorkflowExecutionFailedEventAttributes x
-> RequestCancelExternalWorkflowExecutionFailedEventAttributes
$cfrom :: forall x.
RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> Rep
     RequestCancelExternalWorkflowExecutionFailedEventAttributes x
Prelude.Generic)

-- |
-- Create a value of 'RequestCancelExternalWorkflowExecutionFailedEventAttributes' 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', 'requestCancelExternalWorkflowExecutionFailedEventAttributes_control' - The data attached to the event that the decider can use in subsequent
-- workflow tasks. This data isn\'t sent to the workflow execution.
--
-- 'runId', 'requestCancelExternalWorkflowExecutionFailedEventAttributes_runId' - The @runId@ of the external workflow execution.
--
-- 'workflowId', 'requestCancelExternalWorkflowExecutionFailedEventAttributes_workflowId' - The @workflowId@ of the external workflow to which the cancel request
-- was to be delivered.
--
-- 'cause', 'requestCancelExternalWorkflowExecutionFailedEventAttributes_cause' - The cause of the failure. This information is generated by the system
-- and can be useful for diagnostic purposes.
--
-- If @cause@ is set to @OPERATION_NOT_PERMITTED@, the decision failed
-- because it lacked 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/.
--
-- 'initiatedEventId', 'requestCancelExternalWorkflowExecutionFailedEventAttributes_initiatedEventId' - The ID of the @RequestCancelExternalWorkflowExecutionInitiated@ event
-- corresponding to the @RequestCancelExternalWorkflowExecution@ decision
-- to cancel this external workflow execution. This information can be
-- useful for diagnosing problems by tracing back the chain of events
-- leading up to this event.
--
-- 'decisionTaskCompletedEventId', 'requestCancelExternalWorkflowExecutionFailedEventAttributes_decisionTaskCompletedEventId' - The ID of the @DecisionTaskCompleted@ event corresponding to the
-- decision task that resulted in the
-- @RequestCancelExternalWorkflowExecution@ decision for this cancellation
-- request. This information can be useful for diagnosing problems by
-- tracing back the chain of events leading up to this event.
newRequestCancelExternalWorkflowExecutionFailedEventAttributes ::
  -- | 'workflowId'
  Prelude.Text ->
  -- | 'cause'
  RequestCancelExternalWorkflowExecutionFailedCause ->
  -- | 'initiatedEventId'
  Prelude.Integer ->
  -- | 'decisionTaskCompletedEventId'
  Prelude.Integer ->
  RequestCancelExternalWorkflowExecutionFailedEventAttributes
newRequestCancelExternalWorkflowExecutionFailedEventAttributes :: Text
-> RequestCancelExternalWorkflowExecutionFailedCause
-> Integer
-> Integer
-> RequestCancelExternalWorkflowExecutionFailedEventAttributes
newRequestCancelExternalWorkflowExecutionFailedEventAttributes
  Text
pWorkflowId_
  RequestCancelExternalWorkflowExecutionFailedCause
pCause_
  Integer
pInitiatedEventId_
  Integer
pDecisionTaskCompletedEventId_ =
    RequestCancelExternalWorkflowExecutionFailedEventAttributes' :: Maybe Text
-> Maybe Text
-> Text
-> RequestCancelExternalWorkflowExecutionFailedCause
-> Integer
-> Integer
-> RequestCancelExternalWorkflowExecutionFailedEventAttributes
RequestCancelExternalWorkflowExecutionFailedEventAttributes'
      { $sel:control:RequestCancelExternalWorkflowExecutionFailedEventAttributes' :: Maybe Text
control =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:runId:RequestCancelExternalWorkflowExecutionFailedEventAttributes' :: Maybe Text
runId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:workflowId:RequestCancelExternalWorkflowExecutionFailedEventAttributes' :: Text
workflowId =
          Text
pWorkflowId_,
        $sel:cause:RequestCancelExternalWorkflowExecutionFailedEventAttributes' :: RequestCancelExternalWorkflowExecutionFailedCause
cause =
          RequestCancelExternalWorkflowExecutionFailedCause
pCause_,
        $sel:initiatedEventId:RequestCancelExternalWorkflowExecutionFailedEventAttributes' :: Integer
initiatedEventId =
          Integer
pInitiatedEventId_,
        $sel:decisionTaskCompletedEventId:RequestCancelExternalWorkflowExecutionFailedEventAttributes' :: 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 workflow execution.
requestCancelExternalWorkflowExecutionFailedEventAttributes_control :: Lens.Lens' RequestCancelExternalWorkflowExecutionFailedEventAttributes (Prelude.Maybe Prelude.Text)
requestCancelExternalWorkflowExecutionFailedEventAttributes_control :: (Maybe Text -> f (Maybe Text))
-> RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> f RequestCancelExternalWorkflowExecutionFailedEventAttributes
requestCancelExternalWorkflowExecutionFailedEventAttributes_control = (RequestCancelExternalWorkflowExecutionFailedEventAttributes
 -> Maybe Text)
-> (RequestCancelExternalWorkflowExecutionFailedEventAttributes
    -> Maybe Text
    -> RequestCancelExternalWorkflowExecutionFailedEventAttributes)
-> Lens
     RequestCancelExternalWorkflowExecutionFailedEventAttributes
     RequestCancelExternalWorkflowExecutionFailedEventAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCancelExternalWorkflowExecutionFailedEventAttributes' {Maybe Text
control :: Maybe Text
$sel:control:RequestCancelExternalWorkflowExecutionFailedEventAttributes' :: RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> Maybe Text
control} -> Maybe Text
control) (\s :: RequestCancelExternalWorkflowExecutionFailedEventAttributes
s@RequestCancelExternalWorkflowExecutionFailedEventAttributes' {} Maybe Text
a -> RequestCancelExternalWorkflowExecutionFailedEventAttributes
s {$sel:control:RequestCancelExternalWorkflowExecutionFailedEventAttributes' :: Maybe Text
control = Maybe Text
a} :: RequestCancelExternalWorkflowExecutionFailedEventAttributes)

-- | The @runId@ of the external workflow execution.
requestCancelExternalWorkflowExecutionFailedEventAttributes_runId :: Lens.Lens' RequestCancelExternalWorkflowExecutionFailedEventAttributes (Prelude.Maybe Prelude.Text)
requestCancelExternalWorkflowExecutionFailedEventAttributes_runId :: (Maybe Text -> f (Maybe Text))
-> RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> f RequestCancelExternalWorkflowExecutionFailedEventAttributes
requestCancelExternalWorkflowExecutionFailedEventAttributes_runId = (RequestCancelExternalWorkflowExecutionFailedEventAttributes
 -> Maybe Text)
-> (RequestCancelExternalWorkflowExecutionFailedEventAttributes
    -> Maybe Text
    -> RequestCancelExternalWorkflowExecutionFailedEventAttributes)
-> Lens
     RequestCancelExternalWorkflowExecutionFailedEventAttributes
     RequestCancelExternalWorkflowExecutionFailedEventAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCancelExternalWorkflowExecutionFailedEventAttributes' {Maybe Text
runId :: Maybe Text
$sel:runId:RequestCancelExternalWorkflowExecutionFailedEventAttributes' :: RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> Maybe Text
runId} -> Maybe Text
runId) (\s :: RequestCancelExternalWorkflowExecutionFailedEventAttributes
s@RequestCancelExternalWorkflowExecutionFailedEventAttributes' {} Maybe Text
a -> RequestCancelExternalWorkflowExecutionFailedEventAttributes
s {$sel:runId:RequestCancelExternalWorkflowExecutionFailedEventAttributes' :: Maybe Text
runId = Maybe Text
a} :: RequestCancelExternalWorkflowExecutionFailedEventAttributes)

-- | The @workflowId@ of the external workflow to which the cancel request
-- was to be delivered.
requestCancelExternalWorkflowExecutionFailedEventAttributes_workflowId :: Lens.Lens' RequestCancelExternalWorkflowExecutionFailedEventAttributes Prelude.Text
requestCancelExternalWorkflowExecutionFailedEventAttributes_workflowId :: (Text -> f Text)
-> RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> f RequestCancelExternalWorkflowExecutionFailedEventAttributes
requestCancelExternalWorkflowExecutionFailedEventAttributes_workflowId = (RequestCancelExternalWorkflowExecutionFailedEventAttributes
 -> Text)
-> (RequestCancelExternalWorkflowExecutionFailedEventAttributes
    -> Text
    -> RequestCancelExternalWorkflowExecutionFailedEventAttributes)
-> Lens
     RequestCancelExternalWorkflowExecutionFailedEventAttributes
     RequestCancelExternalWorkflowExecutionFailedEventAttributes
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCancelExternalWorkflowExecutionFailedEventAttributes' {Text
workflowId :: Text
$sel:workflowId:RequestCancelExternalWorkflowExecutionFailedEventAttributes' :: RequestCancelExternalWorkflowExecutionFailedEventAttributes -> Text
workflowId} -> Text
workflowId) (\s :: RequestCancelExternalWorkflowExecutionFailedEventAttributes
s@RequestCancelExternalWorkflowExecutionFailedEventAttributes' {} Text
a -> RequestCancelExternalWorkflowExecutionFailedEventAttributes
s {$sel:workflowId:RequestCancelExternalWorkflowExecutionFailedEventAttributes' :: Text
workflowId = Text
a} :: RequestCancelExternalWorkflowExecutionFailedEventAttributes)

-- | The cause of the failure. This information is generated by the system
-- and can be useful for diagnostic purposes.
--
-- If @cause@ is set to @OPERATION_NOT_PERMITTED@, the decision failed
-- because it lacked 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/.
requestCancelExternalWorkflowExecutionFailedEventAttributes_cause :: Lens.Lens' RequestCancelExternalWorkflowExecutionFailedEventAttributes RequestCancelExternalWorkflowExecutionFailedCause
requestCancelExternalWorkflowExecutionFailedEventAttributes_cause :: (RequestCancelExternalWorkflowExecutionFailedCause
 -> f RequestCancelExternalWorkflowExecutionFailedCause)
-> RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> f RequestCancelExternalWorkflowExecutionFailedEventAttributes
requestCancelExternalWorkflowExecutionFailedEventAttributes_cause = (RequestCancelExternalWorkflowExecutionFailedEventAttributes
 -> RequestCancelExternalWorkflowExecutionFailedCause)
-> (RequestCancelExternalWorkflowExecutionFailedEventAttributes
    -> RequestCancelExternalWorkflowExecutionFailedCause
    -> RequestCancelExternalWorkflowExecutionFailedEventAttributes)
-> Lens
     RequestCancelExternalWorkflowExecutionFailedEventAttributes
     RequestCancelExternalWorkflowExecutionFailedEventAttributes
     RequestCancelExternalWorkflowExecutionFailedCause
     RequestCancelExternalWorkflowExecutionFailedCause
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCancelExternalWorkflowExecutionFailedEventAttributes' {RequestCancelExternalWorkflowExecutionFailedCause
cause :: RequestCancelExternalWorkflowExecutionFailedCause
$sel:cause:RequestCancelExternalWorkflowExecutionFailedEventAttributes' :: RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> RequestCancelExternalWorkflowExecutionFailedCause
cause} -> RequestCancelExternalWorkflowExecutionFailedCause
cause) (\s :: RequestCancelExternalWorkflowExecutionFailedEventAttributes
s@RequestCancelExternalWorkflowExecutionFailedEventAttributes' {} RequestCancelExternalWorkflowExecutionFailedCause
a -> RequestCancelExternalWorkflowExecutionFailedEventAttributes
s {$sel:cause:RequestCancelExternalWorkflowExecutionFailedEventAttributes' :: RequestCancelExternalWorkflowExecutionFailedCause
cause = RequestCancelExternalWorkflowExecutionFailedCause
a} :: RequestCancelExternalWorkflowExecutionFailedEventAttributes)

-- | The ID of the @RequestCancelExternalWorkflowExecutionInitiated@ event
-- corresponding to the @RequestCancelExternalWorkflowExecution@ decision
-- to cancel this external workflow execution. This information can be
-- useful for diagnosing problems by tracing back the chain of events
-- leading up to this event.
requestCancelExternalWorkflowExecutionFailedEventAttributes_initiatedEventId :: Lens.Lens' RequestCancelExternalWorkflowExecutionFailedEventAttributes Prelude.Integer
requestCancelExternalWorkflowExecutionFailedEventAttributes_initiatedEventId :: (Integer -> f Integer)
-> RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> f RequestCancelExternalWorkflowExecutionFailedEventAttributes
requestCancelExternalWorkflowExecutionFailedEventAttributes_initiatedEventId = (RequestCancelExternalWorkflowExecutionFailedEventAttributes
 -> Integer)
-> (RequestCancelExternalWorkflowExecutionFailedEventAttributes
    -> Integer
    -> RequestCancelExternalWorkflowExecutionFailedEventAttributes)
-> Lens
     RequestCancelExternalWorkflowExecutionFailedEventAttributes
     RequestCancelExternalWorkflowExecutionFailedEventAttributes
     Integer
     Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCancelExternalWorkflowExecutionFailedEventAttributes' {Integer
initiatedEventId :: Integer
$sel:initiatedEventId:RequestCancelExternalWorkflowExecutionFailedEventAttributes' :: RequestCancelExternalWorkflowExecutionFailedEventAttributes
-> Integer
initiatedEventId} -> Integer
initiatedEventId) (\s :: RequestCancelExternalWorkflowExecutionFailedEventAttributes
s@RequestCancelExternalWorkflowExecutionFailedEventAttributes' {} Integer
a -> RequestCancelExternalWorkflowExecutionFailedEventAttributes
s {$sel:initiatedEventId:RequestCancelExternalWorkflowExecutionFailedEventAttributes' :: Integer
initiatedEventId = Integer
a} :: RequestCancelExternalWorkflowExecutionFailedEventAttributes)

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

instance
  Core.FromJSON
    RequestCancelExternalWorkflowExecutionFailedEventAttributes
  where
  parseJSON :: Value
-> Parser
     RequestCancelExternalWorkflowExecutionFailedEventAttributes
parseJSON =
    String
-> (Object
    -> Parser
         RequestCancelExternalWorkflowExecutionFailedEventAttributes)
-> Value
-> Parser
     RequestCancelExternalWorkflowExecutionFailedEventAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RequestCancelExternalWorkflowExecutionFailedEventAttributes"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Text
-> RequestCancelExternalWorkflowExecutionFailedCause
-> Integer
-> Integer
-> RequestCancelExternalWorkflowExecutionFailedEventAttributes
RequestCancelExternalWorkflowExecutionFailedEventAttributes'
            (Maybe Text
 -> Maybe Text
 -> Text
 -> RequestCancelExternalWorkflowExecutionFailedCause
 -> Integer
 -> Integer
 -> RequestCancelExternalWorkflowExecutionFailedEventAttributes)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Text
      -> RequestCancelExternalWorkflowExecutionFailedCause
      -> Integer
      -> Integer
      -> RequestCancelExternalWorkflowExecutionFailedEventAttributes)
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
  (Maybe Text
   -> Text
   -> RequestCancelExternalWorkflowExecutionFailedCause
   -> Integer
   -> Integer
   -> RequestCancelExternalWorkflowExecutionFailedEventAttributes)
-> Parser (Maybe Text)
-> Parser
     (Text
      -> RequestCancelExternalWorkflowExecutionFailedCause
      -> Integer
      -> Integer
      -> RequestCancelExternalWorkflowExecutionFailedEventAttributes)
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
"runId")
              Parser
  (Text
   -> RequestCancelExternalWorkflowExecutionFailedCause
   -> Integer
   -> Integer
   -> RequestCancelExternalWorkflowExecutionFailedEventAttributes)
-> Parser Text
-> Parser
     (RequestCancelExternalWorkflowExecutionFailedCause
      -> Integer
      -> Integer
      -> RequestCancelExternalWorkflowExecutionFailedEventAttributes)
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
  (RequestCancelExternalWorkflowExecutionFailedCause
   -> Integer
   -> Integer
   -> RequestCancelExternalWorkflowExecutionFailedEventAttributes)
-> Parser RequestCancelExternalWorkflowExecutionFailedCause
-> Parser
     (Integer
      -> Integer
      -> RequestCancelExternalWorkflowExecutionFailedEventAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser RequestCancelExternalWorkflowExecutionFailedCause
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"cause")
              Parser
  (Integer
   -> Integer
   -> RequestCancelExternalWorkflowExecutionFailedEventAttributes)
-> Parser Integer
-> Parser
     (Integer
      -> RequestCancelExternalWorkflowExecutionFailedEventAttributes)
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
   -> RequestCancelExternalWorkflowExecutionFailedEventAttributes)
-> Parser Integer
-> Parser
     RequestCancelExternalWorkflowExecutionFailedEventAttributes
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
    RequestCancelExternalWorkflowExecutionFailedEventAttributes

instance
  Prelude.NFData
    RequestCancelExternalWorkflowExecutionFailedEventAttributes