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

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

-- | Provides the details of the @ActivityTaskCancelRequested@ event.
--
-- /See:/ 'newActivityTaskCancelRequestedEventAttributes' smart constructor.
data ActivityTaskCancelRequestedEventAttributes = ActivityTaskCancelRequestedEventAttributes'
  { -- | The ID of the @DecisionTaskCompleted@ event corresponding to the
    -- decision task that resulted in the @RequestCancelActivityTask@ 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.
    ActivityTaskCancelRequestedEventAttributes -> Integer
decisionTaskCompletedEventId :: Prelude.Integer,
    -- | The unique ID of the task.
    ActivityTaskCancelRequestedEventAttributes -> Text
activityId :: Prelude.Text
  }
  deriving (ActivityTaskCancelRequestedEventAttributes
-> ActivityTaskCancelRequestedEventAttributes -> Bool
(ActivityTaskCancelRequestedEventAttributes
 -> ActivityTaskCancelRequestedEventAttributes -> Bool)
-> (ActivityTaskCancelRequestedEventAttributes
    -> ActivityTaskCancelRequestedEventAttributes -> Bool)
-> Eq ActivityTaskCancelRequestedEventAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActivityTaskCancelRequestedEventAttributes
-> ActivityTaskCancelRequestedEventAttributes -> Bool
$c/= :: ActivityTaskCancelRequestedEventAttributes
-> ActivityTaskCancelRequestedEventAttributes -> Bool
== :: ActivityTaskCancelRequestedEventAttributes
-> ActivityTaskCancelRequestedEventAttributes -> Bool
$c== :: ActivityTaskCancelRequestedEventAttributes
-> ActivityTaskCancelRequestedEventAttributes -> Bool
Prelude.Eq, ReadPrec [ActivityTaskCancelRequestedEventAttributes]
ReadPrec ActivityTaskCancelRequestedEventAttributes
Int -> ReadS ActivityTaskCancelRequestedEventAttributes
ReadS [ActivityTaskCancelRequestedEventAttributes]
(Int -> ReadS ActivityTaskCancelRequestedEventAttributes)
-> ReadS [ActivityTaskCancelRequestedEventAttributes]
-> ReadPrec ActivityTaskCancelRequestedEventAttributes
-> ReadPrec [ActivityTaskCancelRequestedEventAttributes]
-> Read ActivityTaskCancelRequestedEventAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActivityTaskCancelRequestedEventAttributes]
$creadListPrec :: ReadPrec [ActivityTaskCancelRequestedEventAttributes]
readPrec :: ReadPrec ActivityTaskCancelRequestedEventAttributes
$creadPrec :: ReadPrec ActivityTaskCancelRequestedEventAttributes
readList :: ReadS [ActivityTaskCancelRequestedEventAttributes]
$creadList :: ReadS [ActivityTaskCancelRequestedEventAttributes]
readsPrec :: Int -> ReadS ActivityTaskCancelRequestedEventAttributes
$creadsPrec :: Int -> ReadS ActivityTaskCancelRequestedEventAttributes
Prelude.Read, Int -> ActivityTaskCancelRequestedEventAttributes -> ShowS
[ActivityTaskCancelRequestedEventAttributes] -> ShowS
ActivityTaskCancelRequestedEventAttributes -> String
(Int -> ActivityTaskCancelRequestedEventAttributes -> ShowS)
-> (ActivityTaskCancelRequestedEventAttributes -> String)
-> ([ActivityTaskCancelRequestedEventAttributes] -> ShowS)
-> Show ActivityTaskCancelRequestedEventAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActivityTaskCancelRequestedEventAttributes] -> ShowS
$cshowList :: [ActivityTaskCancelRequestedEventAttributes] -> ShowS
show :: ActivityTaskCancelRequestedEventAttributes -> String
$cshow :: ActivityTaskCancelRequestedEventAttributes -> String
showsPrec :: Int -> ActivityTaskCancelRequestedEventAttributes -> ShowS
$cshowsPrec :: Int -> ActivityTaskCancelRequestedEventAttributes -> ShowS
Prelude.Show, (forall x.
 ActivityTaskCancelRequestedEventAttributes
 -> Rep ActivityTaskCancelRequestedEventAttributes x)
-> (forall x.
    Rep ActivityTaskCancelRequestedEventAttributes x
    -> ActivityTaskCancelRequestedEventAttributes)
-> Generic ActivityTaskCancelRequestedEventAttributes
forall x.
Rep ActivityTaskCancelRequestedEventAttributes x
-> ActivityTaskCancelRequestedEventAttributes
forall x.
ActivityTaskCancelRequestedEventAttributes
-> Rep ActivityTaskCancelRequestedEventAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ActivityTaskCancelRequestedEventAttributes x
-> ActivityTaskCancelRequestedEventAttributes
$cfrom :: forall x.
ActivityTaskCancelRequestedEventAttributes
-> Rep ActivityTaskCancelRequestedEventAttributes x
Prelude.Generic)

-- |
-- Create a value of 'ActivityTaskCancelRequestedEventAttributes' 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:
--
-- 'decisionTaskCompletedEventId', 'activityTaskCancelRequestedEventAttributes_decisionTaskCompletedEventId' - The ID of the @DecisionTaskCompleted@ event corresponding to the
-- decision task that resulted in the @RequestCancelActivityTask@ 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.
--
-- 'activityId', 'activityTaskCancelRequestedEventAttributes_activityId' - The unique ID of the task.
newActivityTaskCancelRequestedEventAttributes ::
  -- | 'decisionTaskCompletedEventId'
  Prelude.Integer ->
  -- | 'activityId'
  Prelude.Text ->
  ActivityTaskCancelRequestedEventAttributes
newActivityTaskCancelRequestedEventAttributes :: Integer -> Text -> ActivityTaskCancelRequestedEventAttributes
newActivityTaskCancelRequestedEventAttributes
  Integer
pDecisionTaskCompletedEventId_
  Text
pActivityId_ =
    ActivityTaskCancelRequestedEventAttributes' :: Integer -> Text -> ActivityTaskCancelRequestedEventAttributes
ActivityTaskCancelRequestedEventAttributes'
      { $sel:decisionTaskCompletedEventId:ActivityTaskCancelRequestedEventAttributes' :: Integer
decisionTaskCompletedEventId =
          Integer
pDecisionTaskCompletedEventId_,
        $sel:activityId:ActivityTaskCancelRequestedEventAttributes' :: Text
activityId = Text
pActivityId_
      }

-- | The ID of the @DecisionTaskCompleted@ event corresponding to the
-- decision task that resulted in the @RequestCancelActivityTask@ 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.
activityTaskCancelRequestedEventAttributes_decisionTaskCompletedEventId :: Lens.Lens' ActivityTaskCancelRequestedEventAttributes Prelude.Integer
activityTaskCancelRequestedEventAttributes_decisionTaskCompletedEventId :: (Integer -> f Integer)
-> ActivityTaskCancelRequestedEventAttributes
-> f ActivityTaskCancelRequestedEventAttributes
activityTaskCancelRequestedEventAttributes_decisionTaskCompletedEventId = (ActivityTaskCancelRequestedEventAttributes -> Integer)
-> (ActivityTaskCancelRequestedEventAttributes
    -> Integer -> ActivityTaskCancelRequestedEventAttributes)
-> Lens
     ActivityTaskCancelRequestedEventAttributes
     ActivityTaskCancelRequestedEventAttributes
     Integer
     Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityTaskCancelRequestedEventAttributes' {Integer
decisionTaskCompletedEventId :: Integer
$sel:decisionTaskCompletedEventId:ActivityTaskCancelRequestedEventAttributes' :: ActivityTaskCancelRequestedEventAttributes -> Integer
decisionTaskCompletedEventId} -> Integer
decisionTaskCompletedEventId) (\s :: ActivityTaskCancelRequestedEventAttributes
s@ActivityTaskCancelRequestedEventAttributes' {} Integer
a -> ActivityTaskCancelRequestedEventAttributes
s {$sel:decisionTaskCompletedEventId:ActivityTaskCancelRequestedEventAttributes' :: Integer
decisionTaskCompletedEventId = Integer
a} :: ActivityTaskCancelRequestedEventAttributes)

-- | The unique ID of the task.
activityTaskCancelRequestedEventAttributes_activityId :: Lens.Lens' ActivityTaskCancelRequestedEventAttributes Prelude.Text
activityTaskCancelRequestedEventAttributes_activityId :: (Text -> f Text)
-> ActivityTaskCancelRequestedEventAttributes
-> f ActivityTaskCancelRequestedEventAttributes
activityTaskCancelRequestedEventAttributes_activityId = (ActivityTaskCancelRequestedEventAttributes -> Text)
-> (ActivityTaskCancelRequestedEventAttributes
    -> Text -> ActivityTaskCancelRequestedEventAttributes)
-> Lens
     ActivityTaskCancelRequestedEventAttributes
     ActivityTaskCancelRequestedEventAttributes
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityTaskCancelRequestedEventAttributes' {Text
activityId :: Text
$sel:activityId:ActivityTaskCancelRequestedEventAttributes' :: ActivityTaskCancelRequestedEventAttributes -> Text
activityId} -> Text
activityId) (\s :: ActivityTaskCancelRequestedEventAttributes
s@ActivityTaskCancelRequestedEventAttributes' {} Text
a -> ActivityTaskCancelRequestedEventAttributes
s {$sel:activityId:ActivityTaskCancelRequestedEventAttributes' :: Text
activityId = Text
a} :: ActivityTaskCancelRequestedEventAttributes)

instance
  Core.FromJSON
    ActivityTaskCancelRequestedEventAttributes
  where
  parseJSON :: Value -> Parser ActivityTaskCancelRequestedEventAttributes
parseJSON =
    String
-> (Object -> Parser ActivityTaskCancelRequestedEventAttributes)
-> Value
-> Parser ActivityTaskCancelRequestedEventAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ActivityTaskCancelRequestedEventAttributes"
      ( \Object
x ->
          Integer -> Text -> ActivityTaskCancelRequestedEventAttributes
ActivityTaskCancelRequestedEventAttributes'
            (Integer -> Text -> ActivityTaskCancelRequestedEventAttributes)
-> Parser Integer
-> Parser (Text -> ActivityTaskCancelRequestedEventAttributes)
forall (f :: * -> *) a b. Functor 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")
              Parser (Text -> ActivityTaskCancelRequestedEventAttributes)
-> Parser Text -> Parser ActivityTaskCancelRequestedEventAttributes
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
"activityId")
      )

instance
  Prelude.Hashable
    ActivityTaskCancelRequestedEventAttributes

instance
  Prelude.NFData
    ActivityTaskCancelRequestedEventAttributes