{-# 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.UpdateEventSourceMapping
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates an event source mapping. You can change the function that Lambda
-- invokes, or pause invocation and resume later from the same location.
--
-- For details about how to configure different event sources, see the
-- following topics.
--
-- -   <https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping Amazon DynamoDB Streams>
--
-- -   <https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping Amazon Kinesis>
--
-- -   <https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource Amazon SQS>
--
-- -   <https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping Amazon MQ and RabbitMQ>
--
-- -   <https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html Amazon MSK>
--
-- -   <https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html Apache Kafka>
--
-- The following error handling options are available only for stream
-- sources (DynamoDB and Kinesis):
--
-- -   @BisectBatchOnFunctionError@ - If the function returns an error,
--     split the batch in two and retry.
--
-- -   @DestinationConfig@ - Send discarded records to an Amazon SQS queue
--     or Amazon SNS topic.
--
-- -   @MaximumRecordAgeInSeconds@ - Discard records older than the
--     specified age. The default value is infinite (-1). When set to
--     infinite (-1), failed records are retried until the record expires
--
-- -   @MaximumRetryAttempts@ - Discard records after the specified number
--     of retries. The default value is infinite (-1). When set to infinite
--     (-1), failed records are retried until the record expires.
--
-- -   @ParallelizationFactor@ - Process multiple batches from each shard
--     concurrently.
--
-- For information about which configuration parameters apply to each event
-- source, see the following topics.
--
-- -   <https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-params Amazon DynamoDB Streams>
--
-- -   <https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-params Amazon Kinesis>
--
-- -   <https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-params Amazon SQS>
--
-- -   <https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-params Amazon MQ and RabbitMQ>
--
-- -   <https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-parms Amazon MSK>
--
-- -   <https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html#services-kafka-parms Apache Kafka>
module Amazonka.Lambda.UpdateEventSourceMapping
  ( -- * Creating a Request
    UpdateEventSourceMapping (..),
    newUpdateEventSourceMapping,

    -- * Request Lenses
    updateEventSourceMapping_batchSize,
    updateEventSourceMapping_bisectBatchOnFunctionError,
    updateEventSourceMapping_destinationConfig,
    updateEventSourceMapping_enabled,
    updateEventSourceMapping_filterCriteria,
    updateEventSourceMapping_functionName,
    updateEventSourceMapping_functionResponseTypes,
    updateEventSourceMapping_maximumBatchingWindowInSeconds,
    updateEventSourceMapping_maximumRecordAgeInSeconds,
    updateEventSourceMapping_maximumRetryAttempts,
    updateEventSourceMapping_parallelizationFactor,
    updateEventSourceMapping_sourceAccessConfigurations,
    updateEventSourceMapping_tumblingWindowInSeconds,
    updateEventSourceMapping_uuid,

    -- * Destructuring the Response
    EventSourceMappingConfiguration (..),
    newEventSourceMappingConfiguration,

    -- * Response Lenses
    eventSourceMappingConfiguration_amazonManagedKafkaEventSourceConfig,
    eventSourceMappingConfiguration_batchSize,
    eventSourceMappingConfiguration_bisectBatchOnFunctionError,
    eventSourceMappingConfiguration_destinationConfig,
    eventSourceMappingConfiguration_eventSourceArn,
    eventSourceMappingConfiguration_filterCriteria,
    eventSourceMappingConfiguration_functionArn,
    eventSourceMappingConfiguration_functionResponseTypes,
    eventSourceMappingConfiguration_lastModified,
    eventSourceMappingConfiguration_lastProcessingResult,
    eventSourceMappingConfiguration_maximumBatchingWindowInSeconds,
    eventSourceMappingConfiguration_maximumRecordAgeInSeconds,
    eventSourceMappingConfiguration_maximumRetryAttempts,
    eventSourceMappingConfiguration_parallelizationFactor,
    eventSourceMappingConfiguration_queues,
    eventSourceMappingConfiguration_selfManagedEventSource,
    eventSourceMappingConfiguration_selfManagedKafkaEventSourceConfig,
    eventSourceMappingConfiguration_sourceAccessConfigurations,
    eventSourceMappingConfiguration_startingPosition,
    eventSourceMappingConfiguration_startingPositionTimestamp,
    eventSourceMappingConfiguration_state,
    eventSourceMappingConfiguration_stateTransitionReason,
    eventSourceMappingConfiguration_topics,
    eventSourceMappingConfiguration_tumblingWindowInSeconds,
    eventSourceMappingConfiguration_uuid,
  )
where

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

-- | /See:/ 'newUpdateEventSourceMapping' smart constructor.
data UpdateEventSourceMapping = UpdateEventSourceMapping'
  { -- | The maximum number of records in each batch that Lambda pulls from your
    -- stream or queue and sends to your function. Lambda passes all of the
    -- records in the batch to the function in a single call, up to the payload
    -- limit for synchronous invocation (6 MB).
    --
    -- -   __Amazon Kinesis__ - Default 100. Max 10,000.
    --
    -- -   __Amazon DynamoDB Streams__ - Default 100. Max 10,000.
    --
    -- -   __Amazon Simple Queue Service__ - Default 10. For standard queues
    --     the max is 10,000. For FIFO queues the max is 10.
    --
    -- -   __Amazon Managed Streaming for Apache Kafka__ - Default 100. Max
    --     10,000.
    --
    -- -   __Self-managed Apache Kafka__ - Default 100. Max 10,000.
    --
    -- -   __Amazon MQ (ActiveMQ and RabbitMQ)__ - Default 100. Max 10,000.
    UpdateEventSourceMapping -> Maybe Natural
batchSize :: Prelude.Maybe Prelude.Natural,
    -- | (Streams only) If the function returns an error, split the batch in two
    -- and retry.
    UpdateEventSourceMapping -> Maybe Bool
bisectBatchOnFunctionError :: Prelude.Maybe Prelude.Bool,
    -- | (Streams only) An Amazon SQS queue or Amazon SNS topic destination for
    -- discarded records.
    UpdateEventSourceMapping -> Maybe DestinationConfig
destinationConfig :: Prelude.Maybe DestinationConfig,
    -- | When true, the event source mapping is active. When false, Lambda pauses
    -- polling and invocation.
    --
    -- Default: True
    UpdateEventSourceMapping -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | An object that defines the filter criteria that determine whether Lambda
    -- should process an event. For more information, see
    -- <https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html Lambda event filtering>.
    UpdateEventSourceMapping -> Maybe FilterCriteria
filterCriteria :: Prelude.Maybe FilterCriteria,
    -- | The name of the Lambda function.
    --
    -- __Name formats__
    --
    -- -   __Function name__ - @MyFunction@.
    --
    -- -   __Function ARN__ -
    --     @arn:aws:lambda:us-west-2:123456789012:function:MyFunction@.
    --
    -- -   __Version or Alias ARN__ -
    --     @arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD@.
    --
    -- -   __Partial ARN__ - @123456789012:function:MyFunction@.
    --
    -- The length constraint applies only to the full ARN. If you specify only
    -- the function name, it\'s limited to 64 characters in length.
    UpdateEventSourceMapping -> Maybe Text
functionName :: Prelude.Maybe Prelude.Text,
    -- | (Streams and Amazon SQS) A list of current response type enums applied
    -- to the event source mapping.
    UpdateEventSourceMapping -> Maybe [FunctionResponseType]
functionResponseTypes :: Prelude.Maybe [FunctionResponseType],
    -- | The maximum amount of time, in seconds, that Lambda spends gathering
    -- records before invoking the function. You can configure
    -- @MaximumBatchingWindowInSeconds@ to any value from 0 seconds to 300
    -- seconds in increments of seconds.
    --
    -- For streams and Amazon SQS event sources, the default batching window is
    -- 0 seconds. For Amazon MSK, Self-managed Apache Kafka, and Amazon MQ
    -- event sources, the default batching window is 500 ms. Note that because
    -- you can only change @MaximumBatchingWindowInSeconds@ in increments of
    -- seconds, you cannot revert back to the 500 ms default batching window
    -- after you have changed it. To restore the default batching window, you
    -- must create a new event source mapping.
    --
    -- Related setting: For streams and Amazon SQS event sources, when you set
    -- @BatchSize@ to a value greater than 10, you must set
    -- @MaximumBatchingWindowInSeconds@ to at least 1.
    UpdateEventSourceMapping -> Maybe Natural
maximumBatchingWindowInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | (Streams only) Discard records older than the specified age. The default
    -- value is infinite (-1).
    UpdateEventSourceMapping -> Maybe Int
maximumRecordAgeInSeconds :: Prelude.Maybe Prelude.Int,
    -- | (Streams only) Discard records after the specified number of retries.
    -- The default value is infinite (-1). When set to infinite (-1), failed
    -- records are retried until the record expires.
    UpdateEventSourceMapping -> Maybe Int
maximumRetryAttempts :: Prelude.Maybe Prelude.Int,
    -- | (Streams only) The number of batches to process from each shard
    -- concurrently.
    UpdateEventSourceMapping -> Maybe Natural
parallelizationFactor :: Prelude.Maybe Prelude.Natural,
    -- | An array of authentication protocols or VPC components required to
    -- secure your event source.
    UpdateEventSourceMapping -> Maybe [SourceAccessConfiguration]
sourceAccessConfigurations :: Prelude.Maybe [SourceAccessConfiguration],
    -- | (Streams only) The duration in seconds of a processing window. The range
    -- is between 1 second and 900 seconds.
    UpdateEventSourceMapping -> Maybe Natural
tumblingWindowInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | The identifier of the event source mapping.
    UpdateEventSourceMapping -> Text
uuid :: Prelude.Text
  }
  deriving (UpdateEventSourceMapping -> UpdateEventSourceMapping -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEventSourceMapping -> UpdateEventSourceMapping -> Bool
$c/= :: UpdateEventSourceMapping -> UpdateEventSourceMapping -> Bool
== :: UpdateEventSourceMapping -> UpdateEventSourceMapping -> Bool
$c== :: UpdateEventSourceMapping -> UpdateEventSourceMapping -> Bool
Prelude.Eq, ReadPrec [UpdateEventSourceMapping]
ReadPrec UpdateEventSourceMapping
Int -> ReadS UpdateEventSourceMapping
ReadS [UpdateEventSourceMapping]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEventSourceMapping]
$creadListPrec :: ReadPrec [UpdateEventSourceMapping]
readPrec :: ReadPrec UpdateEventSourceMapping
$creadPrec :: ReadPrec UpdateEventSourceMapping
readList :: ReadS [UpdateEventSourceMapping]
$creadList :: ReadS [UpdateEventSourceMapping]
readsPrec :: Int -> ReadS UpdateEventSourceMapping
$creadsPrec :: Int -> ReadS UpdateEventSourceMapping
Prelude.Read, Int -> UpdateEventSourceMapping -> ShowS
[UpdateEventSourceMapping] -> ShowS
UpdateEventSourceMapping -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEventSourceMapping] -> ShowS
$cshowList :: [UpdateEventSourceMapping] -> ShowS
show :: UpdateEventSourceMapping -> String
$cshow :: UpdateEventSourceMapping -> String
showsPrec :: Int -> UpdateEventSourceMapping -> ShowS
$cshowsPrec :: Int -> UpdateEventSourceMapping -> ShowS
Prelude.Show, forall x.
Rep UpdateEventSourceMapping x -> UpdateEventSourceMapping
forall x.
UpdateEventSourceMapping -> Rep UpdateEventSourceMapping x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateEventSourceMapping x -> UpdateEventSourceMapping
$cfrom :: forall x.
UpdateEventSourceMapping -> Rep UpdateEventSourceMapping x
Prelude.Generic)

