listBotLocales method
Gets a list of locales for the specified bot.
May throw InternalServerException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter botId :
The identifier of the bot to list locales for.
Parameter botVersion :
The version of the bot to list locales for.
Parameter filters :
Provides the specification for a filter used to limit the response to only
those locales that match the filter specification. You can only specify
one filter and one value to filter on.
Parameter maxResults :
The maximum number of aliases to return in each page of results. If there
are fewer results than the max page size, only the actual number of
results are returned.
Parameter nextToken :
If the response from the ListBotLocales operation contains
more results than specified in the maxResults parameter, a
token is returned in the response. Use that token as the
nextToken parameter to return the next page of results.
Parameter sortBy :
Specifies sorting parameters for the list of locales. You can sort by
locale name in ascending or descending order.
Implementation
Future<ListBotLocalesResponse> listBotLocales({
required String botId,
required String botVersion,
List<BotLocaleFilter>? filters,
int? maxResults,
String? nextToken,
BotLocaleSortBy? sortBy,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
1000,
);
final $payload = <String, dynamic>{
if (filters != null) 'filters': filters,
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',
exceptionFnMap: _exceptionFns,
);
return ListBotLocalesResponse.fromJson(response);
}