{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Lambda.UpdateFunctionConfiguration
-- 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)
--
-- Modify the version-specific settings of a Lambda function.
--
-- When you update a function, Lambda provisions an instance of the
-- function and its supporting resources. If your function connects to a
-- VPC, this process can take a minute. During this time, you can\'t modify
-- the function, but you can still invoke it. The @LastUpdateStatus@,
-- @LastUpdateStatusReason@, and @LastUpdateStatusReasonCode@ fields in the
-- response from GetFunctionConfiguration indicate when the update is
-- complete and the function is processing events with the new
-- configuration. For more information, see
-- <https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html Function States>.
--
-- These settings can vary between versions of a function and are locked
-- when you publish a version. You can\'t modify the configuration of a
-- published version, only the unpublished version.
--
-- To configure function concurrency, use PutFunctionConcurrency. To grant
-- invoke permissions to an account or Amazon Web Services service, use
-- AddPermission.
module Amazonka.Lambda.UpdateFunctionConfiguration
  ( -- * Creating a Request
    UpdateFunctionConfiguration (..),
    newUpdateFunctionConfiguration,

    -- * Request Lenses
    updateFunctionConfiguration_memorySize,
    updateFunctionConfiguration_runtime,
    updateFunctionConfiguration_kmsKeyArn,
    updateFunctionConfiguration_fileSystemConfigs,
    updateFunctionConfiguration_environment,
    updateFunctionConfiguration_imageConfig,
    updateFunctionConfiguration_deadLetterConfig,
    updateFunctionConfiguration_role,
    updateFunctionConfiguration_vpcConfig,
    updateFunctionConfiguration_layers,
    updateFunctionConfiguration_handler,
    updateFunctionConfiguration_timeout,
    updateFunctionConfiguration_tracingConfig,
    updateFunctionConfiguration_description,
    updateFunctionConfiguration_revisionId,
    updateFunctionConfiguration_functionName,

    -- * Destructuring the Response
    FunctionConfiguration (..),
    newFunctionConfiguration,

    -- * Response Lenses
    functionConfiguration_memorySize,
    functionConfiguration_runtime,
    functionConfiguration_state,
    functionConfiguration_signingProfileVersionArn,
    functionConfiguration_lastUpdateStatus,
    functionConfiguration_functionArn,
    functionConfiguration_kmsKeyArn,
    functionConfiguration_packageType,
    functionConfiguration_fileSystemConfigs,
    functionConfiguration_environment,
    functionConfiguration_deadLetterConfig,
    functionConfiguration_architectures,
    functionConfiguration_signingJobArn,
    functionConfiguration_role,
    functionConfiguration_vpcConfig,
    functionConfiguration_version,
    functionConfiguration_functionName,
    functionConfiguration_layers,
    functionConfiguration_codeSize,
    functionConfiguration_handler,
    functionConfiguration_timeout,
    functionConfiguration_lastUpdateStatusReason,
    functionConfiguration_stateReason,
    functionConfiguration_lastModified,
    functionConfiguration_codeSha256,
    functionConfiguration_tracingConfig,
    functionConfiguration_stateReasonCode,
    functionConfiguration_imageConfigResponse,
    functionConfiguration_description,
    functionConfiguration_lastUpdateStatusReasonCode,
    functionConfiguration_revisionId,
    functionConfiguration_masterArn,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Lambda.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateFunctionConfiguration' smart constructor.
data UpdateFunctionConfiguration = UpdateFunctionConfiguration'
  { -- | The amount of
    -- <https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html memory available to the function>
    -- at runtime. Increasing the function memory also increases its CPU
    -- allocation. The default value is 128 MB. The value can be any multiple
    -- of 1 MB.
    UpdateFunctionConfiguration -> Maybe Natural
memorySize :: Prelude.Maybe Prelude.Natural,
    -- | The identifier of the function\'s
    -- <https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html runtime>.
    UpdateFunctionConfiguration -> Maybe Runtime
runtime :: Prelude.Maybe Runtime,
    -- | The ARN of the Amazon Web Services Key Management Service (KMS) key
    -- that\'s used to encrypt your function\'s environment variables. If it\'s
    -- not provided, Lambda uses a default service key.
    UpdateFunctionConfiguration -> Maybe Text
kmsKeyArn :: Prelude.Maybe Prelude.Text,
    -- | Connection settings for an Amazon EFS file system.
    UpdateFunctionConfiguration -> Maybe [FileSystemConfig]
fileSystemConfigs :: Prelude.Maybe [FileSystemConfig],
    -- | Environment variables that are accessible from function code during
    -- execution.
    UpdateFunctionConfiguration -> Maybe Environment
environment :: Prelude.Maybe Environment,
    -- | <https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html Container image configuration values>
    -- that override the values in the container image Docker file.
    UpdateFunctionConfiguration -> Maybe ImageConfig
imageConfig :: Prelude.Maybe ImageConfig,
    -- | A dead letter queue configuration that specifies the queue or topic
    -- where Lambda sends asynchronous events when they fail processing. For
    -- more information, see
    -- <https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq Dead Letter Queues>.
    UpdateFunctionConfiguration -> Maybe DeadLetterConfig
deadLetterConfig :: Prelude.Maybe DeadLetterConfig,
    -- | The Amazon Resource Name (ARN) of the function\'s execution role.
    UpdateFunctionConfiguration -> Maybe Text
role' :: Prelude.Maybe Prelude.Text,
    -- | For network connectivity to Amazon Web Services resources in a VPC,
    -- specify a list of security groups and subnets in the VPC. When you
    -- connect a function to a VPC, it can only access resources and the
    -- internet through that VPC. For more information, see
    -- <https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html VPC Settings>.
    UpdateFunctionConfiguration -> Maybe VpcConfig
vpcConfig :: Prelude.Maybe VpcConfig,
    -- | A list of
    -- <https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html function layers>
    -- to add to the function\'s execution environment. Specify each layer by
    -- its ARN, including the version.
    UpdateFunctionConfiguration -> Maybe [Text]
layers :: Prelude.Maybe [Prelude.Text],
    -- | The name of the method within your code that Lambda calls to execute
    -- your function. The format includes the file name. It can also include
    -- namespaces and other qualifiers, depending on the runtime. For more
    -- information, see
    -- <https://docs.aws.amazon.com/lambda/latest/dg/programming-model-v2.html Programming Model>.
    UpdateFunctionConfiguration -> Maybe Text
handler :: Prelude.Maybe Prelude.Text,
    -- | The amount of time that Lambda allows a function to run before stopping
    -- it. The default is 3 seconds. The maximum allowed value is 900 seconds.
    -- For additional information, see
    -- <https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html Lambda execution environment>.
    UpdateFunctionConfiguration -> Maybe Natural
timeout :: Prelude.Maybe Prelude.Natural,
    -- | Set @Mode@ to @Active@ to sample and trace a subset of incoming requests
    -- with
    -- <https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html X-Ray>.
    UpdateFunctionConfiguration -> Maybe TracingConfig
tracingConfig :: Prelude.Maybe TracingConfig,
    -- | A description of the function.
    UpdateFunctionConfiguration -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Only update the function if the revision ID matches the ID that\'s
    -- specified. Use this option to avoid modifying a function that has
    -- changed since you last read it.
    UpdateFunctionConfiguration -> Maybe Text
revisionId :: Prelude.Maybe Prelude.Text,
    -- | The name of the Lambda function.
    --
    -- __Name formats__
    --
    -- -   __Function name__ - @my-function@.
    --
    -- -   __Function ARN__ -
    --     @arn:aws:lambda:us-west-2:123456789012:function:my-function@.
    --
    -- -   __Partial ARN__ - @123456789012:function:my-function@.
    --
    -- The length constraint applies only to the full ARN. If you specify only
    -- the function name, it is limited to 64 characters in length.
    UpdateFunctionConfiguration -> Text
functionName :: Prelude.Text
  }
  deriving (UpdateFunctionConfiguration -> UpdateFunctionConfiguration -> Bool
(UpdateFunctionConfiguration
 -> UpdateFunctionConfiguration -> Bool)
-> (UpdateFunctionConfiguration
    -> UpdateFunctionConfiguration -> Bool)
-> Eq UpdateFunctionConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFunctionConfiguration -> UpdateFunctionConfiguration -> Bool
$c/= :: UpdateFunctionConfiguration -> UpdateFunctionConfiguration -> Bool
== :: UpdateFunctionConfiguration -> UpdateFunctionConfiguration -> Bool
$c== :: UpdateFunctionConfiguration -> UpdateFunctionConfiguration -> Bool
Prelude.Eq, Int -> UpdateFunctionConfiguration -> ShowS
[UpdateFunctionConfiguration] -> ShowS
UpdateFunctionConfiguration -> String
(Int -> UpdateFunctionConfiguration -> ShowS)
-> (UpdateFunctionConfiguration -> String)
-> ([UpdateFunctionConfiguration] -> ShowS)
-> Show UpdateFunctionConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFunctionConfiguration] -> ShowS
$cshowList :: [UpdateFunctionConfiguration] -> ShowS
show :: UpdateFunctionConfiguration -> String
$cshow :: UpdateFunctionConfiguration -> String
showsPrec :: Int -> UpdateFunctionConfiguration -> ShowS
$cshowsPrec :: Int -> UpdateFunctionConfiguration -> ShowS
Prelude.Show, (forall x.
 UpdateFunctionConfiguration -> Rep UpdateFunctionConfiguration x)
-> (forall x.
    Rep UpdateFunctionConfiguration x -> UpdateFunctionConfiguration)
-> Generic UpdateFunctionConfiguration
forall x.
Rep UpdateFunctionConfiguration x -> UpdateFunctionConfiguration
forall x.
UpdateFunctionConfiguration -> Rep UpdateFunctionConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateFunctionConfiguration x -> UpdateFunctionConfiguration
$cfrom :: forall x.
UpdateFunctionConfiguration -> Rep UpdateFunctionConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFunctionConfiguration' 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:
--
-- 'memorySize', 'updateFunctionConfiguration_memorySize' - The amount of
-- <https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html memory available to the function>
-- at runtime. Increasing the function memory also increases its CPU
-- allocation. The default value is 128 MB. The value can be any multiple
-- of 1 MB.
--
-- 'runtime', 'updateFunctionConfiguration_runtime' - The identifier of the function\'s
-- <https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html runtime>.
--
-- 'kmsKeyArn', 'updateFunctionConfiguration_kmsKeyArn' - The ARN of the Amazon Web Services Key Management Service (KMS) key
-- that\'s used to encrypt your function\'s environment variables. If it\'s
-- not provided, Lambda uses a default service key.
--
-- 'fileSystemConfigs', 'updateFunctionConfiguration_fileSystemConfigs' - Connection settings for an Amazon EFS file system.
--
-- 'environment', 'updateFunctionConfiguration_environment' - Environment variables that are accessible from function code during
-- execution.
--
-- 'imageConfig', 'updateFunctionConfiguration_imageConfig' - <https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html Container image configuration values>
-- that override the values in the container image Docker file.
--
-- 'deadLetterConfig', 'updateFunctionConfiguration_deadLetterConfig' - A dead letter queue configuration that specifies the queue or topic
-- where Lambda sends asynchronous events when they fail processing. For
-- more information, see
-- <https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq Dead Letter Queues>.
--
-- 'role'', 'updateFunctionConfiguration_role' - The Amazon Resource Name (ARN) of the function\'s execution role.
--
-- 'vpcConfig', 'updateFunctionConfiguration_vpcConfig' - For network connectivity to Amazon Web Services resources in a VPC,
-- specify a list of security groups and subnets in the VPC. When you
-- connect a function to a VPC, it can only access resources and the
-- internet through that VPC. For more information, see
-- <https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html VPC Settings>.
--
-- 'layers', 'updateFunctionConfiguration_layers' - A list of
-- <https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html function layers>
-- to add to the function\'s execution environment. Specify each layer by
-- its ARN, including the version.
--
-- 'handler', 'updateFunctionConfiguration_handler' - The name of the method within your code that Lambda calls to execute
-- your function. The format includes the file name. It can also include
-- namespaces and other qualifiers, depending on the runtime. For more
-- information, see
-- <https://docs.aws.amazon.com/lambda/latest/dg/programming-model-v2.html Programming Model>.
--
-- 'timeout', 'updateFunctionConfiguration_timeout' - The amount of time that Lambda allows a function to run before stopping
-- it. The default is 3 seconds. The maximum allowed value is 900 seconds.
-- For additional information, see
-- <https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html Lambda execution environment>.
--
-- 'tracingConfig', 'updateFunctionConfiguration_tracingConfig' - Set @Mode@ to @Active@ to sample and trace a subset of incoming requests
-- with
-- <https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html X-Ray>.
--
-- 'description', 'updateFunctionConfiguration_description' - A description of the function.
--
-- 'revisionId', 'updateFunctionConfiguration_revisionId' - Only update the function if the revision ID matches the ID that\'s
-- specified. Use this option to avoid modifying a function that has
-- changed since you last read it.
--
-- 'functionName', 'updateFunctionConfiguration_functionName' - The name of the Lambda function.
--
-- __Name formats__
--
-- -   __Function name__ - @my-function@.
--
-- -   __Function ARN__ -
--     @arn:aws:lambda:us-west-2:123456789012:function:my-function@.
--
-- -   __Partial ARN__ - @123456789012:function:my-function@.
--
-- The length constraint applies only to the full ARN. If you specify only
-- the function name, it is limited to 64 characters in length.
newUpdateFunctionConfiguration ::
  -- | 'functionName'
  Prelude.Text ->
  UpdateFunctionConfiguration
newUpdateFunctionConfiguration :: Text -> UpdateFunctionConfiguration
newUpdateFunctionConfiguration Text
pFunctionName_ =
  UpdateFunctionConfiguration' :: Maybe Natural
-> Maybe Runtime
-> Maybe Text
-> Maybe [FileSystemConfig]
-> Maybe Environment
-> Maybe ImageConfig
-> Maybe DeadLetterConfig
-> Maybe Text
-> Maybe VpcConfig
-> Maybe [Text]
-> Maybe Text
-> Maybe Natural
-> Maybe TracingConfig
-> Maybe Text
-> Maybe Text
-> Text
-> UpdateFunctionConfiguration
UpdateFunctionConfiguration'
    { $sel:memorySize:UpdateFunctionConfiguration' :: Maybe Natural
memorySize =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:runtime:UpdateFunctionConfiguration' :: Maybe Runtime
runtime = Maybe Runtime
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyArn:UpdateFunctionConfiguration' :: Maybe Text
kmsKeyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fileSystemConfigs:UpdateFunctionConfiguration' :: Maybe [FileSystemConfig]
fileSystemConfigs = Maybe [FileSystemConfig]
forall a. Maybe a
Prelude.Nothing,
      $sel:environment:UpdateFunctionConfiguration' :: Maybe Environment
environment = Maybe Environment
forall a. Maybe a
Prelude.Nothing,
      $sel:imageConfig:UpdateFunctionConfiguration' :: Maybe ImageConfig
imageConfig = Maybe ImageConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:deadLetterConfig:UpdateFunctionConfiguration' :: Maybe DeadLetterConfig
deadLetterConfig = Maybe DeadLetterConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:role':UpdateFunctionConfiguration' :: Maybe Text
role' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcConfig:UpdateFunctionConfiguration' :: Maybe VpcConfig
vpcConfig = Maybe VpcConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:layers:UpdateFunctionConfiguration' :: Maybe [Text]
layers = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:handler:UpdateFunctionConfiguration' :: Maybe Text
handler = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:timeout:UpdateFunctionConfiguration' :: Maybe Natural
timeout = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:tracingConfig:UpdateFunctionConfiguration' :: Maybe TracingConfig
tracingConfig = Maybe TracingConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateFunctionConfiguration' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:revisionId:UpdateFunctionConfiguration' :: Maybe Text
revisionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:functionName:UpdateFunctionConfiguration' :: Text
functionName = Text
pFunctionName_
    }

-- | The amount of
-- <https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html memory available to the function>
-- at runtime. Increasing the function memory also increases its CPU
-- allocation. The default value is 128 MB. The value can be any multiple
-- of 1 MB.
updateFunctionConfiguration_memorySize :: Lens.Lens' UpdateFunctionConfiguration (Prelude.Maybe Prelude.Natural)
updateFunctionConfiguration_memorySize :: (Maybe Natural -> f (Maybe Natural))
-> UpdateFunctionConfiguration -> f UpdateFunctionConfiguration
updateFunctionConfiguration_memorySize = (UpdateFunctionConfiguration -> Maybe Natural)
-> (UpdateFunctionConfiguration
    -> Maybe Natural -> UpdateFunctionConfiguration)
-> Lens
     UpdateFunctionConfiguration
     UpdateFunctionConfiguration
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionConfiguration' {Maybe Natural
memorySize :: Maybe Natural
$sel:memorySize:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Natural
memorySize} -> Maybe Natural
memorySize) (\s :: UpdateFunctionConfiguration
s@UpdateFunctionConfiguration' {} Maybe Natural
a -> UpdateFunctionConfiguration
s {$sel:memorySize:UpdateFunctionConfiguration' :: Maybe Natural
memorySize = Maybe Natural
a} :: UpdateFunctionConfiguration)

