{-# 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-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)
--
-- Updates an event source mapping. You can change the function that Lambda
-- invokes, or pause invocation and resume later from the same location.
--
-- The following error handling options are only available 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.
module Amazonka.Lambda.UpdateEventSourceMapping
  ( -- * Creating a Request
    UpdateEventSourceMapping (..),
    newUpdateEventSourceMapping,

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

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

    -- * Response Lenses
    eventSourceMappingConfiguration_eventSourceArn,
    eventSourceMappingConfiguration_state,
    eventSourceMappingConfiguration_startingPositionTimestamp,
    eventSourceMappingConfiguration_functionArn,
    eventSourceMappingConfiguration_topics,
    eventSourceMappingConfiguration_queues,
    eventSourceMappingConfiguration_bisectBatchOnFunctionError,
    eventSourceMappingConfiguration_uuid,
    eventSourceMappingConfiguration_parallelizationFactor,
    eventSourceMappingConfiguration_lastProcessingResult,
    eventSourceMappingConfiguration_maximumRetryAttempts,
    eventSourceMappingConfiguration_batchSize,
    eventSourceMappingConfiguration_stateTransitionReason,
    eventSourceMappingConfiguration_maximumBatchingWindowInSeconds,
    eventSourceMappingConfiguration_sourceAccessConfigurations,
    eventSourceMappingConfiguration_maximumRecordAgeInSeconds,
    eventSourceMappingConfiguration_functionResponseTypes,
    eventSourceMappingConfiguration_tumblingWindowInSeconds,
    eventSourceMappingConfiguration_selfManagedEventSource,
    eventSourceMappingConfiguration_lastModified,
    eventSourceMappingConfiguration_destinationConfig,
    eventSourceMappingConfiguration_startingPosition,
  )
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:/ 'newUpdateEventSourceMapping' smart constructor.
data UpdateEventSourceMapping = UpdateEventSourceMapping'
  { -- | 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,
    -- | (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) The number of batches to process from each shard
    -- concurrently.
    UpdateEventSourceMapping -> Maybe Natural
parallelizationFactor :: Prelude.Maybe Prelude.Natural,
    -- | (Streams only) Discard records after the specified number of retries.
    -- The default value is infinite (-1). When set to infinite (-1), failed
    -- records will be retried until the record expires.
    UpdateEventSourceMapping -> Maybe Int
maximumRetryAttempts :: Prelude.Maybe Prelude.Int,
    -- | 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 1,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.
    UpdateEventSourceMapping -> Maybe Natural
batchSize :: Prelude.Maybe Prelude.Natural,
    -- | (Streams and Amazon SQS standard queues) The maximum amount of time, in
    -- seconds, that Lambda spends gathering records before invoking the
    -- function.
    --
    -- Default: 0
    --
    -- Related setting: 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,
    -- | An array of authentication protocols or VPC components required to
    -- secure your event source.
    UpdateEventSourceMapping -> Maybe [SourceAccessConfiguration]
sourceAccessConfigurations :: Prelude.Maybe [SourceAccessConfiguration],
    -- | (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) A list of current response type enums applied to the
    -- event source mapping.
    UpdateEventSourceMapping -> Maybe [FunctionResponseType]
functionResponseTypes :: Prelude.Maybe [FunctionResponseType],
    -- | (Streams only) The duration in seconds of a processing window. The range
    -- is between 1 second up to 900 seconds.
    UpdateEventSourceMapping -> Maybe Natural
tumblingWindowInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | 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 only) An Amazon SQS queue or Amazon SNS topic destination for
    -- discarded records.
    UpdateEventSourceMapping -> Maybe DestinationConfig
destinationConfig :: Prelude.Maybe DestinationConfig,
    -- | The identifier of the event source mapping.
    UpdateEventSourceMapping -> Text
uuid :: Prelude.Text
  }
  deriving (UpdateEventSourceMapping -> UpdateEventSourceMapping -> Bool
(UpdateEventSourceMapping -> UpdateEventSourceMapping -> Bool)
-> (UpdateEventSourceMapping -> UpdateEventSourceMapping -> Bool)
-> Eq UpdateEventSourceMapping
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]
(Int -> ReadS UpdateEventSourceMapping)
-> ReadS [UpdateEventSourceMapping]
-> ReadPrec UpdateEventSourceMapping
-> ReadPrec [UpdateEventSourceMapping]
-> Read 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
(Int -> UpdateEventSourceMapping -> ShowS)
-> (UpdateEventSourceMapping -> String)
-> ([UpdateEventSourceMapping] -> ShowS)
-> Show UpdateEventSourceMapping
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.
 UpdateEventSourceMapping -> Rep UpdateEventSourceMapping x)
