{-# 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.ChildWorkflowExecutionTimedOutEventAttributes
-- 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.ChildWorkflowExecutionTimedOutEventAttributes 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.WorkflowExecution
import Amazonka.SWF.Types.WorkflowExecutionTimeoutType
import Amazonka.SWF.Types.WorkflowType

-- | Provides the details of the @ChildWorkflowExecutionTimedOut@ event.
--
-- /See:/ 'newChildWorkflowExecutionTimedOutEventAttributes' smart constructor.
data ChildWorkflowExecutionTimedOutEventAttributes = ChildWorkflowExecutionTimedOutEventAttributes'
  { -- | The child workflow execution that timed out.
    ChildWorkflowExecutionTimedOutEventAttributes -> WorkflowExecution
workflowExecution :: WorkflowExecution,
    -- | The type of the child workflow execution.
    ChildWorkflowExecutionTimedOutEventAttributes -> WorkflowType
workflowType :: WorkflowType,
    -- | The type of the timeout that caused the child workflow execution to time
    -- out.
    ChildWorkflowExecutionTimedOutEventAttributes
-> WorkflowExecutionTimeoutType
timeoutType :: WorkflowExecutionTimeoutType,
    -- | The ID of the @StartChildWorkflowExecutionInitiated@ event corresponding
    -- to the @StartChildWorkflowExecution@ Decision to start this child
    -- workflow execution. This information can be useful for diagnosing
    -- problems by tracing back the chain of events leading up to this event.
    ChildWorkflowExecutionTimedOutEventAttributes -> Integer
initiatedEventId :: Prelude.Integer,
    -- | The ID of the @ChildWorkflowExecutionStarted@ event recorded when this
    -- child workflow execution was started. This information can be useful for
    -- diagnosing problems by tracing back the chain of events leading up to
    -- this event.
    ChildWorkflowExecutionTimedOutEventAttributes -> Integer
startedEventId :: Prelude.Integer
  }
  deriving (ChildWorkflowExecutionTimedOutEventAttributes
-> ChildWorkflowExecutionTimedOutEventAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChildWorkflowExecutionTimedOutEventAttributes
-> ChildWorkflowExecutionTimedOutEventAttributes -> Bool
$c/= :: ChildWorkflowExecutionTimedOutEventAttributes
-> ChildWorkflowExecutionTimedOutEventAttributes -> Bool
== :: ChildWorkflowExecutionTimedOutEventAttributes
-> ChildWorkflowExecutionTimedOutEventAttributes -> Bool
$c== :: ChildWorkflowExecutionTimedOutEventAttributes
-> ChildWorkflowExecutionTimedOutEventAttributes -> Bool
Prelude.Eq, ReadPrec [ChildWorkflowExecutionTimedOutEventAttributes]
ReadPrec ChildWorkflowExecutionTimedOutEventAttributes
Int -> ReadS ChildWorkflowExecutionTimedOutEventAttributes
ReadS [ChildWorkflowExecutionTimedOutEventAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChildWorkflowExecutionTimedOutEventAttributes]
$creadListPrec :: ReadPrec [ChildWorkflowExecutionTimedOutEventAttributes]
readPrec :: ReadPrec ChildWorkflowExecutionTimedOutEventAttributes
$creadPrec :: ReadPrec ChildWorkflowExecutionTimedOutEventAttributes
readList :: ReadS [ChildWorkflowExecutionTimedOutEventAttributes]
$creadList :: ReadS [ChildWorkflowExecutionTimedOutEventAttributes]
readsPrec :: Int -> ReadS ChildWorkflowExecutionTimedOutEventAttributes
$creadsPrec :: Int -> ReadS ChildWorkflowExecutionTimedOutEventAttributes
Prelude.Read, Int -> ChildWorkflowExecutionTimedOutEventAttributes -> ShowS
[ChildWorkflowExecutionTimedOutEventAttributes] -> ShowS
ChildWorkflowExecutionTimedOutEventAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChildWorkflowExecutionTimedOutEventAttributes] -> ShowS
$cshowList :: [ChildWorkflowExecutionTimedOutEventAttributes] -> ShowS
show :: ChildWorkflowExecutionTimedOutEventAttributes -> String
$cshow :: ChildWorkflowExecutionTimedOutEventAttributes -> String
showsPrec :: Int -> ChildWorkflowExecutionTimedOutEventAttributes -> ShowS
$cshowsPrec :: Int -> ChildWorkflowExecutionTimedOutEventAttributes -> ShowS
Prelude.Show, forall x.
Rep ChildWorkflowExecutionTimedOutEventAttributes x
-> ChildWorkflowExecutionTimedOutEventAttributes
forall x.
ChildWorkflowExecutionTimedOutEventAttributes
-> Rep ChildWorkflowExecutionTimedOutEventAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ChildWorkflowExecutionTimedOutEventAttributes x
-> ChildWorkflowExecutionTimedOutEventAttributes
$cfrom :: forall x.
ChildWorkflowExecutionTimedOutEventAttributes
-> Rep ChildWorkflowExecutionTimedOutEventAttributes x
Prelude.Generic)

