{-# 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.SWF.Types.LambdaFunctionScheduledEventAttributes
-- 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.SWF.Types.LambdaFunctionScheduledEventAttributes 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

-- | Provides the details of the @LambdaFunctionScheduled@ event. It isn\'t
-- set for other event types.
--
-- /See:/ 'newLambdaFunctionScheduledEventAttributes' smart constructor.
data LambdaFunctionScheduledEventAttributes = LambdaFunctionScheduledEventAttributes'
  { -- | Data attached to the event that the decider can use in subsequent
    -- workflow tasks. This data isn\'t sent to the Lambda task.
    LambdaFunctionScheduledEventAttributes -> Maybe Text
control :: Prelude.Maybe Prelude.Text,
    -- | The input provided to the Lambda task.
    LambdaFunctionScheduledEventAttributes -> Maybe Text
input :: Prelude.Maybe Prelude.Text,
    -- | The maximum amount of time a worker can take to process the Lambda task.
    LambdaFunctionScheduledEventAttributes -> Maybe Text
startToCloseTimeout :: Prelude.Maybe Prelude.Text,
    -- | The unique ID of the Lambda task.
    LambdaFunctionScheduledEventAttributes -> Text
id :: Prelude.Text,
    -- | The name of the Lambda function.
    LambdaFunctionScheduledEventAttributes -> Text
name :: Prelude.Text,
    -- | The ID of the @LambdaFunctionCompleted@ event corresponding to the
    -- decision that resulted in scheduling this activity task. To help
    -- diagnose issues, use this information to trace back the chain of events
    -- leading up to this event.
    LambdaFunctionScheduledEventAttributes -> Integer
decisionTaskCompletedEventId :: Prelude.Integer
  }
  deriving (LambdaFunctionScheduledEventAttributes
-> LambdaFunctionScheduledEventAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LambdaFunctionScheduledEventAttributes
-> LambdaFunctionScheduledEventAttributes -> Bool
$c/= :: LambdaFunctionScheduledEventAttributes
-> LambdaFunctionScheduledEventAttributes -> Bool
== :: LambdaFunctionScheduledEventAttributes
-> LambdaFunctionScheduledEventAttributes -> Bool
$c== :: LambdaFunctionScheduledEventAttributes
-> LambdaFunctionScheduledEventAttributes -> Bool
Prelude.Eq, ReadPrec [LambdaFunctionScheduledEventAttributes]
ReadPrec LambdaFunctionScheduledEventAttributes
Int -> ReadS LambdaFunctionScheduledEventAttributes
ReadS [LambdaFunctionScheduledEventAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LambdaFunctionScheduledEventAttributes]
$creadListPrec :: ReadPrec [LambdaFunctionScheduledEventAttributes]
readPrec :: ReadPrec LambdaFunctionScheduledEventAttributes
$creadPrec :: ReadPrec LambdaFunctionScheduledEventAttributes
readList :: ReadS [LambdaFunctionScheduledEventAttributes]
$creadList :: ReadS [LambdaFunctionScheduledEventAttributes]
readsPrec :: Int -> ReadS LambdaFunctionScheduledEventAttributes
$creadsPrec :: Int -> ReadS LambdaFunctionScheduledEventAttributes
Prelude.Read, Int -> LambdaFunctionScheduledEventAttributes -> ShowS
[LambdaFunctionScheduledEventAttributes] -> ShowS
LambdaFunctionScheduledEventAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LambdaFunctionScheduledEventAttributes] -> ShowS
$cshowList :: [LambdaFunctionScheduledEventAttributes] -> ShowS
show :: LambdaFunctionScheduledEventAttributes -> String
$cshow :: LambdaFunctionScheduledEventAttributes -> String
showsPrec :: Int -> LambdaFunctionScheduledEventAttributes -> ShowS
$cshowsPrec :: Int -> LambdaFunctionScheduledEventAttributes -> ShowS
Prelude.Show, forall x.
Rep LambdaFunctionScheduledEventAttributes x
-> LambdaFunctionScheduledEventAttributes
forall x.
LambdaFunctionScheduledEventAttributes
-> Rep LambdaFunctionScheduledEventAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LambdaFunctionScheduledEventAttributes x
-> LambdaFunctionScheduledEventAttributes
$cfrom :: forall x.
LambdaFunctionScheduledEventAttributes
-> Rep LambdaFunctionScheduledEventAttributes x
Prelude.Generic)

