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

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

-- |
-- Module      : Amazonka.Pipes.Types.PipeSourceDynamoDBStreamParameters
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Pipes.Types.PipeSourceDynamoDBStreamParameters where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Pipes.Types.DeadLetterConfig
import Amazonka.Pipes.Types.DynamoDBStreamStartPosition
import Amazonka.Pipes.Types.OnPartialBatchItemFailureStreams
import qualified Amazonka.Prelude as Prelude

-- | The parameters for using a DynamoDB stream as a source.
--
-- /See:/ 'newPipeSourceDynamoDBStreamParameters' smart constructor.
data PipeSourceDynamoDBStreamParameters = PipeSourceDynamoDBStreamParameters'
  { -- | The maximum number of records to include in each batch.
    PipeSourceDynamoDBStreamParameters -> Maybe Natural
batchSize :: Prelude.Maybe Prelude.Natural,
    -- | Define the target queue to send dead-letter queue events to.
    PipeSourceDynamoDBStreamParameters -> Maybe DeadLetterConfig
deadLetterConfig :: Prelude.Maybe DeadLetterConfig,
    -- | The maximum length of a time to wait for events.
    PipeSourceDynamoDBStreamParameters -> Maybe Natural
maximumBatchingWindowInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | (Streams only) Discard records older than the specified age. The default
    -- value is -1, which sets the maximum age to infinite. When the value is
    -- set to infinite, EventBridge never discards old records.
    PipeSourceDynamoDBStreamParameters -> Maybe Int
maximumRecordAgeInSeconds :: Prelude.Maybe Prelude.Int,
    -- | (Streams only) Discard records after the specified number of retries.
    -- The default value is -1, which sets the maximum number of retries to
    -- infinite. When MaximumRetryAttempts is infinite, EventBridge retries
    -- failed records until the record expires in the event source.
    PipeSourceDynamoDBStreamParameters -> Maybe Int
maximumRetryAttempts :: Prelude.Maybe Prelude.Int,
    -- | (Streams only) Define how to handle item process failures.
    -- @AUTOMATIC_BISECT@ halves each batch and retry each half until all the
    -- records are processed or there is one failed message left in the batch.
    PipeSourceDynamoDBStreamParameters
-> Maybe OnPartialBatchItemFailureStreams
onPartialBatchItemFailure :: Prelude.Maybe OnPartialBatchItemFailureStreams,
    -- | (Streams only) The number of batches to process concurrently from each
    -- shard. The default value is 1.
    PipeSourceDynamoDBStreamParameters -> Maybe Natural
parallelizationFactor :: Prelude.Maybe Prelude.Natural,
    -- | (Streams only) The position in a stream from which to start reading.
    PipeSourceDynamoDBStreamParameters -> DynamoDBStreamStartPosition
startingPosition :: DynamoDBStreamStartPosition
  }
  deriving (PipeSourceDynamoDBStreamParameters
-> PipeSourceDynamoDBStreamParameters -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PipeSourceDynamoDBStreamParameters
-> PipeSourceDynamoDBStreamParameters -> Bool
$c/= :: PipeSourceDynamoDBStreamParameters
-> PipeSourceDynamoDBStreamParameters -> Bool
== :: PipeSourceDynamoDBStreamParameters
-> PipeSourceDynamoDBStreamParameters -> Bool
$c== :: PipeSourceDynamoDBStreamParameters
-> PipeSourceDynamoDBStreamParameters -> Bool
Prelude.Eq, ReadPrec [PipeSourceDynamoDBStreamParameters]
ReadPrec PipeSourceDynamoDBStreamParameters
Int -> ReadS PipeSourceDynamoDBStreamParameters
ReadS [PipeSourceDynamoDBStreamParameters]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PipeSourceDynamoDBStreamParameters]
$creadListPrec :: ReadPrec [PipeSourceDynamoDBStreamParameters]
readPrec :: ReadPrec PipeSourceDynamoDBStreamParameters
$creadPrec :: ReadPrec PipeSourceDynamoDBStreamParameters
readList :: ReadS [PipeSourceDynamoDBStreamParameters]
$creadList :: ReadS [PipeSourceDynamoDBStreamParameters]
readsPrec :: Int -> ReadS PipeSourceDynamoDBStreamParameters
$creadsPrec :: Int -> ReadS PipeSourceDynamoDBStreamParameters
Prelude.Read, Int -> PipeSourceDynamoDBStreamParameters -> ShowS
[PipeSourceDynamoDBStreamParameters] -> ShowS
PipeSourceDynamoDBStreamParameters -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PipeSourceDynamoDBStreamParameters] -> ShowS
$cshowList :: [PipeSourceDynamoDBStreamParameters] -> ShowS
show :: PipeSourceDynamoDBStreamParameters -> String
$cshow :: PipeSourceDynamoDBStreamParameters -> String
showsPrec :: Int -> PipeSourceDynamoDBStreamParameters -> ShowS
$cshowsPrec :: Int -> PipeSourceDynamoDBStreamParameters -> ShowS
Prelude.Show, forall x.
Rep PipeSourceDynamoDBStreamParameters x
-> PipeSourceDynamoDBStreamParameters
forall x.
PipeSourceDynamoDBStreamParameters
-> Rep PipeSourceDynamoDBStreamParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PipeSourceDynamoDBStreamParameters x
-> PipeSourceDynamoDBStreamParameters
$cfrom :: forall x.
PipeSourceDynamoDBStreamParameters
-> Rep PipeSourceDynamoDBStreamParameters x
Prelude.Generic)

