{-# 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.SubscribeToShardEvent 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.ChildShard
import Amazonka.Kinesis.Types.Record
import qualified Amazonka.Prelude as Prelude
data SubscribeToShardEvent = SubscribeToShardEvent'
{
SubscribeToShardEvent -> Maybe [ChildShard]
childShards :: Prelude.Maybe [ChildShard],
SubscribeToShardEvent -> [Record]
records :: [Record],
SubscribeToShardEvent -> Text
continuationSequenceNumber :: Prelude.Text,
SubscribeToShardEvent -> Natural
millisBehindLatest :: Prelude.Natural
}
deriving (SubscribeToShardEvent -> SubscribeToShardEvent -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SubscribeToShardEvent -> SubscribeToShardEvent -> Bool
$c/= :: SubscribeToShardEvent -> SubscribeToShardEvent -> Bool
== :: SubscribeToShardEvent -> SubscribeToShardEvent -> Bool
$c== :: SubscribeToShardEvent -> SubscribeToShardEvent -> Bool
Prelude.Eq, ReadPrec [SubscribeToShardEvent]
ReadPrec SubscribeToShardEvent
Int -> ReadS SubscribeToShardEvent
ReadS [SubscribeToShardEvent]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SubscribeToShardEvent]
$creadListPrec :: ReadPrec [SubscribeToShardEvent]
readPrec :: ReadPrec SubscribeToShardEvent
$creadPrec :: ReadPrec SubscribeToShardEvent
readList :: ReadS [SubscribeToShardEvent]
$creadList :: ReadS [SubscribeToShardEvent]
readsPrec :: Int -> ReadS SubscribeToShardEvent
$creadsPrec :: Int -> ReadS SubscribeToShardEvent
Prelude.Read, Int -> SubscribeToShardEvent -> ShowS
[SubscribeToShardEvent] -> ShowS
SubscribeToShardEvent -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SubscribeToShardEvent] -> ShowS
$cshowList :: [SubscribeToShardEvent] -> ShowS
show :: SubscribeToShardEvent -> String
$cshow :: SubscribeToShardEvent -> String
showsPrec :: Int -> SubscribeToShardEvent -> ShowS
$cshowsPrec :: Int -> SubscribeToShardEvent -> ShowS
Prelude.Show, forall x. Rep SubscribeToShardEvent x -> SubscribeToShardEvent
forall x. SubscribeToShardEvent -> Rep SubscribeToShardEvent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SubscribeToShardEvent x -> SubscribeToShardEvent
$cfrom :: forall x. SubscribeToShardEvent -> Rep SubscribeToShardEvent x
Prelude.Generic)
newSubscribeToShardEvent ::
Prelude.Text ->
Prelude.Natural ->
SubscribeToShardEvent
newSubscribeToShardEvent :: Text -> Natural -> SubscribeToShardEvent
newSubscribeToShardEvent
Text
pContinuationSequenceNumber_
Natural
pMillisBehindLatest_ =
SubscribeToShardEvent'
{ $sel:childShards:SubscribeToShardEvent' :: Maybe [ChildShard]
childShards =
forall a. Maybe a
Prelude.Nothing,
$sel:records:SubscribeToShardEvent' :: [Record]
records = forall a. Monoid a => a
Prelude.mempty,
$sel:continuationSequenceNumber:SubscribeToShardEvent' :: Text
continuationSequenceNumber =
Text
pContinuationSequenceNumber_,
$sel:millisBehindLatest:SubscribeToShardEvent' :: Natural
millisBehindLatest = Natural
pMillisBehindLatest_
}
subscribeToShardEvent_childShards :: Lens.Lens' SubscribeToShardEvent (Prelude.Maybe [ChildShard])
subscribeToShardEvent_childShards :: Lens' SubscribeToShardEvent (Maybe [ChildShard])
subscribeToShardEvent_childShards = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscribeToShardEvent' {Maybe [ChildShard]
childShards :: Maybe [ChildShard]
$sel:childShards:SubscribeToShardEvent' :: SubscribeToShardEvent -> Maybe [ChildShard]
childShards} -> Maybe [ChildShard]
childShards) (\s :: SubscribeToShardEvent
s@SubscribeToShardEvent' {} Maybe [ChildShard]
a -> SubscribeToShardEvent
s {$sel:childShards:SubscribeToShardEvent' :: Maybe [ChildShard]
childShards = Maybe [ChildShard]
a} :: SubscribeToShardEvent) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
subscribeToShardEvent_records :: Lens.Lens' SubscribeToShardEvent [Record]
subscribeToShardEvent_records :: Lens' SubscribeToShardEvent [Record]
subscribeToShardEvent_records = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscribeToShardEvent' {[Record]
records :: [Record]
$sel:records:SubscribeToShardEvent' :: SubscribeToShardEvent -> [Record]
records} -> [Record]
records) (\s :: SubscribeToShardEvent
s@SubscribeToShardEvent' {} [Record]
a -> SubscribeToShardEvent
s {$sel:records:SubscribeToShardEvent' :: [Record]
records = [Record]
a} :: SubscribeToShardEvent) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
subscribeToShardEvent_continuationSequenceNumber :: Lens.Lens' SubscribeToShardEvent Prelude.Text
subscribeToShardEvent_continuationSequenceNumber :: Lens' SubscribeToShardEvent Text
subscribeToShardEvent_continuationSequenceNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscribeToShardEvent' {Text
continuationSequenceNumber :: Text
$sel:continuationSequenceNumber:SubscribeToShardEvent' :: SubscribeToShardEvent -> Text
continuationSequenceNumber} -> Text
continuationSequenceNumber) (\s :: SubscribeToShardEvent
s@SubscribeToShardEvent' {} Text
a -> SubscribeToShardEvent
s {$sel:continuationSequenceNumber:SubscribeToShardEvent' :: Text
continuationSequenceNumber = Text
a} :: SubscribeToShardEvent)
subscribeToShardEvent_millisBehindLatest :: Lens.Lens' SubscribeToShardEvent Prelude.Natural
subscribeToShardEvent_millisBehindLatest :: Lens' SubscribeToShardEvent Natural
subscribeToShardEvent_millisBehindLatest = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscribeToShardEvent' {Natural
millisBehindLatest :: Natural
$sel:millisBehindLatest:SubscribeToShardEvent' :: SubscribeToShardEvent -> Natural
millisBehindLatest} -> Natural
millisBehindLatest) (\s :: SubscribeToShardEvent
s@SubscribeToShardEvent' {} Natural
a -> SubscribeToShardEvent
s {$sel:millisBehindLatest:SubscribeToShardEvent' :: Natural
millisBehindLatest = Natural
a} :: SubscribeToShardEvent)
instance Data.FromJSON SubscribeToShardEvent where
parseJSON :: Value -> Parser SubscribeToShardEvent
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SubscribeToShardEvent"
( \Object
x ->
Maybe [ChildShard]
-> [Record] -> Text -> Natural -> SubscribeToShardEvent
SubscribeToShardEvent'
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
"ChildShards" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"Records" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"ContinuationSequenceNumber")
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
"MillisBehindLatest")
)
instance Prelude.Hashable SubscribeToShardEvent where
hashWithSalt :: Int -> SubscribeToShardEvent -> Int
hashWithSalt Int
_salt SubscribeToShardEvent' {Natural
[Record]
Maybe [ChildShard]
Text
millisBehindLatest :: Natural
continuationSequenceNumber :: Text
records :: [Record]
childShards :: Maybe [ChildShard]
$sel:millisBehindLatest:SubscribeToShardEvent' :: SubscribeToShardEvent -> Natural
$sel:continuationSequenceNumber:SubscribeToShardEvent' :: SubscribeToShardEvent -> Text
$sel:records:SubscribeToShardEvent' :: SubscribeToShardEvent -> [Record]
$sel:childShards:SubscribeToShardEvent' :: SubscribeToShardEvent -> Maybe [ChildShard]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ChildShard]
childShards
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Record]
records
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
continuationSequenceNumber
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
millisBehindLatest
instance Prelude.NFData SubscribeToShardEvent where
rnf :: SubscribeToShardEvent -> ()
rnf SubscribeToShardEvent' {Natural
[Record]
Maybe [ChildShard]
Text
millisBehindLatest :: Natural
continuationSequenceNumber :: Text
records :: [Record]
childShards :: Maybe [ChildShard]
$sel:millisBehindLatest:SubscribeToShardEvent' :: SubscribeToShardEvent -> Natural
$sel:continuationSequenceNumber:SubscribeToShardEvent' :: SubscribeToShardEvent -> Text
$sel:records:SubscribeToShardEvent' :: SubscribeToShardEvent -> [Record]
$sel:childShards:SubscribeToShardEvent' :: SubscribeToShardEvent -> Maybe [ChildShard]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [ChildShard]
childShards
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Record]
records
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
continuationSequenceNumber
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
millisBehindLatest