{-# 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.ElasticTranscoder.Types.AudioCodecOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AudioCodecOptions = AudioCodecOptions'
{
AudioCodecOptions -> Maybe Text
signed :: Prelude.Maybe Prelude.Text,
AudioCodecOptions -> Maybe Text
bitDepth :: Prelude.Maybe Prelude.Text,
AudioCodecOptions -> Maybe Text
profile :: Prelude.Maybe Prelude.Text,
AudioCodecOptions -> Maybe Text
bitOrder :: Prelude.Maybe Prelude.Text
}
deriving (AudioCodecOptions -> AudioCodecOptions -> Bool
(AudioCodecOptions -> AudioCodecOptions -> Bool)
-> (AudioCodecOptions -> AudioCodecOptions -> Bool)
-> Eq AudioCodecOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AudioCodecOptions -> AudioCodecOptions -> Bool
$c/= :: AudioCodecOptions -> AudioCodecOptions -> Bool
== :: AudioCodecOptions -> AudioCodecOptions -> Bool
$c== :: AudioCodecOptions -> AudioCodecOptions -> Bool
Prelude.Eq, ReadPrec [AudioCodecOptions]
ReadPrec AudioCodecOptions
Int -> ReadS AudioCodecOptions
ReadS [AudioCodecOptions]
(Int -> ReadS AudioCodecOptions)
-> ReadS [AudioCodecOptions]
-> ReadPrec AudioCodecOptions
-> ReadPrec [AudioCodecOptions]
-> Read AudioCodecOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AudioCodecOptions]
$creadListPrec :: ReadPrec [AudioCodecOptions]
readPrec :: ReadPrec AudioCodecOptions
$creadPrec :: ReadPrec AudioCodecOptions
readList :: ReadS [AudioCodecOptions]
$creadList :: ReadS [AudioCodecOptions]
readsPrec :: Int -> ReadS AudioCodecOptions
$creadsPrec :: Int -> ReadS AudioCodecOptions
Prelude.Read, Int -> AudioCodecOptions -> ShowS
[AudioCodecOptions] -> ShowS
AudioCodecOptions -> String
(Int -> AudioCodecOptions -> ShowS)
-> (AudioCodecOptions -> String)
-> ([AudioCodecOptions] -> ShowS)
-> Show AudioCodecOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AudioCodecOptions] -> ShowS
$cshowList :: [AudioCodecOptions] -> ShowS
show :: AudioCodecOptions -> String
$cshow :: AudioCodecOptions -> String
showsPrec :: Int -> AudioCodecOptions -> ShowS
$cshowsPrec :: Int -> AudioCodecOptions -> ShowS
Prelude.Show, (forall x. AudioCodecOptions -> Rep AudioCodecOptions x)
-> (forall x. Rep AudioCodecOptions x -> AudioCodecOptions)
-> Generic AudioCodecOptions
forall x. Rep AudioCodecOptions x -> AudioCodecOptions
forall x. AudioCodecOptions -> Rep AudioCodecOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AudioCodecOptions x -> AudioCodecOptions
$cfrom :: forall x. AudioCodecOptions -> Rep AudioCodecOptions x
Prelude.Generic)
newAudioCodecOptions ::
AudioCodecOptions
newAudioCodecOptions :: AudioCodecOptions
newAudioCodecOptions =
AudioCodecOptions' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> AudioCodecOptions
AudioCodecOptions'
{ $sel:signed:AudioCodecOptions' :: Maybe Text
signed = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bitDepth:AudioCodecOptions' :: Maybe Text
bitDepth = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:profile:AudioCodecOptions' :: Maybe Text
profile = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bitOrder:AudioCodecOptions' :: Maybe Text
bitOrder = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
audioCodecOptions_signed :: Lens.Lens' AudioCodecOptions (Prelude.Maybe Prelude.Text)
audioCodecOptions_signed :: (Maybe Text -> f (Maybe Text))
-> AudioCodecOptions -> f AudioCodecOptions
audioCodecOptions_signed = (AudioCodecOptions -> Maybe Text)
-> (AudioCodecOptions -> Maybe Text -> AudioCodecOptions)
-> Lens
AudioCodecOptions AudioCodecOptions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioCodecOptions' {Maybe Text
signed :: Maybe Text
$sel:signed:AudioCodecOptions' :: AudioCodecOptions -> Maybe Text
signed} -> Maybe Text
signed) (\s :: AudioCodecOptions
s@AudioCodecOptions' {} Maybe Text
a -> AudioCodecOptions
s {$sel:signed:AudioCodecOptions' :: Maybe Text
signed = Maybe Text
a} :: AudioCodecOptions)
audioCodecOptions_bitDepth :: Lens.Lens' AudioCodecOptions (Prelude.Maybe Prelude.Text)
audioCodecOptions_bitDepth :: (Maybe Text -> f (Maybe Text))
-> AudioCodecOptions -> f AudioCodecOptions
audioCodecOptions_bitDepth = (AudioCodecOptions -> Maybe Text)
-> (AudioCodecOptions -> Maybe Text -> AudioCodecOptions)
-> Lens
AudioCodecOptions AudioCodecOptions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioCodecOptions' {Maybe Text
bitDepth :: Maybe Text
$sel:bitDepth:AudioCodecOptions' :: AudioCodecOptions -> Maybe Text
bitDepth} -> Maybe Text
bitDepth) (\s :: AudioCodecOptions
s@AudioCodecOptions' {} Maybe Text
a -> AudioCodecOptions
s {$sel:bitDepth:AudioCodecOptions' :: Maybe Text
bitDepth = Maybe Text
a} :: AudioCodecOptions)
audioCodecOptions_profile :: Lens.Lens' AudioCodecOptions (Prelude.Maybe Prelude.Text)
audioCodecOptions_profile :: (Maybe Text -> f (Maybe Text))
-> AudioCodecOptions -> f AudioCodecOptions
audioCodecOptions_profile = (AudioCodecOptions -> Maybe Text)
-> (AudioCodecOptions -> Maybe Text -> AudioCodecOptions)
-> Lens
AudioCodecOptions AudioCodecOptions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioCodecOptions' {Maybe Text
profile :: Maybe Text
$sel:profile:AudioCodecOptions' :: AudioCodecOptions -> Maybe Text
profile} -> Maybe Text
profile) (\s :: AudioCodecOptions
s@AudioCodecOptions' {} Maybe Text
a -> AudioCodecOptions
s {$sel:profile:AudioCodecOptions' :: Maybe Text
profile = Maybe Text
a} :: AudioCodecOptions)
audioCodecOptions_bitOrder :: Lens.Lens' AudioCodecOptions (Prelude.Maybe Prelude.Text)
audioCodecOptions_bitOrder :: (Maybe Text -> f (Maybe Text))
-> AudioCodecOptions -> f AudioCodecOptions
audioCodecOptions_bitOrder = (AudioCodecOptions -> Maybe Text)
-> (AudioCodecOptions -> Maybe Text -> AudioCodecOptions)
-> Lens
AudioCodecOptions AudioCodecOptions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioCodecOptions' {Maybe Text
bitOrder :: Maybe Text
$sel:bitOrder:AudioCodecOptions' :: AudioCodecOptions -> Maybe Text
bitOrder} -> Maybe Text
bitOrder) (\s :: AudioCodecOptions
s@AudioCodecOptions' {} Maybe Text
a -> AudioCodecOptions
s {$sel:bitOrder:AudioCodecOptions' :: Maybe Text
bitOrder = Maybe Text
a} :: AudioCodecOptions)
instance Core.FromJSON AudioCodecOptions where
parseJSON :: Value -> Parser AudioCodecOptions
parseJSON =
String
-> (Object -> Parser AudioCodecOptions)
-> Value
-> Parser AudioCodecOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AudioCodecOptions"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> AudioCodecOptions
AudioCodecOptions'
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> AudioCodecOptions)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> AudioCodecOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Signed")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> AudioCodecOptions)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> AudioCodecOptions)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BitDepth")
Parser (Maybe Text -> Maybe Text -> AudioCodecOptions)
-> Parser (Maybe Text) -> Parser (Maybe Text -> AudioCodecOptions)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Profile")
Parser (Maybe Text -> AudioCodecOptions)
-> Parser (Maybe Text) -> Parser AudioCodecOptions
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BitOrder")
)
instance Prelude.Hashable AudioCodecOptions
instance Prelude.NFData AudioCodecOptions
instance Core.ToJSON AudioCodecOptions where
toJSON :: AudioCodecOptions -> Value
toJSON AudioCodecOptions' {Maybe Text
bitOrder :: Maybe Text
profile :: Maybe Text
bitDepth :: Maybe Text
signed :: Maybe Text
$sel:bitOrder:AudioCodecOptions' :: AudioCodecOptions -> Maybe Text
$sel:profile:AudioCodecOptions' :: AudioCodecOptions -> Maybe Text
$sel:bitDepth:AudioCodecOptions' :: AudioCodecOptions -> Maybe Text
$sel:signed:AudioCodecOptions' :: AudioCodecOptions -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Signed" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
signed,
(Text
"BitDepth" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
bitDepth,
(Text
"Profile" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
profile,
(Text
"BitOrder" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
bitOrder
]
)