@Generated(value="by gapic-generator") @BetaApi public class AutoMlClient extends Object implements 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()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Dataset dataset = Dataset.newBuilder().build();
Dataset response = autoMlClient.createDataset(parent, dataset);
}
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.ListColumnSpecsFixedSizeCollection |
static class |
AutoMlClient.ListColumnSpecsPage |
static class |
AutoMlClient.ListColumnSpecsPagedResponse |
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 |
static class |
AutoMlClient.ListTableSpecsFixedSizeCollection |
static class |
AutoMlClient.ListTableSpecsPage |
static class |
AutoMlClient.ListTableSpecsPagedResponse |
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.cloud.automl.v1beta1.Dataset |
createDataset(com.google.cloud.automl.v1beta1.CreateDatasetRequest request)
Creates a dataset.
|
com.google.cloud.automl.v1beta1.Dataset |
createDataset(com.google.cloud.automl.v1beta1.LocationName parent,
com.google.cloud.automl.v1beta1.Dataset dataset)
Creates a dataset.
|
com.google.cloud.automl.v1beta1.Dataset |
createDataset(String parent,
com.google.cloud.automl.v1beta1.Dataset dataset)
Creates a dataset.
|
UnaryCallable<com.google.cloud.automl.v1beta1.CreateDatasetRequest,com.google.cloud.automl.v1beta1.Dataset> |
createDatasetCallable()
Creates a dataset.
|
OperationFuture<com.google.cloud.automl.v1beta1.Model,com.google.cloud.automl.v1beta1.OperationMetadata> |
createModelAsync(com.google.cloud.automl.v1beta1.CreateModelRequest request)
Creates a model.
|
OperationFuture<com.google.cloud.automl.v1beta1.Model,com.google.cloud.automl.v1beta1.OperationMetadata> |
createModelAsync(com.google.cloud.automl.v1beta1.LocationName parent,
com.google.cloud.automl.v1beta1.Model model)
Creates a model.
|
OperationFuture<com.google.cloud.automl.v1beta1.Model,com.google.cloud.automl.v1beta1.OperationMetadata> |
createModelAsync(String parent,
com.google.cloud.automl.v1beta1.Model model)
Creates a model.
|
UnaryCallable<com.google.cloud.automl.v1beta1.CreateModelRequest,Operation> |
createModelCallable()
Creates a model.
|
OperationCallable<com.google.cloud.automl.v1beta1.CreateModelRequest,com.google.cloud.automl.v1beta1.Model,com.google.cloud.automl.v1beta1.OperationMetadata> |
createModelOperationCallable()
Creates a model.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
deleteDatasetAsync(com.google.cloud.automl.v1beta1.DatasetName name)
Deletes a dataset and all of its contents.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
deleteDatasetAsync(com.google.cloud.automl.v1beta1.DeleteDatasetRequest request)
Deletes a dataset and all of its contents.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
deleteDatasetAsync(String name)
Deletes a dataset and all of its contents.
|
UnaryCallable<com.google.cloud.automl.v1beta1.DeleteDatasetRequest,Operation> |
deleteDatasetCallable()
Deletes a dataset and all of its contents.
|
OperationCallable<com.google.cloud.automl.v1beta1.DeleteDatasetRequest,Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
deleteDatasetOperationCallable()
Deletes a dataset and all of its contents.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
deleteModelAsync(com.google.cloud.automl.v1beta1.DeleteModelRequest request)
Deletes a model.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
deleteModelAsync(com.google.cloud.automl.v1beta1.ModelName name)
Deletes a model.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
deleteModelAsync(String name)
Deletes a model.
|
UnaryCallable<com.google.cloud.automl.v1beta1.DeleteModelRequest,Operation> |
deleteModelCallable()
Deletes a model.
|
OperationCallable<com.google.cloud.automl.v1beta1.DeleteModelRequest,Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
deleteModelOperationCallable()
Deletes a model.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
deployModelAsync(com.google.cloud.automl.v1beta1.DeployModelRequest request)
Deploys a model.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
deployModelAsync(com.google.cloud.automl.v1beta1.ModelName name)
Deploys a model.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
deployModelAsync(String name)
Deploys a model.
|
UnaryCallable<com.google.cloud.automl.v1beta1.DeployModelRequest,Operation> |
deployModelCallable()
Deploys a model.
|
OperationCallable<com.google.cloud.automl.v1beta1.DeployModelRequest,Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
deployModelOperationCallable()
Deploys a model.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
exportDataAsync(com.google.cloud.automl.v1beta1.DatasetName name,
com.google.cloud.automl.v1beta1.OutputConfig outputConfig)
Exports dataset's data to the provided output location.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
exportDataAsync(com.google.cloud.automl.v1beta1.ExportDataRequest request)
Exports dataset's data to the provided output location.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
exportDataAsync(String name,
com.google.cloud.automl.v1beta1.OutputConfig outputConfig)
Exports dataset's data to the provided output location.
|
UnaryCallable<com.google.cloud.automl.v1beta1.ExportDataRequest,Operation> |
exportDataCallable()
Exports dataset's data to the provided output location.
|
OperationCallable<com.google.cloud.automl.v1beta1.ExportDataRequest,Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
exportDataOperationCallable()
Exports dataset's data to the provided output location.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
exportEvaluatedExamplesAsync(com.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest request)
Exports examples on which the model was evaluated (i.e.
|
UnaryCallable<com.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest,Operation> |
exportEvaluatedExamplesCallable()
Exports examples on which the model was evaluated (i.e.
|
OperationCallable<com.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest,Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
exportEvaluatedExamplesOperationCallable()
Exports examples on which the model was evaluated (i.e.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
exportModelAsync(com.google.cloud.automl.v1beta1.ExportModelRequest request)
Exports a trained, "export-able", model to a user specified Google Cloud Storage location.
|
UnaryCallable<com.google.cloud.automl.v1beta1.ExportModelRequest,Operation> |
exportModelCallable()
Exports a trained, "export-able", model to a user specified Google Cloud Storage location.
|
OperationCallable<com.google.cloud.automl.v1beta1.ExportModelRequest,Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
exportModelOperationCallable()
Exports a trained, "export-able", model to a user specified Google Cloud Storage location.
|
com.google.cloud.automl.v1beta1.AnnotationSpec |
getAnnotationSpec(com.google.cloud.automl.v1beta1.AnnotationSpecName name)
Gets an annotation spec.
|
com.google.cloud.automl.v1beta1.AnnotationSpec |
getAnnotationSpec(com.google.cloud.automl.v1beta1.GetAnnotationSpecRequest request)
Gets an annotation spec.
|
com.google.cloud.automl.v1beta1.AnnotationSpec |
getAnnotationSpec(String name)
Gets an annotation spec.
|
UnaryCallable<com.google.cloud.automl.v1beta1.GetAnnotationSpecRequest,com.google.cloud.automl.v1beta1.AnnotationSpec> |
getAnnotationSpecCallable()
Gets an annotation spec.
|
com.google.cloud.automl.v1beta1.ColumnSpec |
getColumnSpec(com.google.cloud.automl.v1beta1.ColumnSpecName name)
Gets a column spec.
|
com.google.cloud.automl.v1beta1.ColumnSpec |
getColumnSpec(com.google.cloud.automl.v1beta1.GetColumnSpecRequest request)
Gets a column spec.
|
com.google.cloud.automl.v1beta1.ColumnSpec |
getColumnSpec(String name)
Gets a column spec.
|
UnaryCallable<com.google.cloud.automl.v1beta1.GetColumnSpecRequest,com.google.cloud.automl.v1beta1.ColumnSpec> |
getColumnSpecCallable()
Gets a column spec.
|
com.google.cloud.automl.v1beta1.Dataset |
getDataset(com.google.cloud.automl.v1beta1.DatasetName name)
Gets a dataset.
|
com.google.cloud.automl.v1beta1.Dataset |
getDataset(com.google.cloud.automl.v1beta1.GetDatasetRequest request)
Gets a dataset.
|
com.google.cloud.automl.v1beta1.Dataset |
getDataset(String name)
Gets a dataset.
|
UnaryCallable<com.google.cloud.automl.v1beta1.GetDatasetRequest,com.google.cloud.automl.v1beta1.Dataset> |
getDatasetCallable()
Gets a dataset.
|
com.google.cloud.automl.v1beta1.Model |
getModel(com.google.cloud.automl.v1beta1.GetModelRequest request)
Gets a model.
|
com.google.cloud.automl.v1beta1.Model |
getModel(com.google.cloud.automl.v1beta1.ModelName name)
Gets a model.
|
com.google.cloud.automl.v1beta1.Model |
getModel(String name)
Gets a model.
|
UnaryCallable<com.google.cloud.automl.v1beta1.GetModelRequest,com.google.cloud.automl.v1beta1.Model> |
getModelCallable()
Gets a model.
|
com.google.cloud.automl.v1beta1.ModelEvaluation |
getModelEvaluation(com.google.cloud.automl.v1beta1.GetModelEvaluationRequest request)
Gets a model evaluation.
|
com.google.cloud.automl.v1beta1.ModelEvaluation |
getModelEvaluation(com.google.cloud.automl.v1beta1.ModelEvaluationName name)
Gets a model evaluation.
|
com.google.cloud.automl.v1beta1.ModelEvaluation |
getModelEvaluation(String name)
Gets a model evaluation.
|
UnaryCallable<com.google.cloud.automl.v1beta1.GetModelEvaluationRequest,com.google.cloud.automl.v1beta1.ModelEvaluation> |
getModelEvaluationCallable()
Gets a model evaluation.
|
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.cloud.automl.v1beta1.TableSpec |
getTableSpec(com.google.cloud.automl.v1beta1.GetTableSpecRequest request)
Gets a table spec.
|
com.google.cloud.automl.v1beta1.TableSpec |
getTableSpec(String name)
Gets a table spec.
|
com.google.cloud.automl.v1beta1.TableSpec |
getTableSpec(com.google.cloud.automl.v1beta1.TableSpecName name)
Gets a table spec.
|
UnaryCallable<com.google.cloud.automl.v1beta1.GetTableSpecRequest,com.google.cloud.automl.v1beta1.TableSpec> |
getTableSpecCallable()
Gets a table spec.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
importDataAsync(com.google.cloud.automl.v1beta1.DatasetName name,
com.google.cloud.automl.v1beta1.InputConfig inputConfig)
Imports data into a dataset.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
importDataAsync(com.google.cloud.automl.v1beta1.ImportDataRequest request)
Imports data into a dataset.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
importDataAsync(String name,
com.google.cloud.automl.v1beta1.InputConfig inputConfig)
Imports data into a dataset.
|
UnaryCallable<com.google.cloud.automl.v1beta1.ImportDataRequest,Operation> |
importDataCallable()
Imports data into a dataset.
|
OperationCallable<com.google.cloud.automl.v1beta1.ImportDataRequest,Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
importDataOperationCallable()
Imports data into a dataset.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
AutoMlClient.ListColumnSpecsPagedResponse |
listColumnSpecs(com.google.cloud.automl.v1beta1.ListColumnSpecsRequest request)
Lists column specs in a table spec.
|
AutoMlClient.ListColumnSpecsPagedResponse |
listColumnSpecs(String parent)
Lists column specs in a table spec.
|
AutoMlClient.ListColumnSpecsPagedResponse |
listColumnSpecs(com.google.cloud.automl.v1beta1.TableSpecName parent)
Lists column specs in a table spec.
|
UnaryCallable<com.google.cloud.automl.v1beta1.ListColumnSpecsRequest,com.google.cloud.automl.v1beta1.ListColumnSpecsResponse> |
listColumnSpecsCallable()
Lists column specs in a table spec.
|
UnaryCallable<com.google.cloud.automl.v1beta1.ListColumnSpecsRequest,AutoMlClient.ListColumnSpecsPagedResponse> |
listColumnSpecsPagedCallable()
Lists column specs in a table spec.
|
AutoMlClient.ListDatasetsPagedResponse |
listDatasets(com.google.cloud.automl.v1beta1.ListDatasetsRequest request)
Lists datasets in a project.
|
AutoMlClient.ListDatasetsPagedResponse |
listDatasets(com.google.cloud.automl.v1beta1.LocationName parent)
Lists datasets in a project.
|
AutoMlClient.ListDatasetsPagedResponse |
listDatasets(String parent)
Lists datasets in a project.
|
UnaryCallable<com.google.cloud.automl.v1beta1.ListDatasetsRequest,com.google.cloud.automl.v1beta1.ListDatasetsResponse> |
listDatasetsCallable()
Lists datasets in a project.
|
UnaryCallable<com.google.cloud.automl.v1beta1.ListDatasetsRequest,AutoMlClient.ListDatasetsPagedResponse> |
listDatasetsPagedCallable()
Lists datasets in a project.
|
AutoMlClient.ListModelEvaluationsPagedResponse |
listModelEvaluations(com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest request)
Lists model evaluations.
|
AutoMlClient.ListModelEvaluationsPagedResponse |
listModelEvaluations(com.google.cloud.automl.v1beta1.ModelName parent)
Lists model evaluations.
|
AutoMlClient.ListModelEvaluationsPagedResponse |
listModelEvaluations(String parent)
Lists model evaluations.
|
UnaryCallable<com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest,com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse> |
listModelEvaluationsCallable()
Lists model evaluations.
|
UnaryCallable<com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest,AutoMlClient.ListModelEvaluationsPagedResponse> |
listModelEvaluationsPagedCallable()
Lists model evaluations.
|
AutoMlClient.ListModelsPagedResponse |
listModels(com.google.cloud.automl.v1beta1.ListModelsRequest request)
Lists models.
|
AutoMlClient.ListModelsPagedResponse |
listModels(com.google.cloud.automl.v1beta1.LocationName parent)
Lists models.
|
AutoMlClient.ListModelsPagedResponse |
listModels(String parent)
Lists models.
|
UnaryCallable<com.google.cloud.automl.v1beta1.ListModelsRequest,com.google.cloud.automl.v1beta1.ListModelsResponse> |
listModelsCallable()
Lists models.
|
UnaryCallable<com.google.cloud.automl.v1beta1.ListModelsRequest,AutoMlClient.ListModelsPagedResponse> |
listModelsPagedCallable()
Lists models.
|
AutoMlClient.ListTableSpecsPagedResponse |
listTableSpecs(com.google.cloud.automl.v1beta1.DatasetName parent)
Lists table specs in a dataset.
|
AutoMlClient.ListTableSpecsPagedResponse |
listTableSpecs(com.google.cloud.automl.v1beta1.ListTableSpecsRequest request)
Lists table specs in a dataset.
|
AutoMlClient.ListTableSpecsPagedResponse |
listTableSpecs(String parent)
Lists table specs in a dataset.
|
UnaryCallable<com.google.cloud.automl.v1beta1.ListTableSpecsRequest,com.google.cloud.automl.v1beta1.ListTableSpecsResponse> |
listTableSpecsCallable()
Lists table specs in a dataset.
|
UnaryCallable<com.google.cloud.automl.v1beta1.ListTableSpecsRequest,AutoMlClient.ListTableSpecsPagedResponse> |
listTableSpecsPagedCallable()
Lists table specs in a dataset.
|
void |
shutdown() |
void |
shutdownNow() |
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
undeployModelAsync(com.google.cloud.automl.v1beta1.ModelName name)
Undeploys a model.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
undeployModelAsync(String name)
Undeploys a model.
|
OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
undeployModelAsync(com.google.cloud.automl.v1beta1.UndeployModelRequest request)
Undeploys a model.
|
UnaryCallable<com.google.cloud.automl.v1beta1.UndeployModelRequest,Operation> |
undeployModelCallable()
Undeploys a model.
|
OperationCallable<com.google.cloud.automl.v1beta1.UndeployModelRequest,Empty,com.google.cloud.automl.v1beta1.OperationMetadata> |
undeployModelOperationCallable()
Undeploys a model.
|
com.google.cloud.automl.v1beta1.ColumnSpec |
updateColumnSpec(com.google.cloud.automl.v1beta1.ColumnSpec columnSpec)
Updates a column spec.
|
com.google.cloud.automl.v1beta1.ColumnSpec |
updateColumnSpec(com.google.cloud.automl.v1beta1.UpdateColumnSpecRequest request)
Updates a column spec.
|
UnaryCallable<com.google.cloud.automl.v1beta1.UpdateColumnSpecRequest,com.google.cloud.automl.v1beta1.ColumnSpec> |
updateColumnSpecCallable()
Updates a column spec.
|
com.google.cloud.automl.v1beta1.Dataset |
updateDataset(com.google.cloud.automl.v1beta1.Dataset dataset)
Updates a dataset.
|
com.google.cloud.automl.v1beta1.Dataset |
updateDataset(com.google.cloud.automl.v1beta1.UpdateDatasetRequest request)
Updates a dataset.
|
UnaryCallable<com.google.cloud.automl.v1beta1.UpdateDatasetRequest,com.google.cloud.automl.v1beta1.Dataset> |
updateDatasetCallable()
Updates a dataset.
|
com.google.cloud.automl.v1beta1.TableSpec |
updateTableSpec(com.google.cloud.automl.v1beta1.TableSpec tableSpec)
Updates a table spec.
|
com.google.cloud.automl.v1beta1.TableSpec |
updateTableSpec(com.google.cloud.automl.v1beta1.UpdateTableSpecRequest request)
Updates a table spec.
|
UnaryCallable<com.google.cloud.automl.v1beta1.UpdateTableSpecRequest,com.google.cloud.automl.v1beta1.TableSpec> |
updateTableSpecCallable()
Updates a table spec.
|
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
IOException
public 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 OperationsClient getOperationsClient()
public final com.google.cloud.automl.v1beta1.Dataset createDataset(com.google.cloud.automl.v1beta1.LocationName parent, com.google.cloud.automl.v1beta1.Dataset dataset)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Dataset dataset = Dataset.newBuilder().build();
Dataset response = autoMlClient.createDataset(parent, dataset);
}
parent
- The resource name of the project to create the dataset for.dataset
- The dataset to create.ApiException
- if the remote call failspublic final com.google.cloud.automl.v1beta1.Dataset createDataset(String parent, com.google.cloud.automl.v1beta1.Dataset dataset)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Dataset dataset = Dataset.newBuilder().build();
Dataset response = autoMlClient.createDataset(parent.toString(), dataset);
}
parent
- The resource name of the project to create the dataset for.dataset
- The dataset to create.ApiException
- if the remote call failspublic final com.google.cloud.automl.v1beta1.Dataset createDataset(com.google.cloud.automl.v1beta1.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.createDataset(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.automl.v1beta1.CreateDatasetRequest,com.google.cloud.automl.v1beta1.Dataset> 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<Dataset> future = autoMlClient.createDatasetCallable().futureCall(request);
// Do something
Dataset response = future.get();
}
public final com.google.cloud.automl.v1beta1.Dataset updateDataset(com.google.cloud.automl.v1beta1.Dataset dataset)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
Dataset dataset = Dataset.newBuilder().build();
Dataset response = autoMlClient.updateDataset(dataset);
}
dataset
- The dataset which replaces the resource on the server.ApiException
- if the remote call failspublic final com.google.cloud.automl.v1beta1.Dataset updateDataset(com.google.cloud.automl.v1beta1.UpdateDatasetRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
Dataset dataset = Dataset.newBuilder().build();
UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder()
.setDataset(dataset)
.build();
Dataset response = autoMlClient.updateDataset(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.automl.v1beta1.UpdateDatasetRequest,com.google.cloud.automl.v1beta1.Dataset> updateDatasetCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
Dataset dataset = Dataset.newBuilder().build();
UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder()
.setDataset(dataset)
.build();
ApiFuture<Dataset> future = autoMlClient.updateDatasetCallable().futureCall(request);
// Do something
Dataset response = future.get();
}
public final com.google.cloud.automl.v1beta1.Dataset getDataset(com.google.cloud.automl.v1beta1.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.ApiException
- if the remote call failspublic final com.google.cloud.automl.v1beta1.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.ApiException
- if the remote call failspublic final com.google.cloud.automl.v1beta1.Dataset getDataset(com.google.cloud.automl.v1beta1.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.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.automl.v1beta1.GetDatasetRequest,com.google.cloud.automl.v1beta1.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(com.google.cloud.automl.v1beta1.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.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.ApiException
- if the remote call failspublic final AutoMlClient.ListDatasetsPagedResponse listDatasets(com.google.cloud.automl.v1beta1.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.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.automl.v1beta1.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 UnaryCallable<com.google.cloud.automl.v1beta1.ListDatasetsRequest,com.google.cloud.automl.v1beta1.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 OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> deleteDatasetAsync(com.google.cloud.automl.v1beta1.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.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 OperationFuture<Empty,com.google.cloud.automl.v1beta1.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.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 OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> deleteDatasetAsync(com.google.cloud.automl.v1beta1.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.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 OperationCallable<com.google.cloud.automl.v1beta1.DeleteDatasetRequest,Empty,com.google.cloud.automl.v1beta1.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 UnaryCallable<com.google.cloud.automl.v1beta1.DeleteDatasetRequest,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 OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> importDataAsync(com.google.cloud.automl.v1beta1.DatasetName name, com.google.cloud.automl.v1beta1.InputConfig inputConfig)
For Tables: * A [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be explicitly set. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
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.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 OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> importDataAsync(String name, com.google.cloud.automl.v1beta1.InputConfig inputConfig)
For Tables: * A [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be explicitly set. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
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.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 OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> importDataAsync(com.google.cloud.automl.v1beta1.ImportDataRequest request)
For Tables: * A [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be explicitly set. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
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.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 OperationCallable<com.google.cloud.automl.v1beta1.ImportDataRequest,Empty,com.google.cloud.automl.v1beta1.OperationMetadata> importDataOperationCallable()
For Tables: * A [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be explicitly set. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
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 UnaryCallable<com.google.cloud.automl.v1beta1.ImportDataRequest,Operation> importDataCallable()
For Tables: * A [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be explicitly set. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
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 OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> exportDataAsync(com.google.cloud.automl.v1beta1.DatasetName name, com.google.cloud.automl.v1beta1.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.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 OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> exportDataAsync(String name, com.google.cloud.automl.v1beta1.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.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 OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> exportDataAsync(com.google.cloud.automl.v1beta1.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.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 OperationCallable<com.google.cloud.automl.v1beta1.ExportDataRequest,Empty,com.google.cloud.automl.v1beta1.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 UnaryCallable<com.google.cloud.automl.v1beta1.ExportDataRequest,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 OperationFuture<com.google.cloud.automl.v1beta1.Model,com.google.cloud.automl.v1beta1.OperationMetadata> createModelAsync(com.google.cloud.automl.v1beta1.LocationName parent, com.google.cloud.automl.v1beta1.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.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 OperationFuture<com.google.cloud.automl.v1beta1.Model,com.google.cloud.automl.v1beta1.OperationMetadata> createModelAsync(String parent, com.google.cloud.automl.v1beta1.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.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 OperationFuture<com.google.cloud.automl.v1beta1.Model,com.google.cloud.automl.v1beta1.OperationMetadata> createModelAsync(com.google.cloud.automl.v1beta1.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.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 OperationCallable<com.google.cloud.automl.v1beta1.CreateModelRequest,com.google.cloud.automl.v1beta1.Model,com.google.cloud.automl.v1beta1.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 UnaryCallable<com.google.cloud.automl.v1beta1.CreateModelRequest,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 com.google.cloud.automl.v1beta1.Model getModel(com.google.cloud.automl.v1beta1.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.ApiException
- if the remote call failspublic final com.google.cloud.automl.v1beta1.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.ApiException
- if the remote call failspublic final com.google.cloud.automl.v1beta1.Model getModel(com.google.cloud.automl.v1beta1.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.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.automl.v1beta1.GetModelRequest,com.google.cloud.automl.v1beta1.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 AutoMlClient.ListModelsPagedResponse listModels(com.google.cloud.automl.v1beta1.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.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.ApiException
- if the remote call failspublic final AutoMlClient.ListModelsPagedResponse listModels(com.google.cloud.automl.v1beta1.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.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.automl.v1beta1.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 UnaryCallable<com.google.cloud.automl.v1beta1.ListModelsRequest,com.google.cloud.automl.v1beta1.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 OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> deleteModelAsync(com.google.cloud.automl.v1beta1.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.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 OperationFuture<Empty,com.google.cloud.automl.v1beta1.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.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 OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> deleteModelAsync(com.google.cloud.automl.v1beta1.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.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 OperationCallable<com.google.cloud.automl.v1beta1.DeleteModelRequest,Empty,com.google.cloud.automl.v1beta1.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 UnaryCallable<com.google.cloud.automl.v1beta1.DeleteModelRequest,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();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> deployModelAsync(com.google.cloud.automl.v1beta1.ModelName name)
[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number] ) will update the deployment without pausing the model's availability.
Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
autoMlClient.deployModelAsync(name).get();
}
name
- Resource name of the model to deploy.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 OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> deployModelAsync(String name)
[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number] ) will update the deployment without pausing the model's availability.
Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
autoMlClient.deployModelAsync(name.toString()).get();
}
name
- Resource name of the model to deploy.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 OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> deployModelAsync(com.google.cloud.automl.v1beta1.DeployModelRequest request)
[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number] ) will update the deployment without pausing the model's availability.
Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
DeployModelRequest request = DeployModelRequest.newBuilder()
.setName(name.toString())
.build();
autoMlClient.deployModelAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.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 OperationCallable<com.google.cloud.automl.v1beta1.DeployModelRequest,Empty,com.google.cloud.automl.v1beta1.OperationMetadata> deployModelOperationCallable()
[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number] ) will update the deployment without pausing the model's availability.
Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
DeployModelRequest request = DeployModelRequest.newBuilder()
.setName(name.toString())
.build();
OperationFuture<Empty, OperationMetadata> future = autoMlClient.deployModelOperationCallable().futureCall(request);
// Do something
future.get();
}
public final UnaryCallable<com.google.cloud.automl.v1beta1.DeployModelRequest,Operation> deployModelCallable()
[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number] ) will update the deployment without pausing the model's availability.
Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
DeployModelRequest request = DeployModelRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Operation> future = autoMlClient.deployModelCallable().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 OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> undeployModelAsync(com.google.cloud.automl.v1beta1.ModelName name)
Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
autoMlClient.undeployModelAsync(name).get();
}
name
- Resource name of the model to undeploy.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 OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> undeployModelAsync(String name)
Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
autoMlClient.undeployModelAsync(name.toString()).get();
}
name
- Resource name of the model to undeploy.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 OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> undeployModelAsync(com.google.cloud.automl.v1beta1.UndeployModelRequest request)
Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
UndeployModelRequest request = UndeployModelRequest.newBuilder()
.setName(name.toString())
.build();
autoMlClient.undeployModelAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.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 OperationCallable<com.google.cloud.automl.v1beta1.UndeployModelRequest,Empty,com.google.cloud.automl.v1beta1.OperationMetadata> undeployModelOperationCallable()
Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
UndeployModelRequest request = UndeployModelRequest.newBuilder()
.setName(name.toString())
.build();
OperationFuture<Empty, OperationMetadata> future = autoMlClient.undeployModelOperationCallable().futureCall(request);
// Do something
future.get();
}
public final UnaryCallable<com.google.cloud.automl.v1beta1.UndeployModelRequest,Operation> undeployModelCallable()
Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
UndeployModelRequest request = UndeployModelRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Operation> future = autoMlClient.undeployModelCallable().futureCall(request);
// Do something
future.get();
}
public final com.google.cloud.automl.v1beta1.ModelEvaluation getModelEvaluation(com.google.cloud.automl.v1beta1.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.ApiException
- if the remote call failspublic final com.google.cloud.automl.v1beta1.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.ApiException
- if the remote call failspublic final com.google.cloud.automl.v1beta1.ModelEvaluation getModelEvaluation(com.google.cloud.automl.v1beta1.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.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.automl.v1beta1.GetModelEvaluationRequest,com.google.cloud.automl.v1beta1.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();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> exportModelAsync(com.google.cloud.automl.v1beta1.ExportModelRequest request)
[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig].
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
ExportModelRequest request = ExportModelRequest.newBuilder()
.setName(name.toString())
.setOutputConfig(outputConfig)
.build();
autoMlClient.exportModelAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.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 OperationCallable<com.google.cloud.automl.v1beta1.ExportModelRequest,Empty,com.google.cloud.automl.v1beta1.OperationMetadata> exportModelOperationCallable()
[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig].
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
ExportModelRequest request = ExportModelRequest.newBuilder()
.setName(name.toString())
.setOutputConfig(outputConfig)
.build();
OperationFuture<Empty, OperationMetadata> future = autoMlClient.exportModelOperationCallable().futureCall(request);
// Do something
future.get();
}
public final UnaryCallable<com.google.cloud.automl.v1beta1.ExportModelRequest,Operation> exportModelCallable()
[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig].
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
ExportModelRequest request = ExportModelRequest.newBuilder()
.setName(name.toString())
.setOutputConfig(outputConfig)
.build();
ApiFuture<Operation> future = autoMlClient.exportModelCallable().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 OperationFuture<Empty,com.google.cloud.automl.v1beta1.OperationMetadata> exportEvaluatedExamplesAsync(com.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest request)
This export is available only for 30 days since the model evaluation is created.
Currently only available for Tables.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
ExportEvaluatedExamplesOutputConfig outputConfig = ExportEvaluatedExamplesOutputConfig.newBuilder().build();
ExportEvaluatedExamplesRequest request = ExportEvaluatedExamplesRequest.newBuilder()
.setName(name.toString())
.setOutputConfig(outputConfig)
.build();
autoMlClient.exportEvaluatedExamplesAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.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 OperationCallable<com.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest,Empty,com.google.cloud.automl.v1beta1.OperationMetadata> exportEvaluatedExamplesOperationCallable()
This export is available only for 30 days since the model evaluation is created.
Currently only available for Tables.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
ExportEvaluatedExamplesOutputConfig outputConfig = ExportEvaluatedExamplesOutputConfig.newBuilder().build();
ExportEvaluatedExamplesRequest request = ExportEvaluatedExamplesRequest.newBuilder()
.setName(name.toString())
.setOutputConfig(outputConfig)
.build();
OperationFuture<Empty, OperationMetadata> future = autoMlClient.exportEvaluatedExamplesOperationCallable().futureCall(request);
// Do something
future.get();
}
public final UnaryCallable<com.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest,Operation> exportEvaluatedExamplesCallable()
This export is available only for 30 days since the model evaluation is created.
Currently only available for Tables.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
ExportEvaluatedExamplesOutputConfig outputConfig = ExportEvaluatedExamplesOutputConfig.newBuilder().build();
ExportEvaluatedExamplesRequest request = ExportEvaluatedExamplesRequest.newBuilder()
.setName(name.toString())
.setOutputConfig(outputConfig)
.build();
ApiFuture<Operation> future = autoMlClient.exportEvaluatedExamplesCallable().futureCall(request);
// Do something
future.get();
}
public final AutoMlClient.ListModelEvaluationsPagedResponse listModelEvaluations(com.google.cloud.automl.v1beta1.ModelName parent)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent).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.ApiException
- if the remote call failspublic final AutoMlClient.ListModelEvaluationsPagedResponse listModelEvaluations(String parent)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent.toString()).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.ApiException
- if the remote call failspublic final AutoMlClient.ListModelEvaluationsPagedResponse listModelEvaluations(com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
.setParent(parent.toString())
.build();
for (ModelEvaluation element : autoMlClient.listModelEvaluations(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest,AutoMlClient.ListModelEvaluationsPagedResponse> listModelEvaluationsPagedCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListModelEvaluationsPagedResponse> future = autoMlClient.listModelEvaluationsPagedCallable().futureCall(request);
// Do something
for (ModelEvaluation element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest,com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse> listModelEvaluationsCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
.setParent(parent.toString())
.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 com.google.cloud.automl.v1beta1.AnnotationSpec getAnnotationSpec(com.google.cloud.automl.v1beta1.AnnotationSpecName name)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
AnnotationSpec response = autoMlClient.getAnnotationSpec(name);
}
name
- The resource name of the annotation spec to retrieve.ApiException
- if the remote call failspublic final com.google.cloud.automl.v1beta1.AnnotationSpec getAnnotationSpec(String name)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
AnnotationSpec response = autoMlClient.getAnnotationSpec(name.toString());
}
name
- The resource name of the annotation spec to retrieve.ApiException
- if the remote call failspublic final com.google.cloud.automl.v1beta1.AnnotationSpec getAnnotationSpec(com.google.cloud.automl.v1beta1.GetAnnotationSpecRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder()
.setName(name.toString())
.build();
AnnotationSpec response = autoMlClient.getAnnotationSpec(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.automl.v1beta1.GetAnnotationSpecRequest,com.google.cloud.automl.v1beta1.AnnotationSpec> getAnnotationSpecCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<AnnotationSpec> future = autoMlClient.getAnnotationSpecCallable().futureCall(request);
// Do something
AnnotationSpec response = future.get();
}
public final com.google.cloud.automl.v1beta1.TableSpec getTableSpec(com.google.cloud.automl.v1beta1.TableSpecName name)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
TableSpec response = autoMlClient.getTableSpec(name);
}
name
- The resource name of the table spec to retrieve.ApiException
- if the remote call failspublic final com.google.cloud.automl.v1beta1.TableSpec getTableSpec(String name)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
TableSpec response = autoMlClient.getTableSpec(name.toString());
}
name
- The resource name of the table spec to retrieve.ApiException
- if the remote call failspublic final com.google.cloud.automl.v1beta1.TableSpec getTableSpec(com.google.cloud.automl.v1beta1.GetTableSpecRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
GetTableSpecRequest request = GetTableSpecRequest.newBuilder()
.setName(name.toString())
.build();
TableSpec response = autoMlClient.getTableSpec(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.automl.v1beta1.GetTableSpecRequest,com.google.cloud.automl.v1beta1.TableSpec> getTableSpecCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
GetTableSpecRequest request = GetTableSpecRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<TableSpec> future = autoMlClient.getTableSpecCallable().futureCall(request);
// Do something
TableSpec response = future.get();
}
public final AutoMlClient.ListTableSpecsPagedResponse listTableSpecs(com.google.cloud.automl.v1beta1.DatasetName parent)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
for (TableSpec element : autoMlClient.listTableSpecs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- The resource name of the dataset to list table specs from.ApiException
- if the remote call failspublic final AutoMlClient.ListTableSpecsPagedResponse listTableSpecs(String parent)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
for (TableSpec element : autoMlClient.listTableSpecs(parent.toString()).iterateAll()) {
// doThingsWith(element);
}
}
parent
- The resource name of the dataset to list table specs from.ApiException
- if the remote call failspublic final AutoMlClient.ListTableSpecsPagedResponse listTableSpecs(com.google.cloud.automl.v1beta1.ListTableSpecsRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
ListTableSpecsRequest request = ListTableSpecsRequest.newBuilder()
.setParent(parent.toString())
.build();
for (TableSpec element : autoMlClient.listTableSpecs(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.automl.v1beta1.ListTableSpecsRequest,AutoMlClient.ListTableSpecsPagedResponse> listTableSpecsPagedCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
ListTableSpecsRequest request = ListTableSpecsRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListTableSpecsPagedResponse> future = autoMlClient.listTableSpecsPagedCallable().futureCall(request);
// Do something
for (TableSpec element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.automl.v1beta1.ListTableSpecsRequest,com.google.cloud.automl.v1beta1.ListTableSpecsResponse> listTableSpecsCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
ListTableSpecsRequest request = ListTableSpecsRequest.newBuilder()
.setParent(parent.toString())
.build();
while (true) {
ListTableSpecsResponse response = autoMlClient.listTableSpecsCallable().call(request);
for (TableSpec element : response.getTableSpecsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.cloud.automl.v1beta1.TableSpec updateTableSpec(com.google.cloud.automl.v1beta1.TableSpec tableSpec)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
TableSpec tableSpec = TableSpec.newBuilder().build();
TableSpec response = autoMlClient.updateTableSpec(tableSpec);
}
tableSpec
- The table spec which replaces the resource on the server.ApiException
- if the remote call failspublic final com.google.cloud.automl.v1beta1.TableSpec updateTableSpec(com.google.cloud.automl.v1beta1.UpdateTableSpecRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
TableSpec tableSpec = TableSpec.newBuilder().build();
UpdateTableSpecRequest request = UpdateTableSpecRequest.newBuilder()
.setTableSpec(tableSpec)
.build();
TableSpec response = autoMlClient.updateTableSpec(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.automl.v1beta1.UpdateTableSpecRequest,com.google.cloud.automl.v1beta1.TableSpec> updateTableSpecCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
TableSpec tableSpec = TableSpec.newBuilder().build();
UpdateTableSpecRequest request = UpdateTableSpecRequest.newBuilder()
.setTableSpec(tableSpec)
.build();
ApiFuture<TableSpec> future = autoMlClient.updateTableSpecCallable().futureCall(request);
// Do something
TableSpec response = future.get();
}
public final com.google.cloud.automl.v1beta1.ColumnSpec getColumnSpec(com.google.cloud.automl.v1beta1.ColumnSpecName name)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ColumnSpecName name = ColumnSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]");
ColumnSpec response = autoMlClient.getColumnSpec(name);
}
name
- The resource name of the column spec to retrieve.ApiException
- if the remote call failspublic final com.google.cloud.automl.v1beta1.ColumnSpec getColumnSpec(String name)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ColumnSpecName name = ColumnSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]");
ColumnSpec response = autoMlClient.getColumnSpec(name.toString());
}
name
- The resource name of the column spec to retrieve.ApiException
- if the remote call failspublic final com.google.cloud.automl.v1beta1.ColumnSpec getColumnSpec(com.google.cloud.automl.v1beta1.GetColumnSpecRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ColumnSpecName name = ColumnSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]");
GetColumnSpecRequest request = GetColumnSpecRequest.newBuilder()
.setName(name.toString())
.build();
ColumnSpec response = autoMlClient.getColumnSpec(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.automl.v1beta1.GetColumnSpecRequest,com.google.cloud.automl.v1beta1.ColumnSpec> getColumnSpecCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ColumnSpecName name = ColumnSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]");
GetColumnSpecRequest request = GetColumnSpecRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<ColumnSpec> future = autoMlClient.getColumnSpecCallable().futureCall(request);
// Do something
ColumnSpec response = future.get();
}
public final AutoMlClient.ListColumnSpecsPagedResponse listColumnSpecs(com.google.cloud.automl.v1beta1.TableSpecName parent)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
TableSpecName parent = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
for (ColumnSpec element : autoMlClient.listColumnSpecs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- The resource name of the table spec to list column specs from.ApiException
- if the remote call failspublic final AutoMlClient.ListColumnSpecsPagedResponse listColumnSpecs(String parent)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
TableSpecName parent = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
for (ColumnSpec element : autoMlClient.listColumnSpecs(parent.toString()).iterateAll()) {
// doThingsWith(element);
}
}
parent
- The resource name of the table spec to list column specs from.ApiException
- if the remote call failspublic final AutoMlClient.ListColumnSpecsPagedResponse listColumnSpecs(com.google.cloud.automl.v1beta1.ListColumnSpecsRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
TableSpecName parent = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
ListColumnSpecsRequest request = ListColumnSpecsRequest.newBuilder()
.setParent(parent.toString())
.build();
for (ColumnSpec element : autoMlClient.listColumnSpecs(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.automl.v1beta1.ListColumnSpecsRequest,AutoMlClient.ListColumnSpecsPagedResponse> listColumnSpecsPagedCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
TableSpecName parent = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
ListColumnSpecsRequest request = ListColumnSpecsRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListColumnSpecsPagedResponse> future = autoMlClient.listColumnSpecsPagedCallable().futureCall(request);
// Do something
for (ColumnSpec element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.automl.v1beta1.ListColumnSpecsRequest,com.google.cloud.automl.v1beta1.ListColumnSpecsResponse> listColumnSpecsCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
TableSpecName parent = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
ListColumnSpecsRequest request = ListColumnSpecsRequest.newBuilder()
.setParent(parent.toString())
.build();
while (true) {
ListColumnSpecsResponse response = autoMlClient.listColumnSpecsCallable().call(request);
for (ColumnSpec element : response.getColumnSpecsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.cloud.automl.v1beta1.ColumnSpec updateColumnSpec(com.google.cloud.automl.v1beta1.ColumnSpec columnSpec)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ColumnSpec columnSpec = ColumnSpec.newBuilder().build();
ColumnSpec response = autoMlClient.updateColumnSpec(columnSpec);
}
columnSpec
- The column spec which replaces the resource on the server.ApiException
- if the remote call failspublic final com.google.cloud.automl.v1beta1.ColumnSpec updateColumnSpec(com.google.cloud.automl.v1beta1.UpdateColumnSpecRequest request)
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ColumnSpec columnSpec = ColumnSpec.newBuilder().build();
UpdateColumnSpecRequest request = UpdateColumnSpecRequest.newBuilder()
.setColumnSpec(columnSpec)
.build();
ColumnSpec response = autoMlClient.updateColumnSpec(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.automl.v1beta1.UpdateColumnSpecRequest,com.google.cloud.automl.v1beta1.ColumnSpec> updateColumnSpecCallable()
Sample code:
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ColumnSpec columnSpec = ColumnSpec.newBuilder().build();
UpdateColumnSpecRequest request = UpdateColumnSpecRequest.newBuilder()
.setColumnSpec(columnSpec)
.build();
ApiFuture<ColumnSpec> future = autoMlClient.updateColumnSpecCallable().futureCall(request);
// Do something
ColumnSpec response = future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface BackgroundResource
public boolean isShutdown()
isShutdown
in interface BackgroundResource
public boolean isTerminated()
isTerminated
in interface BackgroundResource
public void shutdownNow()
shutdownNow
in interface BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.