submitFeedback method

Future<void> submitFeedback({
  1. required String anomalyInstanceId,
  2. required String profilingGroupName,
  3. required FeedbackType type,
  4. String? comment,
})

Sends feedback to CodeGuru Profiler about whether the anomaly detected by the analysis is useful or not.

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

Parameter anomalyInstanceId : The universally unique identifier (UUID) of the AnomalyInstance object that is included in the analysis data.

Parameter profilingGroupName : The name of the profiling group that is associated with the analysis data.

Parameter type : The feedback tpye. Thee are two valid values, Positive and Negative.

Parameter comment : Optional feedback about this anomaly.

Implementation

Future<void> submitFeedback({
  required String anomalyInstanceId,
  required String profilingGroupName,
  required FeedbackType type,
  String? comment,
}) async {
  ArgumentError.checkNotNull(anomalyInstanceId, 'anomalyInstanceId');
  ArgumentError.checkNotNull(profilingGroupName, 'profilingGroupName');
  _s.validateStringLength(
    'profilingGroupName',
    profilingGroupName,
    1,
    255,
    isRequired: true,
  );
  ArgumentError.checkNotNull(type, 'type');
  final $payload = <String, dynamic>{
    'type': type.toValue(),
    if (comment != null) 'comment': comment,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/internal/profilingGroups/${Uri.encodeComponent(profilingGroupName)}/anomalies/${Uri.encodeComponent(anomalyInstanceId)}/feedback',
    exceptionFnMap: _exceptionFns,
  );
}