{-# 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.IVS.Types.StreamSession where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IVS.Types.Channel
import Amazonka.IVS.Types.IngestConfiguration
import Amazonka.IVS.Types.RecordingConfiguration
import Amazonka.IVS.Types.StreamEvent
import qualified Amazonka.Prelude as Prelude
data StreamSession = StreamSession'
{
StreamSession -> Maybe Channel
channel :: Prelude.Maybe Channel,
StreamSession -> Maybe ISO8601
endTime :: Prelude.Maybe Data.ISO8601,
StreamSession -> Maybe IngestConfiguration
ingestConfiguration :: Prelude.Maybe IngestConfiguration,
StreamSession -> Maybe RecordingConfiguration
recordingConfiguration :: Prelude.Maybe RecordingConfiguration,
StreamSession -> Maybe ISO8601
startTime :: Prelude.Maybe Data.ISO8601,
StreamSession -> Maybe Text
streamId :: Prelude.Maybe Prelude.Text,
StreamSession -> Maybe [StreamEvent]
truncatedEvents :: Prelude.Maybe [StreamEvent]
}
deriving (StreamSession -> StreamSession -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StreamSession -> StreamSession -> Bool
$c/= :: StreamSession -> StreamSession -> Bool
== :: StreamSession -> StreamSession -> Bool
$c== :: StreamSession -> StreamSession -> Bool
Prelude.Eq, ReadPrec [StreamSession]
ReadPrec StreamSession
Int -> ReadS StreamSession
ReadS [StreamSession]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StreamSession]
$creadListPrec :: ReadPrec [StreamSession]
readPrec :: ReadPrec StreamSession
$creadPrec :: ReadPrec StreamSession
readList :: ReadS [StreamSession]
$creadList :: ReadS [StreamSession]
readsPrec :: Int -> ReadS StreamSession
$creadsPrec :: Int -> ReadS StreamSession
Prelude.Read, Int -> StreamSession -> ShowS
[StreamSession] -> ShowS
StreamSession -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StreamSession] -> ShowS
$cshowList :: [StreamSession] -> ShowS
show :: StreamSession -> String
$cshow :: StreamSession -> String
showsPrec :: Int -> StreamSession -> ShowS
$cshowsPrec :: Int -> StreamSession -> ShowS
Prelude.Show, forall x. Rep StreamSession x -> StreamSession
forall x. StreamSession -> Rep StreamSession x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StreamSession x -> StreamSession
$cfrom :: forall x. StreamSession -> Rep StreamSession x
Prelude.Generic)
newStreamSession ::
StreamSession
newStreamSession :: StreamSession
newStreamSession =
StreamSession'
{ $sel:channel:StreamSession' :: Maybe Channel
channel = forall a. Maybe a
Prelude.Nothing,
$sel:endTime:StreamSession' :: Maybe ISO8601
endTime = forall a. Maybe a
Prelude.Nothing,
$sel:ingestConfiguration:StreamSession' :: Maybe IngestConfiguration
ingestConfiguration = forall a. Maybe a
Prelude.Nothing,
$sel:recordingConfiguration:StreamSession' :: Maybe RecordingConfiguration
recordingConfiguration = forall a. Maybe a
Prelude.Nothing,
$sel:startTime:StreamSession' :: Maybe ISO8601
startTime = forall a. Maybe a
Prelude.Nothing,
$sel:streamId:StreamSession' :: Maybe Text
streamId = forall a. Maybe a
Prelude.Nothing,
$sel:truncatedEvents:StreamSession' :: Maybe [StreamEvent]
truncatedEvents = forall a. Maybe a
Prelude.Nothing
}
streamSession_channel :: Lens.Lens' StreamSession (Prelude.Maybe Channel)
streamSession_channel :: Lens' StreamSession (Maybe Channel)
streamSession_channel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSession' {Maybe Channel
channel :: Maybe Channel
$sel:channel:StreamSession' :: StreamSession -> Maybe Channel
channel} -> Maybe Channel
channel) (\s :: StreamSession
s@StreamSession' {} Maybe Channel
a -> StreamSession
s {$sel:channel:StreamSession' :: Maybe Channel
channel = Maybe Channel
a} :: StreamSession)
streamSession_endTime :: Lens.Lens' StreamSession (Prelude.Maybe Prelude.UTCTime)
streamSession_endTime :: Lens' StreamSession (Maybe UTCTime)
streamSession_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSession' {Maybe ISO8601
endTime :: Maybe ISO8601
$sel:endTime:StreamSession' :: StreamSession -> Maybe ISO8601
endTime} -> Maybe ISO8601
endTime) (\s :: StreamSession
s@StreamSession' {} Maybe ISO8601
a -> StreamSession
s {$sel:endTime:StreamSession' :: Maybe ISO8601
endTime = Maybe ISO8601
a} :: StreamSession) 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
streamSession_ingestConfiguration :: Lens.Lens' StreamSession (Prelude.Maybe IngestConfiguration)
streamSession_ingestConfiguration :: Lens' StreamSession (Maybe IngestConfiguration)
streamSession_ingestConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSession' {Maybe IngestConfiguration
ingestConfiguration :: Maybe IngestConfiguration
$sel:ingestConfiguration:StreamSession' :: StreamSession -> Maybe IngestConfiguration
ingestConfiguration} -> Maybe IngestConfiguration
ingestConfiguration) (\s :: StreamSession
s@StreamSession' {} Maybe IngestConfiguration
a -> StreamSession
s {$sel:ingestConfiguration:StreamSession' :: Maybe IngestConfiguration
ingestConfiguration = Maybe IngestConfiguration
a} :: StreamSession)
streamSession_recordingConfiguration :: Lens.Lens' StreamSession (Prelude.Maybe RecordingConfiguration)
streamSession_recordingConfiguration :: Lens' StreamSession (Maybe RecordingConfiguration)
streamSession_recordingConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSession' {Maybe RecordingConfiguration
recordingConfiguration :: Maybe RecordingConfiguration
$sel:recordingConfiguration:StreamSession' :: StreamSession -> Maybe RecordingConfiguration
recordingConfiguration} -> Maybe RecordingConfiguration
recordingConfiguration) (\s :: StreamSession
s@StreamSession' {} Maybe RecordingConfiguration
a -> StreamSession
s {$sel:recordingConfiguration:StreamSession' :: Maybe RecordingConfiguration
recordingConfiguration = Maybe RecordingConfiguration
a} :: StreamSession)
streamSession_startTime :: Lens.Lens' StreamSession (Prelude.Maybe Prelude.UTCTime)
streamSession_startTime :: Lens' StreamSession (Maybe UTCTime)
streamSession_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSession' {Maybe ISO8601
startTime :: Maybe ISO8601
$sel:startTime:StreamSession' :: StreamSession -> Maybe ISO8601
startTime} -> Maybe ISO8601
startTime) (\s :: StreamSession
s@StreamSession' {} Maybe ISO8601
a -> StreamSession
s {$sel:startTime:StreamSession' :: Maybe ISO8601
startTime = Maybe ISO8601
a} :: StreamSession) 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
streamSession_streamId :: Lens.Lens' StreamSession (Prelude.Maybe Prelude.Text)
streamSession_streamId :: Lens' StreamSession (Maybe Text)
streamSession_streamId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSession' {Maybe Text
streamId :: Maybe Text
$sel:streamId:StreamSession' :: StreamSession -> Maybe Text
streamId} -> Maybe Text
streamId) (\s :: StreamSession
s@StreamSession' {} Maybe Text
a -> StreamSession
s {$sel:streamId:StreamSession' :: Maybe Text
streamId = Maybe Text
a} :: StreamSession)
streamSession_truncatedEvents :: Lens.Lens' StreamSession (Prelude.Maybe [StreamEvent])
streamSession_truncatedEvents :: Lens' StreamSession (Maybe [StreamEvent])
streamSession_truncatedEvents = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSession' {Maybe [StreamEvent]
truncatedEvents :: Maybe [StreamEvent]
$sel:truncatedEvents:StreamSession' :: StreamSession -> Maybe [StreamEvent]
truncatedEvents} -> Maybe [StreamEvent]
truncatedEvents) (\s :: StreamSession
s@StreamSession' {} Maybe [StreamEvent]
a -> StreamSession
s {$sel:truncatedEvents:StreamSession' :: Maybe [StreamEvent]
truncatedEvents = Maybe [StreamEvent]
a} :: StreamSession) 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
instance Data.FromJSON StreamSession where
parseJSON :: Value -> Parser StreamSession
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"StreamSession"
( \Object
x ->
Maybe Channel
-> Maybe ISO8601
-> Maybe IngestConfiguration
-> Maybe RecordingConfiguration
-> Maybe ISO8601
-> Maybe Text
-> Maybe [StreamEvent]
-> StreamSession
StreamSession'
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
"channel")
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
"endTime")
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
"ingestConfiguration")
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
"recordingConfiguration")
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
"startTime")
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
"streamId")
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
"truncatedEvents"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable StreamSession where
hashWithSalt :: Int -> StreamSession -> Int
hashWithSalt Int
_salt StreamSession' {Maybe [StreamEvent]
Maybe Text
Maybe ISO8601
Maybe Channel
Maybe RecordingConfiguration
Maybe IngestConfiguration
truncatedEvents :: Maybe [StreamEvent]
streamId :: Maybe Text
startTime :: Maybe ISO8601
recordingConfiguration :: Maybe RecordingConfiguration
ingestConfiguration :: Maybe IngestConfiguration
endTime :: Maybe ISO8601
channel :: Maybe Channel
$sel:truncatedEvents:StreamSession' :: StreamSession -> Maybe [StreamEvent]
$sel:streamId:StreamSession' :: StreamSession -> Maybe Text
$sel:startTime:StreamSession' :: StreamSession -> Maybe ISO8601
$sel:recordingConfiguration:StreamSession' :: StreamSession -> Maybe RecordingConfiguration
$sel:ingestConfiguration:StreamSession' :: StreamSession -> Maybe IngestConfiguration
$sel:endTime:StreamSession' :: StreamSession -> Maybe ISO8601
$sel:channel:StreamSession' :: StreamSession -> Maybe Channel
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Channel
channel
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
endTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IngestConfiguration
ingestConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RecordingConfiguration
recordingConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
startTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
streamId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [StreamEvent]
truncatedEvents
instance Prelude.NFData StreamSession where
rnf :: StreamSession -> ()
rnf StreamSession' {Maybe [StreamEvent]
Maybe Text
Maybe ISO8601
Maybe Channel
Maybe RecordingConfiguration
Maybe IngestConfiguration
truncatedEvents :: Maybe [StreamEvent]
streamId :: Maybe Text
startTime :: Maybe ISO8601
recordingConfiguration :: Maybe RecordingConfiguration
ingestConfiguration :: Maybe IngestConfiguration
endTime :: Maybe ISO8601
channel :: Maybe Channel
$sel:truncatedEvents:StreamSession' :: StreamSession -> Maybe [StreamEvent]
$sel:streamId:StreamSession' :: StreamSession -> Maybe Text
$sel:startTime:StreamSession' :: StreamSession -> Maybe ISO8601
$sel:recordingConfiguration:StreamSession' :: StreamSession -> Maybe RecordingConfiguration
$sel:ingestConfiguration:StreamSession' :: StreamSession -> Maybe IngestConfiguration
$sel:endTime:StreamSession' :: StreamSession -> Maybe ISO8601
$sel:channel:StreamSession' :: StreamSession -> Maybe Channel
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Channel
channel
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
endTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IngestConfiguration
ingestConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RecordingConfiguration
recordingConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
startTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
streamId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [StreamEvent]
truncatedEvents