cancelAuditTask method

Future<void> cancelAuditTask({
  1. required String taskId,
})

Cancels an audit that is in progress. The audit can be either scheduled or on demand. If the audit isn't in progress, an "InvalidRequestException" occurs.

Requires permission to access the CancelAuditTask action.

May throw InternalFailureException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter taskId : The ID of the audit you want to cancel. You can only cancel an audit that is "IN_PROGRESS".

Implementation

Future<void> cancelAuditTask({
  required String taskId,
}) async {
  final response = await _protocol.send(
    payload: null,
    method: 'PUT',
    requestUri: '/audit/tasks/${Uri.encodeComponent(taskId)}/cancel',
    exceptionFnMap: _exceptionFns,
  );
}