{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.ListTranscriptionJobs
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Provides a list of transcription jobs that match the specified criteria.
-- If no criteria are specified, all transcription jobs are returned.
--
-- To get detailed information about a specific transcription job, use the
-- operation.
module Amazonka.Transcribe.ListTranscriptionJobs
  ( -- * Creating a Request
    ListTranscriptionJobs (..),
    newListTranscriptionJobs,

    -- * Request Lenses
    listTranscriptionJobs_jobNameContains,
    listTranscriptionJobs_maxResults,
    listTranscriptionJobs_nextToken,
    listTranscriptionJobs_status,

    -- * Destructuring the Response
    ListTranscriptionJobsResponse (..),
    newListTranscriptionJobsResponse,

    -- * Response Lenses
    listTranscriptionJobsResponse_nextToken,
    listTranscriptionJobsResponse_status,
    listTranscriptionJobsResponse_transcriptionJobSummaries,
    listTranscriptionJobsResponse_httpStatus,
  )
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Transcribe.Types

-- | /See:/ 'newListTranscriptionJobs' smart constructor.
data ListTranscriptionJobs = ListTranscriptionJobs'
  { -- | Returns only the transcription jobs that contain the specified string.
    -- The search is not case sensitive.
    ListTranscriptionJobs -> Maybe Text
jobNameContains :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of transcription jobs to return in each page of
    -- results. If there are fewer results than the value that you specify,
    -- only the actual results are returned. If you don\'t specify a value, a
    -- default of 5 is used.
    ListTranscriptionJobs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | If your @ListTranscriptionJobs@ request returns more results than can be
    -- displayed, @NextToken@ is displayed in the response with an associated
    -- string. To get the next page of results, copy this string and repeat
    -- your request, including @NextToken@ with the value of the copied string.
    -- Repeat as needed to view all your results.
    ListTranscriptionJobs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Returns only transcription jobs with the specified status. Jobs are
    -- ordered by creation date, with the newest job first. If you don\'t
    -- include @Status@, all transcription jobs are returned.
    ListTranscriptionJobs -> Maybe TranscriptionJobStatus
status :: Prelude.Maybe TranscriptionJobStatus
  }
  deriving (ListTranscriptionJobs -> ListTranscriptionJobs -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTranscriptionJobs -> ListTranscriptionJobs -> Bool
$c/= :: ListTranscriptionJobs -> ListTranscriptionJobs -> Bool
== :: ListTranscriptionJobs -> ListTranscriptionJobs -> Bool
$c== :: ListTranscriptionJobs -> ListTranscriptionJobs -> Bool
Prelude.Eq, ReadPrec [ListTranscriptionJobs]
ReadPrec ListTranscriptionJobs
Int -> ReadS ListTranscriptionJobs
ReadS [ListTranscriptionJobs]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTranscriptionJobs]
$creadListPrec :: ReadPrec [ListTranscriptionJobs]
readPrec :: ReadPrec ListTranscriptionJobs
$creadPrec :: ReadPrec ListTranscriptionJobs
readList :: ReadS [ListTranscriptionJobs]
$creadList :: ReadS [ListTranscriptionJobs]
readsPrec :: Int -> ReadS ListTranscriptionJobs
$creadsPrec :: Int -> ReadS ListTranscriptionJobs
Prelude.Read, Int -> ListTranscriptionJobs -> ShowS
[ListTranscriptionJobs] -> ShowS
ListTranscriptionJobs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTranscriptionJobs] -> ShowS
$cshowList :: [ListTranscriptionJobs] -> ShowS
show :: ListTranscriptionJobs -> String
$cshow :: ListTranscriptionJobs -> String
showsPrec :: Int -> ListTranscriptionJobs -> ShowS
$cshowsPrec :: Int -> ListTranscriptionJobs -> ShowS
Prelude.Show, forall x. Rep ListTranscriptionJobs x -> ListTranscriptionJobs
forall x. ListTranscriptionJobs -> Rep ListTranscriptionJobs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTranscriptionJobs x -> ListTranscriptionJobs
$cfrom :: forall x. ListTranscriptionJobs -> Rep ListTranscriptionJobs x
Prelude.Generic)

