listDataSources method

Future<ListDataSourcesResponse> listDataSources({
  1. required String knowledgeBaseId,
  2. int? maxResults,
  3. String? nextToken,
})

Lists the data sources in a knowledge base and information about each one.

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

Parameter knowledgeBaseId : The unique identifier of the knowledge base for which to return a list of information.

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<ListDataSourcesResponse> listDataSources({
  required String knowledgeBaseId,
  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/${Uri.encodeComponent(knowledgeBaseId)}/datasources/',
    exceptionFnMap: _exceptionFns,
  );
  return ListDataSourcesResponse.fromJson(response);
}