{-# 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.DynamoDBStreams.Types.StreamRecord
-- 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)
module Amazonka.DynamoDBStreams.Types.StreamRecord where

import qualified Amazonka.Core as Core
import Amazonka.DynamoDBStreams.Types.AttributeValue
import Amazonka.DynamoDBStreams.Types.StreamViewType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A description of a single data modification that was performed on an
-- item in a DynamoDB table.
--
-- /See:/ 'newStreamRecord' smart constructor.
data StreamRecord = StreamRecord'
  { -- | The size of the stream record, in bytes.
    StreamRecord -> Maybe Natural
sizeBytes :: Prelude.Maybe Prelude.Natural,
    -- | The sequence number of the stream record.
    StreamRecord -> Maybe Text
sequenceNumber :: Prelude.Maybe Prelude.Text,
    -- | The approximate date and time when the stream record was created, in
    -- <http://www.epochconverter.com/ UNIX epoch time> format.
    StreamRecord -> Maybe POSIX
approximateCreationDateTime :: Prelude.Maybe Core.POSIX,
    -- | The type of data from the modified DynamoDB item that was captured in
    -- this stream record:
    --
    -- -   @KEYS_ONLY@ - only the key attributes of the modified item.
    --
    -- -   @NEW_IMAGE@ - the entire item, as it appeared after it was modified.
    --
    -- -   @OLD_IMAGE@ - the entire item, as it appeared before it was
    --     modified.
    --
    -- -   @NEW_AND_OLD_IMAGES@ - both the new and the old item images of the
    --     item.
    StreamRecord -> Maybe StreamViewType
streamViewType :: Prelude.Maybe StreamViewType,
    -- | The primary key attribute(s) for the DynamoDB item that was modified.
    StreamRecord -> Maybe (HashMap Text AttributeValue)
keys :: Prelude.Maybe (Prelude.HashMap Prelude.Text AttributeValue),
    -- | The item in the DynamoDB table as it appeared before it was modified.
    StreamRecord -> Maybe (HashMap Text AttributeValue)
oldImage :: Prelude.Maybe (Prelude.HashMap Prelude.Text AttributeValue),
    -- | The item in the DynamoDB table as it appeared after it was modified.
    StreamRecord -> Maybe (HashMap Text AttributeValue)
newImage' :: Prelude.Maybe (Prelude.HashMap Prelude.Text AttributeValue)
  }
  deriving (StreamRecord -> StreamRecord -> Bool
(StreamRecord -> StreamRecord -> Bool)
-> (StreamRecord -> StreamRecord -> Bool) -> Eq StreamRecord
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StreamRecord -> StreamRecord -> Bool
$c/= :: StreamRecord -> StreamRecord -> Bool
== :: StreamRecord -> StreamRecord -> Bool
$c== :: StreamRecord -> StreamRecord -> Bool
Prelude.Eq, ReadPrec [StreamRecord]
ReadPrec StreamRecord
Int -> ReadS StreamRecord
ReadS [StreamRecord]
(Int -> ReadS StreamRecord)
-> ReadS [StreamRecord]
-> ReadPrec StreamRecord
-> ReadPrec [StreamRecord]
-> Read StreamRecord
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StreamRecord]
$creadListPrec :: ReadPrec [StreamRecord]
readPrec :: ReadPrec StreamRecord
$creadPrec :: ReadPrec StreamRecord
readList :: ReadS [StreamRecord]
$creadList :: ReadS [StreamRecord]
readsPrec :: Int -> ReadS StreamRecord
$creadsPrec :: Int -> ReadS StreamRecord
Prelude.Read, Int -> StreamRecord -> ShowS
[StreamRecord] -> ShowS
StreamRecord -> String
(Int -> StreamRecord -> ShowS)
-> (StreamRecord -> String)
-> ([StreamRecord] -> ShowS)
-> Show StreamRecord
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StreamRecord] -> ShowS
$cshowList :: [StreamRecord] -> ShowS
show :: StreamRecord -> String
$cshow :: StreamRecord -> String
showsPrec :: Int -> StreamRecord -> ShowS
$cshowsPrec :: Int -> StreamRecord -> ShowS
Prelude.Show, (forall x. StreamRecord -> Rep StreamRecord x)
-> (forall x. Rep StreamRecord x -> StreamRecord)
-> Generic StreamRecord
forall x. Rep StreamRecord x -> StreamRecord
forall x. StreamRecord -> Rep StreamRecord x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StreamRecord x -> StreamRecord
$cfrom :: forall x. StreamRecord -> Rep StreamRecord x
Prelude.Generic)

-- |
-- Create a value of 'StreamRecord' 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:
--
-- 'sizeBytes', 'streamRecord_sizeBytes' - The size of the stream record, in bytes.
--
-- 'sequenceNumber', 'streamRecord_sequenceNumber' - The sequence number of the stream record.
--
-- 'approximateCreationDateTime', 'streamRecord_approximateCreationDateTime' - The approximate date and time when the stream record was created, in
-- <http://www.epochconverter.com/ UNIX epoch time> format.
--
-- 'streamViewType', 'streamRecord_streamViewType' - The type of data from the modified DynamoDB item that was captured in
-- this stream record:
--
-- -   @KEYS_ONLY@ - only the key attributes of the modified item.
--
-- -   @NEW_IMAGE@ - the entire item, as it appeared after it was modified.
--
-- -   @OLD_IMAGE@ - the entire item, as it appeared before it was
--     modified.
--
-- -   @NEW_AND_OLD_IMAGES@ - both the new and the old item images of the
--     item.
--
-- 'keys', 'streamRecord_keys' - The primary key attribute(s) for the DynamoDB item that was modified.
--
-- 'oldImage', 'streamRecord_oldImage' - The item in the DynamoDB table as it appeared before it was modified.
--
-- 'newImage'', 'streamRecord_newImage' - The item in the DynamoDB table as it appeared after it was modified.
newStreamRecord ::
  StreamRecord
newStreamRecord :: StreamRecord
newStreamRecord =
  StreamRecord' :: Maybe Natural
-> Maybe Text
-> Maybe POSIX
-> Maybe StreamViewType
-> Maybe (HashMap Text AttributeValue)
-> Maybe (HashMap Text AttributeValue)
-> Maybe (HashMap Text AttributeValue)
-> StreamRecord
StreamRecord'
    { $sel:sizeBytes:StreamRecord' :: Maybe Natural
sizeBytes = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:sequenceNumber:StreamRecord' :: Maybe Text
sequenceNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:approximateCreationDateTime:StreamRecord' :: Maybe POSIX
approximateCreationDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:streamViewType:StreamRecord' :: Maybe StreamViewType
streamViewType = Maybe StreamViewType
forall a. Maybe a
Prelude.Nothing,
      $sel:keys:StreamRecord' :: Maybe (HashMap Text AttributeValue)
keys = Maybe (HashMap Text AttributeValue)
forall a. Maybe a
Prelude.Nothing,
      $sel:oldImage:StreamRecord' :: Maybe (HashMap Text AttributeValue)
oldImage = Maybe (HashMap Text AttributeValue)
forall a. Maybe a
Prelude.Nothing,
      $sel:newImage':StreamRecord' :: Maybe (HashMap Text AttributeValue)
newImage' = Maybe (HashMap Text AttributeValue)
forall a. Maybe a
Prelude.Nothing
    }

-- | The size of the stream record, in bytes.
streamRecord_sizeBytes :: Lens.Lens' StreamRecord (Prelude.Maybe Prelude.Natural)
streamRecord_sizeBytes :: (Maybe Natural -> f (Maybe Natural))
-> StreamRecord -> f StreamRecord
streamRecord_sizeBytes = (StreamRecord -> Maybe Natural)
-> (StreamRecord -> Maybe Natural -> StreamRecord)
-> Lens StreamRecord StreamRecord (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamRecord' {Maybe Natural
sizeBytes :: Maybe Natural
$sel:sizeBytes:StreamRecord' :: StreamRecord -> Maybe Natural
sizeBytes} -> Maybe Natural
sizeBytes) (\s :: StreamRecord
s@StreamRecord' {} Maybe Natural
a -> StreamRecord
s {$sel:sizeBytes:StreamRecord' :: Maybe Natural
sizeBytes = Maybe Natural
a} :: StreamRecord)

