{-# 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.GreengrassV2.Types.LambdaExecutionParameters
-- 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.GreengrassV2.Types.LambdaExecutionParameters where

import qualified Amazonka.Core as Core
import Amazonka.GreengrassV2.Types.LambdaEventSource
import Amazonka.GreengrassV2.Types.LambdaInputPayloadEncodingType
import Amazonka.GreengrassV2.Types.LambdaLinuxProcessParams
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains parameters for a Lambda function that runs on IoT Greengrass.
--
-- /See:/ 'newLambdaExecutionParameters' smart constructor.
data LambdaExecutionParameters = LambdaExecutionParameters'
  { -- | The list of arguments to pass to the Lambda function when it runs.
    LambdaExecutionParameters -> Maybe [Text]
execArgs :: Prelude.Maybe [Prelude.Text],
    -- | The maximum size of the message queue for the Lambda function component.
    -- The IoT Greengrass core stores messages in a FIFO (first-in-first-out)
    -- queue until it can run the Lambda function to consume each message.
    LambdaExecutionParameters -> Maybe Int
maxQueueSize :: Prelude.Maybe Prelude.Int,
    -- | Whether or not the Lambda function is pinned, or long-lived.
    --
    -- -   A pinned Lambda function starts when IoT Greengrass starts and keeps
    --     running in its own container.
    --
    -- -   A non-pinned Lambda function starts only when it receives a work
    --     item and exists after it idles for @maxIdleTimeInSeconds@. If the
    --     function has multiple work items, the IoT Greengrass Core software
    --     creates multiple instances of the function.
    --
    -- Default: @true@
    LambdaExecutionParameters -> Maybe Bool
pinned :: Prelude.Maybe Prelude.Bool,
    -- | The encoding type that the Lambda function supports.
    --
    -- Default: @json@
    LambdaExecutionParameters -> Maybe LambdaInputPayloadEncodingType
inputPayloadEncodingType :: Prelude.Maybe LambdaInputPayloadEncodingType,
    -- | The maximum amount of time in seconds that a non-pinned Lambda function
    -- can idle before the IoT Greengrass Core software stops its process.
    LambdaExecutionParameters -> Maybe Int
maxIdleTimeInSeconds :: Prelude.Maybe Prelude.Int,
    -- | The maximum amount of time in seconds that the Lambda function can
    -- process a work item.
    LambdaExecutionParameters -> Maybe Int
timeoutInSeconds :: Prelude.Maybe Prelude.Int,
    -- | The list of event sources to which to subscribe to receive work
    -- messages. The Lambda function runs when it receives a message from an
    -- event source. You can subscribe this function to local
    -- publish\/subscribe messages and Amazon Web Services IoT Core MQTT
    -- messages.
    LambdaExecutionParameters -> Maybe [LambdaEventSource]
eventSources :: Prelude.Maybe [LambdaEventSource],
    -- | The maximum number of instances that a non-pinned Lambda function can
    -- run at the same time.
    LambdaExecutionParameters -> Maybe Int
maxInstancesCount :: Prelude.Maybe Prelude.Int,
    -- | The map of environment variables that are available to the Lambda
    -- function when it runs.
    LambdaExecutionParameters -> Maybe (HashMap Text Text)
environmentVariables :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The interval in seconds at which a pinned (also known as long-lived)
    -- Lambda function component sends status updates to the Lambda manager
    -- component.
    LambdaExecutionParameters -> Maybe Int
statusTimeoutInSeconds :: Prelude.Maybe Prelude.Int,
    -- | The parameters for the Linux process that contains the Lambda function.
    LambdaExecutionParameters -> Maybe LambdaLinuxProcessParams
linuxProcessParams :: Prelude.Maybe LambdaLinuxProcessParams
  }
  deriving (LambdaExecutionParameters -> LambdaExecutionParameters -> Bool
(LambdaExecutionParameters -> LambdaExecutionParameters -> Bool)
-> (LambdaExecutionParameters -> LambdaExecutionParameters -> Bool)
-> Eq LambdaExecutionParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LambdaExecutionParameters -> LambdaExecutionParameters -> Bool
$c/= :: LambdaExecutionParameters -> LambdaExecutionParameters -> Bool
== :: LambdaExecutionParameters -> LambdaExecutionParameters -> Bool
$c== :: LambdaExecutionParameters -> LambdaExecutionParameters -> Bool
Prelude.Eq, ReadPrec [LambdaExecutionParameters]
ReadPrec LambdaExecutionParameters
Int -> ReadS LambdaExecutionParameters
ReadS [LambdaExecutionParameters]
(Int -> ReadS LambdaExecutionParameters)
-> ReadS [LambdaExecutionParameters]
-> ReadPrec LambdaExecutionParameters
-> ReadPrec [LambdaExecutionParameters]
-> Read LambdaExecutionParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LambdaExecutionParameters]
$creadListPrec :: ReadPrec [LambdaExecutionParameters]
readPrec :: ReadPrec LambdaExecutionParameters
$creadPrec :: ReadPrec LambdaExecutionParameters
readList :: ReadS [LambdaExecutionParameters]
$creadList :: ReadS [LambdaExecutionParameters]
readsPrec :: Int -> ReadS LambdaExecutionParameters
$creadsPrec :: Int -> ReadS LambdaExecutionParameters
Prelude.Read, Int -> LambdaExecutionParameters -> ShowS
[LambdaExecutionParameters] -> ShowS
LambdaExecutionParameters -> String
(Int -> LambdaExecutionParameters -> ShowS)
-> (LambdaExecutionParameters -> String)
-> ([LambdaExecutionParameters] -> ShowS)
-> Show LambdaExecutionParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LambdaExecutionParameters] -> ShowS
$cshowList :: [LambdaExecutionParameters] -> ShowS
show :: LambdaExecutionParameters -> String
$cshow :: LambdaExecutionParameters -> String
showsPrec :: Int -> LambdaExecutionParameters -> ShowS
$cshowsPrec :: Int -> LambdaExecutionParameters -> ShowS
Prelude.Show, (forall x.
 LambdaExecutionParameters -> Rep LambdaExecutionParameters x)