-- | The identifier of the function\'s
-- <https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html runtime>.
updateFunctionConfiguration_runtime :: Lens.Lens' UpdateFunctionConfiguration (Prelude.Maybe Runtime)
updateFunctionConfiguration_runtime :: (Maybe Runtime -> f (Maybe Runtime))
-> UpdateFunctionConfiguration -> f UpdateFunctionConfiguration
updateFunctionConfiguration_runtime = (UpdateFunctionConfiguration -> Maybe Runtime)
-> (UpdateFunctionConfiguration
    -> Maybe Runtime -> UpdateFunctionConfiguration)
-> Lens
     UpdateFunctionConfiguration
     UpdateFunctionConfiguration
     (Maybe Runtime)
     (Maybe Runtime)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionConfiguration' {Maybe Runtime
runtime :: Maybe Runtime
$sel:runtime:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Runtime
runtime} -> Maybe Runtime
runtime) (\s :: UpdateFunctionConfiguration
s@UpdateFunctionConfiguration' {} Maybe Runtime
a -> UpdateFunctionConfiguration
s {$sel:runtime:UpdateFunctionConfiguration' :: Maybe Runtime
runtime = Maybe Runtime
a} :: UpdateFunctionConfiguration)

-- | The ARN of the Amazon Web Services Key Management Service (KMS) key
-- that\'s used to encrypt your function\'s environment variables. If it\'s
-- not provided, Lambda uses a default service key.
updateFunctionConfiguration_kmsKeyArn :: Lens.Lens' UpdateFunctionConfiguration (Prelude.Maybe Prelude.Text)
updateFunctionConfiguration_kmsKeyArn :: (Maybe Text -> f (Maybe Text))
-> UpdateFunctionConfiguration -> f UpdateFunctionConfiguration
updateFunctionConfiguration_kmsKeyArn = (UpdateFunctionConfiguration -> Maybe Text)
-> (UpdateFunctionConfiguration
    -> Maybe Text -> UpdateFunctionConfiguration)
