updateFindingsFeedback method

Future<void> updateFindingsFeedback({
  1. required String detectorId,
  2. required Feedback feedback,
  3. required List<String> findingIds,
  4. String? comments,
})

Marks the specified GuardDuty findings as useful or not useful.

May throw BadRequestException. May throw InternalServerErrorException.

Parameter detectorId : The ID of the detector associated with the findings to update feedback for.

Parameter feedback : The feedback for the finding.

Parameter findingIds : The IDs of the findings that you want to mark as useful or not useful.

Parameter comments : Additional feedback about the GuardDuty findings.

Implementation

Future<void> updateFindingsFeedback({
  required String detectorId,
  required Feedback feedback,
  required List<String> findingIds,
  String? comments,
}) async {
  ArgumentError.checkNotNull(detectorId, 'detectorId');
  _s.validateStringLength(
    'detectorId',
    detectorId,
    1,
    300,
    isRequired: true,
  );
  ArgumentError.checkNotNull(feedback, 'feedback');
  ArgumentError.checkNotNull(findingIds, 'findingIds');
  final $payload = <String, dynamic>{
    'feedback': feedback.toValue(),
    'findingIds': findingIds,
    if (comments != null) 'comments': comments,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/detector/${Uri.encodeComponent(detectorId)}/findings/feedback',
    exceptionFnMap: _exceptionFns,
  );
}