listFeaturedResultsSets method

Future<ListFeaturedResultsSetsResponse> listFeaturedResultsSets({
  1. required String indexId,
  2. int? maxResults,
  3. String? nextToken,
})

Lists all your sets of featured results for a given index. Features results are placed above all other results for certain queries. If there's an exact match of a query, then one or more specific documents are featured in the search results.

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

Parameter indexId : The identifier of the index used for featuring results.

Parameter maxResults : The maximum number of featured results sets to return.

Parameter nextToken : If the response is truncated, Amazon Kendra returns a pagination token in the response. You can use this pagination token to retrieve the next set of featured results sets.

Implementation

Future<ListFeaturedResultsSetsResponse> listFeaturedResultsSets({
  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.ListFeaturedResultsSets'
  };
  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 ListFeaturedResultsSetsResponse.fromJson(jsonResponse.body);
}