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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.StepFunctions.Types.HistoryEventExecutionDataDetails

-- | Contains details about the successful termination of the execution.
--
-- /See:/ 'newExecutionSucceededEventDetails' smart constructor.
data ExecutionSucceededEventDetails = ExecutionSucceededEventDetails'
  { -- | The JSON data output by the execution. Length constraints apply to the
    -- payload size, and are expressed as bytes in UTF-8 encoding.
    ExecutionSucceededEventDetails -> Maybe (Sensitive Text)
output :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Contains details about the output of an execution history event.
    ExecutionSucceededEventDetails
-> Maybe HistoryEventExecutionDataDetails
outputDetails :: Prelude.Maybe HistoryEventExecutionDataDetails
  }
  deriving (ExecutionSucceededEventDetails
-> ExecutionSucceededEventDetails -> Bool
(ExecutionSucceededEventDetails
 -> ExecutionSucceededEventDetails -> Bool)
-> (ExecutionSucceededEventDetails
    -> ExecutionSucceededEventDetails -> Bool)
-> Eq ExecutionSucceededEventDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExecutionSucceededEventDetails
-> ExecutionSucceededEventDetails -> Bool
$c/= :: ExecutionSucceededEventDetails
-> ExecutionSucceededEventDetails -> Bool
== :: ExecutionSucceededEventDetails
-> ExecutionSucceededEventDetails -> Bool
$c== :: ExecutionSucceededEventDetails
-> ExecutionSucceededEventDetails -> Bool
Prelude.Eq, Int -> ExecutionSucceededEventDetails -> ShowS
[ExecutionSucceededEventDetails] -> ShowS
ExecutionSucceededEventDetails -> String
(Int -> ExecutionSucceededEventDetails -> ShowS)
-> (ExecutionSucceededEventDetails -> String)
-> ([ExecutionSucceededEventDetails] -> ShowS)
-> Show ExecutionSucceededEventDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExecutionSucceededEventDetails] -> ShowS
$cshowList :: [ExecutionSucceededEventDetails] -> ShowS
show :: ExecutionSucceededEventDetails -> String
$cshow :: ExecutionSucceededEventDetails -> String
showsPrec :: Int -> ExecutionSucceededEventDetails -> ShowS
$cshowsPrec :: Int -> ExecutionSucceededEventDetails -> ShowS
Prelude.Show, (forall x.
 ExecutionSucceededEventDetails
 -> Rep ExecutionSucceededEventDetails x)
-> (forall x.
    Rep ExecutionSucceededEventDetails x
    -> ExecutionSucceededEventDetails)
-> Generic ExecutionSucceededEventDetails
forall x.
Rep ExecutionSucceededEventDetails x
-> ExecutionSucceededEventDetails
forall x.
ExecutionSucceededEventDetails
-> Rep ExecutionSucceededEventDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExecutionSucceededEventDetails x
-> ExecutionSucceededEventDetails
$cfrom :: forall x.
ExecutionSucceededEventDetails
-> Rep ExecutionSucceededEventDetails x
Prelude.Generic)

-- |
-- Create a value of 'ExecutionSucceededEventDetails' 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:
--
-- 'output', 'executionSucceededEventDetails_output' - The JSON data output by the execution. Length constraints apply to the
-- payload size, and are expressed as bytes in UTF-8 encoding.
--
-- 'outputDetails', 'executionSucceededEventDetails_outputDetails' - Contains details about the output of an execution history event.
newExecutionSucceededEventDetails ::
  ExecutionSucceededEventDetails
newExecutionSucceededEventDetails :: ExecutionSucceededEventDetails
newExecutionSucceededEventDetails =
  ExecutionSucceededEventDetails' :: Maybe (Sensitive Text)
-> Maybe HistoryEventExecutionDataDetails
-> ExecutionSucceededEventDetails
ExecutionSucceededEventDetails'
    { $sel:output:ExecutionSucceededEventDetails' :: Maybe (Sensitive Text)
output =
        Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:outputDetails:ExecutionSucceededEventDetails' :: Maybe HistoryEventExecutionDataDetails
outputDetails = Maybe HistoryEventExecutionDataDetails
forall a. Maybe a
Prelude.Nothing
    }

