{-# 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.ActivityTaskTimedOutEventAttributes
-- 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.ActivityTaskTimedOutEventAttributes 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
import Amazonka.SWF.Types.ActivityTaskTimeoutType

-- | Provides the details of the @ActivityTaskTimedOut@ event.
--
-- /See:/ 'newActivityTaskTimedOutEventAttributes' smart constructor.
data ActivityTaskTimedOutEventAttributes = ActivityTaskTimedOutEventAttributes'
  { -- | Contains the content of the @details@ parameter for the last call made
    -- by the activity to @RecordActivityTaskHeartbeat@.
    ActivityTaskTimedOutEventAttributes -> Maybe Text
details :: Prelude.Maybe Prelude.Text,
    -- | The type of the timeout that caused this event.
    ActivityTaskTimedOutEventAttributes -> ActivityTaskTimeoutType
timeoutType :: ActivityTaskTimeoutType,
    -- | The ID of the @ActivityTaskScheduled@ event that was recorded when this
    -- activity task was scheduled. This information can be useful for
    -- diagnosing problems by tracing back the chain of events leading up to
    -- this event.
    ActivityTaskTimedOutEventAttributes -> Integer
scheduledEventId :: Prelude.Integer,
    -- | The ID of the @ActivityTaskStarted@ event recorded when this activity
    -- task was started. This information can be useful for diagnosing problems
    -- by tracing back the chain of events leading up to this event.
    ActivityTaskTimedOutEventAttributes -> Integer
startedEventId :: Prelude.Integer
  }
  deriving (ActivityTaskTimedOutEventAttributes
-> ActivityTaskTimedOutEventAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActivityTaskTimedOutEventAttributes
-> ActivityTaskTimedOutEventAttributes -> Bool
$c/= :: ActivityTaskTimedOutEventAttributes
-> ActivityTaskTimedOutEventAttributes -> Bool
== :: ActivityTaskTimedOutEventAttributes
-> ActivityTaskTimedOutEventAttributes -> Bool
$c== :: ActivityTaskTimedOutEventAttributes
-> ActivityTaskTimedOutEventAttributes -> Bool
Prelude.Eq, ReadPrec [ActivityTaskTimedOutEventAttributes]
ReadPrec ActivityTaskTimedOutEventAttributes
Int -> ReadS ActivityTaskTimedOutEventAttributes
ReadS [ActivityTaskTimedOutEventAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActivityTaskTimedOutEventAttributes]
$creadListPrec :: ReadPrec [ActivityTaskTimedOutEventAttributes]
readPrec :: ReadPrec ActivityTaskTimedOutEventAttributes
$creadPrec :: ReadPrec ActivityTaskTimedOutEventAttributes
readList :: ReadS [ActivityTaskTimedOutEventAttributes]
$creadList :: ReadS [ActivityTaskTimedOutEventAttributes]
readsPrec :: Int -> ReadS ActivityTaskTimedOutEventAttributes
$creadsPrec :: Int -> ReadS ActivityTaskTimedOutEventAttributes
Prelude.Read, Int -> ActivityTaskTimedOutEventAttributes -> ShowS
[ActivityTaskTimedOutEventAttributes] -> ShowS
ActivityTaskTimedOutEventAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActivityTaskTimedOutEventAttributes] -> ShowS
$cshowList :: [ActivityTaskTimedOutEventAttributes] -> ShowS
show :: ActivityTaskTimedOutEventAttributes -> String
$cshow :: ActivityTaskTimedOutEventAttributes -> String
showsPrec :: Int -> ActivityTaskTimedOutEventAttributes -> ShowS
$cshowsPrec :: Int -> ActivityTaskTimedOutEventAttributes -> ShowS
Prelude.Show, forall x.
Rep ActivityTaskTimedOutEventAttributes x
-> ActivityTaskTimedOutEventAttributes
forall x.
ActivityTaskTimedOutEventAttributes
-> Rep ActivityTaskTimedOutEventAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ActivityTaskTimedOutEventAttributes x
-> ActivityTaskTimedOutEventAttributes
$cfrom :: forall x.
ActivityTaskTimedOutEventAttributes
-> Rep ActivityTaskTimedOutEventAttributes x
Prelude.Generic)

