listBots method

Future<ListBotsResponse> listBots({
  1. List<BotFilter>? filters,
  2. int? maxResults,
  3. String? nextToken,
  4. BotSortBy? sortBy,
})

Gets a list of available bots.

May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter filters : Provides the specification of a filter used to limit the bots in the response to only those that match the filter specification. You can only specify one filter and one string to filter on.

Parameter maxResults : The maximum number of bots to return in each page of results. If there are fewer results than the maximum page size, only the actual number of results are returned.

Parameter nextToken : If the response from the ListBots operation contains more results than specified in the maxResults parameter, a token is returned in the response.

Use the returned token in the nextToken parameter of a ListBots request to return the next page of results. For a complete set of results, call the ListBots operation until the nextToken returned in the response is null.

Parameter sortBy : Specifies sorting parameters for the list of bots. You can specify that the list be sorted by bot name in ascending or descending order.

Implementation

Future<ListBotsResponse> listBots({
  List<BotFilter>? filters,
  int? maxResults,
  String? nextToken,
  BotSortBy? 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',
    exceptionFnMap: _exceptionFns,
  );
  return ListBotsResponse.fromJson(response);
}