-- |
-- Create a value of 'UpdateEventSourceMapping' 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:
--
-- 'batchSize', 'updateEventSourceMapping_batchSize' - The maximum number of records in each batch that Lambda pulls from your
-- stream or queue and sends to your function. Lambda passes all of the
-- records in the batch to the function in a single call, up to the payload
-- limit for synchronous invocation (6 MB).
--
-- -   __Amazon Kinesis__ - Default 100. Max 10,000.
--
-- -   __Amazon DynamoDB Streams__ - Default 100. Max 10,000.
--
-- -   __Amazon Simple Queue Service__ - Default 10. For standard queues
--     the max is 10,000. For FIFO queues the max is 10.
--
-- -   __Amazon Managed Streaming for Apache Kafka__ - Default 100. Max
--     10,000.
--
-- -   __Self-managed Apache Kafka__ - Default 100. Max 10,000.
--
-- -   __Amazon MQ (ActiveMQ and RabbitMQ)__ - Default 100. Max 10,000.
--
-- 'bisectBatchOnFunctionError', 'updateEventSourceMapping_bisectBatchOnFunctionError' - (Streams only) If the function returns an error, split the batch in two
-- and retry.
--
-- 'destinationConfig', 'updateEventSourceMapping_destinationConfig' - (Streams only) An Amazon SQS queue or Amazon SNS topic destination for
-- discarded records.
--
-- 'enabled', 'updateEventSourceMapping_enabled' - When true, the event source mapping is active. When false, Lambda pauses
-- polling and invocation.
--
-- Default: True
--
-- 'filterCriteria', 'updateEventSourceMapping_filterCriteria' - An object that defines the filter criteria that determine whether Lambda
-- should process an event. For more information, see
-- <https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html Lambda event filtering>.
--
-- 'functionName', 'updateEventSourceMapping_functionName' - The name of the Lambda function.
--
-- __Name formats__
--
-- -   __Function name__ - @MyFunction@.
--
-- -   __Function ARN__ -
--     @arn:aws:lambda:us-west-2:123456789012:function:MyFunction@.
--
-- -   __Version or Alias ARN__ -
--     @arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD@.
--
-- -   __Partial ARN__ - @123456789012:function:MyFunction@.
--
-- The length constraint applies only to the full ARN. If you specify only
-- the function name, it\'s limited to 64 characters in length.
--
-- 'functionResponseTypes', 'updateEventSourceMapping_functionResponseTypes' - (Streams and Amazon SQS) A list of current response type enums applied
-- to the event source mapping.
--
-- 'maximumBatchingWindowInSeconds', 'updateEventSourceMapping_maximumBatchingWindowInSeconds' - The maximum amount of time, in seconds, that Lambda spends gathering
-- records before invoking the function. You can configure
-- @MaximumBatchingWindowInSeconds@ to any value from 0 seconds to 300
-- seconds in increments of seconds.
--
-- For streams and Amazon SQS event sources, the default batching window is
-- 0 seconds. For Amazon MSK, Self-managed Apache Kafka, and Amazon MQ
-- event sources, the default batching window is 500 ms. Note that because
-- you can only change @MaximumBatchingWindowInSeconds@ in increments of
-- seconds, you cannot revert back to the 500 ms default batching window
-- after you have changed it. To restore the default batching window, you
-- must create a new event source mapping.
--
-- Related setting: For streams and Amazon SQS event sources, when you set
-- @BatchSize@ to a value greater than 10, you must set
-- @MaximumBatchingWindowInSeconds@ to at least 1.
--
-- 'maximumRecordAgeInSeconds', 'updateEventSourceMapping_maximumRecordAgeInSeconds' - (Streams only) Discard records older than the specified age. The default
-- value is infinite (-1).
--
-- 'maximumRetryAttempts', 'updateEventSourceMapping_maximumRetryAttempts' - (Streams only) Discard records after the specified number of retries.
-- The default value is infinite (-1). When set to infinite (-1), failed
-- records are retried until the record expires.
--
-- 'parallelizationFactor', 'updateEventSourceMapping_parallelizationFactor' - (Streams only) The number of batches to process from each shard
-- concurrently.
--
-- 'sourceAccessConfigurations', 'updateEventSourceMapping_sourceAccessConfigurations' - An array of authentication protocols or VPC components required to
-- secure your event source.
--
-- 'tumblingWindowInSeconds', 'updateEventSourceMapping_tumblingWindowInSeconds' - (Streams only) The duration in seconds of a processing window. The range
-- is between 1 second and 900 seconds.
--
-- 'uuid', 'updateEventSourceMapping_uuid' - The identifier of the event source mapping.
newUpdateEventSourceMapping ::
  -- | 'uuid'
  Prelude.Text ->
  UpdateEventSourceMapping