-> Lens
     UpdateFunctionConfiguration
     UpdateFunctionConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionConfiguration' {Maybe Text
kmsKeyArn :: Maybe Text
$sel:kmsKeyArn:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Text
kmsKeyArn} -> Maybe Text
kmsKeyArn) (\s :: UpdateFunctionConfiguration
s@UpdateFunctionConfiguration' {} Maybe Text
a -> UpdateFunctionConfiguration
s {$sel:kmsKeyArn:UpdateFunctionConfiguration' :: Maybe Text
kmsKeyArn = Maybe Text
a} :: UpdateFunctionConfiguration)

-- | Connection settings for an Amazon EFS file system.
updateFunctionConfiguration_fileSystemConfigs :: Lens.Lens' UpdateFunctionConfiguration (Prelude.Maybe [FileSystemConfig])
updateFunctionConfiguration_fileSystemConfigs :: (Maybe [FileSystemConfig] -> f (Maybe [FileSystemConfig]))
-> UpdateFunctionConfiguration -> f UpdateFunctionConfiguration
updateFunctionConfiguration_fileSystemConfigs = (UpdateFunctionConfiguration -> Maybe [FileSystemConfig])
-> (UpdateFunctionConfiguration
    -> Maybe [FileSystemConfig] -> UpdateFunctionConfiguration)
