cancelBatchPredictionJob method
Cancels a BatchPredictionJob.
Starts asynchronous cancellation on the BatchPredictionJob. The server
makes the best effort to cancel the job, but success is not
guaranteed. Clients can use
JobService.GetBatchPredictionJob
or other methods to check whether the cancellation succeeded or whether the
job completed despite cancellation. On a successful cancellation,
the BatchPredictionJob is not deleted;instead its
BatchPredictionJob.state
is set to CANCELLED. Any files already outputted by the job are not
deleted.
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
Future<void> cancelBatchPredictionJob(
CancelBatchPredictionJobRequest request,
) async {
final url = Uri.https(_host, '/v1beta1/${request.name}:cancel');
await _client.post(url, body: request);
}