-- |
-- Create a value of 'PipeSourceDynamoDBStreamParameters' 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', 'pipeSourceDynamoDBStreamParameters_batchSize' - The maximum number of records to include in each batch.
--
-- 'deadLetterConfig', 'pipeSourceDynamoDBStreamParameters_deadLetterConfig' - Define the target queue to send dead-letter queue events to.
--
-- 'maximumBatchingWindowInSeconds', 'pipeSourceDynamoDBStreamParameters_maximumBatchingWindowInSeconds' - The maximum length of a time to wait for events.
--
-- 'maximumRecordAgeInSeconds', 'pipeSourceDynamoDBStreamParameters_maximumRecordAgeInSeconds' - (Streams only) Discard records older than the specified age. The default
-- value is -1, which sets the maximum age to infinite. When the value is
-- set to infinite, EventBridge never discards old records.
--
-- 'maximumRetryAttempts', 'pipeSourceDynamoDBStreamParameters_maximumRetryAttempts' - (Streams only) Discard records after the specified number of retries.
-- The default value is -1, which sets the maximum number of retries to
-- infinite. When MaximumRetryAttempts is infinite, EventBridge retries
-- failed records until the record expires in the event source.
--
-- 'onPartialBatchItemFailure', 'pipeSourceDynamoDBStreamParameters_onPartialBatchItemFailure' - (Streams only) Define how to handle item process failures.
-- @AUTOMATIC_BISECT@ halves each batch and retry each half until all the
-- records are processed or there is one failed message left in the batch.
--
-- 'parallelizationFactor', 'pipeSourceDynamoDBStreamParameters_parallelizationFactor' - (Streams only) The number of batches to process concurrently from each
-- shard. The default value is 1.
--
-- 'startingPosition', 'pipeSourceDynamoDBStreamParameters_startingPosition' - (Streams only) The position in a stream from which to start reading.
newPipeSourceDynamoDBStreamParameters ::
  -- | 'startingPosition'
  DynamoDBStreamStartPosition ->
  PipeSourceDynamoDBStreamParameters
newPipeSourceDynamoDBStreamParameters :: DynamoDBStreamStartPosition -> PipeSourceDynamoDBStreamParameters
newPipeSourceDynamoDBStreamParameters
  DynamoDBStreamStartPosition