-- |
-- Create a value of 'LambdaFunctionScheduledEventAttributes' 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:
--
-- 'control', 'lambdaFunctionScheduledEventAttributes_control' - Data attached to the event that the decider can use in subsequent
-- workflow tasks. This data isn\'t sent to the Lambda task.
--
-- 'input', 'lambdaFunctionScheduledEventAttributes_input' - The input provided to the Lambda task.
--
-- 'startToCloseTimeout', 'lambdaFunctionScheduledEventAttributes_startToCloseTimeout' - The maximum amount of time a worker can take to process the Lambda task.
--
-- 'id', 'lambdaFunctionScheduledEventAttributes_id' - The unique ID of the Lambda task.
--
-- 'name', 'lambdaFunctionScheduledEventAttributes_name' - The name of the Lambda function.
--
-- 'decisionTaskCompletedEventId', 'lambdaFunctionScheduledEventAttributes_decisionTaskCompletedEventId' - The ID of the @LambdaFunctionCompleted@ event corresponding to the
-- decision that resulted in scheduling this activity task. To help
-- diagnose issues, use this information to trace back the chain of events
-- leading up to this event.
newLambdaFunctionScheduledEventAttributes ::
  -- | 'id'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'decisionTaskCompletedEventId'
  Prelude.Integer ->
  LambdaFunctionScheduledEventAttributes
newLambdaFunctionScheduledEventAttributes :: Text -> Text -> Integer -> LambdaFunctionScheduledEventAttributes
newLambdaFunctionScheduledEventAttributes
  Text
pId_
  Text
pName_
  Integer
pDecisionTaskCompletedEventId_ =
    LambdaFunctionScheduledEventAttributes'
      { $sel:control:LambdaFunctionScheduledEventAttributes' :: Maybe Text
control =
          forall a. Maybe a
Prelude.Nothing,
        $sel:input:LambdaFunctionScheduledEventAttributes' :: Maybe Text
input = forall a. Maybe a
Prelude.Nothing,
        $sel:startToCloseTimeout:LambdaFunctionScheduledEventAttributes' :: Maybe Text
startToCloseTimeout =
          forall a. Maybe a
Prelude.Nothing,
        $sel:id:LambdaFunctionScheduledEventAttributes' :: Text
id = Text
pId_,
        $sel:name:LambdaFunctionScheduledEventAttributes' :: Text
name = Text
pName_,
        $sel:decisionTaskCompletedEventId:LambdaFunctionScheduledEventAttributes' :: Integer
decisionTaskCompletedEventId =
          Integer
pDecisionTaskCompletedEventId_
      }

-- | Data attached to the event that the decider can use in subsequent
-- workflow tasks. This data isn\'t sent to the Lambda task.
lambdaFunctionScheduledEventAttributes_control :: Lens.Lens' LambdaFunctionScheduledEventAttributes (Prelude.Maybe Prelude.Text)
lambdaFunctionScheduledEventAttributes_control :: Lens' LambdaFunctionScheduledEventAttributes (Maybe Text)
lambdaFunctionScheduledEventAttributes_control = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionScheduledEventAttributes' {Maybe Text
control :: Maybe Text
$sel:control:LambdaFunctionScheduledEventAttributes' :: LambdaFunctionScheduledEventAttributes -> Maybe Text
control} -> Maybe Text
control) (\s :: LambdaFunctionScheduledEventAttributes
s@LambdaFunctionScheduledEventAttributes' {} Maybe Text
a -> LambdaFunctionScheduledEventAttributes
s {$sel:control:LambdaFunctionScheduledEventAttributes' :: Maybe Text
control = Maybe Text
a} :: LambdaFunctionScheduledEventAttributes)

