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.

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

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 {
  ArgumentError.checkNotNull(taskId, 'taskId');
  _s.validateStringLength(
    'taskId',
    taskId,
    1,
    40,
    isRequired: true,
  );
  final response = await _protocol.send(
    payload: null,
    method: 'PUT',
    requestUri: '/audit/tasks/${Uri.encodeComponent(taskId)}/cancel',
    exceptionFnMap: _exceptionFns,
  );
}