{-# 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.Lens as Lens
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
(AiffSettings -> AiffSettings -> Bool)
-> (AiffSettings -> AiffSettings -> Bool) -> Eq AiffSettings
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]
(Int -> ReadS AiffSettings)
-> ReadS [AiffSettings]
-> ReadPrec AiffSettings
-> ReadPrec [AiffSettings]
-> Read 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
(Int -> AiffSettings -> ShowS)
-> (AiffSettings -> String)
-> ([AiffSettings] -> ShowS)
-> Show AiffSettings
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. AiffSettings -> Rep AiffSettings x)
-> (forall x. Rep AiffSettings x -> AiffSettings)
-> Generic AiffSettings
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' :: Maybe Natural -> Maybe Natural -> Maybe Natural -> AiffSettings
AiffSettings'
{ $sel:bitDepth:AiffSettings' :: Maybe Natural
bitDepth = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:channels:AiffSettings' :: Maybe Natural
channels = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:sampleRate:AiffSettings' :: Maybe Natural
sampleRate = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
aiffSettings_bitDepth :: Lens.Lens' AiffSettings (Prelude.Maybe Prelude.Natural)
aiffSettings_bitDepth :: (Maybe Natural -> f (Maybe Natural))
-> AiffSettings -> f AiffSettings
aiffSettings_bitDepth = (AiffSettings -> Maybe Natural)
-> (AiffSettings -> Maybe Natural -> AiffSettings)
-> Lens AiffSettings AiffSettings (Maybe Natural) (Maybe Natural)
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 :: (Maybe Natural -> f (Maybe Natural))
-> AiffSettings -> f AiffSettings
aiffSettings_channels = (AiffSettings -> Maybe Natural)
-> (AiffSettings -> Maybe Natural -> AiffSettings)
-> Lens AiffSettings AiffSettings (Maybe Natural) (Maybe Natural)
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 :: (Maybe Natural -> f (Maybe Natural))
-> AiffSettings -> f AiffSettings
aiffSettings_sampleRate = (AiffSettings -> Maybe Natural)
-> (AiffSettings -> Maybe Natural -> AiffSettings)
-> Lens AiffSettings AiffSettings (Maybe Natural) (Maybe Natural)
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 Core.FromJSON AiffSettings where
parseJSON :: Value -> Parser AiffSettings
parseJSON =
String
-> (Object -> Parser AiffSettings) -> Value -> Parser AiffSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AiffSettings"
( \Object
x ->
Maybe Natural -> Maybe Natural -> Maybe Natural -> AiffSettings
AiffSettings'
(Maybe Natural -> Maybe Natural -> Maybe Natural -> AiffSettings)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> Maybe Natural -> AiffSettings)
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 Natural -> AiffSettings)
-> Parser (Maybe Natural) -> Parser (Maybe Natural -> AiffSettings)
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 Natural -> AiffSettings)
-> Parser (Maybe Natural) -> Parser AiffSettings
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 AiffSettings
instance Prelude.NFData AiffSettings
instance Core.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
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
"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
]
)