newUpdateEventSourceMapping :: Text -> UpdateEventSourceMapping
newUpdateEventSourceMapping Text
pUUID_ =
  UpdateEventSourceMapping'
    { $sel:batchSize:UpdateEventSourceMapping' :: Maybe Natural
batchSize =
        forall a. Maybe a
Prelude.Nothing,
      $sel:bisectBatchOnFunctionError:UpdateEventSourceMapping' :: Maybe Bool
bisectBatchOnFunctionError = forall a. Maybe a
Prelude.Nothing,
      $sel:destinationConfig:UpdateEventSourceMapping' :: Maybe DestinationConfig
destinationConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:UpdateEventSourceMapping' :: Maybe Bool
enabled = forall a. Maybe a
Prelude.Nothing,
      $sel:filterCriteria:UpdateEventSourceMapping' :: Maybe FilterCriteria
filterCriteria = forall a. Maybe a
Prelude.Nothing,
      $sel:functionName:UpdateEventSourceMapping' :: Maybe Text
functionName = forall a. Maybe a
Prelude.Nothing,
      $sel:functionResponseTypes:UpdateEventSourceMapping' :: Maybe [FunctionResponseType]
functionResponseTypes = forall a. Maybe a
Prelude.Nothing,
      $sel:maximumBatchingWindowInSeconds:UpdateEventSourceMapping' :: Maybe Natural
maximumBatchingWindowInSeconds = forall a. Maybe a
Prelude.Nothing,
      $sel:maximumRecordAgeInSeconds:UpdateEventSourceMapping' :: Maybe Int
maximumRecordAgeInSeconds = forall a. Maybe a
Prelude.Nothing,
      $sel:maximumRetryAttempts:UpdateEventSourceMapping' :: Maybe Int
maximumRetryAttempts = forall a. Maybe a
Prelude.Nothing,
      $sel:parallelizationFactor:UpdateEventSourceMapping' :: Maybe Natural
parallelizationFactor = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceAccessConfigurations:UpdateEventSourceMapping' :: Maybe [SourceAccessConfiguration]
sourceAccessConfigurations = forall a. Maybe a
Prelude.Nothing,
      $sel:tumblingWindowInSeconds:UpdateEventSourceMapping' :: Maybe Natural
tumblingWindowInSeconds = forall a. Maybe a
Prelude.Nothing,
      $sel:uuid:UpdateEventSourceMapping' :: Text
uuid = Text
pUUID_
    }

