{-# 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.Transcribe.Types.Media 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 Media = Media'
{
Media -> Maybe Text
mediaFileUri :: Prelude.Maybe Prelude.Text,
Media -> Maybe Text
redactedMediaFileUri :: Prelude.Maybe Prelude.Text
}
deriving (Media -> Media -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Media -> Media -> Bool
$c/= :: Media -> Media -> Bool
== :: Media -> Media -> Bool
$c== :: Media -> Media -> Bool
Prelude.Eq, ReadPrec [Media]
ReadPrec Media
Int -> ReadS Media
ReadS [Media]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Media]
$creadListPrec :: ReadPrec [Media]
readPrec :: ReadPrec Media
$creadPrec :: ReadPrec Media
readList :: ReadS [Media]
$creadList :: ReadS [Media]
readsPrec :: Int -> ReadS Media
$creadsPrec :: Int -> ReadS Media
Prelude.Read, Int -> Media -> ShowS
[Media] -> ShowS
Media -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Media] -> ShowS
$cshowList :: [Media] -> ShowS
show :: Media -> String
$cshow :: Media -> String
showsPrec :: Int -> Media -> ShowS
$cshowsPrec :: Int -> Media -> ShowS
Prelude.Show, forall x. Rep Media x -> Media
forall x. Media -> Rep Media x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Media x -> Media
$cfrom :: forall x. Media -> Rep Media x
Prelude.Generic)
newMedia ::
Media
newMedia :: Media
newMedia =
Media'
{ $sel:mediaFileUri:Media' :: Maybe Text
mediaFileUri = forall a. Maybe a
Prelude.Nothing,
$sel:redactedMediaFileUri:Media' :: Maybe Text
redactedMediaFileUri = forall a. Maybe a
Prelude.Nothing
}
media_mediaFileUri :: Lens.Lens' Media (Prelude.Maybe Prelude.Text)
media_mediaFileUri :: Lens' Media (Maybe Text)
media_mediaFileUri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Media' {Maybe Text
mediaFileUri :: Maybe Text
$sel:mediaFileUri:Media' :: Media -> Maybe Text
mediaFileUri} -> Maybe Text
mediaFileUri) (\s :: Media
s@Media' {} Maybe Text
a -> Media
s {$sel:mediaFileUri:Media' :: Maybe Text
mediaFileUri = Maybe Text
a} :: Media)
media_redactedMediaFileUri :: Lens.Lens' Media (Prelude.Maybe Prelude.Text)
media_redactedMediaFileUri :: Lens' Media (Maybe Text)
media_redactedMediaFileUri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Media' {Maybe Text
redactedMediaFileUri :: Maybe Text
$sel:redactedMediaFileUri:Media' :: Media -> Maybe Text
redactedMediaFileUri} -> Maybe Text
redactedMediaFileUri) (\s :: Media
s@Media' {} Maybe Text
a -> Media
s {$sel:redactedMediaFileUri:Media' :: Maybe Text
redactedMediaFileUri = Maybe Text
a} :: Media)
instance Data.FromJSON Media where
parseJSON :: Value -> Parser Media
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Media"
( \Object
x ->
Maybe Text -> Maybe Text -> Media
Media'
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
"MediaFileUri")
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
"RedactedMediaFileUri")
)
instance Prelude.Hashable Media where
hashWithSalt :: Int -> Media -> Int
hashWithSalt Int
_salt Media' {Maybe Text
redactedMediaFileUri :: Maybe Text
mediaFileUri :: Maybe Text
$sel:redactedMediaFileUri:Media' :: Media -> Maybe Text
$sel:mediaFileUri:Media' :: Media -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
mediaFileUri
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
redactedMediaFileUri
instance Prelude.NFData Media where
rnf :: Media -> ()
rnf Media' {Maybe Text
redactedMediaFileUri :: Maybe Text
mediaFileUri :: Maybe Text
$sel:redactedMediaFileUri:Media' :: Media -> Maybe Text
$sel:mediaFileUri:Media' :: Media -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
mediaFileUri
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
redactedMediaFileUri
instance Data.ToJSON Media where
toJSON :: Media -> Value
toJSON Media' {Maybe Text
redactedMediaFileUri :: Maybe Text
mediaFileUri :: Maybe Text
$sel:redactedMediaFileUri:Media' :: Media -> Maybe Text
$sel:mediaFileUri:Media' :: Media -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MediaFileUri" 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 Text
mediaFileUri,
(Key
"RedactedMediaFileUri" 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 Text
redactedMediaFileUri
]
)