-> (forall x.
    Rep UpdateEventSourceMapping x -> UpdateEventSourceMapping)
-> Generic UpdateEventSourceMapping
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:
--
-- 'enabled', 'updateEventSourceMapping_enabled' - When true, the event source mapping is active. When false, Lambda pauses
-- polling and invocation.
--
-- Default: True
--
-- 'bisectBatchOnFunctionError', 'updateEventSourceMapping_bisectBatchOnFunctionError' - (Streams only) If the function returns an error, split the batch in two
-- and retry.
--
-- 'parallelizationFactor', 'updateEventSourceMapping_parallelizationFactor' - (Streams only) The number of batches to process from each shard
-- concurrently.
--
-- '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 will be retried until the record expires.
--
-- '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 1,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.
--
-- 'maximumBatchingWindowInSeconds', 'updateEventSourceMapping_maximumBatchingWindowInSeconds' - (Streams and Amazon SQS standard queues) The maximum amount of time, in
-- seconds, that Lambda spends gathering records before invoking the
-- function.
--
-- Default: 0
--
-- Related setting: When you set @BatchSize@ to a value greater than 10,
-- you must set @MaximumBatchingWindowInSeconds@ to at least 1.
--
-- 'sourceAccessConfigurations', 'updateEventSourceMapping_sourceAccessConfigurations' - An array of authentication protocols or VPC components required to
-- secure your event source.
--
-- 'maximumRecordAgeInSeconds', 'updateEventSourceMapping_maximumRecordAgeInSeconds' - (Streams only) Discard records older than the specified age. The default
-- value is infinite (-1).
--
-- 'functionResponseTypes', 'updateEventSourceMapping_functionResponseTypes' - (Streams only) A list of current response type enums applied to the
-- event source mapping.
--
-- 'tumblingWindowInSeconds', 'updateEventSourceMapping_tumblingWindowInSeconds' - (Streams only) The duration in seconds of a processing window. The range
-- is between 1 second up to 900 seconds.
--
-- '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.
--
-- 'destinationConfig', 'updateEventSourceMapping_destinationConfig' - (Streams only) An Amazon SQS queue or Amazon SNS topic destination for
-- discarded records.
--
-- 'uuid', 'updateEventSourceMapping_uuid' - The identifier of the event source mapping.
newUpdateEventSourceMapping ::
  -- | 'uuid'
  Prelude.Text ->
  UpdateEventSourceMapping
newUpdateEventSourceMapping :: Text -> UpdateEventSourceMapping
newUpdateEventSourceMapping Text
pUUID_ =
  UpdateEventSourceMapping' :: Maybe Bool
