{-# 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.MediaConvert.Types.Mp2Settings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Mp2Settings = Mp2Settings'
{
Mp2Settings -> Maybe Natural
channels :: Prelude.Maybe Prelude.Natural,
Mp2Settings -> Maybe Natural
sampleRate :: Prelude.Maybe Prelude.Natural,
Mp2Settings -> Maybe Natural
bitrate :: Prelude.Maybe Prelude.Natural
}
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 Natural -> Maybe Natural -> Maybe Natural -> Mp2Settings
Mp2Settings'
{ $sel:channels:Mp2Settings' :: Maybe Natural
channels = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:sampleRate:Mp2Settings' :: Maybe Natural
sampleRate = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:bitrate:Mp2Settings' :: Maybe Natural
bitrate = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
mp2Settings_channels :: Lens.Lens' Mp2Settings (Prelude.Maybe Prelude.Natural)
mp2Settings_channels :: (Maybe Natural -> f (Maybe Natural))
-> Mp2Settings -> f Mp2Settings
mp2Settings_channels = (Mp2Settings -> Maybe Natural)
-> (Mp2Settings -> Maybe Natural -> Mp2Settings)
-> Lens Mp2Settings Mp2Settings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mp2Settings' {Maybe Natural
channels :: Maybe Natural
$sel:channels:Mp2Settings' :: Mp2Settings -> Maybe Natural
channels} -> Maybe Natural
channels) (\s :: Mp2Settings
s@Mp2Settings' {} Maybe Natural
a -> Mp2Settings
s {$sel:channels:Mp2Settings' :: Maybe Natural
channels = Maybe Natural
a} :: Mp2Settings)
mp2Settings_sampleRate :: Lens.Lens' Mp2Settings (Prelude.Maybe Prelude.Natural)
mp2Settings_sampleRate :: (Maybe Natural -> f (Maybe Natural))
-> Mp2Settings -> f Mp2Settings
mp2Settings_sampleRate = (Mp2Settings -> Maybe Natural)
-> (Mp2Settings -> Maybe Natural -> Mp2Settings)
-> Lens Mp2Settings Mp2Settings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mp2Settings' {Maybe Natural
sampleRate :: Maybe Natural
$sel:sampleRate:Mp2Settings' :: Mp2Settings -> Maybe Natural
sampleRate} -> Maybe Natural
sampleRate) (\s :: Mp2Settings
s@Mp2Settings' {} Maybe Natural
a -> Mp2Settings
s {$sel:sampleRate:Mp2Settings' :: Maybe Natural
sampleRate = Maybe Natural
a} :: Mp2Settings)
mp2Settings_bitrate :: Lens.Lens' Mp2Settings (Prelude.Maybe Prelude.Natural)
mp2Settings_bitrate :: (Maybe Natural -> f (Maybe Natural))
-> Mp2Settings -> f Mp2Settings
mp2Settings_bitrate = (Mp2Settings -> Maybe Natural)
-> (Mp2Settings -> Maybe Natural -> Mp2Settings)
-> Lens Mp2Settings Mp2Settings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mp2Settings' {Maybe Natural
bitrate :: Maybe Natural
$sel:bitrate:Mp2Settings' :: Mp2Settings -> Maybe Natural
bitrate} -> Maybe Natural
bitrate) (\s :: Mp2Settings
s@Mp2Settings' {} Maybe Natural
a -> Mp2Settings
s {$sel:bitrate:Mp2Settings' :: Maybe Natural
bitrate = Maybe Natural
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 Natural -> Maybe Natural -> Maybe Natural -> Mp2Settings
Mp2Settings'
(Maybe Natural -> Maybe Natural -> Maybe Natural -> Mp2Settings)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> Maybe Natural -> Mp2Settings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"channels")
Parser (Maybe Natural -> Maybe Natural -> Mp2Settings)
-> Parser (Maybe Natural) -> Parser (Maybe Natural -> Mp2Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sampleRate")
Parser (Maybe Natural -> Mp2Settings)
-> Parser (Maybe Natural) -> Parser Mp2Settings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
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 Natural
bitrate :: Maybe Natural
sampleRate :: Maybe Natural
channels :: Maybe Natural
$sel:bitrate:Mp2Settings' :: Mp2Settings -> Maybe Natural
$sel:sampleRate:Mp2Settings' :: Mp2Settings -> Maybe Natural
$sel:channels:Mp2Settings' :: Mp2Settings -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"channels" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
channels,
(Text
"sampleRate" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
sampleRate,
(Text
"bitrate" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
bitrate
]
)