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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(LambdaFunctionScheduledEventAttributes
 -> LambdaFunctionScheduledEventAttributes -> Bool)
-> (LambdaFunctionScheduledEventAttributes
    -> LambdaFunctionScheduledEventAttributes -> Bool)
-> Eq LambdaFunctionScheduledEventAttributes
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]
(Int -> ReadS LambdaFunctionScheduledEventAttributes)
-> ReadS [LambdaFunctionScheduledEventAttributes]
-> ReadPrec LambdaFunctionScheduledEventAttributes
-> ReadPrec [LambdaFunctionScheduledEventAttributes]
-> Read 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
(Int -> LambdaFunctionScheduledEventAttributes -> ShowS)
-> (LambdaFunctionScheduledEventAttributes -> String)
-> ([LambdaFunctionScheduledEventAttributes] -> ShowS)
-> Show LambdaFunctionScheduledEventAttributes
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.
 LambdaFunctionScheduledEventAttributes
 -> Rep LambdaFunctionScheduledEventAttributes x)
-> (forall x.
    Rep LambdaFunctionScheduledEventAttributes x
    -> LambdaFunctionScheduledEventAttributes)
-> Generic LambdaFunctionScheduledEventAttributes
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' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> Integer
-> LambdaFunctionScheduledEventAttributes
LambdaFunctionScheduledEventAttributes'
      { $sel:control:LambdaFunctionScheduledEventAttributes' :: Maybe Text
control =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:input:LambdaFunctionScheduledEventAttributes' :: Maybe Text
input = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:startToCloseTimeout:LambdaFunctionScheduledEventAttributes' :: Maybe Text
startToCloseTimeout =
          Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> LambdaFunctionScheduledEventAttributes
-> f LambdaFunctionScheduledEventAttributes
lambdaFunctionScheduledEventAttributes_control = (LambdaFunctionScheduledEventAttributes -> Maybe Text)
-> (LambdaFunctionScheduledEventAttributes
    -> Maybe Text -> LambdaFunctionScheduledEventAttributes)
-> Lens
     LambdaFunctionScheduledEventAttributes
     LambdaFunctionScheduledEventAttributes
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> LambdaFunctionScheduledEventAttributes
-> f LambdaFunctionScheduledEventAttributes
lambdaFunctionScheduledEventAttributes_input = (LambdaFunctionScheduledEventAttributes -> Maybe Text)
-> (LambdaFunctionScheduledEventAttributes
    -> Maybe Text -> LambdaFunctionScheduledEventAttributes)
-> Lens
     LambdaFunctionScheduledEventAttributes
     LambdaFunctionScheduledEventAttributes
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> LambdaFunctionScheduledEventAttributes
-> f LambdaFunctionScheduledEventAttributes
lambdaFunctionScheduledEventAttributes_startToCloseTimeout = (LambdaFunctionScheduledEventAttributes -> Maybe Text)
-> (LambdaFunctionScheduledEventAttributes
    -> Maybe Text -> LambdaFunctionScheduledEventAttributes)
-> Lens
     LambdaFunctionScheduledEventAttributes
     LambdaFunctionScheduledEventAttributes
     (Maybe Text)
     (Maybe Text)
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 :: (Text -> f Text)
-> LambdaFunctionScheduledEventAttributes
-> f LambdaFunctionScheduledEventAttributes
lambdaFunctionScheduledEventAttributes_id = (LambdaFunctionScheduledEventAttributes -> Text)
-> (LambdaFunctionScheduledEventAttributes
    -> Text -> LambdaFunctionScheduledEventAttributes)
-> Lens
     LambdaFunctionScheduledEventAttributes
     LambdaFunctionScheduledEventAttributes
     Text
     Text
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 :: (Text -> f Text)
-> LambdaFunctionScheduledEventAttributes
-> f LambdaFunctionScheduledEventAttributes
lambdaFunctionScheduledEventAttributes_name = (LambdaFunctionScheduledEventAttributes -> Text)
-> (LambdaFunctionScheduledEventAttributes
    -> Text -> LambdaFunctionScheduledEventAttributes)
-> Lens
     LambdaFunctionScheduledEventAttributes
     LambdaFunctionScheduledEventAttributes
     Text
     Text
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 :: (Integer -> f Integer)
-> LambdaFunctionScheduledEventAttributes
-> f LambdaFunctionScheduledEventAttributes
lambdaFunctionScheduledEventAttributes_decisionTaskCompletedEventId = (LambdaFunctionScheduledEventAttributes -> Integer)
-> (LambdaFunctionScheduledEventAttributes
    -> Integer -> LambdaFunctionScheduledEventAttributes)
-> Lens
     LambdaFunctionScheduledEventAttributes
     LambdaFunctionScheduledEventAttributes
     Integer
     Integer
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
  Core.FromJSON
    LambdaFunctionScheduledEventAttributes
  where
  parseJSON :: Value -> Parser LambdaFunctionScheduledEventAttributes
parseJSON =
    String
-> (Object -> Parser LambdaFunctionScheduledEventAttributes)
-> Value
-> Parser LambdaFunctionScheduledEventAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LambdaFunctionScheduledEventAttributes"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> Integer
-> LambdaFunctionScheduledEventAttributes
LambdaFunctionScheduledEventAttributes'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Text
 -> Text
 -> Integer
 -> LambdaFunctionScheduledEventAttributes)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Text
      -> Text
      -> Integer
      -> LambdaFunctionScheduledEventAttributes)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"control")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Text
   -> Text
   -> Integer
   -> LambdaFunctionScheduledEventAttributes)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Text
      -> Text
      -> Integer
      -> LambdaFunctionScheduledEventAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"input")
            Parser
  (Maybe Text
   -> Text
   -> Text
   -> Integer
   -> LambdaFunctionScheduledEventAttributes)
-> Parser (Maybe Text)
-> Parser
     (Text -> Text -> Integer -> LambdaFunctionScheduledEventAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"startToCloseTimeout")
            Parser
  (Text -> Text -> Integer -> LambdaFunctionScheduledEventAttributes)
-> Parser Text
-> Parser
     (Text -> Integer -> LambdaFunctionScheduledEventAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"id")
            Parser (Text -> Integer -> LambdaFunctionScheduledEventAttributes)
-> Parser Text
-> Parser (Integer -> LambdaFunctionScheduledEventAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"name")
            Parser (Integer -> LambdaFunctionScheduledEventAttributes)
-> Parser Integer -> Parser LambdaFunctionScheduledEventAttributes
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Integer
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"decisionTaskCompletedEventId")
      )

instance
  Prelude.Hashable
    LambdaFunctionScheduledEventAttributes

instance
  Prelude.NFData
    LambdaFunctionScheduledEventAttributes