-> Lens
     UpdateFunctionConfiguration
     UpdateFunctionConfiguration
     (Maybe [FileSystemConfig])
     (Maybe [FileSystemConfig])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionConfiguration' {Maybe [FileSystemConfig]
fileSystemConfigs :: Maybe [FileSystemConfig]
$sel:fileSystemConfigs:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe [FileSystemConfig]
fileSystemConfigs} -> Maybe [FileSystemConfig]
fileSystemConfigs) (\s :: UpdateFunctionConfiguration
s@UpdateFunctionConfiguration' {} Maybe [FileSystemConfig]
a -> UpdateFunctionConfiguration
s {$sel:fileSystemConfigs:UpdateFunctionConfiguration' :: Maybe [FileSystemConfig]
fileSystemConfigs = Maybe [FileSystemConfig]
a} :: UpdateFunctionConfiguration) ((Maybe [FileSystemConfig] -> f (Maybe [FileSystemConfig]))
 -> UpdateFunctionConfiguration -> f UpdateFunctionConfiguration)
-> ((Maybe [FileSystemConfig] -> f (Maybe [FileSystemConfig]))
    -> Maybe [FileSystemConfig] -> f (Maybe [FileSystemConfig]))
-> (Maybe [FileSystemConfig] -> f (Maybe [FileSystemConfig]))
-> UpdateFunctionConfiguration
-> f UpdateFunctionConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FileSystemConfig]
  [FileSystemConfig]
  [FileSystemConfig]
  [FileSystemConfig]
