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