listFaqs method

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

Gets a list of FAQ lists associated with an index.

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

Parameter indexId : The index that contains the FAQ lists.

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 result of the previous request to ListFaqs was truncated, include the NextToken to fetch the next set of FAQs.

Implementation

Future<ListFaqsResponse> listFaqs({
  required String indexId,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(indexId, 'indexId');
  _s.validateStringLength(
    'indexId',
    indexId,
    36,
    36,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    800,
  );
  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);
}