{-# 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.MediaConnect.Types.MediaStream where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types.MediaStreamAttributes
import Amazonka.MediaConnect.Types.MediaStreamType
import qualified Amazonka.Prelude as Prelude
data MediaStream = MediaStream'
{
MediaStream -> Maybe Text
videoFormat :: Prelude.Maybe Prelude.Text,
MediaStream -> Maybe MediaStreamAttributes
attributes :: Prelude.Maybe MediaStreamAttributes,
MediaStream -> Maybe Int
clockRate :: Prelude.Maybe Prelude.Int,
MediaStream -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
MediaStream -> MediaStreamType
mediaStreamType :: MediaStreamType,
MediaStream -> Int
mediaStreamId :: Prelude.Int,
MediaStream -> Text
mediaStreamName :: Prelude.Text,
MediaStream -> Int
fmt :: Prelude.Int
}
deriving (MediaStream -> MediaStream -> Bool
(MediaStream -> MediaStream -> Bool)
-> (MediaStream -> MediaStream -> Bool) -> Eq MediaStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MediaStream -> MediaStream -> Bool
$c/= :: MediaStream -> MediaStream -> Bool
== :: MediaStream -> MediaStream -> Bool
$c== :: MediaStream -> MediaStream -> Bool
Prelude.Eq, ReadPrec [MediaStream]
ReadPrec MediaStream
Int -> ReadS MediaStream
ReadS [MediaStream]
(Int -> ReadS MediaStream)
-> ReadS [MediaStream]
-> ReadPrec MediaStream
-> ReadPrec [MediaStream]
-> Read MediaStream
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MediaStream]
$creadListPrec :: ReadPrec [MediaStream]
readPrec :: ReadPrec MediaStream
$creadPrec :: ReadPrec MediaStream
readList :: ReadS [MediaStream]
$creadList :: ReadS [MediaStream]
readsPrec :: Int -> ReadS MediaStream
$creadsPrec :: Int -> ReadS MediaStream
Prelude.Read, Int -> MediaStream -> ShowS
[MediaStream] -> ShowS
MediaStream -> String
(Int -> MediaStream -> ShowS)
-> (MediaStream -> String)
-> ([MediaStream] -> ShowS)
-> Show MediaStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MediaStream] -> ShowS
$cshowList :: [MediaStream] -> ShowS
show :: MediaStream -> String
$cshow :: MediaStream -> String
showsPrec :: Int -> MediaStream -> ShowS
$cshowsPrec :: Int -> MediaStream -> ShowS
Prelude.Show, (forall x. MediaStream -> Rep MediaStream x)
-> (forall x. Rep MediaStream x -> MediaStream)
-> Generic MediaStream
forall x. Rep MediaStream x -> MediaStream
forall x. MediaStream -> Rep MediaStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MediaStream x -> MediaStream
$cfrom :: forall x. MediaStream -> Rep MediaStream x
Prelude.Generic)
newMediaStream ::
MediaStreamType ->
Prelude.Int ->
Prelude.Text ->
Prelude.Int ->
MediaStream
newMediaStream :: MediaStreamType -> Int -> Text -> Int -> MediaStream
newMediaStream
MediaStreamType
pMediaStreamType_
Int
pMediaStreamId_
Text
pMediaStreamName_
Int
pFmt_ =
MediaStream' :: Maybe Text
-> Maybe MediaStreamAttributes
-> Maybe Int
-> Maybe Text
-> MediaStreamType
-> Int
-> Text
-> Int
-> MediaStream
MediaStream'
{ $sel:videoFormat:MediaStream' :: Maybe Text
videoFormat = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:attributes:MediaStream' :: Maybe MediaStreamAttributes
attributes = Maybe MediaStreamAttributes
forall a. Maybe a
Prelude.Nothing,
$sel:clockRate:MediaStream' :: Maybe Int
clockRate = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:description:MediaStream' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:mediaStreamType:MediaStream' :: MediaStreamType
mediaStreamType = MediaStreamType
pMediaStreamType_,
$sel:mediaStreamId:MediaStream' :: Int
mediaStreamId = Int
pMediaStreamId_,
$sel:mediaStreamName:MediaStream' :: Text
mediaStreamName = Text
pMediaStreamName_,
$sel:fmt:MediaStream' :: Int
fmt = Int
pFmt_
}
mediaStream_videoFormat :: Lens.Lens' MediaStream (Prelude.Maybe Prelude.Text)
mediaStream_videoFormat :: (Maybe Text -> f (Maybe Text)) -> MediaStream -> f MediaStream
mediaStream_videoFormat = (MediaStream -> Maybe Text)
-> (MediaStream -> Maybe Text -> MediaStream)
-> Lens MediaStream MediaStream (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaStream' {Maybe Text
videoFormat :: Maybe Text
$sel:videoFormat:MediaStream' :: MediaStream -> Maybe Text
videoFormat} -> Maybe Text
videoFormat) (\s :: MediaStream
s@MediaStream' {} Maybe Text
a -> MediaStream
s {$sel:videoFormat:MediaStream' :: Maybe Text
videoFormat = Maybe Text
a} :: MediaStream)
mediaStream_attributes :: Lens.Lens' MediaStream (Prelude.Maybe MediaStreamAttributes)
mediaStream_attributes :: (Maybe MediaStreamAttributes -> f (Maybe MediaStreamAttributes))
-> MediaStream -> f MediaStream
mediaStream_attributes = (MediaStream -> Maybe MediaStreamAttributes)
-> (MediaStream -> Maybe MediaStreamAttributes -> MediaStream)
-> Lens
MediaStream
MediaStream
(Maybe MediaStreamAttributes)
(Maybe MediaStreamAttributes)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaStream' {Maybe MediaStreamAttributes
attributes :: Maybe MediaStreamAttributes
$sel:attributes:MediaStream' :: MediaStream -> Maybe MediaStreamAttributes
attributes} -> Maybe MediaStreamAttributes
attributes) (\s :: MediaStream
s@MediaStream' {} Maybe MediaStreamAttributes
a -> MediaStream
s {$sel:attributes:MediaStream' :: Maybe MediaStreamAttributes
attributes = Maybe MediaStreamAttributes
a} :: MediaStream)
mediaStream_clockRate :: Lens.Lens' MediaStream (Prelude.Maybe Prelude.Int)
mediaStream_clockRate :: (Maybe Int -> f (Maybe Int)) -> MediaStream -> f MediaStream
mediaStream_clockRate = (MediaStream -> Maybe Int)
-> (MediaStream -> Maybe Int -> MediaStream)
-> Lens MediaStream MediaStream (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaStream' {Maybe Int
clockRate :: Maybe Int
$sel:clockRate:MediaStream' :: MediaStream -> Maybe Int
clockRate} -> Maybe Int
clockRate) (\s :: MediaStream
s@MediaStream' {} Maybe Int
a -> MediaStream
s {$sel:clockRate:MediaStream' :: Maybe Int
clockRate = Maybe Int
a} :: MediaStream)
mediaStream_description :: Lens.Lens' MediaStream (Prelude.Maybe Prelude.Text)
mediaStream_description :: (Maybe Text -> f (Maybe Text)) -> MediaStream -> f MediaStream
mediaStream_description = (MediaStream -> Maybe Text)
-> (MediaStream -> Maybe Text -> MediaStream)
-> Lens MediaStream MediaStream (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaStream' {Maybe Text
description :: Maybe Text
$sel:description:MediaStream' :: MediaStream -> Maybe Text
description} -> Maybe Text
description) (\s :: MediaStream
s@MediaStream' {} Maybe Text
a -> MediaStream
s {$sel:description:MediaStream' :: Maybe Text
description = Maybe Text
a} :: MediaStream)
mediaStream_mediaStreamType :: Lens.Lens' MediaStream MediaStreamType
mediaStream_mediaStreamType :: (MediaStreamType -> f MediaStreamType)
-> MediaStream -> f MediaStream
mediaStream_mediaStreamType = (MediaStream -> MediaStreamType)
-> (MediaStream -> MediaStreamType -> MediaStream)
-> Lens MediaStream MediaStream MediaStreamType MediaStreamType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaStream' {MediaStreamType
mediaStreamType :: MediaStreamType
$sel:mediaStreamType:MediaStream' :: MediaStream -> MediaStreamType
mediaStreamType} -> MediaStreamType
mediaStreamType) (\s :: MediaStream
s@MediaStream' {} MediaStreamType
a -> MediaStream
s {$sel:mediaStreamType:MediaStream' :: MediaStreamType
mediaStreamType = MediaStreamType
a} :: MediaStream)
mediaStream_mediaStreamId :: Lens.Lens' MediaStream Prelude.Int
mediaStream_mediaStreamId :: (Int -> f Int) -> MediaStream -> f MediaStream
mediaStream_mediaStreamId = (MediaStream -> Int)
-> (MediaStream -> Int -> MediaStream)
-> Lens MediaStream MediaStream Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaStream' {Int
mediaStreamId :: Int
$sel:mediaStreamId:MediaStream' :: MediaStream -> Int
mediaStreamId} -> Int
mediaStreamId) (\s :: MediaStream
s@MediaStream' {} Int
a -> MediaStream
s {$sel:mediaStreamId:MediaStream' :: Int
mediaStreamId = Int
a} :: MediaStream)
mediaStream_mediaStreamName :: Lens.Lens' MediaStream Prelude.Text
mediaStream_mediaStreamName :: (Text -> f Text) -> MediaStream -> f MediaStream
mediaStream_mediaStreamName = (MediaStream -> Text)
-> (MediaStream -> Text -> MediaStream)
-> Lens MediaStream MediaStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaStream' {Text
mediaStreamName :: Text
$sel:mediaStreamName:MediaStream' :: MediaStream -> Text
mediaStreamName} -> Text
mediaStreamName) (\s :: MediaStream
s@MediaStream' {} Text
a -> MediaStream
s {$sel:mediaStreamName:MediaStream' :: Text
mediaStreamName = Text
a} :: MediaStream)
mediaStream_fmt :: Lens.Lens' MediaStream Prelude.Int
mediaStream_fmt :: (Int -> f Int) -> MediaStream -> f MediaStream
mediaStream_fmt = (MediaStream -> Int)
-> (MediaStream -> Int -> MediaStream)
-> Lens MediaStream MediaStream Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaStream' {Int
fmt :: Int
$sel:fmt:MediaStream' :: MediaStream -> Int
fmt} -> Int
fmt) (\s :: MediaStream
s@MediaStream' {} Int
a -> MediaStream
s {$sel:fmt:MediaStream' :: Int
fmt = Int
a} :: MediaStream)
instance Core.FromJSON MediaStream where
parseJSON :: Value -> Parser MediaStream
parseJSON =
String
-> (Object -> Parser MediaStream) -> Value -> Parser MediaStream
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MediaStream"
( \Object
x ->
Maybe Text
-> Maybe MediaStreamAttributes
-> Maybe Int
-> Maybe Text
-> MediaStreamType
-> Int
-> Text
-> Int
-> MediaStream
MediaStream'
(Maybe Text
-> Maybe MediaStreamAttributes
-> Maybe Int
-> Maybe Text
-> MediaStreamType
-> Int
-> Text
-> Int
-> MediaStream)
-> Parser (Maybe Text)
-> Parser
(Maybe MediaStreamAttributes
-> Maybe Int
-> Maybe Text
-> MediaStreamType
-> Int
-> Text
-> Int
-> MediaStream)
forall (f :: * -> *) a b. Functor 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
"videoFormat")
Parser
(Maybe MediaStreamAttributes
-> Maybe Int
-> Maybe Text
-> MediaStreamType
-> Int
-> Text
-> Int
-> MediaStream)
-> Parser (Maybe MediaStreamAttributes)
-> Parser
(Maybe Int
-> Maybe Text
-> MediaStreamType
-> Int
-> Text
-> Int
-> MediaStream)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MediaStreamAttributes)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"attributes")
Parser
(Maybe Int
-> Maybe Text
-> MediaStreamType
-> Int
-> Text
-> Int
-> MediaStream)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> MediaStreamType -> Int -> Text -> Int -> MediaStream)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"clockRate")
Parser
(Maybe Text
-> MediaStreamType -> Int -> Text -> Int -> MediaStream)
-> Parser (Maybe Text)
-> Parser (MediaStreamType -> Int -> Text -> Int -> MediaStream)
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
"description")
Parser (MediaStreamType -> Int -> Text -> Int -> MediaStream)
-> Parser MediaStreamType
-> Parser (Int -> Text -> Int -> MediaStream)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser MediaStreamType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"mediaStreamType")
Parser (Int -> Text -> Int -> MediaStream)
-> Parser Int -> Parser (Text -> Int -> MediaStream)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"mediaStreamId")
Parser (Text -> Int -> MediaStream)
-> Parser Text -> Parser (Int -> MediaStream)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"mediaStreamName")
Parser (Int -> MediaStream) -> Parser Int -> Parser MediaStream
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"fmt")
)
instance Prelude.Hashable MediaStream
instance Prelude.NFData MediaStream