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