pStartingPosition_ =
    PipeSourceDynamoDBStreamParameters'
      { $sel:batchSize:PipeSourceDynamoDBStreamParameters' :: Maybe Natural
batchSize =
          forall a. Maybe a
Prelude.Nothing,
        $sel:deadLetterConfig:PipeSourceDynamoDBStreamParameters' :: Maybe DeadLetterConfig
deadLetterConfig = forall a. Maybe a
Prelude.Nothing,
        $sel:maximumBatchingWindowInSeconds:PipeSourceDynamoDBStreamParameters' :: Maybe Natural
maximumBatchingWindowInSeconds =
          forall a. Maybe a
Prelude.Nothing,
        $sel:maximumRecordAgeInSeconds:PipeSourceDynamoDBStreamParameters' :: Maybe Int
maximumRecordAgeInSeconds =
          forall a. Maybe a
Prelude.Nothing,
        $sel:maximumRetryAttempts:PipeSourceDynamoDBStreamParameters' :: Maybe Int
maximumRetryAttempts = forall a. Maybe a
Prelude.Nothing,
        $sel:onPartialBatchItemFailure:PipeSourceDynamoDBStreamParameters' :: Maybe OnPartialBatchItemFailureStreams
onPartialBatchItemFailure =
          forall a. Maybe a
Prelude.Nothing,
        $sel:parallelizationFactor:PipeSourceDynamoDBStreamParameters' :: Maybe Natural
parallelizationFactor = forall a. Maybe a
Prelude.Nothing,
        $sel:startingPosition:PipeSourceDynamoDBStreamParameters' :: DynamoDBStreamStartPosition
startingPosition = DynamoDBStreamStartPosition
pStartingPosition_
      }

-- | The maximum number of records to include in each batch.
pipeSourceDynamoDBStreamParameters_batchSize :: Lens.Lens' PipeSourceDynamoDBStreamParameters (Prelude.Maybe Prelude.Natural)
pipeSourceDynamoDBStreamParameters_batchSize :: Lens' PipeSourceDynamoDBStreamParameters (Maybe Natural)
pipeSourceDynamoDBStreamParameters_batchSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipeSourceDynamoDBStreamParameters' {Maybe Natural
batchSize :: Maybe Natural
$sel:batchSize:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe Natural
batchSize} -> Maybe Natural
batchSize) (\s :: PipeSourceDynamoDBStreamParameters
s@PipeSourceDynamoDBStreamParameters' {} Maybe Natural
a -> PipeSourceDynamoDBStreamParameters
s {$sel:batchSize:PipeSourceDynamoDBStreamParameters' :: Maybe Natural
batchSize = Maybe Natural
a} :: PipeSourceDynamoDBStreamParameters)

-- | Define the target queue to send dead-letter queue events to.
pipeSourceDynamoDBStreamParameters_deadLetterConfig :: Lens.Lens' PipeSourceDynamoDBStreamParameters (Prelude.Maybe DeadLetterConfig)
pipeSourceDynamoDBStreamParameters_deadLetterConfig :: Lens' PipeSourceDynamoDBStreamParameters (Maybe DeadLetterConfig)
pipeSourceDynamoDBStreamParameters_deadLetterConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipeSourceDynamoDBStreamParameters' {Maybe DeadLetterConfig
deadLetterConfig :: Maybe DeadLetterConfig
$sel:deadLetterConfig:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe DeadLetterConfig
deadLetterConfig} -> Maybe DeadLetterConfig
deadLetterConfig) (\s :: PipeSourceDynamoDBStreamParameters
s@PipeSourceDynamoDBStreamParameters' {} Maybe DeadLetterConfig
a -> PipeSourceDynamoDBStreamParameters
s {$sel:deadLetterConfig:PipeSourceDynamoDBStreamParameters' :: Maybe DeadLetterConfig
deadLetterConfig = Maybe DeadLetterConfig
a} :: PipeSourceDynamoDBStreamParameters)