-- |
-- Create a value of 'ActivityTaskTimedOutEventAttributes' 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:
--
-- 'details', 'activityTaskTimedOutEventAttributes_details' - Contains the content of the @details@ parameter for the last call made
-- by the activity to @RecordActivityTaskHeartbeat@.
--
-- 'timeoutType', 'activityTaskTimedOutEventAttributes_timeoutType' - The type of the timeout that caused this event.
--
-- 'scheduledEventId', 'activityTaskTimedOutEventAttributes_scheduledEventId' - The ID of the @ActivityTaskScheduled@ event that was recorded when this
-- activity task was scheduled. This information can be useful for
-- diagnosing problems by tracing back the chain of events leading up to
-- this event.
--
-- 'startedEventId', 'activityTaskTimedOutEventAttributes_startedEventId' - The ID of the @ActivityTaskStarted@ event recorded when this activity
-- task was started. This information can be useful for diagnosing problems
-- by tracing back the chain of events leading up to this event.
newActivityTaskTimedOutEventAttributes ::
  -- | 'timeoutType'
  ActivityTaskTimeoutType ->
  -- | 'scheduledEventId'
  Prelude.Integer ->
  -- | 'startedEventId'
  Prelude.Integer ->
  ActivityTaskTimedOutEventAttributes
newActivityTaskTimedOutEventAttributes :: ActivityTaskTimeoutType
-> Integer -> Integer -> ActivityTaskTimedOutEventAttributes
newActivityTaskTimedOutEventAttributes
  ActivityTaskTimeoutType
pTimeoutType_
  Integer
pScheduledEventId_
  Integer
pStartedEventId_ =
    ActivityTaskTimedOutEventAttributes'
      { $sel:details:ActivityTaskTimedOutEventAttributes' :: Maybe Text
details =
          forall a. Maybe a
Prelude.Nothing,
        $sel:timeoutType:ActivityTaskTimedOutEventAttributes' :: ActivityTaskTimeoutType
timeoutType = ActivityTaskTimeoutType
pTimeoutType_,
        $sel:scheduledEventId:ActivityTaskTimedOutEventAttributes' :: Integer
scheduledEventId = Integer
pScheduledEventId_,
        $sel:startedEventId:ActivityTaskTimedOutEventAttributes' :: Integer
startedEventId = Integer
pStartedEventId_
      }

-- | Contains the content of the @details@ parameter for the last call made
-- by the activity to @RecordActivityTaskHeartbeat@.
activityTaskTimedOutEventAttributes_details :: Lens.Lens' ActivityTaskTimedOutEventAttributes (Prelude.Maybe Prelude.Text)
activityTaskTimedOutEventAttributes_details :: Lens' ActivityTaskTimedOutEventAttributes (Maybe Text)
activityTaskTimedOutEventAttributes_details = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityTaskTimedOutEventAttributes' {Maybe Text
details :: Maybe Text
$sel:details:ActivityTaskTimedOutEventAttributes' :: ActivityTaskTimedOutEventAttributes -> Maybe Text
details} -> Maybe Text
details) (\s :: ActivityTaskTimedOutEventAttributes
s@ActivityTaskTimedOutEventAttributes' {} Maybe Text
a -> ActivityTaskTimedOutEventAttributes
s {$sel:details:ActivityTaskTimedOutEventAttributes' :: Maybe Text
details = Maybe Text
a} :: ActivityTaskTimedOutEventAttributes)

-- | The type of the timeout that caused this event.
activityTaskTimedOutEventAttributes_timeoutType :: Lens.Lens' ActivityTaskTimedOutEventAttributes ActivityTaskTimeoutType
activityTaskTimedOutEventAttributes_timeoutType :: Lens' ActivityTaskTimedOutEventAttributes ActivityTaskTimeoutType
activityTaskTimedOutEventAttributes_timeoutType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityTaskTimedOutEventAttributes' {ActivityTaskTimeoutType
timeoutType :: ActivityTaskTimeoutType
$sel:timeoutType:ActivityTaskTimedOutEventAttributes' :: ActivityTaskTimedOutEventAttributes -> ActivityTaskTimeoutType
timeoutType} -> ActivityTaskTimeoutType
timeoutType) (\s :: ActivityTaskTimedOutEventAttributes
s@ActivityTaskTimedOutEventAttributes' {} ActivityTaskTimeoutType
a -> ActivityTaskTimedOutEventAttributes
s {$sel:timeoutType:ActivityTaskTimedOutEventAttributes' :: ActivityTaskTimeoutType
timeoutType = ActivityTaskTimeoutType
a} :: ActivityTaskTimedOutEventAttributes)

