{-# 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.ListVocabularies
-- 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)
--
-- Returns a list of vocabularies that match the specified criteria. If no
-- criteria are specified, returns the entire list of vocabularies.
module Amazonka.Transcribe.ListVocabularies
  ( -- * Creating a Request
    ListVocabularies (..),
    newListVocabularies,

    -- * Request Lenses
    listVocabularies_nameContains,
    listVocabularies_nextToken,
    listVocabularies_stateEquals,
    listVocabularies_maxResults,

    -- * Destructuring the Response
    ListVocabulariesResponse (..),
    newListVocabulariesResponse,

    -- * Response Lenses
    listVocabulariesResponse_vocabularies,
    listVocabulariesResponse_status,
    listVocabulariesResponse_nextToken,
    listVocabulariesResponse_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:/ 'newListVocabularies' smart constructor.
data ListVocabularies = ListVocabularies'
  { -- | When specified, the vocabularies returned in the list are limited to
    -- vocabularies whose name contains the specified string. The search is not
    -- case sensitive, @ListVocabularies@ returns both \"vocabularyname\" and
    -- \"VocabularyName\" in the response list.
    ListVocabularies -> Maybe Text
nameContains :: Prelude.Maybe Prelude.Text,
    -- | If the result of the previous request to @ListVocabularies@ was
    -- truncated, include the @NextToken@ to fetch the next set of jobs.
    ListVocabularies -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | When specified, only returns vocabularies with the @VocabularyState@
    -- field equal to the specified state.
    ListVocabularies -> Maybe VocabularyState
stateEquals :: Prelude.Maybe VocabularyState,
    -- | The maximum number of vocabularies 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.
    ListVocabularies -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListVocabularies -> ListVocabularies -> Bool
(ListVocabularies -> ListVocabularies -> Bool)
-> (ListVocabularies -> ListVocabularies -> Bool)
-> Eq ListVocabularies
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVocabularies -> ListVocabularies -> Bool
$c/= :: ListVocabularies -> ListVocabularies -> Bool
== :: ListVocabularies -> ListVocabularies -> Bool
$c== :: ListVocabularies -> ListVocabularies -> Bool
Prelude.Eq, ReadPrec [ListVocabularies]
ReadPrec ListVocabularies
Int -> ReadS ListVocabularies
ReadS [ListVocabularies]
(Int -> ReadS ListVocabularies)
-> ReadS [ListVocabularies]
-> ReadPrec ListVocabularies
-> ReadPrec [ListVocabularies]
-> Read ListVocabularies
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVocabularies]
$creadListPrec :: ReadPrec [ListVocabularies]
readPrec :: ReadPrec ListVocabularies
$creadPrec :: ReadPrec ListVocabularies
readList :: ReadS [ListVocabularies]
$creadList :: ReadS [ListVocabularies]
readsPrec :: Int -> ReadS ListVocabularies
$creadsPrec :: Int -> ReadS ListVocabularies
Prelude.Read, Int -> ListVocabularies -> ShowS
[ListVocabularies] -> ShowS
ListVocabularies -> String
(Int -> ListVocabularies -> ShowS)
-> (ListVocabularies -> String)
-> ([ListVocabularies] -> ShowS)
-> Show ListVocabularies
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVocabularies] -> ShowS
$cshowList :: [ListVocabularies] -> ShowS
show :: ListVocabularies -> String
$cshow :: ListVocabularies -> String
showsPrec :: Int -> ListVocabularies -> ShowS
$cshowsPrec :: Int -> ListVocabularies -> ShowS
Prelude.Show, (forall x. ListVocabularies -> Rep ListVocabularies x)
-> (forall x. Rep ListVocabularies x -> ListVocabularies)
-> Generic ListVocabularies
forall x. Rep ListVocabularies x -> ListVocabularies
forall x. ListVocabularies -> Rep ListVocabularies x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListVocabularies x -> ListVocabularies
$cfrom :: forall x. ListVocabularies -> Rep ListVocabularies x
Prelude.Generic)

