insightFeedback method

Future<InsightFeedbackResponse> insightFeedback({
  1. required InsightFeedbackEntity entity,
  2. required String insightId,
  3. required InsightFeedbackThumbs thumbs,
  4. String? feedbackText,
})

Submits feedback for an existing insight in an Amazon OpenSearch Service domain. Allows users to provide a thumbs up or thumbs down rating and optional text feedback for a specific insight.

May throw BaseException. May throw DisabledOperationException. May throw InternalException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter entity : The entity for which to submit insight feedback. Specifies the type and value of the entity, such as a domain name.

Parameter insightId : The unique identifier of the insight for which to submit feedback.

Parameter thumbs : The thumbs up or thumbs down feedback for the insight. Possible values are Up and Down.

Parameter feedbackText : Optional text feedback providing additional details about the insight. Maximum length is 1000 characters.

Implementation

Future<InsightFeedbackResponse> insightFeedback({
  required InsightFeedbackEntity entity,
  required String insightId,
  required InsightFeedbackThumbs thumbs,
  String? feedbackText,
}) async {
  final $payload = <String, dynamic>{
    'Entity': entity,
    'InsightId': insightId,
    'Thumbs': thumbs.value,
    if (feedbackText != null) 'FeedbackText': feedbackText,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/2021-01-01/opensearch/insight-feedback',
    exceptionFnMap: _exceptionFns,
  );
  return InsightFeedbackResponse.fromJson(response);
}