-> Iso
     (Maybe [FileSystemConfig])
     (Maybe [FileSystemConfig])
     (Maybe [FileSystemConfig])
     (Maybe [FileSystemConfig])
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
  [FileSystemConfig]
  [FileSystemConfig]
  [FileSystemConfig]
  [FileSystemConfig]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Environment variables that are accessible from function code during
-- execution.
updateFunctionConfiguration_environment :: Lens.Lens' UpdateFunctionConfiguration (Prelude.Maybe Environment)
updateFunctionConfiguration_environment :: (Maybe Environment -> f (Maybe Environment))
-> UpdateFunctionConfiguration -> f UpdateFunctionConfiguration
updateFunctionConfiguration_environment = (UpdateFunctionConfiguration -> Maybe Environment)
-> (UpdateFunctionConfiguration
    -> Maybe Environment -> UpdateFunctionConfiguration)
-> Lens
     UpdateFunctionConfiguration
     UpdateFunctionConfiguration
     (Maybe Environment)
     (Maybe Environment)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionConfiguration' {Maybe Environment
environment :: Maybe Environment
$sel:environment:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Environment
environment} -> Maybe Environment
environment) (\s :: UpdateFunctionConfiguration
s@UpdateFunctionConfiguration' {} Maybe Environment
a -> UpdateFunctionConfiguration
s {$sel:environment:UpdateFunctionConfiguration' :: Maybe Environment
environment = Maybe Environment
a} :: UpdateFunctionConfiguration)

-- | <https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html Container image configuration values>
-- that override the values in the container image Docker file.
updateFunctionConfiguration_imageConfig :: Lens.Lens' UpdateFunctionConfiguration (Prelude.Maybe ImageConfig)
updateFunctionConfiguration_imageConfig :: (Maybe ImageConfig -> f (Maybe ImageConfig))
-> UpdateFunctionConfiguration -> f UpdateFunctionConfiguration
updateFunctionConfiguration_imageConfig = (UpdateFunctionConfiguration -> Maybe ImageConfig)
-> (UpdateFunctionConfiguration
    -> Maybe ImageConfig -> UpdateFunctionConfiguration)
-> Lens
     UpdateFunctionConfiguration
     UpdateFunctionConfiguration
     (Maybe ImageConfig)
     (Maybe ImageConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionConfiguration' {Maybe ImageConfig
imageConfig :: Maybe ImageConfig
$sel:imageConfig:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe ImageConfig
imageConfig} -> Maybe ImageConfig
imageConfig) (\s :: UpdateFunctionConfiguration
s@UpdateFunctionConfiguration' {} Maybe ImageConfig
a -> UpdateFunctionConfiguration
s {$sel:imageConfig:UpdateFunctionConfiguration' :: Maybe ImageConfig
imageConfig = Maybe ImageConfig
a} :: UpdateFunctionConfiguration)

-- | A dead letter queue configuration that specifies the queue or topic
-- where Lambda sends asynchronous events when they fail processing. For
-- more information, see
-- <https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq Dead Letter Queues>.
updateFunctionConfiguration_deadLetterConfig :: Lens.Lens' UpdateFunctionConfiguration (Prelude.Maybe DeadLetterConfig)
updateFunctionConfiguration_deadLetterConfig :: (Maybe DeadLetterConfig -> f (Maybe DeadLetterConfig))
-> UpdateFunctionConfiguration -> f UpdateFunctionConfiguration
updateFunctionConfiguration_deadLetterConfig = (UpdateFunctionConfiguration -> Maybe DeadLetterConfig)
-> (UpdateFunctionConfiguration
    -> Maybe DeadLetterConfig -> UpdateFunctionConfiguration)
-> Lens
     UpdateFunctionConfiguration
     UpdateFunctionConfiguration
     (Maybe DeadLetterConfig)
     (Maybe DeadLetterConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionConfiguration' {Maybe DeadLetterConfig
deadLetterConfig :: Maybe DeadLetterConfig
$sel:deadLetterConfig:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe DeadLetterConfig
deadLetterConfig} -> Maybe DeadLetterConfig
deadLetterConfig) (\s :: UpdateFunctionConfiguration
s@UpdateFunctionConfiguration' {} Maybe DeadLetterConfig
a -> UpdateFunctionConfiguration
s {$sel:deadLetterConfig:UpdateFunctionConfiguration' :: Maybe DeadLetterConfig
deadLetterConfig = Maybe DeadLetterConfig
a} :: UpdateFunctionConfiguration)

-- | The Amazon Resource Name (ARN) of the function\'s execution role.
updateFunctionConfiguration_role :: Lens.Lens' UpdateFunctionConfiguration (Prelude.Maybe Prelude.Text)
updateFunctionConfiguration_role :: (Maybe Text -> f (Maybe Text))
-> UpdateFunctionConfiguration -> f UpdateFunctionConfiguration
updateFunctionConfiguration_role = (UpdateFunctionConfiguration -> Maybe Text)
-> (UpdateFunctionConfiguration
    -> Maybe Text -> UpdateFunctionConfiguration)
-> Lens
     UpdateFunctionConfiguration
     UpdateFunctionConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionConfiguration' {Maybe Text
role' :: Maybe Text
$sel:role':UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Text
role'} -> Maybe Text
role') (\s :: UpdateFunctionConfiguration
s@UpdateFunctionConfiguration' {} Maybe Text
a -> UpdateFunctionConfiguration
s {$sel:role':UpdateFunctionConfiguration' :: Maybe Text
role' = Maybe Text
a} :: UpdateFunctionConfiguration)

