{-# 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.MediaLive.Types.MultiplexProgramSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.MultiplexProgramServiceDescriptor
import Amazonka.MediaLive.Types.MultiplexVideoSettings
import Amazonka.MediaLive.Types.PreferredChannelPipeline
import qualified Amazonka.Prelude as Prelude
data MultiplexProgramSettings = MultiplexProgramSettings'
{
MultiplexProgramSettings -> Maybe PreferredChannelPipeline
preferredChannelPipeline :: Prelude.Maybe PreferredChannelPipeline,
MultiplexProgramSettings -> Maybe MultiplexVideoSettings
videoSettings :: Prelude.Maybe MultiplexVideoSettings,
MultiplexProgramSettings -> Maybe MultiplexProgramServiceDescriptor
serviceDescriptor :: Prelude.Maybe MultiplexProgramServiceDescriptor,
MultiplexProgramSettings -> Natural
programNumber :: Prelude.Natural
}
deriving (MultiplexProgramSettings -> MultiplexProgramSettings -> Bool
(MultiplexProgramSettings -> MultiplexProgramSettings -> Bool)
-> (MultiplexProgramSettings -> MultiplexProgramSettings -> Bool)
-> Eq MultiplexProgramSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MultiplexProgramSettings -> MultiplexProgramSettings -> Bool
$c/= :: MultiplexProgramSettings -> MultiplexProgramSettings -> Bool
== :: MultiplexProgramSettings -> MultiplexProgramSettings -> Bool
$c== :: MultiplexProgramSettings -> MultiplexProgramSettings -> Bool
Prelude.Eq, ReadPrec [MultiplexProgramSettings]
ReadPrec MultiplexProgramSettings
Int -> ReadS MultiplexProgramSettings
ReadS [MultiplexProgramSettings]
(Int -> ReadS MultiplexProgramSettings)
-> ReadS [MultiplexProgramSettings]
-> ReadPrec MultiplexProgramSettings
-> ReadPrec [MultiplexProgramSettings]
-> Read MultiplexProgramSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MultiplexProgramSettings]
$creadListPrec :: ReadPrec [MultiplexProgramSettings]
readPrec :: ReadPrec MultiplexProgramSettings
$creadPrec :: ReadPrec MultiplexProgramSettings
readList :: ReadS [MultiplexProgramSettings]
$creadList :: ReadS [MultiplexProgramSettings]
readsPrec :: Int -> ReadS MultiplexProgramSettings
$creadsPrec :: Int -> ReadS MultiplexProgramSettings
Prelude.Read, Int -> MultiplexProgramSettings -> ShowS
[MultiplexProgramSettings] -> ShowS
MultiplexProgramSettings -> String
(Int -> MultiplexProgramSettings -> ShowS)
-> (MultiplexProgramSettings -> String)
-> ([MultiplexProgramSettings] -> ShowS)
-> Show MultiplexProgramSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MultiplexProgramSettings] -> ShowS
$cshowList :: [MultiplexProgramSettings] -> ShowS
show :: MultiplexProgramSettings -> String
$cshow :: MultiplexProgramSettings -> String
showsPrec :: Int -> MultiplexProgramSettings -> ShowS
$cshowsPrec :: Int -> MultiplexProgramSettings -> ShowS
Prelude.Show, (forall x.
MultiplexProgramSettings -> Rep MultiplexProgramSettings x)
-> (forall x.
Rep MultiplexProgramSettings x -> MultiplexProgramSettings)
-> Generic MultiplexProgramSettings
forall x.
Rep MultiplexProgramSettings x -> MultiplexProgramSettings
forall x.
MultiplexProgramSettings -> Rep MultiplexProgramSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MultiplexProgramSettings x -> MultiplexProgramSettings
$cfrom :: forall x.
MultiplexProgramSettings -> Rep MultiplexProgramSettings x
Prelude.Generic)
newMultiplexProgramSettings ::
Prelude.Natural ->
MultiplexProgramSettings
newMultiplexProgramSettings :: Natural -> MultiplexProgramSettings
newMultiplexProgramSettings Natural
pProgramNumber_ =
MultiplexProgramSettings' :: Maybe PreferredChannelPipeline
-> Maybe MultiplexVideoSettings
-> Maybe MultiplexProgramServiceDescriptor
-> Natural
-> MultiplexProgramSettings
MultiplexProgramSettings'
{ $sel:preferredChannelPipeline:MultiplexProgramSettings' :: Maybe PreferredChannelPipeline
preferredChannelPipeline =
Maybe PreferredChannelPipeline
forall a. Maybe a
Prelude.Nothing,
$sel:videoSettings:MultiplexProgramSettings' :: Maybe MultiplexVideoSettings
videoSettings = Maybe MultiplexVideoSettings
forall a. Maybe a
Prelude.Nothing,
$sel:serviceDescriptor:MultiplexProgramSettings' :: Maybe MultiplexProgramServiceDescriptor
serviceDescriptor = Maybe MultiplexProgramServiceDescriptor
forall a. Maybe a
Prelude.Nothing,
$sel:programNumber:MultiplexProgramSettings' :: Natural
programNumber = Natural
pProgramNumber_
}
multiplexProgramSettings_preferredChannelPipeline :: Lens.Lens' MultiplexProgramSettings (Prelude.Maybe PreferredChannelPipeline)
multiplexProgramSettings_preferredChannelPipeline :: (Maybe PreferredChannelPipeline
-> f (Maybe PreferredChannelPipeline))
-> MultiplexProgramSettings -> f MultiplexProgramSettings
multiplexProgramSettings_preferredChannelPipeline = (MultiplexProgramSettings -> Maybe PreferredChannelPipeline)
-> (MultiplexProgramSettings
-> Maybe PreferredChannelPipeline -> MultiplexProgramSettings)
-> Lens
MultiplexProgramSettings
MultiplexProgramSettings
(Maybe PreferredChannelPipeline)
(Maybe PreferredChannelPipeline)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiplexProgramSettings' {Maybe PreferredChannelPipeline
preferredChannelPipeline :: Maybe PreferredChannelPipeline
$sel:preferredChannelPipeline:MultiplexProgramSettings' :: MultiplexProgramSettings -> Maybe PreferredChannelPipeline
preferredChannelPipeline} -> Maybe PreferredChannelPipeline
preferredChannelPipeline) (\s :: MultiplexProgramSettings
s@MultiplexProgramSettings' {} Maybe PreferredChannelPipeline
a -> MultiplexProgramSettings
s {$sel:preferredChannelPipeline:MultiplexProgramSettings' :: Maybe PreferredChannelPipeline
preferredChannelPipeline = Maybe PreferredChannelPipeline
a} :: MultiplexProgramSettings)
multiplexProgramSettings_videoSettings :: Lens.Lens' MultiplexProgramSettings (Prelude.Maybe MultiplexVideoSettings)
multiplexProgramSettings_videoSettings :: (Maybe MultiplexVideoSettings -> f (Maybe MultiplexVideoSettings))
-> MultiplexProgramSettings -> f MultiplexProgramSettings
multiplexProgramSettings_videoSettings = (MultiplexProgramSettings -> Maybe MultiplexVideoSettings)
-> (MultiplexProgramSettings
-> Maybe MultiplexVideoSettings -> MultiplexProgramSettings)
-> Lens
MultiplexProgramSettings
MultiplexProgramSettings
(Maybe MultiplexVideoSettings)
(Maybe MultiplexVideoSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiplexProgramSettings' {Maybe MultiplexVideoSettings
videoSettings :: Maybe MultiplexVideoSettings
$sel:videoSettings:MultiplexProgramSettings' :: MultiplexProgramSettings -> Maybe MultiplexVideoSettings
videoSettings} -> Maybe MultiplexVideoSettings
videoSettings) (\s :: MultiplexProgramSettings
s@MultiplexProgramSettings' {} Maybe MultiplexVideoSettings
a -> MultiplexProgramSettings
s {$sel:videoSettings:MultiplexProgramSettings' :: Maybe MultiplexVideoSettings
videoSettings = Maybe MultiplexVideoSettings
a} :: MultiplexProgramSettings)
multiplexProgramSettings_serviceDescriptor :: Lens.Lens' MultiplexProgramSettings (Prelude.Maybe MultiplexProgramServiceDescriptor)
multiplexProgramSettings_serviceDescriptor :: (Maybe MultiplexProgramServiceDescriptor
-> f (Maybe MultiplexProgramServiceDescriptor))
-> MultiplexProgramSettings -> f MultiplexProgramSettings
multiplexProgramSettings_serviceDescriptor = (MultiplexProgramSettings
-> Maybe MultiplexProgramServiceDescriptor)
-> (MultiplexProgramSettings
-> Maybe MultiplexProgramServiceDescriptor
-> MultiplexProgramSettings)
-> Lens
MultiplexProgramSettings
MultiplexProgramSettings
(Maybe MultiplexProgramServiceDescriptor)
(Maybe MultiplexProgramServiceDescriptor)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiplexProgramSettings' {Maybe MultiplexProgramServiceDescriptor
serviceDescriptor :: Maybe MultiplexProgramServiceDescriptor
$sel:serviceDescriptor:MultiplexProgramSettings' :: MultiplexProgramSettings -> Maybe MultiplexProgramServiceDescriptor
serviceDescriptor} -> Maybe MultiplexProgramServiceDescriptor
serviceDescriptor) (\s :: MultiplexProgramSettings
s@MultiplexProgramSettings' {} Maybe MultiplexProgramServiceDescriptor
a -> MultiplexProgramSettings
s {$sel:serviceDescriptor:MultiplexProgramSettings' :: Maybe MultiplexProgramServiceDescriptor
serviceDescriptor = Maybe MultiplexProgramServiceDescriptor
a} :: MultiplexProgramSettings)
multiplexProgramSettings_programNumber :: Lens.Lens' MultiplexProgramSettings Prelude.Natural
multiplexProgramSettings_programNumber :: (Natural -> f Natural)
-> MultiplexProgramSettings -> f MultiplexProgramSettings
multiplexProgramSettings_programNumber = (MultiplexProgramSettings -> Natural)
-> (MultiplexProgramSettings
-> Natural -> MultiplexProgramSettings)
-> Lens
MultiplexProgramSettings MultiplexProgramSettings Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiplexProgramSettings' {Natural
programNumber :: Natural
$sel:programNumber:MultiplexProgramSettings' :: MultiplexProgramSettings -> Natural
programNumber} -> Natural
programNumber) (\s :: MultiplexProgramSettings
s@MultiplexProgramSettings' {} Natural
a -> MultiplexProgramSettings
s {$sel:programNumber:MultiplexProgramSettings' :: Natural
programNumber = Natural
a} :: MultiplexProgramSettings)
instance Core.FromJSON MultiplexProgramSettings where
parseJSON :: Value -> Parser MultiplexProgramSettings
parseJSON =
String
-> (Object -> Parser MultiplexProgramSettings)
-> Value
-> Parser MultiplexProgramSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MultiplexProgramSettings"
( \Object
x ->
Maybe PreferredChannelPipeline
-> Maybe MultiplexVideoSettings
-> Maybe MultiplexProgramServiceDescriptor
-> Natural
-> MultiplexProgramSettings
MultiplexProgramSettings'
(Maybe PreferredChannelPipeline
-> Maybe MultiplexVideoSettings
-> Maybe MultiplexProgramServiceDescriptor
-> Natural
-> MultiplexProgramSettings)
-> Parser (Maybe PreferredChannelPipeline)
-> Parser
(Maybe MultiplexVideoSettings
-> Maybe MultiplexProgramServiceDescriptor
-> Natural
-> MultiplexProgramSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe PreferredChannelPipeline)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"preferredChannelPipeline")
Parser
(Maybe MultiplexVideoSettings
-> Maybe MultiplexProgramServiceDescriptor
-> Natural
-> MultiplexProgramSettings)
-> Parser (Maybe MultiplexVideoSettings)
-> Parser
(Maybe MultiplexProgramServiceDescriptor
-> Natural -> MultiplexProgramSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MultiplexVideoSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"videoSettings")
Parser
(Maybe MultiplexProgramServiceDescriptor
-> Natural -> MultiplexProgramSettings)
-> Parser (Maybe MultiplexProgramServiceDescriptor)
-> Parser (Natural -> MultiplexProgramSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MultiplexProgramServiceDescriptor)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"serviceDescriptor")
Parser (Natural -> MultiplexProgramSettings)
-> Parser Natural -> Parser MultiplexProgramSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"programNumber")
)
instance Prelude.Hashable MultiplexProgramSettings
instance Prelude.NFData MultiplexProgramSettings
instance Core.ToJSON MultiplexProgramSettings where
toJSON :: MultiplexProgramSettings -> Value
toJSON MultiplexProgramSettings' {Natural
Maybe MultiplexProgramServiceDescriptor
Maybe MultiplexVideoSettings
Maybe PreferredChannelPipeline
programNumber :: Natural
serviceDescriptor :: Maybe MultiplexProgramServiceDescriptor
videoSettings :: Maybe MultiplexVideoSettings
preferredChannelPipeline :: Maybe PreferredChannelPipeline
$sel:programNumber:MultiplexProgramSettings' :: MultiplexProgramSettings -> Natural
$sel:serviceDescriptor:MultiplexProgramSettings' :: MultiplexProgramSettings -> Maybe MultiplexProgramServiceDescriptor
$sel:videoSettings:MultiplexProgramSettings' :: MultiplexProgramSettings -> Maybe MultiplexVideoSettings
$sel:preferredChannelPipeline:MultiplexProgramSettings' :: MultiplexProgramSettings -> Maybe PreferredChannelPipeline
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"preferredChannelPipeline" Text -> PreferredChannelPipeline -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(PreferredChannelPipeline -> Pair)
-> Maybe PreferredChannelPipeline -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PreferredChannelPipeline
preferredChannelPipeline,
(Text
"videoSettings" Text -> MultiplexVideoSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MultiplexVideoSettings -> Pair)
-> Maybe MultiplexVideoSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MultiplexVideoSettings
videoSettings,
(Text
"serviceDescriptor" Text -> MultiplexProgramServiceDescriptor -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(MultiplexProgramServiceDescriptor -> Pair)
-> Maybe MultiplexProgramServiceDescriptor -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MultiplexProgramServiceDescriptor
serviceDescriptor,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"programNumber" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
programNumber)
]
)