-- | The maximum number of records in each batch that Lambda pulls from your
-- stream or queue and sends to your function. Lambda passes all of the
-- records in the batch to the function in a single call, up to the payload
-- limit for synchronous invocation (6 MB).
--
-- -   __Amazon Kinesis__ - Default 100. Max 10,000.
--
-- -   __Amazon DynamoDB Streams__ - Default 100. Max 10,000.
--
-- -   __Amazon Simple Queue Service__ - Default 10. For standard queues
--     the max is 10,000. For FIFO queues the max is 10.
--
-- -   __Amazon Managed Streaming for Apache Kafka__ - Default 100. Max
--     10,000.
--
-- -   __Self-managed Apache Kafka__ - Default 100. Max 10,000.
--
-- -   __Amazon MQ (ActiveMQ and RabbitMQ)__ - Default 100. Max 10,000.
updateEventSourceMapping_batchSize :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe Prelude.Natural)
updateEventSourceMapping_batchSize :: Lens' UpdateEventSourceMapping (Maybe Natural)
updateEventSourceMapping_batchSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventSourceMapping' {Maybe Natural
batchSize :: Maybe Natural
$sel:batchSize:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
batchSize} -> Maybe Natural
batchSize) (\s :: UpdateEventSourceMapping
s@UpdateEventSourceMapping' {} Maybe Natural
a -> UpdateEventSourceMapping
s {$sel:batchSize:UpdateEventSourceMapping' :: Maybe Natural
batchSize = Maybe Natural
a} :: UpdateEventSourceMapping)

