{-# 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.PipeSourceKinesisStreamParameters
-- 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.PipeSourceKinesisStreamParameters 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.KinesisStreamStartPosition
import Amazonka.Pipes.Types.OnPartialBatchItemFailureStreams
import qualified Amazonka.Prelude as Prelude

-- | The parameters for using a Kinesis stream as a source.
--
-- /See:/ 'newPipeSourceKinesisStreamParameters' smart constructor.
data PipeSourceKinesisStreamParameters = PipeSourceKinesisStreamParameters'
  { -- | The maximum number of records to include in each batch.
    PipeSourceKinesisStreamParameters -> Maybe Natural
batchSize :: Prelude.Maybe Prelude.Natural,
    -- | Define the target queue to send dead-letter queue events to.
    PipeSourceKinesisStreamParameters -> Maybe DeadLetterConfig
deadLetterConfig :: Prelude.Maybe DeadLetterConfig,
    -- | The maximum length of a time to wait for events.
    PipeSourceKinesisStreamParameters -> 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.
    PipeSourceKinesisStreamParameters -> 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.
    PipeSourceKinesisStreamParameters -> 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.
    PipeSourceKinesisStreamParameters
-> Maybe OnPartialBatchItemFailureStreams
onPartialBatchItemFailure :: Prelude.Maybe OnPartialBatchItemFailureStreams,
    -- | (Streams only) The number of batches to process concurrently from each
    -- shard. The default value is 1.
    PipeSourceKinesisStreamParameters -> Maybe Natural
parallelizationFactor :: Prelude.Maybe Prelude.Natural,
    -- | With @StartingPosition@ set to @AT_TIMESTAMP@, the time from which to
    -- start reading, in Unix time seconds.
    PipeSourceKinesisStreamParameters -> Maybe POSIX
startingPositionTimestamp :: Prelude.Maybe Data.POSIX,
    -- | (Streams only) The position in a stream from which to start reading.
    PipeSourceKinesisStreamParameters -> KinesisStreamStartPosition
startingPosition :: KinesisStreamStartPosition
  }
  deriving (PipeSourceKinesisStreamParameters
-> PipeSourceKinesisStreamParameters -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PipeSourceKinesisStreamParameters
-> PipeSourceKinesisStreamParameters -> Bool
$c/= :: PipeSourceKinesisStreamParameters
-> PipeSourceKinesisStreamParameters -> Bool
== :: PipeSourceKinesisStreamParameters
-> PipeSourceKinesisStreamParameters -> Bool
$c== :: PipeSourceKinesisStreamParameters
-> PipeSourceKinesisStreamParameters -> Bool
Prelude.Eq, ReadPrec [PipeSourceKinesisStreamParameters]
ReadPrec PipeSourceKinesisStreamParameters
Int -> ReadS PipeSourceKinesisStreamParameters
ReadS [PipeSourceKinesisStreamParameters]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PipeSourceKinesisStreamParameters]
$creadListPrec :: ReadPrec [PipeSourceKinesisStreamParameters]
readPrec :: ReadPrec PipeSourceKinesisStreamParameters
$creadPrec :: ReadPrec PipeSourceKinesisStreamParameters
readList :: ReadS [PipeSourceKinesisStreamParameters]
$creadList :: ReadS [PipeSourceKinesisStreamParameters]
readsPrec :: Int -> ReadS PipeSourceKinesisStreamParameters
$creadsPrec :: Int -> ReadS PipeSourceKinesisStreamParameters
Prelude.Read, Int -> PipeSourceKinesisStreamParameters -> ShowS
[PipeSourceKinesisStreamParameters] -> ShowS
PipeSourceKinesisStreamParameters -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PipeSourceKinesisStreamParameters] -> ShowS
$cshowList :: [PipeSourceKinesisStreamParameters] -> ShowS
show :: PipeSourceKinesisStreamParameters -> String
$cshow :: PipeSourceKinesisStreamParameters -> String
showsPrec :: Int -> PipeSourceKinesisStreamParameters -> ShowS
$cshowsPrec :: Int -> PipeSourceKinesisStreamParameters -> ShowS
Prelude.Show, forall x.
Rep PipeSourceKinesisStreamParameters x
-> PipeSourceKinesisStreamParameters
forall x.
PipeSourceKinesisStreamParameters
-> Rep PipeSourceKinesisStreamParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PipeSourceKinesisStreamParameters x
-> PipeSourceKinesisStreamParameters
$cfrom :: forall x.
PipeSourceKinesisStreamParameters
-> Rep PipeSourceKinesisStreamParameters x
Prelude.Generic)

-- |
-- Create a value of 'PipeSourceKinesisStreamParameters' 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', 'pipeSourceKinesisStreamParameters_batchSize' - The maximum number of records to include in each batch.
--
-- 'deadLetterConfig', 'pipeSourceKinesisStreamParameters_deadLetterConfig' - Define the target queue to send dead-letter queue events to.
--
-- 'maximumBatchingWindowInSeconds', 'pipeSourceKinesisStreamParameters_maximumBatchingWindowInSeconds' - The maximum length of a time to wait for events.
--
-- 'maximumRecordAgeInSeconds', 'pipeSourceKinesisStreamParameters_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', 'pipeSourceKinesisStreamParameters_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', 'pipeSourceKinesisStreamParameters_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', 'pipeSourceKinesisStreamParameters_parallelizationFactor' - (Streams only) The number of batches to process concurrently from each
-- shard. The default value is 1.
--
-- 'startingPositionTimestamp', 'pipeSourceKinesisStreamParameters_startingPositionTimestamp' - With @StartingPosition@ set to @AT_TIMESTAMP@, the time from which to
-- start reading, in Unix time seconds.
--
-- 'startingPosition', 'pipeSourceKinesisStreamParameters_startingPosition' - (Streams only) The position in a stream from which to start reading.
newPipeSourceKinesisStreamParameters ::
  -- | 'startingPosition'
  KinesisStreamStartPosition ->
  PipeSourceKinesisStreamParameters
newPipeSourceKinesisStreamParameters :: KinesisStreamStartPosition -> PipeSourceKinesisStreamParameters
newPipeSourceKinesisStreamParameters
  KinesisStreamStartPosition
pStartingPosition_ =
    PipeSourceKinesisStreamParameters'
      { $sel:batchSize:PipeSourceKinesisStreamParameters' :: Maybe Natural
batchSize =
          forall a. Maybe a
Prelude.Nothing,
        $sel:deadLetterConfig:PipeSourceKinesisStreamParameters' :: Maybe DeadLetterConfig
deadLetterConfig = forall a. Maybe a
Prelude.Nothing,
        $sel:maximumBatchingWindowInSeconds:PipeSourceKinesisStreamParameters' :: Maybe Natural
maximumBatchingWindowInSeconds =
          forall a. Maybe a
Prelude.Nothing,
        $sel:maximumRecordAgeInSeconds:PipeSourceKinesisStreamParameters' :: Maybe Int
maximumRecordAgeInSeconds =
          forall a. Maybe a
Prelude.Nothing,
        $sel:maximumRetryAttempts:PipeSourceKinesisStreamParameters' :: Maybe Int
maximumRetryAttempts = forall a. Maybe a
Prelude.Nothing,
        $sel:onPartialBatchItemFailure:PipeSourceKinesisStreamParameters' :: Maybe OnPartialBatchItemFailureStreams
onPartialBatchItemFailure =
          forall a. Maybe a
Prelude.Nothing,
        $sel:parallelizationFactor:PipeSourceKinesisStreamParameters' :: Maybe Natural
parallelizationFactor = forall a. Maybe a
Prelude.Nothing,
        $sel:startingPositionTimestamp:PipeSourceKinesisStreamParameters' :: Maybe POSIX
startingPositionTimestamp =
          forall a. Maybe a
Prelude.Nothing,
        $sel:startingPosition:PipeSourceKinesisStreamParameters' :: KinesisStreamStartPosition
startingPosition = KinesisStreamStartPosition
pStartingPosition_
      }

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

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

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