-- |
-- Create a value of 'ChildWorkflowExecutionTimedOutEventAttributes' 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:
--
-- 'workflowExecution', 'childWorkflowExecutionTimedOutEventAttributes_workflowExecution' - The child workflow execution that timed out.
--
-- 'workflowType', 'childWorkflowExecutionTimedOutEventAttributes_workflowType' - The type of the child workflow execution.
--
-- 'timeoutType', 'childWorkflowExecutionTimedOutEventAttributes_timeoutType' - The type of the timeout that caused the child workflow execution to time
-- out.
--
-- 'initiatedEventId', 'childWorkflowExecutionTimedOutEventAttributes_initiatedEventId' - The ID of the @StartChildWorkflowExecutionInitiated@ event corresponding
-- to the @StartChildWorkflowExecution@ Decision to start this child
-- workflow execution. This information can be useful for diagnosing
-- problems by tracing back the chain of events leading up to this event.
--
-- 'startedEventId', 'childWorkflowExecutionTimedOutEventAttributes_startedEventId' - The ID of the @ChildWorkflowExecutionStarted@ event recorded when this
-- child workflow execution was started. This information can be useful for
-- diagnosing problems by tracing back the chain of events leading up to
-- this event.
newChildWorkflowExecutionTimedOutEventAttributes ::
  -- | 'workflowExecution'
  WorkflowExecution ->
  -- | 'workflowType'
  WorkflowType ->
  -- | 'timeoutType'
  WorkflowExecutionTimeoutType ->
  -- | 'initiatedEventId'
  Prelude.Integer ->
  -- | 'startedEventId'
  Prelude.Integer ->
  ChildWorkflowExecutionTimedOutEventAttributes
newChildWorkflowExecutionTimedOutEventAttributes :: WorkflowExecution
-> WorkflowType
-> WorkflowExecutionTimeoutType
-> Integer
-> Integer
-> ChildWorkflowExecutionTimedOutEventAttributes
newChildWorkflowExecutionTimedOutEventAttributes
  WorkflowExecution
pWorkflowExecution_
  WorkflowType
pWorkflowType_
  WorkflowExecutionTimeoutType
pTimeoutType_
  Integer
pInitiatedEventId_
  Integer
pStartedEventId_ =
    ChildWorkflowExecutionTimedOutEventAttributes'
      { $sel:workflowExecution:ChildWorkflowExecutionTimedOutEventAttributes' :: WorkflowExecution
workflowExecution =
          WorkflowExecution
pWorkflowExecution_,
        $sel:workflowType:ChildWorkflowExecutionTimedOutEventAttributes' :: WorkflowType
workflowType =
          WorkflowType
pWorkflowType_,
        $sel:timeoutType:ChildWorkflowExecutionTimedOutEventAttributes' :: WorkflowExecutionTimeoutType
timeoutType = WorkflowExecutionTimeoutType
pTimeoutType_,
        $sel:initiatedEventId:ChildWorkflowExecutionTimedOutEventAttributes' :: Integer
initiatedEventId =
          Integer
pInitiatedEventId_,
        $sel:startedEventId:ChildWorkflowExecutionTimedOutEventAttributes' :: Integer
startedEventId =
          Integer
pStartedEventId_
      }

-- | The child workflow execution that timed out.
childWorkflowExecutionTimedOutEventAttributes_workflowExecution :: Lens.Lens' ChildWorkflowExecutionTimedOutEventAttributes WorkflowExecution
childWorkflowExecutionTimedOutEventAttributes_workflowExecution :: Lens'
  ChildWorkflowExecutionTimedOutEventAttributes WorkflowExecution
