submitFeedback method

Future<void> submitFeedback({
  1. required String indexId,
  2. required String queryId,
  3. List<ClickFeedback>? clickFeedbackItems,
  4. List<RelevanceFeedback>? relevanceFeedbackItems,
})

Enables you to provide feedback to Amazon Kendra to improve the performance of the service.

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

Parameter indexId : The identifier of the index that was queried.

Parameter queryId : The identifier of the specific query for which you are submitting feedback. The query ID is returned in the response to the operation.

Parameter clickFeedbackItems : Tells Amazon Kendra that a particular search result link was chosen by the user.

Parameter relevanceFeedbackItems : Provides Amazon Kendra with relevant or not relevant feedback for whether a particular item was relevant to the search.

Implementation

Future<void> submitFeedback({
  required String indexId,
  required String queryId,
  List<ClickFeedback>? clickFeedbackItems,
  List<RelevanceFeedback>? relevanceFeedbackItems,
}) async {
  ArgumentError.checkNotNull(indexId, 'indexId');
  _s.validateStringLength(
    'indexId',
    indexId,
    36,
    36,
    isRequired: true,
  );
  ArgumentError.checkNotNull(queryId, 'queryId');
  _s.validateStringLength(
    'queryId',
    queryId,
    1,
    36,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSKendraFrontendService.SubmitFeedback'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'IndexId': indexId,
      'QueryId': queryId,
      if (clickFeedbackItems != null)
        'ClickFeedbackItems': clickFeedbackItems,
      if (relevanceFeedbackItems != null)
        'RelevanceFeedbackItems': relevanceFeedbackItems,
    },
  );
}