-> (forall x.
    Rep LambdaExecutionParameters x -> LambdaExecutionParameters)
-> Generic LambdaExecutionParameters
forall x.
Rep LambdaExecutionParameters x -> LambdaExecutionParameters
forall x.
LambdaExecutionParameters -> Rep LambdaExecutionParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LambdaExecutionParameters x -> LambdaExecutionParameters
$cfrom :: forall x.
LambdaExecutionParameters -> Rep LambdaExecutionParameters x
Prelude.Generic)

-- |
-- Create a value of 'LambdaExecutionParameters' 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:
--
-- 'execArgs', 'lambdaExecutionParameters_execArgs' - The list of arguments to pass to the Lambda function when it runs.
--
-- 'maxQueueSize', 'lambdaExecutionParameters_maxQueueSize' - The maximum size of the message queue for the Lambda function component.
-- The IoT Greengrass core stores messages in a FIFO (first-in-first-out)
-- queue until it can run the Lambda function to consume each message.
--
-- 'pinned', 'lambdaExecutionParameters_pinned' - Whether or not the Lambda function is pinned, or long-lived.
--
-- -   A pinned Lambda function starts when IoT Greengrass starts and keeps
--     running in its own container.
--
-- -   A non-pinned Lambda function starts only when it receives a work
--     item and exists after it idles for @maxIdleTimeInSeconds@. If the
--     function has multiple work items, the IoT Greengrass Core software
--     creates multiple instances of the function.
--
-- Default: @true@
--
-- 'inputPayloadEncodingType', 'lambdaExecutionParameters_inputPayloadEncodingType' - The encoding type that the Lambda function supports.
--
-- Default: @json@
--
-- 'maxIdleTimeInSeconds', 'lambdaExecutionParameters_maxIdleTimeInSeconds' - The maximum amount of time in seconds that a non-pinned Lambda function
-- can idle before the IoT Greengrass Core software stops its process.
--
-- 'timeoutInSeconds', 'lambdaExecutionParameters_timeoutInSeconds' - The maximum amount of time in seconds that the Lambda function can
-- process a work item.
--
-- 'eventSources', 'lambdaExecutionParameters_eventSources' - The list of event sources to which to subscribe to receive work
-- messages. The Lambda function runs when it receives a message from an
-- event source. You can subscribe this function to local
-- publish\/subscribe messages and Amazon Web Services IoT Core MQTT
-- messages.
--
-- 'maxInstancesCount', 'lambdaExecutionParameters_maxInstancesCount' - The maximum number of instances that a non-pinned Lambda function can
-- run at the same time.
--
-- 'environmentVariables', 'lambdaExecutionParameters_environmentVariables' - The map of environment variables that are available to the Lambda
-- function when it runs.
--
-- 'statusTimeoutInSeconds', 'lambdaExecutionParameters_statusTimeoutInSeconds' - The interval in seconds at which a pinned (also known as long-lived)
-- Lambda function component sends status updates to the Lambda manager
-- component.
--
-- 'linuxProcessParams', 'lambdaExecutionParameters_linuxProcessParams' - The parameters for the Linux process that contains the Lambda function.
newLambdaExecutionParameters ::
  LambdaExecutionParameters
