{-# 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.Transcript
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Transcribe.Types.Transcript where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Identifies the location of a transcription.
--
-- /See:/ 'newTranscript' smart constructor.
data Transcript = Transcript'
  { -- | The S3 object location of the redacted transcript.
    --
    -- Use this URI to access the redacted transcript. If you specified an S3
    -- bucket in the @OutputBucketName@ field when you created the job, this is
    -- the URI of that bucket. If you chose to store the transcript in Amazon
    -- Transcribe, this is a shareable URL that provides secure access to that
    -- location.
    Transcript -> Maybe Text
redactedTranscriptFileUri :: Prelude.Maybe Prelude.Text,
    -- | The S3 object location of the transcript.
    --
    -- Use this URI to access the transcript. If you specified an S3 bucket in
    -- the @OutputBucketName@ field when you created the job, this is the URI
    -- of that bucket. If you chose to store the transcript in Amazon
    -- Transcribe, this is a shareable URL that provides secure access to that
    -- location.
    Transcript -> Maybe Text
transcriptFileUri :: Prelude.Maybe Prelude.Text
  }
  deriving (Transcript -> Transcript -> Bool
(Transcript -> Transcript -> Bool)
-> (Transcript -> Transcript -> Bool) -> Eq Transcript
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Transcript -> Transcript -> Bool
$c/= :: Transcript -> Transcript -> Bool
== :: Transcript -> Transcript -> Bool
$c== :: Transcript -> Transcript -> Bool
Prelude.Eq, ReadPrec [Transcript]
ReadPrec Transcript
Int -> ReadS Transcript
ReadS [Transcript]
(Int -> ReadS Transcript)
-> ReadS [Transcript]
-> ReadPrec Transcript
-> ReadPrec [Transcript]
-> Read Transcript
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Transcript]
$creadListPrec :: ReadPrec [Transcript]
readPrec :: ReadPrec Transcript
$creadPrec :: ReadPrec Transcript
readList :: ReadS [Transcript]
$creadList :: ReadS [Transcript]
readsPrec :: Int -> ReadS Transcript
$creadsPrec :: Int -> ReadS Transcript
Prelude.Read, Int -> Transcript -> ShowS
[Transcript] -> ShowS
Transcript -> String
(Int -> Transcript -> ShowS)
-> (Transcript -> String)
-> ([Transcript] -> ShowS)
-> Show Transcript
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Transcript] -> ShowS
$cshowList :: [Transcript] -> ShowS
show :: Transcript -> String
$cshow :: Transcript -> String
showsPrec :: Int -> Transcript -> ShowS
$cshowsPrec :: Int -> Transcript -> ShowS
Prelude.Show, (forall x. Transcript -> Rep Transcript x)
-> (forall x. Rep Transcript x -> Transcript) -> Generic Transcript
forall x. Rep Transcript x -> Transcript
forall x. Transcript -> Rep Transcript x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Transcript x -> Transcript
$cfrom :: forall x. Transcript -> Rep Transcript x
Prelude.Generic)

-- |
-- Create a value of 'Transcript' 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:
--
-- 'redactedTranscriptFileUri', 'transcript_redactedTranscriptFileUri' - The S3 object location of the redacted transcript.
--
-- Use this URI to access the redacted transcript. If you specified an S3
-- bucket in the @OutputBucketName@ field when you created the job, this is
-- the URI of that bucket. If you chose to store the transcript in Amazon
-- Transcribe, this is a shareable URL that provides secure access to that
-- location.
--
-- 'transcriptFileUri', 'transcript_transcriptFileUri' - The S3 object location of the transcript.
--
-- Use this URI to access the transcript. If you specified an S3 bucket in
-- the @OutputBucketName@ field when you created the job, this is the URI
-- of that bucket. If you chose to store the transcript in Amazon
-- Transcribe, this is a shareable URL that provides secure access to that
-- location.
newTranscript ::
  Transcript
newTranscript :: Transcript
newTranscript =
  Transcript' :: Maybe Text -> Maybe Text -> Transcript
Transcript'
    { $sel:redactedTranscriptFileUri:Transcript' :: Maybe Text
redactedTranscriptFileUri =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:transcriptFileUri:Transcript' :: Maybe Text
transcriptFileUri = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The S3 object location of the redacted transcript.
--
-- Use this URI to access the redacted transcript. If you specified an S3
-- bucket in the @OutputBucketName@ field when you created the job, this is
-- the URI of that bucket. If you chose to store the transcript in Amazon
-- Transcribe, this is a shareable URL that provides secure access to that
-- location.
transcript_redactedTranscriptFileUri :: Lens.Lens' Transcript (Prelude.Maybe Prelude.Text)
transcript_redactedTranscriptFileUri :: (Maybe Text -> f (Maybe Text)) -> Transcript -> f Transcript
transcript_redactedTranscriptFileUri = (Transcript -> Maybe Text)
-> (Transcript -> Maybe Text -> Transcript)
-> Lens Transcript Transcript (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transcript' {Maybe Text
redactedTranscriptFileUri :: Maybe Text
$sel:redactedTranscriptFileUri:Transcript' :: Transcript -> Maybe Text
redactedTranscriptFileUri} -> Maybe Text
redactedTranscriptFileUri) (\s :: Transcript
s@Transcript' {} Maybe Text
a -> Transcript
s {$sel:redactedTranscriptFileUri:Transcript' :: Maybe Text
redactedTranscriptFileUri = Maybe Text
a} :: Transcript)

-- | The S3 object location of the transcript.
--
-- Use this URI to access the transcript. If you specified an S3 bucket in
-- the @OutputBucketName@ field when you created the job, this is the URI
-- of that bucket. If you chose to store the transcript in Amazon
-- Transcribe, this is a shareable URL that provides secure access to that
-- location.
transcript_transcriptFileUri :: Lens.Lens' Transcript (Prelude.Maybe Prelude.Text)
transcript_transcriptFileUri :: (Maybe Text -> f (Maybe Text)) -> Transcript -> f Transcript
transcript_transcriptFileUri = (Transcript -> Maybe Text)
-> (Transcript -> Maybe Text -> Transcript)
-> Lens Transcript Transcript (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transcript' {Maybe Text
transcriptFileUri :: Maybe Text
$sel:transcriptFileUri:Transcript' :: Transcript -> Maybe Text
transcriptFileUri} -> Maybe Text
transcriptFileUri) (\s :: Transcript
s@Transcript' {} Maybe Text
a -> Transcript
s {$sel:transcriptFileUri:Transcript' :: Maybe Text
transcriptFileUri = Maybe Text
a} :: Transcript)

instance Core.FromJSON Transcript where
  parseJSON :: Value -> Parser Transcript
parseJSON =
    String
-> (Object -> Parser Transcript) -> Value -> Parser Transcript
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Transcript"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Transcript
Transcript'
            (Maybe Text -> Maybe Text -> Transcript)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Transcript)
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
"RedactedTranscriptFileUri")
            Parser (Maybe Text -> Transcript)
-> Parser (Maybe Text) -> Parser Transcript
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
"TranscriptFileUri")
      )

instance Prelude.Hashable Transcript

instance Prelude.NFData Transcript