{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Transcribe.Types.Media
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Describes the Amazon S3 location of the media file you want to use in
-- your request.
--
-- For information on supported media formats, refer to the
-- <https://docs.aws.amazon.com/APIReference/API_StartTranscriptionJob.html#transcribe-StartTranscriptionJob-request-MediaFormat MediaFormat>
-- parameter or the
-- <https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio Media formats>
-- section in the Amazon S3 Developer Guide.
--
-- /See:/ 'newMedia' smart constructor.
data Media = Media'
  { -- | The Amazon S3 location of the media file you want to transcribe. For
    -- example:
    --
    -- -   @s3:\/\/DOC-EXAMPLE-BUCKET\/my-media-file.flac@
    --
    -- -   @s3:\/\/DOC-EXAMPLE-BUCKET\/media-files\/my-media-file.flac@
    --
    -- Note that the Amazon S3 bucket that contains your input media must be
    -- located in the same Amazon Web Services Region where you\'re making your
    -- transcription request.
    Media -> Maybe Text
mediaFileUri :: Prelude.Maybe Prelude.Text,
    -- | The Amazon S3 location of the media file you want to redact. For
    -- example:
    --
    -- -   @s3:\/\/DOC-EXAMPLE-BUCKET\/my-media-file.flac@
    --
    -- -   @s3:\/\/DOC-EXAMPLE-BUCKET\/media-files\/my-media-file.flac@
    --
    -- Note that the Amazon S3 bucket that contains your input media must be
    -- located in the same Amazon Web Services Region where you\'re making your
    -- transcription request.
    --
    -- @RedactedMediaFileUri@ produces a redacted audio file in addition to a
    -- redacted transcript. It is only supported for Call Analytics
    -- (@StartCallAnalyticsJob@) transcription requests.
    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)

-- |
-- Create a value of 'Media' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'mediaFileUri', 'media_mediaFileUri' - The Amazon S3 location of the media file you want to transcribe. For
-- example:
--
-- -   @s3:\/\/DOC-EXAMPLE-BUCKET\/my-media-file.flac@
--
-- -   @s3:\/\/DOC-EXAMPLE-BUCKET\/media-files\/my-media-file.flac@
--
-- Note that the Amazon S3 bucket that contains your input media must be
-- located in the same Amazon Web Services Region where you\'re making your
-- transcription request.
--
-- 'redactedMediaFileUri', 'media_redactedMediaFileUri' - The Amazon S3 location of the media file you want to redact. For
-- example:
--
-- -   @s3:\/\/DOC-EXAMPLE-BUCKET\/my-media-file.flac@
--
-- -   @s3:\/\/DOC-EXAMPLE-BUCKET\/media-files\/my-media-file.flac@
--
-- Note that the Amazon S3 bucket that contains your input media must be
-- located in the same Amazon Web Services Region where you\'re making your
-- transcription request.
--
-- @RedactedMediaFileUri@ produces a redacted audio file in addition to a
-- redacted transcript. It is only supported for Call Analytics
-- (@StartCallAnalyticsJob@) transcription requests.
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
    }

-- | The Amazon S3 location of the media file you want to transcribe. For
-- example:
--
-- -   @s3:\/\/DOC-EXAMPLE-BUCKET\/my-media-file.flac@
--
-- -   @s3:\/\/DOC-EXAMPLE-BUCKET\/media-files\/my-media-file.flac@
--
-- Note that the Amazon S3 bucket that contains your input media must be
-- located in the same Amazon Web Services Region where you\'re making your
-- transcription request.
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)

-- | The Amazon S3 location of the media file you want to redact. For
-- example:
--
-- -   @s3:\/\/DOC-EXAMPLE-BUCKET\/my-media-file.flac@
--
-- -   @s3:\/\/DOC-EXAMPLE-BUCKET\/media-files\/my-media-file.flac@
--
-- Note that the Amazon S3 bucket that contains your input media must be
-- located in the same Amazon Web Services Region where you\'re making your
-- transcription request.
--
-- @RedactedMediaFileUri@ produces a redacted audio file in addition to a
-- redacted transcript. It is only supported for Call Analytics
-- (@StartCallAnalyticsJob@) transcription requests.
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
          ]
      )