-- | For network connectivity to Amazon Web Services resources in a VPC,
-- specify a list of security groups and subnets in the VPC. When you
-- connect a function to a VPC, it can only access resources and the
-- internet through that VPC. For more information, see
-- <https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html VPC Settings>.
updateFunctionConfiguration_vpcConfig :: Lens.Lens' UpdateFunctionConfiguration (Prelude.Maybe VpcConfig)
updateFunctionConfiguration_vpcConfig :: (Maybe VpcConfig -> f (Maybe VpcConfig))
-> UpdateFunctionConfiguration -> f UpdateFunctionConfiguration
updateFunctionConfiguration_vpcConfig = (UpdateFunctionConfiguration -> Maybe VpcConfig)
-> (UpdateFunctionConfiguration
    -> Maybe VpcConfig -> UpdateFunctionConfiguration)
-> Lens
     UpdateFunctionConfiguration
     UpdateFunctionConfiguration
     (Maybe VpcConfig)
     (Maybe VpcConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionConfiguration' {Maybe VpcConfig
vpcConfig :: Maybe VpcConfig
$sel:vpcConfig:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe VpcConfig
vpcConfig} -> Maybe VpcConfig
vpcConfig) (\s :: UpdateFunctionConfiguration
s@UpdateFunctionConfiguration' {} Maybe VpcConfig
a -> UpdateFunctionConfiguration
s {$sel:vpcConfig:UpdateFunctionConfiguration' :: Maybe VpcConfig
vpcConfig = Maybe VpcConfig
a} :: UpdateFunctionConfiguration)

-- | A list of
-- <https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html function layers>
-- to add to the function\'s execution environment. Specify each layer by
-- its ARN, including the version.
updateFunctionConfiguration_layers :: Lens.Lens' UpdateFunctionConfiguration (Prelude.Maybe [Prelude.Text])
updateFunctionConfiguration_layers :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateFunctionConfiguration -> f UpdateFunctionConfiguration
updateFunctionConfiguration_layers = (UpdateFunctionConfiguration -> Maybe [Text])
-> (UpdateFunctionConfiguration
    -> Maybe [Text] -> UpdateFunctionConfiguration)
-> Lens
     UpdateFunctionConfiguration
     UpdateFunctionConfiguration
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionConfiguration' {Maybe [Text]
layers :: Maybe [Text]
$sel:layers:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe [Text]
layers} -> Maybe [Text]
layers) (\s :: UpdateFunctionConfiguration
s@UpdateFunctionConfiguration' {} Maybe [Text]
a -> UpdateFunctionConfiguration
s {$sel:layers:UpdateFunctionConfiguration' :: Maybe [Text]
layers = Maybe [Text]
a} :: UpdateFunctionConfiguration) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateFunctionConfiguration -> f UpdateFunctionConfiguration)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateFunctionConfiguration
-> f UpdateFunctionConfiguration
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 name of the method within your code that Lambda calls to execute
-- your function. The format includes the file name. It can also include
-- namespaces and other qualifiers, depending on the runtime. For more
-- information, see
-- <https://docs.aws.amazon.com/lambda/latest/dg/programming-model-v2.html Programming Model>.
updateFunctionConfiguration_handler :: Lens.Lens' UpdateFunctionConfiguration (Prelude.Maybe Prelude.Text)
updateFunctionConfiguration_handler :: (Maybe Text -> f (Maybe Text))
-> UpdateFunctionConfiguration -> f UpdateFunctionConfiguration
updateFunctionConfiguration_handler = (UpdateFunctionConfiguration -> Maybe Text)
-> (UpdateFunctionConfiguration
    -> Maybe Text -> UpdateFunctionConfiguration)
-> Lens
     UpdateFunctionConfiguration
     UpdateFunctionConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionConfiguration' {Maybe Text
handler :: Maybe Text
$sel:handler:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Text
handler} -> Maybe Text
handler) (\s :: UpdateFunctionConfiguration
s@UpdateFunctionConfiguration' {} Maybe Text
a -> UpdateFunctionConfiguration
s {$sel:handler:UpdateFunctionConfiguration' :: Maybe Text
handler = Maybe Text
a} :: UpdateFunctionConfiguration)

-- | The amount of time that Lambda allows a function to run before stopping
-- it. The default is 3 seconds. The maximum allowed value is 900 seconds.
-- For additional information, see
-- <https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html Lambda execution environment>.
updateFunctionConfiguration_timeout :: Lens.Lens' UpdateFunctionConfiguration (Prelude.Maybe Prelude.Natural)
updateFunctionConfiguration_timeout :: (Maybe Natural -> f (Maybe Natural))
-> UpdateFunctionConfiguration -> f UpdateFunctionConfiguration
updateFunctionConfiguration_timeout = (UpdateFunctionConfiguration -> Maybe Natural)
-> (UpdateFunctionConfiguration
    -> Maybe Natural -> UpdateFunctionConfiguration)
-> Lens
     UpdateFunctionConfiguration
     UpdateFunctionConfiguration
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionConfiguration' {Maybe Natural
timeout :: Maybe Natural
$sel:timeout:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Natural
timeout} -> Maybe Natural
timeout) (\s :: UpdateFunctionConfiguration
s@UpdateFunctionConfiguration' {} Maybe Natural
a -> UpdateFunctionConfiguration
s {$sel:timeout:UpdateFunctionConfiguration' :: Maybe Natural
timeout = Maybe Natural
a} :: UpdateFunctionConfiguration)