-- |
-- Create a value of 'ListTranscriptionJobs' 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:
--
-- 'jobNameContains', 'listTranscriptionJobs_jobNameContains' - Returns only the transcription jobs that contain the specified string.
-- The search is not case sensitive.
--
-- 'maxResults', 'listTranscriptionJobs_maxResults' - The maximum number of transcription jobs to return in each page of
-- results. If there are fewer results than the value that you specify,
-- only the actual results are returned. If you don\'t specify a value, a
-- default of 5 is used.
--
-- 'nextToken', 'listTranscriptionJobs_nextToken' - If your @ListTranscriptionJobs@ request returns more results than can be
-- displayed, @NextToken@ is displayed in the response with an associated
-- string. To get the next page of results, copy this string and repeat
-- your request, including @NextToken@ with the value of the copied string.
-- Repeat as needed to view all your results.
--
-- 'status', 'listTranscriptionJobs_status' - Returns only transcription jobs with the specified status. Jobs are
-- ordered by creation date, with the newest job first. If you don\'t
-- include @Status@, all transcription jobs are returned.
newListTranscriptionJobs ::
  ListTranscriptionJobs
newListTranscriptionJobs :: ListTranscriptionJobs
newListTranscriptionJobs =
  ListTranscriptionJobs'
    { $sel:jobNameContains:ListTranscriptionJobs' :: Maybe Text
jobNameContains =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListTranscriptionJobs' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListTranscriptionJobs' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:status:ListTranscriptionJobs' :: Maybe TranscriptionJobStatus
status = forall a. Maybe a
Prelude.Nothing
    }

-- | Returns only the transcription jobs that contain the specified string.
-- The search is not case sensitive.
listTranscriptionJobs_jobNameContains :: Lens.Lens' ListTranscriptionJobs (Prelude.Maybe Prelude.Text)
listTranscriptionJobs_jobNameContains :: Lens' ListTranscriptionJobs (Maybe Text)
listTranscriptionJobs_jobNameContains = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTranscriptionJobs' {Maybe Text
jobNameContains :: Maybe Text
$sel:jobNameContains:ListTranscriptionJobs' :: ListTranscriptionJobs -> Maybe Text
jobNameContains} -> Maybe Text
jobNameContains) (\s :: ListTranscriptionJobs
s@ListTranscriptionJobs' {} Maybe Text
a -> ListTranscriptionJobs
s {$sel:jobNameContains:ListTranscriptionJobs' :: Maybe Text
jobNameContains = Maybe Text
a} :: ListTranscriptionJobs)

-- | The maximum number of transcription jobs to return in each page of
-- results. If there are fewer results than the value that you specify,
-- only the actual results are returned. If you don\'t specify a value, a
-- default of 5 is used.
listTranscriptionJobs_maxResults :: Lens.Lens' ListTranscriptionJobs (Prelude.Maybe Prelude.Natural)
listTranscriptionJobs_maxResults :: Lens' ListTranscriptionJobs (Maybe Natural)
listTranscriptionJobs_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTranscriptionJobs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListTranscriptionJobs' :: ListTranscriptionJobs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListTranscriptionJobs
s@ListTranscriptionJobs' {} Maybe Natural
a -> ListTranscriptionJobs
s {$sel:maxResults:ListTranscriptionJobs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListTranscriptionJobs)

-- | If your @ListTranscriptionJobs@ request returns more results than can be
-- displayed, @NextToken@ is displayed in the response with an associated
-- string. To get the next page of results, copy this string and repeat
-- your request, including @NextToken@ with the value of the copied string.
-- Repeat as needed to view all your results.
listTranscriptionJobs_nextToken :: Lens.Lens' ListTranscriptionJobs (Prelude.Maybe Prelude.Text)
listTranscriptionJobs_nextToken :: Lens' ListTranscriptionJobs (Maybe Text)
listTranscriptionJobs_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTranscriptionJobs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTranscriptionJobs' :: ListTranscriptionJobs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTranscriptionJobs
s@ListTranscriptionJobs' {} Maybe Text
a -> ListTranscriptionJobs
s {$sel:nextToken:ListTranscriptionJobs' :: Maybe Text
nextToken = Maybe Text
a} :: ListTranscriptionJobs)

-- | Returns only transcription jobs with the specified status. Jobs are
-- ordered by creation date, with the newest job first. If you don\'t
-- include @Status@, all transcription jobs are returned.
listTranscriptionJobs_status :: Lens.Lens' ListTranscriptionJobs (Prelude.Maybe TranscriptionJobStatus)
listTranscriptionJobs_status :: Lens' ListTranscriptionJobs (Maybe TranscriptionJobStatus)
listTranscriptionJobs_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTranscriptionJobs' {Maybe TranscriptionJobStatus
status :: Maybe TranscriptionJobStatus
$sel:status:ListTranscriptionJobs' :: ListTranscriptionJobs -> Maybe TranscriptionJobStatus
status} -> Maybe TranscriptionJobStatus
status) (\s :: ListTranscriptionJobs
s@ListTranscriptionJobs' {} Maybe TranscriptionJobStatus
a -> ListTranscriptionJobs
s {$sel:status:ListTranscriptionJobs' :: Maybe TranscriptionJobStatus
status = Maybe TranscriptionJobStatus
a} :: ListTranscriptionJobs)