-- | The maximum length of a time to wait for events.
pipeSourceDynamoDBStreamParameters_maximumBatchingWindowInSeconds :: Lens.Lens' PipeSourceDynamoDBStreamParameters (Prelude.Maybe Prelude.Natural)
pipeSourceDynamoDBStreamParameters_maximumBatchingWindowInSeconds :: Lens' PipeSourceDynamoDBStreamParameters (Maybe Natural)
pipeSourceDynamoDBStreamParameters_maximumBatchingWindowInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipeSourceDynamoDBStreamParameters' {Maybe Natural
maximumBatchingWindowInSeconds :: Maybe Natural
$sel:maximumBatchingWindowInSeconds:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe Natural
maximumBatchingWindowInSeconds} -> Maybe Natural
maximumBatchingWindowInSeconds) (\s :: PipeSourceDynamoDBStreamParameters
s@PipeSourceDynamoDBStreamParameters' {} Maybe Natural
a -> PipeSourceDynamoDBStreamParameters
s {$sel:maximumBatchingWindowInSeconds:PipeSourceDynamoDBStreamParameters' :: Maybe Natural
maximumBatchingWindowInSeconds = Maybe Natural
a} :: PipeSourceDynamoDBStreamParameters)

-- | (Streams only) Discard records older than the specified age. The default
-- value is -1, which sets the maximum age to infinite. When the value is
-- set to infinite, EventBridge never discards old records.
pipeSourceDynamoDBStreamParameters_maximumRecordAgeInSeconds :: Lens.Lens' PipeSourceDynamoDBStreamParameters (Prelude.Maybe Prelude.Int)
pipeSourceDynamoDBStreamParameters_maximumRecordAgeInSeconds :: Lens' PipeSourceDynamoDBStreamParameters (Maybe Int)
pipeSourceDynamoDBStreamParameters_maximumRecordAgeInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipeSourceDynamoDBStreamParameters' {Maybe Int
maximumRecordAgeInSeconds :: Maybe Int
$sel:maximumRecordAgeInSeconds:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe Int
maximumRecordAgeInSeconds} -> Maybe Int
maximumRecordAgeInSeconds) (\s :: PipeSourceDynamoDBStreamParameters
s@PipeSourceDynamoDBStreamParameters' {} Maybe Int
a -> PipeSourceDynamoDBStreamParameters
s {$sel:maximumRecordAgeInSeconds:PipeSourceDynamoDBStreamParameters' :: Maybe Int
maximumRecordAgeInSeconds = Maybe Int
a} :: PipeSourceDynamoDBStreamParameters)

-- | (Streams only) Discard records after the specified number of retries.
-- The default value is -1, which sets the maximum number of retries to
-- infinite. When MaximumRetryAttempts is infinite, EventBridge retries
-- failed records until the record expires in the event source.
pipeSourceDynamoDBStreamParameters_maximumRetryAttempts :: Lens.Lens' PipeSourceDynamoDBStreamParameters (Prelude.Maybe Prelude.Int)
pipeSourceDynamoDBStreamParameters_maximumRetryAttempts :: Lens' PipeSourceDynamoDBStreamParameters (Maybe Int)
pipeSourceDynamoDBStreamParameters_maximumRetryAttempts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipeSourceDynamoDBStreamParameters' {Maybe Int
maximumRetryAttempts :: Maybe Int
$sel:maximumRetryAttempts:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe Int
maximumRetryAttempts} -> Maybe Int
maximumRetryAttempts) (\s :: PipeSourceDynamoDBStreamParameters
s@PipeSourceDynamoDBStreamParameters' {} Maybe Int
a -> PipeSourceDynamoDBStreamParameters
s {$sel:maximumRetryAttempts:PipeSourceDynamoDBStreamParameters' :: Maybe Int
maximumRetryAttempts = Maybe Int
a} :: PipeSourceDynamoDBStreamParameters)

-- | (Streams only) Define how to handle item process failures.
-- @AUTOMATIC_BISECT@ halves each batch and retry each half until all the
-- records are processed or there is one failed message left in the batch.
pipeSourceDynamoDBStreamParameters_onPartialBatchItemFailure :: Lens.Lens' PipeSourceDynamoDBStreamParameters (Prelude.Maybe OnPartialBatchItemFailureStreams)
pipeSourceDynamoDBStreamParameters_onPartialBatchItemFailure :: Lens'
  PipeSourceDynamoDBStreamParameters
  (Maybe OnPartialBatchItemFailureStreams)
pipeSourceDynamoDBStreamParameters_onPartialBatchItemFailure = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipeSourceDynamoDBStreamParameters' {Maybe OnPartialBatchItemFailureStreams
onPartialBatchItemFailure :: Maybe OnPartialBatchItemFailureStreams
$sel:onPartialBatchItemFailure:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters
-> Maybe OnPartialBatchItemFailureStreams
onPartialBatchItemFailure} -> Maybe OnPartialBatchItemFailureStreams
onPartialBatchItemFailure) (\s :: PipeSourceDynamoDBStreamParameters
s@PipeSourceDynamoDBStreamParameters' {} Maybe OnPartialBatchItemFailureStreams
a -> PipeSourceDynamoDBStreamParameters
s {$sel:onPartialBatchItemFailure:PipeSourceDynamoDBStreamParameters' :: Maybe OnPartialBatchItemFailureStreams
onPartialBatchItemFailure = Maybe OnPartialBatchItemFailureStreams
a} :: PipeSourceDynamoDBStreamParameters)

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

-- | (Streams only) The position in a stream from which to start reading.
pipeSourceDynamoDBStreamParameters_startingPosition :: Lens.Lens' PipeSourceDynamoDBStreamParameters DynamoDBStreamStartPosition
pipeSourceDynamoDBStreamParameters_startingPosition :: Lens'
  PipeSourceDynamoDBStreamParameters DynamoDBStreamStartPosition
pipeSourceDynamoDBStreamParameters_startingPosition = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipeSourceDynamoDBStreamParameters' {DynamoDBStreamStartPosition
startingPosition :: DynamoDBStreamStartPosition
$sel:startingPosition:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> DynamoDBStreamStartPosition
startingPosition} -> DynamoDBStreamStartPosition
startingPosition) (\s :: PipeSourceDynamoDBStreamParameters
s@PipeSourceDynamoDBStreamParameters' {} DynamoDBStreamStartPosition
a -> PipeSourceDynamoDBStreamParameters
s {$sel:startingPosition:PipeSourceDynamoDBStreamParameters' :: DynamoDBStreamStartPosition
startingPosition = DynamoDBStreamStartPosition
a} :: PipeSourceDynamoDBStreamParameters)

instance
  Data.FromJSON
    PipeSourceDynamoDBStreamParameters
  where
  parseJSON :: Value -> Parser PipeSourceDynamoDBStreamParameters
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PipeSourceDynamoDBStreamParameters"
      ( \Object
x ->
          Maybe Natural
-> Maybe DeadLetterConfig
-> Maybe Natural
-> Maybe Int
-> Maybe Int
-> Maybe OnPartialBatchItemFailureStreams
-> Maybe Natural
-> DynamoDBStreamStartPosition
-> PipeSourceDynamoDBStreamParameters
PipeSourceDynamoDBStreamParameters'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"BatchSize")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DeadLetterConfig")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MaximumBatchingWindowInSeconds")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MaximumRecordAgeInSeconds")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MaximumRetryAttempts")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OnPartialBatchItemFailure")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ParallelizationFactor")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"StartingPosition")
      )

instance
  Prelude.Hashable
    PipeSourceDynamoDBStreamParameters
  where
  hashWithSalt :: Int -> PipeSourceDynamoDBStreamParameters -> Int
hashWithSalt
    Int
_salt
    PipeSourceDynamoDBStreamParameters' {Maybe Int