-- | (Streams only) If the function returns an error, split the batch in two
-- and retry.
updateEventSourceMapping_bisectBatchOnFunctionError :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe Prelude.Bool)
updateEventSourceMapping_bisectBatchOnFunctionError :: Lens' UpdateEventSourceMapping (Maybe Bool)
updateEventSourceMapping_bisectBatchOnFunctionError = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventSourceMapping' {Maybe Bool
bisectBatchOnFunctionError :: Maybe Bool
$sel:bisectBatchOnFunctionError:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Bool
bisectBatchOnFunctionError} -> Maybe Bool
bisectBatchOnFunctionError) (\s :: UpdateEventSourceMapping
s@UpdateEventSourceMapping' {} Maybe Bool
a -> UpdateEventSourceMapping
s {$sel:bisectBatchOnFunctionError:UpdateEventSourceMapping' :: Maybe Bool
bisectBatchOnFunctionError = Maybe Bool
a} :: UpdateEventSourceMapping)

-- | (Streams only) An Amazon SQS queue or Amazon SNS topic destination for
-- discarded records.
updateEventSourceMapping_destinationConfig :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe DestinationConfig)
updateEventSourceMapping_destinationConfig :: Lens' UpdateEventSourceMapping (Maybe DestinationConfig)
updateEventSourceMapping_destinationConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventSourceMapping' {Maybe DestinationConfig
destinationConfig :: Maybe DestinationConfig
$sel:destinationConfig:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe DestinationConfig
destinationConfig} -> Maybe DestinationConfig
destinationConfig) (\s :: UpdateEventSourceMapping
s@UpdateEventSourceMapping' {} Maybe DestinationConfig
a -> UpdateEventSourceMapping
s {$sel:destinationConfig:UpdateEventSourceMapping' :: Maybe DestinationConfig
destinationConfig = Maybe DestinationConfig
a} :: UpdateEventSourceMapping)

-- | When true, the event source mapping is active. When false, Lambda pauses
-- polling and invocation.
--
-- Default: True
updateEventSourceMapping_enabled :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe Prelude.Bool)
updateEventSourceMapping_enabled :: Lens' UpdateEventSourceMapping (Maybe Bool)
updateEventSourceMapping_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventSourceMapping' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: UpdateEventSourceMapping
s@UpdateEventSourceMapping' {} Maybe Bool
a -> UpdateEventSourceMapping
s {$sel:enabled:UpdateEventSourceMapping' :: Maybe Bool
enabled = Maybe Bool
a} :: UpdateEventSourceMapping)

-- | An object that defines the filter criteria that determine whether Lambda
-- should process an event. For more information, see
-- <https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html Lambda event filtering>.
updateEventSourceMapping_filterCriteria :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe FilterCriteria)
updateEventSourceMapping_filterCriteria :: Lens' UpdateEventSourceMapping (Maybe FilterCriteria)
updateEventSourceMapping_filterCriteria = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventSourceMapping' {Maybe FilterCriteria
filterCriteria :: Maybe FilterCriteria
$sel:filterCriteria:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe FilterCriteria
filterCriteria} -> Maybe FilterCriteria
filterCriteria) (\s :: UpdateEventSourceMapping
s@UpdateEventSourceMapping' {} Maybe FilterCriteria
a -> UpdateEventSourceMapping
s {$sel:filterCriteria:UpdateEventSourceMapping' :: Maybe FilterCriteria
filterCriteria = Maybe FilterCriteria
a} :: UpdateEventSourceMapping)

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

-- | (Streams and Amazon SQS) A list of current response type enums applied
-- to the event source mapping.
updateEventSourceMapping_functionResponseTypes :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe [FunctionResponseType])
updateEventSourceMapping_functionResponseTypes :: Lens' UpdateEventSourceMapping (Maybe [FunctionResponseType])
updateEventSourceMapping_functionResponseTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventSourceMapping' {Maybe [FunctionResponseType]
functionResponseTypes :: Maybe [FunctionResponseType]
$sel:functionResponseTypes:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe [FunctionResponseType]
functionResponseTypes} -> Maybe [FunctionResponseType]
functionResponseTypes) (\s :: UpdateEventSourceMapping
s@UpdateEventSourceMapping' {} Maybe [FunctionResponseType]
a -> UpdateEventSourceMapping
s {$sel:functionResponseTypes:UpdateEventSourceMapping' :: Maybe [FunctionResponseType]
functionResponseTypes = Maybe [FunctionResponseType]
a} :: UpdateEventSourceMapping) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum amount of time, in seconds, that Lambda spends gathering
-- records before invoking the function. You can configure
-- @MaximumBatchingWindowInSeconds@ to any value from 0 seconds to 300
-- seconds in increments of seconds.
--
-- For streams and Amazon SQS event sources, the default batching window is
-- 0 seconds. For Amazon MSK, Self-managed Apache Kafka, and Amazon MQ
-- event sources, the default batching window is 500 ms. Note that because
-- you can only change @MaximumBatchingWindowInSeconds@ in increments of
-- seconds, you cannot revert back to the 500 ms default batching window
-- after you have changed it. To restore the default batching window, you
-- must create a new event source mapping.
--
-- Related setting: For streams and Amazon SQS event sources, when you set
-- @BatchSize@ to a value greater than 10, you must set
-- @MaximumBatchingWindowInSeconds@ to at least 1.
updateEventSourceMapping_maximumBatchingWindowInSeconds :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe Prelude.Natural)
updateEventSourceMapping_maximumBatchingWindowInSeconds :: Lens' UpdateEventSourceMapping (Maybe Natural)
updateEventSourceMapping_maximumBatchingWindowInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventSourceMapping' {Maybe Natural
maximumBatchingWindowInSeconds :: Maybe Natural
$sel:maximumBatchingWindowInSeconds:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
maximumBatchingWindowInSeconds} -> Maybe Natural
maximumBatchingWindowInSeconds) (\s :: UpdateEventSourceMapping
s@UpdateEventSourceMapping' {} Maybe Natural
a -> UpdateEventSourceMapping
s {$sel:maximumBatchingWindowInSeconds:UpdateEventSourceMapping' :: Maybe Natural
maximumBatchingWindowInSeconds = Maybe Natural
a} :: UpdateEventSourceMapping)

-- | (Streams only) Discard records older than the specified age. The default
-- value is infinite (-1).
updateEventSourceMapping_maximumRecordAgeInSeconds :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe Prelude.Int)
updateEventSourceMapping_maximumRecordAgeInSeconds :: Lens' UpdateEventSourceMapping (Maybe Int)
updateEventSourceMapping_maximumRecordAgeInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventSourceMapping' {Maybe Int
maximumRecordAgeInSeconds :: Maybe Int
$sel:maximumRecordAgeInSeconds:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Int
maximumRecordAgeInSeconds} -> Maybe Int
maximumRecordAgeInSeconds) (\s :: UpdateEventSourceMapping
s@UpdateEventSourceMapping' {} Maybe Int
a -> UpdateEventSourceMapping
s {$sel:maximumRecordAgeInSeconds:UpdateEventSourceMapping' :: Maybe Int
maximumRecordAgeInSeconds = Maybe Int
a} :: UpdateEventSourceMapping)

-- | (Streams only) Discard records after the specified number of retries.
-- The default value is infinite (-1). When set to infinite (-1), failed
-- records are retried until the record expires.
updateEventSourceMapping_maximumRetryAttempts :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe Prelude.Int)
updateEventSourceMapping_maximumRetryAttempts :: Lens' UpdateEventSourceMapping (Maybe Int)
updateEventSourceMapping_maximumRetryAttempts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventSourceMapping' {Maybe Int
maximumRetryAttempts :: Maybe Int
$sel:maximumRetryAttempts:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Int
maximumRetryAttempts} -> Maybe Int
maximumRetryAttempts) (\s :: UpdateEventSourceMapping
s@UpdateEventSourceMapping' {} Maybe Int
a -> UpdateEventSourceMapping
s {$sel:maximumRetryAttempts:UpdateEventSourceMapping' :: Maybe Int
maximumRetryAttempts = Maybe Int
a} :: UpdateEventSourceMapping)

-- | (Streams only) The number of batches to process from each shard
-- concurrently.
updateEventSourceMapping_parallelizationFactor :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe Prelude.Natural)
updateEventSourceMapping_parallelizationFactor :: Lens' UpdateEventSourceMapping (Maybe Natural)
updateEventSourceMapping_parallelizationFactor = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventSourceMapping' {Maybe Natural
parallelizationFactor :: Maybe Natural
$sel:parallelizationFactor:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
parallelizationFactor} -> Maybe Natural
parallelizationFactor) (\s :: UpdateEventSourceMapping
s@UpdateEventSourceMapping' {} Maybe Natural
a -> UpdateEventSourceMapping
s {$sel:parallelizationFactor:UpdateEventSourceMapping' :: Maybe Natural
parallelizationFactor = Maybe Natural
a} :: UpdateEventSourceMapping)

-- | An array of authentication protocols or VPC components required to
-- secure your event source.
updateEventSourceMapping_sourceAccessConfigurations :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe [SourceAccessConfiguration])
updateEventSourceMapping_sourceAccessConfigurations :: Lens' UpdateEventSourceMapping (Maybe [SourceAccessConfiguration])
updateEventSourceMapping_sourceAccessConfigurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventSourceMapping' {Maybe [SourceAccessConfiguration]
sourceAccessConfigurations :: Maybe [SourceAccessConfiguration]
$sel:sourceAccessConfigurations:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe [SourceAccessConfiguration]
sourceAccessConfigurations} -> Maybe [SourceAccessConfiguration]
sourceAccessConfigurations) (\s :: UpdateEventSourceMapping
s@UpdateEventSourceMapping' {} Maybe [SourceAccessConfiguration]
a -> UpdateEventSourceMapping
s {$sel:sourceAccessConfigurations:UpdateEventSourceMapping' :: Maybe [SourceAccessConfiguration]
sourceAccessConfigurations = Maybe [SourceAccessConfiguration]
a} :: UpdateEventSourceMapping) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | (Streams only) The duration in seconds of a processing window. The range
-- is between 1 second and 900 seconds.
updateEventSourceMapping_tumblingWindowInSeconds :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe Prelude.Natural)
updateEventSourceMapping_tumblingWindowInSeconds :: Lens' UpdateEventSourceMapping (Maybe Natural)
updateEventSourceMapping_tumblingWindowInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventSourceMapping' {Maybe Natural
tumblingWindowInSeconds :: Maybe Natural
$sel:tumblingWindowInSeconds:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
tumblingWindowInSeconds} -> Maybe Natural
tumblingWindowInSeconds) (\s :: UpdateEventSourceMapping
s@UpdateEventSourceMapping' {} Maybe Natural
a -> UpdateEventSourceMapping
s {$sel:tumblingWindowInSeconds:UpdateEventSourceMapping' :: Maybe Natural
tumblingWindowInSeconds = Maybe Natural
a} :: UpdateEventSourceMapping)

