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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

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

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

-- | The error code of the failure.
executionTimedOutEventDetails_error :: Lens.Lens' ExecutionTimedOutEventDetails (Prelude.Maybe Prelude.Text)
executionTimedOutEventDetails_error :: (Maybe Text -> f (Maybe Text))
-> ExecutionTimedOutEventDetails -> f ExecutionTimedOutEventDetails
executionTimedOutEventDetails_error = (ExecutionTimedOutEventDetails -> Maybe (Sensitive Text))
-> (ExecutionTimedOutEventDetails
    -> Maybe (Sensitive Text) -> ExecutionTimedOutEventDetails)
-> Lens
     ExecutionTimedOutEventDetails
     ExecutionTimedOutEventDetails
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecutionTimedOutEventDetails' {Maybe (Sensitive Text)
error :: Maybe (Sensitive Text)
$sel:error:ExecutionTimedOutEventDetails' :: ExecutionTimedOutEventDetails -> Maybe (Sensitive Text)
error} -> Maybe (Sensitive Text)
error) (\s :: ExecutionTimedOutEventDetails
s@ExecutionTimedOutEventDetails' {} Maybe (Sensitive Text)
a -> ExecutionTimedOutEventDetails
s {$sel:error:ExecutionTimedOutEventDetails' :: Maybe (Sensitive Text)
error = Maybe (Sensitive Text)
a} :: ExecutionTimedOutEventDetails) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> ExecutionTimedOutEventDetails
 -> f ExecutionTimedOutEventDetails)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ExecutionTimedOutEventDetails
-> f ExecutionTimedOutEventDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | A more detailed explanation of the cause of the timeout.
executionTimedOutEventDetails_cause :: Lens.Lens' ExecutionTimedOutEventDetails (Prelude.Maybe Prelude.Text)
executionTimedOutEventDetails_cause :: (Maybe Text -> f (Maybe Text))
-> ExecutionTimedOutEventDetails -> f ExecutionTimedOutEventDetails
executionTimedOutEventDetails_cause = (ExecutionTimedOutEventDetails -> Maybe (Sensitive Text))
-> (ExecutionTimedOutEventDetails
    -> Maybe (Sensitive Text) -> ExecutionTimedOutEventDetails)
-> Lens
     ExecutionTimedOutEventDetails
     ExecutionTimedOutEventDetails
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecutionTimedOutEventDetails' {Maybe (Sensitive Text)
cause :: Maybe (Sensitive Text)
$sel:cause:ExecutionTimedOutEventDetails' :: ExecutionTimedOutEventDetails -> Maybe (Sensitive Text)
cause} -> Maybe (Sensitive Text)
cause) (\s :: ExecutionTimedOutEventDetails
s@ExecutionTimedOutEventDetails' {} Maybe (Sensitive Text)
a -> ExecutionTimedOutEventDetails
s {$sel:cause:ExecutionTimedOutEventDetails' :: Maybe (Sensitive Text)
cause = Maybe (Sensitive Text)
a} :: ExecutionTimedOutEventDetails) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> ExecutionTimedOutEventDetails
 -> f ExecutionTimedOutEventDetails)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ExecutionTimedOutEventDetails
-> f ExecutionTimedOutEventDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

instance Core.FromJSON ExecutionTimedOutEventDetails where
  parseJSON :: Value -> Parser ExecutionTimedOutEventDetails
parseJSON =
    String
-> (Object -> Parser ExecutionTimedOutEventDetails)
-> Value
-> Parser ExecutionTimedOutEventDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ExecutionTimedOutEventDetails"
      ( \Object
x ->
          Maybe (Sensitive Text)
-> Maybe (Sensitive Text) -> ExecutionTimedOutEventDetails
ExecutionTimedOutEventDetails'
            (Maybe (Sensitive Text)
 -> Maybe (Sensitive Text) -> ExecutionTimedOutEventDetails)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe (Sensitive Text) -> ExecutionTimedOutEventDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"error")
            Parser (Maybe (Sensitive Text) -> ExecutionTimedOutEventDetails)
-> Parser (Maybe (Sensitive Text))
-> Parser ExecutionTimedOutEventDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cause")
      )

instance
  Prelude.Hashable
    ExecutionTimedOutEventDetails

instance Prelude.NFData ExecutionTimedOutEventDetails