listVocabularies method

Future<ListVocabulariesResponse> listVocabularies({
  1. int? maxResults,
  2. String? nameContains,
  3. String? nextToken,
  4. VocabularyState? stateEquals,
})

Returns a list of vocabularies that match the specified criteria. If no criteria are specified, returns the entire list of vocabularies.

May throw BadRequestException. May throw LimitExceededException. May throw InternalFailureException.

Parameter maxResults : The maximum number of vocabularies to return in the response. If there are fewer results in the list, this response contains only the actual results.

Parameter 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.

Parameter nextToken : If the result of the previous request to ListVocabularies was truncated, include the NextToken to fetch the next set of jobs.

Parameter stateEquals : When specified, only returns vocabularies with the VocabularyState field equal to the specified state.

Implementation

Future<ListVocabulariesResponse> listVocabularies({
  int? maxResults,
  String? nameContains,
  String? nextToken,
  VocabularyState? stateEquals,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nameContains',
    nameContains,
    1,
    200,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    8192,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Transcribe.ListVocabularies'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'MaxResults': maxResults,
      if (nameContains != null) 'NameContains': nameContains,
      if (nextToken != null) 'NextToken': nextToken,
      if (stateEquals != null) 'StateEquals': stateEquals.toValue(),
    },
  );

  return ListVocabulariesResponse.fromJson(jsonResponse.body);
}