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

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

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

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

instance Prelude.NFData ActivitySucceededEventDetails