-- | The JSON data output by the execution. Length constraints apply to the
-- payload size, and are expressed as bytes in UTF-8 encoding.
executionSucceededEventDetails_output :: Lens.Lens' ExecutionSucceededEventDetails (Prelude.Maybe Prelude.Text)
executionSucceededEventDetails_output :: (Maybe Text -> f (Maybe Text))
-> ExecutionSucceededEventDetails
-> f ExecutionSucceededEventDetails
executionSucceededEventDetails_output = (ExecutionSucceededEventDetails -> Maybe (Sensitive Text))
-> (ExecutionSucceededEventDetails
    -> Maybe (Sensitive Text) -> ExecutionSucceededEventDetails)
-> Lens
     ExecutionSucceededEventDetails
     ExecutionSucceededEventDetails
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecutionSucceededEventDetails' {Maybe (Sensitive Text)
output :: Maybe (Sensitive Text)
$sel:output:ExecutionSucceededEventDetails' :: ExecutionSucceededEventDetails -> Maybe (Sensitive Text)
output} -> Maybe (Sensitive Text)
output) (\s :: ExecutionSucceededEventDetails
s@ExecutionSucceededEventDetails' {} Maybe (Sensitive Text)
a -> ExecutionSucceededEventDetails
s {$sel:output:ExecutionSucceededEventDetails' :: Maybe (Sensitive Text)
output = Maybe (Sensitive Text)
a} :: ExecutionSucceededEventDetails) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> ExecutionSucceededEventDetails
 -> f ExecutionSucceededEventDetails)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ExecutionSucceededEventDetails
-> f ExecutionSucceededEventDetails
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

-- | Contains details about the output of an execution history event.
executionSucceededEventDetails_outputDetails :: Lens.Lens' ExecutionSucceededEventDetails (Prelude.Maybe HistoryEventExecutionDataDetails)
executionSucceededEventDetails_outputDetails :: (Maybe HistoryEventExecutionDataDetails
 -> f (Maybe HistoryEventExecutionDataDetails))
-> ExecutionSucceededEventDetails
-> f ExecutionSucceededEventDetails
executionSucceededEventDetails_outputDetails = (ExecutionSucceededEventDetails
 -> Maybe HistoryEventExecutionDataDetails)
-> (ExecutionSucceededEventDetails
    -> Maybe HistoryEventExecutionDataDetails
    -> ExecutionSucceededEventDetails)
-> Lens
     ExecutionSucceededEventDetails
     ExecutionSucceededEventDetails
     (Maybe HistoryEventExecutionDataDetails)
     (Maybe HistoryEventExecutionDataDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecutionSucceededEventDetails' {Maybe HistoryEventExecutionDataDetails
outputDetails :: Maybe HistoryEventExecutionDataDetails
$sel:outputDetails:ExecutionSucceededEventDetails' :: ExecutionSucceededEventDetails
-> Maybe HistoryEventExecutionDataDetails
outputDetails} -> Maybe HistoryEventExecutionDataDetails
outputDetails) (\s :: ExecutionSucceededEventDetails
s@ExecutionSucceededEventDetails' {} Maybe HistoryEventExecutionDataDetails
a -> ExecutionSucceededEventDetails
s {$sel:outputDetails:ExecutionSucceededEventDetails' :: Maybe HistoryEventExecutionDataDetails
outputDetails = Maybe HistoryEventExecutionDataDetails
a} :: ExecutionSucceededEventDetails)

instance Core.FromJSON ExecutionSucceededEventDetails where
  parseJSON :: Value -> Parser ExecutionSucceededEventDetails
parseJSON =
    String
-> (Object -> Parser ExecutionSucceededEventDetails)
-> Value
-> Parser ExecutionSucceededEventDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ExecutionSucceededEventDetails"
      ( \Object
x ->
          Maybe (Sensitive Text)
-> Maybe HistoryEventExecutionDataDetails
-> ExecutionSucceededEventDetails
ExecutionSucceededEventDetails'
            (Maybe (Sensitive Text)
 -> Maybe HistoryEventExecutionDataDetails
 -> ExecutionSucceededEventDetails)
-> Parser (Maybe (Sensitive Text))
-> Parser
     (Maybe HistoryEventExecutionDataDetails
      -> ExecutionSucceededEventDetails)
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
"output")
            Parser
  (Maybe HistoryEventExecutionDataDetails
   -> ExecutionSucceededEventDetails)
-> Parser (Maybe HistoryEventExecutionDataDetails)
-> Parser ExecutionSucceededEventDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HistoryEventExecutionDataDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"outputDetails")
      )

instance
  Prelude.Hashable
    ExecutionSucceededEventDetails

instance
  Prelude.NFData
    ExecutionSucceededEventDetails