{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data OpusSettings = OpusSettings'
{
OpusSettings -> Maybe Natural
channels :: Prelude.Maybe Prelude.Natural,
OpusSettings -> Maybe Natural
sampleRate :: Prelude.Maybe Prelude.Natural,
OpusSettings -> Maybe Natural
bitrate :: Prelude.Maybe Prelude.Natural
}
deriving (OpusSettings -> OpusSettings -> Bool
(OpusSettings -> OpusSettings -> Bool)
-> (OpusSettings -> OpusSettings -> Bool) -> Eq OpusSettings
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]
(Int -> ReadS OpusSettings)
-> ReadS [OpusSettings]
-> ReadPrec OpusSettings
-> ReadPrec [OpusSettings]
-> Read 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
(Int -> OpusSettings -> ShowS)
-> (OpusSettings -> String)
-> ([OpusSettings] -> ShowS)
-> Show OpusSettings
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. OpusSettings -> Rep OpusSettings x)
-> (forall x. Rep OpusSettings x -> OpusSettings)
-> Generic OpusSettings
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' :: Maybe Natural -> Maybe Natural -> Maybe Natural -> OpusSettings
OpusSettings'
{ $sel:channels:OpusSettings' :: Maybe Natural
channels = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:sampleRate:OpusSettings' :: Maybe Natural
sampleRate = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:bitrate:OpusSettings' :: Maybe Natural
bitrate = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
opusSettings_channels :: Lens.Lens' OpusSettings (Prelude.Maybe Prelude.Natural)
opusSettings_channels :: (Maybe Natural -> f (Maybe Natural))
-> OpusSettings -> f OpusSettings
opusSettings_channels = (OpusSettings -> Maybe Natural)
-> (OpusSettings -> Maybe Natural -> OpusSettings)
-> Lens OpusSettings OpusSettings (Maybe Natural) (Maybe Natural)
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 :: (Maybe Natural -> f (Maybe Natural))
-> OpusSettings -> f OpusSettings
opusSettings_sampleRate = (OpusSettings -> Maybe Natural)
-> (OpusSettings -> Maybe Natural -> OpusSettings)
-> Lens OpusSettings OpusSettings (Maybe Natural) (Maybe Natural)
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)
opusSettings_bitrate :: Lens.Lens' OpusSettings (Prelude.Maybe Prelude.Natural)
opusSettings_bitrate :: (Maybe Natural -> f (Maybe Natural))
-> OpusSettings -> f OpusSettings
opusSettings_bitrate = (OpusSettings -> Maybe Natural)
-> (OpusSettings -> Maybe Natural -> OpusSettings)
-> Lens OpusSettings OpusSettings (Maybe Natural) (Maybe Natural)
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)
instance Core.FromJSON OpusSettings where
parseJSON :: Value -> Parser OpusSettings
parseJSON =
String
-> (Object -> Parser OpusSettings) -> Value -> Parser OpusSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"OpusSettings"
( \Object
x ->
Maybe Natural -> Maybe Natural -> Maybe Natural -> OpusSettings
OpusSettings'
(Maybe Natural -> Maybe Natural -> Maybe Natural -> OpusSettings)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> Maybe Natural -> OpusSettings)
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 -> OpusSettings)
-> Parser (Maybe Natural) -> Parser (Maybe Natural -> OpusSettings)
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 -> OpusSettings)
-> Parser (Maybe Natural) -> Parser OpusSettings
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 OpusSettings
instance Prelude.NFData OpusSettings
instance Core.ToJSON OpusSettings where
toJSON :: OpusSettings -> Value
toJSON OpusSettings' {Maybe Natural
bitrate :: Maybe Natural
sampleRate :: Maybe Natural
channels :: Maybe Natural
$sel:bitrate:OpusSettings' :: OpusSettings -> Maybe Natural
$sel:sampleRate:OpusSettings' :: OpusSettings -> Maybe Natural
$sel:channels:OpusSettings' :: OpusSettings -> 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
]
)