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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides the details of the
-- @RequestCancelExternalWorkflowExecutionInitiated@ event.
--
-- /See:/ 'newRequestCancelExternalWorkflowExecutionInitiatedEventAttributes' smart constructor.
data RequestCancelExternalWorkflowExecutionInitiatedEventAttributes = RequestCancelExternalWorkflowExecutionInitiatedEventAttributes'
  { -- | Data attached to the event that can be used by the decider in subsequent
    -- workflow tasks.
    RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> Maybe Text
control :: Prelude.Maybe Prelude.Text,
    -- | The @runId@ of the external workflow execution to be canceled.
    RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> Maybe Text
runId :: Prelude.Maybe Prelude.Text,
    -- | The @workflowId@ of the external workflow execution to be canceled.
    RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> Text
workflowId :: Prelude.Text,
    -- | 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.
    RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> Integer
decisionTaskCompletedEventId :: Prelude.Integer
  }
  deriving (RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> Bool
(RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
 -> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
 -> Bool)
-> (RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
    -> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
    -> Bool)
-> Eq
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> Bool
$c/= :: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> Bool
== :: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> Bool
$c== :: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> Bool
Prelude.Eq, ReadPrec
  [RequestCancelExternalWorkflowExecutionInitiatedEventAttributes]
ReadPrec
  RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
Int
-> ReadS
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
ReadS
  [RequestCancelExternalWorkflowExecutionInitiatedEventAttributes]
(Int
 -> ReadS
      RequestCancelExternalWorkflowExecutionInitiatedEventAttributes)
-> ReadS
     [RequestCancelExternalWorkflowExecutionInitiatedEventAttributes]
-> ReadPrec
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> ReadPrec
     [RequestCancelExternalWorkflowExecutionInitiatedEventAttributes]
-> Read
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec
  [RequestCancelExternalWorkflowExecutionInitiatedEventAttributes]
$creadListPrec :: ReadPrec
  [RequestCancelExternalWorkflowExecutionInitiatedEventAttributes]
readPrec :: ReadPrec
  RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
$creadPrec :: ReadPrec
  RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
readList :: ReadS
  [RequestCancelExternalWorkflowExecutionInitiatedEventAttributes]
$creadList :: ReadS
  [RequestCancelExternalWorkflowExecutionInitiatedEventAttributes]
readsPrec :: Int
-> ReadS
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
$creadsPrec :: Int
-> ReadS
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
Prelude.Read, Int
-> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> ShowS
[RequestCancelExternalWorkflowExecutionInitiatedEventAttributes]
-> ShowS
RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> String
(Int
 -> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
 -> ShowS)
-> (RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
    -> String)
-> ([RequestCancelExternalWorkflowExecutionInitiatedEventAttributes]
    -> ShowS)
-> Show
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RequestCancelExternalWorkflowExecutionInitiatedEventAttributes]
-> ShowS
$cshowList :: [RequestCancelExternalWorkflowExecutionInitiatedEventAttributes]
-> ShowS
show :: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> String
$cshow :: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> String
showsPrec :: Int
-> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> ShowS
$cshowsPrec :: Int
-> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> ShowS
Prelude.Show, (forall x.
 RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
 -> Rep
      RequestCancelExternalWorkflowExecutionInitiatedEventAttributes x)
-> (forall x.
    Rep
      RequestCancelExternalWorkflowExecutionInitiatedEventAttributes x
    -> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes)
-> Generic
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
forall x.
Rep
  RequestCancelExternalWorkflowExecutionInitiatedEventAttributes x
-> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
forall x.
RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> Rep
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep
  RequestCancelExternalWorkflowExecutionInitiatedEventAttributes x
-> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
$cfrom :: forall x.
RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> Rep
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes x
Prelude.Generic)

-- |
-- Create a value of 'RequestCancelExternalWorkflowExecutionInitiatedEventAttributes' 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', 'requestCancelExternalWorkflowExecutionInitiatedEventAttributes_control' - Data attached to the event that can be used by the decider in subsequent
-- workflow tasks.
--
-- 'runId', 'requestCancelExternalWorkflowExecutionInitiatedEventAttributes_runId' - The @runId@ of the external workflow execution to be canceled.
--
-- 'workflowId', 'requestCancelExternalWorkflowExecutionInitiatedEventAttributes_workflowId' - The @workflowId@ of the external workflow execution to be canceled.
--
-- 'decisionTaskCompletedEventId', 'requestCancelExternalWorkflowExecutionInitiatedEventAttributes_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.
newRequestCancelExternalWorkflowExecutionInitiatedEventAttributes ::
  -- | 'workflowId'
  Prelude.Text ->
  -- | 'decisionTaskCompletedEventId'
  Prelude.Integer ->
  RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
newRequestCancelExternalWorkflowExecutionInitiatedEventAttributes :: Text
-> Integer
-> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
newRequestCancelExternalWorkflowExecutionInitiatedEventAttributes
  Text
pWorkflowId_
  Integer
pDecisionTaskCompletedEventId_ =
    RequestCancelExternalWorkflowExecutionInitiatedEventAttributes' :: Maybe Text
