deleteModel method

  1. @override
Future<Operation<Empty, DeleteOperationMetadata>> deleteModel(
  1. DeleteModelRequest request
)
override

Deletes a Model.

A model cannot be deleted if any Endpoint resource has a DeployedModel based on the model in its deployed_models field.

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

Returns an Operation representing the status of the long-running operation.

When complete, Operation.done will be true. If successful, Operation.responseAsMessage will contain the operation's result.

Implementation

@override
Future<Operation<protobuf.Empty, DeleteOperationMetadata>> deleteModel(
  DeleteModelRequest request,
) async {
  if (isClosed) throw StateError('Service is closed');

  if (_deleteModel case final deleteModel?) {
    return deleteModel(request);
  }
  throw UnsupportedError('deleteModel');
}