-> Maybe Bool
-> Maybe Natural
-> Maybe Int
-> Maybe Natural
-> Maybe Natural
-> Maybe [SourceAccessConfiguration]
-> Maybe Int
-> Maybe [FunctionResponseType]
-> Maybe Natural
-> Maybe Text
-> Maybe DestinationConfig
-> Text
-> UpdateEventSourceMapping
UpdateEventSourceMapping'
    { $sel:enabled:UpdateEventSourceMapping' :: Maybe Bool
enabled =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:bisectBatchOnFunctionError:UpdateEventSourceMapping' :: Maybe Bool
bisectBatchOnFunctionError = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:parallelizationFactor:UpdateEventSourceMapping' :: Maybe Natural
parallelizationFactor = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:maximumRetryAttempts:UpdateEventSourceMapping' :: Maybe Int
maximumRetryAttempts = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:batchSize:UpdateEventSourceMapping' :: Maybe Natural
batchSize = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:maximumBatchingWindowInSeconds:UpdateEventSourceMapping' :: Maybe Natural
maximumBatchingWindowInSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceAccessConfigurations:UpdateEventSourceMapping' :: Maybe [SourceAccessConfiguration]
sourceAccessConfigurations = Maybe [SourceAccessConfiguration]
forall a. Maybe a
Prelude.Nothing,
      $sel:maximumRecordAgeInSeconds:UpdateEventSourceMapping' :: Maybe Int
maximumRecordAgeInSeconds = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:functionResponseTypes:UpdateEventSourceMapping' :: Maybe [FunctionResponseType]
functionResponseTypes = Maybe [FunctionResponseType]
forall a. Maybe a
Prelude.Nothing,
      $sel:tumblingWindowInSeconds:UpdateEventSourceMapping' :: Maybe Natural
tumblingWindowInSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:functionName:UpdateEventSourceMapping' :: Maybe Text
functionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:destinationConfig:UpdateEventSourceMapping' :: Maybe DestinationConfig
destinationConfig = Maybe DestinationConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:uuid:UpdateEventSourceMapping' :: Text
uuid = Text
pUUID_
    }

-- | 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 :: (Maybe Bool -> f (Maybe Bool))
-> UpdateEventSourceMapping -> f UpdateEventSourceMapping
updateEventSourceMapping_enabled = (UpdateEventSourceMapping -> Maybe Bool)
-> (UpdateEventSourceMapping
    -> Maybe Bool -> UpdateEventSourceMapping)
-> Lens
     UpdateEventSourceMapping
     UpdateEventSourceMapping
     (Maybe Bool)
     (Maybe Bool)
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)

-- | (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 :: (Maybe Bool -> f (Maybe Bool))
-> UpdateEventSourceMapping -> f UpdateEventSourceMapping
updateEventSourceMapping_bisectBatchOnFunctionError = (UpdateEventSourceMapping -> Maybe Bool)
-> (UpdateEventSourceMapping
    -> Maybe Bool -> UpdateEventSourceMapping)
-> Lens
     UpdateEventSourceMapping
     UpdateEventSourceMapping
     (Maybe Bool)
     (Maybe Bool)
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) The number of batches to process from each shard
-- concurrently.
updateEventSourceMapping_parallelizationFactor :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe Prelude.Natural)
updateEventSourceMapping_parallelizationFactor :: (Maybe Natural -> f (Maybe Natural))
-> UpdateEventSourceMapping -> f UpdateEventSourceMapping
updateEventSourceMapping_parallelizationFactor = (UpdateEventSourceMapping -> Maybe Natural)
-> (UpdateEventSourceMapping
    -> Maybe Natural -> UpdateEventSourceMapping)
-> Lens
     UpdateEventSourceMapping
     UpdateEventSourceMapping
     (Maybe Natural)
     (Maybe Natural)
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)

-- | (Streams only) Discard records after the specified number of retries.
-- The default value is infinite (-1). When set to infinite (-1), failed
-- records will be retried until the record expires.
updateEventSourceMapping_maximumRetryAttempts :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe Prelude.Int)
updateEventSourceMapping_maximumRetryAttempts :: (Maybe Int -> f (Maybe Int))
-> UpdateEventSourceMapping -> f UpdateEventSourceMapping
updateEventSourceMapping_maximumRetryAttempts = (UpdateEventSourceMapping -> Maybe Int)
-> (UpdateEventSourceMapping
    -> Maybe Int -> UpdateEventSourceMapping)
-> Lens
     UpdateEventSourceMapping
     UpdateEventSourceMapping
     (Maybe Int)
     (Maybe Int)
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)

-- | 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 1,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.
updateEventSourceMapping_batchSize :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe Prelude.Natural)
updateEventSourceMapping_batchSize :: (Maybe Natural -> f (Maybe Natural))
-> UpdateEventSourceMapping -> f UpdateEventSourceMapping
updateEventSourceMapping_batchSize = (UpdateEventSourceMapping -> Maybe Natural)
-> (UpdateEventSourceMapping
    -> Maybe Natural -> UpdateEventSourceMapping)