-- | The identifier of the event source mapping.
updateEventSourceMapping_uuid :: Lens.Lens' UpdateEventSourceMapping Prelude.Text
updateEventSourceMapping_uuid :: Lens' UpdateEventSourceMapping Text
updateEventSourceMapping_uuid = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventSourceMapping' {Text
uuid :: Text
$sel:uuid:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Text
uuid} -> Text
uuid) (\s :: UpdateEventSourceMapping
s@UpdateEventSourceMapping' {} Text
a -> UpdateEventSourceMapping
s {$sel:uuid:UpdateEventSourceMapping' :: Text
uuid = Text
a} :: UpdateEventSourceMapping)

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

instance Prelude.Hashable UpdateEventSourceMapping where
  hashWithSalt :: Int -> UpdateEventSourceMapping -> Int
hashWithSalt Int
_salt UpdateEventSourceMapping' {Maybe Bool
Maybe Int
Maybe Natural
Maybe [FunctionResponseType]
Maybe [SourceAccessConfiguration]
Maybe Text
Maybe FilterCriteria
Maybe DestinationConfig
Text
uuid :: Text
tumblingWindowInSeconds :: Maybe Natural
sourceAccessConfigurations :: Maybe [SourceAccessConfiguration]
parallelizationFactor :: Maybe Natural
maximumRetryAttempts :: Maybe Int
maximumRecordAgeInSeconds :: Maybe Int
maximumBatchingWindowInSeconds :: Maybe Natural
functionResponseTypes :: Maybe [FunctionResponseType]
functionName :: Maybe Text
filterCriteria :: Maybe FilterCriteria
enabled :: Maybe Bool
destinationConfig :: Maybe DestinationConfig
bisectBatchOnFunctionError :: Maybe Bool
batchSize :: Maybe Natural
$sel:uuid:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Text
$sel:tumblingWindowInSeconds:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
$sel:sourceAccessConfigurations:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe [SourceAccessConfiguration]
$sel:parallelizationFactor:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
$sel:maximumRetryAttempts:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Int
$sel:maximumRecordAgeInSeconds:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Int
$sel:maximumBatchingWindowInSeconds:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
$sel:functionResponseTypes:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe [FunctionResponseType]
$sel:functionName:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Text
$sel:filterCriteria:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe FilterCriteria
$sel:enabled:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Bool
$sel:destinationConfig:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe DestinationConfig
$sel:bisectBatchOnFunctionError:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Bool
$sel:batchSize:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
batchSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
bisectBatchOnFunctionError
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DestinationConfig
destinationConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FilterCriteria
filterCriteria
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
functionName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [FunctionResponseType]
functionResponseTypes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maximumBatchingWindowInSeconds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maximumRecordAgeInSeconds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maximumRetryAttempts
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
parallelizationFactor
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [SourceAccessConfiguration]
sourceAccessConfigurations
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
tumblingWindowInSeconds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
uuid

instance Prelude.NFData UpdateEventSourceMapping where
  rnf :: UpdateEventSourceMapping -> ()
rnf UpdateEventSourceMapping' {Maybe Bool
Maybe Int
Maybe Natural
Maybe [FunctionResponseType]
Maybe [SourceAccessConfiguration]
Maybe Text
Maybe FilterCriteria
Maybe DestinationConfig
Text
uuid :: Text
tumblingWindowInSeconds :: Maybe Natural
sourceAccessConfigurations :: Maybe [SourceAccessConfiguration]
parallelizationFactor :: Maybe Natural
maximumRetryAttempts :: Maybe Int
maximumRecordAgeInSeconds :: Maybe Int
maximumBatchingWindowInSeconds :: Maybe Natural
functionResponseTypes :: Maybe [FunctionResponseType]
functionName :: Maybe Text
filterCriteria :: Maybe FilterCriteria
enabled :: Maybe Bool
destinationConfig :: Maybe DestinationConfig
bisectBatchOnFunctionError :: Maybe Bool
batchSize :: Maybe Natural
$sel:uuid:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Text
$sel:tumblingWindowInSeconds:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
$sel:sourceAccessConfigurations:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe [SourceAccessConfiguration]
$sel:parallelizationFactor:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
$sel:maximumRetryAttempts:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Int
$sel:maximumRecordAgeInSeconds:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Int
$sel:maximumBatchingWindowInSeconds:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
$sel:functionResponseTypes:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe [FunctionResponseType]
$sel:functionName:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Text
$sel:filterCriteria:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe FilterCriteria
$sel:enabled:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Bool
$sel:destinationConfig:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe DestinationConfig
$sel:bisectBatchOnFunctionError:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Bool
$sel:batchSize:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
batchSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
bisectBatchOnFunctionError
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DestinationConfig
destinationConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FilterCriteria
filterCriteria
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
functionName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [FunctionResponseType]
functionResponseTypes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maximumBatchingWindowInSeconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maximumRecordAgeInSeconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maximumRetryAttempts
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
parallelizationFactor
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SourceAccessConfiguration]
sourceAccessConfigurations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
tumblingWindowInSeconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
uuid

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

instance Data.ToJSON UpdateEventSourceMapping where
  toJSON :: UpdateEventSourceMapping -> Value
toJSON UpdateEventSourceMapping' {Maybe Bool
Maybe Int
Maybe Natural
Maybe [FunctionResponseType]
Maybe [SourceAccessConfiguration]
Maybe Text
Maybe FilterCriteria
Maybe DestinationConfig
Text
uuid :: Text
tumblingWindowInSeconds :: Maybe Natural
sourceAccessConfigurations :: Maybe [SourceAccessConfiguration]
parallelizationFactor :: Maybe Natural
maximumRetryAttempts :: Maybe Int
maximumRecordAgeInSeconds :: Maybe Int
maximumBatchingWindowInSeconds :: Maybe Natural
functionResponseTypes :: Maybe [FunctionResponseType]
functionName :: Maybe Text
filterCriteria :: Maybe FilterCriteria
enabled :: Maybe Bool
destinationConfig :: Maybe DestinationConfig
bisectBatchOnFunctionError :: Maybe Bool
batchSize :: Maybe Natural
$sel:uuid:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Text
$sel:tumblingWindowInSeconds:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
$sel:sourceAccessConfigurations:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe [SourceAccessConfiguration]
$sel:parallelizationFactor:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
$sel:maximumRetryAttempts:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Int
$sel:maximumRecordAgeInSeconds:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Int
$sel:maximumBatchingWindowInSeconds:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
$sel:functionResponseTypes:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe [FunctionResponseType]
$sel:functionName:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Text
$sel:filterCriteria:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe FilterCriteria
$sel:enabled:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Bool
$sel:destinationConfig:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe DestinationConfig
$sel:bisectBatchOnFunctionError:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Bool
$sel:batchSize:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"BatchSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
batchSize,
            (Key
"BisectBatchOnFunctionError" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
bisectBatchOnFunctionError,
            (Key
"DestinationConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DestinationConfig
destinationConfig,
            (Key
"Enabled" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enabled,
            (Key
"FilterCriteria" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FilterCriteria
filterCriteria,
            (Key
"FunctionName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
functionName,
            (Key
"FunctionResponseTypes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [FunctionResponseType]
functionResponseTypes,
            (Key
"MaximumBatchingWindowInSeconds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maximumBatchingWindowInSeconds,
            (Key
"MaximumRecordAgeInSeconds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maximumRecordAgeInSeconds,
            (Key
"MaximumRetryAttempts" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maximumRetryAttempts,
            (Key
"ParallelizationFactor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
parallelizationFactor,
            (Key
"SourceAccessConfigurations" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SourceAccessConfiguration]
sourceAccessConfigurations,
            (Key
"TumblingWindowInSeconds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
tumblingWindowInSeconds
          ]
      )

instance Data.ToPath UpdateEventSourceMapping where
  toPath :: UpdateEventSourceMapping -> ByteString
toPath UpdateEventSourceMapping' {Maybe Bool
Maybe Int
Maybe Natural
Maybe [FunctionResponseType]
Maybe [SourceAccessConfiguration]
Maybe Text
Maybe FilterCriteria
Maybe DestinationConfig
Text
uuid :: Text
tumblingWindowInSeconds :: Maybe Natural
sourceAccessConfigurations :: Maybe [SourceAccessConfiguration]
parallelizationFactor :: Maybe Natural
maximumRetryAttempts :: Maybe Int
maximumRecordAgeInSeconds :: Maybe Int
maximumBatchingWindowInSeconds :: Maybe Natural
functionResponseTypes :: Maybe [FunctionResponseType]
functionName :: Maybe Text
filterCriteria :: Maybe FilterCriteria
enabled :: Maybe Bool
destinationConfig :: Maybe DestinationConfig
bisectBatchOnFunctionError :: Maybe Bool
batchSize :: Maybe Natural
$sel:uuid:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Text
$sel:tumblingWindowInSeconds:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
$sel:sourceAccessConfigurations:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe [SourceAccessConfiguration]
$sel:parallelizationFactor:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
$sel:maximumRetryAttempts:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Int
$sel:maximumRecordAgeInSeconds:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Int
$sel:maximumBatchingWindowInSeconds:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
$sel:functionResponseTypes:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe [FunctionResponseType]
$sel:functionName:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Text
$sel:filterCriteria:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe FilterCriteria
$sel:enabled:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Bool
$sel:destinationConfig:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe DestinationConfig
$sel:bisectBatchOnFunctionError:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Bool
$sel:batchSize:UpdateEventSourceMapping' :: UpdateEventSourceMapping -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2015-03-31/event-source-mappings/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
uuid
      ]

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