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