{-# 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.LambdaFunctionScheduledEventDetails
-- 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.LambdaFunctionScheduledEventDetails 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
import Amazonka.StepFunctions.Types.TaskCredentials

-- | Contains details about a Lambda function scheduled during an execution.
--
-- /See:/ 'newLambdaFunctionScheduledEventDetails' smart constructor.
data LambdaFunctionScheduledEventDetails = LambdaFunctionScheduledEventDetails'
  { -- | The JSON data input to the Lambda function. Length constraints apply to
    -- the payload size, and are expressed as bytes in UTF-8 encoding.
    LambdaFunctionScheduledEventDetails -> Maybe (Sensitive Text)
input :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | Contains details about input for an execution history event.
    LambdaFunctionScheduledEventDetails
-> Maybe HistoryEventExecutionDataDetails
inputDetails :: Prelude.Maybe HistoryEventExecutionDataDetails,
    -- | The credentials that Step Functions uses for the task.
    LambdaFunctionScheduledEventDetails -> Maybe TaskCredentials
taskCredentials :: Prelude.Maybe TaskCredentials,
    -- | The maximum allowed duration of the Lambda function.
    LambdaFunctionScheduledEventDetails -> Maybe Integer
timeoutInSeconds :: Prelude.Maybe Prelude.Integer,
    -- | The Amazon Resource Name (ARN) of the scheduled Lambda function.
    LambdaFunctionScheduledEventDetails -> Text
resource :: Prelude.Text
  }
  deriving (LambdaFunctionScheduledEventDetails
-> LambdaFunctionScheduledEventDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LambdaFunctionScheduledEventDetails
-> LambdaFunctionScheduledEventDetails -> Bool
$c/= :: LambdaFunctionScheduledEventDetails
-> LambdaFunctionScheduledEventDetails -> Bool
== :: LambdaFunctionScheduledEventDetails
-> LambdaFunctionScheduledEventDetails -> Bool
$c== :: LambdaFunctionScheduledEventDetails
-> LambdaFunctionScheduledEventDetails -> Bool
Prelude.Eq, Int -> LambdaFunctionScheduledEventDetails -> ShowS
[LambdaFunctionScheduledEventDetails] -> ShowS
LambdaFunctionScheduledEventDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LambdaFunctionScheduledEventDetails] -> ShowS
$cshowList :: [LambdaFunctionScheduledEventDetails] -> ShowS
show :: LambdaFunctionScheduledEventDetails -> String
$cshow :: LambdaFunctionScheduledEventDetails -> String
showsPrec :: Int -> LambdaFunctionScheduledEventDetails -> ShowS
$cshowsPrec :: Int -> LambdaFunctionScheduledEventDetails -> ShowS
Prelude.Show, forall x.
Rep LambdaFunctionScheduledEventDetails x
-> LambdaFunctionScheduledEventDetails
forall x.
LambdaFunctionScheduledEventDetails
-> Rep LambdaFunctionScheduledEventDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LambdaFunctionScheduledEventDetails x
-> LambdaFunctionScheduledEventDetails
$cfrom :: forall x.
LambdaFunctionScheduledEventDetails
-> Rep LambdaFunctionScheduledEventDetails x
Prelude.Generic)

-- |
-- Create a value of 'LambdaFunctionScheduledEventDetails' 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:
--
-- 'input', 'lambdaFunctionScheduledEventDetails_input' - The JSON data input to the Lambda function. Length constraints apply to
-- the payload size, and are expressed as bytes in UTF-8 encoding.
--
-- 'inputDetails', 'lambdaFunctionScheduledEventDetails_inputDetails' - Contains details about input for an execution history event.
--
-- 'taskCredentials', 'lambdaFunctionScheduledEventDetails_taskCredentials' - The credentials that Step Functions uses for the task.
--
-- 'timeoutInSeconds', 'lambdaFunctionScheduledEventDetails_timeoutInSeconds' - The maximum allowed duration of the Lambda function.
--
-- 'resource', 'lambdaFunctionScheduledEventDetails_resource' - The Amazon Resource Name (ARN) of the scheduled Lambda function.
newLambdaFunctionScheduledEventDetails ::
  -- | 'resource'
  Prelude.Text ->
  LambdaFunctionScheduledEventDetails
newLambdaFunctionScheduledEventDetails :: Text -> LambdaFunctionScheduledEventDetails
newLambdaFunctionScheduledEventDetails Text
pResource_ =
  LambdaFunctionScheduledEventDetails'
    { $sel:input:LambdaFunctionScheduledEventDetails' :: Maybe (Sensitive Text)
input =
        forall a. Maybe a
Prelude.Nothing,
      $sel:inputDetails:LambdaFunctionScheduledEventDetails' :: Maybe HistoryEventExecutionDataDetails
inputDetails = forall a. Maybe a
Prelude.Nothing,
      $sel:taskCredentials:LambdaFunctionScheduledEventDetails' :: Maybe TaskCredentials
taskCredentials = forall a. Maybe a
Prelude.Nothing,
      $sel:timeoutInSeconds:LambdaFunctionScheduledEventDetails' :: Maybe Integer
timeoutInSeconds = forall a. Maybe a
Prelude.Nothing,
      $sel:resource:LambdaFunctionScheduledEventDetails' :: Text
resource = Text
pResource_
    }

