{-# 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.StepFunctions.Types.ActivityTimedOutEventDetails
-- 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.StepFunctions.Types.ActivityTimedOutEventDetails 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

-- | Contains details about an activity timeout that occurred during an
-- execution.
--
-- /See:/ 'newActivityTimedOutEventDetails' smart constructor.
data ActivityTimedOutEventDetails = ActivityTimedOutEventDetails'
  { -- | A more detailed explanation of the cause of the timeout.
    ActivityTimedOutEventDetails -> Maybe (Sensitive Text)
cause :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The error code of the failure.
    ActivityTimedOutEventDetails -> Maybe (Sensitive Text)
error :: Prelude.Maybe (Data.Sensitive Prelude.Text)
  }
  deriving (ActivityTimedOutEventDetails
-> ActivityTimedOutEventDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActivityTimedOutEventDetails
-> ActivityTimedOutEventDetails -> Bool
$c/= :: ActivityTimedOutEventDetails
-> ActivityTimedOutEventDetails -> Bool
== :: ActivityTimedOutEventDetails
-> ActivityTimedOutEventDetails -> Bool
$c== :: ActivityTimedOutEventDetails
-> ActivityTimedOutEventDetails -> Bool
Prelude.Eq, Int -> ActivityTimedOutEventDetails -> ShowS
[ActivityTimedOutEventDetails] -> ShowS
ActivityTimedOutEventDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActivityTimedOutEventDetails] -> ShowS
$cshowList :: [ActivityTimedOutEventDetails] -> ShowS
show :: ActivityTimedOutEventDetails -> String
$cshow :: ActivityTimedOutEventDetails -> String
showsPrec :: Int -> ActivityTimedOutEventDetails -> ShowS
$cshowsPrec :: Int -> ActivityTimedOutEventDetails -> ShowS
Prelude.Show, forall x.
Rep ActivityTimedOutEventDetails x -> ActivityTimedOutEventDetails
forall x.
ActivityTimedOutEventDetails -> Rep ActivityTimedOutEventDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ActivityTimedOutEventDetails x -> ActivityTimedOutEventDetails
$cfrom :: forall x.
ActivityTimedOutEventDetails -> Rep ActivityTimedOutEventDetails x
Prelude.Generic)

-- |
-- Create a value of 'ActivityTimedOutEventDetails' 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:
--
-- 'cause', 'activityTimedOutEventDetails_cause' - A more detailed explanation of the cause of the timeout.
--
-- 'error', 'activityTimedOutEventDetails_error' - The error code of the failure.
newActivityTimedOutEventDetails ::
  ActivityTimedOutEventDetails
newActivityTimedOutEventDetails :: ActivityTimedOutEventDetails
newActivityTimedOutEventDetails =
  ActivityTimedOutEventDetails'
    { $sel:cause:ActivityTimedOutEventDetails' :: Maybe (Sensitive Text)
cause =
        forall a. Maybe a
Prelude.Nothing,
      $sel:error:ActivityTimedOutEventDetails' :: Maybe (Sensitive Text)
error = forall a. Maybe a
Prelude.Nothing
    }

-- | A more detailed explanation of the cause of the timeout.
activityTimedOutEventDetails_cause :: Lens.Lens' ActivityTimedOutEventDetails (Prelude.Maybe Prelude.Text)
activityTimedOutEventDetails_cause :: Lens' ActivityTimedOutEventDetails (Maybe Text)
activityTimedOutEventDetails_cause = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityTimedOutEventDetails' {Maybe (Sensitive Text)
cause :: Maybe (Sensitive Text)
$sel:cause:ActivityTimedOutEventDetails' :: ActivityTimedOutEventDetails -> Maybe (Sensitive Text)
cause} -> Maybe (Sensitive Text)
cause) (\s :: ActivityTimedOutEventDetails
s@ActivityTimedOutEventDetails' {} Maybe (Sensitive Text)
a -> ActivityTimedOutEventDetails
s {$sel:cause:ActivityTimedOutEventDetails' :: Maybe (Sensitive Text)
cause = Maybe (Sensitive Text)
a} :: ActivityTimedOutEventDetails) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The error code of the failure.
activityTimedOutEventDetails_error :: Lens.Lens' ActivityTimedOutEventDetails (Prelude.Maybe Prelude.Text)
activityTimedOutEventDetails_error :: Lens' ActivityTimedOutEventDetails (Maybe Text)
activityTimedOutEventDetails_error = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityTimedOutEventDetails' {Maybe (Sensitive Text)
error :: Maybe (Sensitive Text)
$sel:error:ActivityTimedOutEventDetails' :: ActivityTimedOutEventDetails -> Maybe (Sensitive Text)
error} -> Maybe (Sensitive Text)
error) (\s :: ActivityTimedOutEventDetails
s@ActivityTimedOutEventDetails' {} Maybe (Sensitive Text)
a -> ActivityTimedOutEventDetails
s {$sel:error:ActivityTimedOutEventDetails' :: Maybe (Sensitive Text)
error = Maybe (Sensitive Text)
a} :: ActivityTimedOutEventDetails) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive

instance Data.FromJSON ActivityTimedOutEventDetails where
  parseJSON :: Value -> Parser ActivityTimedOutEventDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ActivityTimedOutEventDetails"
      ( \Object
x ->
          Maybe (Sensitive Text)
-> Maybe (Sensitive Text) -> ActivityTimedOutEventDetails
ActivityTimedOutEventDetails'
            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
"cause")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"error")
      )

instance
  Prelude.Hashable
    ActivityTimedOutEventDetails
  where
  hashWithSalt :: Int -> ActivityTimedOutEventDetails -> Int
hashWithSalt Int
_salt ActivityTimedOutEventDetails' {Maybe (Sensitive Text)
error :: Maybe (Sensitive Text)
cause :: Maybe (Sensitive Text)
$sel:error:ActivityTimedOutEventDetails' :: ActivityTimedOutEventDetails -> Maybe (Sensitive Text)
$sel:cause:ActivityTimedOutEventDetails' :: ActivityTimedOutEventDetails -> Maybe (Sensitive Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
cause
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
error

instance Prelude.NFData ActivityTimedOutEventDetails where
  rnf :: ActivityTimedOutEventDetails -> ()
rnf ActivityTimedOutEventDetails' {Maybe (Sensitive Text)
error :: Maybe (Sensitive Text)
cause :: Maybe (Sensitive Text)
$sel:error:ActivityTimedOutEventDetails' :: ActivityTimedOutEventDetails -> Maybe (Sensitive Text)
$sel:cause:ActivityTimedOutEventDetails' :: ActivityTimedOutEventDetails -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
cause seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
error