-- |
-- Create a value of 'ListVocabularies' 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', 'listVocabularies_nameContains' - When specified, the vocabularies returned in the list are limited to
-- vocabularies whose name contains the specified string. The search is not
-- case sensitive, @ListVocabularies@ returns both \"vocabularyname\" and
-- \"VocabularyName\" in the response list.
--
-- 'nextToken', 'listVocabularies_nextToken' - If the result of the previous request to @ListVocabularies@ was
-- truncated, include the @NextToken@ to fetch the next set of jobs.
--
-- 'stateEquals', 'listVocabularies_stateEquals' - When specified, only returns vocabularies with the @VocabularyState@
-- field equal to the specified state.
--
-- 'maxResults', 'listVocabularies_maxResults' - The maximum number of vocabularies 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.
newListVocabularies ::
  ListVocabularies
newListVocabularies :: ListVocabularies
newListVocabularies =
  ListVocabularies' :: Maybe Text
-> Maybe Text
-> Maybe VocabularyState
-> Maybe Natural
-> ListVocabularies
ListVocabularies'
    { $sel:nameContains:ListVocabularies' :: Maybe Text
nameContains = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListVocabularies' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stateEquals:ListVocabularies' :: Maybe VocabularyState
stateEquals = Maybe VocabularyState
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListVocabularies' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | When specified, the vocabularies returned in the list are limited to
-- vocabularies whose name contains the specified string. The search is not
-- case sensitive, @ListVocabularies@ returns both \"vocabularyname\" and
-- \"VocabularyName\" in the response list.
listVocabularies_nameContains :: Lens.Lens' ListVocabularies (Prelude.Maybe Prelude.Text)
listVocabularies_nameContains :: (Maybe Text -> f (Maybe Text))
-> ListVocabularies -> f ListVocabularies
listVocabularies_nameContains = (ListVocabularies -> Maybe Text)
-> (ListVocabularies -> Maybe Text -> ListVocabularies)
-> Lens ListVocabularies ListVocabularies (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVocabularies' {Maybe Text
nameContains :: Maybe Text
$sel:nameContains:ListVocabularies' :: ListVocabularies -> Maybe Text
nameContains} -> Maybe Text
nameContains) (\s :: ListVocabularies
s@ListVocabularies' {} Maybe Text
a -> ListVocabularies
s {$sel:nameContains:ListVocabularies' :: Maybe Text
nameContains = Maybe Text
a} :: ListVocabularies)

-- | If the result of the previous request to @ListVocabularies@ was
-- truncated, include the @NextToken@ to fetch the next set of jobs.
listVocabularies_nextToken :: Lens.Lens' ListVocabularies (Prelude.Maybe Prelude.Text)
listVocabularies_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListVocabularies -> f ListVocabularies
listVocabularies_nextToken = (ListVocabularies -> Maybe Text)
-> (ListVocabularies -> Maybe Text -> ListVocabularies)
-> Lens ListVocabularies ListVocabularies (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVocabularies' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListVocabularies' :: ListVocabularies -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListVocabularies
s@ListVocabularies' {} Maybe Text
a -> ListVocabularies
s {$sel:nextToken:ListVocabularies' :: Maybe Text
nextToken = Maybe Text
a} :: ListVocabularies)

-- | When specified, only returns vocabularies with the @VocabularyState@
-- field equal to the specified state.
listVocabularies_stateEquals :: Lens.Lens' ListVocabularies (Prelude.Maybe VocabularyState)
listVocabularies_stateEquals :: (Maybe VocabularyState -> f (Maybe VocabularyState))
-> ListVocabularies -> f ListVocabularies
listVocabularies_stateEquals = (ListVocabularies -> Maybe VocabularyState)
-> (ListVocabularies -> Maybe VocabularyState -> ListVocabularies)
-> Lens
     ListVocabularies
     ListVocabularies
     (Maybe VocabularyState)
     (Maybe VocabularyState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVocabularies' {Maybe VocabularyState
stateEquals :: Maybe VocabularyState
$sel:stateEquals:ListVocabularies' :: ListVocabularies -> Maybe VocabularyState
stateEquals} -> Maybe VocabularyState
stateEquals) (\s :: ListVocabularies
s@ListVocabularies' {} Maybe VocabularyState
a -> ListVocabularies
s {$sel:stateEquals:ListVocabularies' :: Maybe VocabularyState
stateEquals = Maybe VocabularyState
a} :: ListVocabularies)