-- | The sequence number of the stream record.
streamRecord_sequenceNumber :: Lens.Lens' StreamRecord (Prelude.Maybe Prelude.Text)
streamRecord_sequenceNumber :: (Maybe Text -> f (Maybe Text)) -> StreamRecord -> f StreamRecord
streamRecord_sequenceNumber = (StreamRecord -> Maybe Text)
-> (StreamRecord -> Maybe Text -> StreamRecord)
-> Lens StreamRecord StreamRecord (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamRecord' {Maybe Text
sequenceNumber :: Maybe Text
$sel:sequenceNumber:StreamRecord' :: StreamRecord -> Maybe Text
sequenceNumber} -> Maybe Text
sequenceNumber) (\s :: StreamRecord
s@StreamRecord' {} Maybe Text
a -> StreamRecord
s {$sel:sequenceNumber:StreamRecord' :: Maybe Text
sequenceNumber = Maybe Text
a} :: StreamRecord)

-- | The approximate date and time when the stream record was created, in
-- <http://www.epochconverter.com/ UNIX epoch time> format.
streamRecord_approximateCreationDateTime :: Lens.Lens' StreamRecord (Prelude.Maybe Prelude.UTCTime)
streamRecord_approximateCreationDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> StreamRecord -> f StreamRecord
streamRecord_approximateCreationDateTime = (StreamRecord -> Maybe POSIX)
-> (StreamRecord -> Maybe POSIX -> StreamRecord)
-> Lens StreamRecord StreamRecord (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamRecord' {Maybe POSIX
approximateCreationDateTime :: Maybe POSIX
$sel:approximateCreationDateTime:StreamRecord' :: StreamRecord -> Maybe POSIX
approximateCreationDateTime} -> Maybe POSIX
approximateCreationDateTime) (\s :: StreamRecord
s@StreamRecord' {} Maybe POSIX
a -> StreamRecord
s {$sel:approximateCreationDateTime:StreamRecord' :: Maybe POSIX
approximateCreationDateTime = Maybe POSIX
a} :: StreamRecord) ((Maybe POSIX -> f (Maybe POSIX))
 -> StreamRecord -> f StreamRecord)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StreamRecord
-> f StreamRecord
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The type of data from the modified DynamoDB item that was captured in
-- this stream record:
--
-- -   @KEYS_ONLY@ - only the key attributes of the modified item.
--
-- -   @NEW_IMAGE@ - the entire item, as it appeared after it was modified.
--
-- -   @OLD_IMAGE@ - the entire item, as it appeared before it was
--     modified.
--
-- -   @NEW_AND_OLD_IMAGES@ - both the new and the old item images of the
--     item.
streamRecord_streamViewType :: Lens.Lens' StreamRecord (Prelude.Maybe StreamViewType)
streamRecord_streamViewType :: (Maybe StreamViewType -> f (Maybe StreamViewType))
-> StreamRecord -> f StreamRecord
streamRecord_streamViewType = (StreamRecord -> Maybe StreamViewType)
-> (StreamRecord -> Maybe StreamViewType -> StreamRecord)
-> Lens
     StreamRecord
     StreamRecord
     (Maybe StreamViewType)
     (Maybe StreamViewType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamRecord' {Maybe StreamViewType
streamViewType :: Maybe StreamViewType
$sel:streamViewType:StreamRecord' :: StreamRecord -> Maybe StreamViewType
streamViewType} -> Maybe StreamViewType
streamViewType) (\s :: StreamRecord
s@StreamRecord' {} Maybe StreamViewType
a -> StreamRecord
s {$sel:streamViewType:StreamRecord' :: Maybe StreamViewType
streamViewType = Maybe StreamViewType
a} :: StreamRecord)

