searchKnowledgeBases method
Searches for a subset of knowledge bases based on specified filters.
May throw AccessDeniedException.
May throw InternalFailureException.
May throw InvalidNextTokenException.
May throw InvalidParameterValueException.
May throw PreconditionNotMetException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter awsAccountId :
The ID of the Amazon Web Services account that contains the knowledge
base.
Parameter filters :
The filters to apply when searching knowledge bases.
Parameter maxResults :
The maximum number of results to return.
Parameter nextToken :
The token for the next set of results, or null if there are no more
results.
Parameter sortBy :
The sort configuration for the search results.
Implementation
Future<SearchKnowledgeBasesResponse> searchKnowledgeBases({
required String awsAccountId,
List<KnowledgeBaseSearchFilter>? filters,
int? maxResults,
String? nextToken,
KnowledgeBaseSortBy? sortBy,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
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:
'/v1/accounts/${Uri.encodeComponent(awsAccountId)}/search/knowledge-bases',
exceptionFnMap: _exceptionFns,
);
return SearchKnowledgeBasesResponse.fromJson(response);
}