-- | The JSON data input to the Lambda function. Length constraints apply to
-- the payload size, and are expressed as bytes in UTF-8 encoding.
lambdaFunctionScheduledEventDetails_input :: Lens.Lens' LambdaFunctionScheduledEventDetails (Prelude.Maybe Prelude.Text)
lambdaFunctionScheduledEventDetails_input :: Lens' LambdaFunctionScheduledEventDetails (Maybe Text)
lambdaFunctionScheduledEventDetails_input = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionScheduledEventDetails' {Maybe (Sensitive Text)
input :: Maybe (Sensitive Text)
$sel:input:LambdaFunctionScheduledEventDetails' :: LambdaFunctionScheduledEventDetails -> Maybe (Sensitive Text)
input} -> Maybe (Sensitive Text)
input) (\s :: LambdaFunctionScheduledEventDetails
s@LambdaFunctionScheduledEventDetails' {} Maybe (Sensitive Text)
a -> LambdaFunctionScheduledEventDetails
s {$sel:input:LambdaFunctionScheduledEventDetails' :: Maybe (Sensitive Text)
input = Maybe (Sensitive Text)
a} :: LambdaFunctionScheduledEventDetails) 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 input for an execution history event.
lambdaFunctionScheduledEventDetails_inputDetails :: Lens.Lens' LambdaFunctionScheduledEventDetails (Prelude.Maybe HistoryEventExecutionDataDetails)
lambdaFunctionScheduledEventDetails_inputDetails :: Lens'
  LambdaFunctionScheduledEventDetails
  (Maybe HistoryEventExecutionDataDetails)
lambdaFunctionScheduledEventDetails_inputDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionScheduledEventDetails' {Maybe HistoryEventExecutionDataDetails
inputDetails :: Maybe HistoryEventExecutionDataDetails
$sel:inputDetails:LambdaFunctionScheduledEventDetails' :: LambdaFunctionScheduledEventDetails
-> Maybe HistoryEventExecutionDataDetails
inputDetails} -> Maybe HistoryEventExecutionDataDetails
inputDetails) (\s :: LambdaFunctionScheduledEventDetails
s@LambdaFunctionScheduledEventDetails' {} Maybe HistoryEventExecutionDataDetails
a -> LambdaFunctionScheduledEventDetails
s {$sel:inputDetails:LambdaFunctionScheduledEventDetails' :: Maybe HistoryEventExecutionDataDetails
inputDetails = Maybe HistoryEventExecutionDataDetails
a} :: LambdaFunctionScheduledEventDetails)

-- | The credentials that Step Functions uses for the task.
lambdaFunctionScheduledEventDetails_taskCredentials :: Lens.Lens' LambdaFunctionScheduledEventDetails (Prelude.Maybe TaskCredentials)
lambdaFunctionScheduledEventDetails_taskCredentials :: Lens' LambdaFunctionScheduledEventDetails (Maybe TaskCredentials)
lambdaFunctionScheduledEventDetails_taskCredentials = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionScheduledEventDetails' {Maybe TaskCredentials
taskCredentials :: Maybe TaskCredentials
$sel:taskCredentials:LambdaFunctionScheduledEventDetails' :: LambdaFunctionScheduledEventDetails -> Maybe TaskCredentials
taskCredentials} -> Maybe TaskCredentials
taskCredentials) (\s :: LambdaFunctionScheduledEventDetails
s@LambdaFunctionScheduledEventDetails' {} Maybe TaskCredentials
a -> LambdaFunctionScheduledEventDetails
s {$sel:taskCredentials:LambdaFunctionScheduledEventDetails' :: Maybe TaskCredentials
taskCredentials = Maybe TaskCredentials
a} :: LambdaFunctionScheduledEventDetails)

-- | The maximum allowed duration of the Lambda function.
lambdaFunctionScheduledEventDetails_timeoutInSeconds :: Lens.Lens' LambdaFunctionScheduledEventDetails (Prelude.Maybe Prelude.Integer)
lambdaFunctionScheduledEventDetails_timeoutInSeconds :: Lens' LambdaFunctionScheduledEventDetails (Maybe Integer)
lambdaFunctionScheduledEventDetails_timeoutInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionScheduledEventDetails' {Maybe Integer
timeoutInSeconds :: Maybe Integer
$sel:timeoutInSeconds:LambdaFunctionScheduledEventDetails' :: LambdaFunctionScheduledEventDetails -> Maybe Integer
timeoutInSeconds} -> Maybe Integer
timeoutInSeconds) (\s :: LambdaFunctionScheduledEventDetails
s@LambdaFunctionScheduledEventDetails' {} Maybe Integer
a -> LambdaFunctionScheduledEventDetails
s {$sel:timeoutInSeconds:LambdaFunctionScheduledEventDetails' :: Maybe Integer
timeoutInSeconds = Maybe Integer
a} :: LambdaFunctionScheduledEventDetails)

