{-# 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.Mp2Settings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.Mp2CodingMode
import qualified Amazonka.Prelude as Prelude
data Mp2Settings = Mp2Settings'
{
Mp2Settings -> Maybe Mp2CodingMode
codingMode :: Prelude.Maybe Mp2CodingMode,
Mp2Settings -> Maybe Double
sampleRate :: Prelude.Maybe Prelude.Double,
Mp2Settings -> Maybe Double
bitrate :: Prelude.Maybe Prelude.Double
}
deriving (Mp2Settings -> Mp2Settings -> Bool
(Mp2Settings -> Mp2Settings -> Bool)
-> (Mp2Settings -> Mp2Settings -> Bool) -> Eq Mp2Settings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Mp2Settings -> Mp2Settings -> Bool
$c/= :: Mp2Settings -> Mp2Settings -> Bool
== :: Mp2Settings -> Mp2Settings -> Bool
$c== :: Mp2Settings -> Mp2Settings -> Bool
Prelude.Eq, ReadPrec [Mp2Settings]
ReadPrec Mp2Settings
Int -> ReadS Mp2Settings
ReadS [Mp2Settings]
(Int -> ReadS Mp2Settings)
-> ReadS [Mp2Settings]
-> ReadPrec Mp2Settings
-> ReadPrec [Mp2Settings]
-> Read Mp2Settings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Mp2Settings]
$creadListPrec :: ReadPrec [Mp2Settings]
readPrec :: ReadPrec Mp2Settings
$creadPrec :: ReadPrec Mp2Settings
readList :: ReadS [Mp2Settings]
$creadList :: ReadS [Mp2Settings]
readsPrec :: Int -> ReadS Mp2Settings
$creadsPrec :: Int -> ReadS Mp2Settings
Prelude.Read, Int -> Mp2Settings -> ShowS
[Mp2Settings] -> ShowS
Mp2Settings -> String
(Int -> Mp2Settings -> ShowS)
-> (Mp2Settings -> String)
-> ([Mp2Settings] -> ShowS)
-> Show Mp2Settings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Mp2Settings] -> ShowS
$cshowList :: [Mp2Settings] -> ShowS
show :: Mp2Settings -> String
$cshow :: Mp2Settings -> String
showsPrec :: Int -> Mp2Settings -> ShowS
$cshowsPrec :: Int -> Mp2Settings -> ShowS
Prelude.Show, (forall x. Mp2Settings -> Rep Mp2Settings x)
-> (forall x. Rep Mp2Settings x -> Mp2Settings)
-> Generic Mp2Settings
forall x. Rep Mp2Settings x -> Mp2Settings
forall x. Mp2Settings -> Rep Mp2Settings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Mp2Settings x -> Mp2Settings
$cfrom :: forall x. Mp2Settings -> Rep Mp2Settings x
Prelude.Generic)
newMp2Settings ::
Mp2Settings
newMp2Settings :: Mp2Settings
newMp2Settings =
Mp2Settings' :: Maybe Mp2CodingMode -> Maybe Double -> Maybe Double -> Mp2Settings
Mp2Settings'
{ $sel:codingMode:Mp2Settings' :: Maybe Mp2CodingMode
codingMode = Maybe Mp2CodingMode
forall a. Maybe a
Prelude.Nothing,
$sel:sampleRate:Mp2Settings' :: Maybe Double
sampleRate = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:bitrate:Mp2Settings' :: Maybe Double
bitrate = Maybe Double
forall a. Maybe a
Prelude.Nothing
}
mp2Settings_codingMode :: Lens.Lens' Mp2Settings (Prelude.Maybe Mp2CodingMode)
mp2Settings_codingMode :: (Maybe Mp2CodingMode -> f (Maybe Mp2CodingMode))
-> Mp2Settings -> f Mp2Settings
mp2Settings_codingMode = (Mp2Settings -> Maybe Mp2CodingMode)
-> (Mp2Settings -> Maybe Mp2CodingMode -> Mp2Settings)
-> Lens
Mp2Settings Mp2Settings (Maybe Mp2CodingMode) (Maybe Mp2CodingMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mp2Settings' {Maybe Mp2CodingMode
codingMode :: Maybe Mp2CodingMode
$sel:codingMode:Mp2Settings' :: Mp2Settings -> Maybe Mp2CodingMode
codingMode} -> Maybe Mp2CodingMode
codingMode) (\s :: Mp2Settings
s@Mp2Settings' {} Maybe Mp2CodingMode
a -> Mp2Settings
s {$sel:codingMode:Mp2Settings' :: Maybe Mp2CodingMode
codingMode = Maybe Mp2CodingMode
a} :: Mp2Settings)
mp2Settings_sampleRate :: Lens.Lens' Mp2Settings (Prelude.Maybe Prelude.Double)
mp2Settings_sampleRate :: (Maybe Double -> f (Maybe Double)) -> Mp2Settings -> f Mp2Settings
mp2Settings_sampleRate = (Mp2Settings -> Maybe Double)
-> (Mp2Settings -> Maybe Double -> Mp2Settings)
-> Lens Mp2Settings Mp2Settings (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mp2Settings' {Maybe Double
sampleRate :: Maybe Double
$sel:sampleRate:Mp2Settings' :: Mp2Settings -> Maybe Double
sampleRate} -> Maybe Double
sampleRate) (\s :: Mp2Settings
s@Mp2Settings' {} Maybe Double
a -> Mp2Settings
s {$sel:sampleRate:Mp2Settings' :: Maybe Double
sampleRate = Maybe Double
a} :: Mp2Settings)
mp2Settings_bitrate :: Lens.Lens' Mp2Settings (Prelude.Maybe Prelude.Double)
mp2Settings_bitrate :: (Maybe Double -> f (Maybe Double)) -> Mp2Settings -> f Mp2Settings
mp2Settings_bitrate = (Mp2Settings -> Maybe Double)
-> (Mp2Settings -> Maybe Double -> Mp2Settings)
-> Lens Mp2Settings Mp2Settings (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mp2Settings' {Maybe Double
bitrate :: Maybe Double
$sel:bitrate:Mp2Settings' :: Mp2Settings -> Maybe Double
bitrate} -> Maybe Double
bitrate) (\s :: Mp2Settings
s@Mp2Settings' {} Maybe Double
a -> Mp2Settings
s {$sel:bitrate:Mp2Settings' :: Maybe Double
bitrate = Maybe Double
a} :: Mp2Settings)
instance Core.FromJSON Mp2Settings where
parseJSON :: Value -> Parser Mp2Settings
parseJSON =
String
-> (Object -> Parser Mp2Settings) -> Value -> Parser Mp2Settings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Mp2Settings"
( \Object
x ->
Maybe Mp2CodingMode -> Maybe Double -> Maybe Double -> Mp2Settings
Mp2Settings'
(Maybe Mp2CodingMode
-> Maybe Double -> Maybe Double -> Mp2Settings)
-> Parser (Maybe Mp2CodingMode)
-> Parser (Maybe Double -> Maybe Double -> Mp2Settings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Mp2CodingMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"codingMode")
Parser (Maybe Double -> Maybe Double -> Mp2Settings)
-> Parser (Maybe Double) -> Parser (Maybe Double -> Mp2Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sampleRate")
Parser (Maybe Double -> Mp2Settings)
-> Parser (Maybe Double) -> Parser Mp2Settings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"bitrate")
)
instance Prelude.Hashable Mp2Settings
instance Prelude.NFData Mp2Settings
instance Core.ToJSON Mp2Settings where
toJSON :: Mp2Settings -> Value
toJSON Mp2Settings' {Maybe Double
Maybe Mp2CodingMode
bitrate :: Maybe Double
sampleRate :: Maybe Double
codingMode :: Maybe Mp2CodingMode
$sel:bitrate:Mp2Settings' :: Mp2Settings -> Maybe Double
$sel:sampleRate:Mp2Settings' :: Mp2Settings -> Maybe Double
$sel:codingMode:Mp2Settings' :: Mp2Settings -> Maybe Mp2CodingMode
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"codingMode" Text -> Mp2CodingMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Mp2CodingMode -> Pair) -> Maybe Mp2CodingMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Mp2CodingMode
codingMode,
(Text
"sampleRate" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
sampleRate,
(Text
"bitrate" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
bitrate
]
)