listFaqs method
Gets a list of FAQs associated with an index.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter indexId :
The index for the FAQs.
Parameter maxResults :
The maximum number of FAQs to return in the response. If there are fewer
results in the list, this response contains only the actual results.
Parameter nextToken :
If the previous response was incomplete (because there is more data to
retrieve), Amazon Kendra returns a pagination token in the response. You
can use this pagination token to retrieve the next set of FAQs.
Implementation
Future<ListFaqsResponse> listFaqs({
required String indexId,
int? maxResults,
String? nextToken,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSKendraFrontendService.ListFaqs'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'IndexId': indexId,
if (maxResults != null) 'MaxResults': maxResults,
if (nextToken != null) 'NextToken': nextToken,
},
);
return ListFaqsResponse.fromJson(jsonResponse.body);
}