-- | The Amazon Resource Name (ARN) of the scheduled Lambda function.
lambdaFunctionScheduledEventDetails_resource :: Lens.Lens' LambdaFunctionScheduledEventDetails Prelude.Text
lambdaFunctionScheduledEventDetails_resource :: Lens' LambdaFunctionScheduledEventDetails Text
lambdaFunctionScheduledEventDetails_resource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionScheduledEventDetails' {Text
resource :: Text
$sel:resource:LambdaFunctionScheduledEventDetails' :: LambdaFunctionScheduledEventDetails -> Text
resource} -> Text
resource) (\s :: LambdaFunctionScheduledEventDetails
s@LambdaFunctionScheduledEventDetails' {} Text
a -> LambdaFunctionScheduledEventDetails
s {$sel:resource:LambdaFunctionScheduledEventDetails' :: Text
resource = Text
a} :: LambdaFunctionScheduledEventDetails)

instance
  Data.FromJSON
    LambdaFunctionScheduledEventDetails
  where
  parseJSON :: Value -> Parser LambdaFunctionScheduledEventDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LambdaFunctionScheduledEventDetails"
      ( \Object
x ->
          Maybe (Sensitive Text)
-> Maybe HistoryEventExecutionDataDetails
-> Maybe TaskCredentials
-> Maybe Integer
-> Text
-> LambdaFunctionScheduledEventDetails
LambdaFunctionScheduledEventDetails'
            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
"input")
            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
"inputDetails")
            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
"taskCredentials")
            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
"timeoutInSeconds")
            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
    LambdaFunctionScheduledEventDetails
  where
  hashWithSalt :: Int -> LambdaFunctionScheduledEventDetails -> Int
hashWithSalt
    Int
_salt
    LambdaFunctionScheduledEventDetails' {Maybe Integer
Maybe (Sensitive Text)
Maybe HistoryEventExecutionDataDetails
Maybe TaskCredentials
Text
resource :: Text
timeoutInSeconds :: Maybe Integer
taskCredentials :: Maybe TaskCredentials
inputDetails :: Maybe HistoryEventExecutionDataDetails
input :: Maybe (Sensitive Text)
$sel:resource:LambdaFunctionScheduledEventDetails' :: LambdaFunctionScheduledEventDetails -> Text
$sel:timeoutInSeconds:LambdaFunctionScheduledEventDetails' :: LambdaFunctionScheduledEventDetails -> Maybe Integer
$sel:taskCredentials:LambdaFunctionScheduledEventDetails' :: LambdaFunctionScheduledEventDetails -> Maybe TaskCredentials
$sel:inputDetails:LambdaFunctionScheduledEventDetails' :: LambdaFunctionScheduledEventDetails
-> Maybe HistoryEventExecutionDataDetails
$sel:input:LambdaFunctionScheduledEventDetails' :: LambdaFunctionScheduledEventDetails -> Maybe (Sensitive Text)
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
input
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HistoryEventExecutionDataDetails
inputDetails
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TaskCredentials
taskCredentials
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
timeoutInSeconds
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resource

instance
  Prelude.NFData
    LambdaFunctionScheduledEventDetails
  where
  rnf :: LambdaFunctionScheduledEventDetails -> ()
rnf LambdaFunctionScheduledEventDetails' {Maybe Integer
Maybe (Sensitive Text)
Maybe HistoryEventExecutionDataDetails
Maybe TaskCredentials
Text
resource :: Text
timeoutInSeconds :: Maybe Integer
taskCredentials :: Maybe TaskCredentials
inputDetails :: Maybe HistoryEventExecutionDataDetails
input :: Maybe (Sensitive Text)
$sel:resource:LambdaFunctionScheduledEventDetails' :: LambdaFunctionScheduledEventDetails -> Text
$sel:timeoutInSeconds:LambdaFunctionScheduledEventDetails' :: LambdaFunctionScheduledEventDetails -> Maybe Integer
$sel:taskCredentials:LambdaFunctionScheduledEventDetails' :: LambdaFunctionScheduledEventDetails -> Maybe TaskCredentials
$sel:inputDetails:LambdaFunctionScheduledEventDetails' :: LambdaFunctionScheduledEventDetails
-> Maybe HistoryEventExecutionDataDetails
$sel:input:LambdaFunctionScheduledEventDetails' :: LambdaFunctionScheduledEventDetails -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
input
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HistoryEventExecutionDataDetails
inputDetails
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TaskCredentials
taskCredentials
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
timeoutInSeconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resource