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