newLambdaExecutionParameters :: LambdaExecutionParameters
newLambdaExecutionParameters =
  LambdaExecutionParameters' :: Maybe [Text]
-> Maybe Int
-> Maybe Bool
-> Maybe LambdaInputPayloadEncodingType
-> Maybe Int
-> Maybe Int
-> Maybe [LambdaEventSource]
-> Maybe Int
-> Maybe (HashMap Text Text)
-> Maybe Int
-> Maybe LambdaLinuxProcessParams
-> LambdaExecutionParameters
LambdaExecutionParameters'
    { $sel:execArgs:LambdaExecutionParameters' :: Maybe [Text]
execArgs =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:maxQueueSize:LambdaExecutionParameters' :: Maybe Int
maxQueueSize = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:pinned:LambdaExecutionParameters' :: Maybe Bool
pinned = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:inputPayloadEncodingType:LambdaExecutionParameters' :: Maybe LambdaInputPayloadEncodingType
inputPayloadEncodingType = Maybe LambdaInputPayloadEncodingType
forall a. Maybe a
Prelude.Nothing,
      $sel:maxIdleTimeInSeconds:LambdaExecutionParameters' :: Maybe Int
maxIdleTimeInSeconds = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:timeoutInSeconds:LambdaExecutionParameters' :: Maybe Int
timeoutInSeconds = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:eventSources:LambdaExecutionParameters' :: Maybe [LambdaEventSource]
eventSources = Maybe [LambdaEventSource]
forall a. Maybe a
Prelude.Nothing,
      $sel:maxInstancesCount:LambdaExecutionParameters' :: Maybe Int
maxInstancesCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:environmentVariables:LambdaExecutionParameters' :: Maybe (HashMap Text Text)
environmentVariables = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:statusTimeoutInSeconds:LambdaExecutionParameters' :: Maybe Int
statusTimeoutInSeconds = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:linuxProcessParams:LambdaExecutionParameters' :: Maybe LambdaLinuxProcessParams
linuxProcessParams = Maybe LambdaLinuxProcessParams
forall a. Maybe a
Prelude.Nothing
    }

-- | The list of arguments to pass to the Lambda function when it runs.
lambdaExecutionParameters_execArgs :: Lens.Lens' LambdaExecutionParameters (Prelude.Maybe [Prelude.Text])
lambdaExecutionParameters_execArgs :: (Maybe [Text] -> f (Maybe [Text]))
-> LambdaExecutionParameters -> f LambdaExecutionParameters
lambdaExecutionParameters_execArgs = (LambdaExecutionParameters -> Maybe [Text])
-> (LambdaExecutionParameters
    -> Maybe [Text] -> LambdaExecutionParameters)
-> Lens
     LambdaExecutionParameters
     LambdaExecutionParameters
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaExecutionParameters' {Maybe [Text]
execArgs :: Maybe [Text]
$sel:execArgs:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe [Text]
execArgs} -> Maybe [Text]
execArgs) (\s :: LambdaExecutionParameters
s@LambdaExecutionParameters' {} Maybe [Text]
a -> LambdaExecutionParameters
s {$sel:execArgs:LambdaExecutionParameters' :: Maybe [Text]
execArgs = Maybe [Text]
a} :: LambdaExecutionParameters) ((Maybe [Text] -> f (Maybe [Text]))
 -> LambdaExecutionParameters -> f LambdaExecutionParameters)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> LambdaExecutionParameters
-> f LambdaExecutionParameters
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum size of the message queue for the Lambda function component.
-- The IoT Greengrass core stores messages in a FIFO (first-in-first-out)
-- queue until it can run the Lambda function to consume each message.
lambdaExecutionParameters_maxQueueSize :: Lens.Lens' LambdaExecutionParameters (Prelude.Maybe Prelude.Int)
lambdaExecutionParameters_maxQueueSize :: (Maybe Int -> f (Maybe Int))
-> LambdaExecutionParameters -> f LambdaExecutionParameters
lambdaExecutionParameters_maxQueueSize = (LambdaExecutionParameters -> Maybe Int)
-> (LambdaExecutionParameters
    -> Maybe Int -> LambdaExecutionParameters)
