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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(ActivityTaskTimedOutEventAttributes
 -> ActivityTaskTimedOutEventAttributes -> Bool)
-> (ActivityTaskTimedOutEventAttributes
    -> ActivityTaskTimedOutEventAttributes -> Bool)
-> Eq ActivityTaskTimedOutEventAttributes
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]
(Int -> ReadS ActivityTaskTimedOutEventAttributes)
-> ReadS [ActivityTaskTimedOutEventAttributes]
-> ReadPrec ActivityTaskTimedOutEventAttributes
-> ReadPrec [ActivityTaskTimedOutEventAttributes]
-> Read 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
(Int -> ActivityTaskTimedOutEventAttributes -> ShowS)
-> (ActivityTaskTimedOutEventAttributes -> String)
-> ([ActivityTaskTimedOutEventAttributes] -> ShowS)
-> Show ActivityTaskTimedOutEventAttributes
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.
 ActivityTaskTimedOutEventAttributes
 -> Rep ActivityTaskTimedOutEventAttributes x)
-> (forall x.
    Rep ActivityTaskTimedOutEventAttributes x
    -> ActivityTaskTimedOutEventAttributes)
-> Generic ActivityTaskTimedOutEventAttributes
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' :: Maybe Text
-> ActivityTaskTimeoutType
-> Integer
-> Integer
-> ActivityTaskTimedOutEventAttributes
ActivityTaskTimedOutEventAttributes'
      { $sel:details:ActivityTaskTimedOutEventAttributes' :: Maybe Text
details =
          Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> ActivityTaskTimedOutEventAttributes
-> f ActivityTaskTimedOutEventAttributes
activityTaskTimedOutEventAttributes_details = (ActivityTaskTimedOutEventAttributes -> Maybe Text)
-> (ActivityTaskTimedOutEventAttributes
    -> Maybe Text -> ActivityTaskTimedOutEventAttributes)
-> Lens
     ActivityTaskTimedOutEventAttributes
     ActivityTaskTimedOutEventAttributes
     (Maybe Text)
     (Maybe Text)
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 :: (ActivityTaskTimeoutType -> f ActivityTaskTimeoutType)
-> ActivityTaskTimedOutEventAttributes
-> f ActivityTaskTimedOutEventAttributes
activityTaskTimedOutEventAttributes_timeoutType = (ActivityTaskTimedOutEventAttributes -> ActivityTaskTimeoutType)
-> (ActivityTaskTimedOutEventAttributes
    -> ActivityTaskTimeoutType -> ActivityTaskTimedOutEventAttributes)
-> Lens
     ActivityTaskTimedOutEventAttributes
     ActivityTaskTimedOutEventAttributes
     ActivityTaskTimeoutType
     ActivityTaskTimeoutType
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 :: (Integer -> f Integer)
-> ActivityTaskTimedOutEventAttributes
-> f ActivityTaskTimedOutEventAttributes
activityTaskTimedOutEventAttributes_scheduledEventId = (ActivityTaskTimedOutEventAttributes -> Integer)
-> (ActivityTaskTimedOutEventAttributes
    -> Integer -> ActivityTaskTimedOutEventAttributes)
-> Lens
     ActivityTaskTimedOutEventAttributes
     ActivityTaskTimedOutEventAttributes
     Integer
     Integer
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 :: (Integer -> f Integer)
-> ActivityTaskTimedOutEventAttributes
-> f ActivityTaskTimedOutEventAttributes
activityTaskTimedOutEventAttributes_startedEventId = (ActivityTaskTimedOutEventAttributes -> Integer)
-> (ActivityTaskTimedOutEventAttributes
    -> Integer -> ActivityTaskTimedOutEventAttributes)
-> Lens
     ActivityTaskTimedOutEventAttributes
     ActivityTaskTimedOutEventAttributes
     Integer
     Integer
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
  Core.FromJSON
    ActivityTaskTimedOutEventAttributes
  where
  parseJSON :: Value -> Parser ActivityTaskTimedOutEventAttributes
parseJSON =
    String
-> (Object -> Parser ActivityTaskTimedOutEventAttributes)
-> Value
-> Parser ActivityTaskTimedOutEventAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ActivityTaskTimedOutEventAttributes"
      ( \Object
x ->
          Maybe Text
-> ActivityTaskTimeoutType
-> Integer
-> Integer
-> ActivityTaskTimedOutEventAttributes
ActivityTaskTimedOutEventAttributes'
            (Maybe Text
 -> ActivityTaskTimeoutType
 -> Integer
 -> Integer
 -> ActivityTaskTimedOutEventAttributes)
-> Parser (Maybe Text)
-> Parser
     (ActivityTaskTimeoutType
      -> Integer -> Integer -> ActivityTaskTimedOutEventAttributes)
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
"details")
            Parser
  (ActivityTaskTimeoutType
   -> Integer -> Integer -> ActivityTaskTimedOutEventAttributes)
-> Parser ActivityTaskTimeoutType
-> Parser
     (Integer -> Integer -> ActivityTaskTimedOutEventAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ActivityTaskTimeoutType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"timeoutType")
            Parser (Integer -> Integer -> ActivityTaskTimedOutEventAttributes)
-> Parser Integer
-> Parser (Integer -> ActivityTaskTimedOutEventAttributes)
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
"scheduledEventId")
            Parser (Integer -> ActivityTaskTimedOutEventAttributes)
-> Parser Integer -> Parser ActivityTaskTimedOutEventAttributes
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
"startedEventId")
      )

instance
  Prelude.Hashable
    ActivityTaskTimedOutEventAttributes

instance
  Prelude.NFData
    ActivityTaskTimedOutEventAttributes