-- | Set @Mode@ to @Active@ to sample and trace a subset of incoming requests
-- with
-- <https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html X-Ray>.
updateFunctionConfiguration_tracingConfig :: Lens.Lens' UpdateFunctionConfiguration (Prelude.Maybe TracingConfig)
updateFunctionConfiguration_tracingConfig :: (Maybe TracingConfig -> f (Maybe TracingConfig))
-> UpdateFunctionConfiguration -> f UpdateFunctionConfiguration
updateFunctionConfiguration_tracingConfig = (UpdateFunctionConfiguration -> Maybe TracingConfig)
-> (UpdateFunctionConfiguration
    -> Maybe TracingConfig -> UpdateFunctionConfiguration)
-> Lens
     UpdateFunctionConfiguration
     UpdateFunctionConfiguration
     (Maybe TracingConfig)
     (Maybe TracingConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionConfiguration' {Maybe TracingConfig
tracingConfig :: Maybe TracingConfig
$sel:tracingConfig:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe TracingConfig
tracingConfig} -> Maybe TracingConfig
tracingConfig) (\s :: UpdateFunctionConfiguration
s@UpdateFunctionConfiguration' {} Maybe TracingConfig
a -> UpdateFunctionConfiguration
s {$sel:tracingConfig:UpdateFunctionConfiguration' :: Maybe TracingConfig
tracingConfig = Maybe TracingConfig
a} :: UpdateFunctionConfiguration)

-- | A description of the function.
updateFunctionConfiguration_description :: Lens.Lens' UpdateFunctionConfiguration (Prelude.Maybe Prelude.Text)
updateFunctionConfiguration_description :: (Maybe Text -> f (Maybe Text))
-> UpdateFunctionConfiguration -> f UpdateFunctionConfiguration
updateFunctionConfiguration_description = (UpdateFunctionConfiguration -> Maybe Text)
-> (UpdateFunctionConfiguration
    -> Maybe Text -> UpdateFunctionConfiguration)
-> Lens
     UpdateFunctionConfiguration
     UpdateFunctionConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionConfiguration' {Maybe Text
description :: Maybe Text
$sel:description:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateFunctionConfiguration
s@UpdateFunctionConfiguration' {} Maybe Text
a -> UpdateFunctionConfiguration
s {$sel:description:UpdateFunctionConfiguration' :: Maybe Text
description = Maybe Text
a} :: UpdateFunctionConfiguration)

-- | Only update the function if the revision ID matches the ID that\'s
-- specified. Use this option to avoid modifying a function that has
-- changed since you last read it.
updateFunctionConfiguration_revisionId :: Lens.Lens' UpdateFunctionConfiguration (Prelude.Maybe Prelude.Text)
updateFunctionConfiguration_revisionId :: (Maybe Text -> f (Maybe Text))
-> UpdateFunctionConfiguration -> f UpdateFunctionConfiguration
updateFunctionConfiguration_revisionId = (UpdateFunctionConfiguration -> Maybe Text)
-> (UpdateFunctionConfiguration
    -> Maybe Text -> UpdateFunctionConfiguration)
-> Lens
     UpdateFunctionConfiguration
     UpdateFunctionConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionConfiguration' {Maybe Text
revisionId :: Maybe Text
$sel:revisionId:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Text
revisionId} -> Maybe Text
revisionId) (\s :: UpdateFunctionConfiguration
s@UpdateFunctionConfiguration' {} Maybe Text
a -> UpdateFunctionConfiguration
s {$sel:revisionId:UpdateFunctionConfiguration' :: Maybe Text
revisionId = Maybe Text
a} :: UpdateFunctionConfiguration)

-- | The name of the Lambda function.
--
-- __Name formats__
--
-- -   __Function name__ - @my-function@.
--
-- -   __Function ARN__ -
--     @arn:aws:lambda:us-west-2:123456789012:function:my-function@.
--
-- -   __Partial ARN__ - @123456789012:function:my-function@.
--
-- The length constraint applies only to the full ARN. If you specify only
-- the function name, it is limited to 64 characters in length.
updateFunctionConfiguration_functionName :: Lens.Lens' UpdateFunctionConfiguration Prelude.Text
updateFunctionConfiguration_functionName :: (Text -> f Text)
-> UpdateFunctionConfiguration -> f UpdateFunctionConfiguration
updateFunctionConfiguration_functionName = (UpdateFunctionConfiguration -> Text)
-> (UpdateFunctionConfiguration
    -> Text -> UpdateFunctionConfiguration)
-> Lens
     UpdateFunctionConfiguration UpdateFunctionConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionConfiguration' {Text
functionName :: Text
$sel:functionName:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Text
functionName} -> Text
functionName) (\s :: UpdateFunctionConfiguration
s@UpdateFunctionConfiguration' {} Text
a -> UpdateFunctionConfiguration
s {$sel:functionName:UpdateFunctionConfiguration' :: Text
functionName = Text
a} :: UpdateFunctionConfiguration)

instance Core.AWSRequest UpdateFunctionConfiguration where
  type
    AWSResponse UpdateFunctionConfiguration =
      FunctionConfiguration
  request :: UpdateFunctionConfiguration -> Request UpdateFunctionConfiguration
request = Service
-> UpdateFunctionConfiguration
-> Request UpdateFunctionConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateFunctionConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateFunctionConfiguration)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateFunctionConfiguration))
-> Logger
-> Service
-> Proxy UpdateFunctionConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateFunctionConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      (\Int
s ResponseHeaders
h Object
x -> Object -> Either String FunctionConfiguration
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)