-- | The primary key attribute(s) for the DynamoDB item that was modified.
streamRecord_keys :: Lens.Lens' StreamRecord (Prelude.Maybe (Prelude.HashMap Prelude.Text AttributeValue))
streamRecord_keys :: (Maybe (HashMap Text AttributeValue)
 -> f (Maybe (HashMap Text AttributeValue)))
-> StreamRecord -> f StreamRecord
streamRecord_keys = (StreamRecord -> Maybe (HashMap Text AttributeValue))
-> (StreamRecord
    -> Maybe (HashMap Text AttributeValue) -> StreamRecord)
-> Lens
     StreamRecord
     StreamRecord
     (Maybe (HashMap Text AttributeValue))
     (Maybe (HashMap Text AttributeValue))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamRecord' {Maybe (HashMap Text AttributeValue)
keys :: Maybe (HashMap Text AttributeValue)
$sel:keys:StreamRecord' :: StreamRecord -> Maybe (HashMap Text AttributeValue)
keys} -> Maybe (HashMap Text AttributeValue)
keys) (\s :: StreamRecord
s@StreamRecord' {} Maybe (HashMap Text AttributeValue)
a -> StreamRecord
s {$sel:keys:StreamRecord' :: Maybe (HashMap Text AttributeValue)
keys = Maybe (HashMap Text AttributeValue)
a} :: StreamRecord) ((Maybe (HashMap Text AttributeValue)
  -> f (Maybe (HashMap Text AttributeValue)))
 -> StreamRecord -> f StreamRecord)
-> ((Maybe (HashMap Text AttributeValue)
     -> f (Maybe (HashMap Text AttributeValue)))
    -> Maybe (HashMap Text AttributeValue)
    -> f (Maybe (HashMap Text AttributeValue)))
-> (Maybe (HashMap Text AttributeValue)
    -> f (Maybe (HashMap Text AttributeValue)))
-> StreamRecord
-> f StreamRecord
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text AttributeValue)
  (HashMap Text AttributeValue)
  (HashMap Text AttributeValue)
  (HashMap Text AttributeValue)
-> Iso
     (Maybe (HashMap Text AttributeValue))
     (Maybe (HashMap Text AttributeValue))
     (Maybe (HashMap Text AttributeValue))
     (Maybe (HashMap Text AttributeValue))
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
  (HashMap Text AttributeValue)
  (HashMap Text AttributeValue)
  (HashMap Text AttributeValue)
  (HashMap Text AttributeValue)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The item in the DynamoDB table as it appeared before it was modified.
streamRecord_oldImage :: Lens.Lens' StreamRecord (Prelude.Maybe (Prelude.HashMap Prelude.Text AttributeValue))
streamRecord_oldImage :: (Maybe (HashMap Text AttributeValue)
 -> f (Maybe (HashMap Text AttributeValue)))
-> StreamRecord -> f StreamRecord
streamRecord_oldImage = (StreamRecord -> Maybe (HashMap Text AttributeValue))
-> (StreamRecord
    -> Maybe (HashMap Text AttributeValue) -> StreamRecord)
-> Lens
     StreamRecord
     StreamRecord
     (Maybe (HashMap Text AttributeValue))
     (Maybe (HashMap Text AttributeValue))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamRecord' {Maybe (HashMap Text AttributeValue)
oldImage :: Maybe (HashMap Text AttributeValue)
$sel:oldImage:StreamRecord' :: StreamRecord -> Maybe (HashMap Text AttributeValue)
oldImage} -> Maybe (HashMap Text AttributeValue)
oldImage) (\s :: StreamRecord
s@StreamRecord' {} Maybe (HashMap Text AttributeValue)
a -> StreamRecord
s {$sel:oldImage:StreamRecord' :: Maybe (HashMap Text AttributeValue)
oldImage = Maybe (HashMap Text AttributeValue)
a} :: StreamRecord) ((Maybe (HashMap Text AttributeValue)
  -> f (Maybe (HashMap Text AttributeValue)))
 -> StreamRecord -> f StreamRecord)