-- | The maximum number of vocabularies 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.
listVocabularies_maxResults :: Lens.Lens' ListVocabularies (Prelude.Maybe Prelude.Natural)
listVocabularies_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListVocabularies -> f ListVocabularies
listVocabularies_maxResults = (ListVocabularies -> Maybe Natural)
-> (ListVocabularies -> Maybe Natural -> ListVocabularies)
-> Lens
     ListVocabularies ListVocabularies (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVocabularies' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListVocabularies' :: ListVocabularies -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListVocabularies
s@ListVocabularies' {} Maybe Natural
a -> ListVocabularies
s {$sel:maxResults:ListVocabularies' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListVocabularies)

instance Core.AWSRequest ListVocabularies where
  type
    AWSResponse ListVocabularies =
      ListVocabulariesResponse
  request :: ListVocabularies -> Request ListVocabularies
request = Service -> ListVocabularies -> Request ListVocabularies
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListVocabularies
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListVocabularies)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListVocabularies))
-> Logger
-> Service
-> Proxy ListVocabularies
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListVocabularies)))
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 [VocabularyInfo]
-> Maybe VocabularyState
-> Maybe Text
-> Int
-> ListVocabulariesResponse
ListVocabulariesResponse'
            (Maybe [VocabularyInfo]
 -> Maybe VocabularyState
 -> Maybe Text
 -> Int
 -> ListVocabulariesResponse)
-> Either String (Maybe [VocabularyInfo])
-> Either
     String
     (Maybe VocabularyState
      -> Maybe Text -> Int -> ListVocabulariesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [VocabularyInfo]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Vocabularies" Either String (Maybe (Maybe [VocabularyInfo]))
-> Maybe [VocabularyInfo] -> Either String (Maybe [VocabularyInfo])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [VocabularyInfo]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe VocabularyState
   -> Maybe Text -> Int -> ListVocabulariesResponse)
-> Either String (Maybe VocabularyState)
-> Either String (Maybe Text -> Int -> ListVocabulariesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe VocabularyState)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
            Either String (Maybe Text -> Int -> ListVocabulariesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListVocabulariesResponse)
forall (f :: * -> *) a b. Applicative f => 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 (Int -> ListVocabulariesResponse)
-> Either String Int -> Either String ListVocabulariesResponse
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 ListVocabularies

instance Prelude.NFData ListVocabularies

instance Core.ToHeaders ListVocabularies where
  toHeaders :: ListVocabularies -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListVocabularies -> 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.ListVocabularies" ::
                          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 ListVocabularies where
  toJSON :: ListVocabularies -> Value
toJSON ListVocabularies' {Maybe Natural
Maybe Text
Maybe VocabularyState
maxResults :: Maybe Natural
stateEquals :: Maybe VocabularyState
nextToken :: Maybe Text
nameContains :: Maybe Text
$sel:maxResults:ListVocabularies' :: ListVocabularies -> Maybe Natural
$sel:stateEquals:ListVocabularies' :: ListVocabularies -> Maybe VocabularyState
$sel:nextToken:ListVocabularies' :: ListVocabularies -> Maybe Text
$sel:nameContains:ListVocabularies' :: ListVocabularies -> 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
"StateEquals" Text -> VocabularyState -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VocabularyState -> Pair) -> Maybe VocabularyState -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VocabularyState
stateEquals,
            (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 ListVocabularies where
  toPath :: ListVocabularies -> ByteString
toPath = ByteString -> ListVocabularies -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newListVocabulariesResponse' smart constructor.
data ListVocabulariesResponse = ListVocabulariesResponse'
  { -- | A list of objects that describe the vocabularies that match the search
    -- criteria in the request.
    ListVocabulariesResponse -> Maybe [VocabularyInfo]
vocabularies :: Prelude.Maybe [VocabularyInfo],
    -- | The requested vocabulary state.
    ListVocabulariesResponse -> Maybe VocabularyState
status :: Prelude.Maybe VocabularyState,
    -- | The @ListVocabularies@ operation returns a page of vocabularies at a
    -- time. The maximum size of the page is set in the @MaxResults@ parameter.
    -- If there are more jobs in the list than will fit on the page, Amazon
    -- Transcribe returns the @NextPage@ token. To return in the next page of
    -- jobs, include the token in the next request to the @ListVocabularies@
    -- operation.
    ListVocabulariesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListVocabulariesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListVocabulariesResponse -> ListVocabulariesResponse -> Bool
(ListVocabulariesResponse -> ListVocabulariesResponse -> Bool)
-> (ListVocabulariesResponse -> ListVocabulariesResponse -> Bool)
-> Eq ListVocabulariesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVocabulariesResponse -> ListVocabulariesResponse -> Bool
$c/= :: ListVocabulariesResponse -> ListVocabulariesResponse -> Bool
== :: ListVocabulariesResponse -> ListVocabulariesResponse -> Bool
$c== :: ListVocabulariesResponse -> ListVocabulariesResponse -> Bool
Prelude.Eq, ReadPrec [ListVocabulariesResponse]
ReadPrec ListVocabulariesResponse
Int -> ReadS ListVocabulariesResponse
ReadS [ListVocabulariesResponse]
(Int -> ReadS ListVocabulariesResponse)
-> ReadS [ListVocabulariesResponse]
-> ReadPrec ListVocabulariesResponse
-> ReadPrec [ListVocabulariesResponse]
-> Read ListVocabulariesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVocabulariesResponse]
$creadListPrec :: ReadPrec [ListVocabulariesResponse]
readPrec :: ReadPrec ListVocabulariesResponse
$creadPrec :: ReadPrec ListVocabulariesResponse
readList :: ReadS [ListVocabulariesResponse]
$creadList :: ReadS [ListVocabulariesResponse]
readsPrec :: Int -> ReadS ListVocabulariesResponse
$creadsPrec :: Int -> ReadS ListVocabulariesResponse
Prelude.Read, Int -> ListVocabulariesResponse -> ShowS
[ListVocabulariesResponse] -> ShowS
ListVocabulariesResponse -> String
(Int -> ListVocabulariesResponse -> ShowS)
-> (ListVocabulariesResponse -> String)
-> ([ListVocabulariesResponse] -> ShowS)
-> Show ListVocabulariesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVocabulariesResponse] -> ShowS
$cshowList :: [ListVocabulariesResponse] -> ShowS
show :: ListVocabulariesResponse -> String
$cshow :: ListVocabulariesResponse -> String
showsPrec :: Int -> ListVocabulariesResponse -> ShowS
$cshowsPrec :: Int -> ListVocabulariesResponse -> ShowS
Prelude.Show, (forall x.
 ListVocabulariesResponse -> Rep ListVocabulariesResponse x)