-- | (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.
pipeSourceKinesisStreamParameters_maximumRecordAgeInSeconds :: Lens.Lens' PipeSourceKinesisStreamParameters (Prelude.Maybe Prelude.Int)
pipeSourceKinesisStreamParameters_maximumRecordAgeInSeconds :: Lens' PipeSourceKinesisStreamParameters (Maybe Int)
pipeSourceKinesisStreamParameters_maximumRecordAgeInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipeSourceKinesisStreamParameters' {Maybe Int
maximumRecordAgeInSeconds :: Maybe Int
$sel:maximumRecordAgeInSeconds:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> Maybe Int
maximumRecordAgeInSeconds} -> Maybe Int
maximumRecordAgeInSeconds) (\s :: PipeSourceKinesisStreamParameters
s@PipeSourceKinesisStreamParameters' {} Maybe Int
a -> PipeSourceKinesisStreamParameters
s {$sel:maximumRecordAgeInSeconds:PipeSourceKinesisStreamParameters' :: Maybe Int
maximumRecordAgeInSeconds = Maybe Int
a} :: PipeSourceKinesisStreamParameters)

-- | (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.
pipeSourceKinesisStreamParameters_maximumRetryAttempts :: Lens.Lens' PipeSourceKinesisStreamParameters (Prelude.Maybe Prelude.Int)
pipeSourceKinesisStreamParameters_maximumRetryAttempts :: Lens' PipeSourceKinesisStreamParameters (Maybe Int)
pipeSourceKinesisStreamParameters_maximumRetryAttempts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipeSourceKinesisStreamParameters' {Maybe Int
maximumRetryAttempts :: Maybe Int
$sel:maximumRetryAttempts:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> Maybe Int
maximumRetryAttempts} -> Maybe Int
maximumRetryAttempts) (\s :: PipeSourceKinesisStreamParameters
s@PipeSourceKinesisStreamParameters' {} Maybe Int
a -> PipeSourceKinesisStreamParameters
s {$sel:maximumRetryAttempts:PipeSourceKinesisStreamParameters' :: Maybe Int
maximumRetryAttempts = Maybe Int
a} :: PipeSourceKinesisStreamParameters)

-- | (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.
pipeSourceKinesisStreamParameters_onPartialBatchItemFailure :: Lens.Lens' PipeSourceKinesisStreamParameters (Prelude.Maybe OnPartialBatchItemFailureStreams)
pipeSourceKinesisStreamParameters_onPartialBatchItemFailure :: Lens'
  PipeSourceKinesisStreamParameters
  (Maybe OnPartialBatchItemFailureStreams)
pipeSourceKinesisStreamParameters_onPartialBatchItemFailure = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipeSourceKinesisStreamParameters' {Maybe OnPartialBatchItemFailureStreams
onPartialBatchItemFailure :: Maybe OnPartialBatchItemFailureStreams
$sel:onPartialBatchItemFailure:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters
-> Maybe OnPartialBatchItemFailureStreams
onPartialBatchItemFailure} -> Maybe OnPartialBatchItemFailureStreams
onPartialBatchItemFailure) (\s :: PipeSourceKinesisStreamParameters
s@PipeSourceKinesisStreamParameters' {} Maybe OnPartialBatchItemFailureStreams
a -> PipeSourceKinesisStreamParameters
s {$sel:onPartialBatchItemFailure:PipeSourceKinesisStreamParameters' :: Maybe OnPartialBatchItemFailureStreams
onPartialBatchItemFailure = Maybe OnPartialBatchItemFailureStreams
a} :: PipeSourceKinesisStreamParameters)

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

-- | With @StartingPosition@ set to @AT_TIMESTAMP@, the time from which to
-- start reading, in Unix time seconds.
pipeSourceKinesisStreamParameters_startingPositionTimestamp :: Lens.Lens' PipeSourceKinesisStreamParameters (Prelude.Maybe Prelude.UTCTime)
pipeSourceKinesisStreamParameters_startingPositionTimestamp :: Lens' PipeSourceKinesisStreamParameters (Maybe UTCTime)
pipeSourceKinesisStreamParameters_startingPositionTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipeSourceKinesisStreamParameters' {Maybe POSIX
startingPositionTimestamp :: Maybe POSIX
$sel:startingPositionTimestamp:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> Maybe POSIX
startingPositionTimestamp} -> Maybe POSIX
startingPositionTimestamp) (\s :: PipeSourceKinesisStreamParameters
s@PipeSourceKinesisStreamParameters' {} Maybe POSIX
a -> PipeSourceKinesisStreamParameters
s {$sel:startingPositionTimestamp:PipeSourceKinesisStreamParameters' :: Maybe POSIX
startingPositionTimestamp = Maybe POSIX
a} :: PipeSourceKinesisStreamParameters) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

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