Maybe Natural
Maybe DeadLetterConfig
Maybe OnPartialBatchItemFailureStreams
DynamoDBStreamStartPosition
startingPosition :: DynamoDBStreamStartPosition
parallelizationFactor :: Maybe Natural
onPartialBatchItemFailure :: Maybe OnPartialBatchItemFailureStreams
maximumRetryAttempts :: Maybe Int
maximumRecordAgeInSeconds :: Maybe Int
maximumBatchingWindowInSeconds :: Maybe Natural
deadLetterConfig :: Maybe DeadLetterConfig
batchSize :: Maybe Natural
$sel:startingPosition:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> DynamoDBStreamStartPosition
$sel:parallelizationFactor:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe Natural
$sel:onPartialBatchItemFailure:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters
-> Maybe OnPartialBatchItemFailureStreams
$sel:maximumRetryAttempts:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe Int
$sel:maximumRecordAgeInSeconds:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe Int
$sel:maximumBatchingWindowInSeconds:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe Natural
$sel:deadLetterConfig:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe DeadLetterConfig
$sel:batchSize:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> 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 DeadLetterConfig
deadLetterConfig
        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 OnPartialBatchItemFailureStreams
onPartialBatchItemFailure
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
parallelizationFactor
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DynamoDBStreamStartPosition
startingPosition

instance
  Prelude.NFData
    PipeSourceDynamoDBStreamParameters
  where
  rnf :: PipeSourceDynamoDBStreamParameters -> ()
rnf PipeSourceDynamoDBStreamParameters' {Maybe Int
Maybe Natural
Maybe DeadLetterConfig
Maybe OnPartialBatchItemFailureStreams
DynamoDBStreamStartPosition
startingPosition :: DynamoDBStreamStartPosition
parallelizationFactor :: Maybe Natural
onPartialBatchItemFailure :: Maybe OnPartialBatchItemFailureStreams
maximumRetryAttempts :: Maybe Int
maximumRecordAgeInSeconds :: Maybe Int
maximumBatchingWindowInSeconds :: Maybe Natural
deadLetterConfig :: Maybe DeadLetterConfig
batchSize :: Maybe Natural
$sel:startingPosition:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> DynamoDBStreamStartPosition
$sel:parallelizationFactor:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe Natural
$sel:onPartialBatchItemFailure:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters
-> Maybe OnPartialBatchItemFailureStreams
$sel:maximumRetryAttempts:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe Int
$sel:maximumRecordAgeInSeconds:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe Int
$sel:maximumBatchingWindowInSeconds:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe Natural
$sel:deadLetterConfig:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe DeadLetterConfig
$sel:batchSize:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> 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 DeadLetterConfig
deadLetterConfig
      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 OnPartialBatchItemFailureStreams
onPartialBatchItemFailure
      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 DynamoDBStreamStartPosition
startingPosition

instance
  Data.ToJSON
    PipeSourceDynamoDBStreamParameters
  where
  toJSON :: PipeSourceDynamoDBStreamParameters -> Value
toJSON PipeSourceDynamoDBStreamParameters' {Maybe Int
Maybe Natural
Maybe DeadLetterConfig
Maybe OnPartialBatchItemFailureStreams
DynamoDBStreamStartPosition
startingPosition :: DynamoDBStreamStartPosition
parallelizationFactor :: Maybe Natural
onPartialBatchItemFailure :: Maybe OnPartialBatchItemFailureStreams
maximumRetryAttempts :: Maybe Int
maximumRecordAgeInSeconds :: Maybe Int
maximumBatchingWindowInSeconds :: Maybe Natural
deadLetterConfig :: Maybe DeadLetterConfig
batchSize :: Maybe Natural
$sel:startingPosition:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> DynamoDBStreamStartPosition
$sel:parallelizationFactor:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe Natural
$sel:onPartialBatchItemFailure:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters
-> Maybe OnPartialBatchItemFailureStreams
$sel:maximumRetryAttempts:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe Int
$sel:maximumRecordAgeInSeconds:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe Int
$sel:maximumBatchingWindowInSeconds:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe Natural
$sel:deadLetterConfig:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> Maybe DeadLetterConfig
$sel:batchSize:PipeSourceDynamoDBStreamParameters' :: PipeSourceDynamoDBStreamParameters -> 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
"DeadLetterConfig" 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 DeadLetterConfig
deadLetterConfig,
            (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
"OnPartialBatchItemFailure" 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 OnPartialBatchItemFailureStreams
onPartialBatchItemFailure,
            (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,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"StartingPosition" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DynamoDBStreamStartPosition
startingPosition)
          ]
      )