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

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

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

instance
  Core.FromJSON
    LambdaFunctionSucceededEventDetails
  where
  parseJSON :: Value -> Parser LambdaFunctionSucceededEventDetails
parseJSON =
    String
-> (Object -> Parser LambdaFunctionSucceededEventDetails)
-> Value
-> Parser LambdaFunctionSucceededEventDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LambdaFunctionSucceededEventDetails"
      ( \Object
x ->
          Maybe (Sensitive Text)
-> Maybe HistoryEventExecutionDataDetails
-> LambdaFunctionSucceededEventDetails
LambdaFunctionSucceededEventDetails'
            (Maybe (Sensitive Text)
 -> Maybe HistoryEventExecutionDataDetails
 -> LambdaFunctionSucceededEventDetails)
-> Parser (Maybe (Sensitive Text))
-> Parser
     (Maybe HistoryEventExecutionDataDetails
      -> LambdaFunctionSucceededEventDetails)
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
   -> LambdaFunctionSucceededEventDetails)
-> Parser (Maybe HistoryEventExecutionDataDetails)
-> Parser LambdaFunctionSucceededEventDetails
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
    LambdaFunctionSucceededEventDetails

instance
  Prelude.NFData
    LambdaFunctionSucceededEventDetails