instance Core.AWSRequest ListTranscriptionJobs where
  type
    AWSResponse ListTranscriptionJobs =
      ListTranscriptionJobsResponse
  request :: (Service -> Service)
-> ListTranscriptionJobs -> Request ListTranscriptionJobs
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListTranscriptionJobs
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListTranscriptionJobs)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe TranscriptionJobStatus
-> Maybe [TranscriptionJobSummary]
-> Int
-> ListTranscriptionJobsResponse
ListTranscriptionJobsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"TranscriptionJobSummaries"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListTranscriptionJobs where
  hashWithSalt :: Int -> ListTranscriptionJobs -> Int
hashWithSalt Int
_salt ListTranscriptionJobs' {Maybe Natural
Maybe Text
Maybe TranscriptionJobStatus
status :: Maybe TranscriptionJobStatus
nextToken :: Maybe Text
maxResults :: Maybe Natural
jobNameContains :: Maybe Text
$sel:status:ListTranscriptionJobs' :: ListTranscriptionJobs -> Maybe TranscriptionJobStatus
$sel:nextToken:ListTranscriptionJobs' :: ListTranscriptionJobs -> Maybe Text
$sel:maxResults:ListTranscriptionJobs' :: ListTranscriptionJobs -> Maybe Natural
$sel:jobNameContains:ListTranscriptionJobs' :: ListTranscriptionJobs -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
jobNameContains
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TranscriptionJobStatus
status

instance Prelude.NFData ListTranscriptionJobs where
  rnf :: ListTranscriptionJobs -> ()
rnf ListTranscriptionJobs' {Maybe Natural
Maybe Text
Maybe TranscriptionJobStatus
status :: Maybe TranscriptionJobStatus
nextToken :: Maybe Text
maxResults :: Maybe Natural
jobNameContains :: Maybe Text
$sel:status:ListTranscriptionJobs' :: ListTranscriptionJobs -> Maybe TranscriptionJobStatus
$sel:nextToken:ListTranscriptionJobs' :: ListTranscriptionJobs -> Maybe Text
$sel:maxResults:ListTranscriptionJobs' :: ListTranscriptionJobs -> Maybe Natural
$sel:jobNameContains:ListTranscriptionJobs' :: ListTranscriptionJobs -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
jobNameContains
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TranscriptionJobStatus
status

instance Data.ToHeaders ListTranscriptionJobs where
  toHeaders :: ListTranscriptionJobs -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Transcribe.ListTranscriptionJobs" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListTranscriptionJobs where
  toJSON :: ListTranscriptionJobs -> Value