-> Lens
     UpdateEventSourceMapping
     UpdateEventSourceMapping
     (Maybe Natural)
     (Maybe Natural)
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 and Amazon SQS standard queues) The maximum amount of time, in
-- seconds, that Lambda spends gathering records before invoking the
-- function.
--
-- Default: 0
--
-- Related setting: 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 :: (Maybe Natural -> f (Maybe Natural))
-> UpdateEventSourceMapping -> f UpdateEventSourceMapping
updateEventSourceMapping_maximumBatchingWindowInSeconds = (UpdateEventSourceMapping -> Maybe Natural)
-> (UpdateEventSourceMapping
    -> Maybe Natural -> UpdateEventSourceMapping)
-> Lens
     UpdateEventSourceMapping
     UpdateEventSourceMapping
     (Maybe Natural)
     (Maybe Natural)
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)

-- | An array of authentication protocols or VPC components required to
-- secure your event source.
updateEventSourceMapping_sourceAccessConfigurations :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe [SourceAccessConfiguration])
updateEventSourceMapping_sourceAccessConfigurations :: (Maybe [SourceAccessConfiguration]
 -> f (Maybe [SourceAccessConfiguration]))
-> UpdateEventSourceMapping -> f UpdateEventSourceMapping
updateEventSourceMapping_sourceAccessConfigurations = (UpdateEventSourceMapping -> Maybe [SourceAccessConfiguration])
-> (UpdateEventSourceMapping
    -> Maybe [SourceAccessConfiguration] -> UpdateEventSourceMapping)
-> Lens
     UpdateEventSourceMapping
     UpdateEventSourceMapping
     (Maybe [SourceAccessConfiguration])
     (Maybe [SourceAccessConfiguration])
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) ((Maybe [SourceAccessConfiguration]
  -> f (Maybe [SourceAccessConfiguration]))
 -> UpdateEventSourceMapping -> f UpdateEventSourceMapping)
-> ((Maybe [SourceAccessConfiguration]
     -> f (Maybe [SourceAccessConfiguration]))
    -> Maybe [SourceAccessConfiguration]
    -> f (Maybe [SourceAccessConfiguration]))
-> (Maybe [SourceAccessConfiguration]
    -> f (Maybe [SourceAccessConfiguration]))
-> UpdateEventSourceMapping
-> f UpdateEventSourceMapping
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SourceAccessConfiguration]
  [SourceAccessConfiguration]
  [SourceAccessConfiguration]
  [SourceAccessConfiguration]
-> Iso
     (Maybe [SourceAccessConfiguration])
     (Maybe [SourceAccessConfiguration])
     (Maybe [SourceAccessConfiguration])
     (Maybe [SourceAccessConfiguration])
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
  [SourceAccessConfiguration]
  [SourceAccessConfiguration]
  [SourceAccessConfiguration]
  [SourceAccessConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | (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 :: (Maybe Int -> f (Maybe Int))
-> UpdateEventSourceMapping -> f UpdateEventSourceMapping
updateEventSourceMapping_maximumRecordAgeInSeconds = (UpdateEventSourceMapping -> Maybe Int)
-> (UpdateEventSourceMapping
    -> Maybe Int -> UpdateEventSourceMapping)
-> Lens
     UpdateEventSourceMapping
     UpdateEventSourceMapping
     (Maybe Int)
     (Maybe Int)
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) A list of current response type enums applied to the
-- event source mapping.
updateEventSourceMapping_functionResponseTypes :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe [FunctionResponseType])
updateEventSourceMapping_functionResponseTypes :: (Maybe [FunctionResponseType] -> f (Maybe [FunctionResponseType]))
-> UpdateEventSourceMapping -> f UpdateEventSourceMapping
updateEventSourceMapping_functionResponseTypes = (UpdateEventSourceMapping -> Maybe [FunctionResponseType])
-> (UpdateEventSourceMapping
    -> Maybe [FunctionResponseType] -> UpdateEventSourceMapping)
-> Lens
     UpdateEventSourceMapping
     UpdateEventSourceMapping
     (Maybe [FunctionResponseType])
     (Maybe [FunctionResponseType])
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) ((Maybe [FunctionResponseType] -> f (Maybe [FunctionResponseType]))
 -> UpdateEventSourceMapping -> f UpdateEventSourceMapping)
-> ((Maybe [FunctionResponseType]
     -> f (Maybe [FunctionResponseType]))
    -> Maybe [FunctionResponseType]
    -> f (Maybe [FunctionResponseType]))
-> (Maybe [FunctionResponseType]
    -> f (Maybe [FunctionResponseType]))
-> UpdateEventSourceMapping
-> f UpdateEventSourceMapping
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FunctionResponseType]
  [FunctionResponseType]
  [FunctionResponseType]
  [FunctionResponseType]
-> Iso
     (Maybe [FunctionResponseType])
     (Maybe [FunctionResponseType])
     (Maybe [FunctionResponseType])
     (Maybe [FunctionResponseType])
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
  [FunctionResponseType]
  [FunctionResponseType]
  [FunctionResponseType]
  [FunctionResponseType]
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 up to 900 seconds.
updateEventSourceMapping_tumblingWindowInSeconds :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe Prelude.Natural)
updateEventSourceMapping_tumblingWindowInSeconds :: (Maybe Natural -> f (Maybe Natural))
-> UpdateEventSourceMapping -> f UpdateEventSourceMapping
updateEventSourceMapping_tumblingWindowInSeconds = (UpdateEventSourceMapping -> Maybe Natural)
-> (UpdateEventSourceMapping
    -> Maybe Natural -> UpdateEventSourceMapping)
-> Lens
     UpdateEventSourceMapping
     UpdateEventSourceMapping
     (Maybe Natural)
     (Maybe Natural)
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 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 :: (Maybe Text -> f (Maybe Text))
-> UpdateEventSourceMapping -> f UpdateEventSourceMapping
updateEventSourceMapping_functionName = (UpdateEventSourceMapping -> Maybe Text)
-> (UpdateEventSourceMapping
    -> Maybe Text -> UpdateEventSourceMapping)
-> Lens
     UpdateEventSourceMapping
     UpdateEventSourceMapping
     (Maybe Text)
     (Maybe Text)
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 only) An Amazon SQS queue or Amazon SNS topic destination for
-- discarded records.
updateEventSourceMapping_destinationConfig :: Lens.Lens' UpdateEventSourceMapping (Prelude.Maybe DestinationConfig)
updateEventSourceMapping_destinationConfig :: (Maybe DestinationConfig -> f (Maybe DestinationConfig))
-> UpdateEventSourceMapping -> f UpdateEventSourceMapping
updateEventSourceMapping_destinationConfig = (UpdateEventSourceMapping -> Maybe DestinationConfig)
-> (UpdateEventSourceMapping
    -> Maybe DestinationConfig -> UpdateEventSourceMapping)
-> Lens
     UpdateEventSourceMapping
     UpdateEventSourceMapping
     (Maybe DestinationConfig)
     (Maybe 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)

-- | The identifier of the event source mapping.
updateEventSourceMapping_uuid :: Lens.Lens' UpdateEventSourceMapping Prelude.Text
updateEventSourceMapping_uuid :: (Text -> f Text)
-> UpdateEventSourceMapping -> f UpdateEventSourceMapping
updateEventSourceMapping_uuid = (UpdateEventSourceMapping -> Text)
-> (UpdateEventSourceMapping -> Text -> UpdateEventSourceMapping)
-> Lens UpdateEventSourceMapping UpdateEventSourceMapping Text Text
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 :: UpdateEventSourceMapping -> Request UpdateEventSourceMapping
request = Service
-> UpdateEventSourceMapping -> Request UpdateEventSourceMapping
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateEventSourceMapping
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateEventSourceMapping)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateEventSourceMapping))
-> Logger
-> Service
-> Proxy UpdateEventSourceMapping
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateEventSourceMapping)))
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 EventSourceMappingConfiguration
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)

instance Prelude.Hashable UpdateEventSourceMapping

instance Prelude.NFData UpdateEventSourceMapping

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

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

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

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