{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SWF.Types.ActivityTaskCancelRequestedEventAttributes where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
      { $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 :: Lens' ActivityTaskCancelRequestedEventAttributes Integer
activityTaskCancelRequestedEventAttributes_decisionTaskCompletedEventId = 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 :: Lens' ActivityTaskCancelRequestedEventAttributes Text
activityTaskCancelRequestedEventAttributes_activityId = 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
  Data.FromJSON
    ActivityTaskCancelRequestedEventAttributes
  where
  parseJSON :: Value -> Parser ActivityTaskCancelRequestedEventAttributes
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ActivityTaskCancelRequestedEventAttributes"
      ( \Object
x ->
          Integer -> Text -> ActivityTaskCancelRequestedEventAttributes
ActivityTaskCancelRequestedEventAttributes'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"decisionTaskCompletedEventId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"activityId")
      )

instance
  Prelude.Hashable
    ActivityTaskCancelRequestedEventAttributes
  where
  hashWithSalt :: Int -> ActivityTaskCancelRequestedEventAttributes -> Int
hashWithSalt
    Int
_salt
    ActivityTaskCancelRequestedEventAttributes' {Integer
Text
activityId :: Text
decisionTaskCompletedEventId :: Integer
$sel:activityId:ActivityTaskCancelRequestedEventAttributes' :: ActivityTaskCancelRequestedEventAttributes -> Text
$sel:decisionTaskCompletedEventId:ActivityTaskCancelRequestedEventAttributes' :: ActivityTaskCancelRequestedEventAttributes -> Integer
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
decisionTaskCompletedEventId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
activityId

instance
  Prelude.NFData
    ActivityTaskCancelRequestedEventAttributes
  where
  rnf :: ActivityTaskCancelRequestedEventAttributes -> ()
rnf ActivityTaskCancelRequestedEventAttributes' {Integer
Text
activityId :: Text
decisionTaskCompletedEventId :: Integer
$sel:activityId:ActivityTaskCancelRequestedEventAttributes' :: ActivityTaskCancelRequestedEventAttributes -> Text
$sel:decisionTaskCompletedEventId:ActivityTaskCancelRequestedEventAttributes' :: ActivityTaskCancelRequestedEventAttributes -> Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Integer
decisionTaskCompletedEventId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
activityId