-> (forall x.
    Rep ListVocabulariesResponse x -> ListVocabulariesResponse)
-> Generic ListVocabulariesResponse
forall x.
Rep ListVocabulariesResponse x -> ListVocabulariesResponse
forall x.
ListVocabulariesResponse -> Rep ListVocabulariesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListVocabulariesResponse x -> ListVocabulariesResponse
$cfrom :: forall x.
ListVocabulariesResponse -> Rep ListVocabulariesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListVocabulariesResponse' 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:
--
-- 'vocabularies', 'listVocabulariesResponse_vocabularies' - A list of objects that describe the vocabularies that match the search
-- criteria in the request.
--
-- 'status', 'listVocabulariesResponse_status' - The requested vocabulary state.
--
-- 'nextToken', 'listVocabulariesResponse_nextToken' - The @ListVocabularies@ operation returns a page of vocabularies at a
-- time. The maximum size of the page is set in the @MaxResults@ parameter.
-- If there are more jobs in the list than will fit on the page, Amazon
-- Transcribe returns the @NextPage@ token. To return in the next page of
-- jobs, include the token in the next request to the @ListVocabularies@
-- operation.
--
-- 'httpStatus', 'listVocabulariesResponse_httpStatus' - The response's http status code.
newListVocabulariesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListVocabulariesResponse
newListVocabulariesResponse :: Int -> ListVocabulariesResponse
newListVocabulariesResponse Int
pHttpStatus_ =
  ListVocabulariesResponse' :: Maybe [VocabularyInfo]
-> Maybe VocabularyState
-> Maybe Text
-> Int
-> ListVocabulariesResponse
ListVocabulariesResponse'
    { $sel:vocabularies:ListVocabulariesResponse' :: Maybe [VocabularyInfo]
vocabularies =
        Maybe [VocabularyInfo]
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ListVocabulariesResponse' :: Maybe VocabularyState
status = Maybe VocabularyState
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListVocabulariesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListVocabulariesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of objects that describe the vocabularies that match the search
-- criteria in the request.
listVocabulariesResponse_vocabularies :: Lens.Lens' ListVocabulariesResponse (Prelude.Maybe [VocabularyInfo])
listVocabulariesResponse_vocabularies :: (Maybe [VocabularyInfo] -> f (Maybe [VocabularyInfo]))
-> ListVocabulariesResponse -> f ListVocabulariesResponse
listVocabulariesResponse_vocabularies = (ListVocabulariesResponse -> Maybe [VocabularyInfo])
-> (ListVocabulariesResponse
    -> Maybe [VocabularyInfo] -> ListVocabulariesResponse)
-> Lens
     ListVocabulariesResponse
     ListVocabulariesResponse
     (Maybe [VocabularyInfo])
     (Maybe [VocabularyInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVocabulariesResponse' {Maybe [VocabularyInfo]
vocabularies :: Maybe [VocabularyInfo]
$sel:vocabularies:ListVocabulariesResponse' :: ListVocabulariesResponse -> Maybe [VocabularyInfo]
vocabularies} -> Maybe [VocabularyInfo]
vocabularies) (\s :: ListVocabulariesResponse
s@ListVocabulariesResponse' {} Maybe [VocabularyInfo]
a -> ListVocabulariesResponse
s {$sel:vocabularies:ListVocabulariesResponse' :: Maybe [VocabularyInfo]
vocabularies = Maybe [VocabularyInfo]
a} :: ListVocabulariesResponse) ((Maybe [VocabularyInfo] -> f (Maybe [VocabularyInfo]))
 -> ListVocabulariesResponse -> f ListVocabulariesResponse)
-> ((Maybe [VocabularyInfo] -> f (Maybe [VocabularyInfo]))
    -> Maybe [VocabularyInfo] -> f (Maybe [VocabularyInfo]))
-> (Maybe [VocabularyInfo] -> f (Maybe [VocabularyInfo]))
-> ListVocabulariesResponse
-> f ListVocabulariesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [VocabularyInfo] [VocabularyInfo] [VocabularyInfo] [VocabularyInfo]
-> Iso
     (Maybe [VocabularyInfo])
     (Maybe [VocabularyInfo])
     (Maybe [VocabularyInfo])
     (Maybe [VocabularyInfo])
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
  [VocabularyInfo] [VocabularyInfo] [VocabularyInfo] [VocabularyInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The requested vocabulary state.
listVocabulariesResponse_status :: Lens.Lens' ListVocabulariesResponse (Prelude.Maybe VocabularyState)
listVocabulariesResponse_status :: (Maybe VocabularyState -> f (Maybe VocabularyState))
-> ListVocabulariesResponse -> f ListVocabulariesResponse
listVocabulariesResponse_status = (ListVocabulariesResponse -> Maybe VocabularyState)
-> (ListVocabulariesResponse
    -> Maybe VocabularyState -> ListVocabulariesResponse)
-> Lens
     ListVocabulariesResponse
     ListVocabulariesResponse
     (Maybe VocabularyState)
     (Maybe VocabularyState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVocabulariesResponse' {Maybe VocabularyState
status :: Maybe VocabularyState
$sel:status:ListVocabulariesResponse' :: ListVocabulariesResponse -> Maybe VocabularyState
status} -> Maybe VocabularyState
status) (\s :: ListVocabulariesResponse
s@ListVocabulariesResponse' {} Maybe VocabularyState
a -> ListVocabulariesResponse
s {$sel:status:ListVocabulariesResponse' :: Maybe VocabularyState
status = Maybe VocabularyState
a} :: ListVocabulariesResponse)

-- | The @ListVocabularies@ operation returns a page of vocabularies at a
-- time. The maximum size of the page is set in the @MaxResults@ parameter.
-- If there are more jobs in the list than will fit on the page, Amazon
-- Transcribe returns the @NextPage@ token. To return in the next page of
-- jobs, include the token in the next request to the @ListVocabularies@
-- operation.
listVocabulariesResponse_nextToken :: Lens.Lens' ListVocabulariesResponse (Prelude.Maybe Prelude.Text)
listVocabulariesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListVocabulariesResponse -> f ListVocabulariesResponse
listVocabulariesResponse_nextToken = (ListVocabulariesResponse -> Maybe Text)
-> (ListVocabulariesResponse
    -> Maybe Text -> ListVocabulariesResponse)
-> Lens
     ListVocabulariesResponse
     ListVocabulariesResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVocabulariesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListVocabulariesResponse' :: ListVocabulariesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListVocabulariesResponse
s@ListVocabulariesResponse' {} Maybe Text
a -> ListVocabulariesResponse
s {$sel:nextToken:ListVocabulariesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListVocabulariesResponse)

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

instance Prelude.NFData ListVocabulariesResponse