-> ((Maybe (HashMap Text AttributeValue)
     -> f (Maybe (HashMap Text AttributeValue)))
    -> Maybe (HashMap Text AttributeValue)
    -> f (Maybe (HashMap Text AttributeValue)))
-> (Maybe (HashMap Text AttributeValue)
    -> f (Maybe (HashMap Text AttributeValue)))
-> StreamRecord
-> f StreamRecord
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text AttributeValue)
  (HashMap Text AttributeValue)
  (HashMap Text AttributeValue)
  (HashMap Text AttributeValue)
-> Iso
     (Maybe (HashMap Text AttributeValue))
     (Maybe (HashMap Text AttributeValue))
     (Maybe (HashMap Text AttributeValue))
     (Maybe (HashMap Text AttributeValue))
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
  (HashMap Text AttributeValue)
  (HashMap Text AttributeValue)
  (HashMap Text AttributeValue)
  (HashMap Text AttributeValue)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The item in the DynamoDB table as it appeared after it was modified.
streamRecord_newImage :: Lens.Lens' StreamRecord (Prelude.Maybe (Prelude.HashMap Prelude.Text AttributeValue))
streamRecord_newImage :: (Maybe (HashMap Text AttributeValue)
 -> f (Maybe (HashMap Text AttributeValue)))
-> StreamRecord -> f StreamRecord
streamRecord_newImage = (StreamRecord -> Maybe (HashMap Text AttributeValue))
-> (StreamRecord
    -> Maybe (HashMap Text AttributeValue) -> StreamRecord)
-> Lens
     StreamRecord
     StreamRecord
     (Maybe (HashMap Text AttributeValue))
     (Maybe (HashMap Text AttributeValue))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamRecord' {Maybe (HashMap Text AttributeValue)
newImage' :: Maybe (HashMap Text AttributeValue)
$sel:newImage':StreamRecord' :: StreamRecord -> Maybe (HashMap Text AttributeValue)
newImage'} -> Maybe (HashMap Text AttributeValue)
newImage') (\s :: StreamRecord
s@StreamRecord' {} Maybe (HashMap Text AttributeValue)
a -> StreamRecord
s {$sel:newImage':StreamRecord' :: Maybe (HashMap Text AttributeValue)
newImage' = Maybe (HashMap Text AttributeValue)
a} :: StreamRecord) ((Maybe (HashMap Text AttributeValue)
  -> f (Maybe (HashMap Text AttributeValue)))
 -> StreamRecord -> f StreamRecord)
-> ((Maybe (HashMap Text AttributeValue)
     -> f (Maybe (HashMap Text AttributeValue)))
    -> Maybe (HashMap Text AttributeValue)
    -> f (Maybe (HashMap Text AttributeValue)))
-> (Maybe (HashMap Text AttributeValue)
    -> f (Maybe (HashMap Text AttributeValue)))
-> StreamRecord
-> f StreamRecord
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text AttributeValue)
  (HashMap Text AttributeValue)
  (HashMap Text AttributeValue)
  (HashMap Text AttributeValue)
-> Iso
     (Maybe (HashMap Text AttributeValue))
     (Maybe (HashMap Text AttributeValue))
     (Maybe (HashMap Text AttributeValue))
     (Maybe (HashMap Text AttributeValue))
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
  (HashMap Text AttributeValue)
  (HashMap Text AttributeValue)
  (HashMap Text AttributeValue)
  (HashMap Text AttributeValue)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON StreamRecord where
  parseJSON :: Value -> Parser StreamRecord
parseJSON =
    String
