{-# 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.StartingPosition where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Kinesis.Types.ShardIteratorType
import qualified Amazonka.Prelude as Prelude
data StartingPosition = StartingPosition'
{
StartingPosition -> Maybe Text
sequenceNumber :: Prelude.Maybe Prelude.Text,
StartingPosition -> Maybe POSIX
timestamp :: Prelude.Maybe Data.POSIX,
StartingPosition -> ShardIteratorType
type' :: ShardIteratorType
}
deriving (StartingPosition -> StartingPosition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartingPosition -> StartingPosition -> Bool
$c/= :: StartingPosition -> StartingPosition -> Bool
== :: StartingPosition -> StartingPosition -> Bool
$c== :: StartingPosition -> StartingPosition -> Bool
Prelude.Eq, ReadPrec [StartingPosition]
ReadPrec StartingPosition
Int -> ReadS StartingPosition
ReadS [StartingPosition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartingPosition]
$creadListPrec :: ReadPrec [StartingPosition]
readPrec :: ReadPrec StartingPosition
$creadPrec :: ReadPrec StartingPosition
readList :: ReadS [StartingPosition]
$creadList :: ReadS [StartingPosition]
readsPrec :: Int -> ReadS StartingPosition
$creadsPrec :: Int -> ReadS StartingPosition
Prelude.Read, Int -> StartingPosition -> ShowS
[StartingPosition] -> ShowS
StartingPosition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartingPosition] -> ShowS
$cshowList :: [StartingPosition] -> ShowS
show :: StartingPosition -> String
$cshow :: StartingPosition -> String
showsPrec :: Int -> StartingPosition -> ShowS
$cshowsPrec :: Int -> StartingPosition -> ShowS
Prelude.Show, forall x. Rep StartingPosition x -> StartingPosition
forall x. StartingPosition -> Rep StartingPosition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartingPosition x -> StartingPosition
$cfrom :: forall x. StartingPosition -> Rep StartingPosition x
Prelude.Generic)
newStartingPosition ::
ShardIteratorType ->
StartingPosition
newStartingPosition :: ShardIteratorType -> StartingPosition
newStartingPosition ShardIteratorType
pType_ =
StartingPosition'
{ $sel:sequenceNumber:StartingPosition' :: Maybe Text
sequenceNumber = forall a. Maybe a
Prelude.Nothing,
$sel:timestamp:StartingPosition' :: Maybe POSIX
timestamp = forall a. Maybe a
Prelude.Nothing,
$sel:type':StartingPosition' :: ShardIteratorType
type' = ShardIteratorType
pType_
}
startingPosition_sequenceNumber :: Lens.Lens' StartingPosition (Prelude.Maybe Prelude.Text)
startingPosition_sequenceNumber :: Lens' StartingPosition (Maybe Text)
startingPosition_sequenceNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartingPosition' {Maybe Text
sequenceNumber :: Maybe Text
$sel:sequenceNumber:StartingPosition' :: StartingPosition -> Maybe Text
sequenceNumber} -> Maybe Text
sequenceNumber) (\s :: StartingPosition
s@StartingPosition' {} Maybe Text
a -> StartingPosition
s {$sel:sequenceNumber:StartingPosition' :: Maybe Text
sequenceNumber = Maybe Text
a} :: StartingPosition)
startingPosition_timestamp :: Lens.Lens' StartingPosition (Prelude.Maybe Prelude.UTCTime)
startingPosition_timestamp :: Lens' StartingPosition (Maybe UTCTime)
startingPosition_timestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartingPosition' {Maybe POSIX
timestamp :: Maybe POSIX
$sel:timestamp:StartingPosition' :: StartingPosition -> Maybe POSIX
timestamp} -> Maybe POSIX
timestamp) (\s :: StartingPosition
s@StartingPosition' {} Maybe POSIX
a -> StartingPosition
s {$sel:timestamp:StartingPosition' :: Maybe POSIX
timestamp = Maybe POSIX
a} :: StartingPosition) 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
startingPosition_type :: Lens.Lens' StartingPosition ShardIteratorType
startingPosition_type :: Lens' StartingPosition ShardIteratorType
startingPosition_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartingPosition' {ShardIteratorType
type' :: ShardIteratorType
$sel:type':StartingPosition' :: StartingPosition -> ShardIteratorType
type'} -> ShardIteratorType
type') (\s :: StartingPosition
s@StartingPosition' {} ShardIteratorType
a -> StartingPosition
s {$sel:type':StartingPosition' :: ShardIteratorType
type' = ShardIteratorType
a} :: StartingPosition)
instance Prelude.Hashable StartingPosition where
hashWithSalt :: Int -> StartingPosition -> Int
hashWithSalt Int
_salt StartingPosition' {Maybe Text
Maybe POSIX
ShardIteratorType
type' :: ShardIteratorType
timestamp :: Maybe POSIX
sequenceNumber :: Maybe Text
$sel:type':StartingPosition' :: StartingPosition -> ShardIteratorType
$sel:timestamp:StartingPosition' :: StartingPosition -> Maybe POSIX
$sel:sequenceNumber:StartingPosition' :: StartingPosition -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sequenceNumber
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
timestamp
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ShardIteratorType
type'
instance Prelude.NFData StartingPosition where
rnf :: StartingPosition -> ()
rnf StartingPosition' {Maybe Text
Maybe POSIX
ShardIteratorType
type' :: ShardIteratorType
timestamp :: Maybe POSIX
sequenceNumber :: Maybe Text
$sel:type':StartingPosition' :: StartingPosition -> ShardIteratorType
$sel:timestamp:StartingPosition' :: StartingPosition -> Maybe POSIX
$sel:sequenceNumber:StartingPosition' :: StartingPosition -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sequenceNumber
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
timestamp
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ShardIteratorType
type'
instance Data.ToJSON StartingPosition where
toJSON :: StartingPosition -> Value
toJSON StartingPosition' {Maybe Text
Maybe POSIX
ShardIteratorType
type' :: ShardIteratorType
timestamp :: Maybe POSIX
sequenceNumber :: Maybe Text
$sel:type':StartingPosition' :: StartingPosition -> ShardIteratorType
$sel:timestamp:StartingPosition' :: StartingPosition -> Maybe POSIX
$sel:sequenceNumber:StartingPosition' :: StartingPosition -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"SequenceNumber" 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 Text
sequenceNumber,
(Key
"Timestamp" 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
timestamp,
forall a. a -> Maybe a
Prelude.Just (Key
"Type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ShardIteratorType
type')
]
)