listLanguageModels method

Future<ListLanguageModelsResponse> listLanguageModels({
  1. int? maxResults,
  2. String? nameContains,
  3. String? nextToken,
  4. ModelStatus? statusEquals,
})

Provides a list of custom language models that match the specified criteria. If no criteria are specified, all custom language models are returned.

To get detailed information about a specific custom language model, use the operation.

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

Parameter maxResults : The maximum number of custom language models 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 do not specify a value, a default of 5 is used.

Parameter nameContains : Returns only the custom language models that contain the specified string. The search is not case sensitive.

Parameter nextToken : If your ListLanguageModels 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.

Parameter statusEquals : Returns only custom language models with the specified status. Language models are ordered by creation date, with the newest model first. If you do not include StatusEquals, all custom language models are returned.

Implementation

Future<ListLanguageModelsResponse> listLanguageModels({
  int? maxResults,
  String? nameContains,
  String? nextToken,
  ModelStatus? statusEquals,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Transcribe.ListLanguageModels'
  };
  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 (statusEquals != null) 'StatusEquals': statusEquals.value,
    },
  );

  return ListLanguageModelsResponse.fromJson(jsonResponse.body);
}