{-# 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-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.Transcript 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

-- | Provides you with the Amazon S3 URI you can use to access your
-- transcript.
--
-- /See:/ 'newTranscript' smart constructor.
data Transcript = Transcript'
  { -- | The Amazon S3 location of your redacted transcript. You can use this URI
    -- to access or download your transcript.
    --
    -- If you included @OutputBucketName@ in your transcription job request,
    -- this is the URI of that bucket. If you also included @OutputKey@ in your
    -- request, your output is located in the path you specified in your
    -- request.
    --
    -- If you didn\'t include @OutputBucketName@ in your transcription job
    -- request, your transcript is stored in a service-managed bucket, and
    -- @RedactedTranscriptFileUri@ provides you with a temporary URI you can
    -- use for secure access to your transcript.
    --
    -- Temporary URIs for service-managed Amazon S3 buckets are only valid for
    -- 15 minutes. If you get an @AccesDenied@ error, you can get a new
    -- temporary URI by running a @GetTranscriptionJob@ or
    -- @ListTranscriptionJob@ request.
    Transcript -> Maybe Text
redactedTranscriptFileUri :: Prelude.Maybe Prelude.Text,
    -- | The Amazon S3 location of your transcript. You can use this URI to
    -- access or download your transcript.
    --
    -- If you included @OutputBucketName@ in your transcription job request,
    -- this is the URI of that bucket. If you also included @OutputKey@ in your
    -- request, your output is located in the path you specified in your
    -- request.
    --
    -- If you didn\'t include @OutputBucketName@ in your transcription job
    -- request, your transcript is stored in a service-managed bucket, and
    -- @TranscriptFileUri@ provides you with a temporary URI you can use for
    -- secure access to your transcript.
    --
    -- Temporary URIs for service-managed Amazon S3 buckets are only valid for
    -- 15 minutes. If you get an @AccesDenied@ error, you can get a new
    -- temporary URI by running a @GetTranscriptionJob@ or
    -- @ListTranscriptionJob@ request.
    Transcript -> Maybe Text
transcriptFileUri :: Prelude.Maybe Prelude.Text
  }
  deriving (Transcript -> Transcript -> Bool
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]
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
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. 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 Amazon S3 location of your redacted transcript. You can use this URI
-- to access or download your transcript.
--
-- If you included @OutputBucketName@ in your transcription job request,
-- this is the URI of that bucket. If you also included @OutputKey@ in your
-- request, your output is located in the path you specified in your
-- request.
--
-- If you didn\'t include @OutputBucketName@ in your transcription job
-- request, your transcript is stored in a service-managed bucket, and
-- @RedactedTranscriptFileUri@ provides you with a temporary URI you can
-- use for secure access to your transcript.
--
-- Temporary URIs for service-managed Amazon S3 buckets are only valid for
-- 15 minutes. If you get an @AccesDenied@ error, you can get a new
-- temporary URI by running a @GetTranscriptionJob@ or
-- @ListTranscriptionJob@ request.
--
-- 'transcriptFileUri', 'transcript_transcriptFileUri' - The Amazon S3 location of your transcript. You can use this URI to
-- access or download your transcript.
--
-- If you included @OutputBucketName@ in your transcription job request,
-- this is the URI of that bucket. If you also included @OutputKey@ in your
-- request, your output is located in the path you specified in your
-- request.
--
-- If you didn\'t include @OutputBucketName@ in your transcription job
-- request, your transcript is stored in a service-managed bucket, and
-- @TranscriptFileUri@ provides you with a temporary URI you can use for
-- secure access to your transcript.
--
-- Temporary URIs for service-managed Amazon S3 buckets are only valid for
-- 15 minutes. If you get an @AccesDenied@ error, you can get a new
-- temporary URI by running a @GetTranscriptionJob@ or
-- @ListTranscriptionJob@ request.
newTranscript ::
  Transcript
newTranscript :: Transcript
newTranscript =
  Transcript'
    { $sel:redactedTranscriptFileUri:Transcript' :: Maybe Text
redactedTranscriptFileUri =
        forall a. Maybe a
Prelude.Nothing,
      $sel:transcriptFileUri:Transcript' :: Maybe Text
transcriptFileUri = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon S3 location of your redacted transcript. You can use this URI
-- to access or download your transcript.
--
-- If you included @OutputBucketName@ in your transcription job request,
-- this is the URI of that bucket. If you also included @OutputKey@ in your
-- request, your output is located in the path you specified in your
-- request.
--
-- If you didn\'t include @OutputBucketName@ in your transcription job
-- request, your transcript is stored in a service-managed bucket, and
-- @RedactedTranscriptFileUri@ provides you with a temporary URI you can
-- use for secure access to your transcript.
--
-- Temporary URIs for service-managed Amazon S3 buckets are only valid for
-- 15 minutes. If you get an @AccesDenied@ error, you can get a new
-- temporary URI by running a @GetTranscriptionJob@ or
-- @ListTranscriptionJob@ request.
transcript_redactedTranscriptFileUri :: Lens.Lens' Transcript (Prelude.Maybe Prelude.Text)
transcript_redactedTranscriptFileUri :: Lens' Transcript (Maybe Text)
transcript_redactedTranscriptFileUri = 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 Amazon S3 location of your transcript. You can use this URI to
-- access or download your transcript.
--
-- If you included @OutputBucketName@ in your transcription job request,
-- this is the URI of that bucket. If you also included @OutputKey@ in your
-- request, your output is located in the path you specified in your
-- request.
--
-- If you didn\'t include @OutputBucketName@ in your transcription job
-- request, your transcript is stored in a service-managed bucket, and
-- @TranscriptFileUri@ provides you with a temporary URI you can use for
-- secure access to your transcript.
--
-- Temporary URIs for service-managed Amazon S3 buckets are only valid for
-- 15 minutes. If you get an @AccesDenied@ error, you can get a new
-- temporary URI by running a @GetTranscriptionJob@ or
-- @ListTranscriptionJob@ request.
transcript_transcriptFileUri :: Lens.Lens' Transcript (Prelude.Maybe Prelude.Text)
transcript_transcriptFileUri :: Lens' Transcript (Maybe Text)
transcript_transcriptFileUri = 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 Data.FromJSON Transcript where
  parseJSON :: Value -> Parser Transcript
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Transcript"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Transcript
Transcript'
            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
"RedactedTranscriptFileUri")
            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
"TranscriptFileUri")
      )

instance Prelude.Hashable Transcript where
  hashWithSalt :: Int -> Transcript -> Int
hashWithSalt Int
_salt Transcript' {Maybe Text
transcriptFileUri :: Maybe Text
redactedTranscriptFileUri :: Maybe Text
$sel:transcriptFileUri:Transcript' :: Transcript -> Maybe Text
$sel:redactedTranscriptFileUri:Transcript' :: Transcript -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
redactedTranscriptFileUri
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
transcriptFileUri

instance Prelude.NFData Transcript where
  rnf :: Transcript -> ()
rnf Transcript' {Maybe Text
transcriptFileUri :: Maybe Text
redactedTranscriptFileUri :: Maybe Text
$sel:transcriptFileUri:Transcript' :: Transcript -> Maybe Text
$sel:redactedTranscriptFileUri:Transcript' :: Transcript -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
redactedTranscriptFileUri
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
transcriptFileUri