-- | The input provided to the Lambda task.
lambdaFunctionScheduledEventAttributes_input :: Lens.Lens' LambdaFunctionScheduledEventAttributes (Prelude.Maybe Prelude.Text)
lambdaFunctionScheduledEventAttributes_input :: Lens' LambdaFunctionScheduledEventAttributes (Maybe Text)
lambdaFunctionScheduledEventAttributes_input = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionScheduledEventAttributes' {Maybe Text
input :: Maybe Text
$sel:input:LambdaFunctionScheduledEventAttributes' :: LambdaFunctionScheduledEventAttributes -> Maybe Text
input} -> Maybe Text
input) (\s :: LambdaFunctionScheduledEventAttributes
s@LambdaFunctionScheduledEventAttributes' {} Maybe Text
a -> LambdaFunctionScheduledEventAttributes
s {$sel:input:LambdaFunctionScheduledEventAttributes' :: Maybe Text
input = Maybe Text
a} :: LambdaFunctionScheduledEventAttributes)

-- | The maximum amount of time a worker can take to process the Lambda task.
lambdaFunctionScheduledEventAttributes_startToCloseTimeout :: Lens.Lens' LambdaFunctionScheduledEventAttributes (Prelude.Maybe Prelude.Text)
lambdaFunctionScheduledEventAttributes_startToCloseTimeout :: Lens' LambdaFunctionScheduledEventAttributes (Maybe Text)
lambdaFunctionScheduledEventAttributes_startToCloseTimeout = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionScheduledEventAttributes' {Maybe Text
startToCloseTimeout :: Maybe Text
$sel:startToCloseTimeout:LambdaFunctionScheduledEventAttributes' :: LambdaFunctionScheduledEventAttributes -> Maybe Text
startToCloseTimeout} -> Maybe Text
startToCloseTimeout) (\s :: LambdaFunctionScheduledEventAttributes
s@LambdaFunctionScheduledEventAttributes' {} Maybe Text
a -> LambdaFunctionScheduledEventAttributes
s {$sel:startToCloseTimeout:LambdaFunctionScheduledEventAttributes' :: Maybe Text
startToCloseTimeout = Maybe Text
a} :: LambdaFunctionScheduledEventAttributes)

-- | The unique ID of the Lambda task.
lambdaFunctionScheduledEventAttributes_id :: Lens.Lens' LambdaFunctionScheduledEventAttributes Prelude.Text
lambdaFunctionScheduledEventAttributes_id :: Lens' LambdaFunctionScheduledEventAttributes Text
lambdaFunctionScheduledEventAttributes_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionScheduledEventAttributes' {Text
id :: Text
$sel:id:LambdaFunctionScheduledEventAttributes' :: LambdaFunctionScheduledEventAttributes -> Text
id} -> Text
id) (\s :: LambdaFunctionScheduledEventAttributes
s@LambdaFunctionScheduledEventAttributes' {} Text
a -> LambdaFunctionScheduledEventAttributes
s {$sel:id:LambdaFunctionScheduledEventAttributes' :: Text
id = Text
a} :: LambdaFunctionScheduledEventAttributes)

-- | The name of the Lambda function.
lambdaFunctionScheduledEventAttributes_name :: Lens.Lens' LambdaFunctionScheduledEventAttributes Prelude.Text
lambdaFunctionScheduledEventAttributes_name :: Lens' LambdaFunctionScheduledEventAttributes Text
lambdaFunctionScheduledEventAttributes_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionScheduledEventAttributes' {Text
name :: Text
$sel:name:LambdaFunctionScheduledEventAttributes' :: LambdaFunctionScheduledEventAttributes -> Text
name} -> Text
name) (\s :: LambdaFunctionScheduledEventAttributes
s@LambdaFunctionScheduledEventAttributes' {} Text
a -> LambdaFunctionScheduledEventAttributes
s {$sel:name:LambdaFunctionScheduledEventAttributes' :: Text
name = Text
a} :: LambdaFunctionScheduledEventAttributes)

