{-# 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.StreamSummary 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.StreamModeDetails
import Amazonka.Kinesis.Types.StreamStatus
import qualified Amazonka.Prelude as Prelude
data StreamSummary = StreamSummary'
{
StreamSummary -> Maybe POSIX
streamCreationTimestamp :: Prelude.Maybe Data.POSIX,
StreamSummary -> Maybe StreamModeDetails
streamModeDetails :: Prelude.Maybe StreamModeDetails,
StreamSummary -> Text
streamName :: Prelude.Text,
StreamSummary -> Text
streamARN :: Prelude.Text,
StreamSummary -> StreamStatus
streamStatus :: StreamStatus
}
deriving (StreamSummary -> StreamSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StreamSummary -> StreamSummary -> Bool
$c/= :: StreamSummary -> StreamSummary -> Bool
== :: StreamSummary -> StreamSummary -> Bool
$c== :: StreamSummary -> StreamSummary -> Bool
Prelude.Eq, ReadPrec [StreamSummary]
ReadPrec StreamSummary
Int -> ReadS StreamSummary
ReadS [StreamSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StreamSummary]
$creadListPrec :: ReadPrec [StreamSummary]
readPrec :: ReadPrec StreamSummary
$creadPrec :: ReadPrec StreamSummary
readList :: ReadS [StreamSummary]
$creadList :: ReadS [StreamSummary]
readsPrec :: Int -> ReadS StreamSummary
$creadsPrec :: Int -> ReadS StreamSummary
Prelude.Read, Int -> StreamSummary -> ShowS
[StreamSummary] -> ShowS
StreamSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StreamSummary] -> ShowS
$cshowList :: [StreamSummary] -> ShowS
show :: StreamSummary -> String
$cshow :: StreamSummary -> String
showsPrec :: Int -> StreamSummary -> ShowS
$cshowsPrec :: Int -> StreamSummary -> ShowS
Prelude.Show, forall x. Rep StreamSummary x -> StreamSummary
forall x. StreamSummary -> Rep StreamSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StreamSummary x -> StreamSummary
$cfrom :: forall x. StreamSummary -> Rep StreamSummary x
Prelude.Generic)
newStreamSummary ::
Prelude.Text ->
Prelude.Text ->
StreamStatus ->
StreamSummary
newStreamSummary :: Text -> Text -> StreamStatus -> StreamSummary
newStreamSummary
Text
pStreamName_
Text
pStreamARN_
StreamStatus
pStreamStatus_ =
StreamSummary'
{ $sel:streamCreationTimestamp:StreamSummary' :: Maybe POSIX
streamCreationTimestamp =
forall a. Maybe a
Prelude.Nothing,
$sel:streamModeDetails:StreamSummary' :: Maybe StreamModeDetails
streamModeDetails = forall a. Maybe a
Prelude.Nothing,
$sel:streamName:StreamSummary' :: Text
streamName = Text
pStreamName_,
$sel:streamARN:StreamSummary' :: Text
streamARN = Text
pStreamARN_,
$sel:streamStatus:StreamSummary' :: StreamStatus
streamStatus = StreamStatus
pStreamStatus_
}
streamSummary_streamCreationTimestamp :: Lens.Lens' StreamSummary (Prelude.Maybe Prelude.UTCTime)
streamSummary_streamCreationTimestamp :: Lens' StreamSummary (Maybe UTCTime)
streamSummary_streamCreationTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSummary' {Maybe POSIX
streamCreationTimestamp :: Maybe POSIX
$sel:streamCreationTimestamp:StreamSummary' :: StreamSummary -> Maybe POSIX
streamCreationTimestamp} -> Maybe POSIX
streamCreationTimestamp) (\s :: StreamSummary
s@StreamSummary' {} Maybe POSIX
a -> StreamSummary
s {$sel:streamCreationTimestamp:StreamSummary' :: Maybe POSIX
streamCreationTimestamp = Maybe POSIX
a} :: StreamSummary) 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
streamSummary_streamModeDetails :: Lens.Lens' StreamSummary (Prelude.Maybe StreamModeDetails)
streamSummary_streamModeDetails :: Lens' StreamSummary (Maybe StreamModeDetails)
streamSummary_streamModeDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSummary' {Maybe StreamModeDetails
streamModeDetails :: Maybe StreamModeDetails
$sel:streamModeDetails:StreamSummary' :: StreamSummary -> Maybe StreamModeDetails
streamModeDetails} -> Maybe StreamModeDetails
streamModeDetails) (\s :: StreamSummary
s@StreamSummary' {} Maybe StreamModeDetails
a -> StreamSummary
s {$sel:streamModeDetails:StreamSummary' :: Maybe StreamModeDetails
streamModeDetails = Maybe StreamModeDetails
a} :: StreamSummary)
streamSummary_streamName :: Lens.Lens' StreamSummary Prelude.Text
streamSummary_streamName :: Lens' StreamSummary Text
streamSummary_streamName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSummary' {Text
streamName :: Text
$sel:streamName:StreamSummary' :: StreamSummary -> Text
streamName} -> Text
streamName) (\s :: StreamSummary
s@StreamSummary' {} Text
a -> StreamSummary
s {$sel:streamName:StreamSummary' :: Text
streamName = Text
a} :: StreamSummary)
streamSummary_streamARN :: Lens.Lens' StreamSummary Prelude.Text
streamSummary_streamARN :: Lens' StreamSummary Text
streamSummary_streamARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSummary' {Text
streamARN :: Text
$sel:streamARN:StreamSummary' :: StreamSummary -> Text
streamARN} -> Text
streamARN) (\s :: StreamSummary
s@StreamSummary' {} Text
a -> StreamSummary
s {$sel:streamARN:StreamSummary' :: Text
streamARN = Text
a} :: StreamSummary)
streamSummary_streamStatus :: Lens.Lens' StreamSummary StreamStatus
streamSummary_streamStatus :: Lens' StreamSummary StreamStatus
streamSummary_streamStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSummary' {StreamStatus
streamStatus :: StreamStatus
$sel:streamStatus:StreamSummary' :: StreamSummary -> StreamStatus
streamStatus} -> StreamStatus
streamStatus) (\s :: StreamSummary
s@StreamSummary' {} StreamStatus
a -> StreamSummary
s {$sel:streamStatus:StreamSummary' :: StreamStatus
streamStatus = StreamStatus
a} :: StreamSummary)
instance Data.FromJSON StreamSummary where
parseJSON :: Value -> Parser StreamSummary
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"StreamSummary"
( \Object
x ->
Maybe POSIX
-> Maybe StreamModeDetails
-> Text
-> Text
-> StreamStatus
-> StreamSummary
StreamSummary'
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
"StreamCreationTimestamp")
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
"StreamModeDetails")
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
"StreamName")
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
"StreamARN")
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
"StreamStatus")
)
instance Prelude.Hashable StreamSummary where
hashWithSalt :: Int -> StreamSummary -> Int
hashWithSalt Int
_salt StreamSummary' {Maybe POSIX
Maybe StreamModeDetails
Text
StreamStatus
streamStatus :: StreamStatus
streamARN :: Text
streamName :: Text
streamModeDetails :: Maybe StreamModeDetails
streamCreationTimestamp :: Maybe POSIX
$sel:streamStatus:StreamSummary' :: StreamSummary -> StreamStatus
$sel:streamARN:StreamSummary' :: StreamSummary -> Text
$sel:streamName:StreamSummary' :: StreamSummary -> Text
$sel:streamModeDetails:StreamSummary' :: StreamSummary -> Maybe StreamModeDetails
$sel:streamCreationTimestamp:StreamSummary' :: StreamSummary -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
streamCreationTimestamp
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StreamModeDetails
streamModeDetails
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
streamName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
streamARN
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` StreamStatus
streamStatus
instance Prelude.NFData StreamSummary where
rnf :: StreamSummary -> ()
rnf StreamSummary' {Maybe POSIX
Maybe StreamModeDetails
Text
StreamStatus
streamStatus :: StreamStatus
streamARN :: Text
streamName :: Text
streamModeDetails :: Maybe StreamModeDetails
streamCreationTimestamp :: Maybe POSIX
$sel:streamStatus:StreamSummary' :: StreamSummary -> StreamStatus
$sel:streamARN:StreamSummary' :: StreamSummary -> Text
$sel:streamName:StreamSummary' :: StreamSummary -> Text
$sel:streamModeDetails:StreamSummary' :: StreamSummary -> Maybe StreamModeDetails
$sel:streamCreationTimestamp:StreamSummary' :: StreamSummary -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
streamCreationTimestamp
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StreamModeDetails
streamModeDetails
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
streamName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
streamARN
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf StreamStatus
streamStatus