toJSON ListTranscriptionJobs' {Maybe Natural
Maybe Text
Maybe TranscriptionJobStatus
status :: Maybe TranscriptionJobStatus
nextToken :: Maybe Text
maxResults :: Maybe Natural
jobNameContains :: Maybe Text
$sel:status:ListTranscriptionJobs' :: ListTranscriptionJobs -> Maybe TranscriptionJobStatus
$sel:nextToken:ListTranscriptionJobs' :: ListTranscriptionJobs -> Maybe Text
$sel:maxResults:ListTranscriptionJobs' :: ListTranscriptionJobs -> Maybe Natural
$sel:jobNameContains:ListTranscriptionJobs' :: ListTranscriptionJobs -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"JobNameContains" 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
jobNameContains,
            (Key
"MaxResults" 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 Natural
maxResults,
            (Key
"NextToken" 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
nextToken,
            (Key
"Status" 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 TranscriptionJobStatus
status
          ]
      )

instance Data.ToPath ListTranscriptionJobs where
  toPath :: ListTranscriptionJobs -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery ListTranscriptionJobs where
  toQuery :: ListTranscriptionJobs -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListTranscriptionJobsResponse' smart constructor.
data ListTranscriptionJobsResponse = ListTranscriptionJobsResponse'
  { -- | If @NextToken@ is present in your response, it indicates that not all
    -- results are displayed. To view the next set of results, copy the string
    -- associated with the @NextToken@ parameter in your results output, then
    -- run your request again including @NextToken@ with the value of the
    -- copied string. Repeat as needed to view all your results.
    ListTranscriptionJobsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Lists all transcription jobs that have the status specified in your
    -- request. Jobs are ordered by creation date, with the newest job first.
    ListTranscriptionJobsResponse -> Maybe TranscriptionJobStatus
status :: Prelude.Maybe TranscriptionJobStatus,
    -- | Provides a summary of information about each result.
    ListTranscriptionJobsResponse -> Maybe [TranscriptionJobSummary]
transcriptionJobSummaries :: Prelude.Maybe [TranscriptionJobSummary],
    -- | The response's http status code.
    ListTranscriptionJobsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListTranscriptionJobsResponse
-> ListTranscriptionJobsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTranscriptionJobsResponse
-> ListTranscriptionJobsResponse -> Bool
$c/= :: ListTranscriptionJobsResponse
-> ListTranscriptionJobsResponse -> Bool
== :: ListTranscriptionJobsResponse
-> ListTranscriptionJobsResponse -> Bool
$c== :: ListTranscriptionJobsResponse
-> ListTranscriptionJobsResponse -> Bool
Prelude.Eq, ReadPrec [ListTranscriptionJobsResponse]
ReadPrec ListTranscriptionJobsResponse
Int -> ReadS ListTranscriptionJobsResponse
ReadS [ListTranscriptionJobsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTranscriptionJobsResponse]
$creadListPrec :: ReadPrec [ListTranscriptionJobsResponse]
readPrec :: ReadPrec ListTranscriptionJobsResponse
$creadPrec :: ReadPrec ListTranscriptionJobsResponse
readList :: ReadS [ListTranscriptionJobsResponse]
$creadList :: ReadS [ListTranscriptionJobsResponse]
readsPrec :: Int -> ReadS ListTranscriptionJobsResponse
$creadsPrec :: Int -> ReadS ListTranscriptionJobsResponse
Prelude.Read, Int -> ListTranscriptionJobsResponse -> ShowS
[ListTranscriptionJobsResponse] -> ShowS
ListTranscriptionJobsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTranscriptionJobsResponse] -> ShowS
$cshowList :: [ListTranscriptionJobsResponse] -> ShowS
show :: ListTranscriptionJobsResponse -> String
$cshow :: ListTranscriptionJobsResponse -> String
showsPrec :: Int -> ListTranscriptionJobsResponse -> ShowS
$cshowsPrec :: Int -> ListTranscriptionJobsResponse -> ShowS
Prelude.Show, forall x.
Rep ListTranscriptionJobsResponse x
-> ListTranscriptionJobsResponse
forall x.
ListTranscriptionJobsResponse
-> Rep ListTranscriptionJobsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTranscriptionJobsResponse x
-> ListTranscriptionJobsResponse
$cfrom :: forall x.
ListTranscriptionJobsResponse
-> Rep ListTranscriptionJobsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListTranscriptionJobsResponse' 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:
--
-- 'nextToken', 'listTranscriptionJobsResponse_nextToken' - If @NextToken@ is present in your response, it indicates that not all
-- results are displayed. To view the next set of results, copy the string
-- associated with the @NextToken@ parameter in your results output, then
-- run your request again including @NextToken@ with the value of the
-- copied string. Repeat as needed to view all your results.
--
-- 'status', 'listTranscriptionJobsResponse_status' - Lists all transcription jobs that have the status specified in your
-- request. Jobs are ordered by creation date, with the newest job first.
--
-- 'transcriptionJobSummaries', 'listTranscriptionJobsResponse_transcriptionJobSummaries' - Provides a summary of information about each result.
--
-- 'httpStatus', 'listTranscriptionJobsResponse_httpStatus' - The response's http status code.
newListTranscriptionJobsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListTranscriptionJobsResponse
newListTranscriptionJobsResponse :: Int -> ListTranscriptionJobsResponse
newListTranscriptionJobsResponse Int
pHttpStatus_ =
  ListTranscriptionJobsResponse'
    { $sel:nextToken:ListTranscriptionJobsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:status:ListTranscriptionJobsResponse' :: Maybe TranscriptionJobStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:transcriptionJobSummaries:ListTranscriptionJobsResponse' :: Maybe [TranscriptionJobSummary]
transcriptionJobSummaries = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListTranscriptionJobsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If @NextToken@ is present in your response, it indicates that not all
-- results are displayed. To view the next set of results, copy the string
-- associated with the @NextToken@ parameter in your results output, then
-- run your request again including @NextToken@ with the value of the
-- copied string. Repeat as needed to view all your results.
listTranscriptionJobsResponse_nextToken :: Lens.Lens' ListTranscriptionJobsResponse (Prelude.Maybe Prelude.Text)
listTranscriptionJobsResponse_nextToken :: Lens' ListTranscriptionJobsResponse (Maybe Text)
listTranscriptionJobsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTranscriptionJobsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTranscriptionJobsResponse' :: ListTranscriptionJobsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTranscriptionJobsResponse
s@ListTranscriptionJobsResponse' {} Maybe Text
a -> ListTranscriptionJobsResponse
s {$sel:nextToken:ListTranscriptionJobsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListTranscriptionJobsResponse)

-- | Lists all transcription jobs that have the status specified in your
-- request. Jobs are ordered by creation date, with the newest job first.
listTranscriptionJobsResponse_status :: Lens.Lens' ListTranscriptionJobsResponse (Prelude.Maybe TranscriptionJobStatus)
listTranscriptionJobsResponse_status :: Lens' ListTranscriptionJobsResponse (Maybe TranscriptionJobStatus)
listTranscriptionJobsResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTranscriptionJobsResponse' {Maybe TranscriptionJobStatus
status :: Maybe TranscriptionJobStatus
$sel:status:ListTranscriptionJobsResponse' :: ListTranscriptionJobsResponse -> Maybe TranscriptionJobStatus
status} -> Maybe TranscriptionJobStatus
status) (\s :: ListTranscriptionJobsResponse
s@ListTranscriptionJobsResponse' {} Maybe TranscriptionJobStatus
a -> ListTranscriptionJobsResponse
s {$sel:status:ListTranscriptionJobsResponse' :: Maybe TranscriptionJobStatus
status = Maybe TranscriptionJobStatus
a} :: ListTranscriptionJobsResponse)