childWorkflowExecutionTimedOutEventAttributes_workflowExecution = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChildWorkflowExecutionTimedOutEventAttributes' {WorkflowExecution
workflowExecution :: WorkflowExecution
$sel:workflowExecution:ChildWorkflowExecutionTimedOutEventAttributes' :: ChildWorkflowExecutionTimedOutEventAttributes -> WorkflowExecution
workflowExecution} -> WorkflowExecution
workflowExecution) (\s :: ChildWorkflowExecutionTimedOutEventAttributes
s@ChildWorkflowExecutionTimedOutEventAttributes' {} WorkflowExecution
a -> ChildWorkflowExecutionTimedOutEventAttributes
s {$sel:workflowExecution:ChildWorkflowExecutionTimedOutEventAttributes' :: WorkflowExecution
workflowExecution = WorkflowExecution
a} :: ChildWorkflowExecutionTimedOutEventAttributes)

-- | The type of the child workflow execution.
childWorkflowExecutionTimedOutEventAttributes_workflowType :: Lens.Lens' ChildWorkflowExecutionTimedOutEventAttributes WorkflowType
childWorkflowExecutionTimedOutEventAttributes_workflowType :: Lens' ChildWorkflowExecutionTimedOutEventAttributes WorkflowType
childWorkflowExecutionTimedOutEventAttributes_workflowType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChildWorkflowExecutionTimedOutEventAttributes' {WorkflowType
workflowType :: WorkflowType
$sel:workflowType:ChildWorkflowExecutionTimedOutEventAttributes' :: ChildWorkflowExecutionTimedOutEventAttributes -> WorkflowType
workflowType} -> WorkflowType
workflowType) (\s :: ChildWorkflowExecutionTimedOutEventAttributes
s@ChildWorkflowExecutionTimedOutEventAttributes' {} WorkflowType
a -> ChildWorkflowExecutionTimedOutEventAttributes
s {$sel:workflowType:ChildWorkflowExecutionTimedOutEventAttributes' :: WorkflowType
workflowType = WorkflowType
a} :: ChildWorkflowExecutionTimedOutEventAttributes)

-- | The type of the timeout that caused the child workflow execution to time
-- out.
childWorkflowExecutionTimedOutEventAttributes_timeoutType :: Lens.Lens' ChildWorkflowExecutionTimedOutEventAttributes WorkflowExecutionTimeoutType
childWorkflowExecutionTimedOutEventAttributes_timeoutType :: Lens'
  ChildWorkflowExecutionTimedOutEventAttributes
  WorkflowExecutionTimeoutType
childWorkflowExecutionTimedOutEventAttributes_timeoutType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChildWorkflowExecutionTimedOutEventAttributes' {WorkflowExecutionTimeoutType
timeoutType :: WorkflowExecutionTimeoutType
$sel:timeoutType:ChildWorkflowExecutionTimedOutEventAttributes' :: ChildWorkflowExecutionTimedOutEventAttributes
-> WorkflowExecutionTimeoutType
timeoutType} -> WorkflowExecutionTimeoutType
timeoutType) (\s :: ChildWorkflowExecutionTimedOutEventAttributes
s@ChildWorkflowExecutionTimedOutEventAttributes' {} WorkflowExecutionTimeoutType
a -> ChildWorkflowExecutionTimedOutEventAttributes
s {$sel:timeoutType:ChildWorkflowExecutionTimedOutEventAttributes' :: WorkflowExecutionTimeoutType
timeoutType = WorkflowExecutionTimeoutType
a} :: ChildWorkflowExecutionTimedOutEventAttributes)

-- | The ID of the @StartChildWorkflowExecutionInitiated@ event corresponding
-- to the @StartChildWorkflowExecution@ Decision to start this child
-- workflow execution. This information can be useful for diagnosing
-- problems by tracing back the chain of events leading up to this event.
childWorkflowExecutionTimedOutEventAttributes_initiatedEventId :: Lens.Lens' ChildWorkflowExecutionTimedOutEventAttributes Prelude.Integer
childWorkflowExecutionTimedOutEventAttributes_initiatedEventId :: Lens' ChildWorkflowExecutionTimedOutEventAttributes Integer
childWorkflowExecutionTimedOutEventAttributes_initiatedEventId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChildWorkflowExecutionTimedOutEventAttributes' {Integer
initiatedEventId :: Integer
$sel:initiatedEventId:ChildWorkflowExecutionTimedOutEventAttributes' :: ChildWorkflowExecutionTimedOutEventAttributes -> Integer
initiatedEventId} -> Integer
initiatedEventId) (\s :: ChildWorkflowExecutionTimedOutEventAttributes
s@ChildWorkflowExecutionTimedOutEventAttributes' {} Integer
a -> ChildWorkflowExecutionTimedOutEventAttributes
s {$sel:initiatedEventId:ChildWorkflowExecutionTimedOutEventAttributes' :: Integer
initiatedEventId = Integer
a} :: ChildWorkflowExecutionTimedOutEventAttributes)

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

instance
  Data.FromJSON
    ChildWorkflowExecutionTimedOutEventAttributes
  where
  parseJSON :: Value -> Parser ChildWorkflowExecutionTimedOutEventAttributes
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ChildWorkflowExecutionTimedOutEventAttributes"
      ( \Object
x ->
          WorkflowExecution
-> WorkflowType
-> WorkflowExecutionTimeoutType
-> Integer
-> Integer
-> ChildWorkflowExecutionTimedOutEventAttributes
ChildWorkflowExecutionTimedOutEventAttributes'
            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
"workflowExecution")
            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
"workflowType")
            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
"initiatedEventId")
            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
    ChildWorkflowExecutionTimedOutEventAttributes
  where
  hashWithSalt :: Int -> ChildWorkflowExecutionTimedOutEventAttributes -> Int
hashWithSalt
    Int
_salt
    ChildWorkflowExecutionTimedOutEventAttributes' {Integer
WorkflowExecution
WorkflowExecutionTimeoutType
WorkflowType
startedEventId :: Integer
initiatedEventId :: Integer
timeoutType :: WorkflowExecutionTimeoutType
workflowType :: WorkflowType
workflowExecution :: WorkflowExecution
$sel:startedEventId:ChildWorkflowExecutionTimedOutEventAttributes' :: ChildWorkflowExecutionTimedOutEventAttributes -> Integer
$sel:initiatedEventId:ChildWorkflowExecutionTimedOutEventAttributes' :: ChildWorkflowExecutionTimedOutEventAttributes -> Integer
$sel:timeoutType:ChildWorkflowExecutionTimedOutEventAttributes' :: ChildWorkflowExecutionTimedOutEventAttributes
-> WorkflowExecutionTimeoutType
$sel:workflowType:ChildWorkflowExecutionTimedOutEventAttributes' :: ChildWorkflowExecutionTimedOutEventAttributes -> WorkflowType
$sel:workflowExecution:ChildWorkflowExecutionTimedOutEventAttributes' :: ChildWorkflowExecutionTimedOutEventAttributes -> WorkflowExecution
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` WorkflowExecution
workflowExecution
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` WorkflowType
workflowType
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` WorkflowExecutionTimeoutType
timeoutType
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
initiatedEventId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
startedEventId

instance
  Prelude.NFData
    ChildWorkflowExecutionTimedOutEventAttributes
  where
  rnf :: ChildWorkflowExecutionTimedOutEventAttributes -> ()
rnf
    ChildWorkflowExecutionTimedOutEventAttributes' {Integer
WorkflowExecution
WorkflowExecutionTimeoutType
WorkflowType
startedEventId :: Integer
initiatedEventId :: Integer
timeoutType :: WorkflowExecutionTimeoutType
workflowType :: WorkflowType
workflowExecution :: WorkflowExecution
$sel:startedEventId:ChildWorkflowExecutionTimedOutEventAttributes' :: ChildWorkflowExecutionTimedOutEventAttributes -> Integer
$sel:initiatedEventId:ChildWorkflowExecutionTimedOutEventAttributes' :: ChildWorkflowExecutionTimedOutEventAttributes -> Integer
$sel:timeoutType:ChildWorkflowExecutionTimedOutEventAttributes' :: ChildWorkflowExecutionTimedOutEventAttributes
-> WorkflowExecutionTimeoutType
$sel:workflowType:ChildWorkflowExecutionTimedOutEventAttributes' :: ChildWorkflowExecutionTimedOutEventAttributes -> WorkflowType
$sel:workflowExecution:ChildWorkflowExecutionTimedOutEventAttributes' :: ChildWorkflowExecutionTimedOutEventAttributes -> WorkflowExecution
..} =
      forall a. NFData a => a -> ()
Prelude.rnf WorkflowExecution
workflowExecution
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf WorkflowType
workflowType
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf WorkflowExecutionTimeoutType
timeoutType
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
initiatedEventId
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
startedEventId