{-# 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.Lens as Lens
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
(Media -> Media -> Bool) -> (Media -> Media -> Bool) -> Eq Media
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]
(Int -> ReadS Media)
-> ReadS [Media]
-> ReadPrec Media
-> ReadPrec [Media]
-> Read 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
(Int -> Media -> ShowS)
-> (Media -> String) -> ([Media] -> ShowS) -> Show Media
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. Media -> Rep Media x)
-> (forall x. Rep Media x -> Media) -> Generic Media
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' :: Maybe Text -> Maybe Text -> Media
Media'
{ $sel:mediaFileUri:Media' :: Maybe Text
mediaFileUri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:redactedMediaFileUri:Media' :: Maybe Text
redactedMediaFileUri = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
media_mediaFileUri :: Lens.Lens' Media (Prelude.Maybe Prelude.Text)
media_mediaFileUri :: (Maybe Text -> f (Maybe Text)) -> Media -> f Media
media_mediaFileUri = (Media -> Maybe Text)
-> (Media -> Maybe Text -> Media)
-> Lens Media Media (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text)) -> Media -> f Media
media_redactedMediaFileUri = (Media -> Maybe Text)
-> (Media -> Maybe Text -> Media)
-> Lens Media Media (Maybe Text) (Maybe Text)
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 Core.FromJSON Media where
parseJSON :: Value -> Parser Media
parseJSON =
String -> (Object -> Parser Media) -> Value -> Parser Media
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Media"
( \Object
x ->
Maybe Text -> Maybe Text -> Media
Media'
(Maybe Text -> Maybe Text -> Media)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Media)
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
"MediaFileUri")
Parser (Maybe Text -> Media) -> Parser (Maybe Text) -> Parser Media
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
"RedactedMediaFileUri")
)
instance Prelude.Hashable Media
instance Prelude.NFData Media
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"MediaFileUri" 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
mediaFileUri,
(Text
"RedactedMediaFileUri" 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
redactedMediaFileUri
]
)