-> (Object -> Parser StreamRecord) -> Value -> Parser StreamRecord
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"StreamRecord"
      ( \Object
x ->
          Maybe Natural
-> Maybe Text
-> Maybe POSIX
-> Maybe StreamViewType
-> Maybe (HashMap Text AttributeValue)
-> Maybe (HashMap Text AttributeValue)
-> Maybe (HashMap Text AttributeValue)
-> StreamRecord
StreamRecord'
            (Maybe Natural
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe StreamViewType
 -> Maybe (HashMap Text AttributeValue)
 -> Maybe (HashMap Text AttributeValue)
 -> Maybe (HashMap Text AttributeValue)
 -> StreamRecord)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe StreamViewType
      -> Maybe (HashMap Text AttributeValue)
      -> Maybe (HashMap Text AttributeValue)
      -> Maybe (HashMap Text AttributeValue)
      -> StreamRecord)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SizeBytes")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe StreamViewType
   -> Maybe (HashMap Text AttributeValue)
   -> Maybe (HashMap Text AttributeValue)
   -> Maybe (HashMap Text AttributeValue)
   -> StreamRecord)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe StreamViewType
      -> Maybe (HashMap Text AttributeValue)
      -> Maybe (HashMap Text AttributeValue)
      -> Maybe (HashMap Text AttributeValue)
      -> StreamRecord)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SequenceNumber")
            Parser
  (Maybe POSIX
   -> Maybe StreamViewType
   -> Maybe (HashMap Text AttributeValue)
   -> Maybe (HashMap Text AttributeValue)
   -> Maybe (HashMap Text AttributeValue)
   -> StreamRecord)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe StreamViewType
      -> Maybe (HashMap Text AttributeValue)
      -> Maybe (HashMap Text AttributeValue)
      -> Maybe (HashMap Text AttributeValue)
      -> StreamRecord)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ApproximateCreationDateTime")
            Parser
  (Maybe StreamViewType
   -> Maybe (HashMap Text AttributeValue)
   -> Maybe (HashMap Text AttributeValue)
   -> Maybe (HashMap Text AttributeValue)
   -> StreamRecord)
-> Parser (Maybe StreamViewType)
-> Parser
     (Maybe (HashMap Text AttributeValue)
      -> Maybe (HashMap Text AttributeValue)
      -> Maybe (HashMap Text AttributeValue)
      -> StreamRecord)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe StreamViewType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StreamViewType")
            Parser
  (Maybe (HashMap Text AttributeValue)
   -> Maybe (HashMap Text AttributeValue)
   -> Maybe (HashMap Text AttributeValue)
   -> StreamRecord)
-> Parser (Maybe (HashMap Text AttributeValue))
-> Parser
     (Maybe (HashMap Text AttributeValue)
      -> Maybe (HashMap Text AttributeValue) -> StreamRecord)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (Maybe (HashMap Text AttributeValue)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Keys" Parser (Maybe (Maybe (HashMap Text AttributeValue)))
-> Maybe (HashMap Text AttributeValue)
-> Parser (Maybe (HashMap Text AttributeValue))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text AttributeValue)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe (HashMap Text AttributeValue)
   -> Maybe (HashMap Text AttributeValue) -> StreamRecord)
-> Parser (Maybe (HashMap Text AttributeValue))
-> Parser (Maybe (HashMap Text AttributeValue) -> StreamRecord)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (Maybe (HashMap Text AttributeValue)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OldImage" Parser (Maybe (Maybe (HashMap Text AttributeValue)))
-> Maybe (HashMap Text AttributeValue)
-> Parser (Maybe (HashMap Text AttributeValue))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text AttributeValue)
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe (HashMap Text AttributeValue) -> StreamRecord)
-> Parser (Maybe (HashMap Text AttributeValue))
-> Parser StreamRecord
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (Maybe (HashMap Text AttributeValue)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NewImage" Parser (Maybe (Maybe (HashMap Text AttributeValue)))
-> Maybe (HashMap Text AttributeValue)
-> Parser (Maybe (HashMap Text AttributeValue))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text AttributeValue)
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable StreamRecord

instance Prelude.NFData StreamRecord