-> Maybe Text
-> Text
-> Integer
-> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
RequestCancelExternalWorkflowExecutionInitiatedEventAttributes'
      { $sel:control:RequestCancelExternalWorkflowExecutionInitiatedEventAttributes' :: Maybe Text
control =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:runId:RequestCancelExternalWorkflowExecutionInitiatedEventAttributes' :: Maybe Text
runId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:workflowId:RequestCancelExternalWorkflowExecutionInitiatedEventAttributes' :: Text
workflowId =
          Text
pWorkflowId_,
        $sel:decisionTaskCompletedEventId:RequestCancelExternalWorkflowExecutionInitiatedEventAttributes' :: Integer
decisionTaskCompletedEventId =
          Integer
pDecisionTaskCompletedEventId_
      }

-- | Data attached to the event that can be used by the decider in subsequent
-- workflow tasks.
requestCancelExternalWorkflowExecutionInitiatedEventAttributes_control :: Lens.Lens' RequestCancelExternalWorkflowExecutionInitiatedEventAttributes (Prelude.Maybe Prelude.Text)
requestCancelExternalWorkflowExecutionInitiatedEventAttributes_control :: (Maybe Text -> f (Maybe Text))
-> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> f RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
requestCancelExternalWorkflowExecutionInitiatedEventAttributes_control = (RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
 -> Maybe Text)
-> (RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
    -> Maybe Text
    -> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes)
-> Lens
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCancelExternalWorkflowExecutionInitiatedEventAttributes' {Maybe Text
control :: Maybe Text
$sel:control:RequestCancelExternalWorkflowExecutionInitiatedEventAttributes' :: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> Maybe Text
control} -> Maybe Text
control) (\s :: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
s@RequestCancelExternalWorkflowExecutionInitiatedEventAttributes' {} Maybe Text
a -> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
s {$sel:control:RequestCancelExternalWorkflowExecutionInitiatedEventAttributes' :: Maybe Text
control = Maybe Text
a} :: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes)

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

-- | The @workflowId@ of the external workflow execution to be canceled.
requestCancelExternalWorkflowExecutionInitiatedEventAttributes_workflowId :: Lens.Lens' RequestCancelExternalWorkflowExecutionInitiatedEventAttributes Prelude.Text
requestCancelExternalWorkflowExecutionInitiatedEventAttributes_workflowId :: (Text -> f Text)
-> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> f RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
requestCancelExternalWorkflowExecutionInitiatedEventAttributes_workflowId = (RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
 -> Text)
-> (RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
    -> Text
    -> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes)
-> Lens
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCancelExternalWorkflowExecutionInitiatedEventAttributes' {Text
workflowId :: Text
$sel:workflowId:RequestCancelExternalWorkflowExecutionInitiatedEventAttributes' :: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> Text
workflowId} -> Text
workflowId) (\s :: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
s@RequestCancelExternalWorkflowExecutionInitiatedEventAttributes' {} Text
a -> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
s {$sel:workflowId:RequestCancelExternalWorkflowExecutionInitiatedEventAttributes' :: Text
workflowId = Text
a} :: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes)

-- | 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.
requestCancelExternalWorkflowExecutionInitiatedEventAttributes_decisionTaskCompletedEventId :: Lens.Lens' RequestCancelExternalWorkflowExecutionInitiatedEventAttributes Prelude.Integer
requestCancelExternalWorkflowExecutionInitiatedEventAttributes_decisionTaskCompletedEventId :: (Integer -> f Integer)
-> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> f RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
requestCancelExternalWorkflowExecutionInitiatedEventAttributes_decisionTaskCompletedEventId = (RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
 -> Integer)
-> (RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
    -> Integer
    -> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes)
-> Lens
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
     Integer
     Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCancelExternalWorkflowExecutionInitiatedEventAttributes' {Integer
decisionTaskCompletedEventId :: Integer
$sel:decisionTaskCompletedEventId:RequestCancelExternalWorkflowExecutionInitiatedEventAttributes' :: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
-> Integer
decisionTaskCompletedEventId} -> Integer
decisionTaskCompletedEventId) (\s :: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
s@RequestCancelExternalWorkflowExecutionInitiatedEventAttributes' {} Integer
a -> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
s {$sel:decisionTaskCompletedEventId:RequestCancelExternalWorkflowExecutionInitiatedEventAttributes' :: Integer
decisionTaskCompletedEventId = Integer
a} :: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes)

instance
  Core.FromJSON
    RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
  where
  parseJSON :: Value
-> Parser
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
parseJSON =
    String
-> (Object
    -> Parser
         RequestCancelExternalWorkflowExecutionInitiatedEventAttributes)
-> Value
-> Parser
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RequestCancelExternalWorkflowExecutionInitiatedEventAttributes"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Text
-> Integer
-> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
RequestCancelExternalWorkflowExecutionInitiatedEventAttributes'
            (Maybe Text
 -> Maybe Text
 -> Text
 -> Integer
 -> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Text
      -> Integer
      -> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes)
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
   -> Integer
   -> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes)
-> Parser (Maybe Text)
-> Parser
     (Text
      -> Integer
      -> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes)
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
   -> Integer
   -> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes)
-> Parser Text
-> Parser
     (Integer
      -> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes)
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
   -> RequestCancelExternalWorkflowExecutionInitiatedEventAttributes)
-> Parser Integer
-> Parser
     RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
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
    RequestCancelExternalWorkflowExecutionInitiatedEventAttributes

instance
  Prelude.NFData
    RequestCancelExternalWorkflowExecutionInitiatedEventAttributes