diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlClient.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlClient.java index 94cf4cc87..cea5d32db 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlClient.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlClient.java @@ -59,6 +59,13 @@ *
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: * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + * Dataset response = autoMlClient.getDataset(name); + * } + * }+ * *
Note: close() needs to be called on the AutoMlClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * @@ -170,6 +177,16 @@ public final OperationsClient getOperationsClient() { /** * Creates a dataset. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Dataset dataset = Dataset.newBuilder().build(); + * Dataset response = autoMlClient.createDatasetAsync(parent, dataset).get(); + * } + * }+ * * @param parent Required. The resource name of the project to create the dataset for. * @param dataset Required. The dataset to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -188,6 +205,16 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * Dataset dataset = Dataset.newBuilder().build(); + * Dataset response = autoMlClient.createDatasetAsync(parent, dataset).get(); + * } + * }+ * * @param parent Required. The resource name of the project to create the dataset for. * @param dataset Required. The dataset to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -203,6 +230,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * CreateDatasetRequest request = + * CreateDatasetRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDataset(Dataset.newBuilder().build()) + * .build(); + * Dataset response = autoMlClient.createDatasetAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -216,6 +256,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * CreateDatasetRequest request = + * CreateDatasetRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDataset(Dataset.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * autoMlClient.createDatasetOperationCallable().futureCall(request); + * // Do something. + * Dataset response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * CreateDatasetRequest request = + * CreateDatasetRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDataset(Dataset.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.createDatasetCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + * Dataset response = autoMlClient.getDataset(name); + * } + * }+ * * @param name Required. The resource name of the dataset to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -249,6 +325,15 @@ public final Dataset getDataset(DatasetName name) { /** * Gets a dataset. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); + * Dataset response = autoMlClient.getDataset(name); + * } + * }+ * * @param name Required. The resource name of the dataset to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -261,6 +346,18 @@ public final Dataset getDataset(String name) { /** * Gets a dataset. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * GetDatasetRequest request = + * GetDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .build(); + * Dataset response = autoMlClient.getDataset(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -273,6 +370,18 @@ public final Dataset getDataset(GetDatasetRequest request) { * Gets a dataset. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * GetDatasetRequest request = + * GetDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.getDatasetCallable().futureCall(request); + * // Do something. + * Dataset response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (Dataset element : autoMlClient.listDatasets(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the project from which to list datasets. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -297,6 +417,17 @@ public final ListDatasetsPagedResponse listDatasets(LocationName parent) { /** * Lists datasets in a project. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (Dataset element : autoMlClient.listDatasets(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the project from which to list datasets. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -309,6 +440,23 @@ public final ListDatasetsPagedResponse listDatasets(String parent) { /** * Lists datasets in a project. * + *
Sample code: + * + *
{@code + * 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); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -321,6 +469,23 @@ public final ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request) * Lists datasets in a project. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ListDatasetsRequest request = + * ListDatasetsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.listDatasetsPagedCallable().futureCall(request); + * // Do something. + * for (Dataset element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * while (true) { + * ListDatasetsResponse response = autoMlClient.listDatasetsCallable().call(request); + * for (Dataset element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * Dataset dataset = Dataset.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Dataset response = autoMlClient.updateDataset(dataset, updateMask); + * } + * }+ * * @param dataset Required. The dataset which replaces the resource on the server. * @param updateMask Required. The update mask applies to the resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -355,6 +547,19 @@ public final Dataset updateDataset(Dataset dataset, FieldMask updateMask) { /** * Updates a dataset. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * UpdateDatasetRequest request = + * UpdateDatasetRequest.newBuilder() + * .setDataset(Dataset.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Dataset response = autoMlClient.updateDataset(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -367,6 +572,19 @@ public final Dataset updateDataset(UpdateDatasetRequest request) { * Updates a dataset. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * UpdateDatasetRequest request = + * UpdateDatasetRequest.newBuilder() + * .setDataset(Dataset.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.updateDatasetCallable().futureCall(request); + * // Do something. + * Dataset response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + * autoMlClient.deleteDatasetAsync(name).get(); + * } + * }+ * * @param name Required. The resource name of the dataset to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -393,6 +620,15 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); + * autoMlClient.deleteDatasetAsync(name).get(); + * } + * }+ * * @param name Required. The resource name of the dataset to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -407,6 +643,18 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DeleteDatasetRequest request = + * DeleteDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .build(); + * autoMlClient.deleteDatasetAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -422,6 +670,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DeleteDatasetRequest request = + * DeleteDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * autoMlClient.deleteDatasetOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DeleteDatasetRequest request = + * DeleteDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.deleteDatasetCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + * InputConfig inputConfig = InputConfig.newBuilder().build(); + * autoMlClient.importDataAsync(name, inputConfig).get(); + * } + * }+ * * @param name Required. Dataset name. Dataset must already exist. All imported annotations and * examples will be added. * @param inputConfig Required. The desired input location and its domain specific semantics, if @@ -480,6 +763,16 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); + * InputConfig inputConfig = InputConfig.newBuilder().build(); + * autoMlClient.importDataAsync(name, inputConfig).get(); + * } + * }+ * * @param name Required. Dataset name. Dataset must already exist. All imported annotations and * examples will be added. * @param inputConfig Required. The desired input location and its domain specific semantics, if @@ -505,6 +798,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * 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(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -526,6 +832,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ImportDataRequest request = + * ImportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .setInputConfig(InputConfig.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * autoMlClient.importDataOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ImportDataRequest request = + * ImportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .setInputConfig(InputConfig.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.importDataCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + * OutputConfig outputConfig = OutputConfig.newBuilder().build(); + * autoMlClient.exportDataAsync(name, outputConfig).get(); + * } + * }+ * * @param name Required. The resource name of the dataset. * @param outputConfig Required. The desired output location. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -574,6 +917,16 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); + * OutputConfig outputConfig = OutputConfig.newBuilder().build(); + * autoMlClient.exportDataAsync(name, outputConfig).get(); + * } + * }+ * * @param name Required. The resource name of the dataset. * @param outputConfig Required. The desired output location. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -590,6 +943,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * 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(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -604,6 +970,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ExportDataRequest request = + * ExportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .setOutputConfig(OutputConfig.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * autoMlClient.exportDataOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ExportDataRequest request = + * ExportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .setOutputConfig(OutputConfig.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.exportDataCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * AnnotationSpecName name = + * AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]"); + * AnnotationSpec response = autoMlClient.getAnnotationSpec(name); + * } + * }+ * * @param name Required. The resource name of the annotation spec to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -640,6 +1043,17 @@ public final AnnotationSpec getAnnotationSpec(AnnotationSpecName name) { /** * Gets an annotation spec. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = + * AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]") + * .toString(); + * AnnotationSpec response = autoMlClient.getAnnotationSpec(name); + * } + * }+ * * @param name Required. The resource name of the annotation spec to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -652,6 +1066,20 @@ public final AnnotationSpec getAnnotationSpec(String name) { /** * Gets an annotation spec. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * GetAnnotationSpecRequest request = + * GetAnnotationSpecRequest.newBuilder() + * .setName( + * AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]") + * .toString()) + * .build(); + * AnnotationSpec response = autoMlClient.getAnnotationSpec(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -664,6 +1092,21 @@ public final AnnotationSpec getAnnotationSpec(GetAnnotationSpecRequest request) * Gets an annotation spec. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * GetAnnotationSpecRequest request = + * GetAnnotationSpecRequest.newBuilder() + * .setName( + * AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]") + * .toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * autoMlClient.getAnnotationSpecCallable().futureCall(request); + * // Do something. + * AnnotationSpec response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Model model = Model.newBuilder().build(); + * Model response = autoMlClient.createModelAsync(parent, model).get(); + * } + * }+ * * @param parent Required. Resource name of the parent project where the model is being created. * @param model Required. The model to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -695,6 +1148,16 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * Model model = Model.newBuilder().build(); + * Model response = autoMlClient.createModelAsync(parent, model).get(); + * } + * }+ * * @param parent Required. Resource name of the parent project where the model is being created. * @param model Required. The model to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -712,6 +1175,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * 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(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -727,6 +1203,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * CreateModelRequest request = + * CreateModelRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setModel(Model.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * autoMlClient.createModelOperationCallable().futureCall(request); + * // Do something. + * Model response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * CreateModelRequest request = + * CreateModelRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setModel(Model.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.createModelCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * Model response = autoMlClient.getModel(name); + * } + * }+ * * @param name Required. Resource name of the model. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -762,6 +1274,15 @@ public final Model getModel(ModelName name) { /** * Gets a model. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * Model response = autoMlClient.getModel(name); + * } + * }+ * * @param name Required. Resource name of the model. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -774,6 +1295,18 @@ public final Model getModel(String name) { /** * Gets a model. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * GetModelRequest request = + * GetModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * Model response = autoMlClient.getModel(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -786,6 +1319,18 @@ public final Model getModel(GetModelRequest request) { * Gets a model. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * GetModelRequest request = + * GetModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.getModelCallable().futureCall(request); + * // Do something. + * Model response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (Model element : autoMlClient.listModels(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Resource name of the project, from which to list the models. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -808,6 +1364,17 @@ public final ListModelsPagedResponse listModels(LocationName parent) { /** * Lists models. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (Model element : autoMlClient.listModels(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Resource name of the project, from which to list the models. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -820,6 +1387,23 @@ public final ListModelsPagedResponse listModels(String parent) { /** * Lists models. * + *
Sample code: + * + *
{@code + * 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); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -832,6 +1416,23 @@ public final ListModelsPagedResponse listModels(ListModelsRequest request) { * Lists models. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ListModelsRequest request = + * ListModelsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.listModelsPagedCallable().futureCall(request); + * // Do something. + * for (Model element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * while (true) { + * ListModelsResponse response = autoMlClient.listModelsCallable().call(request); + * for (Model element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * autoMlClient.deleteModelAsync(name).get(); + * } + * }+ * * @param name Required. Resource name of the model being deleted. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -868,6 +1495,15 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * autoMlClient.deleteModelAsync(name).get(); + * } + * }+ * * @param name Required. Resource name of the model being deleted. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -882,6 +1518,18 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DeleteModelRequest request = + * DeleteModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * autoMlClient.deleteModelAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -897,6 +1545,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DeleteModelRequest request = + * DeleteModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * autoMlClient.deleteModelOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DeleteModelRequest request = + * DeleteModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.deleteModelCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * Model model = Model.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Model response = autoMlClient.updateModel(model, updateMask); + * } + * }+ * * @param model Required. The model which replaces the resource on the server. * @param updateMask Required. The update mask applies to the resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -933,6 +1616,19 @@ public final Model updateModel(Model model, FieldMask updateMask) { /** * Updates a model. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * UpdateModelRequest request = + * UpdateModelRequest.newBuilder() + * .setModel(Model.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Model response = autoMlClient.updateModel(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -945,6 +1641,19 @@ public final Model updateModel(UpdateModelRequest request) { * Updates a model. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * UpdateModelRequest request = + * UpdateModelRequest.newBuilder() + * .setModel(Model.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.updateModelCallable().futureCall(request); + * // Do something. + * Model response = future.get(); + * } + * }
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * autoMlClient.deployModelAsync(name).get(); + * } + * }+ * * @param name Required. Resource name of the model to deploy. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -987,6 +1705,15 @@ public final OperationFuture
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * autoMlClient.deployModelAsync(name).get(); + * } + * }+ * * @param name Required. Resource name of the model to deploy. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1009,6 +1736,18 @@ public final OperationFuture
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DeployModelRequest request = + * DeployModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * autoMlClient.deployModelAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1032,6 +1771,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DeployModelRequest request = + * DeployModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * autoMlClient.deployModelOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DeployModelRequest request = + * DeployModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.deployModelCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * autoMlClient.undeployModelAsync(name).get(); + * } + * }+ * * @param name Required. Resource name of the model to undeploy. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1087,6 +1860,15 @@ public final OperationFuture
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * autoMlClient.undeployModelAsync(name).get(); + * } + * }+ * * @param name Required. Resource name of the model to undeploy. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1105,6 +1887,18 @@ public final OperationFuture
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * UndeployModelRequest request = + * UndeployModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * autoMlClient.undeployModelAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1124,6 +1918,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * UndeployModelRequest request = + * UndeployModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * autoMlClient.undeployModelOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * UndeployModelRequest request = + * UndeployModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.undeployModelCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build(); + * autoMlClient.exportModelAsync(name, outputConfig).get(); + * } + * }+ * * @param name Required. The resource name of the model to export. * @param outputConfig Required. The desired output location and configuration. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1178,6 +2007,16 @@ public final OperationFuture
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build(); + * autoMlClient.exportModelAsync(name, outputConfig).get(); + * } + * }+ * * @param name Required. The resource name of the model to export. * @param outputConfig Required. The desired output location and configuration. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1198,6 +2037,19 @@ public final OperationFuture
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * 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(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1216,6 +2068,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ExportModelRequest request = + * ExportModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setOutputConfig(ModelExportOutputConfig.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * autoMlClient.exportModelOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ExportModelRequest request = + * ExportModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setOutputConfig(ModelExportOutputConfig.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.exportModelCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ModelEvaluationName name = + * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]"); + * ModelEvaluation response = autoMlClient.getModelEvaluation(name); + * } + * }+ * * @param name Required. Resource name for the model evaluation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1256,6 +2145,17 @@ public final ModelEvaluation getModelEvaluation(ModelEvaluationName name) { /** * Gets a model evaluation. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = + * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]") + * .toString(); + * ModelEvaluation response = autoMlClient.getModelEvaluation(name); + * } + * }+ * * @param name Required. Resource name for the model evaluation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1269,6 +2169,20 @@ public final ModelEvaluation getModelEvaluation(String name) { /** * Gets a model evaluation. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * GetModelEvaluationRequest request = + * GetModelEvaluationRequest.newBuilder() + * .setName( + * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]") + * .toString()) + * .build(); + * ModelEvaluation response = autoMlClient.getModelEvaluation(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1281,6 +2195,21 @@ public final ModelEvaluation getModelEvaluation(GetModelEvaluationRequest reques * Gets a model evaluation. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * GetModelEvaluationRequest request = + * GetModelEvaluationRequest.newBuilder() + * .setName( + * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]") + * .toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * autoMlClient.getModelEvaluationCallable().futureCall(request); + * // Do something. + * ModelEvaluation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * String filter = "filter-1274492040"; + * for (ModelEvaluation element : + * autoMlClient.listModelEvaluations(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param 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. @@ -1316,6 +2258,19 @@ public final ListModelEvaluationsPagedResponse listModelEvaluations( /** * Lists model evaluations. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * String filter = "filter-1274492040"; + * for (ModelEvaluation element : + * autoMlClient.listModelEvaluations(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param 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. @@ -1338,6 +2293,23 @@ public final ListModelEvaluationsPagedResponse listModelEvaluations( /** * Lists model evaluations. * + *
Sample code: + * + *
{@code + * 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); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1351,6 +2323,24 @@ public final ListModelEvaluationsPagedResponse listModelEvaluations( * Lists model evaluations. * *
Sample code: + * + *
{@code + * 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*/ public final UnaryCallablefuture = + * autoMlClient.listModelEvaluationsPagedCallable().futureCall(request); + * // Do something. + * for (ModelEvaluation element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * while (true) { + * ListModelEvaluationsResponse response = + * autoMlClient.listModelEvaluationsCallable().call(request); + * for (ModelEvaluation element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
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: * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * ExamplePayload payload = ExamplePayload.newBuilder().build(); + * Map+ * *params = new HashMap<>(); + * PredictResponse response = predictionServiceClient.predict(name, payload, params); + * } + * }
Note: close() needs to be called on the PredictionServiceClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). @@ -204,6 +213,17 @@ public final OperationsClient getOperationsClient() { * FORECASTING `prediction_type`. * * + *
Sample code: + * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * ExamplePayload payload = ExamplePayload.newBuilder().build(); + * Map+ * * @param name Required. Name of the model requested to serve the prediction. * @param payload Required. Payload to perform a prediction on. The payload must match the problem * type that the model was trained to solve. @@ -288,6 +308,17 @@ public final PredictResponse predict( * FORECASTING `prediction_type`. * * + *params = new HashMap<>(); + * PredictResponse response = predictionServiceClient.predict(name, payload, params); + * } + * }
Sample code: + * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * ExamplePayload payload = ExamplePayload.newBuilder().build(); + * Map+ * * @param name Required. Name of the model requested to serve the prediction. * @param payload Required. Payload to perform a prediction on. The payload must match the problem * type that the model was trained to solve. @@ -368,6 +399,20 @@ public final PredictResponse predict( * FORECASTING `prediction_type`. * * + *params = new HashMap<>(); + * PredictResponse response = predictionServiceClient.predict(name, payload, params); + * } + * }
Sample code: + * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * PredictRequest request = + * PredictRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setPayload(ExamplePayload.newBuilder().build()) + * .putAllParams(new HashMap+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -427,6 +472,21 @@ public final PredictResponse predict(PredictRequest request) { * * *()) + * .build(); + * PredictResponse response = predictionServiceClient.predict(request); + * } + * }
Sample code: + * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * PredictRequest request = + * PredictRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setPayload(ExamplePayload.newBuilder().build()) + * .putAllParams(new HashMap*/ public final UnaryCallable()) + * .build(); + * ApiFuture future = + * predictionServiceClient.predictCallable().futureCall(request); + * // Do something. + * PredictResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * BatchPredictInputConfig inputConfig = BatchPredictInputConfig.newBuilder().build(); + * BatchPredictOutputConfig outputConfig = BatchPredictOutputConfig.newBuilder().build(); + * Map+ * * @param name Required. Name of the model requested to serve the batch prediction. * @param inputConfig Required. The input configuration for batch prediction. * @param outputConfig Required. The Configuration specifying where output predictions should be @@ -540,6 +613,19 @@ public final OperationFutureparams = new HashMap<>(); + * BatchPredictResult response = + * predictionServiceClient.batchPredictAsync(name, inputConfig, outputConfig, params).get(); + * } + * }
Sample code: + * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * BatchPredictInputConfig inputConfig = BatchPredictInputConfig.newBuilder().build(); + * BatchPredictOutputConfig outputConfig = BatchPredictOutputConfig.newBuilder().build(); + * Map+ * * @param name Required. Name of the model requested to serve the batch prediction. * @param inputConfig Required. The input configuration for batch prediction. * @param outputConfig Required. The Configuration specifying where output predictions should be @@ -628,6 +714,21 @@ public final OperationFutureparams = new HashMap<>(); + * BatchPredictResult response = + * predictionServiceClient.batchPredictAsync(name, inputConfig, outputConfig, params).get(); + * } + * }
Sample code: + * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * BatchPredictRequest request = + * BatchPredictRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setInputConfig(BatchPredictInputConfig.newBuilder().build()) + * .setOutputConfig(BatchPredictOutputConfig.newBuilder().build()) + * .putAllParams(new HashMap+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -657,6 +758,22 @@ public final OperationFuture()) + * .build(); + * BatchPredictResult response = predictionServiceClient.batchPredictAsync(request).get(); + * } + * }
Sample code: + * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * BatchPredictRequest request = + * BatchPredictRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setInputConfig(BatchPredictInputConfig.newBuilder().build()) + * .setOutputConfig(BatchPredictOutputConfig.newBuilder().build()) + * .putAllParams(new HashMap*/ public final OperationCallable()) + * .build(); + * OperationFuture future = + * predictionServiceClient.batchPredictOperationCallable().futureCall(request); + * // Do something. + * BatchPredictResult response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * BatchPredictRequest request = + * BatchPredictRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setInputConfig(BatchPredictInputConfig.newBuilder().build()) + * .setOutputConfig(BatchPredictOutputConfig.newBuilder().build()) + * .putAllParams(new HashMap*/ public final UnaryCallable()) + * .build(); + * ApiFuture future = + * predictionServiceClient.batchPredictCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample for PredictionServiceClient: * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * ExamplePayload payload = ExamplePayload.newBuilder().build(); + * Map+ * *params = new HashMap<>(); + * PredictResponse response = predictionServiceClient.predict(name, payload, params); + * } + * }
======================= AutoMlClient ======================= * *
Service Description: AutoML Server API. @@ -43,6 +52,13 @@ * either of those cases is accepted. * *
Sample for AutoMlClient: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + * Dataset response = autoMlClient.getDataset(name); + * } + * }*/ @Generated("by gapic-generator-java") package com.google.cloud.automl.v1; diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java index d6b79a0f1..ced1d6d5e 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java @@ -58,6 +58,14 @@ *
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: * + *
{@code + * 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(). * @@ -170,6 +178,16 @@ public final OperationsClient getOperationsClient() { /** * Creates a dataset. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Dataset dataset = Dataset.newBuilder().build(); + * Dataset response = autoMlClient.createDataset(parent, dataset); + * } + * }+ * * @param parent Required. The resource name of the project to create the dataset for. * @param dataset Required. The dataset to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -187,6 +205,16 @@ public final Dataset createDataset(LocationName parent, Dataset dataset) { /** * Creates a dataset. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * Dataset dataset = Dataset.newBuilder().build(); + * Dataset response = autoMlClient.createDataset(parent, dataset); + * } + * }+ * * @param parent Required. The resource name of the project to create the dataset for. * @param dataset Required. The dataset to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -201,6 +229,19 @@ public final Dataset createDataset(String parent, Dataset dataset) { /** * Creates a dataset. * + *
Sample code: + * + *
{@code + * 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); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -213,6 +254,19 @@ public final Dataset createDataset(CreateDatasetRequest request) { * Creates a dataset. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * CreateDatasetRequest request = + * CreateDatasetRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDataset(Dataset.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.createDatasetCallable().futureCall(request); + * // Do something. + * Dataset response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + * Dataset response = autoMlClient.getDataset(name); + * } + * }+ * * @param name Required. The resource name of the dataset to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -235,6 +298,15 @@ public final Dataset getDataset(DatasetName name) { /** * Gets a dataset. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); + * Dataset response = autoMlClient.getDataset(name); + * } + * }+ * * @param name Required. The resource name of the dataset to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -247,6 +319,18 @@ public final Dataset getDataset(String name) { /** * Gets a dataset. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * GetDatasetRequest request = + * GetDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .build(); + * Dataset response = autoMlClient.getDataset(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -259,6 +343,18 @@ public final Dataset getDataset(GetDatasetRequest request) { * Gets a dataset. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * GetDatasetRequest request = + * GetDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.getDatasetCallable().futureCall(request); + * // Do something. + * Dataset response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (Dataset element : autoMlClient.listDatasets(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the project from which to list datasets. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -283,6 +390,17 @@ public final ListDatasetsPagedResponse listDatasets(LocationName parent) { /** * Lists datasets in a project. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (Dataset element : autoMlClient.listDatasets(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the project from which to list datasets. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -295,6 +413,23 @@ public final ListDatasetsPagedResponse listDatasets(String parent) { /** * Lists datasets in a project. * + *
Sample code: + * + *
{@code + * 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); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -307,6 +442,23 @@ public final ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request) * Lists datasets in a project. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ListDatasetsRequest request = + * ListDatasetsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.listDatasetsPagedCallable().futureCall(request); + * // Do something. + * for (Dataset element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * while (true) { + * ListDatasetsResponse response = autoMlClient.listDatasetsCallable().call(request); + * for (Dataset element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * Dataset dataset = Dataset.newBuilder().build(); + * Dataset response = autoMlClient.updateDataset(dataset); + * } + * }+ * * @param dataset Required. The dataset which replaces the resource on the server. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -339,6 +517,19 @@ public final Dataset updateDataset(Dataset dataset) { /** * Updates a dataset. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * UpdateDatasetRequest request = + * UpdateDatasetRequest.newBuilder() + * .setDataset(Dataset.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Dataset response = autoMlClient.updateDataset(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -351,6 +542,19 @@ public final Dataset updateDataset(UpdateDatasetRequest request) { * Updates a dataset. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * UpdateDatasetRequest request = + * UpdateDatasetRequest.newBuilder() + * .setDataset(Dataset.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.updateDatasetCallable().futureCall(request); + * // Do something. + * Dataset response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + * autoMlClient.deleteDatasetAsync(name).get(); + * } + * }+ * * @param name Required. The resource name of the dataset to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -377,6 +590,15 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); + * autoMlClient.deleteDatasetAsync(name).get(); + * } + * }+ * * @param name Required. The resource name of the dataset to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -391,6 +613,18 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DeleteDatasetRequest request = + * DeleteDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .build(); + * autoMlClient.deleteDatasetAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -406,6 +640,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DeleteDatasetRequest request = + * DeleteDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * autoMlClient.deleteDatasetOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DeleteDatasetRequest request = + * DeleteDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.deleteDatasetCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + * InputConfig inputConfig = InputConfig.newBuilder().build(); + * autoMlClient.importDataAsync(name, inputConfig).get(); + * } + * }+ * * @param name Required. Dataset name. Dataset must already exist. All imported annotations and * examples will be added. * @param inputConfig Required. The desired input location and its domain specific semantics, if @@ -464,6 +733,16 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); + * InputConfig inputConfig = InputConfig.newBuilder().build(); + * autoMlClient.importDataAsync(name, inputConfig).get(); + * } + * }+ * * @param name Required. Dataset name. Dataset must already exist. All imported annotations and * examples will be added. * @param inputConfig Required. The desired input location and its domain specific semantics, if @@ -489,6 +768,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * 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(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -510,6 +802,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ImportDataRequest request = + * ImportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .setInputConfig(InputConfig.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * autoMlClient.importDataOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ImportDataRequest request = + * ImportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .setInputConfig(InputConfig.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.importDataCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + * OutputConfig outputConfig = OutputConfig.newBuilder().build(); + * autoMlClient.exportDataAsync(name, outputConfig).get(); + * } + * }+ * * @param name Required. The resource name of the dataset. * @param outputConfig Required. The desired output location. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -558,6 +887,16 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); + * OutputConfig outputConfig = OutputConfig.newBuilder().build(); + * autoMlClient.exportDataAsync(name, outputConfig).get(); + * } + * }+ * * @param name Required. The resource name of the dataset. * @param outputConfig Required. The desired output location. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -574,6 +913,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * 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(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -588,6 +940,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ExportDataRequest request = + * ExportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .setOutputConfig(OutputConfig.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * autoMlClient.exportDataOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ExportDataRequest request = + * ExportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .setOutputConfig(OutputConfig.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.exportDataCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * AnnotationSpecName name = + * AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]"); + * AnnotationSpec response = autoMlClient.getAnnotationSpec(name); + * } + * }+ * * @param name Required. The resource name of the annotation spec to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -624,6 +1013,17 @@ public final AnnotationSpec getAnnotationSpec(AnnotationSpecName name) { /** * Gets an annotation spec. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = + * AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]") + * .toString(); + * AnnotationSpec response = autoMlClient.getAnnotationSpec(name); + * } + * }+ * * @param name Required. The resource name of the annotation spec to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -636,6 +1036,20 @@ public final AnnotationSpec getAnnotationSpec(String name) { /** * Gets an annotation spec. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * GetAnnotationSpecRequest request = + * GetAnnotationSpecRequest.newBuilder() + * .setName( + * AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]") + * .toString()) + * .build(); + * AnnotationSpec response = autoMlClient.getAnnotationSpec(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -648,6 +1062,21 @@ public final AnnotationSpec getAnnotationSpec(GetAnnotationSpecRequest request) * Gets an annotation spec. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * GetAnnotationSpecRequest request = + * GetAnnotationSpecRequest.newBuilder() + * .setName( + * AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]") + * .toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * autoMlClient.getAnnotationSpecCallable().futureCall(request); + * // Do something. + * AnnotationSpec response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]"); + * TableSpec response = autoMlClient.getTableSpec(name); + * } + * }+ * * @param name Required. The resource name of the table spec to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -670,6 +1108,16 @@ public final TableSpec getTableSpec(TableSpecName name) { /** * Gets a table spec. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = + * TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]").toString(); + * TableSpec response = autoMlClient.getTableSpec(name); + * } + * }+ * * @param name Required. The resource name of the table spec to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -682,6 +1130,21 @@ public final TableSpec getTableSpec(String name) { /** * Gets a table spec. * + *
Sample code: + * + *
{@code + * 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); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -694,6 +1157,21 @@ public final TableSpec getTableSpec(GetTableSpecRequest request) { * Gets a table spec. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * GetTableSpecRequest request = + * GetTableSpecRequest.newBuilder() + * .setName( + * TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]") + * .toString()) + * .setFieldMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.getTableSpecCallable().futureCall(request); + * // Do something. + * TableSpec response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + * for (TableSpec element : autoMlClient.listTableSpecs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the dataset to list table specs from. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -718,6 +1207,17 @@ public final ListTableSpecsPagedResponse listTableSpecs(DatasetName parent) { /** * Lists table specs in a dataset. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); + * for (TableSpec element : autoMlClient.listTableSpecs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the dataset to list table specs from. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -730,6 +1230,24 @@ public final ListTableSpecsPagedResponse listTableSpecs(String parent) { /** * Lists table specs in a dataset. * + *
Sample code: + * + *
{@code + * 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); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -742,6 +1260,24 @@ public final ListTableSpecsPagedResponse listTableSpecs(ListTableSpecsRequest re * Lists table specs in a dataset. * *
Sample code: + * + *
{@code + * 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*/ public final UnaryCallablefuture = autoMlClient.listTableSpecsPagedCallable().futureCall(request); + * // Do something. + * for (TableSpec element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * while (true) { + * ListTableSpecsResponse response = autoMlClient.listTableSpecsCallable().call(request); + * for (TableSpec element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * TableSpec tableSpec = TableSpec.newBuilder().build(); + * TableSpec response = autoMlClient.updateTableSpec(tableSpec); + * } + * }+ * * @param tableSpec Required. The table spec which replaces the resource on the server. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -776,6 +1338,19 @@ public final TableSpec updateTableSpec(TableSpec tableSpec) { /** * Updates a table spec. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * UpdateTableSpecRequest request = + * UpdateTableSpecRequest.newBuilder() + * .setTableSpec(TableSpec.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * TableSpec response = autoMlClient.updateTableSpec(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -788,6 +1363,19 @@ public final TableSpec updateTableSpec(UpdateTableSpecRequest request) { * Updates a table spec. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * UpdateTableSpecRequest request = + * UpdateTableSpecRequest.newBuilder() + * .setTableSpec(TableSpec.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.updateTableSpecCallable().futureCall(request); + * // Do something. + * TableSpec response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ColumnSpecName name = + * ColumnSpecName.of( + * "[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]"); + * ColumnSpec response = autoMlClient.getColumnSpec(name); + * } + * }+ * * @param name Required. The resource name of the column spec to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -810,6 +1409,17 @@ public final ColumnSpec getColumnSpec(ColumnSpecName name) { /** * Gets a column spec. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = + * ColumnSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]") + * .toString(); + * ColumnSpec response = autoMlClient.getColumnSpec(name); + * } + * }+ * * @param name Required. The resource name of the column spec to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -822,6 +1432,22 @@ public final ColumnSpec getColumnSpec(String name) { /** * Gets a column spec. * + *
Sample code: + * + *
{@code + * 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); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -834,6 +1460,22 @@ public final ColumnSpec getColumnSpec(GetColumnSpecRequest request) { * Gets a column spec. * *
Sample code: + * + *
{@code + * 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*/ public final UnaryCallablefuture = autoMlClient.getColumnSpecCallable().futureCall(request); + * // Do something. + * ColumnSpec response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * TableSpecName parent = + * TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]"); + * for (ColumnSpec element : autoMlClient.listColumnSpecs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the table spec to list column specs from. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -858,6 +1512,18 @@ public final ListColumnSpecsPagedResponse listColumnSpecs(TableSpecName parent) /** * Lists column specs in a table spec. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String parent = + * TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]").toString(); + * for (ColumnSpec element : autoMlClient.listColumnSpecs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the table spec to list column specs from. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -870,6 +1536,26 @@ public final ListColumnSpecsPagedResponse listColumnSpecs(String parent) { /** * Lists column specs in a table spec. * + *
Sample code: + * + *
{@code + * 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); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -882,6 +1568,27 @@ public final ListColumnSpecsPagedResponse listColumnSpecs(ListColumnSpecsRequest * Lists column specs in a table spec. * *
Sample code: + * + *
{@code + * 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*/ public final UnaryCallablefuture = + * autoMlClient.listColumnSpecsPagedCallable().futureCall(request); + * // Do something. + * for (ColumnSpec element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * while (true) { + * ListColumnSpecsResponse response = autoMlClient.listColumnSpecsCallable().call(request); + * for (ColumnSpec element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ColumnSpec columnSpec = ColumnSpec.newBuilder().build(); + * ColumnSpec response = autoMlClient.updateColumnSpec(columnSpec); + * } + * }+ * * @param columnSpec Required. The column spec which replaces the resource on the server. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -916,6 +1649,19 @@ public final ColumnSpec updateColumnSpec(ColumnSpec columnSpec) { /** * Updates a column spec. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * UpdateColumnSpecRequest request = + * UpdateColumnSpecRequest.newBuilder() + * .setColumnSpec(ColumnSpec.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ColumnSpec response = autoMlClient.updateColumnSpec(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -928,6 +1674,19 @@ public final ColumnSpec updateColumnSpec(UpdateColumnSpecRequest request) { * Updates a column spec. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * UpdateColumnSpecRequest request = + * UpdateColumnSpecRequest.newBuilder() + * .setColumnSpec(ColumnSpec.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.updateColumnSpecCallable().futureCall(request); + * // Do something. + * ColumnSpec response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Model model = Model.newBuilder().build(); + * Model response = autoMlClient.createModelAsync(parent, model).get(); + * } + * }+ * * @param parent Required. Resource name of the parent project where the model is being created. * @param model Required. The model to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -959,6 +1728,16 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * Model model = Model.newBuilder().build(); + * Model response = autoMlClient.createModelAsync(parent, model).get(); + * } + * }+ * * @param parent Required. Resource name of the parent project where the model is being created. * @param model Required. The model to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -976,6 +1755,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * 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(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -991,6 +1783,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * CreateModelRequest request = + * CreateModelRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setModel(Model.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * autoMlClient.createModelOperationCallable().futureCall(request); + * // Do something. + * Model response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * CreateModelRequest request = + * CreateModelRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setModel(Model.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.createModelCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * Model response = autoMlClient.getModel(name); + * } + * }+ * * @param name Required. Resource name of the model. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1026,6 +1854,15 @@ public final Model getModel(ModelName name) { /** * Gets a model. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * Model response = autoMlClient.getModel(name); + * } + * }+ * * @param name Required. Resource name of the model. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1038,6 +1875,18 @@ public final Model getModel(String name) { /** * Gets a model. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * GetModelRequest request = + * GetModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * Model response = autoMlClient.getModel(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1050,6 +1899,18 @@ public final Model getModel(GetModelRequest request) { * Gets a model. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * GetModelRequest request = + * GetModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.getModelCallable().futureCall(request); + * // Do something. + * Model response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (Model element : autoMlClient.listModels(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Resource name of the project, from which to list the models. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1072,6 +1944,17 @@ public final ListModelsPagedResponse listModels(LocationName parent) { /** * Lists models. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (Model element : autoMlClient.listModels(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Resource name of the project, from which to list the models. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1084,6 +1967,23 @@ public final ListModelsPagedResponse listModels(String parent) { /** * Lists models. * + *
Sample code: + * + *
{@code + * 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); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1096,6 +1996,23 @@ public final ListModelsPagedResponse listModels(ListModelsRequest request) { * Lists models. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ListModelsRequest request = + * ListModelsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.listModelsPagedCallable().futureCall(request); + * // Do something. + * for (Model element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * while (true) { + * ListModelsResponse response = autoMlClient.listModelsCallable().call(request); + * for (Model element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * autoMlClient.deleteModelAsync(name).get(); + * } + * }+ * * @param name Required. Resource name of the model being deleted. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1132,6 +2075,15 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * autoMlClient.deleteModelAsync(name).get(); + * } + * }+ * * @param name Required. Resource name of the model being deleted. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1146,6 +2098,18 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DeleteModelRequest request = + * DeleteModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * autoMlClient.deleteModelAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1161,6 +2125,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DeleteModelRequest request = + * DeleteModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * autoMlClient.deleteModelOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DeleteModelRequest request = + * DeleteModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.deleteModelCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * autoMlClient.deployModelAsync(name).get(); + * } + * }+ * * @param name Required. Resource name of the model to deploy. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1216,6 +2214,15 @@ public final OperationFuture
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * autoMlClient.deployModelAsync(name).get(); + * } + * }+ * * @param name Required. Resource name of the model to deploy. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1238,6 +2245,18 @@ public final OperationFuture
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DeployModelRequest request = + * DeployModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * autoMlClient.deployModelAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1261,6 +2280,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DeployModelRequest request = + * DeployModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * autoMlClient.deployModelOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * DeployModelRequest request = + * DeployModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.deployModelCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * autoMlClient.undeployModelAsync(name).get(); + * } + * }+ * * @param name Required. Resource name of the model to undeploy. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1316,6 +2369,15 @@ public final OperationFuture
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * autoMlClient.undeployModelAsync(name).get(); + * } + * }+ * * @param name Required. Resource name of the model to undeploy. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1334,6 +2396,18 @@ public final OperationFuture
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * UndeployModelRequest request = + * UndeployModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * autoMlClient.undeployModelAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1353,6 +2427,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * UndeployModelRequest request = + * UndeployModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * autoMlClient.undeployModelOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * UndeployModelRequest request = + * UndeployModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.undeployModelCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build(); + * autoMlClient.exportModelAsync(name, outputConfig).get(); + * } + * }+ * * @param name Required. The resource name of the model to export. * @param outputConfig Required. The desired output location and configuration. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1409,6 +2518,16 @@ public final OperationFuture
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build(); + * autoMlClient.exportModelAsync(name, outputConfig).get(); + * } + * }+ * * @param name Required. The resource name of the model to export. * @param outputConfig Required. The desired output location and configuration. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1430,6 +2549,19 @@ public final OperationFuture
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * 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(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1449,6 +2581,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ExportModelRequest request = + * ExportModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setOutputConfig(ModelExportOutputConfig.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * autoMlClient.exportModelOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ExportModelRequest request = + * ExportModelRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setOutputConfig(ModelExportOutputConfig.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = autoMlClient.exportModelCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * ExportEvaluatedExamplesOutputConfig outputConfig = + * ExportEvaluatedExamplesOutputConfig.newBuilder().build(); + * autoMlClient.exportEvaluatedExamplesAsync(name, outputConfig).get(); + * } + * }+ * * @param name Required. The resource name of the model whose evaluated examples are to be * exported. * @param outputConfig Required. The desired output location and configuration. @@ -1514,6 +2684,17 @@ public final OperationFuture
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * ExportEvaluatedExamplesOutputConfig outputConfig = + * ExportEvaluatedExamplesOutputConfig.newBuilder().build(); + * autoMlClient.exportEvaluatedExamplesAsync(name, outputConfig).get(); + * } + * }+ * * @param name Required. The resource name of the model whose evaluated examples are to be * exported. * @param outputConfig Required. The desired output location and configuration. @@ -1543,6 +2724,19 @@ public final OperationFuture
Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. * + *
Sample code: + * + *
{@code + * 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(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1566,6 +2760,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ExportEvaluatedExamplesRequest request = + * ExportEvaluatedExamplesRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setOutputConfig(ExportEvaluatedExamplesOutputConfig.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * autoMlClient.exportEvaluatedExamplesOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ExportEvaluatedExamplesRequest request = + * ExportEvaluatedExamplesRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setOutputConfig(ExportEvaluatedExamplesOutputConfig.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * autoMlClient.exportEvaluatedExamplesCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ModelEvaluationName name = + * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]"); + * ModelEvaluation response = autoMlClient.getModelEvaluation(name); + * } + * }+ * * @param name Required. Resource name for the model evaluation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1612,6 +2844,17 @@ public final ModelEvaluation getModelEvaluation(ModelEvaluationName name) { /** * Gets a model evaluation. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String name = + * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]") + * .toString(); + * ModelEvaluation response = autoMlClient.getModelEvaluation(name); + * } + * }+ * * @param name Required. Resource name for the model evaluation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1625,6 +2868,20 @@ public final ModelEvaluation getModelEvaluation(String name) { /** * Gets a model evaluation. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * GetModelEvaluationRequest request = + * GetModelEvaluationRequest.newBuilder() + * .setName( + * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]") + * .toString()) + * .build(); + * ModelEvaluation response = autoMlClient.getModelEvaluation(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1637,6 +2894,21 @@ public final ModelEvaluation getModelEvaluation(GetModelEvaluationRequest reques * Gets a model evaluation. * *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * GetModelEvaluationRequest request = + * GetModelEvaluationRequest.newBuilder() + * .setName( + * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]") + * .toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * autoMlClient.getModelEvaluationCallable().futureCall(request); + * // Do something. + * ModelEvaluation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param 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. @@ -1664,6 +2947,17 @@ public final ListModelEvaluationsPagedResponse listModelEvaluations(ModelName pa /** * Lists model evaluations. * + *
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * String parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param 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. @@ -1679,6 +2973,23 @@ public final ListModelEvaluationsPagedResponse listModelEvaluations(String paren /** * Lists model evaluations. * + *
Sample code: + * + *
{@code + * 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); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1692,6 +3003,24 @@ public final ListModelEvaluationsPagedResponse listModelEvaluations( * Lists model evaluations. * *
Sample code: + * + *
{@code + * 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*/ public final UnaryCallablefuture = + * autoMlClient.listModelEvaluationsPagedCallable().futureCall(request); + * // Do something. + * for (ModelEvaluation element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * while (true) { + * ListModelEvaluationsResponse response = + * autoMlClient.listModelEvaluationsCallable().call(request); + * for (ModelEvaluation element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
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: * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * ExamplePayload payload = ExamplePayload.newBuilder().build(); + * Map+ * *params = new HashMap<>(); + * PredictResponse response = predictionServiceClient.predict(name, payload, params); + * } + * }
Note: close() needs to be called on the PredictionServiceClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). @@ -175,6 +184,17 @@ public final OperationsClient getOperationsClient() { *
Sample code: + * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * ExamplePayload payload = ExamplePayload.newBuilder().build(); + * Map+ * * @param name Required. Name of the model requested to serve the prediction. * @param payload Required. Payload to perform a prediction on. The payload must match the problem * type that the model was trained to solve. @@ -231,6 +251,17 @@ public final PredictResponse predict( *params = new HashMap<>(); + * PredictResponse response = predictionServiceClient.predict(name, payload, params); + * } + * }
Sample code: + * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * ExamplePayload payload = ExamplePayload.newBuilder().build(); + * Map+ * * @param name Required. Name of the model requested to serve the prediction. * @param payload Required. Payload to perform a prediction on. The payload must match the problem * type that the model was trained to solve. @@ -283,6 +314,20 @@ public final PredictResponse predict( *params = new HashMap<>(); + * PredictResponse response = predictionServiceClient.predict(name, payload, params); + * } + * }
Sample code: + * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * PredictRequest request = + * PredictRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setPayload(ExamplePayload.newBuilder().build()) + * .putAllParams(new HashMap+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -312,6 +357,21 @@ public final PredictResponse predict(PredictRequest request) { * * *()) + * .build(); + * PredictResponse response = predictionServiceClient.predict(request); + * } + * }
Sample code: + * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * PredictRequest request = + * PredictRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setPayload(ExamplePayload.newBuilder().build()) + * .putAllParams(new HashMap*/ public final UnaryCallable()) + * .build(); + * ApiFuture future = + * predictionServiceClient.predictCallable().futureCall(request); + * // Do something. + * PredictResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * BatchPredictInputConfig inputConfig = BatchPredictInputConfig.newBuilder().build(); + * BatchPredictOutputConfig outputConfig = BatchPredictOutputConfig.newBuilder().build(); + * Map+ * * @param name Required. Name of the model requested to serve the batch prediction. * @param inputConfig Required. The input configuration for batch prediction. * @param outputConfig Required. The Configuration specifying where output predictions should be @@ -432,6 +505,19 @@ public final OperationFutureparams = new HashMap<>(); + * BatchPredictResult response = + * predictionServiceClient.batchPredictAsync(name, inputConfig, outputConfig, params).get(); + * } + * }
Sample code: + * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * BatchPredictInputConfig inputConfig = BatchPredictInputConfig.newBuilder().build(); + * BatchPredictOutputConfig outputConfig = BatchPredictOutputConfig.newBuilder().build(); + * Map+ * * @param name Required. Name of the model requested to serve the batch prediction. * @param inputConfig Required. The input configuration for batch prediction. * @param outputConfig Required. The Configuration specifying where output predictions should be @@ -529,6 +615,21 @@ public final OperationFutureparams = new HashMap<>(); + * BatchPredictResult response = + * predictionServiceClient.batchPredictAsync(name, inputConfig, outputConfig, params).get(); + * } + * }
Sample code: + * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * BatchPredictRequest request = + * BatchPredictRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setInputConfig(BatchPredictInputConfig.newBuilder().build()) + * .setOutputConfig(BatchPredictOutputConfig.newBuilder().build()) + * .putAllParams(new HashMap+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -556,6 +657,22 @@ public final OperationFuture()) + * .build(); + * BatchPredictResult response = predictionServiceClient.batchPredictAsync(request).get(); + * } + * }
Sample code: + * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * BatchPredictRequest request = + * BatchPredictRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setInputConfig(BatchPredictInputConfig.newBuilder().build()) + * .setOutputConfig(BatchPredictOutputConfig.newBuilder().build()) + * .putAllParams(new HashMap*/ public final OperationCallable()) + * .build(); + * OperationFuture future = + * predictionServiceClient.batchPredictOperationCallable().futureCall(request); + * // Do something. + * BatchPredictResult response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * BatchPredictRequest request = + * BatchPredictRequest.newBuilder() + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setInputConfig(BatchPredictInputConfig.newBuilder().build()) + * .setOutputConfig(BatchPredictOutputConfig.newBuilder().build()) + * .putAllParams(new HashMap*/ public final UnaryCallable()) + * .build(); + * ApiFuture future = + * predictionServiceClient.batchPredictCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample for PredictionServiceClient: * + *
{@code + * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * ExamplePayload payload = ExamplePayload.newBuilder().build(); + * Map+ * *params = new HashMap<>(); + * PredictResponse response = predictionServiceClient.predict(name, payload, params); + * } + * }
======================= AutoMlClient ======================= * *
Service Description: AutoML Server API. @@ -43,6 +52,14 @@ * either of those cases is accepted. * *
Sample for AutoMlClient: + * + *
{@code + * try (AutoMlClient autoMlClient = AutoMlClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Dataset dataset = Dataset.newBuilder().build(); + * Dataset response = autoMlClient.createDataset(parent, dataset); + * } + * }*/ @Generated("by gapic-generator-java") package com.google.cloud.automl.v1beta1; diff --git a/synth.metadata b/synth.metadata index 44dfc8901..663eb7c55 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,23 +4,23 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-automl.git", - "sha": "6a33cff3b7e656ef546224917e6b95c7d892d69d" + "sha": "051d91ef659cb81f286edfa8de783da7f73730be" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, {