Class AutoMlClient (2.51.0)

GitHub RepositoryProduct ReferenceREST DocumentationRPC Documentation

Service Description: AutoML Server API.

The resource names are assigned by the server. The server never reuses names that it has created after the resources with those names are deleted.

An ID of a resource is the last element of the item's resource name. For projects/{project_id}/locations/{location_id}/datasets/{dataset_id}, then the id for the item is {dataset_id}.

Currently the only supported location_id is "us-central1".

On any input that is documented to expect a string parameter in snake_case or dash-case, either of those cases is accepted.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
   Dataset response = autoMlClient.getDataset(name);
 }
 

Note: close() needs to be called on the AutoMlClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
Method Description Method Variants

CreateDataset

Creates a dataset.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createDatasetAsync(CreateDatasetRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createDatasetAsync(LocationName parent, Dataset dataset)

  • createDatasetAsync(String parent, Dataset dataset)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createDatasetOperationCallable()

  • createDatasetCallable()

GetDataset

Gets a dataset.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getDataset(GetDatasetRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getDataset(DatasetName name)

  • getDataset(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getDatasetCallable()

ListDatasets

Lists datasets in a project.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listDatasets(ListDatasetsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listDatasets(LocationName parent)

  • listDatasets(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listDatasetsPagedCallable()

  • listDatasetsCallable()

UpdateDataset

Updates a dataset.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateDataset(UpdateDatasetRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateDataset(Dataset dataset, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateDatasetCallable()

DeleteDataset

Deletes a dataset and all of its contents. Returns empty response in the response field when it completes, and delete_details in the metadata field.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteDatasetAsync(DeleteDatasetRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteDatasetAsync(DatasetName name)

  • deleteDatasetAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteDatasetOperationCallable()

  • deleteDatasetCallable()

ImportData

Imports data into a dataset. For Tables this method can only be called on an empty Dataset.

For Tables:

  • A schema_inference_version parameter must be explicitly set. Returns an empty response in the response field when it completes.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • importDataAsync(ImportDataRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • importDataAsync(DatasetName name, InputConfig inputConfig)

  • importDataAsync(String name, InputConfig inputConfig)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • importDataOperationCallable()

  • importDataCallable()

ExportData

Exports dataset's data to the provided output location. Returns an empty response in the response field when it completes.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • exportDataAsync(ExportDataRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • exportDataAsync(DatasetName name, OutputConfig outputConfig)

  • exportDataAsync(String name, OutputConfig outputConfig)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • exportDataOperationCallable()

  • exportDataCallable()

GetAnnotationSpec

Gets an annotation spec.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getAnnotationSpec(GetAnnotationSpecRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getAnnotationSpec(AnnotationSpecName name)

  • getAnnotationSpec(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getAnnotationSpecCallable()

CreateModel

Creates a model. Returns a Model in the response field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createModelAsync(CreateModelRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createModelAsync(LocationName parent, Model model)

  • createModelAsync(String parent, Model model)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createModelOperationCallable()

  • createModelCallable()

GetModel

Gets a model.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getModel(GetModelRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getModel(ModelName name)

  • getModel(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getModelCallable()

ListModels

Lists models.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listModels(ListModelsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listModels(LocationName parent)

  • listModels(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listModelsPagedCallable()

  • listModelsCallable()

DeleteModel

Deletes a model. Returns google.protobuf.Empty in the response field when it completes, and delete_details in the metadata field.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteModelAsync(DeleteModelRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteModelAsync(ModelName name)

  • deleteModelAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteModelOperationCallable()

  • deleteModelCallable()

UpdateModel

Updates a model.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateModel(UpdateModelRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateModel(Model model, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateModelCallable()

DeployModel

Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing node_number) will reset the deployment state without pausing the model's availability.

Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically.

Returns an empty response in the response field when it completes.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deployModelAsync(DeployModelRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deployModelAsync(ModelName name)

  • deployModelAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deployModelOperationCallable()

  • deployModelCallable()

UndeployModel

Undeploys a model. If the model is not deployed this method has no effect.

Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.

Returns an empty response in the response field when it completes.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • undeployModelAsync(UndeployModelRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • undeployModelAsync(ModelName name)

  • undeployModelAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • undeployModelOperationCallable()

  • undeployModelCallable()

ExportModel

Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in ModelExportOutputConfig.

Returns an empty response in the response field when it completes.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • exportModelAsync(ExportModelRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • exportModelAsync(ModelName name, ModelExportOutputConfig outputConfig)

  • exportModelAsync(String name, ModelExportOutputConfig outputConfig)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • exportModelOperationCallable()

  • exportModelCallable()

GetModelEvaluation

Gets a model evaluation.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getModelEvaluation(GetModelEvaluationRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getModelEvaluation(ModelEvaluationName name)

  • getModelEvaluation(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getModelEvaluationCallable()

ListModelEvaluations

Lists model evaluations.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listModelEvaluations(ListModelEvaluationsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listModelEvaluations(ModelName parent, String filter)

  • listModelEvaluations(String parent, String filter)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listModelEvaluationsPagedCallable()

  • listModelEvaluationsCallable()

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of AutoMlSettings to create(). For example:

To customize credentials:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 AutoMlSettings autoMlSettings =
     AutoMlSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 AutoMlClient autoMlClient = AutoMlClient.create(autoMlSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 AutoMlSettings autoMlSettings = AutoMlSettings.newBuilder().setEndpoint(myEndpoint).build();
 AutoMlClient autoMlClient = AutoMlClient.create(autoMlSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 AutoMlSettings autoMlSettings = AutoMlSettings.newHttpJsonBuilder().build();
 AutoMlClient autoMlClient = AutoMlClient.create(autoMlSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > AutoMlClient

Static Methods

create()

public static final AutoMlClient create()

Constructs an instance of AutoMlClient with default settings.

Returns
Type Description
AutoMlClient
Exceptions
Type Description
IOException

create(AutoMlSettings settings)

public static final AutoMlClient create(AutoMlSettings settings)

Constructs an instance of AutoMlClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
Name Description
settings AutoMlSettings
Returns
Type Description
AutoMlClient
Exceptions
Type Description
IOException

create(AutoMlStub stub)

public static final AutoMlClient create(AutoMlStub stub)

Constructs an instance of AutoMlClient, using the given stub for making calls. This is for advanced usage - prefer using create(AutoMlSettings).

Parameter
Name Description
stub AutoMlStub
Returns
Type Description
AutoMlClient

Constructors

AutoMlClient(AutoMlSettings settings)

protected AutoMlClient(AutoMlSettings settings)

Constructs an instance of AutoMlClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
Name Description
settings AutoMlSettings

AutoMlClient(AutoMlStub stub)

protected AutoMlClient(AutoMlStub stub)
Parameter
Name Description
stub AutoMlStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

close()

public final void close()

createDatasetAsync(CreateDatasetRequest request)

public final OperationFuture<Dataset,OperationMetadata> createDatasetAsync(CreateDatasetRequest request)

Creates a dataset.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   CreateDatasetRequest request =
       CreateDatasetRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDataset(Dataset.newBuilder().build())
           .build();
   Dataset response = autoMlClient.createDatasetAsync(request).get();
 }
 
Parameter
Name Description
request CreateDatasetRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Dataset,OperationMetadata>

createDatasetAsync(LocationName parent, Dataset dataset)

public final OperationFuture<Dataset,OperationMetadata> createDatasetAsync(LocationName parent, Dataset dataset)

Creates a dataset.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Dataset dataset = Dataset.newBuilder().build();
   Dataset response = autoMlClient.createDatasetAsync(parent, dataset).get();
 }
 
Parameters
Name Description
parent LocationName

Required. The resource name of the project to create the dataset for.

dataset Dataset

Required. The dataset to create.

Returns
Type Description
OperationFuture<Dataset,OperationMetadata>

createDatasetAsync(String parent, Dataset dataset)

public final OperationFuture<Dataset,OperationMetadata> createDatasetAsync(String parent, Dataset dataset)

Creates a dataset.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   Dataset dataset = Dataset.newBuilder().build();
   Dataset response = autoMlClient.createDatasetAsync(parent, dataset).get();
 }
 
Parameters
Name Description
parent String

Required. The resource name of the project to create the dataset for.

dataset Dataset

Required. The dataset to create.

Returns
Type Description
OperationFuture<Dataset,OperationMetadata>

createDatasetCallable()

public final UnaryCallable<CreateDatasetRequest,Operation> createDatasetCallable()

Creates a dataset.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   CreateDatasetRequest request =
       CreateDatasetRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDataset(Dataset.newBuilder().build())
           .build();
   ApiFuture<Operation> future = autoMlClient.createDatasetCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateDatasetRequest,Operation>

createDatasetOperationCallable()

public final OperationCallable<CreateDatasetRequest,Dataset,OperationMetadata> createDatasetOperationCallable()

Creates a dataset.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   CreateDatasetRequest request =
       CreateDatasetRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDataset(Dataset.newBuilder().build())
           .build();
   OperationFuture<Dataset, OperationMetadata> future =
       autoMlClient.createDatasetOperationCallable().futureCall(request);
   // Do something.
   Dataset response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateDatasetRequest,Dataset,OperationMetadata>

createModelAsync(CreateModelRequest request)

public final OperationFuture<Model,OperationMetadata> createModelAsync(CreateModelRequest request)

Creates a model. Returns a Model in the response field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   CreateModelRequest request =
       CreateModelRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setModel(Model.newBuilder().build())
           .build();
   Model response = autoMlClient.createModelAsync(request).get();
 }
 
Parameter
Name Description
request CreateModelRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Model,OperationMetadata>

createModelAsync(LocationName parent, Model model)

public final OperationFuture<Model,OperationMetadata> createModelAsync(LocationName parent, Model model)

Creates a model. Returns a Model in the response field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Model model = Model.newBuilder().build();
   Model response = autoMlClient.createModelAsync(parent, model).get();
 }
 
Parameters
Name Description
parent LocationName

Required. Resource name of the parent project where the model is being created.

model Model

Required. The model to create.

Returns
Type Description
OperationFuture<Model,OperationMetadata>

createModelAsync(String parent, Model model)

public final OperationFuture<Model,OperationMetadata> createModelAsync(String parent, Model model)

Creates a model. Returns a Model in the response field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   Model model = Model.newBuilder().build();
   Model response = autoMlClient.createModelAsync(parent, model).get();
 }
 
Parameters
Name Description
parent String

Required. Resource name of the parent project where the model is being created.

model Model

Required. The model to create.

Returns
Type Description
OperationFuture<Model,OperationMetadata>

createModelCallable()

public final UnaryCallable<CreateModelRequest,Operation> createModelCallable()

Creates a model. Returns a Model in the response field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   CreateModelRequest request =
       CreateModelRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setModel(Model.newBuilder().build())
           .build();
   ApiFuture<Operation> future = autoMlClient.createModelCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateModelRequest,Operation>

createModelOperationCallable()

public final OperationCallable<CreateModelRequest,Model,OperationMetadata> createModelOperationCallable()

Creates a model. Returns a Model in the response field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   CreateModelRequest request =
       CreateModelRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setModel(Model.newBuilder().build())
           .build();
   OperationFuture<Model, OperationMetadata> future =
       autoMlClient.createModelOperationCallable().futureCall(request);
   // Do something.
   Model response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateModelRequest,Model,OperationMetadata>

deleteDatasetAsync(DatasetName name)

public final OperationFuture<Empty,OperationMetadata> deleteDatasetAsync(DatasetName name)

Deletes a dataset and all of its contents. Returns empty response in the response field when it completes, and delete_details in the metadata field.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
   autoMlClient.deleteDatasetAsync(name).get();
 }
 
Parameter
Name Description
name DatasetName

Required. The resource name of the dataset to delete.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteDatasetAsync(DeleteDatasetRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteDatasetAsync(DeleteDatasetRequest request)

Deletes a dataset and all of its contents. Returns empty response in the response field when it completes, and delete_details in the metadata field.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   DeleteDatasetRequest request =
       DeleteDatasetRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
           .build();
   autoMlClient.deleteDatasetAsync(request).get();
 }
 
Parameter
Name Description
request DeleteDatasetRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteDatasetAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteDatasetAsync(String name)

Deletes a dataset and all of its contents. Returns empty response in the response field when it completes, and delete_details in the metadata field.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString();
   autoMlClient.deleteDatasetAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The resource name of the dataset to delete.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteDatasetCallable()

public final UnaryCallable<DeleteDatasetRequest,Operation> deleteDatasetCallable()

Deletes a dataset and all of its contents. Returns empty response in the response field when it completes, and delete_details in the metadata field.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   DeleteDatasetRequest request =
       DeleteDatasetRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
           .build();
   ApiFuture<Operation> future = autoMlClient.deleteDatasetCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteDatasetRequest,Operation>

deleteDatasetOperationCallable()

public final OperationCallable<DeleteDatasetRequest,Empty,OperationMetadata> deleteDatasetOperationCallable()

Deletes a dataset and all of its contents. Returns empty response in the response field when it completes, and delete_details in the metadata field.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   DeleteDatasetRequest request =
       DeleteDatasetRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
           .build();
   OperationFuture<Empty, OperationMetadata> future =
       autoMlClient.deleteDatasetOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteDatasetRequest,Empty,OperationMetadata>

deleteModelAsync(DeleteModelRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteModelAsync(DeleteModelRequest request)

Deletes a model. Returns google.protobuf.Empty in the response field when it completes, and delete_details in the metadata field.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   DeleteModelRequest request =
       DeleteModelRequest.newBuilder()
           .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
           .build();
   autoMlClient.deleteModelAsync(request).get();
 }
 
Parameter
Name Description
request DeleteModelRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteModelAsync(ModelName name)

public final OperationFuture<Empty,OperationMetadata> deleteModelAsync(ModelName name)

Deletes a model. Returns google.protobuf.Empty in the response field when it completes, and delete_details in the metadata field.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
   autoMlClient.deleteModelAsync(name).get();
 }
 
Parameter
Name Description
name ModelName

Required. Resource name of the model being deleted.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteModelAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteModelAsync(String name)

Deletes a model. Returns google.protobuf.Empty in the response field when it completes, and delete_details in the metadata field.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString();
   autoMlClient.deleteModelAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. Resource name of the model being deleted.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteModelCallable()

public final UnaryCallable<DeleteModelRequest,Operation> deleteModelCallable()

Deletes a model. Returns google.protobuf.Empty in the response field when it completes, and delete_details in the metadata field.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   DeleteModelRequest request =
       DeleteModelRequest.newBuilder()
           .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
           .build();
   ApiFuture<Operation> future = autoMlClient.deleteModelCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteModelRequest,Operation>

deleteModelOperationCallable()

public final OperationCallable<DeleteModelRequest,Empty,OperationMetadata> deleteModelOperationCallable()

Deletes a model. Returns google.protobuf.Empty in the response field when it completes, and delete_details in the metadata field.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   DeleteModelRequest request =
       DeleteModelRequest.newBuilder()
           .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
           .build();
   OperationFuture<Empty, OperationMetadata> future =
       autoMlClient.deleteModelOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteModelRequest,Empty,OperationMetadata>

deployModelAsync(DeployModelRequest request)

public final OperationFuture<Empty,OperationMetadata> deployModelAsync(DeployModelRequest request)

Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing node_number) will reset the deployment state without pausing the model's availability.

Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically.

Returns an empty response in the response field when it completes.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   DeployModelRequest request =
       DeployModelRequest.newBuilder()
           .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
           .build();
   autoMlClient.deployModelAsync(request).get();
 }
 
Parameter
Name Description
request DeployModelRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deployModelAsync(ModelName name)

public final OperationFuture<Empty,OperationMetadata> deployModelAsync(ModelName name)

Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing node_number) will reset the deployment state without pausing the model's availability.

Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically.

Returns an empty response in the response field when it completes.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AutoMlClient autoMlClient = AutoMlClient.create()) {
   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
   autoMlClient.deployModelAsync(name).get();
 }
 
Parameter
Name Description
name ModelName

Required. Resource name of the model to deploy.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deployModelAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deployModelAsync(String name)

Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing node_number) will reset the deployment state without pausing the model's availability.

Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically.

Returns an empty response in the response field when it completes.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (