listBotResourceGenerations method

Future<ListBotResourceGenerationsResponse> listBotResourceGenerations({
  1. required String botId,
  2. required String botVersion,
  3. required String localeId,
  4. int? maxResults,
  5. String? nextToken,
  6. GenerationSortBy? sortBy,
})

Lists the generation requests made for a bot locale.

May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter botId : The unique identifier of the bot whose generation requests you want to view.

Parameter botVersion : The version of the bot whose generation requests you want to view.

Parameter localeId : The locale of the bot whose generation requests you want to view.

Parameter maxResults : The maximum number of results to return in the response.

Parameter nextToken : If the total number of results is greater than the number specified in the maxResults, the response returns a token in the nextToken field. Use this token when making a request to return the next batch of results.

Parameter sortBy : An object containing information about the attribute and the method by which to sort the results

Implementation

Future<ListBotResourceGenerationsResponse> listBotResourceGenerations({
  required String botId,
  required String botVersion,
  required String localeId,
  int? maxResults,
  String? nextToken,
  GenerationSortBy? sortBy,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final $payload = <String, dynamic>{
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
    if (sortBy != null) 'sortBy': sortBy,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/bots/${Uri.encodeComponent(botId)}/botversions/${Uri.encodeComponent(botVersion)}/botlocales/${Uri.encodeComponent(localeId)}/generations',
    exceptionFnMap: _exceptionFns,
  );
  return ListBotResourceGenerationsResponse.fromJson(response);
}