cancelTrainingPipeline method

  1. @override
Future<void> cancelTrainingPipeline(
  1. CancelTrainingPipelineRequest request
)
override

Cancels a TrainingPipeline. Starts asynchronous cancellation on the TrainingPipeline. The server makes a best effort to cancel the pipeline, but success is not guaranteed. Clients can use PipelineService.GetTrainingPipeline or other methods to check whether the cancellation succeeded or whether the pipeline completed despite cancellation. On successful cancellation, the TrainingPipeline is not deleted; instead it becomes a pipeline with a TrainingPipeline.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and TrainingPipeline.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> cancelTrainingPipeline(
  CancelTrainingPipelineRequest request,
) async {
  if (isClosed) throw StateError('Service is closed');

  if (_cancelTrainingPipeline case final cancelTrainingPipeline?) {
    return cancelTrainingPipeline(request);
  }
  throw UnsupportedError('cancelTrainingPipeline');
}