{-# 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.Kinesis.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
endingSequenceNumber :: Prelude.Maybe Prelude.Text,
SequenceNumberRange -> Text
startingSequenceNumber :: 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 ::
Prelude.Text ->
SequenceNumberRange
newSequenceNumberRange :: Text -> SequenceNumberRange
newSequenceNumberRange Text
pStartingSequenceNumber_ =
SequenceNumberRange' :: Maybe Text -> Text -> SequenceNumberRange
SequenceNumberRange'
{ $sel:endingSequenceNumber:SequenceNumberRange' :: Maybe Text
endingSequenceNumber =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:startingSequenceNumber:SequenceNumberRange' :: Text
startingSequenceNumber = Text
pStartingSequenceNumber_
}
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)
sequenceNumberRange_startingSequenceNumber :: Lens.Lens' SequenceNumberRange Prelude.Text
sequenceNumberRange_startingSequenceNumber :: (Text -> f Text) -> SequenceNumberRange -> f SequenceNumberRange
sequenceNumberRange_startingSequenceNumber = (SequenceNumberRange -> Text)
-> (SequenceNumberRange -> Text -> SequenceNumberRange)
-> Lens SequenceNumberRange SequenceNumberRange Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SequenceNumberRange' {Text
startingSequenceNumber :: Text
$sel:startingSequenceNumber:SequenceNumberRange' :: SequenceNumberRange -> Text
startingSequenceNumber} -> Text
startingSequenceNumber) (\s :: SequenceNumberRange
s@SequenceNumberRange' {} Text
a -> SequenceNumberRange
s {$sel:startingSequenceNumber:SequenceNumberRange' :: Text
startingSequenceNumber = 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 -> Text -> SequenceNumberRange
SequenceNumberRange'
(Maybe Text -> Text -> SequenceNumberRange)
-> Parser (Maybe Text) -> Parser (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
"EndingSequenceNumber")
Parser (Text -> SequenceNumberRange)
-> Parser Text -> Parser SequenceNumberRange
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"StartingSequenceNumber")
)
instance Prelude.Hashable SequenceNumberRange
instance Prelude.NFData SequenceNumberRange