-- | The ID of the @ActivityTaskScheduled@ event that was recorded when this
-- activity task was scheduled. This information can be useful for
-- diagnosing problems by tracing back the chain of events leading up to
-- this event.
activityTaskTimedOutEventAttributes_scheduledEventId :: Lens.Lens' ActivityTaskTimedOutEventAttributes Prelude.Integer
activityTaskTimedOutEventAttributes_scheduledEventId :: Lens' ActivityTaskTimedOutEventAttributes Integer
activityTaskTimedOutEventAttributes_scheduledEventId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityTaskTimedOutEventAttributes' {Integer
scheduledEventId :: Integer
$sel:scheduledEventId:ActivityTaskTimedOutEventAttributes' :: ActivityTaskTimedOutEventAttributes -> Integer
scheduledEventId} -> Integer
scheduledEventId) (\s :: ActivityTaskTimedOutEventAttributes
s@ActivityTaskTimedOutEventAttributes' {} Integer
a -> ActivityTaskTimedOutEventAttributes
s {$sel:scheduledEventId:ActivityTaskTimedOutEventAttributes' :: Integer
scheduledEventId = Integer
a} :: ActivityTaskTimedOutEventAttributes)

-- | The ID of the @ActivityTaskStarted@ event recorded when this activity
-- task was started. This information can be useful for diagnosing problems
-- by tracing back the chain of events leading up to this event.
activityTaskTimedOutEventAttributes_startedEventId :: Lens.Lens' ActivityTaskTimedOutEventAttributes Prelude.Integer
activityTaskTimedOutEventAttributes_startedEventId :: Lens' ActivityTaskTimedOutEventAttributes Integer
activityTaskTimedOutEventAttributes_startedEventId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityTaskTimedOutEventAttributes' {Integer
startedEventId :: Integer
$sel:startedEventId:ActivityTaskTimedOutEventAttributes' :: ActivityTaskTimedOutEventAttributes -> Integer
startedEventId} -> Integer
startedEventId) (\s :: ActivityTaskTimedOutEventAttributes
s@ActivityTaskTimedOutEventAttributes' {} Integer
a -> ActivityTaskTimedOutEventAttributes
s {$sel:startedEventId:ActivityTaskTimedOutEventAttributes' :: Integer
startedEventId = Integer
a} :: ActivityTaskTimedOutEventAttributes)

instance
  Data.FromJSON
    ActivityTaskTimedOutEventAttributes
  where
  parseJSON :: Value -> Parser ActivityTaskTimedOutEventAttributes
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ActivityTaskTimedOutEventAttributes"
      ( \Object
x ->
          Maybe Text
-> ActivityTaskTimeoutType
-> Integer
-> Integer
-> ActivityTaskTimedOutEventAttributes
ActivityTaskTimedOutEventAttributes'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"details")
            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
"timeoutType")
            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
"scheduledEventId")
            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
"startedEventId")
      )

instance
  Prelude.Hashable
    ActivityTaskTimedOutEventAttributes
  where
  hashWithSalt :: Int -> ActivityTaskTimedOutEventAttributes -> Int
hashWithSalt
    Int
_salt
    ActivityTaskTimedOutEventAttributes' {Integer
Maybe Text
ActivityTaskTimeoutType
startedEventId :: Integer
scheduledEventId :: Integer
timeoutType :: ActivityTaskTimeoutType
details :: Maybe Text
$sel:startedEventId:ActivityTaskTimedOutEventAttributes' :: ActivityTaskTimedOutEventAttributes -> Integer
$sel:scheduledEventId:ActivityTaskTimedOutEventAttributes' :: ActivityTaskTimedOutEventAttributes -> Integer
$sel:timeoutType:ActivityTaskTimedOutEventAttributes' :: ActivityTaskTimedOutEventAttributes -> ActivityTaskTimeoutType
$sel:details:ActivityTaskTimedOutEventAttributes' :: ActivityTaskTimedOutEventAttributes -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
details
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ActivityTaskTimeoutType
timeoutType
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
scheduledEventId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
startedEventId

instance
  Prelude.NFData
    ActivityTaskTimedOutEventAttributes
  where
  rnf :: ActivityTaskTimedOutEventAttributes -> ()
rnf ActivityTaskTimedOutEventAttributes' {Integer
Maybe Text
ActivityTaskTimeoutType
startedEventId :: Integer
scheduledEventId :: Integer
timeoutType :: ActivityTaskTimeoutType
details :: Maybe Text
$sel:startedEventId:ActivityTaskTimedOutEventAttributes' :: ActivityTaskTimedOutEventAttributes -> Integer
$sel:scheduledEventId:ActivityTaskTimedOutEventAttributes' :: ActivityTaskTimedOutEventAttributes -> Integer
$sel:timeoutType:ActivityTaskTimedOutEventAttributes' :: ActivityTaskTimedOutEventAttributes -> ActivityTaskTimeoutType
$sel:details:ActivityTaskTimedOutEventAttributes' :: ActivityTaskTimedOutEventAttributes -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
details
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ActivityTaskTimeoutType
timeoutType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
scheduledEventId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
startedEventId