-> Lens
     LambdaExecutionParameters
     LambdaExecutionParameters
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaExecutionParameters' {Maybe Int
maxQueueSize :: Maybe Int
$sel:maxQueueSize:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe Int
maxQueueSize} -> Maybe Int
maxQueueSize) (\s :: LambdaExecutionParameters
s@LambdaExecutionParameters' {} Maybe Int
a -> LambdaExecutionParameters
s {$sel:maxQueueSize:LambdaExecutionParameters' :: Maybe Int
maxQueueSize = Maybe Int
a} :: LambdaExecutionParameters)

-- | Whether or not the Lambda function is pinned, or long-lived.
--
-- -   A pinned Lambda function starts when IoT Greengrass starts and keeps
--     running in its own container.
--
-- -   A non-pinned Lambda function starts only when it receives a work
--     item and exists after it idles for @maxIdleTimeInSeconds@. If the
--     function has multiple work items, the IoT Greengrass Core software
--     creates multiple instances of the function.
--
-- Default: @true@
lambdaExecutionParameters_pinned :: Lens.Lens' LambdaExecutionParameters (Prelude.Maybe Prelude.Bool)
lambdaExecutionParameters_pinned :: (Maybe Bool -> f (Maybe Bool))
-> LambdaExecutionParameters -> f LambdaExecutionParameters
lambdaExecutionParameters_pinned = (LambdaExecutionParameters -> Maybe Bool)
-> (LambdaExecutionParameters
    -> Maybe Bool -> LambdaExecutionParameters)
-> Lens
     LambdaExecutionParameters
     LambdaExecutionParameters
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaExecutionParameters' {Maybe Bool
pinned :: Maybe Bool
$sel:pinned:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe Bool
pinned} -> Maybe Bool
pinned) (\s :: LambdaExecutionParameters
s@LambdaExecutionParameters' {} Maybe Bool
a -> LambdaExecutionParameters
s {$sel:pinned:LambdaExecutionParameters' :: Maybe Bool
pinned = Maybe Bool
a} :: LambdaExecutionParameters)

-- | The encoding type that the Lambda function supports.
--
-- Default: @json@
lambdaExecutionParameters_inputPayloadEncodingType :: Lens.Lens' LambdaExecutionParameters (Prelude.Maybe LambdaInputPayloadEncodingType)
lambdaExecutionParameters_inputPayloadEncodingType :: (Maybe LambdaInputPayloadEncodingType
 -> f (Maybe LambdaInputPayloadEncodingType))
-> LambdaExecutionParameters -> f LambdaExecutionParameters
lambdaExecutionParameters_inputPayloadEncodingType = (LambdaExecutionParameters -> Maybe LambdaInputPayloadEncodingType)
-> (LambdaExecutionParameters
    -> Maybe LambdaInputPayloadEncodingType
    -> LambdaExecutionParameters)
-> Lens
     LambdaExecutionParameters
     LambdaExecutionParameters
     (Maybe LambdaInputPayloadEncodingType)
     (Maybe LambdaInputPayloadEncodingType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaExecutionParameters' {Maybe LambdaInputPayloadEncodingType
inputPayloadEncodingType :: Maybe LambdaInputPayloadEncodingType
$sel:inputPayloadEncodingType:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe LambdaInputPayloadEncodingType
inputPayloadEncodingType} -> Maybe LambdaInputPayloadEncodingType
inputPayloadEncodingType) (\s :: LambdaExecutionParameters
s@LambdaExecutionParameters' {} Maybe LambdaInputPayloadEncodingType
a -> LambdaExecutionParameters
s {$sel:inputPayloadEncodingType:LambdaExecutionParameters' :: Maybe LambdaInputPayloadEncodingType
inputPayloadEncodingType = Maybe LambdaInputPayloadEncodingType
a} :: LambdaExecutionParameters)

-- | The maximum amount of time in seconds that a non-pinned Lambda function
-- can idle before the IoT Greengrass Core software stops its process.
lambdaExecutionParameters_maxIdleTimeInSeconds :: Lens.Lens' LambdaExecutionParameters (Prelude.Maybe Prelude.Int)
lambdaExecutionParameters_maxIdleTimeInSeconds :: (Maybe Int -> f (Maybe Int))
-> LambdaExecutionParameters -> f LambdaExecutionParameters
lambdaExecutionParameters_maxIdleTimeInSeconds = (LambdaExecutionParameters -> Maybe Int)
-> (LambdaExecutionParameters
    -> Maybe Int -> LambdaExecutionParameters)
-> Lens
     LambdaExecutionParameters
     LambdaExecutionParameters
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaExecutionParameters' {Maybe Int
maxIdleTimeInSeconds :: Maybe Int
$sel:maxIdleTimeInSeconds:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe Int
maxIdleTimeInSeconds} -> Maybe Int
maxIdleTimeInSeconds) (\s :: LambdaExecutionParameters
s@LambdaExecutionParameters' {} Maybe Int
a -> LambdaExecutionParameters
s {$sel:maxIdleTimeInSeconds:LambdaExecutionParameters' :: Maybe Int
maxIdleTimeInSeconds = Maybe Int
a} :: LambdaExecutionParameters)

-- | The maximum amount of time in seconds that the Lambda function can
-- process a work item.
lambdaExecutionParameters_timeoutInSeconds :: Lens.Lens' LambdaExecutionParameters (Prelude.Maybe Prelude.Int)
lambdaExecutionParameters_timeoutInSeconds :: (Maybe Int -> f (Maybe Int))
-> LambdaExecutionParameters -> f LambdaExecutionParameters
lambdaExecutionParameters_timeoutInSeconds = (LambdaExecutionParameters -> Maybe Int)
-> (LambdaExecutionParameters
    -> Maybe Int -> LambdaExecutionParameters)
-> Lens
     LambdaExecutionParameters
     LambdaExecutionParameters
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaExecutionParameters' {Maybe Int
timeoutInSeconds :: Maybe Int
$sel:timeoutInSeconds:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe Int
timeoutInSeconds} -> Maybe Int
timeoutInSeconds) (\s :: LambdaExecutionParameters
s@LambdaExecutionParameters' {} Maybe Int
a -> LambdaExecutionParameters
s {$sel:timeoutInSeconds:LambdaExecutionParameters' :: Maybe Int
timeoutInSeconds = Maybe Int
a} :: LambdaExecutionParameters)

-- | The list of event sources to which to subscribe to receive work
-- messages. The Lambda function runs when it receives a message from an
-- event source. You can subscribe this function to local
-- publish\/subscribe messages and Amazon Web Services IoT Core MQTT
-- messages.
lambdaExecutionParameters_eventSources :: Lens.Lens' LambdaExecutionParameters (Prelude.Maybe [LambdaEventSource])
lambdaExecutionParameters_eventSources :: (Maybe [LambdaEventSource] -> f (Maybe [LambdaEventSource]))
-> LambdaExecutionParameters -> f LambdaExecutionParameters
lambdaExecutionParameters_eventSources = (LambdaExecutionParameters -> Maybe [LambdaEventSource])
-> (LambdaExecutionParameters
    -> Maybe [LambdaEventSource] -> LambdaExecutionParameters)
-> Lens
     LambdaExecutionParameters
     LambdaExecutionParameters
     (Maybe [LambdaEventSource])
     (Maybe [LambdaEventSource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaExecutionParameters' {Maybe [LambdaEventSource]
eventSources :: Maybe [LambdaEventSource]
$sel:eventSources:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe [LambdaEventSource]
eventSources} -> Maybe [LambdaEventSource]
eventSources) (\s :: LambdaExecutionParameters
s@LambdaExecutionParameters' {} Maybe [LambdaEventSource]
a -> LambdaExecutionParameters
s {$sel:eventSources:LambdaExecutionParameters' :: Maybe [LambdaEventSource]
eventSources = Maybe [LambdaEventSource]
a} :: LambdaExecutionParameters) ((Maybe [LambdaEventSource] -> f (Maybe [LambdaEventSource]))
 -> LambdaExecutionParameters -> f LambdaExecutionParameters)
-> ((Maybe [LambdaEventSource] -> f (Maybe [LambdaEventSource]))
    -> Maybe [LambdaEventSource] -> f (Maybe [LambdaEventSource]))
-> (Maybe [LambdaEventSource] -> f (Maybe [LambdaEventSource]))
-> LambdaExecutionParameters
-> f LambdaExecutionParameters
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [LambdaEventSource]
  [LambdaEventSource]
  [LambdaEventSource]
  [LambdaEventSource]
-> Iso
     (Maybe [LambdaEventSource])
     (Maybe [LambdaEventSource])
     (Maybe [LambdaEventSource])
     (Maybe [LambdaEventSource])
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
  [LambdaEventSource]
  [LambdaEventSource]
  [LambdaEventSource]
  [LambdaEventSource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of instances that a non-pinned Lambda function can
-- run at the same time.
lambdaExecutionParameters_maxInstancesCount :: Lens.Lens' LambdaExecutionParameters (Prelude.Maybe Prelude.Int)
lambdaExecutionParameters_maxInstancesCount :: (Maybe Int -> f (Maybe Int))
-> LambdaExecutionParameters -> f LambdaExecutionParameters
lambdaExecutionParameters_maxInstancesCount = (LambdaExecutionParameters -> Maybe Int)
-> (LambdaExecutionParameters
    -> Maybe Int -> LambdaExecutionParameters)
-> Lens
     LambdaExecutionParameters
     LambdaExecutionParameters
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaExecutionParameters' {Maybe Int
maxInstancesCount :: Maybe Int
$sel:maxInstancesCount:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe Int
maxInstancesCount} -> Maybe Int
maxInstancesCount) (\s :: LambdaExecutionParameters
s@LambdaExecutionParameters' {} Maybe Int
a -> LambdaExecutionParameters
s {$sel:maxInstancesCount:LambdaExecutionParameters' :: Maybe Int
maxInstancesCount = Maybe Int
a} :: LambdaExecutionParameters)

-- | The map of environment variables that are available to the Lambda
-- function when it runs.
lambdaExecutionParameters_environmentVariables :: Lens.Lens' LambdaExecutionParameters (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
lambdaExecutionParameters_environmentVariables :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> LambdaExecutionParameters -> f LambdaExecutionParameters
lambdaExecutionParameters_environmentVariables = (LambdaExecutionParameters -> Maybe (HashMap Text Text))
-> (LambdaExecutionParameters
    -> Maybe (HashMap Text Text) -> LambdaExecutionParameters)
-> Lens
     LambdaExecutionParameters
     LambdaExecutionParameters
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaExecutionParameters' {Maybe (HashMap Text Text)
environmentVariables :: Maybe (HashMap Text Text)
$sel:environmentVariables:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe (HashMap Text Text)
environmentVariables} -> Maybe (HashMap Text Text)
environmentVariables) (\s :: LambdaExecutionParameters
s@LambdaExecutionParameters' {} Maybe (HashMap Text Text)
a -> LambdaExecutionParameters
s {$sel:environmentVariables:LambdaExecutionParameters' :: Maybe (HashMap Text Text)
environmentVariables = Maybe (HashMap Text Text)
a} :: LambdaExecutionParameters) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> LambdaExecutionParameters -> f LambdaExecutionParameters)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> LambdaExecutionParameters
-> f LambdaExecutionParameters
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The interval in seconds at which a pinned (also known as long-lived)
-- Lambda function component sends status updates to the Lambda manager
-- component.
lambdaExecutionParameters_statusTimeoutInSeconds :: Lens.Lens' LambdaExecutionParameters (Prelude.Maybe Prelude.Int)
lambdaExecutionParameters_statusTimeoutInSeconds :: (Maybe Int -> f (Maybe Int))
-> LambdaExecutionParameters -> f LambdaExecutionParameters
lambdaExecutionParameters_statusTimeoutInSeconds = (LambdaExecutionParameters -> Maybe Int)
-> (LambdaExecutionParameters
    -> Maybe Int -> LambdaExecutionParameters)
-> Lens
     LambdaExecutionParameters
     LambdaExecutionParameters
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaExecutionParameters' {Maybe Int
statusTimeoutInSeconds :: Maybe Int
$sel:statusTimeoutInSeconds:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe Int
statusTimeoutInSeconds} -> Maybe Int
statusTimeoutInSeconds) (\s :: LambdaExecutionParameters
s@LambdaExecutionParameters' {} Maybe Int
a -> LambdaExecutionParameters
s {$sel:statusTimeoutInSeconds:LambdaExecutionParameters' :: Maybe Int
statusTimeoutInSeconds = Maybe Int
a} :: LambdaExecutionParameters)

-- | The parameters for the Linux process that contains the Lambda function.
lambdaExecutionParameters_linuxProcessParams :: Lens.Lens' LambdaExecutionParameters (Prelude.Maybe LambdaLinuxProcessParams)
lambdaExecutionParameters_linuxProcessParams :: (Maybe LambdaLinuxProcessParams
 -> f (Maybe LambdaLinuxProcessParams))
-> LambdaExecutionParameters -> f LambdaExecutionParameters
lambdaExecutionParameters_linuxProcessParams = (LambdaExecutionParameters -> Maybe LambdaLinuxProcessParams)
-> (LambdaExecutionParameters
    -> Maybe LambdaLinuxProcessParams -> LambdaExecutionParameters)
-> Lens
     LambdaExecutionParameters
     LambdaExecutionParameters
     (Maybe LambdaLinuxProcessParams)
     (Maybe LambdaLinuxProcessParams)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaExecutionParameters' {Maybe LambdaLinuxProcessParams
linuxProcessParams :: Maybe LambdaLinuxProcessParams
$sel:linuxProcessParams:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe LambdaLinuxProcessParams
linuxProcessParams} -> Maybe LambdaLinuxProcessParams
linuxProcessParams) (\s :: LambdaExecutionParameters
s@LambdaExecutionParameters' {} Maybe LambdaLinuxProcessParams
a -> LambdaExecutionParameters
s {$sel:linuxProcessParams:LambdaExecutionParameters' :: Maybe LambdaLinuxProcessParams
linuxProcessParams = Maybe LambdaLinuxProcessParams
a} :: LambdaExecutionParameters)

instance Prelude.Hashable LambdaExecutionParameters

instance Prelude.NFData LambdaExecutionParameters

instance Core.ToJSON LambdaExecutionParameters where
  toJSON :: LambdaExecutionParameters -> Value
toJSON LambdaExecutionParameters' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [LambdaEventSource]
Maybe (HashMap Text Text)
Maybe LambdaInputPayloadEncodingType
Maybe LambdaLinuxProcessParams
linuxProcessParams :: Maybe LambdaLinuxProcessParams
statusTimeoutInSeconds :: Maybe Int
environmentVariables :: Maybe (HashMap Text Text)
maxInstancesCount :: Maybe Int
eventSources :: Maybe [LambdaEventSource]
timeoutInSeconds :: Maybe Int
maxIdleTimeInSeconds :: Maybe Int
inputPayloadEncodingType :: Maybe LambdaInputPayloadEncodingType
pinned :: Maybe Bool
maxQueueSize :: Maybe Int
execArgs :: Maybe [Text]
$sel:linuxProcessParams:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe LambdaLinuxProcessParams
$sel:statusTimeoutInSeconds:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe Int
$sel:environmentVariables:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe (HashMap Text Text)
$sel:maxInstancesCount:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe Int
$sel:eventSources:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe [LambdaEventSource]
$sel:timeoutInSeconds:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe Int
$sel:maxIdleTimeInSeconds:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe Int
$sel:inputPayloadEncodingType:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe LambdaInputPayloadEncodingType
$sel:pinned:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe Bool
$sel:maxQueueSize:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe Int
$sel:execArgs:LambdaExecutionParameters' :: LambdaExecutionParameters -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"execArgs" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
execArgs,
            (Text
"maxQueueSize" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxQueueSize,
            (Text
"pinned" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
pinned,
            (Text
"inputPayloadEncodingType" Text -> LambdaInputPayloadEncodingType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (LambdaInputPayloadEncodingType -> Pair)
-> Maybe LambdaInputPayloadEncodingType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LambdaInputPayloadEncodingType
inputPayloadEncodingType,
            (Text
"maxIdleTimeInSeconds" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxIdleTimeInSeconds,
            (Text
"timeoutInSeconds" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
timeoutInSeconds,
            (Text
"eventSources" Text -> [LambdaEventSource] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([LambdaEventSource] -> Pair)
-> Maybe [LambdaEventSource] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [LambdaEventSource]
eventSources,
            (Text
"maxInstancesCount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxInstancesCount,
            (Text
"environmentVariables" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
environmentVariables,
            (Text
"statusTimeoutInSeconds" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
statusTimeoutInSeconds,
            (Text
"linuxProcessParams" Text -> LambdaLinuxProcessParams -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (LambdaLinuxProcessParams -> Pair)
-> Maybe LambdaLinuxProcessParams -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LambdaLinuxProcessParams
linuxProcessParams
          ]
      )