@Generated(value="by gapic-generator") @BetaApi public class AutoMlClient extends Object implements com.google.api.gax.core.BackgroundResource
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 kebab-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:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
Dataset dataset = Dataset.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Dataset response = autoMlClient.updateDataset(dataset, updateMask);
}
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().
The surface of this class includes several types of Java methods for each of the API's methods:
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:
AutoMlSettings autoMlSettings =
AutoMlSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
AutoMlClient autoMlClient =
AutoMlClient.create(autoMlSettings);
To customize the endpoint:
AutoMlSettings autoMlSettings =
AutoMlSettings.newBuilder().setEndpoint(myEndpoint).build();
AutoMlClient autoMlClient =
AutoMlClient.create(autoMlSettings);
| Modifier and Type | Class and Description |
|---|---|
static class |
AutoMlClient.ListDatasetsFixedSizeCollection |
static class |
AutoMlClient.ListDatasetsPage |
static class |
AutoMlClient.ListDatasetsPagedResponse |
static class |
AutoMlClient.ListModelEvaluationsFixedSizeCollection |
static class |
AutoMlClient.ListModelEvaluationsPage |
static class |
AutoMlClient.ListModelEvaluationsPagedResponse |
static class |
AutoMlClient.ListModelsFixedSizeCollection |
static class |
AutoMlClient.ListModelsPage |
static class |
AutoMlClient.ListModelsPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
AutoMlClient(AutoMlSettings settings)
Constructs an instance of AutoMlClient, using the given settings.
|
protected |
AutoMlClient(AutoMlStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static AutoMlClient |
create()
Constructs an instance of AutoMlClient with default settings.
|
static AutoMlClient |
create(AutoMlSettings settings)
Constructs an instance of AutoMlClient, using the given settings.
|
static AutoMlClient |
create(AutoMlStub stub)
Constructs an instance of AutoMlClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Dataset,OperationMetadata> |
createDatasetAsync(CreateDatasetRequest request)
Creates a dataset.
|
com.google.api.gax.longrunning.OperationFuture<Dataset,OperationMetadata> |
createDatasetAsync(LocationName parent,
Dataset dataset)
Creates a dataset.
|
com.google.api.gax.longrunning.OperationFuture<Dataset,OperationMetadata> |
createDatasetAsync(String parent,
Dataset dataset)
Creates a dataset.
|
com.google.api.gax.rpc.UnaryCallable<CreateDatasetRequest,com.google.longrunning.Operation> |
createDatasetCallable()
Creates a dataset.
|
com.google.api.gax.rpc.OperationCallable<CreateDatasetRequest,Dataset,OperationMetadata> |
createDatasetOperationCallable()
Creates a dataset.
|
com.google.api.gax.longrunning.OperationFuture<Model,OperationMetadata> |
createModelAsync(CreateModelRequest request)
Creates a model.
|
com.google.api.gax.longrunning.OperationFuture<Model,OperationMetadata> |
createModelAsync(LocationName parent,
Model model)
Creates a model.
|
com.google.api.gax.longrunning.OperationFuture<Model,OperationMetadata> |
createModelAsync(String parent,
Model model)
Creates a model.
|
com.google.api.gax.rpc.UnaryCallable<CreateModelRequest,com.google.longrunning.Operation> |
createModelCallable()
Creates a model.
|
com.google.api.gax.rpc.OperationCallable<CreateModelRequest,Model,OperationMetadata> |
createModelOperationCallable()
Creates a model.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteDatasetAsync(DatasetName name)
Deletes a dataset and all of its contents.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteDatasetAsync(DeleteDatasetRequest request)
Deletes a dataset and all of its contents.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteDatasetAsync(String name)
Deletes a dataset and all of its contents.
|
com.google.api.gax.rpc.UnaryCallable<DeleteDatasetRequest,com.google.longrunning.Operation> |
deleteDatasetCallable()
Deletes a dataset and all of its contents.
|
com.google.api.gax.rpc.OperationCallable<DeleteDatasetRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteDatasetOperationCallable()
Deletes a dataset and all of its contents.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteModelAsync(DeleteModelRequest request)
Deletes a model.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteModelAsync(ModelName name)
Deletes a model.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteModelAsync(String name)
Deletes a model.
|
com.google.api.gax.rpc.UnaryCallable<DeleteModelRequest,com.google.longrunning.Operation> |
deleteModelCallable()
Deletes a model.
|
com.google.api.gax.rpc.OperationCallable<DeleteModelRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteModelOperationCallable()
Deletes a model.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
exportDataAsync(DatasetName name,
OutputConfig outputConfig)
Exports dataset's data to the provided output location.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
exportDataAsync(ExportDataRequest request)
Exports dataset's data to the provided output location.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
exportDataAsync(String name,
OutputConfig outputConfig)
Exports dataset's data to the provided output location.
|
com.google.api.gax.rpc.UnaryCallable<ExportDataRequest,com.google.longrunning.Operation> |
exportDataCallable()
Exports dataset's data to the provided output location.
|
com.google.api.gax.rpc.OperationCallable<ExportDataRequest,com.google.protobuf.Empty,OperationMetadata> |
exportDataOperationCallable()
Exports dataset's data to the provided output location.
|
Dataset |
getDataset(DatasetName name)
Gets a dataset.
|
Dataset |
getDataset(GetDatasetRequest request)
Gets a dataset.
|
Dataset |
getDataset(String name)
Gets a dataset.
|
com.google.api.gax.rpc.UnaryCallable<GetDatasetRequest,Dataset> |
getDatasetCallable()
Gets a dataset.
|
Model |
getModel(GetModelRequest request)
Gets a model.
|
Model |
getModel(ModelName name)
Gets a model.
|
Model |
getModel(String name)
Gets a model.
|
com.google.api.gax.rpc.UnaryCallable<GetModelRequest,Model> |
getModelCallable()
Gets a model.
|
ModelEvaluation |
getModelEvaluation(GetModelEvaluationRequest request)
Gets a model evaluation.
|
ModelEvaluation |
getModelEvaluation(ModelEvaluationName name)
Gets a model evaluation.
|
ModelEvaluation |
getModelEvaluation(String name)
Gets a model evaluation.
|
com.google.api.gax.rpc.UnaryCallable<GetModelEvaluationRequest,ModelEvaluation> |
getModelEvaluationCallable()
Gets a model evaluation.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
AutoMlSettings |
getSettings() |
AutoMlStub |
getStub() |
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
importDataAsync(DatasetName name,
InputConfig inputConfig)
Imports data into a dataset.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
importDataAsync(ImportDataRequest request)
Imports data into a dataset.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
importDataAsync(String name,
InputConfig inputConfig)
Imports data into a dataset.
|
com.google.api.gax.rpc.UnaryCallable<ImportDataRequest,com.google.longrunning.Operation> |
importDataCallable()
Imports data into a dataset.
|
com.google.api.gax.rpc.OperationCallable<ImportDataRequest,com.google.protobuf.Empty,OperationMetadata> |
importDataOperationCallable()
Imports data into a dataset.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
AutoMlClient.ListDatasetsPagedResponse |
listDatasets(ListDatasetsRequest request)
Lists datasets in a project.
|
AutoMlClient.ListDatasetsPagedResponse |
listDatasets(LocationName parent)
Lists datasets in a project.
|
AutoMlClient.ListDatasetsPagedResponse |
listDatasets(String parent)
Lists datasets in a project.
|
com.google.api.gax.rpc.UnaryCallable<ListDatasetsRequest,ListDatasetsResponse> |
listDatasetsCallable()
Lists datasets in a project.
|
com.google.api.gax.rpc.UnaryCallable<ListDatasetsRequest,AutoMlClient.ListDatasetsPagedResponse> |
listDatasetsPagedCallable()
Lists datasets in a project.
|
AutoMlClient.ListModelEvaluationsPagedResponse |
listModelEvaluations(ListModelEvaluationsRequest request)
Lists model evaluations.
|
AutoMlClient.ListModelEvaluationsPagedResponse |
listModelEvaluations(ModelName parent,
String filter)
Lists model evaluations.
|
AutoMlClient.ListModelEvaluationsPagedResponse |
listModelEvaluations(String parent,
String filter)
Lists model evaluations.
|
com.google.api.gax.rpc.UnaryCallable<ListModelEvaluationsRequest,ListModelEvaluationsResponse> |
listModelEvaluationsCallable()
Lists model evaluations.
|
com.google.api.gax.rpc.UnaryCallable<ListModelEvaluationsRequest,AutoMlClient.ListModelEvaluationsPagedResponse> |
listModelEvaluationsPagedCallable()
Lists model evaluations.
|
AutoMlClient.ListModelsPagedResponse |
listModels(ListModelsRequest request)
Lists models.
|
AutoMlClient.ListModelsPagedResponse |
listModels(LocationName parent)
Lists models.
|
AutoMlClient.ListModelsPagedResponse |
listModels(String parent)
Lists models.
|
com.google.api.gax.rpc.UnaryCallable<ListModelsRequest,ListModelsResponse> |
listModelsCallable()
Lists models.
|
com.google.api.gax.rpc.UnaryCallable<ListModelsRequest,AutoMlClient.ListModelsPagedResponse> |
listModelsPagedCallable()
Lists models.
|
void |
shutdown() |
void |
shutdownNow() |
Dataset |
updateDataset(Dataset dataset,
com.google.protobuf.FieldMask updateMask)
Updates a dataset.
|
Dataset |
updateDataset(UpdateDatasetRequest request)
Updates a dataset.
|
com.google.api.gax.rpc.UnaryCallable<UpdateDatasetRequest,Dataset> |
updateDatasetCallable()
Updates a dataset.
|
Model |
updateModel(Model model,
com.google.protobuf.FieldMask updateMask)
Updates a model.
|
Model |
updateModel(UpdateModelRequest request)
Updates a model.
|
com.google.api.gax.rpc.UnaryCallable<UpdateModelRequest,Model> |
updateModelCallable()
Updates a model.
|
protected AutoMlClient(AutoMlSettings settings) throws IOException
IOException@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected AutoMlClient(AutoMlStub stub)
public static final AutoMlClient create() throws IOException
IOExceptionpublic static final AutoMlClient create(AutoMlSettings settings) throws IOException
IOException@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final AutoMlClient create(AutoMlStub stub)
public final AutoMlSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public AutoMlStub getStub()
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<Dataset,OperationMetadata> createDatasetAsync(LocationName parent, Dataset dataset)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Dataset dataset = Dataset.newBuilder().build();
Dataset response = autoMlClient.createDatasetAsync(parent, dataset).get();
}
parent - The resource name of the project to create the dataset for.dataset - The dataset to create.com.google.api.gax.rpc.ApiException - if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<Dataset,OperationMetadata> createDatasetAsync(String parent, Dataset dataset)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Dataset dataset = Dataset.newBuilder().build();
Dataset response = autoMlClient.createDatasetAsync(parent.toString(), dataset).get();
}
parent - The resource name of the project to create the dataset for.dataset - The dataset to create.com.google.api.gax.rpc.ApiException - if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<Dataset,OperationMetadata> createDatasetAsync(CreateDatasetRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Dataset dataset = Dataset.newBuilder().build();
CreateDatasetRequest request = CreateDatasetRequest.newBuilder()
.setParent(parent.toString())
.setDataset(dataset)
.build();
Dataset response = autoMlClient.createDatasetAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<CreateDatasetRequest,Dataset,OperationMetadata> createDatasetOperationCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Dataset dataset = Dataset.newBuilder().build();
CreateDatasetRequest request = CreateDatasetRequest.newBuilder()
.setParent(parent.toString())
.setDataset(dataset)
.build();
OperationFuture<Dataset, OperationMetadata> future = autoMlClient.createDatasetOperationCallable().futureCall(request);
// Do something
Dataset response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateDatasetRequest,com.google.longrunning.Operation> createDatasetCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Dataset dataset = Dataset.newBuilder().build();
CreateDatasetRequest request = CreateDatasetRequest.newBuilder()
.setParent(parent.toString())
.setDataset(dataset)
.build();
ApiFuture<Operation> future = autoMlClient.createDatasetCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final Dataset updateDataset(Dataset dataset, com.google.protobuf.FieldMask updateMask)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
Dataset dataset = Dataset.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Dataset response = autoMlClient.updateDataset(dataset, updateMask);
}
dataset - The dataset which replaces the resource on the server.updateMask - Required. The update mask applies to the resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Dataset updateDataset(UpdateDatasetRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
Dataset dataset = Dataset.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder()
.setDataset(dataset)
.setUpdateMask(updateMask)
.build();
Dataset response = autoMlClient.updateDataset(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateDatasetRequest,Dataset> updateDatasetCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
Dataset dataset = Dataset.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder()
.setDataset(dataset)
.setUpdateMask(updateMask)
.build();
ApiFuture<Dataset> future = autoMlClient.updateDatasetCallable().futureCall(request);
// Do something
Dataset response = future.get();
}
public final Dataset getDataset(DatasetName name)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
Dataset response = autoMlClient.getDataset(name);
}
name - The resource name of the dataset to retrieve.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Dataset getDataset(String name)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
Dataset response = autoMlClient.getDataset(name.toString());
}
name - The resource name of the dataset to retrieve.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Dataset getDataset(GetDatasetRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
GetDatasetRequest request = GetDatasetRequest.newBuilder()
.setName(name.toString())
.build();
Dataset response = autoMlClient.getDataset(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetDatasetRequest,Dataset> getDatasetCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
GetDatasetRequest request = GetDatasetRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Dataset> future = autoMlClient.getDatasetCallable().futureCall(request);
// Do something
Dataset response = future.get();
}
public final AutoMlClient.ListDatasetsPagedResponse listDatasets(LocationName parent)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Dataset element : autoMlClient.listDatasets(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - The resource name of the project from which to list datasets.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AutoMlClient.ListDatasetsPagedResponse listDatasets(String parent)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Dataset element : autoMlClient.listDatasets(parent.toString()).iterateAll()) {
// doThingsWith(element);
}
}
parent - The resource name of the project from which to list datasets.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AutoMlClient.ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
.setParent(parent.toString())
.build();
for (Dataset element : autoMlClient.listDatasets(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListDatasetsRequest,AutoMlClient.ListDatasetsPagedResponse> listDatasetsPagedCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListDatasetsPagedResponse> future = autoMlClient.listDatasetsPagedCallable().futureCall(request);
// Do something
for (Dataset element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListDatasetsRequest,ListDatasetsResponse> listDatasetsCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
.setParent(parent.toString())
.build();
while (true) {
ListDatasetsResponse response = autoMlClient.listDatasetsCallable().call(request);
for (Dataset element : response.getDatasetsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDatasetAsync(DatasetName name)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
autoMlClient.deleteDatasetAsync(name).get();
}
name - The resource name of the dataset to delete.com.google.api.gax.rpc.ApiException - if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDatasetAsync(String name)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
autoMlClient.deleteDatasetAsync(name.toString()).get();
}
name - The resource name of the dataset to delete.com.google.api.gax.rpc.ApiException - if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDatasetAsync(DeleteDatasetRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
.setName(name.toString())
.build();
autoMlClient.deleteDatasetAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<DeleteDatasetRequest,com.google.protobuf.Empty,OperationMetadata> deleteDatasetOperationCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
.setName(name.toString())
.build();
OperationFuture<Empty, OperationMetadata> future = autoMlClient.deleteDatasetOperationCallable().futureCall(request);
// Do something
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteDatasetRequest,com.google.longrunning.Operation> deleteDatasetCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Operation> future = autoMlClient.deleteDatasetCallable().futureCall(request);
// Do something
future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> importDataAsync(DatasetName name, InputConfig inputConfig)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
InputConfig inputConfig = InputConfig.newBuilder().build();
autoMlClient.importDataAsync(name, inputConfig).get();
}
name - Required. Dataset name. Dataset must already exist. All imported annotations and
examples will be added.inputConfig - Required. The desired input location and its domain specific semantics, if
any.com.google.api.gax.rpc.ApiException - if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> importDataAsync(String name, InputConfig inputConfig)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
InputConfig inputConfig = InputConfig.newBuilder().build();
autoMlClient.importDataAsync(name.toString(), inputConfig).get();
}
name - Required. Dataset name. Dataset must already exist. All imported annotations and
examples will be added.inputConfig - Required. The desired input location and its domain specific semantics, if
any.com.google.api.gax.rpc.ApiException - if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> importDataAsync(ImportDataRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
InputConfig inputConfig = InputConfig.newBuilder().build();
ImportDataRequest request = ImportDataRequest.newBuilder()
.setName(name.toString())
.setInputConfig(inputConfig)
.build();
autoMlClient.importDataAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<ImportDataRequest,com.google.protobuf.Empty,OperationMetadata> importDataOperationCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
InputConfig inputConfig = InputConfig.newBuilder().build();
ImportDataRequest request = ImportDataRequest.newBuilder()
.setName(name.toString())
.setInputConfig(inputConfig)
.build();
OperationFuture<Empty, OperationMetadata> future = autoMlClient.importDataOperationCallable().futureCall(request);
// Do something
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ImportDataRequest,com.google.longrunning.Operation> importDataCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
InputConfig inputConfig = InputConfig.newBuilder().build();
ImportDataRequest request = ImportDataRequest.newBuilder()
.setName(name.toString())
.setInputConfig(inputConfig)
.build();
ApiFuture<Operation> future = autoMlClient.importDataCallable().futureCall(request);
// Do something
future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportDataAsync(DatasetName name, OutputConfig outputConfig)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
OutputConfig outputConfig = OutputConfig.newBuilder().build();
autoMlClient.exportDataAsync(name, outputConfig).get();
}
name - Required. The resource name of the dataset.outputConfig - Required. The desired output location.com.google.api.gax.rpc.ApiException - if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportDataAsync(String name, OutputConfig outputConfig)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
OutputConfig outputConfig = OutputConfig.newBuilder().build();
autoMlClient.exportDataAsync(name.toString(), outputConfig).get();
}
name - Required. The resource name of the dataset.outputConfig - Required. The desired output location.com.google.api.gax.rpc.ApiException - if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportDataAsync(ExportDataRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
OutputConfig outputConfig = OutputConfig.newBuilder().build();
ExportDataRequest request = ExportDataRequest.newBuilder()
.setName(name.toString())
.setOutputConfig(outputConfig)
.build();
autoMlClient.exportDataAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<ExportDataRequest,com.google.protobuf.Empty,OperationMetadata> exportDataOperationCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
OutputConfig outputConfig = OutputConfig.newBuilder().build();
ExportDataRequest request = ExportDataRequest.newBuilder()
.setName(name.toString())
.setOutputConfig(outputConfig)
.build();
OperationFuture<Empty, OperationMetadata> future = autoMlClient.exportDataOperationCallable().futureCall(request);
// Do something
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ExportDataRequest,com.google.longrunning.Operation> exportDataCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
OutputConfig outputConfig = OutputConfig.newBuilder().build();
ExportDataRequest request = ExportDataRequest.newBuilder()
.setName(name.toString())
.setOutputConfig(outputConfig)
.build();
ApiFuture<Operation> future = autoMlClient.exportDataCallable().futureCall(request);
// Do something
future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<Model,OperationMetadata> createModelAsync(LocationName parent, Model model)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Model model = Model.newBuilder().build();
Model response = autoMlClient.createModelAsync(parent, model).get();
}
parent - Resource name of the parent project where the model is being created.model - The model to create.com.google.api.gax.rpc.ApiException - if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<Model,OperationMetadata> createModelAsync(String parent, Model model)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Model model = Model.newBuilder().build();
Model response = autoMlClient.createModelAsync(parent.toString(), model).get();
}
parent - Resource name of the parent project where the model is being created.model - The model to create.com.google.api.gax.rpc.ApiException - if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<Model,OperationMetadata> createModelAsync(CreateModelRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Model model = Model.newBuilder().build();
CreateModelRequest request = CreateModelRequest.newBuilder()
.setParent(parent.toString())
.setModel(model)
.build();
Model response = autoMlClient.createModelAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<CreateModelRequest,Model,OperationMetadata> createModelOperationCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Model model = Model.newBuilder().build();
CreateModelRequest request = CreateModelRequest.newBuilder()
.setParent(parent.toString())
.setModel(model)
.build();
OperationFuture<Model, OperationMetadata> future = autoMlClient.createModelOperationCallable().futureCall(request);
// Do something
Model response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateModelRequest,com.google.longrunning.Operation> createModelCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Model model = Model.newBuilder().build();
CreateModelRequest request = CreateModelRequest.newBuilder()
.setParent(parent.toString())
.setModel(model)
.build();
ApiFuture<Operation> future = autoMlClient.createModelCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final Model getModel(ModelName name)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
Model response = autoMlClient.getModel(name);
}
name - Resource name of the model.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Model getModel(String name)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
Model response = autoMlClient.getModel(name.toString());
}
name - Resource name of the model.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Model getModel(GetModelRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
GetModelRequest request = GetModelRequest.newBuilder()
.setName(name.toString())
.build();
Model response = autoMlClient.getModel(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetModelRequest,Model> getModelCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
GetModelRequest request = GetModelRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Model> future = autoMlClient.getModelCallable().futureCall(request);
// Do something
Model response = future.get();
}
public final Model updateModel(Model model, com.google.protobuf.FieldMask updateMask)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
Model model = Model.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Model response = autoMlClient.updateModel(model, updateMask);
}
model - The model which replaces the resource on the server.updateMask - Required. The update mask applies to the resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Model updateModel(UpdateModelRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
Model model = Model.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
UpdateModelRequest request = UpdateModelRequest.newBuilder()
.setModel(model)
.setUpdateMask(updateMask)
.build();
Model response = autoMlClient.updateModel(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateModelRequest,Model> updateModelCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
Model model = Model.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
UpdateModelRequest request = UpdateModelRequest.newBuilder()
.setModel(model)
.setUpdateMask(updateMask)
.build();
ApiFuture<Model> future = autoMlClient.updateModelCallable().futureCall(request);
// Do something
Model response = future.get();
}
public final AutoMlClient.ListModelsPagedResponse listModels(LocationName parent)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Model element : autoMlClient.listModels(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Resource name of the project, from which to list the models.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AutoMlClient.ListModelsPagedResponse listModels(String parent)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Model element : autoMlClient.listModels(parent.toString()).iterateAll()) {
// doThingsWith(element);
}
}
parent - Resource name of the project, from which to list the models.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AutoMlClient.ListModelsPagedResponse listModels(ListModelsRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
ListModelsRequest request = ListModelsRequest.newBuilder()
.setParent(parent.toString())
.build();
for (Model element : autoMlClient.listModels(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListModelsRequest,AutoMlClient.ListModelsPagedResponse> listModelsPagedCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
ListModelsRequest request = ListModelsRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListModelsPagedResponse> future = autoMlClient.listModelsPagedCallable().futureCall(request);
// Do something
for (Model element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListModelsRequest,ListModelsResponse> listModelsCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
ListModelsRequest request = ListModelsRequest.newBuilder()
.setParent(parent.toString())
.build();
while (true) {
ListModelsResponse response = autoMlClient.listModelsCallable().call(request);
for (Model element : response.getModelList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteModelAsync(ModelName name)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
autoMlClient.deleteModelAsync(name).get();
}
name - Resource name of the model being deleted.com.google.api.gax.rpc.ApiException - if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteModelAsync(String name)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
autoMlClient.deleteModelAsync(name.toString()).get();
}
name - Resource name of the model being deleted.com.google.api.gax.rpc.ApiException - if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteModelAsync(DeleteModelRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
DeleteModelRequest request = DeleteModelRequest.newBuilder()
.setName(name.toString())
.build();
autoMlClient.deleteModelAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<DeleteModelRequest,com.google.protobuf.Empty,OperationMetadata> deleteModelOperationCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
DeleteModelRequest request = DeleteModelRequest.newBuilder()
.setName(name.toString())
.build();
OperationFuture<Empty, OperationMetadata> future = autoMlClient.deleteModelOperationCallable().futureCall(request);
// Do something
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteModelRequest,com.google.longrunning.Operation> deleteModelCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
DeleteModelRequest request = DeleteModelRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Operation> future = autoMlClient.deleteModelCallable().futureCall(request);
// Do something
future.get();
}
public final ModelEvaluation getModelEvaluation(ModelEvaluationName name)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
ModelEvaluation response = autoMlClient.getModelEvaluation(name);
}
name - Resource name for the model evaluation.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ModelEvaluation getModelEvaluation(String name)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
ModelEvaluation response = autoMlClient.getModelEvaluation(name.toString());
}
name - Resource name for the model evaluation.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ModelEvaluation getModelEvaluation(GetModelEvaluationRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
GetModelEvaluationRequest request = GetModelEvaluationRequest.newBuilder()
.setName(name.toString())
.build();
ModelEvaluation response = autoMlClient.getModelEvaluation(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetModelEvaluationRequest,ModelEvaluation> getModelEvaluationCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
GetModelEvaluationRequest request = GetModelEvaluationRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<ModelEvaluation> future = autoMlClient.getModelEvaluationCallable().futureCall(request);
// Do something
ModelEvaluation response = future.get();
}
public final AutoMlClient.ListModelEvaluationsPagedResponse listModelEvaluations(ModelName parent, String filter)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
String filter = "";
for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent, filter).iterateAll()) {
// doThingsWith(element);
}
}
parent - Resource name of the model to list the model evaluations for. If modelId is set
as "-", this will list model evaluations from across all models of the parent location.filter - An expression for filtering the results of the request.
* `annotation_spec_id` - for =, != or existence. See example below for the last.
Some examples of using the filter are:
* `annotation_spec_id!=4` --> The model evaluation was done for annotation spec with ID different than 4. * `NOT annotation_spec_id:*` --> The model evaluation was done for aggregate of all annotation specs.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final AutoMlClient.ListModelEvaluationsPagedResponse listModelEvaluations(String parent, String filter)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
String filter = "";
for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent.toString(), filter).iterateAll()) {
// doThingsWith(element);
}
}
parent - Resource name of the model to list the model evaluations for. If modelId is set
as "-", this will list model evaluations from across all models of the parent location.filter - An expression for filtering the results of the request.
* `annotation_spec_id` - for =, != or existence. See example below for the last.
Some examples of using the filter are:
* `annotation_spec_id!=4` --> The model evaluation was done for annotation spec with ID different than 4. * `NOT annotation_spec_id:*` --> The model evaluation was done for aggregate of all annotation specs.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final AutoMlClient.ListModelEvaluationsPagedResponse listModelEvaluations(ListModelEvaluationsRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
String filter = "";
ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
.setParent(parent.toString())
.setFilter(filter)
.build();
for (ModelEvaluation element : autoMlClient.listModelEvaluations(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListModelEvaluationsRequest,AutoMlClient.ListModelEvaluationsPagedResponse> listModelEvaluationsPagedCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
String filter = "";
ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
.setParent(parent.toString())
.setFilter(filter)
.build();
ApiFuture<ListModelEvaluationsPagedResponse> future = autoMlClient.listModelEvaluationsPagedCallable().futureCall(request);
// Do something
for (ModelEvaluation element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListModelEvaluationsRequest,ListModelEvaluationsResponse> listModelEvaluationsCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
String filter = "";
ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
.setParent(parent.toString())
.setFilter(filter)
.build();
while (true) {
ListModelEvaluationsResponse response = autoMlClient.listModelEvaluationsCallable().call(request);
for (ModelEvaluation element : response.getModelEvaluationList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2019 Google LLC. All rights reserved.