{-# 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.TaskSubmittedEventDetails
-- 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.TaskSubmittedEventDetails 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
import Amazonka.StepFunctions.Types.HistoryEventExecutionDataDetails

-- | Contains details about a task submitted to a resource .
--
-- /See:/ 'newTaskSubmittedEventDetails' smart constructor.
data TaskSubmittedEventDetails = TaskSubmittedEventDetails'
  { -- | The response from a resource when a task has started. Length constraints
    -- apply to the payload size, and are expressed as bytes in UTF-8 encoding.
    TaskSubmittedEventDetails -> Maybe (Sensitive Text)
output :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | Contains details about the output of an execution history event.
    TaskSubmittedEventDetails -> Maybe HistoryEventExecutionDataDetails
outputDetails :: Prelude.Maybe HistoryEventExecutionDataDetails,
    -- | The service name of the resource in a task state.
    TaskSubmittedEventDetails -> Text
resourceType :: Prelude.Text,
    -- | The action of the resource called by a task state.
    TaskSubmittedEventDetails -> Text
resource :: Prelude.Text
  }
  deriving (TaskSubmittedEventDetails -> TaskSubmittedEventDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TaskSubmittedEventDetails -> TaskSubmittedEventDetails -> Bool
$c/= :: TaskSubmittedEventDetails -> TaskSubmittedEventDetails -> Bool
== :: TaskSubmittedEventDetails -> TaskSubmittedEventDetails -> Bool
$c== :: TaskSubmittedEventDetails -> TaskSubmittedEventDetails -> Bool
Prelude.Eq, Int -> TaskSubmittedEventDetails -> ShowS
[TaskSubmittedEventDetails] -> ShowS
TaskSubmittedEventDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TaskSubmittedEventDetails] -> ShowS
$cshowList :: [TaskSubmittedEventDetails] -> ShowS
show :: TaskSubmittedEventDetails -> String
$cshow :: TaskSubmittedEventDetails -> String
showsPrec :: Int -> TaskSubmittedEventDetails -> ShowS
$cshowsPrec :: Int -> TaskSubmittedEventDetails -> ShowS
Prelude.Show, forall x.
Rep TaskSubmittedEventDetails x -> TaskSubmittedEventDetails
forall x.
TaskSubmittedEventDetails -> Rep TaskSubmittedEventDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TaskSubmittedEventDetails x -> TaskSubmittedEventDetails
$cfrom :: forall x.
TaskSubmittedEventDetails -> Rep TaskSubmittedEventDetails x
Prelude.Generic)

-- |
-- Create a value of 'TaskSubmittedEventDetails' 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', 'taskSubmittedEventDetails_output' - The response from a resource when a task has started. Length constraints
-- apply to the payload size, and are expressed as bytes in UTF-8 encoding.
--
-- 'outputDetails', 'taskSubmittedEventDetails_outputDetails' - Contains details about the output of an execution history event.
--
-- 'resourceType', 'taskSubmittedEventDetails_resourceType' - The service name of the resource in a task state.
--
-- 'resource', 'taskSubmittedEventDetails_resource' - The action of the resource called by a task state.
newTaskSubmittedEventDetails ::
  -- | 'resourceType'
  Prelude.Text ->
  -- | 'resource'
  Prelude.Text ->
  TaskSubmittedEventDetails
newTaskSubmittedEventDetails :: Text -> Text -> TaskSubmittedEventDetails
newTaskSubmittedEventDetails
  Text
pResourceType_
  Text
pResource_ =
    TaskSubmittedEventDetails'
      { $sel:output:TaskSubmittedEventDetails' :: Maybe (Sensitive Text)
output =
          forall a. Maybe a
Prelude.Nothing,
        $sel:outputDetails:TaskSubmittedEventDetails' :: Maybe HistoryEventExecutionDataDetails
outputDetails = forall a. Maybe a
Prelude.Nothing,
        $sel:resourceType:TaskSubmittedEventDetails' :: Text
resourceType = Text
pResourceType_,
        $sel:resource:TaskSubmittedEventDetails' :: Text
resource = Text
pResource_
      }

-- | The response from a resource when a task has started. Length constraints
-- apply to the payload size, and are expressed as bytes in UTF-8 encoding.
taskSubmittedEventDetails_output :: Lens.Lens' TaskSubmittedEventDetails (Prelude.Maybe Prelude.Text)
taskSubmittedEventDetails_output :: Lens' TaskSubmittedEventDetails (Maybe Text)
taskSubmittedEventDetails_output = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskSubmittedEventDetails' {Maybe (Sensitive Text)
output :: Maybe (Sensitive Text)
$sel:output:TaskSubmittedEventDetails' :: TaskSubmittedEventDetails -> Maybe (Sensitive Text)
output} -> Maybe (Sensitive Text)
output) (\s :: TaskSubmittedEventDetails
s@TaskSubmittedEventDetails' {} Maybe (Sensitive Text)
a -> TaskSubmittedEventDetails
s {$sel:output:TaskSubmittedEventDetails' :: Maybe (Sensitive Text)
output = Maybe (Sensitive Text)
a} :: TaskSubmittedEventDetails) 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

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

-- | The service name of the resource in a task state.
taskSubmittedEventDetails_resourceType :: Lens.Lens' TaskSubmittedEventDetails Prelude.Text
taskSubmittedEventDetails_resourceType :: Lens' TaskSubmittedEventDetails Text
taskSubmittedEventDetails_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskSubmittedEventDetails' {Text
resourceType :: Text
$sel:resourceType:TaskSubmittedEventDetails' :: TaskSubmittedEventDetails -> Text
resourceType} -> Text
resourceType) (\s :: TaskSubmittedEventDetails
s@TaskSubmittedEventDetails' {} Text
a -> TaskSubmittedEventDetails
s {$sel:resourceType:TaskSubmittedEventDetails' :: Text
resourceType = Text
a} :: TaskSubmittedEventDetails)

-- | The action of the resource called by a task state.
taskSubmittedEventDetails_resource :: Lens.Lens' TaskSubmittedEventDetails Prelude.Text
taskSubmittedEventDetails_resource :: Lens' TaskSubmittedEventDetails Text
taskSubmittedEventDetails_resource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskSubmittedEventDetails' {Text
resource :: Text
$sel:resource:TaskSubmittedEventDetails' :: TaskSubmittedEventDetails -> Text
resource} -> Text
resource) (\s :: TaskSubmittedEventDetails
s@TaskSubmittedEventDetails' {} Text
a -> TaskSubmittedEventDetails
s {$sel:resource:TaskSubmittedEventDetails' :: Text
resource = Text
a} :: TaskSubmittedEventDetails)

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

instance Prelude.Hashable TaskSubmittedEventDetails where
  hashWithSalt :: Int -> TaskSubmittedEventDetails -> Int
hashWithSalt Int
_salt TaskSubmittedEventDetails' {Maybe (Sensitive Text)
Maybe HistoryEventExecutionDataDetails
Text
resource :: Text
resourceType :: Text
outputDetails :: Maybe HistoryEventExecutionDataDetails
output :: Maybe (Sensitive Text)
$sel:resource:TaskSubmittedEventDetails' :: TaskSubmittedEventDetails -> Text
$sel:resourceType:TaskSubmittedEventDetails' :: TaskSubmittedEventDetails -> Text
$sel:outputDetails:TaskSubmittedEventDetails' :: TaskSubmittedEventDetails -> Maybe HistoryEventExecutionDataDetails
$sel:output:TaskSubmittedEventDetails' :: TaskSubmittedEventDetails -> Maybe (Sensitive Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
output
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HistoryEventExecutionDataDetails
outputDetails
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resource

instance Prelude.NFData TaskSubmittedEventDetails where
  rnf :: TaskSubmittedEventDetails -> ()
rnf TaskSubmittedEventDetails' {Maybe (Sensitive Text)
Maybe HistoryEventExecutionDataDetails
Text
resource :: Text
resourceType :: Text
outputDetails :: Maybe HistoryEventExecutionDataDetails
output :: Maybe (Sensitive Text)
$sel:resource:TaskSubmittedEventDetails' :: TaskSubmittedEventDetails -> Text
$sel:resourceType:TaskSubmittedEventDetails' :: TaskSubmittedEventDetails -> Text
$sel:outputDetails:TaskSubmittedEventDetails' :: TaskSubmittedEventDetails -> Maybe HistoryEventExecutionDataDetails
$sel:output:TaskSubmittedEventDetails' :: TaskSubmittedEventDetails -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
output
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HistoryEventExecutionDataDetails
outputDetails
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resource