{-# 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.AddMediaStreamRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types.MediaStreamAttributesRequest
import Amazonka.MediaConnect.Types.MediaStreamType
import qualified Amazonka.Prelude as Prelude
data AddMediaStreamRequest = AddMediaStreamRequest'
{
AddMediaStreamRequest -> Maybe Text
videoFormat :: Prelude.Maybe Prelude.Text,
AddMediaStreamRequest -> Maybe MediaStreamAttributesRequest
attributes :: Prelude.Maybe MediaStreamAttributesRequest,
AddMediaStreamRequest -> Maybe Int
clockRate :: Prelude.Maybe Prelude.Int,
AddMediaStreamRequest -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
AddMediaStreamRequest -> MediaStreamType
mediaStreamType :: MediaStreamType,
AddMediaStreamRequest -> Int
mediaStreamId :: Prelude.Int,
AddMediaStreamRequest -> Text
mediaStreamName :: Prelude.Text
}
deriving (AddMediaStreamRequest -> AddMediaStreamRequest -> Bool
(AddMediaStreamRequest -> AddMediaStreamRequest -> Bool)
-> (AddMediaStreamRequest -> AddMediaStreamRequest -> Bool)
-> Eq AddMediaStreamRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddMediaStreamRequest -> AddMediaStreamRequest -> Bool
$c/= :: AddMediaStreamRequest -> AddMediaStreamRequest -> Bool
== :: AddMediaStreamRequest -> AddMediaStreamRequest -> Bool
$c== :: AddMediaStreamRequest -> AddMediaStreamRequest -> Bool
Prelude.Eq, ReadPrec [AddMediaStreamRequest]
ReadPrec AddMediaStreamRequest
Int -> ReadS AddMediaStreamRequest
ReadS [AddMediaStreamRequest]
(Int -> ReadS AddMediaStreamRequest)
-> ReadS [AddMediaStreamRequest]
-> ReadPrec AddMediaStreamRequest
-> ReadPrec [AddMediaStreamRequest]
-> Read AddMediaStreamRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddMediaStreamRequest]
$creadListPrec :: ReadPrec [AddMediaStreamRequest]
readPrec :: ReadPrec AddMediaStreamRequest
$creadPrec :: ReadPrec AddMediaStreamRequest
readList :: ReadS [AddMediaStreamRequest]
$creadList :: ReadS [AddMediaStreamRequest]
readsPrec :: Int -> ReadS AddMediaStreamRequest
$creadsPrec :: Int -> ReadS AddMediaStreamRequest
Prelude.Read, Int -> AddMediaStreamRequest -> ShowS
[AddMediaStreamRequest] -> ShowS
AddMediaStreamRequest -> String
(Int -> AddMediaStreamRequest -> ShowS)
-> (AddMediaStreamRequest -> String)
-> ([AddMediaStreamRequest] -> ShowS)
-> Show AddMediaStreamRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddMediaStreamRequest] -> ShowS
$cshowList :: [AddMediaStreamRequest] -> ShowS
show :: AddMediaStreamRequest -> String
$cshow :: AddMediaStreamRequest -> String
showsPrec :: Int -> AddMediaStreamRequest -> ShowS
$cshowsPrec :: Int -> AddMediaStreamRequest -> ShowS
Prelude.Show, (forall x. AddMediaStreamRequest -> Rep AddMediaStreamRequest x)
-> (forall x. Rep AddMediaStreamRequest x -> AddMediaStreamRequest)
-> Generic AddMediaStreamRequest
forall x. Rep AddMediaStreamRequest x -> AddMediaStreamRequest
forall x. AddMediaStreamRequest -> Rep AddMediaStreamRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddMediaStreamRequest x -> AddMediaStreamRequest
$cfrom :: forall x. AddMediaStreamRequest -> Rep AddMediaStreamRequest x
Prelude.Generic)
newAddMediaStreamRequest ::
MediaStreamType ->
Prelude.Int ->
Prelude.Text ->
AddMediaStreamRequest
newAddMediaStreamRequest :: MediaStreamType -> Int -> Text -> AddMediaStreamRequest
newAddMediaStreamRequest
MediaStreamType
pMediaStreamType_
Int
pMediaStreamId_
Text
pMediaStreamName_ =
AddMediaStreamRequest' :: Maybe Text
-> Maybe MediaStreamAttributesRequest
-> Maybe Int
-> Maybe Text
-> MediaStreamType
-> Int
-> Text
-> AddMediaStreamRequest
AddMediaStreamRequest'
{ $sel:videoFormat:AddMediaStreamRequest' :: Maybe Text
videoFormat =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:attributes:AddMediaStreamRequest' :: Maybe MediaStreamAttributesRequest
attributes = Maybe MediaStreamAttributesRequest
forall a. Maybe a
Prelude.Nothing,
$sel:clockRate:AddMediaStreamRequest' :: Maybe Int
clockRate = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:description:AddMediaStreamRequest' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:mediaStreamType:AddMediaStreamRequest' :: MediaStreamType
mediaStreamType = MediaStreamType
pMediaStreamType_,
$sel:mediaStreamId:AddMediaStreamRequest' :: Int
mediaStreamId = Int
pMediaStreamId_,
$sel:mediaStreamName:AddMediaStreamRequest' :: Text
mediaStreamName = Text
pMediaStreamName_
}
addMediaStreamRequest_videoFormat :: Lens.Lens' AddMediaStreamRequest (Prelude.Maybe Prelude.Text)
addMediaStreamRequest_videoFormat :: (Maybe Text -> f (Maybe Text))
-> AddMediaStreamRequest -> f AddMediaStreamRequest
addMediaStreamRequest_videoFormat = (AddMediaStreamRequest -> Maybe Text)
-> (AddMediaStreamRequest -> Maybe Text -> AddMediaStreamRequest)
-> Lens
AddMediaStreamRequest
AddMediaStreamRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddMediaStreamRequest' {Maybe Text
videoFormat :: Maybe Text
$sel:videoFormat:AddMediaStreamRequest' :: AddMediaStreamRequest -> Maybe Text
videoFormat} -> Maybe Text
videoFormat) (\s :: AddMediaStreamRequest
s@AddMediaStreamRequest' {} Maybe Text
a -> AddMediaStreamRequest
s {$sel:videoFormat:AddMediaStreamRequest' :: Maybe Text
videoFormat = Maybe Text
a} :: AddMediaStreamRequest)
addMediaStreamRequest_attributes :: Lens.Lens' AddMediaStreamRequest (Prelude.Maybe MediaStreamAttributesRequest)
addMediaStreamRequest_attributes :: (Maybe MediaStreamAttributesRequest
-> f (Maybe MediaStreamAttributesRequest))
-> AddMediaStreamRequest -> f AddMediaStreamRequest
addMediaStreamRequest_attributes = (AddMediaStreamRequest -> Maybe MediaStreamAttributesRequest)
-> (AddMediaStreamRequest
-> Maybe MediaStreamAttributesRequest -> AddMediaStreamRequest)
-> Lens
AddMediaStreamRequest
AddMediaStreamRequest
(Maybe MediaStreamAttributesRequest)
(Maybe MediaStreamAttributesRequest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddMediaStreamRequest' {Maybe MediaStreamAttributesRequest
attributes :: Maybe MediaStreamAttributesRequest
$sel:attributes:AddMediaStreamRequest' :: AddMediaStreamRequest -> Maybe MediaStreamAttributesRequest
attributes} -> Maybe MediaStreamAttributesRequest
attributes) (\s :: AddMediaStreamRequest
s@AddMediaStreamRequest' {} Maybe MediaStreamAttributesRequest
a -> AddMediaStreamRequest
s {$sel:attributes:AddMediaStreamRequest' :: Maybe MediaStreamAttributesRequest
attributes = Maybe MediaStreamAttributesRequest
a} :: AddMediaStreamRequest)
addMediaStreamRequest_clockRate :: Lens.Lens' AddMediaStreamRequest (Prelude.Maybe Prelude.Int)
addMediaStreamRequest_clockRate :: (Maybe Int -> f (Maybe Int))
-> AddMediaStreamRequest -> f AddMediaStreamRequest
addMediaStreamRequest_clockRate = (AddMediaStreamRequest -> Maybe Int)
-> (AddMediaStreamRequest -> Maybe Int -> AddMediaStreamRequest)
-> Lens
AddMediaStreamRequest AddMediaStreamRequest (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddMediaStreamRequest' {Maybe Int
clockRate :: Maybe Int
$sel:clockRate:AddMediaStreamRequest' :: AddMediaStreamRequest -> Maybe Int
clockRate} -> Maybe Int
clockRate) (\s :: AddMediaStreamRequest
s@AddMediaStreamRequest' {} Maybe Int
a -> AddMediaStreamRequest
s {$sel:clockRate:AddMediaStreamRequest' :: Maybe Int
clockRate = Maybe Int
a} :: AddMediaStreamRequest)
addMediaStreamRequest_description :: Lens.Lens' AddMediaStreamRequest (Prelude.Maybe Prelude.Text)
addMediaStreamRequest_description :: (Maybe Text -> f (Maybe Text))
-> AddMediaStreamRequest -> f AddMediaStreamRequest
addMediaStreamRequest_description = (AddMediaStreamRequest -> Maybe Text)
-> (AddMediaStreamRequest -> Maybe Text -> AddMediaStreamRequest)
-> Lens
AddMediaStreamRequest
AddMediaStreamRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddMediaStreamRequest' {Maybe Text
description :: Maybe Text
$sel:description:AddMediaStreamRequest' :: AddMediaStreamRequest -> Maybe Text
description} -> Maybe Text
description) (\s :: AddMediaStreamRequest
s@AddMediaStreamRequest' {} Maybe Text
a -> AddMediaStreamRequest
s {$sel:description:AddMediaStreamRequest' :: Maybe Text
description = Maybe Text
a} :: AddMediaStreamRequest)
addMediaStreamRequest_mediaStreamType :: Lens.Lens' AddMediaStreamRequest MediaStreamType
addMediaStreamRequest_mediaStreamType :: (MediaStreamType -> f MediaStreamType)
-> AddMediaStreamRequest -> f AddMediaStreamRequest
addMediaStreamRequest_mediaStreamType = (AddMediaStreamRequest -> MediaStreamType)
-> (AddMediaStreamRequest
-> MediaStreamType -> AddMediaStreamRequest)
-> Lens
AddMediaStreamRequest
AddMediaStreamRequest
MediaStreamType
MediaStreamType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddMediaStreamRequest' {MediaStreamType
mediaStreamType :: MediaStreamType
$sel:mediaStreamType:AddMediaStreamRequest' :: AddMediaStreamRequest -> MediaStreamType
mediaStreamType} -> MediaStreamType
mediaStreamType) (\s :: AddMediaStreamRequest
s@AddMediaStreamRequest' {} MediaStreamType
a -> AddMediaStreamRequest
s {$sel:mediaStreamType:AddMediaStreamRequest' :: MediaStreamType
mediaStreamType = MediaStreamType
a} :: AddMediaStreamRequest)
addMediaStreamRequest_mediaStreamId :: Lens.Lens' AddMediaStreamRequest Prelude.Int
addMediaStreamRequest_mediaStreamId :: (Int -> f Int) -> AddMediaStreamRequest -> f AddMediaStreamRequest
addMediaStreamRequest_mediaStreamId = (AddMediaStreamRequest -> Int)
-> (AddMediaStreamRequest -> Int -> AddMediaStreamRequest)
-> Lens AddMediaStreamRequest AddMediaStreamRequest Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddMediaStreamRequest' {Int
mediaStreamId :: Int
$sel:mediaStreamId:AddMediaStreamRequest' :: AddMediaStreamRequest -> Int
mediaStreamId} -> Int
mediaStreamId) (\s :: AddMediaStreamRequest
s@AddMediaStreamRequest' {} Int
a -> AddMediaStreamRequest
s {$sel:mediaStreamId:AddMediaStreamRequest' :: Int
mediaStreamId = Int
a} :: AddMediaStreamRequest)
addMediaStreamRequest_mediaStreamName :: Lens.Lens' AddMediaStreamRequest Prelude.Text
addMediaStreamRequest_mediaStreamName :: (Text -> f Text)
-> AddMediaStreamRequest -> f AddMediaStreamRequest
addMediaStreamRequest_mediaStreamName = (AddMediaStreamRequest -> Text)
-> (AddMediaStreamRequest -> Text -> AddMediaStreamRequest)
-> Lens AddMediaStreamRequest AddMediaStreamRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddMediaStreamRequest' {Text
mediaStreamName :: Text
$sel:mediaStreamName:AddMediaStreamRequest' :: AddMediaStreamRequest -> Text
mediaStreamName} -> Text
mediaStreamName) (\s :: AddMediaStreamRequest
s@AddMediaStreamRequest' {} Text
a -> AddMediaStreamRequest
s {$sel:mediaStreamName:AddMediaStreamRequest' :: Text
mediaStreamName = Text
a} :: AddMediaStreamRequest)
instance Prelude.Hashable AddMediaStreamRequest
instance Prelude.NFData AddMediaStreamRequest
instance Core.ToJSON AddMediaStreamRequest where
toJSON :: AddMediaStreamRequest -> Value
toJSON AddMediaStreamRequest' {Int
Maybe Int
Maybe Text
Maybe MediaStreamAttributesRequest
Text
MediaStreamType
mediaStreamName :: Text
mediaStreamId :: Int
mediaStreamType :: MediaStreamType
description :: Maybe Text
clockRate :: Maybe Int
attributes :: Maybe MediaStreamAttributesRequest
videoFormat :: Maybe Text
$sel:mediaStreamName:AddMediaStreamRequest' :: AddMediaStreamRequest -> Text
$sel:mediaStreamId:AddMediaStreamRequest' :: AddMediaStreamRequest -> Int
$sel:mediaStreamType:AddMediaStreamRequest' :: AddMediaStreamRequest -> MediaStreamType
$sel:description:AddMediaStreamRequest' :: AddMediaStreamRequest -> Maybe Text
$sel:clockRate:AddMediaStreamRequest' :: AddMediaStreamRequest -> Maybe Int
$sel:attributes:AddMediaStreamRequest' :: AddMediaStreamRequest -> Maybe MediaStreamAttributesRequest
$sel:videoFormat:AddMediaStreamRequest' :: AddMediaStreamRequest -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"videoFormat" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
videoFormat,
(Text
"attributes" Text -> MediaStreamAttributesRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MediaStreamAttributesRequest -> Pair)
-> Maybe MediaStreamAttributesRequest -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MediaStreamAttributesRequest
attributes,
(Text
"clockRate" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
clockRate,
(Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"mediaStreamType" Text -> MediaStreamType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= MediaStreamType
mediaStreamType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"mediaStreamId" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
mediaStreamId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"mediaStreamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
mediaStreamName)
]
)