{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:channels:VorbisSettings' :: Maybe Natural
channels = forall a. Maybe a
Prelude.Nothing,
$sel:sampleRate:VorbisSettings' :: Maybe Natural
sampleRate = forall a. Maybe a
Prelude.Nothing,
$sel:vbrQuality:VorbisSettings' :: Maybe Int
vbrQuality = forall a. Maybe a
Prelude.Nothing
}
vorbisSettings_channels :: Lens.Lens' VorbisSettings (Prelude.Maybe Prelude.Natural)
vorbisSettings_channels :: Lens' VorbisSettings (Maybe Natural)
vorbisSettings_channels = 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 :: Lens' VorbisSettings (Maybe Natural)
vorbisSettings_sampleRate = 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 :: Lens' VorbisSettings (Maybe Int)
vorbisSettings_vbrQuality = 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 Data.FromJSON VorbisSettings where
parseJSON :: Value -> Parser VorbisSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"VorbisSettings"
( \Object
x ->
Maybe Natural -> Maybe Natural -> Maybe Int -> VorbisSettings
VorbisSettings'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"channels")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"sampleRate")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"vbrQuality")
)
instance Prelude.Hashable VorbisSettings where
hashWithSalt :: Int -> VorbisSettings -> Int
hashWithSalt Int
_salt 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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
channels
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
sampleRate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
vbrQuality
instance Prelude.NFData VorbisSettings where
rnf :: VorbisSettings -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
channels
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
sampleRate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
vbrQuality
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"channels" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
channels,
(Key
"sampleRate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
sampleRate,
(Key
"vbrQuality" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
vbrQuality
]
)