listKnowledgeBases method

Future<ListKnowledgeBasesResponse> listKnowledgeBases({
  1. int? maxResults,
  2. String? nextToken,
})

Lists the knowledge bases in an account. The list also includesinformation about each knowledge base.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter maxResults : The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

Parameter nextToken : If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

Implementation

Future<ListKnowledgeBasesResponse> listKnowledgeBases({
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final $payload = <String, dynamic>{
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/knowledgebases/',
    exceptionFnMap: _exceptionFns,
  );
  return ListKnowledgeBasesResponse.fromJson(response);
}