instance
  Data.FromJSON
    PipeSourceKinesisStreamParameters
  where
  parseJSON :: Value -> Parser PipeSourceKinesisStreamParameters
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PipeSourceKinesisStreamParameters"
      ( \Object
x ->
          Maybe Natural
-> Maybe DeadLetterConfig
-> Maybe Natural
-> Maybe Int
-> Maybe Int
-> Maybe OnPartialBatchItemFailureStreams
-> Maybe Natural
-> Maybe POSIX
-> KinesisStreamStartPosition
-> PipeSourceKinesisStreamParameters
PipeSourceKinesisStreamParameters'
            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 (Maybe a)
Data..:? Key
"StartingPositionTimestamp")
            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
    PipeSourceKinesisStreamParameters
  where
  hashWithSalt :: Int -> PipeSourceKinesisStreamParameters -> Int
hashWithSalt
    Int
_salt
    PipeSourceKinesisStreamParameters' {Maybe Int
Maybe Natural
Maybe POSIX
Maybe DeadLetterConfig
Maybe OnPartialBatchItemFailureStreams
KinesisStreamStartPosition
startingPosition :: KinesisStreamStartPosition
startingPositionTimestamp :: Maybe POSIX
parallelizationFactor :: Maybe Natural
onPartialBatchItemFailure :: Maybe OnPartialBatchItemFailureStreams
maximumRetryAttempts :: Maybe Int
maximumRecordAgeInSeconds :: Maybe Int
maximumBatchingWindowInSeconds :: Maybe Natural
deadLetterConfig :: Maybe DeadLetterConfig
batchSize :: Maybe Natural
$sel:startingPosition:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> KinesisStreamStartPosition
$sel:startingPositionTimestamp:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> Maybe POSIX
$sel:parallelizationFactor:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> Maybe Natural
$sel:onPartialBatchItemFailure:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters
-> Maybe OnPartialBatchItemFailureStreams
$sel:maximumRetryAttempts:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> Maybe Int
$sel:maximumRecordAgeInSeconds:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> Maybe Int
$sel:maximumBatchingWindowInSeconds:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> Maybe Natural
$sel:deadLetterConfig:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> Maybe DeadLetterConfig
$sel:batchSize:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> 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` Maybe POSIX
startingPositionTimestamp
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` KinesisStreamStartPosition
startingPosition

instance
  Prelude.NFData
    PipeSourceKinesisStreamParameters
  where
  rnf :: PipeSourceKinesisStreamParameters -> ()
rnf PipeSourceKinesisStreamParameters' {Maybe Int
Maybe Natural
Maybe POSIX
Maybe DeadLetterConfig
Maybe OnPartialBatchItemFailureStreams
KinesisStreamStartPosition
startingPosition :: KinesisStreamStartPosition
startingPositionTimestamp :: Maybe POSIX
parallelizationFactor :: Maybe Natural
onPartialBatchItemFailure :: Maybe OnPartialBatchItemFailureStreams
maximumRetryAttempts :: Maybe Int
maximumRecordAgeInSeconds :: Maybe Int
maximumBatchingWindowInSeconds :: Maybe Natural
deadLetterConfig :: Maybe DeadLetterConfig
batchSize :: Maybe Natural
$sel:startingPosition:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> KinesisStreamStartPosition
$sel:startingPositionTimestamp:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> Maybe POSIX
$sel:parallelizationFactor:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> Maybe Natural
$sel:onPartialBatchItemFailure:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters
-> Maybe OnPartialBatchItemFailureStreams
$sel:maximumRetryAttempts:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> Maybe Int
$sel:maximumRecordAgeInSeconds:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> Maybe Int
$sel:maximumBatchingWindowInSeconds:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> Maybe Natural
$sel:deadLetterConfig:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> Maybe DeadLetterConfig
$sel:batchSize:PipeSourceKinesisStreamParameters' :: PipeSourceKinesisStreamParameters -> 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 Maybe POSIX
startingPositionTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf KinesisStreamStartPosition
startingPosition

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