-- | The ID of the @LambdaFunctionCompleted@ event corresponding to the
-- decision that resulted in scheduling this activity task. To help
-- diagnose issues, use this information to trace back the chain of events
-- leading up to this event.
lambdaFunctionScheduledEventAttributes_decisionTaskCompletedEventId :: Lens.Lens' LambdaFunctionScheduledEventAttributes Prelude.Integer
lambdaFunctionScheduledEventAttributes_decisionTaskCompletedEventId :: Lens' LambdaFunctionScheduledEventAttributes Integer
lambdaFunctionScheduledEventAttributes_decisionTaskCompletedEventId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionScheduledEventAttributes' {Integer
decisionTaskCompletedEventId :: Integer
$sel:decisionTaskCompletedEventId:LambdaFunctionScheduledEventAttributes' :: LambdaFunctionScheduledEventAttributes -> Integer
decisionTaskCompletedEventId} -> Integer
decisionTaskCompletedEventId) (\s :: LambdaFunctionScheduledEventAttributes
s@LambdaFunctionScheduledEventAttributes' {} Integer
a -> LambdaFunctionScheduledEventAttributes
s {$sel:decisionTaskCompletedEventId:LambdaFunctionScheduledEventAttributes' :: Integer
decisionTaskCompletedEventId = Integer
a} :: LambdaFunctionScheduledEventAttributes)

instance
  Data.FromJSON
    LambdaFunctionScheduledEventAttributes
  where
  parseJSON :: Value -> Parser LambdaFunctionScheduledEventAttributes
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LambdaFunctionScheduledEventAttributes"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> Integer
-> LambdaFunctionScheduledEventAttributes
LambdaFunctionScheduledEventAttributes'
            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
"control")
            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
"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
"startToCloseTimeout")
            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
"id")
            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
"name")
            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
"decisionTaskCompletedEventId")
      )

instance
  Prelude.Hashable
    LambdaFunctionScheduledEventAttributes
  where
  hashWithSalt :: Int -> LambdaFunctionScheduledEventAttributes -> Int
hashWithSalt
    Int
_salt
    LambdaFunctionScheduledEventAttributes' {Integer
Maybe Text
Text
decisionTaskCompletedEventId :: Integer
name :: Text
id :: Text
startToCloseTimeout :: Maybe Text
input :: Maybe Text
control :: Maybe Text
$sel:decisionTaskCompletedEventId:LambdaFunctionScheduledEventAttributes' :: LambdaFunctionScheduledEventAttributes -> Integer
$sel:name:LambdaFunctionScheduledEventAttributes' :: LambdaFunctionScheduledEventAttributes -> Text
$sel:id:LambdaFunctionScheduledEventAttributes' :: LambdaFunctionScheduledEventAttributes -> Text
$sel:startToCloseTimeout:LambdaFunctionScheduledEventAttributes' :: LambdaFunctionScheduledEventAttributes -> Maybe Text
$sel:input:LambdaFunctionScheduledEventAttributes' :: LambdaFunctionScheduledEventAttributes -> Maybe Text
$sel:control:LambdaFunctionScheduledEventAttributes' :: LambdaFunctionScheduledEventAttributes -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
control
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
input
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
startToCloseTimeout
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
decisionTaskCompletedEventId

instance
  Prelude.NFData
    LambdaFunctionScheduledEventAttributes
  where
  rnf :: LambdaFunctionScheduledEventAttributes -> ()
rnf LambdaFunctionScheduledEventAttributes' {Integer
Maybe Text
Text
decisionTaskCompletedEventId :: Integer
name :: Text
id :: Text
startToCloseTimeout :: Maybe Text
input :: Maybe Text
control :: Maybe Text
$sel:decisionTaskCompletedEventId:LambdaFunctionScheduledEventAttributes' :: LambdaFunctionScheduledEventAttributes -> Integer
$sel:name:LambdaFunctionScheduledEventAttributes' :: LambdaFunctionScheduledEventAttributes -> Text
$sel:id:LambdaFunctionScheduledEventAttributes' :: LambdaFunctionScheduledEventAttributes -> Text
$sel:startToCloseTimeout:LambdaFunctionScheduledEventAttributes' :: LambdaFunctionScheduledEventAttributes -> Maybe Text
$sel:input:LambdaFunctionScheduledEventAttributes' :: LambdaFunctionScheduledEventAttributes -> Maybe Text
$sel:control:LambdaFunctionScheduledEventAttributes' :: LambdaFunctionScheduledEventAttributes -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
control
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
input
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
startToCloseTimeout
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
decisionTaskCompletedEventId