@BetaApi @Generated(value="by gapic-generator-java") 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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Dataset dataset = Dataset.newBuilder().build();
Dataset response = autoMlClient.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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
AutoMlSettings autoMlSettings =
AutoMlSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
AutoMlClient autoMlClient = AutoMlClient.create(autoMlSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
AutoMlSettings autoMlSettings = AutoMlSettings.newBuilder().setEndpoint(myEndpoint).build();
AutoMlClient autoMlClient = AutoMlClient.create(autoMlSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
AutoMlSettings autoMlSettings =
AutoMlSettings.newBuilder()
.setTransportChannelProvider(
AutoMlSettings.defaultHttpJsonTransportProviderBuilder().build())
.build();
AutoMlClient autoMlClient = AutoMlClient.create(autoMlSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| 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.
|
Dataset |
createDataset(CreateDatasetRequest request)
Creates a dataset.
|
Dataset |
createDataset(LocationName parent,
Dataset dataset)
Creates a dataset.
|
Dataset |
createDataset(String parent,
Dataset dataset)
Creates a dataset.
|
com.google.api.gax.rpc.UnaryCallable<CreateDatasetRequest,Dataset> |
createDatasetCallable()
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> |
deployModelAsync(DeployModelRequest request)
Deploys a model.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deployModelAsync(ModelName name)
Deploys a model.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deployModelAsync(String name)
Deploys a model.
|
com.google.api.gax.rpc.UnaryCallable<DeployModelRequest,com.google.longrunning.Operation> |
deployModelCallable()
Deploys a model.
|
com.google.api.gax.rpc.OperationCallable<DeployModelRequest,com.google.protobuf.Empty,OperationMetadata> |
deployModelOperationCallable()
Deploys 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.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
exportEvaluatedExamplesAsync(ExportEvaluatedExamplesRequest request)
Exports examples on which the model was evaluated (i.e.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
exportEvaluatedExamplesAsync(ModelName name,
ExportEvaluatedExamplesOutputConfig outputConfig)
Exports examples on which the model was evaluated (i.e.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
exportEvaluatedExamplesAsync(String name,
ExportEvaluatedExamplesOutputConfig outputConfig)
Exports examples on which the model was evaluated (i.e.
|
com.google.api.gax.rpc.UnaryCallable<ExportEvaluatedExamplesRequest,com.google.longrunning.Operation> |
exportEvaluatedExamplesCallable()
Exports examples on which the model was evaluated (i.e.
|
com.google.api.gax.rpc.OperationCallable<ExportEvaluatedExamplesRequest,com.google.protobuf.Empty,OperationMetadata> |
exportEvaluatedExamplesOperationCallable()
Exports examples on which the model was evaluated (i.e.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
exportModelAsync(ExportModelRequest request)
Exports a trained, "export-able", model to a user specified Google Cloud Storage location.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
exportModelAsync(ModelName name,
ModelExportOutputConfig outputConfig)
Exports a trained, "export-able", model to a user specified Google Cloud Storage location.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
exportModelAsync(String name,
ModelExportOutputConfig outputConfig)
Exports a trained, "export-able", model to a user specified Google Cloud Storage location.
|
com.google.api.gax.rpc.UnaryCallable<ExportModelRequest,com.google.longrunning.Operation> |
exportModelCallable()
Exports a trained, "export-able", model to a user specified Google Cloud Storage location.
|
com.google.api.gax.rpc.OperationCallable<ExportModelRequest,com.google.protobuf.Empty,OperationMetadata> |
exportModelOperationCallable()
Exports a trained, "export-able", model to a user specified Google Cloud Storage location.
|
AnnotationSpec |
getAnnotationSpec(AnnotationSpecName name)
Gets an annotation spec.
|
AnnotationSpec |
getAnnotationSpec(GetAnnotationSpecRequest request)
Gets an annotation spec.
|
AnnotationSpec |
getAnnotationSpec(String name)
Gets an annotation spec.
|
com.google.api.gax.rpc.UnaryCallable<GetAnnotationSpecRequest,AnnotationSpec> |
getAnnotationSpecCallable()
Gets an annotation spec.
|
ColumnSpec |
getColumnSpec(ColumnSpecName name)
Gets a column spec.
|
ColumnSpec |
getColumnSpec(GetColumnSpecRequest request)
Gets a column spec.
|
ColumnSpec |
getColumnSpec(String name)
Gets a column spec.
|
com.google.api.gax.rpc.UnaryCallable<GetColumnSpecRequest,ColumnSpec> |
getColumnSpecCallable()
Gets a column spec.
|
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.
|
com.google.api.gax.httpjson.longrunning.OperationsClient |
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
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() |
TableSpec |
getTableSpec(GetTableSpecRequest request)
Gets a table spec.
|
TableSpec |
getTableSpec(String name)
Gets a table spec.
|
TableSpec |
getTableSpec(TableSpecName name)
Gets a table spec.
|
com.google.api.gax.rpc.UnaryCallable<GetTableSpecRequest,TableSpec> |
getTableSpecCallable()
Gets a table spec.
|
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.ListColumnSpecsPagedResponse |
listColumnSpecs(ListColumnSpecsRequest request)
Lists column specs in a table spec.
|
AutoMlClient.ListColumnSpecsPagedResponse |
listColumnSpecs(String parent)
Lists column specs in a table spec.
|
AutoMlClient.ListColumnSpecsPagedResponse |
listColumnSpecs(TableSpecName parent)
Lists column specs in a table spec.
|
com.google.api.gax.rpc.UnaryCallable<ListColumnSpecsRequest,ListColumnSpecsResponse> |
listColumnSpecsCallable()
Lists column specs in a table spec.
|
com.google.api.gax.rpc.UnaryCallable<ListColumnSpecsRequest,AutoMlClient.ListColumnSpecsPagedResponse> |
listColumnSpecsPagedCallable()
Lists column specs in a table spec.
|
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)
Lists model evaluations.
|
AutoMlClient.ListModelEvaluationsPagedResponse |
listModelEvaluations(String parent)
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.
|
AutoMlClient.ListTableSpecsPagedResponse |
listTableSpecs(DatasetName parent)
Lists table specs in a dataset.
|
AutoMlClient.ListTableSpecsPagedResponse |
listTableSpecs(ListTableSpecsRequest request)
Lists table specs in a dataset.
|
AutoMlClient.ListTableSpecsPagedResponse |
listTableSpecs(String parent)
Lists table specs in a dataset.
|
com.google.api.gax.rpc.UnaryCallable<ListTableSpecsRequest,ListTableSpecsResponse> |
listTableSpecsCallable()
Lists table specs in a dataset.
|
com.google.api.gax.rpc.UnaryCallable<ListTableSpecsRequest,AutoMlClient.ListTableSpecsPagedResponse> |
listTableSpecsPagedCallable()
Lists table specs in a dataset.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
undeployModelAsync(ModelName name)
Undeploys a model.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
undeployModelAsync(String name)
Undeploys a model.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
undeployModelAsync(UndeployModelRequest request)
Undeploys a model.
|
com.google.api.gax.rpc.UnaryCallable<UndeployModelRequest,com.google.longrunning.Operation> |
undeployModelCallable()
Undeploys a model.
|
com.google.api.gax.rpc.OperationCallable<UndeployModelRequest,com.google.protobuf.Empty,OperationMetadata> |
undeployModelOperationCallable()
Undeploys a model.
|
ColumnSpec |
updateColumnSpec(ColumnSpec columnSpec)
Updates a column spec.
|
ColumnSpec |
updateColumnSpec(UpdateColumnSpecRequest request)
Updates a column spec.
|
com.google.api.gax.rpc.UnaryCallable<UpdateColumnSpecRequest,ColumnSpec> |
updateColumnSpecCallable()
Updates a column spec.
|
Dataset |
updateDataset(Dataset dataset)
Updates a dataset.
|
Dataset |
updateDataset(UpdateDatasetRequest request)
Updates a dataset.
|
com.google.api.gax.rpc.UnaryCallable<UpdateDatasetRequest,Dataset> |
updateDatasetCallable()
Updates a dataset.
|
TableSpec |
updateTableSpec(TableSpec tableSpec)
Updates a table spec.
|
TableSpec |
updateTableSpec(UpdateTableSpecRequest request)
Updates a table spec.
|
com.google.api.gax.rpc.UnaryCallable<UpdateTableSpecRequest,TableSpec> |
updateTableSpecCallable()
Updates a table spec.
|
protected AutoMlClient(AutoMlSettings settings) throws IOException
IOExceptionprotected AutoMlClient(AutoMlStub stub)
public static final AutoMlClient create() throws IOException
IOExceptionpublic static final AutoMlClient create(AutoMlSettings settings) throws IOException
IOExceptionpublic static final AutoMlClient create(AutoMlStub stub)
public final AutoMlSettings getSettings()
public AutoMlStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final Dataset createDataset(LocationName parent, Dataset dataset)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Dataset dataset = Dataset.newBuilder().build();
Dataset response = autoMlClient.createDataset(parent, dataset);
}
parent - Required. The resource name of the project to create the dataset for.dataset - Required. The dataset to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Dataset createDataset(String parent, Dataset dataset)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Dataset dataset = Dataset.newBuilder().build();
Dataset response = autoMlClient.createDataset(parent, dataset);
}
parent - Required. The resource name of the project to create the dataset for.dataset - Required. The dataset to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Dataset createDataset(CreateDatasetRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
CreateDatasetRequest request =
CreateDatasetRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setDataset(Dataset.newBuilder().build())
.build();
Dataset response = autoMlClient.createDataset(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<CreateDatasetRequest,Dataset> createDatasetCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
CreateDatasetRequest request =
CreateDatasetRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setDataset(Dataset.newBuilder().build())
.build();
ApiFuture<Dataset> future = autoMlClient.createDatasetCallable().futureCall(request);
// Do something.
Dataset response = future.get();
}
public final Dataset getDataset(DatasetName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
Dataset response = autoMlClient.getDataset(name);
}
name - Required. 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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString();
Dataset response = autoMlClient.getDataset(name);
}
name - Required. 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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
GetDatasetRequest request =
GetDatasetRequest.newBuilder()
.setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
GetDatasetRequest request =
GetDatasetRequest.newBuilder()
.setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.build();
ApiFuture<Dataset> future = autoMlClient.getDatasetCallable().futureCall(request);
// Do something.
Dataset response = future.get();
}
public final AutoMlClient.ListDatasetsPagedResponse listDatasets(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Dataset element : autoMlClient.listDatasets(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. 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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Dataset element : autoMlClient.listDatasets(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. 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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ListDatasetsRequest request =
ListDatasetsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ListDatasetsRequest request =
ListDatasetsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Dataset> 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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ListDatasetsRequest request =
ListDatasetsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.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;
}
}
}
public final Dataset updateDataset(Dataset dataset)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
Dataset dataset = Dataset.newBuilder().build();
Dataset response = autoMlClient.updateDataset(dataset);
}
dataset - Required. The dataset which replaces the resource on the server.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Dataset updateDataset(UpdateDatasetRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
UpdateDatasetRequest request =
UpdateDatasetRequest.newBuilder()
.setDataset(Dataset.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
UpdateDatasetRequest request =
UpdateDatasetRequest.newBuilder()
.setDataset(Dataset.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Dataset> future = autoMlClient.updateDatasetCallable().futureCall(request);
// Do something.
Dataset response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDatasetAsync(DatasetName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
autoMlClient.deleteDatasetAsync(name).get();
}
name - Required. The resource name of the dataset to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDatasetAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString();
autoMlClient.deleteDatasetAsync(name).get();
}
name - Required. The resource name of the dataset to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDatasetAsync(DeleteDatasetRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DeleteDatasetRequest request =
DeleteDatasetRequest.newBuilder()
.setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.build();
autoMlClient.deleteDatasetAsync(request).get();
}
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.OperationCallable<DeleteDatasetRequest,com.google.protobuf.Empty,OperationMetadata> deleteDatasetOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DeleteDatasetRequest request =
DeleteDatasetRequest.newBuilder()
.setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.build();
OperationFuture<Empty, OperationMetadata> future =
autoMlClient.deleteDatasetOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteDatasetRequest,com.google.longrunning.Operation> deleteDatasetCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DeleteDatasetRequest request =
DeleteDatasetRequest.newBuilder()
.setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.build();
ApiFuture<Operation> future = autoMlClient.deleteDatasetCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> importDataAsync(DatasetName name, InputConfig inputConfig)
For Tables:
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
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 failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> importDataAsync(String name, InputConfig inputConfig)
For Tables:
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString();
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 failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> importDataAsync(ImportDataRequest request)
For Tables:
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ImportDataRequest request =
ImportDataRequest.newBuilder()
.setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.setInputConfig(InputConfig.newBuilder().build())
.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 failspublic final com.google.api.gax.rpc.OperationCallable<ImportDataRequest,com.google.protobuf.Empty,OperationMetadata> importDataOperationCallable()
For Tables:
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ImportDataRequest request =
ImportDataRequest.newBuilder()
.setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.setInputConfig(InputConfig.newBuilder().build())
.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()
For Tables:
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ImportDataRequest request =
ImportDataRequest.newBuilder()
.setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.setInputConfig(InputConfig.newBuilder().build())
.build();
ApiFuture<Operation> future = autoMlClient.importDataCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportDataAsync(DatasetName name, OutputConfig outputConfig)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
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 failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportDataAsync(String name, OutputConfig outputConfig)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString();
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 failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportDataAsync(ExportDataRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ExportDataRequest request =
ExportDataRequest.newBuilder()
.setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.setOutputConfig(OutputConfig.newBuilder().build())
.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 failspublic final com.google.api.gax.rpc.OperationCallable<ExportDataRequest,com.google.protobuf.Empty,OperationMetadata> exportDataOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ExportDataRequest request =
ExportDataRequest.newBuilder()
.setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.setOutputConfig(OutputConfig.newBuilder().build())
.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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ExportDataRequest request =
ExportDataRequest.newBuilder()
.setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.setOutputConfig(OutputConfig.newBuilder().build())
.build();
ApiFuture<Operation> future = autoMlClient.exportDataCallable().futureCall(request);
// Do something.
future.get();
}
public final AnnotationSpec getAnnotationSpec(AnnotationSpecName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
AnnotationSpecName name =
AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
AnnotationSpec response = autoMlClient.getAnnotationSpec(name);
}
name - Required. The resource name of the annotation spec to retrieve.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AnnotationSpec getAnnotationSpec(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String name =
AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]")
.toString();
AnnotationSpec response = autoMlClient.getAnnotationSpec(name);
}
name - Required. The resource name of the annotation spec to retrieve.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AnnotationSpec getAnnotationSpec(GetAnnotationSpecRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
GetAnnotationSpecRequest request =
GetAnnotationSpecRequest.newBuilder()
.setName(
AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]")
.toString())
.build();
AnnotationSpec response = autoMlClient.getAnnotationSpec(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<GetAnnotationSpecRequest,AnnotationSpec> getAnnotationSpecCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
GetAnnotationSpecRequest request =
GetAnnotationSpecRequest.newBuilder()
.setName(
AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]")
.toString())
.build();
ApiFuture<AnnotationSpec> future =
autoMlClient.getAnnotationSpecCallable().futureCall(request);
// Do something.
AnnotationSpec response = future.get();
}
public final TableSpec getTableSpec(TableSpecName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
TableSpec response = autoMlClient.getTableSpec(name);
}
name - Required. The resource name of the table spec to retrieve.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TableSpec getTableSpec(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String name =
TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]").toString();
TableSpec response = autoMlClient.getTableSpec(name);
}
name - Required. The resource name of the table spec to retrieve.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TableSpec getTableSpec(GetTableSpecRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
GetTableSpecRequest request =
GetTableSpecRequest.newBuilder()
.setName(
TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]")
.toString())
.setFieldMask(FieldMask.newBuilder().build())
.build();
TableSpec response = autoMlClient.getTableSpec(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<GetTableSpecRequest,TableSpec> getTableSpecCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
GetTableSpecRequest request =
GetTableSpecRequest.newBuilder()
.setName(
TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]")
.toString())
.setFieldMask(FieldMask.newBuilder().build())
.build();
ApiFuture<TableSpec> future = autoMlClient.getTableSpecCallable().futureCall(request);
// Do something.
TableSpec response = future.get();
}
public final AutoMlClient.ListTableSpecsPagedResponse listTableSpecs(DatasetName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
for (TableSpec element : autoMlClient.listTableSpecs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the dataset to list table specs from.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AutoMlClient.ListTableSpecsPagedResponse listTableSpecs(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString();
for (TableSpec element : autoMlClient.listTableSpecs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the dataset to list table specs from.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AutoMlClient.ListTableSpecsPagedResponse listTableSpecs(ListTableSpecsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ListTableSpecsRequest request =
ListTableSpecsRequest.newBuilder()
.setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.setFieldMask(FieldMask.newBuilder().build())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (TableSpec element : autoMlClient.listTableSpecs(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<ListTableSpecsRequest,AutoMlClient.ListTableSpecsPagedResponse> listTableSpecsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ListTableSpecsRequest request =
ListTableSpecsRequest.newBuilder()
.setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.setFieldMask(FieldMask.newBuilder().build())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<TableSpec> future = autoMlClient.listTableSpecsPagedCallable().futureCall(request);
// Do something.
for (TableSpec element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListTableSpecsRequest,ListTableSpecsResponse> listTableSpecsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ListTableSpecsRequest request =
ListTableSpecsRequest.newBuilder()
.setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.setFieldMask(FieldMask.newBuilder().build())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.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 TableSpec updateTableSpec(TableSpec tableSpec)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
TableSpec tableSpec = TableSpec.newBuilder().build();
TableSpec response = autoMlClient.updateTableSpec(tableSpec);
}
tableSpec - Required. The table spec which replaces the resource on the server.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TableSpec updateTableSpec(UpdateTableSpecRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
UpdateTableSpecRequest request =
UpdateTableSpecRequest.newBuilder()
.setTableSpec(TableSpec.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
TableSpec response = autoMlClient.updateTableSpec(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<UpdateTableSpecRequest,TableSpec> updateTableSpecCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
UpdateTableSpecRequest request =
UpdateTableSpecRequest.newBuilder()
.setTableSpec(TableSpec.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<TableSpec> future = autoMlClient.updateTableSpecCallable().futureCall(request);
// Do something.
TableSpec response = future.get();
}
public final ColumnSpec getColumnSpec(ColumnSpecName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ColumnSpecName name =
ColumnSpecName.of(
"[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]");
ColumnSpec response = autoMlClient.getColumnSpec(name);
}
name - Required. The resource name of the column spec to retrieve.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ColumnSpec getColumnSpec(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String name =
ColumnSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]")
.toString();
ColumnSpec response = autoMlClient.getColumnSpec(name);
}
name - Required. The resource name of the column spec to retrieve.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ColumnSpec getColumnSpec(GetColumnSpecRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
GetColumnSpecRequest request =
GetColumnSpecRequest.newBuilder()
.setName(
ColumnSpecName.of(
"[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]")
.toString())
.setFieldMask(FieldMask.newBuilder().build())
.build();
ColumnSpec response = autoMlClient.getColumnSpec(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<GetColumnSpecRequest,ColumnSpec> getColumnSpecCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
GetColumnSpecRequest request =
GetColumnSpecRequest.newBuilder()
.setName(
ColumnSpecName.of(
"[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]")
.toString())
.setFieldMask(FieldMask.newBuilder().build())
.build();
ApiFuture<ColumnSpec> future = autoMlClient.getColumnSpecCallable().futureCall(request);
// Do something.
ColumnSpec response = future.get();
}
public final AutoMlClient.ListColumnSpecsPagedResponse listColumnSpecs(TableSpecName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
TableSpecName parent =
TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
for (ColumnSpec element : autoMlClient.listColumnSpecs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the table spec to list column specs from.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AutoMlClient.ListColumnSpecsPagedResponse listColumnSpecs(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String parent =
TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]").toString();
for (ColumnSpec element : autoMlClient.listColumnSpecs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the table spec to list column specs from.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AutoMlClient.ListColumnSpecsPagedResponse listColumnSpecs(ListColumnSpecsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ListColumnSpecsRequest request =
ListColumnSpecsRequest.newBuilder()
.setParent(
TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]")
.toString())
.setFieldMask(FieldMask.newBuilder().build())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (ColumnSpec element : autoMlClient.listColumnSpecs(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<ListColumnSpecsRequest,AutoMlClient.ListColumnSpecsPagedResponse> listColumnSpecsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ListColumnSpecsRequest request =
ListColumnSpecsRequest.newBuilder()
.setParent(
TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]")
.toString())
.setFieldMask(FieldMask.newBuilder().build())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<ColumnSpec> future =
autoMlClient.listColumnSpecsPagedCallable().futureCall(request);
// Do something.
for (ColumnSpec element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListColumnSpecsRequest,ListColumnSpecsResponse> listColumnSpecsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ListColumnSpecsRequest request =
ListColumnSpecsRequest.newBuilder()
.setParent(
TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]")
.toString())
.setFieldMask(FieldMask.newBuilder().build())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.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 ColumnSpec updateColumnSpec(ColumnSpec columnSpec)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ColumnSpec columnSpec = ColumnSpec.newBuilder().build();
ColumnSpec response = autoMlClient.updateColumnSpec(columnSpec);
}
columnSpec - Required. The column spec which replaces the resource on the server.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ColumnSpec updateColumnSpec(UpdateColumnSpecRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
UpdateColumnSpecRequest request =
UpdateColumnSpecRequest.newBuilder()
.setColumnSpec(ColumnSpec.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ColumnSpec response = autoMlClient.updateColumnSpec(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<UpdateColumnSpecRequest,ColumnSpec> updateColumnSpecCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
UpdateColumnSpecRequest request =
UpdateColumnSpecRequest.newBuilder()
.setColumnSpec(ColumnSpec.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<ColumnSpec> future = autoMlClient.updateColumnSpecCallable().futureCall(request);
// Do something.
ColumnSpec response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Model,OperationMetadata> createModelAsync(LocationName parent, Model model)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Model model = Model.newBuilder().build();
Model response = autoMlClient.createModelAsync(parent, model).get();
}
parent - Required. Resource name of the parent project where the model is being created.model - Required. The model to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Model,OperationMetadata> createModelAsync(String parent, Model model)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Model model = Model.newBuilder().build();
Model response = autoMlClient.createModelAsync(parent, model).get();
}
parent - Required. Resource name of the parent project where the model is being created.model - Required. The model to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Model,OperationMetadata> createModelAsync(CreateModelRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
CreateModelRequest request =
CreateModelRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setModel(Model.newBuilder().build())
.build();
Model response = autoMlClient.createModelAsync(request).get();
}
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.OperationCallable<CreateModelRequest,Model,OperationMetadata> createModelOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
CreateModelRequest request =
CreateModelRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setModel(Model.newBuilder().build())
.build();
OperationFuture<Model, OperationMetadata> future =
autoMlClient.createModelOperationCallable().futureCall(request);
// Do something.
Model response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateModelRequest,com.google.longrunning.Operation> createModelCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
CreateModelRequest request =
CreateModelRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setModel(Model.newBuilder().build())
.build();
ApiFuture<Operation> future = autoMlClient.createModelCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final Model getModel(ModelName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
Model response = autoMlClient.getModel(name);
}
name - Required. Resource name of the model.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Model getModel(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString();
Model response = autoMlClient.getModel(name);
}
name - Required. Resource name of the model.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Model getModel(GetModelRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
GetModelRequest request =
GetModelRequest.newBuilder()
.setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
GetModelRequest request =
GetModelRequest.newBuilder()
.setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.build();
ApiFuture<Model> future = autoMlClient.getModelCallable().futureCall(request);
// Do something.
Model response = future.get();
}
public final AutoMlClient.ListModelsPagedResponse listModels(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Model element : autoMlClient.listModels(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. 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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Model element : autoMlClient.listModels(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. 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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ListModelsRequest request =
ListModelsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ListModelsRequest request =
ListModelsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Model> 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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ListModelsRequest request =
ListModelsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.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;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteModelAsync(ModelName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
autoMlClient.deleteModelAsync(name).get();
}
name - Required. Resource name of the model being deleted.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteModelAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString();
autoMlClient.deleteModelAsync(name).get();
}
name - Required. Resource name of the model being deleted.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteModelAsync(DeleteModelRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DeleteModelRequest request =
DeleteModelRequest.newBuilder()
.setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.build();
autoMlClient.deleteModelAsync(request).get();
}
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.OperationCallable<DeleteModelRequest,com.google.protobuf.Empty,OperationMetadata> deleteModelOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DeleteModelRequest request =
DeleteModelRequest.newBuilder()
.setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.build();
OperationFuture<Empty, OperationMetadata> future =
autoMlClient.deleteModelOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteModelRequest,com.google.longrunning.Operation> deleteModelCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DeleteModelRequest request =
DeleteModelRequest.newBuilder()
.setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.build();
ApiFuture<Operation> future = autoMlClient.deleteModelCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deployModelAsync(ModelName name)
[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability.
Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
autoMlClient.deployModelAsync(name).get();
}
name - Required. Resource name of the model to deploy.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deployModelAsync(String name)
[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability.
Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString();
autoMlClient.deployModelAsync(name).get();
}
name - Required. Resource name of the model to deploy.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deployModelAsync(DeployModelRequest request)
[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability.
Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DeployModelRequest request =
DeployModelRequest.newBuilder()
.setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.build();
autoMlClient.deployModelAsync(request).get();
}
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.OperationCallable<DeployModelRequest,com.google.protobuf.Empty,OperationMetadata> deployModelOperationCallable()
[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability.
Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DeployModelRequest request =
DeployModelRequest.newBuilder()
.setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.build();
OperationFuture<Empty, OperationMetadata> future =
autoMlClient.deployModelOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeployModelRequest,com.google.longrunning.Operation> deployModelCallable()
[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability.
Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
DeployModelRequest request =
DeployModelRequest.newBuilder()
.setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.build();
ApiFuture<Operation> future = autoMlClient.deployModelCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> undeployModelAsync(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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
autoMlClient.undeployModelAsync(name).get();
}
name - Required. Resource name of the model to undeploy.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString();
autoMlClient.undeployModelAsync(name).get();
}
name - Required. Resource name of the model to undeploy.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> undeployModelAsync(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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
UndeployModelRequest request =
UndeployModelRequest.newBuilder()
.setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.build();
autoMlClient.undeployModelAsync(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 failspublic final com.google.api.gax.rpc.OperationCallable<UndeployModelRequest,com.google.protobuf.Empty,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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
UndeployModelRequest request =
UndeployModelRequest.newBuilder()
.setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.build();
OperationFuture<Empty, OperationMetadata> future =
autoMlClient.undeployModelOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UndeployModelRequest,com.google.longrunning.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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
UndeployModelRequest request =
UndeployModelRequest.newBuilder()
.setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.build();
ApiFuture<Operation> future = autoMlClient.undeployModelCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportModelAsync(ModelName name, ModelExportOutputConfig outputConfig)
[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig].
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
autoMlClient.exportModelAsync(name, outputConfig).get();
}
name - Required. The resource name of the model to export.outputConfig - Required. The desired output location and configuration.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportModelAsync(String name, ModelExportOutputConfig outputConfig)
[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig].
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString();
ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
autoMlClient.exportModelAsync(name, outputConfig).get();
}
name - Required. The resource name of the model to export.outputConfig - Required. The desired output location and configuration.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportModelAsync(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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ExportModelRequest request =
ExportModelRequest.newBuilder()
.setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.setOutputConfig(ModelExportOutputConfig.newBuilder().build())
.build();
autoMlClient.exportModelAsync(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 failspublic final com.google.api.gax.rpc.OperationCallable<ExportModelRequest,com.google.protobuf.Empty,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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ExportModelRequest request =
ExportModelRequest.newBuilder()
.setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.setOutputConfig(ModelExportOutputConfig.newBuilder().build())
.build();
OperationFuture<Empty, OperationMetadata> future =
autoMlClient.exportModelOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ExportModelRequest,com.google.longrunning.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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ExportModelRequest request =
ExportModelRequest.newBuilder()
.setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.setOutputConfig(ModelExportOutputConfig.newBuilder().build())
.build();
ApiFuture<Operation> future = autoMlClient.exportModelCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportEvaluatedExamplesAsync(ModelName name, ExportEvaluatedExamplesOutputConfig outputConfig)
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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
ExportEvaluatedExamplesOutputConfig outputConfig =
ExportEvaluatedExamplesOutputConfig.newBuilder().build();
autoMlClient.exportEvaluatedExamplesAsync(name, outputConfig).get();
}
name - Required. The resource name of the model whose evaluated examples are to be
exported.outputConfig - Required. The desired output location and configuration.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportEvaluatedExamplesAsync(String name, ExportEvaluatedExamplesOutputConfig outputConfig)
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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString();
ExportEvaluatedExamplesOutputConfig outputConfig =
ExportEvaluatedExamplesOutputConfig.newBuilder().build();
autoMlClient.exportEvaluatedExamplesAsync(name, outputConfig).get();
}
name - Required. The resource name of the model whose evaluated examples are to be
exported.outputConfig - Required. The desired output location and configuration.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportEvaluatedExamplesAsync(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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ExportEvaluatedExamplesRequest request =
ExportEvaluatedExamplesRequest.newBuilder()
.setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.setOutputConfig(ExportEvaluatedExamplesOutputConfig.newBuilder().build())
.build();
autoMlClient.exportEvaluatedExamplesAsync(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 failspublic final com.google.api.gax.rpc.OperationCallable<ExportEvaluatedExamplesRequest,com.google.protobuf.Empty,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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ExportEvaluatedExamplesRequest request =
ExportEvaluatedExamplesRequest.newBuilder()
.setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.setOutputConfig(ExportEvaluatedExamplesOutputConfig.newBuilder().build())
.build();
OperationFuture<Empty, OperationMetadata> future =
autoMlClient.exportEvaluatedExamplesOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ExportEvaluatedExamplesRequest,com.google.longrunning.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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ExportEvaluatedExamplesRequest request =
ExportEvaluatedExamplesRequest.newBuilder()
.setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.setOutputConfig(ExportEvaluatedExamplesOutputConfig.newBuilder().build())
.build();
ApiFuture<Operation> future =
autoMlClient.exportEvaluatedExamplesCallable().futureCall(request);
// Do something.
future.get();
}
public final ModelEvaluation getModelEvaluation(ModelEvaluationName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelEvaluationName name =
ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
ModelEvaluation response = autoMlClient.getModelEvaluation(name);
}
name - Required. Resource name for the model evaluation.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ModelEvaluation getModelEvaluation(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String name =
ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]")
.toString();
ModelEvaluation response = autoMlClient.getModelEvaluation(name);
}
name - Required. Resource name for the model evaluation.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ModelEvaluation getModelEvaluation(GetModelEvaluationRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
GetModelEvaluationRequest request =
GetModelEvaluationRequest.newBuilder()
.setName(
ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]")
.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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
GetModelEvaluationRequest request =
GetModelEvaluationRequest.newBuilder()
.setName(
ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]")
.toString())
.build();
ApiFuture<ModelEvaluation> future =
autoMlClient.getModelEvaluationCallable().futureCall(request);
// Do something.
ModelEvaluation response = future.get();
}
public final AutoMlClient.ListModelEvaluationsPagedResponse listModelEvaluations(ModelName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. 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.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AutoMlClient.ListModelEvaluationsPagedResponse listModelEvaluations(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString();
for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. 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.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AutoMlClient.ListModelEvaluationsPagedResponse listModelEvaluations(ListModelEvaluationsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ListModelEvaluationsRequest request =
ListModelEvaluationsRequest.newBuilder()
.setParent(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ListModelEvaluationsRequest request =
ListModelEvaluationsRequest.newBuilder()
.setParent(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<ModelEvaluation> 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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
ListModelEvaluationsRequest request =
ListModelEvaluationsRequest.newBuilder()
.setParent(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.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 © 2022 Google LLC. All rights reserved.