instance Prelude.Hashable UpdateFunctionConfiguration

instance Prelude.NFData UpdateFunctionConfiguration

instance Core.ToHeaders UpdateFunctionConfiguration where
  toHeaders :: UpdateFunctionConfiguration -> ResponseHeaders
toHeaders = ResponseHeaders -> UpdateFunctionConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON UpdateFunctionConfiguration where
  toJSON :: UpdateFunctionConfiguration -> Value
toJSON UpdateFunctionConfiguration' {Maybe Natural
Maybe [Text]
Maybe [FileSystemConfig]
Maybe Text
Maybe DeadLetterConfig
Maybe Environment
Maybe ImageConfig
Maybe Runtime
Maybe TracingConfig
Maybe VpcConfig
Text
functionName :: Text
revisionId :: Maybe Text
description :: Maybe Text
tracingConfig :: Maybe TracingConfig
timeout :: Maybe Natural
handler :: Maybe Text
layers :: Maybe [Text]
vpcConfig :: Maybe VpcConfig
role' :: Maybe Text
deadLetterConfig :: Maybe DeadLetterConfig
imageConfig :: Maybe ImageConfig
environment :: Maybe Environment
fileSystemConfigs :: Maybe [FileSystemConfig]
kmsKeyArn :: Maybe Text
runtime :: Maybe Runtime
memorySize :: Maybe Natural
$sel:functionName:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Text
$sel:revisionId:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Text
$sel:description:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Text
$sel:tracingConfig:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe TracingConfig
$sel:timeout:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Natural
$sel:handler:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Text
$sel:layers:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe [Text]
$sel:vpcConfig:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe VpcConfig
$sel:role':UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Text
$sel:deadLetterConfig:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe DeadLetterConfig
$sel:imageConfig:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe ImageConfig
$sel:environment:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Environment
$sel:fileSystemConfigs:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe [FileSystemConfig]
$sel:kmsKeyArn:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Text
$sel:runtime:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Runtime
$sel:memorySize:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Natural
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"MemorySize" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
memorySize,
            (Text
"Runtime" Text -> Runtime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Runtime -> Pair) -> Maybe Runtime -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Runtime
runtime,
            (Text
"KMSKeyArn" 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
kmsKeyArn,
            (Text
"FileSystemConfigs" Text -> [FileSystemConfig] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([FileSystemConfig] -> Pair)
-> Maybe [FileSystemConfig] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [FileSystemConfig]
fileSystemConfigs,
            (Text
"Environment" Text -> Environment -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Environment -> Pair) -> Maybe Environment -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Environment
environment,
            (Text
"ImageConfig" Text -> ImageConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ImageConfig -> Pair) -> Maybe ImageConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ImageConfig
imageConfig,
            (Text
"DeadLetterConfig" Text -> DeadLetterConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DeadLetterConfig -> Pair) -> Maybe DeadLetterConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeadLetterConfig
deadLetterConfig,
            (Text
"Role" 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
role',
            (Text
"VpcConfig" Text -> VpcConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VpcConfig -> Pair) -> Maybe VpcConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VpcConfig
vpcConfig,
            (Text
"Layers" 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]
layers,
            (Text
"Handler" 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
handler,
            (Text
"Timeout" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
timeout,
            (Text
"TracingConfig" Text -> TracingConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TracingConfig -> Pair) -> Maybe TracingConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TracingConfig
tracingConfig,
            (Text
"Description" 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
description,
            (Text
"RevisionId" 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
revisionId
          ]
      )

instance Core.ToPath UpdateFunctionConfiguration where
  toPath :: UpdateFunctionConfiguration -> ByteString
toPath UpdateFunctionConfiguration' {Maybe Natural
Maybe [Text]
Maybe [FileSystemConfig]
Maybe Text
Maybe DeadLetterConfig
Maybe Environment
Maybe ImageConfig
Maybe Runtime
Maybe TracingConfig
Maybe VpcConfig
Text
functionName :: Text
revisionId :: Maybe Text
description :: Maybe Text
tracingConfig :: Maybe TracingConfig
timeout :: Maybe Natural
handler :: Maybe Text
layers :: Maybe [Text]
vpcConfig :: Maybe VpcConfig
role' :: Maybe Text
deadLetterConfig :: Maybe DeadLetterConfig
imageConfig :: Maybe ImageConfig
environment :: Maybe Environment
fileSystemConfigs :: Maybe [FileSystemConfig]
kmsKeyArn :: Maybe Text
runtime :: Maybe Runtime
memorySize :: Maybe Natural
$sel:functionName:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Text
$sel:revisionId:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Text
$sel:description:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Text
$sel:tracingConfig:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe TracingConfig
$sel:timeout:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Natural
$sel:handler:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Text
$sel:layers:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe [Text]
$sel:vpcConfig:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe VpcConfig
$sel:role':UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Text
$sel:deadLetterConfig:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe DeadLetterConfig
$sel:imageConfig:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe ImageConfig
$sel:environment:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Environment
$sel:fileSystemConfigs:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe [FileSystemConfig]
$sel:kmsKeyArn:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Text
$sel:runtime:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Runtime
$sel:memorySize:UpdateFunctionConfiguration' :: UpdateFunctionConfiguration -> Maybe Natural
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2015-03-31/functions/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
functionName,
        ByteString
"/configuration"
      ]

instance Core.ToQuery UpdateFunctionConfiguration where
  toQuery :: UpdateFunctionConfiguration -> QueryString
toQuery = QueryString -> UpdateFunctionConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty