{-# 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.ListLanguageModels
-- 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)
--
-- Provides more information about the custom language models you\'ve
-- created. You can use the information in this list to find a specific
-- custom language model. You can then use the operation to get more
-- information about it.
module Amazonka.Transcribe.ListLanguageModels
  ( -- * Creating a Request
    ListLanguageModels (..),
    newListLanguageModels,

    -- * Request Lenses
    listLanguageModels_nameContains,
    listLanguageModels_nextToken,
    listLanguageModels_statusEquals,
    listLanguageModels_maxResults,

    -- * Destructuring the Response
    ListLanguageModelsResponse (..),
    newListLanguageModelsResponse,

    -- * Response Lenses
    listLanguageModelsResponse_nextToken,
    listLanguageModelsResponse_models,
    listLanguageModelsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Transcribe.Types

-- | /See:/ 'newListLanguageModels' smart constructor.
data ListLanguageModels = ListLanguageModels'
  { -- | When specified, the custom language model names returned contain the
    -- substring you\'ve specified.
    ListLanguageModels -> Maybe Text
nameContains :: Prelude.Maybe Prelude.Text,
    -- | When included, fetches the next set of jobs if the result of the
    -- previous request was truncated.
    ListLanguageModels -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | When specified, returns only custom language models with the specified
    -- status. Language models are ordered by creation date, with the newest
    -- models first. If you don\'t specify a status, Amazon Transcribe returns
    -- all custom language models ordered by date.
    ListLanguageModels -> Maybe ModelStatus
statusEquals :: Prelude.Maybe ModelStatus,
    -- | The maximum number of language models to return in each page of results.
    -- If there are fewer results than the value you specify, only the actual
    -- results are returned. If you do not specify a value, the default of 5 is
    -- used.
    ListLanguageModels -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListLanguageModels -> ListLanguageModels -> Bool
(ListLanguageModels -> ListLanguageModels -> Bool)
-> (ListLanguageModels -> ListLanguageModels -> Bool)
-> Eq ListLanguageModels
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLanguageModels -> ListLanguageModels -> Bool
$c/= :: ListLanguageModels -> ListLanguageModels -> Bool
== :: ListLanguageModels -> ListLanguageModels -> Bool
$c== :: ListLanguageModels -> ListLanguageModels -> Bool
Prelude.Eq, ReadPrec [ListLanguageModels]
ReadPrec ListLanguageModels
Int -> ReadS ListLanguageModels
ReadS [ListLanguageModels]
(Int -> ReadS ListLanguageModels)
-> ReadS [ListLanguageModels]
-> ReadPrec ListLanguageModels
-> ReadPrec [ListLanguageModels]
-> Read ListLanguageModels
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLanguageModels]
$creadListPrec :: ReadPrec [ListLanguageModels]
readPrec :: ReadPrec ListLanguageModels
$creadPrec :: ReadPrec ListLanguageModels
readList :: ReadS [ListLanguageModels]
$creadList :: ReadS [ListLanguageModels]
readsPrec :: Int -> ReadS ListLanguageModels
$creadsPrec :: Int -> ReadS ListLanguageModels
Prelude.Read, Int -> ListLanguageModels -> ShowS
[ListLanguageModels] -> ShowS
ListLanguageModels -> String
(Int -> ListLanguageModels -> ShowS)
-> (ListLanguageModels -> String)
-> ([ListLanguageModels] -> ShowS)
-> Show ListLanguageModels
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLanguageModels] -> ShowS
$cshowList :: [ListLanguageModels] -> ShowS
show :: ListLanguageModels -> String
$cshow :: ListLanguageModels -> String
showsPrec :: Int -> ListLanguageModels -> ShowS
$cshowsPrec :: Int -> ListLanguageModels -> ShowS
Prelude.Show, (forall x. ListLanguageModels -> Rep ListLanguageModels x)
-> (forall x. Rep ListLanguageModels x -> ListLanguageModels)
-> Generic ListLanguageModels
forall x. Rep ListLanguageModels x -> ListLanguageModels
forall x. ListLanguageModels -> Rep ListLanguageModels x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListLanguageModels x -> ListLanguageModels
$cfrom :: forall x. ListLanguageModels -> Rep ListLanguageModels x
Prelude.Generic)

-- |
-- Create a value of 'ListLanguageModels' 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:
--
-- 'nameContains', 'listLanguageModels_nameContains' - When specified, the custom language model names returned contain the
-- substring you\'ve specified.
--
-- 'nextToken', 'listLanguageModels_nextToken' - When included, fetches the next set of jobs if the result of the
-- previous request was truncated.
--
-- 'statusEquals', 'listLanguageModels_statusEquals' - When specified, returns only custom language models with the specified
-- status. Language models are ordered by creation date, with the newest
-- models first. If you don\'t specify a status, Amazon Transcribe returns
-- all custom language models ordered by date.
--
-- 'maxResults', 'listLanguageModels_maxResults' - The maximum number of language models to return in each page of results.
-- If there are fewer results than the value you specify, only the actual
-- results are returned. If you do not specify a value, the default of 5 is
-- used.
newListLanguageModels ::
  ListLanguageModels
newListLanguageModels :: ListLanguageModels
newListLanguageModels =
  ListLanguageModels' :: Maybe Text
-> Maybe Text
-> Maybe ModelStatus
-> Maybe Natural
-> ListLanguageModels
ListLanguageModels'
    { $sel:nameContains:ListLanguageModels' :: Maybe Text
nameContains = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListLanguageModels' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusEquals:ListLanguageModels' :: Maybe ModelStatus
statusEquals = Maybe ModelStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListLanguageModels' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | When specified, the custom language model names returned contain the
-- substring you\'ve specified.
listLanguageModels_nameContains :: Lens.Lens' ListLanguageModels (Prelude.Maybe Prelude.Text)
listLanguageModels_nameContains :: (Maybe Text -> f (Maybe Text))
-> ListLanguageModels -> f ListLanguageModels
listLanguageModels_nameContains = (ListLanguageModels -> Maybe Text)
-> (ListLanguageModels -> Maybe Text -> ListLanguageModels)
-> Lens
     ListLanguageModels ListLanguageModels (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLanguageModels' {Maybe Text
nameContains :: Maybe Text
$sel:nameContains:ListLanguageModels' :: ListLanguageModels -> Maybe Text
nameContains} -> Maybe Text
nameContains) (\s :: ListLanguageModels
s@ListLanguageModels' {} Maybe Text
a -> ListLanguageModels
s {$sel:nameContains:ListLanguageModels' :: Maybe Text
nameContains = Maybe Text
a} :: ListLanguageModels)

-- | When included, fetches the next set of jobs if the result of the
-- previous request was truncated.
listLanguageModels_nextToken :: Lens.Lens' ListLanguageModels (Prelude.Maybe Prelude.Text)
listLanguageModels_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListLanguageModels -> f ListLanguageModels
listLanguageModels_nextToken = (ListLanguageModels -> Maybe Text)
-> (ListLanguageModels -> Maybe Text -> ListLanguageModels)
-> Lens
     ListLanguageModels ListLanguageModels (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLanguageModels' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLanguageModels' :: ListLanguageModels -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLanguageModels
s@ListLanguageModels' {} Maybe Text
a -> ListLanguageModels
s {$sel:nextToken:ListLanguageModels' :: Maybe Text
nextToken = Maybe Text
a} :: ListLanguageModels)

-- | When specified, returns only custom language models with the specified
-- status. Language models are ordered by creation date, with the newest
-- models first. If you don\'t specify a status, Amazon Transcribe returns
-- all custom language models ordered by date.
listLanguageModels_statusEquals :: Lens.Lens' ListLanguageModels (Prelude.Maybe ModelStatus)
listLanguageModels_statusEquals :: (Maybe ModelStatus -> f (Maybe ModelStatus))
-> ListLanguageModels -> f ListLanguageModels
listLanguageModels_statusEquals = (ListLanguageModels -> Maybe ModelStatus)
-> (ListLanguageModels -> Maybe ModelStatus -> ListLanguageModels)
-> Lens
     ListLanguageModels
     ListLanguageModels
     (Maybe ModelStatus)
     (Maybe ModelStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLanguageModels' {Maybe ModelStatus
statusEquals :: Maybe ModelStatus
$sel:statusEquals:ListLanguageModels' :: ListLanguageModels -> Maybe ModelStatus
statusEquals} -> Maybe ModelStatus
statusEquals) (\s :: ListLanguageModels
s@ListLanguageModels' {} Maybe ModelStatus
a -> ListLanguageModels
s {$sel:statusEquals:ListLanguageModels' :: Maybe ModelStatus
statusEquals = Maybe ModelStatus
a} :: ListLanguageModels)

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

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

instance Prelude.Hashable ListLanguageModels

instance Prelude.NFData ListLanguageModels

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

instance Core.ToJSON ListLanguageModels where
  toJSON :: ListLanguageModels -> Value
toJSON ListLanguageModels' {Maybe Natural
Maybe Text
Maybe ModelStatus
maxResults :: Maybe Natural
statusEquals :: Maybe ModelStatus
nextToken :: Maybe Text
nameContains :: Maybe Text
$sel:maxResults:ListLanguageModels' :: ListLanguageModels -> Maybe Natural
$sel:statusEquals:ListLanguageModels' :: ListLanguageModels -> Maybe ModelStatus
$sel:nextToken:ListLanguageModels' :: ListLanguageModels -> Maybe Text
$sel:nameContains:ListLanguageModels' :: ListLanguageModels -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NameContains" 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
nameContains,
            (Text
"NextToken" 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
nextToken,
            (Text
"StatusEquals" Text -> ModelStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ModelStatus -> Pair) -> Maybe ModelStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ModelStatus
statusEquals,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

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

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

-- | /See:/ 'newListLanguageModelsResponse' smart constructor.
data ListLanguageModelsResponse = ListLanguageModelsResponse'
  { -- | The operation returns a page of jobs at a time. The maximum size of the
    -- list is set by the MaxResults parameter. If there are more language
    -- models in the list than the page size, Amazon Transcribe returns the
    -- @NextPage@ token. Include the token in the next request to the operation
    -- to return the next page of language models.
    ListLanguageModelsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of objects containing information about custom language models.
    ListLanguageModelsResponse -> Maybe [LanguageModel]
models :: Prelude.Maybe [LanguageModel],
    -- | The response's http status code.
    ListLanguageModelsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListLanguageModelsResponse -> ListLanguageModelsResponse -> Bool
(ListLanguageModelsResponse -> ListLanguageModelsResponse -> Bool)
-> (ListLanguageModelsResponse
    -> ListLanguageModelsResponse -> Bool)
-> Eq ListLanguageModelsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLanguageModelsResponse -> ListLanguageModelsResponse -> Bool
$c/= :: ListLanguageModelsResponse -> ListLanguageModelsResponse -> Bool
== :: ListLanguageModelsResponse -> ListLanguageModelsResponse -> Bool
$c== :: ListLanguageModelsResponse -> ListLanguageModelsResponse -> Bool
Prelude.Eq, ReadPrec [ListLanguageModelsResponse]
ReadPrec ListLanguageModelsResponse
Int -> ReadS ListLanguageModelsResponse
ReadS [ListLanguageModelsResponse]
(Int -> ReadS ListLanguageModelsResponse)
-> ReadS [ListLanguageModelsResponse]
-> ReadPrec ListLanguageModelsResponse
-> ReadPrec [ListLanguageModelsResponse]
-> Read ListLanguageModelsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLanguageModelsResponse]
$creadListPrec :: ReadPrec [ListLanguageModelsResponse]
readPrec :: ReadPrec ListLanguageModelsResponse
$creadPrec :: ReadPrec ListLanguageModelsResponse
readList :: ReadS [ListLanguageModelsResponse]
$creadList :: ReadS [ListLanguageModelsResponse]
readsPrec :: Int -> ReadS ListLanguageModelsResponse
$creadsPrec :: Int -> ReadS ListLanguageModelsResponse
Prelude.Read, Int -> ListLanguageModelsResponse -> ShowS
[ListLanguageModelsResponse] -> ShowS
ListLanguageModelsResponse -> String
(Int -> ListLanguageModelsResponse -> ShowS)
-> (ListLanguageModelsResponse -> String)
-> ([ListLanguageModelsResponse] -> ShowS)
-> Show ListLanguageModelsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLanguageModelsResponse] -> ShowS
$cshowList :: [ListLanguageModelsResponse] -> ShowS
show :: ListLanguageModelsResponse -> String
$cshow :: ListLanguageModelsResponse -> String
showsPrec :: Int -> ListLanguageModelsResponse -> ShowS
$cshowsPrec :: Int -> ListLanguageModelsResponse -> ShowS
Prelude.Show, (forall x.
 ListLanguageModelsResponse -> Rep ListLanguageModelsResponse x)
-> (forall x.
    Rep ListLanguageModelsResponse x -> ListLanguageModelsResponse)
-> Generic ListLanguageModelsResponse
forall x.
Rep ListLanguageModelsResponse x -> ListLanguageModelsResponse
forall x.
ListLanguageModelsResponse -> Rep ListLanguageModelsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListLanguageModelsResponse x -> ListLanguageModelsResponse
$cfrom :: forall x.
ListLanguageModelsResponse -> Rep ListLanguageModelsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListLanguageModelsResponse' 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', 'listLanguageModelsResponse_nextToken' - The operation returns a page of jobs at a time. The maximum size of the
-- list is set by the MaxResults parameter. If there are more language
-- models in the list than the page size, Amazon Transcribe returns the
-- @NextPage@ token. Include the token in the next request to the operation
-- to return the next page of language models.
--
-- 'models', 'listLanguageModelsResponse_models' - A list of objects containing information about custom language models.
--
-- 'httpStatus', 'listLanguageModelsResponse_httpStatus' - The response's http status code.
newListLanguageModelsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListLanguageModelsResponse
newListLanguageModelsResponse :: Int -> ListLanguageModelsResponse
newListLanguageModelsResponse Int
pHttpStatus_ =
  ListLanguageModelsResponse' :: Maybe Text
-> Maybe [LanguageModel] -> Int -> ListLanguageModelsResponse
ListLanguageModelsResponse'
    { $sel:nextToken:ListLanguageModelsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:models:ListLanguageModelsResponse' :: Maybe [LanguageModel]
models = Maybe [LanguageModel]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListLanguageModelsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The operation returns a page of jobs at a time. The maximum size of the
-- list is set by the MaxResults parameter. If there are more language
-- models in the list than the page size, Amazon Transcribe returns the
-- @NextPage@ token. Include the token in the next request to the operation
-- to return the next page of language models.
listLanguageModelsResponse_nextToken :: Lens.Lens' ListLanguageModelsResponse (Prelude.Maybe Prelude.Text)
listLanguageModelsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListLanguageModelsResponse -> f ListLanguageModelsResponse
listLanguageModelsResponse_nextToken = (ListLanguageModelsResponse -> Maybe Text)
-> (ListLanguageModelsResponse
    -> Maybe Text -> ListLanguageModelsResponse)
-> Lens
     ListLanguageModelsResponse
     ListLanguageModelsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLanguageModelsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLanguageModelsResponse' :: ListLanguageModelsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLanguageModelsResponse
s@ListLanguageModelsResponse' {} Maybe Text
a -> ListLanguageModelsResponse
s {$sel:nextToken:ListLanguageModelsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListLanguageModelsResponse)

-- | A list of objects containing information about custom language models.
listLanguageModelsResponse_models :: Lens.Lens' ListLanguageModelsResponse (Prelude.Maybe [LanguageModel])
listLanguageModelsResponse_models :: (Maybe [LanguageModel] -> f (Maybe [LanguageModel]))
-> ListLanguageModelsResponse -> f ListLanguageModelsResponse
listLanguageModelsResponse_models = (ListLanguageModelsResponse -> Maybe [LanguageModel])
-> (ListLanguageModelsResponse
    -> Maybe [LanguageModel] -> ListLanguageModelsResponse)
-> Lens
     ListLanguageModelsResponse
     ListLanguageModelsResponse
     (Maybe [LanguageModel])
     (Maybe [LanguageModel])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLanguageModelsResponse' {Maybe [LanguageModel]
models :: Maybe [LanguageModel]
$sel:models:ListLanguageModelsResponse' :: ListLanguageModelsResponse -> Maybe [LanguageModel]
models} -> Maybe [LanguageModel]
models) (\s :: ListLanguageModelsResponse
s@ListLanguageModelsResponse' {} Maybe [LanguageModel]
a -> ListLanguageModelsResponse
s {$sel:models:ListLanguageModelsResponse' :: Maybe [LanguageModel]
models = Maybe [LanguageModel]
a} :: ListLanguageModelsResponse) ((Maybe [LanguageModel] -> f (Maybe [LanguageModel]))
 -> ListLanguageModelsResponse -> f ListLanguageModelsResponse)
-> ((Maybe [LanguageModel] -> f (Maybe [LanguageModel]))
    -> Maybe [LanguageModel] -> f (Maybe [LanguageModel]))
-> (Maybe [LanguageModel] -> f (Maybe [LanguageModel]))
-> ListLanguageModelsResponse
-> f ListLanguageModelsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [LanguageModel] [LanguageModel] [LanguageModel] [LanguageModel]
-> Iso
     (Maybe [LanguageModel])
     (Maybe [LanguageModel])
     (Maybe [LanguageModel])
     (Maybe [LanguageModel])
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 AnIso
  [LanguageModel] [LanguageModel] [LanguageModel] [LanguageModel]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListLanguageModelsResponse