{-# 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 Amazonka.IVS.Types.StreamHealth
import Amazonka.IVS.Types.StreamState
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StreamSummary = StreamSummary'
{
StreamSummary -> Maybe StreamState
state :: Prelude.Maybe StreamState,
StreamSummary -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
StreamSummary -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
StreamSummary -> Maybe Integer
viewerCount :: Prelude.Maybe Prelude.Integer,
StreamSummary -> Maybe StreamHealth
health :: Prelude.Maybe StreamHealth
}
deriving (StreamSummary -> StreamSummary -> Bool
(StreamSummary -> StreamSummary -> Bool)
-> (StreamSummary -> StreamSummary -> Bool) -> Eq StreamSummary
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]
(Int -> ReadS StreamSummary)
-> ReadS [StreamSummary]
-> ReadPrec StreamSummary
-> ReadPrec [StreamSummary]
-> Read 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
(Int -> StreamSummary -> ShowS)
-> (StreamSummary -> String)
-> ([StreamSummary] -> ShowS)
-> Show StreamSummary
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. StreamSummary -> Rep StreamSummary x)
-> (forall x. Rep StreamSummary x -> StreamSummary)
-> Generic StreamSummary
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' :: Maybe StreamState
-> Maybe POSIX
-> Maybe Text
-> Maybe Integer
-> Maybe StreamHealth
-> StreamSummary
StreamSummary'
{ $sel:state:StreamSummary' :: Maybe StreamState
state = Maybe StreamState
forall a. Maybe a
Prelude.Nothing,
$sel:startTime:StreamSummary' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:channelArn:StreamSummary' :: Maybe Text
channelArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:viewerCount:StreamSummary' :: Maybe Integer
viewerCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:health:StreamSummary' :: Maybe StreamHealth
health = Maybe StreamHealth
forall a. Maybe a
Prelude.Nothing
}
streamSummary_state :: Lens.Lens' StreamSummary (Prelude.Maybe StreamState)
streamSummary_state :: (Maybe StreamState -> f (Maybe StreamState))
-> StreamSummary -> f StreamSummary
streamSummary_state = (StreamSummary -> Maybe StreamState)
-> (StreamSummary -> Maybe StreamState -> StreamSummary)
-> Lens
StreamSummary StreamSummary (Maybe StreamState) (Maybe StreamState)
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_startTime :: Lens.Lens' StreamSummary (Prelude.Maybe Prelude.UTCTime)
streamSummary_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> StreamSummary -> f StreamSummary
streamSummary_startTime = (StreamSummary -> Maybe POSIX)
-> (StreamSummary -> Maybe POSIX -> StreamSummary)
-> Lens StreamSummary StreamSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamSummary' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:StreamSummary' :: StreamSummary -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: StreamSummary
s@StreamSummary' {} Maybe POSIX
a -> StreamSummary
s {$sel:startTime:StreamSummary' :: Maybe POSIX
startTime = Maybe POSIX
a} :: StreamSummary) ((Maybe POSIX -> f (Maybe POSIX))
-> StreamSummary -> f StreamSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StreamSummary
-> f StreamSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
streamSummary_channelArn :: Lens.Lens' StreamSummary (Prelude.Maybe Prelude.Text)
streamSummary_channelArn :: (Maybe Text -> f (Maybe Text)) -> StreamSummary -> f StreamSummary
streamSummary_channelArn = (StreamSummary -> Maybe Text)
-> (StreamSummary -> Maybe Text -> StreamSummary)
-> Lens StreamSummary StreamSummary (Maybe Text) (Maybe Text)
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_viewerCount :: Lens.Lens' StreamSummary (Prelude.Maybe Prelude.Integer)
streamSummary_viewerCount :: (Maybe Integer -> f (Maybe Integer))
-> StreamSummary -> f StreamSummary
streamSummary_viewerCount = (StreamSummary -> Maybe Integer)
-> (StreamSummary -> Maybe Integer -> StreamSummary)
-> Lens StreamSummary StreamSummary (Maybe Integer) (Maybe Integer)
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)
streamSummary_health :: Lens.Lens' StreamSummary (Prelude.Maybe StreamHealth)
streamSummary_health :: (Maybe StreamHealth -> f (Maybe StreamHealth))
-> StreamSummary -> f StreamSummary
streamSummary_health = (StreamSummary -> Maybe StreamHealth)
-> (StreamSummary -> Maybe StreamHealth -> StreamSummary)
-> Lens
StreamSummary
StreamSummary
(Maybe StreamHealth)
(Maybe StreamHealth)
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)
instance Core.FromJSON StreamSummary where
parseJSON :: Value -> Parser StreamSummary
parseJSON =
String
-> (Object -> Parser StreamSummary)
-> Value
-> Parser StreamSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"StreamSummary"
( \Object
x ->
Maybe StreamState
-> Maybe POSIX
-> Maybe Text
-> Maybe Integer
-> Maybe StreamHealth
-> StreamSummary
StreamSummary'
(Maybe StreamState
-> Maybe POSIX
-> Maybe Text
-> Maybe Integer
-> Maybe StreamHealth
-> StreamSummary)
-> Parser (Maybe StreamState)
-> Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Integer
-> Maybe StreamHealth
-> StreamSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe StreamState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"state")
Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Integer
-> Maybe StreamHealth
-> StreamSummary)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe Integer -> Maybe StreamHealth -> StreamSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"startTime")
Parser
(Maybe Text
-> Maybe Integer -> Maybe StreamHealth -> StreamSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Integer -> Maybe StreamHealth -> StreamSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"channelArn")
Parser (Maybe Integer -> Maybe StreamHealth -> StreamSummary)
-> Parser (Maybe Integer)
-> Parser (Maybe StreamHealth -> StreamSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"viewerCount")
Parser (Maybe StreamHealth -> StreamSummary)
-> Parser (Maybe StreamHealth) -> Parser StreamSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe StreamHealth)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"health")
)
instance Prelude.Hashable StreamSummary
instance Prelude.NFData StreamSummary