-- | Provides a summary of information about each result.
listTranscriptionJobsResponse_transcriptionJobSummaries :: Lens.Lens' ListTranscriptionJobsResponse (Prelude.Maybe [TranscriptionJobSummary])
listTranscriptionJobsResponse_transcriptionJobSummaries :: Lens'
  ListTranscriptionJobsResponse (Maybe [TranscriptionJobSummary])
listTranscriptionJobsResponse_transcriptionJobSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTranscriptionJobsResponse' {Maybe [TranscriptionJobSummary]
transcriptionJobSummaries :: Maybe [TranscriptionJobSummary]
$sel:transcriptionJobSummaries:ListTranscriptionJobsResponse' :: ListTranscriptionJobsResponse -> Maybe [TranscriptionJobSummary]
transcriptionJobSummaries} -> Maybe [TranscriptionJobSummary]
transcriptionJobSummaries) (\s :: ListTranscriptionJobsResponse
s@ListTranscriptionJobsResponse' {} Maybe [TranscriptionJobSummary]
a -> ListTranscriptionJobsResponse
s {$sel:transcriptionJobSummaries:ListTranscriptionJobsResponse' :: Maybe [TranscriptionJobSummary]
transcriptionJobSummaries = Maybe [TranscriptionJobSummary]
a} :: ListTranscriptionJobsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listTranscriptionJobsResponse_httpStatus :: Lens.Lens' ListTranscriptionJobsResponse Prelude.Int
listTranscriptionJobsResponse_httpStatus :: Lens' ListTranscriptionJobsResponse Int
listTranscriptionJobsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTranscriptionJobsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListTranscriptionJobsResponse' :: ListTranscriptionJobsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListTranscriptionJobsResponse
s@ListTranscriptionJobsResponse' {} Int
a -> ListTranscriptionJobsResponse
s {$sel:httpStatus:ListTranscriptionJobsResponse' :: Int
httpStatus = Int
a} :: ListTranscriptionJobsResponse)

instance Prelude.NFData ListTranscriptionJobsResponse where
  rnf :: ListTranscriptionJobsResponse -> ()
rnf ListTranscriptionJobsResponse' {Int
Maybe [TranscriptionJobSummary]
Maybe Text
Maybe TranscriptionJobStatus
httpStatus :: Int
transcriptionJobSummaries :: Maybe [TranscriptionJobSummary]
status :: Maybe TranscriptionJobStatus
nextToken :: Maybe Text
$sel:httpStatus:ListTranscriptionJobsResponse' :: ListTranscriptionJobsResponse -> Int
$sel:transcriptionJobSummaries:ListTranscriptionJobsResponse' :: ListTranscriptionJobsResponse -> Maybe [TranscriptionJobSummary]
$sel:status:ListTranscriptionJobsResponse' :: ListTranscriptionJobsResponse -> Maybe TranscriptionJobStatus
$sel:nextToken:ListTranscriptionJobsResponse' :: ListTranscriptionJobsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TranscriptionJobStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TranscriptionJobSummary]
transcriptionJobSummaries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus