{-# 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 #-}
module Amazonka.DynamoDBStreams.Types.SequenceNumberRange where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SequenceNumberRange = SequenceNumberRange'
{
SequenceNumberRange -> Maybe Text
startingSequenceNumber :: Prelude.Maybe Prelude.Text,
SequenceNumberRange -> Maybe Text
endingSequenceNumber :: Prelude.Maybe Prelude.Text
}
deriving (SequenceNumberRange -> SequenceNumberRange -> Bool
(SequenceNumberRange -> SequenceNumberRange -> Bool)
-> (SequenceNumberRange -> SequenceNumberRange -> Bool)
-> Eq SequenceNumberRange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SequenceNumberRange -> SequenceNumberRange -> Bool
$c/= :: SequenceNumberRange -> SequenceNumberRange -> Bool
== :: SequenceNumberRange -> SequenceNumberRange -> Bool
$c== :: SequenceNumberRange -> SequenceNumberRange -> Bool
Prelude.Eq, ReadPrec [SequenceNumberRange]
ReadPrec SequenceNumberRange
Int -> ReadS SequenceNumberRange
ReadS [SequenceNumberRange]
(Int -> ReadS SequenceNumberRange)
-> ReadS [SequenceNumberRange]
-> ReadPrec SequenceNumberRange
-> ReadPrec [SequenceNumberRange]
-> Read SequenceNumberRange
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SequenceNumberRange]
$creadListPrec :: ReadPrec [SequenceNumberRange]
readPrec :: ReadPrec SequenceNumberRange
$creadPrec :: ReadPrec SequenceNumberRange
readList :: ReadS [SequenceNumberRange]
$creadList :: ReadS [SequenceNumberRange]
readsPrec :: Int -> ReadS SequenceNumberRange
$creadsPrec :: Int -> ReadS SequenceNumberRange
Prelude.Read, Int -> SequenceNumberRange -> ShowS
[SequenceNumberRange] -> ShowS
SequenceNumberRange -> String
(Int -> SequenceNumberRange -> ShowS)
-> (SequenceNumberRange -> String)
-> ([SequenceNumberRange] -> ShowS)
-> Show SequenceNumberRange
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SequenceNumberRange] -> ShowS
$cshowList :: [SequenceNumberRange] -> ShowS
show :: SequenceNumberRange -> String
$cshow :: SequenceNumberRange -> String
showsPrec :: Int -> SequenceNumberRange -> ShowS
$cshowsPrec :: Int -> SequenceNumberRange -> ShowS
Prelude.Show, (forall x. SequenceNumberRange -> Rep SequenceNumberRange x)
-> (forall x. Rep SequenceNumberRange x -> SequenceNumberRange)
-> Generic SequenceNumberRange
forall x. Rep SequenceNumberRange x -> SequenceNumberRange
forall x. SequenceNumberRange -> Rep SequenceNumberRange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SequenceNumberRange x -> SequenceNumberRange
$cfrom :: forall x. SequenceNumberRange -> Rep SequenceNumberRange x
Prelude.Generic)
newSequenceNumberRange ::
SequenceNumberRange
newSequenceNumberRange :: SequenceNumberRange
newSequenceNumberRange =
SequenceNumberRange' :: Maybe Text -> Maybe Text -> SequenceNumberRange
SequenceNumberRange'
{ $sel:startingSequenceNumber:SequenceNumberRange' :: Maybe Text
startingSequenceNumber =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endingSequenceNumber:SequenceNumberRange' :: Maybe Text
endingSequenceNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
sequenceNumberRange_startingSequenceNumber :: Lens.Lens' SequenceNumberRange (Prelude.Maybe Prelude.Text)
sequenceNumberRange_startingSequenceNumber :: (Maybe Text -> f (Maybe Text))
-> SequenceNumberRange -> f SequenceNumberRange
sequenceNumberRange_startingSequenceNumber = (SequenceNumberRange -> Maybe Text)
-> (SequenceNumberRange -> Maybe Text -> SequenceNumberRange)
-> Lens
SequenceNumberRange SequenceNumberRange (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SequenceNumberRange' {Maybe Text
startingSequenceNumber :: Maybe Text
$sel:startingSequenceNumber:SequenceNumberRange' :: SequenceNumberRange -> Maybe Text
startingSequenceNumber} -> Maybe Text
startingSequenceNumber) (\s :: SequenceNumberRange
s@SequenceNumberRange' {} Maybe Text
a -> SequenceNumberRange
s {$sel:startingSequenceNumber:SequenceNumberRange' :: Maybe Text
startingSequenceNumber = Maybe Text
a} :: SequenceNumberRange)
sequenceNumberRange_endingSequenceNumber :: Lens.Lens' SequenceNumberRange (Prelude.Maybe Prelude.Text)
sequenceNumberRange_endingSequenceNumber :: (Maybe Text -> f (Maybe Text))
-> SequenceNumberRange -> f SequenceNumberRange
sequenceNumberRange_endingSequenceNumber = (SequenceNumberRange -> Maybe Text)
-> (SequenceNumberRange -> Maybe Text -> SequenceNumberRange)
-> Lens
SequenceNumberRange SequenceNumberRange (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SequenceNumberRange' {Maybe Text
endingSequenceNumber :: Maybe Text
$sel:endingSequenceNumber:SequenceNumberRange' :: SequenceNumberRange -> Maybe Text
endingSequenceNumber} -> Maybe Text
endingSequenceNumber) (\s :: SequenceNumberRange
s@SequenceNumberRange' {} Maybe Text
a -> SequenceNumberRange
s {$sel:endingSequenceNumber:SequenceNumberRange' :: Maybe Text
endingSequenceNumber = Maybe Text
a} :: SequenceNumberRange)
instance Core.FromJSON SequenceNumberRange where
parseJSON :: Value -> Parser SequenceNumberRange
parseJSON =
String
-> (Object -> Parser SequenceNumberRange)
-> Value
-> Parser SequenceNumberRange
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SequenceNumberRange"
( \Object
x ->
Maybe Text -> Maybe Text -> SequenceNumberRange
SequenceNumberRange'
(Maybe Text -> Maybe Text -> SequenceNumberRange)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> SequenceNumberRange)
forall (f :: * -> *) a b. Functor 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
"StartingSequenceNumber")
Parser (Maybe Text -> SequenceNumberRange)
-> Parser (Maybe Text) -> Parser SequenceNumberRange
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
"EndingSequenceNumber")
)
instance Prelude.Hashable SequenceNumberRange
instance Prelude.NFData SequenceNumberRange