{-# 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.Rekognition.Types.AudioMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AudioMetadata = AudioMetadata'
{
AudioMetadata -> Maybe Text
codec :: Prelude.Maybe Prelude.Text,
AudioMetadata -> Maybe Natural
sampleRate :: Prelude.Maybe Prelude.Natural,
AudioMetadata -> Maybe Natural
numberOfChannels :: Prelude.Maybe Prelude.Natural,
AudioMetadata -> Maybe Natural
durationMillis :: Prelude.Maybe Prelude.Natural
}
deriving (AudioMetadata -> AudioMetadata -> Bool
(AudioMetadata -> AudioMetadata -> Bool)
-> (AudioMetadata -> AudioMetadata -> Bool) -> Eq AudioMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AudioMetadata -> AudioMetadata -> Bool
$c/= :: AudioMetadata -> AudioMetadata -> Bool
== :: AudioMetadata -> AudioMetadata -> Bool
$c== :: AudioMetadata -> AudioMetadata -> Bool
Prelude.Eq, ReadPrec [AudioMetadata]
ReadPrec AudioMetadata
Int -> ReadS AudioMetadata
ReadS [AudioMetadata]
(Int -> ReadS AudioMetadata)
-> ReadS [AudioMetadata]
-> ReadPrec AudioMetadata
-> ReadPrec [AudioMetadata]
-> Read AudioMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AudioMetadata]
$creadListPrec :: ReadPrec [AudioMetadata]
readPrec :: ReadPrec AudioMetadata
$creadPrec :: ReadPrec AudioMetadata
readList :: ReadS [AudioMetadata]
$creadList :: ReadS [AudioMetadata]
readsPrec :: Int -> ReadS AudioMetadata
$creadsPrec :: Int -> ReadS AudioMetadata
Prelude.Read, Int -> AudioMetadata -> ShowS
[AudioMetadata] -> ShowS
AudioMetadata -> String
(Int -> AudioMetadata -> ShowS)
-> (AudioMetadata -> String)
-> ([AudioMetadata] -> ShowS)
-> Show AudioMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AudioMetadata] -> ShowS
$cshowList :: [AudioMetadata] -> ShowS
show :: AudioMetadata -> String
$cshow :: AudioMetadata -> String
showsPrec :: Int -> AudioMetadata -> ShowS
$cshowsPrec :: Int -> AudioMetadata -> ShowS
Prelude.Show, (forall x. AudioMetadata -> Rep AudioMetadata x)
-> (forall x. Rep AudioMetadata x -> AudioMetadata)
-> Generic AudioMetadata
forall x. Rep AudioMetadata x -> AudioMetadata
forall x. AudioMetadata -> Rep AudioMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AudioMetadata x -> AudioMetadata
$cfrom :: forall x. AudioMetadata -> Rep AudioMetadata x
Prelude.Generic)
newAudioMetadata ::
AudioMetadata
newAudioMetadata :: AudioMetadata
newAudioMetadata =
AudioMetadata' :: Maybe Text
-> Maybe Natural -> Maybe Natural -> Maybe Natural -> AudioMetadata
AudioMetadata'
{ $sel:codec:AudioMetadata' :: Maybe Text
codec = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sampleRate:AudioMetadata' :: Maybe Natural
sampleRate = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:numberOfChannels:AudioMetadata' :: Maybe Natural
numberOfChannels = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:durationMillis:AudioMetadata' :: Maybe Natural
durationMillis = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
audioMetadata_codec :: Lens.Lens' AudioMetadata (Prelude.Maybe Prelude.Text)
audioMetadata_codec :: (Maybe Text -> f (Maybe Text)) -> AudioMetadata -> f AudioMetadata
audioMetadata_codec = (AudioMetadata -> Maybe Text)
-> (AudioMetadata -> Maybe Text -> AudioMetadata)
-> Lens AudioMetadata AudioMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioMetadata' {Maybe Text
codec :: Maybe Text
$sel:codec:AudioMetadata' :: AudioMetadata -> Maybe Text
codec} -> Maybe Text
codec) (\s :: AudioMetadata
s@AudioMetadata' {} Maybe Text
a -> AudioMetadata
s {$sel:codec:AudioMetadata' :: Maybe Text
codec = Maybe Text
a} :: AudioMetadata)
audioMetadata_sampleRate :: Lens.Lens' AudioMetadata (Prelude.Maybe Prelude.Natural)
audioMetadata_sampleRate :: (Maybe Natural -> f (Maybe Natural))
-> AudioMetadata -> f AudioMetadata
audioMetadata_sampleRate = (AudioMetadata -> Maybe Natural)
-> (AudioMetadata -> Maybe Natural -> AudioMetadata)
-> Lens AudioMetadata AudioMetadata (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioMetadata' {Maybe Natural
sampleRate :: Maybe Natural
$sel:sampleRate:AudioMetadata' :: AudioMetadata -> Maybe Natural
sampleRate} -> Maybe Natural
sampleRate) (\s :: AudioMetadata
s@AudioMetadata' {} Maybe Natural
a -> AudioMetadata
s {$sel:sampleRate:AudioMetadata' :: Maybe Natural
sampleRate = Maybe Natural
a} :: AudioMetadata)
audioMetadata_numberOfChannels :: Lens.Lens' AudioMetadata (Prelude.Maybe Prelude.Natural)
audioMetadata_numberOfChannels :: (Maybe Natural -> f (Maybe Natural))
-> AudioMetadata -> f AudioMetadata
audioMetadata_numberOfChannels = (AudioMetadata -> Maybe Natural)
-> (AudioMetadata -> Maybe Natural -> AudioMetadata)
-> Lens AudioMetadata AudioMetadata (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioMetadata' {Maybe Natural
numberOfChannels :: Maybe Natural
$sel:numberOfChannels:AudioMetadata' :: AudioMetadata -> Maybe Natural
numberOfChannels} -> Maybe Natural
numberOfChannels) (\s :: AudioMetadata
s@AudioMetadata' {} Maybe Natural
a -> AudioMetadata
s {$sel:numberOfChannels:AudioMetadata' :: Maybe Natural
numberOfChannels = Maybe Natural
a} :: AudioMetadata)
audioMetadata_durationMillis :: Lens.Lens' AudioMetadata (Prelude.Maybe Prelude.Natural)
audioMetadata_durationMillis :: (Maybe Natural -> f (Maybe Natural))
-> AudioMetadata -> f AudioMetadata
audioMetadata_durationMillis = (AudioMetadata -> Maybe Natural)
-> (AudioMetadata -> Maybe Natural -> AudioMetadata)
-> Lens AudioMetadata AudioMetadata (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioMetadata' {Maybe Natural
durationMillis :: Maybe Natural
$sel:durationMillis:AudioMetadata' :: AudioMetadata -> Maybe Natural
durationMillis} -> Maybe Natural
durationMillis) (\s :: AudioMetadata
s@AudioMetadata' {} Maybe Natural
a -> AudioMetadata
s {$sel:durationMillis:AudioMetadata' :: Maybe Natural
durationMillis = Maybe Natural
a} :: AudioMetadata)
instance Core.FromJSON AudioMetadata where
parseJSON :: Value -> Parser AudioMetadata
parseJSON =
String
-> (Object -> Parser AudioMetadata)
-> Value
-> Parser AudioMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AudioMetadata"
( \Object
x ->
Maybe Text
-> Maybe Natural -> Maybe Natural -> Maybe Natural -> AudioMetadata
AudioMetadata'
(Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> AudioMetadata)
-> Parser (Maybe Text)
-> Parser
(Maybe Natural -> Maybe Natural -> Maybe Natural -> AudioMetadata)
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
"Codec")
Parser
(Maybe Natural -> Maybe Natural -> Maybe Natural -> AudioMetadata)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> Maybe Natural -> AudioMetadata)
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 -> Maybe Natural -> AudioMetadata)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> AudioMetadata)
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
"NumberOfChannels")
Parser (Maybe Natural -> AudioMetadata)
-> Parser (Maybe Natural) -> Parser AudioMetadata
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
"DurationMillis")
)
instance Prelude.Hashable AudioMetadata
instance Prelude.NFData AudioMetadata