{-# 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.OpusSettings 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 OpusSettings = OpusSettings'
{
OpusSettings -> Maybe Natural
bitrate :: Prelude.Maybe Prelude.Natural,
OpusSettings -> Maybe Natural
channels :: Prelude.Maybe Prelude.Natural,
OpusSettings -> Maybe Natural
sampleRate :: Prelude.Maybe Prelude.Natural
}
deriving (OpusSettings -> OpusSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OpusSettings -> OpusSettings -> Bool
$c/= :: OpusSettings -> OpusSettings -> Bool
== :: OpusSettings -> OpusSettings -> Bool
$c== :: OpusSettings -> OpusSettings -> Bool
Prelude.Eq, ReadPrec [OpusSettings]
ReadPrec OpusSettings
Int -> ReadS OpusSettings
ReadS [OpusSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OpusSettings]
$creadListPrec :: ReadPrec [OpusSettings]
readPrec :: ReadPrec OpusSettings
$creadPrec :: ReadPrec OpusSettings
readList :: ReadS [OpusSettings]
$creadList :: ReadS [OpusSettings]
readsPrec :: Int -> ReadS OpusSettings
$creadsPrec :: Int -> ReadS OpusSettings
Prelude.Read, Int -> OpusSettings -> ShowS
[OpusSettings] -> ShowS
OpusSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OpusSettings] -> ShowS
$cshowList :: [OpusSettings] -> ShowS
show :: OpusSettings -> String
$cshow :: OpusSettings -> String
showsPrec :: Int -> OpusSettings -> ShowS
$cshowsPrec :: Int -> OpusSettings -> ShowS
Prelude.Show, forall x. Rep OpusSettings x -> OpusSettings
forall x. OpusSettings -> Rep OpusSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OpusSettings x -> OpusSettings
$cfrom :: forall x. OpusSettings -> Rep OpusSettings x
Prelude.Generic)
newOpusSettings ::
OpusSettings
newOpusSettings :: OpusSettings
newOpusSettings =
OpusSettings'
{ $sel:bitrate:OpusSettings' :: Maybe Natural
bitrate = forall a. Maybe a
Prelude.Nothing,
$sel:channels:OpusSettings' :: Maybe Natural
channels = forall a. Maybe a
Prelude.Nothing,
$sel:sampleRate:OpusSettings' :: Maybe Natural
sampleRate = forall a. Maybe a
Prelude.Nothing
}
opusSettings_bitrate :: Lens.Lens' OpusSettings (Prelude.Maybe Prelude.Natural)
opusSettings_bitrate :: Lens' OpusSettings (Maybe Natural)
opusSettings_bitrate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpusSettings' {Maybe Natural
bitrate :: Maybe Natural
$sel:bitrate:OpusSettings' :: OpusSettings -> Maybe Natural
bitrate} -> Maybe Natural
bitrate) (\s :: OpusSettings
s@OpusSettings' {} Maybe Natural
a -> OpusSettings
s {$sel:bitrate:OpusSettings' :: Maybe Natural
bitrate = Maybe Natural
a} :: OpusSettings)
opusSettings_channels :: Lens.Lens' OpusSettings (Prelude.Maybe Prelude.Natural)
opusSettings_channels :: Lens' OpusSettings (Maybe Natural)
opusSettings_channels = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpusSettings' {Maybe Natural
channels :: Maybe Natural
$sel:channels:OpusSettings' :: OpusSettings -> Maybe Natural
channels} -> Maybe Natural
channels) (\s :: OpusSettings
s@OpusSettings' {} Maybe Natural
a -> OpusSettings
s {$sel:channels:OpusSettings' :: Maybe Natural
channels = Maybe Natural
a} :: OpusSettings)
opusSettings_sampleRate :: Lens.Lens' OpusSettings (Prelude.Maybe Prelude.Natural)
opusSettings_sampleRate :: Lens' OpusSettings (Maybe Natural)
opusSettings_sampleRate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpusSettings' {Maybe Natural
sampleRate :: Maybe Natural
$sel:sampleRate:OpusSettings' :: OpusSettings -> Maybe Natural
sampleRate} -> Maybe Natural
sampleRate) (\s :: OpusSettings
s@OpusSettings' {} Maybe Natural
a -> OpusSettings
s {$sel:sampleRate:OpusSettings' :: Maybe Natural
sampleRate = Maybe Natural
a} :: OpusSettings)
instance Data.FromJSON OpusSettings where
parseJSON :: Value -> Parser OpusSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"OpusSettings"
( \Object
x ->
Maybe Natural -> Maybe Natural -> Maybe Natural -> OpusSettings
OpusSettings'
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
"bitrate")
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
"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")
)
instance Prelude.Hashable OpusSettings where
hashWithSalt :: Int -> OpusSettings -> Int
hashWithSalt Int
_salt OpusSettings' {Maybe Natural
sampleRate :: Maybe Natural
channels :: Maybe Natural
bitrate :: Maybe Natural
$sel:sampleRate:OpusSettings' :: OpusSettings -> Maybe Natural
$sel:channels:OpusSettings' :: OpusSettings -> Maybe Natural
$sel:bitrate:OpusSettings' :: OpusSettings -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
bitrate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
channels
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
sampleRate
instance Prelude.NFData OpusSettings where
rnf :: OpusSettings -> ()
rnf OpusSettings' {Maybe Natural
sampleRate :: Maybe Natural
channels :: Maybe Natural
bitrate :: Maybe Natural
$sel:sampleRate:OpusSettings' :: OpusSettings -> Maybe Natural
$sel:channels:OpusSettings' :: OpusSettings -> Maybe Natural
$sel:bitrate:OpusSettings' :: OpusSettings -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
bitrate
seq :: forall a b. a -> b -> b
`Prelude.seq` 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
instance Data.ToJSON OpusSettings where
toJSON :: OpusSettings -> Value
toJSON OpusSettings' {Maybe Natural
sampleRate :: Maybe Natural
channels :: Maybe Natural
bitrate :: Maybe Natural
$sel:sampleRate:OpusSettings' :: OpusSettings -> Maybe Natural
$sel:channels:OpusSettings' :: OpusSettings -> Maybe Natural
$sel:bitrate:OpusSettings' :: OpusSettings -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"bitrate" 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
bitrate,
(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
]
)