cancelNasJob method

  1. @override
Future<void> cancelNasJob(
  1. CancelNasJobRequest request
)
override

Cancels a NasJob. Starts asynchronous cancellation on the NasJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetNasJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the NasJob is not deleted; instead it becomes a job with a NasJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and NasJob.state is set to CANCELLED.

Throws a http.ClientException if there were problems communicating with the API service. Throws a ServiceException if the API method failed for any reason.

Implementation

@override
Future<void> cancelNasJob(CancelNasJobRequest request) async {
  if (isClosed) throw StateError('Service is closed');

  if (_cancelNasJob case final cancelNasJob?) {
    return cancelNasJob(request);
  }
  throw UnsupportedError('cancelNasJob');
}