{-# 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.StreamSummary 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.StreamHealth
import Amazonka.IVS.Types.StreamState
import qualified Amazonka.Prelude as Prelude
data StreamSummary = StreamSummary'
{
StreamSummary -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
StreamSummary -> Maybe StreamHealth
health :: Prelude.Maybe StreamHealth,
StreamSummary -> Maybe ISO8601
startTime :: Prelude.Maybe Data.ISO8601,
StreamSummary -> Maybe StreamState
state :: Prelude.Maybe StreamState,
StreamSummary -> Maybe Text
streamId :: Prelude.Maybe Prelude.Text,
StreamSummary -> Maybe Integer
viewerCount :: Prelude.Maybe Prelude.Integer
}
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 ::
StreamSummary
newStreamSummary :: StreamSummary
newStreamSummary =
StreamSummary'
{ $sel:channelArn:StreamSummary' :: Maybe Text
channelArn = forall a. Maybe a
Prelude.Nothing,
$sel:health:StreamSummary' :: Maybe StreamHealth
health = forall a. Maybe a
Prelude.Nothing,
$sel:startTime:StreamSummary' :: Maybe ISO8601
startTime = forall a. Maybe a
Prelude.Nothing,
$sel:state:StreamSummary' :: Maybe StreamState
state = forall a. Maybe a
Prelude.Nothing,
$sel:streamId:StreamSummary' :: Maybe Text
streamId = forall a. Maybe a
Prelude.Nothing,
$sel:viewerCount:StreamSummary' :: Maybe Integer
viewerCount = forall a. Maybe a
Prelude.Nothing
}
streamSummary_channelArn :: Lens.Lens' StreamSummary (Prelude.Maybe Prelude.Text)
streamSummary_channelArn :: Lens' StreamSummary (Maybe Text)
streamSummary_channelArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSummary' {Maybe Text
channelArn :: Maybe Text
$sel:channelArn:StreamSummary' :: StreamSummary -> Maybe Text
channelArn} -> Maybe Text
channelArn) (\s :: StreamSummary
s@StreamSummary' {} Maybe Text
a -> StreamSummary
s {$sel:channelArn:StreamSummary' :: Maybe Text
channelArn = Maybe Text
a} :: StreamSummary)
streamSummary_health :: Lens.Lens' StreamSummary (Prelude.Maybe StreamHealth)
streamSummary_health :: Lens' StreamSummary (Maybe StreamHealth)
streamSummary_health = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSummary' {Maybe StreamHealth
health :: Maybe StreamHealth
$sel:health:StreamSummary' :: StreamSummary -> Maybe StreamHealth
health} -> Maybe StreamHealth
health) (\s :: StreamSummary
s@StreamSummary' {} Maybe StreamHealth
a -> StreamSummary
s {$sel:health:StreamSummary' :: Maybe StreamHealth
health = Maybe StreamHealth
a} :: StreamSummary)
streamSummary_startTime :: Lens.Lens' StreamSummary (Prelude.Maybe Prelude.UTCTime)
streamSummary_startTime :: Lens' StreamSummary (Maybe UTCTime)
streamSummary_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSummary' {Maybe ISO8601
startTime :: Maybe ISO8601
$sel:startTime:StreamSummary' :: StreamSummary -> Maybe ISO8601
startTime} -> Maybe ISO8601
startTime) (\s :: StreamSummary
s@StreamSummary' {} Maybe ISO8601
a -> StreamSummary
s {$sel:startTime:StreamSummary' :: Maybe ISO8601
startTime = Maybe ISO8601
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_state :: Lens.Lens' StreamSummary (Prelude.Maybe StreamState)
streamSummary_state :: Lens' StreamSummary (Maybe StreamState)
streamSummary_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSummary' {Maybe StreamState
state :: Maybe StreamState
$sel:state:StreamSummary' :: StreamSummary -> Maybe StreamState
state} -> Maybe StreamState
state) (\s :: StreamSummary
s@StreamSummary' {} Maybe StreamState
a -> StreamSummary
s {$sel:state:StreamSummary' :: Maybe StreamState
state = Maybe StreamState
a} :: StreamSummary)
streamSummary_streamId :: Lens.Lens' StreamSummary (Prelude.Maybe Prelude.Text)
streamSummary_streamId :: Lens' StreamSummary (Maybe Text)
streamSummary_streamId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSummary' {Maybe Text
streamId :: Maybe Text
$sel:streamId:StreamSummary' :: StreamSummary -> Maybe Text
streamId} -> Maybe Text
streamId) (\s :: StreamSummary
s@StreamSummary' {} Maybe Text
a -> StreamSummary
s {$sel:streamId:StreamSummary' :: Maybe Text
streamId = Maybe Text
a} :: StreamSummary)
streamSummary_viewerCount :: Lens.Lens' StreamSummary (Prelude.Maybe Prelude.Integer)
streamSummary_viewerCount :: Lens' StreamSummary (Maybe Integer)
streamSummary_viewerCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSummary' {Maybe Integer
viewerCount :: Maybe Integer
$sel:viewerCount:StreamSummary' :: StreamSummary -> Maybe Integer
viewerCount} -> Maybe Integer
viewerCount) (\s :: StreamSummary
s@StreamSummary' {} Maybe Integer
a -> StreamSummary
s {$sel:viewerCount:StreamSummary' :: Maybe Integer
viewerCount = Maybe Integer
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 Text
-> Maybe StreamHealth
-> Maybe ISO8601
-> Maybe StreamState
-> Maybe Text
-> Maybe Integer
-> 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
"channelArn")
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
"health")
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
"state")
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
"viewerCount")
)
instance Prelude.Hashable StreamSummary where
hashWithSalt :: Int -> StreamSummary -> Int
hashWithSalt Int
_salt StreamSummary' {Maybe Integer
Maybe Text
Maybe ISO8601
Maybe StreamHealth
Maybe StreamState
viewerCount :: Maybe Integer
streamId :: Maybe Text
state :: Maybe StreamState
startTime :: Maybe ISO8601
health :: Maybe StreamHealth
channelArn :: Maybe Text
$sel:viewerCount:StreamSummary' :: StreamSummary -> Maybe Integer
$sel:streamId:StreamSummary' :: StreamSummary -> Maybe Text
$sel:state:StreamSummary' :: StreamSummary -> Maybe StreamState
$sel:startTime:StreamSummary' :: StreamSummary -> Maybe ISO8601
$sel:health:StreamSummary' :: StreamSummary -> Maybe StreamHealth
$sel:channelArn:StreamSummary' :: StreamSummary -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
channelArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StreamHealth
health
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
startTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StreamState
state
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
streamId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
viewerCount
instance Prelude.NFData StreamSummary where
rnf :: StreamSummary -> ()
rnf StreamSummary' {Maybe Integer
Maybe Text
Maybe ISO8601
Maybe StreamHealth
Maybe StreamState
viewerCount :: Maybe Integer
streamId :: Maybe Text
state :: Maybe StreamState
startTime :: Maybe ISO8601
health :: Maybe StreamHealth
channelArn :: Maybe Text
$sel:viewerCount:StreamSummary' :: StreamSummary -> Maybe Integer
$sel:streamId:StreamSummary' :: StreamSummary -> Maybe Text
$sel:state:StreamSummary' :: StreamSummary -> Maybe StreamState
$sel:startTime:StreamSummary' :: StreamSummary -> Maybe ISO8601
$sel:health:StreamSummary' :: StreamSummary -> Maybe StreamHealth
$sel:channelArn:StreamSummary' :: StreamSummary -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
channelArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StreamHealth
health
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 StreamState
state
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 Integer
viewerCount