From e66195445b36f6a87be77d6502dc33f123d32eb8 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 22 Jun 2020 13:02:17 -0700 Subject: [PATCH] fix: migrate retry settings to grpc_service_config (#171) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/8090a8db-78af-43ce-903e-cbc4378c9d99/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 317109460 Source-Link: https://github.com/googleapis/googleapis/commit/d810c1d73c25b2a0051c26bc960e0044ebf939b1 PiperOrigin-RevId: 317109190 Source-Link: https://github.com/googleapis/googleapis/commit/025ee9eb4660764a21918a7311d57c7466f34a3c PiperOrigin-RevId: 317108363 Source-Link: https://github.com/googleapis/googleapis/commit/074e5b22fc2f3fc70ee895705a8aced2b000fff3 PiperOrigin-RevId: 317108263 Source-Link: https://github.com/googleapis/googleapis/commit/2ec6c6276f8cd7ec7363e505a88c78075c2b4898 PiperOrigin-RevId: 317107948 Source-Link: https://github.com/googleapis/googleapis/commit/316e611ba9cc62244e3cb3854b0d36feea304409 --- README.md | 2 +- .../cloud/vision/v1/ImageAnnotatorClient.java | 142 +- .../vision/v1/ImageAnnotatorSettings.java | 30 +- .../cloud/vision/v1/ProductSearchClient.java | 1388 ++++++++--------- .../vision/v1/ProductSearchSettings.java | 110 +- .../google/cloud/vision/v1/package-info.java | 4 +- .../v1/stub/GrpcImageAnnotatorStub.java | 72 +- .../vision/v1/stub/GrpcProductSearchStub.java | 184 +-- .../vision/v1/stub/ImageAnnotatorStub.java | 10 +- .../v1/stub/ImageAnnotatorStubSettings.java | 96 +- .../vision/v1/stub/ProductSearchStub.java | 44 +- .../v1/stub/ProductSearchStubSettings.java | 301 ++-- .../stub/ImageAnnotatorStubSettings.java | 18 +- .../v1p2beta1/ImageAnnotatorClient.java | 138 +- .../v1p2beta1/ImageAnnotatorSettings.java | 24 +- .../stub/GrpcImageAnnotatorStub.java | 54 +- .../v1p2beta1/stub/ImageAnnotatorStub.java | 10 +- .../stub/ImageAnnotatorStubSettings.java | 74 +- .../vision/v1p3beta1/ProductSearchClient.java | 748 ++++----- .../v1p3beta1/ProductSearchSettings.java | 68 +- .../cloud/vision/v1p3beta1/package-info.java | 6 +- .../v1p3beta1/stub/GrpcProductSearchStub.java | 180 +-- .../stub/ImageAnnotatorStubSettings.java | 39 +- .../v1p3beta1/stub/ProductSearchStub.java | 24 +- .../stub/ProductSearchStubSettings.java | 241 +-- .../v1p4beta1/ImageAnnotatorClient.java | 306 ++-- .../v1p4beta1/ImageAnnotatorSettings.java | 48 +- .../vision/v1p4beta1/ProductSearchClient.java | 690 ++++---- .../v1p4beta1/ProductSearchSettings.java | 68 +- .../cloud/vision/v1p4beta1/package-info.java | 6 +- .../stub/GrpcImageAnnotatorStub.java | 108 +- .../v1p4beta1/stub/GrpcProductSearchStub.java | 180 +-- .../v1p4beta1/stub/ImageAnnotatorStub.java | 20 +- .../stub/ImageAnnotatorStubSettings.java | 139 +- .../v1p4beta1/stub/ProductSearchStub.java | 24 +- .../stub/ProductSearchStubSettings.java | 247 +-- .../vision/v1/ImageAnnotatorClientTest.java | 76 +- .../vision/v1/ProductSearchClientTest.java | 192 +-- .../v1p2beta1/ImageAnnotatorClientTest.java | 66 +- .../v1p3beta1/ProductSearchClientTest.java | 226 +-- .../v1p4beta1/ImageAnnotatorClientTest.java | 130 +- .../v1p4beta1/ProductSearchClientTest.java | 226 +-- synth.metadata | 22 +- 43 files changed, 3427 insertions(+), 3354 deletions(-) diff --git a/README.md b/README.md index a1e72b628..c51a51de0 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 5.7.0 + 7.0.0 pom import diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ImageAnnotatorClient.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ImageAnnotatorClient.java index 436ccec7d..4a85d01fa 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ImageAnnotatorClient.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ImageAnnotatorClient.java @@ -41,8 +41,8 @@ *
  * 
  * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
- *   List<AnnotateImageRequest> requests = new ArrayList<>();
- *   BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
+ *   List<AnnotateFileRequest> requests = new ArrayList<>();
+ *   BatchAnnotateFilesResponse response = imageAnnotatorClient.batchAnnotateFiles(requests);
  * }
  * 
  * 
@@ -163,75 +163,6 @@ public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Run image detection and annotation for a batch of images. - * - *

Sample code: - * - *


-   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
-   *   List<AnnotateImageRequest> requests = new ArrayList<>();
-   *   BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
-   * }
-   * 
- * - * @param requests Required. Individual image annotation requests for this batch. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final BatchAnnotateImagesResponse batchAnnotateImages( - List requests) { - BatchAnnotateImagesRequest request = - BatchAnnotateImagesRequest.newBuilder().addAllRequests(requests).build(); - return batchAnnotateImages(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Run image detection and annotation for a batch of images. - * - *

Sample code: - * - *


-   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
-   *   List<AnnotateImageRequest> requests = new ArrayList<>();
-   *   BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
-   *     .addAllRequests(requests)
-   *     .build();
-   *   BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(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 - */ - public final BatchAnnotateImagesResponse batchAnnotateImages(BatchAnnotateImagesRequest request) { - return batchAnnotateImagesCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Run image detection and annotation for a batch of images. - * - *

Sample code: - * - *


-   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
-   *   List<AnnotateImageRequest> requests = new ArrayList<>();
-   *   BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
-   *     .addAllRequests(requests)
-   *     .build();
-   *   ApiFuture<BatchAnnotateImagesResponse> future = imageAnnotatorClient.batchAnnotateImagesCallable().futureCall(request);
-   *   // Do something
-   *   BatchAnnotateImagesResponse response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable - batchAnnotateImagesCallable() { - return stub.batchAnnotateImagesCallable(); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Service that performs image detection and annotation for a batch of files. Now only @@ -570,6 +501,75 @@ public final BatchAnnotateFilesResponse batchAnnotateFiles(BatchAnnotateFilesReq return stub.asyncBatchAnnotateFilesCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run image detection and annotation for a batch of images. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateImageRequest> requests = new ArrayList<>();
+   *   BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
+   * }
+   * 
+ * + * @param requests Required. Individual image annotation requests for this batch. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BatchAnnotateImagesResponse batchAnnotateImages( + List requests) { + BatchAnnotateImagesRequest request = + BatchAnnotateImagesRequest.newBuilder().addAllRequests(requests).build(); + return batchAnnotateImages(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run image detection and annotation for a batch of images. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateImageRequest> requests = new ArrayList<>();
+   *   BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(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 + */ + public final BatchAnnotateImagesResponse batchAnnotateImages(BatchAnnotateImagesRequest request) { + return batchAnnotateImagesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run image detection and annotation for a batch of images. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateImageRequest> requests = new ArrayList<>();
+   *   BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   ApiFuture<BatchAnnotateImagesResponse> future = imageAnnotatorClient.batchAnnotateImagesCallable().futureCall(request);
+   *   // Do something
+   *   BatchAnnotateImagesResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + batchAnnotateImagesCallable() { + return stub.batchAnnotateImagesCallable(); + } + @Override public final void close() { stub.close(); diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ImageAnnotatorSettings.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ImageAnnotatorSettings.java index deeb9d5c9..9f248241b 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ImageAnnotatorSettings.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ImageAnnotatorSettings.java @@ -47,16 +47,16 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of batchAnnotateImages to 30 seconds: + *

For example, to set the total timeout of batchAnnotateFiles to 30 seconds: * *

  * 
  * ImageAnnotatorSettings.Builder imageAnnotatorSettingsBuilder =
  *     ImageAnnotatorSettings.newBuilder();
  * imageAnnotatorSettingsBuilder
- *     .batchAnnotateImagesSettings()
+ *     .batchAnnotateFilesSettings()
  *     .setRetrySettings(
- *         imageAnnotatorSettingsBuilder.batchAnnotateImagesSettings().getRetrySettings().toBuilder()
+ *         imageAnnotatorSettingsBuilder.batchAnnotateFilesSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * ImageAnnotatorSettings imageAnnotatorSettings = imageAnnotatorSettingsBuilder.build();
@@ -65,12 +65,6 @@
  */
 @Generated("by gapic-generator")
 public class ImageAnnotatorSettings extends ClientSettings {
-  /** Returns the object with the settings used for calls to batchAnnotateImages. */
-  public UnaryCallSettings
-      batchAnnotateImagesSettings() {
-    return ((ImageAnnotatorStubSettings) getStubSettings()).batchAnnotateImagesSettings();
-  }
-
   /** Returns the object with the settings used for calls to batchAnnotateFiles. */
   public UnaryCallSettings
       batchAnnotateFilesSettings() {
@@ -109,6 +103,12 @@ public class ImageAnnotatorSettings extends ClientSettings
+      batchAnnotateImagesSettings() {
+    return ((ImageAnnotatorStubSettings) getStubSettings()).batchAnnotateImagesSettings();
+  }
+
   public static final ImageAnnotatorSettings create(ImageAnnotatorStubSettings stub)
       throws IOException {
     return new ImageAnnotatorSettings.Builder(stub.toBuilder()).build();
@@ -206,12 +206,6 @@ public Builder applyToAllUnaryMethods(
       return this;
     }
 
-    /** Returns the builder for the settings used for calls to batchAnnotateImages. */
-    public UnaryCallSettings.Builder
-        batchAnnotateImagesSettings() {
-      return getStubSettingsBuilder().batchAnnotateImagesSettings();
-    }
-
     /** Returns the builder for the settings used for calls to batchAnnotateFiles. */
     public UnaryCallSettings.Builder
         batchAnnotateFilesSettings() {
@@ -248,6 +242,12 @@ public Builder applyToAllUnaryMethods(
       return getStubSettingsBuilder().asyncBatchAnnotateFilesOperationSettings();
     }
 
+    /** Returns the builder for the settings used for calls to batchAnnotateImages. */
+    public UnaryCallSettings.Builder
+        batchAnnotateImagesSettings() {
+      return getStubSettingsBuilder().batchAnnotateImagesSettings();
+    }
+
     @Override
     public ImageAnnotatorSettings build() throws IOException {
       return new ImageAnnotatorSettings(this);
diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java
index d520a7c49..79fdd609c 100644
--- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java
+++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java
@@ -385,662 +385,1079 @@ public final OperationsClient getOperationsClient() {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Creates and returns a new ProductSet resource.
+   * Asynchronous API that imports a list of reference images to specified product sets based on a
+   * list of image information.
    *
-   * 

Possible errors: + *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep + * track of the progress and results of the request. `Operation.metadata` contains + * `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. + * (results) * - *

* Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 - * characters. + *

The input source of this method is a csv file on Google Cloud Storage. For the format of the + * csv file please see + * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ProductSet productSet = ProductSet.newBuilder().build();
-   *   String productSetId = "";
-   *   ProductSet response = productSearchClient.createProductSet(parent, productSet, productSetId);
+   *   ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
+   *   ImportProductSetsResponse response = productSearchClient.importProductSetsAsync(parent, inputConfig).get();
    * }
    * 
* - * @param parent Required. The project in which the ProductSet should be created. + * @param parent Required. The project in which the ProductSets should be imported. *

Format is `projects/PROJECT_ID/locations/LOC_ID`. - * @param productSet Required. The ProductSet to create. - * @param productSetId A user-supplied resource id for this ProductSet. If set, the server will - * attempt to use this value as the resource id. If it is already in use, an error is returned - * with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the - * character `/`. + * @param inputConfig Required. The input content for the list of requests. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ProductSet createProductSet( - LocationName parent, ProductSet productSet, String productSetId) { - CreateProductSetRequest request = - CreateProductSetRequest.newBuilder() + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture + importProductSetsAsync(LocationName parent, ImportProductSetsInputConfig inputConfig) { + ImportProductSetsRequest request = + ImportProductSetsRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) - .setProductSet(productSet) - .setProductSetId(productSetId) + .setInputConfig(inputConfig) .build(); - return createProductSet(request); + return importProductSetsAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates and returns a new ProductSet resource. + * Asynchronous API that imports a list of reference images to specified product sets based on a + * list of image information. * - *

Possible errors: + *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep + * track of the progress and results of the request. `Operation.metadata` contains + * `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. + * (results) * - *

* Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 - * characters. + *

The input source of this method is a csv file on Google Cloud Storage. For the format of the + * csv file please see + * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ProductSet productSet = ProductSet.newBuilder().build();
-   *   String productSetId = "";
-   *   ProductSet response = productSearchClient.createProductSet(parent.toString(), productSet, productSetId);
+   *   ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
+   *   ImportProductSetsResponse response = productSearchClient.importProductSetsAsync(parent.toString(), inputConfig).get();
    * }
    * 
* - * @param parent Required. The project in which the ProductSet should be created. + * @param parent Required. The project in which the ProductSets should be imported. *

Format is `projects/PROJECT_ID/locations/LOC_ID`. - * @param productSet Required. The ProductSet to create. - * @param productSetId A user-supplied resource id for this ProductSet. If set, the server will - * attempt to use this value as the resource id. If it is already in use, an error is returned - * with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the - * character `/`. + * @param inputConfig Required. The input content for the list of requests. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ProductSet createProductSet( - String parent, ProductSet productSet, String productSetId) { - CreateProductSetRequest request = - CreateProductSetRequest.newBuilder() - .setParent(parent) - .setProductSet(productSet) - .setProductSetId(productSetId) - .build(); - return createProductSet(request); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture + importProductSetsAsync(String parent, ImportProductSetsInputConfig inputConfig) { + ImportProductSetsRequest request = + ImportProductSetsRequest.newBuilder().setParent(parent).setInputConfig(inputConfig).build(); + return importProductSetsAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates and returns a new ProductSet resource. + * Asynchronous API that imports a list of reference images to specified product sets based on a + * list of image information. * - *

Possible errors: + *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep + * track of the progress and results of the request. `Operation.metadata` contains + * `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. + * (results) * - *

* Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 - * characters. + *

The input source of this method is a csv file on Google Cloud Storage. For the format of the + * csv file please see + * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ProductSet productSet = ProductSet.newBuilder().build();
-   *   CreateProductSetRequest request = CreateProductSetRequest.newBuilder()
+   *   ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
+   *   ImportProductSetsRequest request = ImportProductSetsRequest.newBuilder()
    *     .setParent(parent.toString())
-   *     .setProductSet(productSet)
+   *     .setInputConfig(inputConfig)
    *     .build();
-   *   ProductSet response = productSearchClient.createProductSet(request);
+   *   ImportProductSetsResponse response = productSearchClient.importProductSetsAsync(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 */ - public final ProductSet createProductSet(CreateProductSetRequest request) { - return createProductSetCallable().call(request); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture + importProductSetsAsync(ImportProductSetsRequest request) { + return importProductSetsOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates and returns a new ProductSet resource. + * Asynchronous API that imports a list of reference images to specified product sets based on a + * list of image information. * - *

Possible errors: + *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep + * track of the progress and results of the request. `Operation.metadata` contains + * `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. + * (results) * - *

* Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 - * characters. + *

The input source of this method is a csv file on Google Cloud Storage. For the format of the + * csv file please see + * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ProductSet productSet = ProductSet.newBuilder().build();
-   *   CreateProductSetRequest request = CreateProductSetRequest.newBuilder()
+   *   ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
+   *   ImportProductSetsRequest request = ImportProductSetsRequest.newBuilder()
    *     .setParent(parent.toString())
-   *     .setProductSet(productSet)
+   *     .setInputConfig(inputConfig)
    *     .build();
-   *   ApiFuture<ProductSet> future = productSearchClient.createProductSetCallable().futureCall(request);
+   *   OperationFuture<ImportProductSetsResponse, BatchOperationMetadata> future = productSearchClient.importProductSetsOperationCallable().futureCall(request);
    *   // Do something
-   *   ProductSet response = future.get();
+   *   ImportProductSetsResponse response = future.get();
    * }
    * 
*/ - public final UnaryCallable createProductSetCallable() { - return stub.createProductSetCallable(); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable< + ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> + importProductSetsOperationCallable() { + return stub.importProductSetsOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists ProductSets in an unspecified order. + * Asynchronous API that imports a list of reference images to specified product sets based on a + * list of image information. * - *

Possible errors: + *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep + * track of the progress and results of the request. `Operation.metadata` contains + * `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. + * (results) * - *

* Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1. + *

The input source of this method is a csv file on Google Cloud Storage. For the format of the + * csv file please see + * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (ProductSet element : productSearchClient.listProductSets(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
+   *   ImportProductSetsRequest request = ImportProductSetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setInputConfig(inputConfig)
+   *     .build();
+   *   ApiFuture<Operation> future = productSearchClient.importProductSetsCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
    * }
    * 
- * - * @param parent Required. The project from which ProductSets should be listed. - *

Format is `projects/PROJECT_ID/locations/LOC_ID`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListProductSetsPagedResponse listProductSets(LocationName parent) { - ListProductSetsRequest request = - ListProductSetsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); - return listProductSets(request); + public final UnaryCallable importProductSetsCallable() { + return stub.importProductSetsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists ProductSets in an unspecified order. + * Asynchronous API to delete all Products in a ProductSet or all Products that are in no + * ProductSet. * - *

Possible errors: + *

If a Product is a member of the specified ProductSet in addition to other ProductSets, the + * Product will still be deleted. * - *

* Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1. + *

It is recommended to not delete the specified ProductSet until after this operation has + * completed. It is also recommended to not add any of the Products involved in the batch delete + * to a new ProductSet while this operation is running because those Products may still end up + * deleted. + * + *

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep + * the csv files used in ImportProductSets (if that was how you originally built the Product Set) + * before starting PurgeProducts, in case you need to re-import the data after deletion. + * + *

If the plan is to purge all of the Products from a ProductSet and then re-use the empty + * ProductSet to re-import new Products into the empty ProductSet, you must wait until the + * PurgeProducts operation has finished for that ProductSet. + * + *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep + * track of the progress and results of the request. `Operation.metadata` contains + * `BatchOperationMetadata`. (progress) * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (ProductSet element : productSearchClient.listProductSets(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   productSearchClient.purgeProductsAsync(parent).get();
    * }
    * 
* - * @param parent Required. The project from which ProductSets should be listed. + * @param parent Required. The project and location in which the Products should be deleted. *

Format is `projects/PROJECT_ID/locations/LOC_ID`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListProductSetsPagedResponse listProductSets(String parent) { - ListProductSetsRequest request = ListProductSetsRequest.newBuilder().setParent(parent).build(); - return listProductSets(request); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture purgeProductsAsync( + LocationName parent) { + PurgeProductsRequest request = + PurgeProductsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return purgeProductsAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists ProductSets in an unspecified order. + * Asynchronous API to delete all Products in a ProductSet or all Products that are in no + * ProductSet. * - *

Possible errors: + *

If a Product is a member of the specified ProductSet in addition to other ProductSets, the + * Product will still be deleted. * - *

* Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1. + *

It is recommended to not delete the specified ProductSet until after this operation has + * completed. It is also recommended to not add any of the Products involved in the batch delete + * to a new ProductSet while this operation is running because those Products may still end up + * deleted. + * + *

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep + * the csv files used in ImportProductSets (if that was how you originally built the Product Set) + * before starting PurgeProducts, in case you need to re-import the data after deletion. + * + *

If the plan is to purge all of the Products from a ProductSet and then re-use the empty + * ProductSet to re-import new Products into the empty ProductSet, you must wait until the + * PurgeProducts operation has finished for that ProductSet. + * + *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep + * track of the progress and results of the request. `Operation.metadata` contains + * `BatchOperationMetadata`. (progress) * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListProductSetsRequest request = ListProductSetsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (ProductSet element : productSearchClient.listProductSets(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   productSearchClient.purgeProductsAsync(parent.toString()).get();
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param parent Required. The project and location in which the Products should be deleted. + *

Format is `projects/PROJECT_ID/locations/LOC_ID`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListProductSetsPagedResponse listProductSets(ListProductSetsRequest request) { - return listProductSetsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists ProductSets in an unspecified order. + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture purgeProductsAsync(String parent) { + PurgeProductsRequest request = PurgeProductsRequest.newBuilder().setParent(parent).build(); + return purgeProductsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Asynchronous API to delete all Products in a ProductSet or all Products that are in no + * ProductSet. * - *

Possible errors: + *

If a Product is a member of the specified ProductSet in addition to other ProductSets, the + * Product will still be deleted. * - *

* Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1. + *

It is recommended to not delete the specified ProductSet until after this operation has + * completed. It is also recommended to not add any of the Products involved in the batch delete + * to a new ProductSet while this operation is running because those Products may still end up + * deleted. + * + *

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep + * the csv files used in ImportProductSets (if that was how you originally built the Product Set) + * before starting PurgeProducts, in case you need to re-import the data after deletion. + * + *

If the plan is to purge all of the Products from a ProductSet and then re-use the empty + * ProductSet to re-import new Products into the empty ProductSet, you must wait until the + * PurgeProducts operation has finished for that ProductSet. + * + *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep + * track of the progress and results of the request. `Operation.metadata` contains + * `BatchOperationMetadata`. (progress) * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListProductSetsRequest request = ListProductSetsRequest.newBuilder()
+   *   PurgeProductsRequest request = PurgeProductsRequest.newBuilder()
    *     .setParent(parent.toString())
    *     .build();
-   *   ApiFuture<ListProductSetsPagedResponse> future = productSearchClient.listProductSetsPagedCallable().futureCall(request);
+   *   productSearchClient.purgeProductsAsync(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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture purgeProductsAsync( + PurgeProductsRequest request) { + return purgeProductsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Asynchronous API to delete all Products in a ProductSet or all Products that are in no + * ProductSet. + * + *

If a Product is a member of the specified ProductSet in addition to other ProductSets, the + * Product will still be deleted. + * + *

It is recommended to not delete the specified ProductSet until after this operation has + * completed. It is also recommended to not add any of the Products involved in the batch delete + * to a new ProductSet while this operation is running because those Products may still end up + * deleted. + * + *

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep + * the csv files used in ImportProductSets (if that was how you originally built the Product Set) + * before starting PurgeProducts, in case you need to re-import the data after deletion. + * + *

If the plan is to purge all of the Products from a ProductSet and then re-use the empty + * ProductSet to re-import new Products into the empty ProductSet, you must wait until the + * PurgeProducts operation has finished for that ProductSet. + * + *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep + * track of the progress and results of the request. `Operation.metadata` contains + * `BatchOperationMetadata`. (progress) + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   PurgeProductsRequest request = PurgeProductsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   OperationFuture<Empty, BatchOperationMetadata> future = productSearchClient.purgeProductsOperationCallable().futureCall(request);
    *   // Do something
-   *   for (ProductSet element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   future.get();
    * }
    * 
*/ - public final UnaryCallable - listProductSetsPagedCallable() { - return stub.listProductSetsPagedCallable(); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + purgeProductsOperationCallable() { + return stub.purgeProductsOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists ProductSets in an unspecified order. + * Asynchronous API to delete all Products in a ProductSet or all Products that are in no + * ProductSet. * - *

Possible errors: + *

If a Product is a member of the specified ProductSet in addition to other ProductSets, the + * Product will still be deleted. * - *

* Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1. + *

It is recommended to not delete the specified ProductSet until after this operation has + * completed. It is also recommended to not add any of the Products involved in the batch delete + * to a new ProductSet while this operation is running because those Products may still end up + * deleted. + * + *

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep + * the csv files used in ImportProductSets (if that was how you originally built the Product Set) + * before starting PurgeProducts, in case you need to re-import the data after deletion. + * + *

If the plan is to purge all of the Products from a ProductSet and then re-use the empty + * ProductSet to re-import new Products into the empty ProductSet, you must wait until the + * PurgeProducts operation has finished for that ProductSet. + * + *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep + * track of the progress and results of the request. `Operation.metadata` contains + * `BatchOperationMetadata`. (progress) * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListProductSetsRequest request = ListProductSetsRequest.newBuilder()
+   *   PurgeProductsRequest request = PurgeProductsRequest.newBuilder()
    *     .setParent(parent.toString())
    *     .build();
-   *   while (true) {
-   *     ListProductSetsResponse response = productSearchClient.listProductSetsCallable().call(request);
-   *     for (ProductSet element : response.getProductSetsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
+   *   ApiFuture<Operation> future = productSearchClient.purgeProductsCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
    * }
    * 
*/ - public final UnaryCallable - listProductSetsCallable() { - return stub.listProductSetsCallable(); + public final UnaryCallable purgeProductsCallable() { + return stub.purgeProductsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets information associated with a ProductSet. + * Creates and returns a new ProductSet resource. * *

Possible errors: * - *

* Returns NOT_FOUND if the ProductSet does not exist. + *

* Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 + * characters. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-   *   ProductSet response = productSearchClient.getProductSet(name);
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   String productSetId = "";
+   *   ProductSet response = productSearchClient.createProductSet(parent, productSet, productSetId);
    * }
    * 
* - * @param name Required. Resource name of the ProductSet to get. - *

Format is: `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID` + * @param parent Required. The project in which the ProductSet should be created. + *

Format is `projects/PROJECT_ID/locations/LOC_ID`. + * @param productSet Required. The ProductSet to create. + * @param productSetId A user-supplied resource id for this ProductSet. If set, the server will + * attempt to use this value as the resource id. If it is already in use, an error is returned + * with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the + * character `/`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ProductSet getProductSet(ProductSetName name) { - GetProductSetRequest request = - GetProductSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getProductSet(request); + public final ProductSet createProductSet( + LocationName parent, ProductSet productSet, String productSetId) { + CreateProductSetRequest request = + CreateProductSetRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setProductSet(productSet) + .setProductSetId(productSetId) + .build(); + return createProductSet(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets information associated with a ProductSet. + * Creates and returns a new ProductSet resource. * *

Possible errors: * - *

* Returns NOT_FOUND if the ProductSet does not exist. + *

* Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 + * characters. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-   *   ProductSet response = productSearchClient.getProductSet(name.toString());
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   String productSetId = "";
+   *   ProductSet response = productSearchClient.createProductSet(parent.toString(), productSet, productSetId);
    * }
    * 
* - * @param name Required. Resource name of the ProductSet to get. - *

Format is: `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID` + * @param parent Required. The project in which the ProductSet should be created. + *

Format is `projects/PROJECT_ID/locations/LOC_ID`. + * @param productSet Required. The ProductSet to create. + * @param productSetId A user-supplied resource id for this ProductSet. If set, the server will + * attempt to use this value as the resource id. If it is already in use, an error is returned + * with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the + * character `/`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ProductSet getProductSet(String name) { - GetProductSetRequest request = GetProductSetRequest.newBuilder().setName(name).build(); - return getProductSet(request); + public final ProductSet createProductSet( + String parent, ProductSet productSet, String productSetId) { + CreateProductSetRequest request = + CreateProductSetRequest.newBuilder() + .setParent(parent) + .setProductSet(productSet) + .setProductSetId(productSetId) + .build(); + return createProductSet(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets information associated with a ProductSet. + * Creates and returns a new ProductSet resource. * *

Possible errors: * - *

* Returns NOT_FOUND if the ProductSet does not exist. + *

* Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 + * characters. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-   *   GetProductSetRequest request = GetProductSetRequest.newBuilder()
-   *     .setName(name.toString())
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   CreateProductSetRequest request = CreateProductSetRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setProductSet(productSet)
    *     .build();
-   *   ProductSet response = productSearchClient.getProductSet(request);
+   *   ProductSet response = productSearchClient.createProductSet(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 */ - public final ProductSet getProductSet(GetProductSetRequest request) { - return getProductSetCallable().call(request); + public final ProductSet createProductSet(CreateProductSetRequest request) { + return createProductSetCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets information associated with a ProductSet. + * Creates and returns a new ProductSet resource. * *

Possible errors: * - *

* Returns NOT_FOUND if the ProductSet does not exist. + *

* Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 + * characters. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-   *   GetProductSetRequest request = GetProductSetRequest.newBuilder()
-   *     .setName(name.toString())
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   CreateProductSetRequest request = CreateProductSetRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setProductSet(productSet)
    *     .build();
-   *   ApiFuture<ProductSet> future = productSearchClient.getProductSetCallable().futureCall(request);
+   *   ApiFuture<ProductSet> future = productSearchClient.createProductSetCallable().futureCall(request);
    *   // Do something
    *   ProductSet response = future.get();
    * }
    * 
*/ - public final UnaryCallable getProductSetCallable() { - return stub.getProductSetCallable(); + public final UnaryCallable createProductSetCallable() { + return stub.createProductSetCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Makes changes to a ProductSet resource. Only display_name can be updated currently. + * Lists ProductSets in an unspecified order. * *

Possible errors: * - *

* Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if - * display_name is present in update_mask but missing from the request or longer than 4096 - * characters. + *

* Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductSet productSet = ProductSet.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   ProductSet response = productSearchClient.updateProductSet(productSet, updateMask);
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (ProductSet element : productSearchClient.listProductSets(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param productSet Required. The ProductSet resource which replaces the one on the server. - * @param updateMask The [FieldMask][google.protobuf.FieldMask] that specifies which fields to - * update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask - * path is `display_name`. + * @param parent Required. The project from which ProductSets should be listed. + *

Format is `projects/PROJECT_ID/locations/LOC_ID`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ProductSet updateProductSet(ProductSet productSet, FieldMask updateMask) { - UpdateProductSetRequest request = - UpdateProductSetRequest.newBuilder() - .setProductSet(productSet) - .setUpdateMask(updateMask) + public final ListProductSetsPagedResponse listProductSets(LocationName parent) { + ListProductSetsRequest request = + ListProductSetsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) .build(); - return updateProductSet(request); + return listProductSets(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Makes changes to a ProductSet resource. Only display_name can be updated currently. + * Lists ProductSets in an unspecified order. * *

Possible errors: * - *

* Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if - * display_name is present in update_mask but missing from the request or longer than 4096 - * characters. + *

* Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductSet productSet = ProductSet.newBuilder().build();
-   *   UpdateProductSetRequest request = UpdateProductSetRequest.newBuilder()
-   *     .setProductSet(productSet)
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (ProductSet element : productSearchClient.listProductSets(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The project from which ProductSets should be listed. + *

Format is `projects/PROJECT_ID/locations/LOC_ID`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProductSetsPagedResponse listProductSets(String parent) { + ListProductSetsRequest request = ListProductSetsRequest.newBuilder().setParent(parent).build(); + return listProductSets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists ProductSets in an unspecified order. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListProductSetsRequest request = ListProductSetsRequest.newBuilder()
+   *     .setParent(parent.toString())
    *     .build();
-   *   ProductSet response = productSearchClient.updateProductSet(request);
+   *   for (ProductSet element : productSearchClient.listProductSets(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 */ - public final ProductSet updateProductSet(UpdateProductSetRequest request) { - return updateProductSetCallable().call(request); + public final ListProductSetsPagedResponse listProductSets(ListProductSetsRequest request) { + return listProductSetsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Makes changes to a ProductSet resource. Only display_name can be updated currently. + * Lists ProductSets in an unspecified order. * *

Possible errors: * - *

* Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if - * display_name is present in update_mask but missing from the request or longer than 4096 - * characters. + *

* Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductSet productSet = ProductSet.newBuilder().build();
-   *   UpdateProductSetRequest request = UpdateProductSetRequest.newBuilder()
-   *     .setProductSet(productSet)
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListProductSetsRequest request = ListProductSetsRequest.newBuilder()
+   *     .setParent(parent.toString())
    *     .build();
-   *   ApiFuture<ProductSet> future = productSearchClient.updateProductSetCallable().futureCall(request);
+   *   ApiFuture<ListProductSetsPagedResponse> future = productSearchClient.listProductSetsPagedCallable().futureCall(request);
    *   // Do something
-   *   ProductSet response = future.get();
+   *   for (ProductSet element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
*/ - public final UnaryCallable updateProductSetCallable() { - return stub.updateProductSetCallable(); + public final UnaryCallable + listProductSetsPagedCallable() { + return stub.listProductSetsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not - * deleted. + * Lists ProductSets in an unspecified order. * - *

The actual image files are not deleted from Google Cloud Storage. + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListProductSetsRequest request = ListProductSetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListProductSetsResponse response = productSearchClient.listProductSetsCallable().call(request);
+   *     for (ProductSet element : response.getProductSetsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listProductSetsCallable() { + return stub.listProductSetsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets information associated with a ProductSet. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
    *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-   *   productSearchClient.deleteProductSet(name);
+   *   ProductSet response = productSearchClient.getProductSet(name);
    * }
    * 
* - * @param name Required. Resource name of the ProductSet to delete. - *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + * @param name Required. Resource name of the ProductSet to get. + *

Format is: `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void deleteProductSet(ProductSetName name) { - DeleteProductSetRequest request = - DeleteProductSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteProductSet(request); + public final ProductSet getProductSet(ProductSetName name) { + GetProductSetRequest request = + GetProductSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getProductSet(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not - * deleted. + * Gets information associated with a ProductSet. * - *

The actual image files are not deleted from Google Cloud Storage. + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
    *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-   *   productSearchClient.deleteProductSet(name.toString());
+   *   ProductSet response = productSearchClient.getProductSet(name.toString());
    * }
    * 
* - * @param name Required. Resource name of the ProductSet to delete. - *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + * @param name Required. Resource name of the ProductSet to get. + *

Format is: `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void deleteProductSet(String name) { - DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder().setName(name).build(); - deleteProductSet(request); + public final ProductSet getProductSet(String name) { + GetProductSetRequest request = GetProductSetRequest.newBuilder().setName(name).build(); + return getProductSet(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not - * deleted. + * Gets information associated with a ProductSet. * - *

The actual image files are not deleted from Google Cloud Storage. + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
    *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-   *   DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder()
+   *   GetProductSetRequest request = GetProductSetRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   productSearchClient.deleteProductSet(request);
+   *   ProductSet response = productSearchClient.getProductSet(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 */ - public final void deleteProductSet(DeleteProductSetRequest request) { - deleteProductSetCallable().call(request); + public final ProductSet getProductSet(GetProductSetRequest request) { + return getProductSetCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not - * deleted. + * Gets information associated with a ProductSet. * - *

The actual image files are not deleted from Google Cloud Storage. + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
    *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-   *   DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder()
+   *   GetProductSetRequest request = GetProductSetRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<Void> future = productSearchClient.deleteProductSetCallable().futureCall(request);
+   *   ApiFuture<ProductSet> future = productSearchClient.getProductSetCallable().futureCall(request);
    *   // Do something
-   *   future.get();
+   *   ProductSet response = future.get();
    * }
    * 
*/ - public final UnaryCallable deleteProductSetCallable() { - return stub.deleteProductSetCallable(); + public final UnaryCallable getProductSetCallable() { + return stub.getProductSetCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates and returns a new product resource. + * Makes changes to a ProductSet resource. Only display_name can be updated currently. * *

Possible errors: * - *

* Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. - * * Returns INVALID_ARGUMENT if description is longer than 4096 characters. * Returns - * INVALID_ARGUMENT if product_category is missing or invalid. + *

* Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if + * display_name is present in update_mask but missing from the request or longer than 4096 + * characters. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Product product = Product.newBuilder().build();
-   *   String productId = "";
-   *   Product response = productSearchClient.createProduct(parent, product, productId);
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   ProductSet response = productSearchClient.updateProductSet(productSet, updateMask);
    * }
    * 
* - * @param parent Required. The project in which the Product should be created. - *

Format is `projects/PROJECT_ID/locations/LOC_ID`. - * @param product Required. The product to create. - * @param productId A user-supplied resource id for this Product. If set, the server will attempt - * to use this value as the resource id. If it is already in use, an error is returned with - * code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character - * `/`. + * @param productSet Required. The ProductSet resource which replaces the one on the server. + * @param updateMask The [FieldMask][google.protobuf.FieldMask] that specifies which fields to + * update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask + * path is `display_name`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Product createProduct(LocationName parent, Product product, String productId) { - CreateProductRequest request = - CreateProductRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setProduct(product) - .setProductId(productId) + public final ProductSet updateProductSet(ProductSet productSet, FieldMask updateMask) { + UpdateProductSetRequest request = + UpdateProductSetRequest.newBuilder() + .setProductSet(productSet) + .setUpdateMask(updateMask) .build(); - return createProduct(request); + return updateProductSet(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates and returns a new product resource. + * Makes changes to a ProductSet resource. Only display_name can be updated currently. * *

Possible errors: * - *

* Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. - * * Returns INVALID_ARGUMENT if description is longer than 4096 characters. * Returns - * INVALID_ARGUMENT if product_category is missing or invalid. + *

* Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if + * display_name is present in update_mask but missing from the request or longer than 4096 + * characters. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Product product = Product.newBuilder().build();
-   *   String productId = "";
-   *   Product response = productSearchClient.createProduct(parent.toString(), product, productId);
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   UpdateProductSetRequest request = UpdateProductSetRequest.newBuilder()
+   *     .setProductSet(productSet)
+   *     .build();
+   *   ProductSet response = productSearchClient.updateProductSet(request);
    * }
    * 
* - * @param parent Required. The project in which the Product should be created. - *

Format is `projects/PROJECT_ID/locations/LOC_ID`. - * @param product Required. The product to create. - * @param productId A user-supplied resource id for this Product. If set, the server will attempt - * to use this value as the resource id. If it is already in use, an error is returned with + * @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 + */ + public final ProductSet updateProductSet(UpdateProductSetRequest request) { + return updateProductSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Makes changes to a ProductSet resource. Only display_name can be updated currently. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if + * display_name is present in update_mask but missing from the request or longer than 4096 + * characters. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   UpdateProductSetRequest request = UpdateProductSetRequest.newBuilder()
+   *     .setProductSet(productSet)
+   *     .build();
+   *   ApiFuture<ProductSet> future = productSearchClient.updateProductSetCallable().futureCall(request);
+   *   // Do something
+   *   ProductSet response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateProductSetCallable() { + return stub.updateProductSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not + * deleted. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   productSearchClient.deleteProductSet(name);
+   * }
+   * 
+ * + * @param name Required. Resource name of the ProductSet to delete. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteProductSet(ProductSetName name) { + DeleteProductSetRequest request = + DeleteProductSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not + * deleted. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   productSearchClient.deleteProductSet(name.toString());
+   * }
+   * 
+ * + * @param name Required. Resource name of the ProductSet to delete. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteProductSet(String name) { + DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder().setName(name).build(); + deleteProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not + * deleted. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   productSearchClient.deleteProductSet(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 + */ + public final void deleteProductSet(DeleteProductSetRequest request) { + deleteProductSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not + * deleted. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = productSearchClient.deleteProductSetCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteProductSetCallable() { + return stub.deleteProductSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates and returns a new product resource. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. + * * Returns INVALID_ARGUMENT if description is longer than 4096 characters. * Returns + * INVALID_ARGUMENT if product_category is missing or invalid. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Product product = Product.newBuilder().build();
+   *   String productId = "";
+   *   Product response = productSearchClient.createProduct(parent, product, productId);
+   * }
+   * 
+ * + * @param parent Required. The project in which the Product should be created. + *

Format is `projects/PROJECT_ID/locations/LOC_ID`. + * @param product Required. The product to create. + * @param productId A user-supplied resource id for this Product. If set, the server will attempt + * to use this value as the resource id. If it is already in use, an error is returned with + * code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character + * `/`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Product createProduct(LocationName parent, Product product, String productId) { + CreateProductRequest request = + CreateProductRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setProduct(product) + .setProductId(productId) + .build(); + return createProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates and returns a new product resource. + * + *

Possible errors: + * + *

* Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. + * * Returns INVALID_ARGUMENT if description is longer than 4096 characters. * Returns + * INVALID_ARGUMENT if product_category is missing or invalid. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Product product = Product.newBuilder().build();
+   *   String productId = "";
+   *   Product response = productSearchClient.createProduct(parent.toString(), product, productId);
+   * }
+   * 
+ * + * @param parent Required. The project in which the Product should be created. + *

Format is `projects/PROJECT_ID/locations/LOC_ID`. + * @param product Required. The product to create. + * @param productId A user-supplied resource id for this Product. If set, the server will attempt + * to use this value as the resource id. If it is already in use, an error is returned with * code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character * `/`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2557,423 +2974,6 @@ public final ListProductsInProductSetPagedResponse listProductsInProductSet( return stub.listProductsInProductSetCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Asynchronous API that imports a list of reference images to specified product sets based on a - * list of image information. - * - *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep - * track of the progress and results of the request. `Operation.metadata` contains - * `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. - * (results) - * - *

The input source of this method is a csv file on Google Cloud Storage. For the format of the - * csv file please see - * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
-   *   ImportProductSetsResponse response = productSearchClient.importProductSetsAsync(parent, inputConfig).get();
-   * }
-   * 
- * - * @param parent Required. The project in which the ProductSets should be imported. - *

Format is `projects/PROJECT_ID/locations/LOC_ID`. - * @param inputConfig Required. The input content for the list of requests. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture - importProductSetsAsync(LocationName parent, ImportProductSetsInputConfig inputConfig) { - ImportProductSetsRequest request = - ImportProductSetsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setInputConfig(inputConfig) - .build(); - return importProductSetsAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Asynchronous API that imports a list of reference images to specified product sets based on a - * list of image information. - * - *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep - * track of the progress and results of the request. `Operation.metadata` contains - * `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. - * (results) - * - *

The input source of this method is a csv file on Google Cloud Storage. For the format of the - * csv file please see - * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
-   *   ImportProductSetsResponse response = productSearchClient.importProductSetsAsync(parent.toString(), inputConfig).get();
-   * }
-   * 
- * - * @param parent Required. The project in which the ProductSets should be imported. - *

Format is `projects/PROJECT_ID/locations/LOC_ID`. - * @param inputConfig Required. The input content for the list of requests. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture - importProductSetsAsync(String parent, ImportProductSetsInputConfig inputConfig) { - ImportProductSetsRequest request = - ImportProductSetsRequest.newBuilder().setParent(parent).setInputConfig(inputConfig).build(); - return importProductSetsAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Asynchronous API that imports a list of reference images to specified product sets based on a - * list of image information. - * - *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep - * track of the progress and results of the request. `Operation.metadata` contains - * `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. - * (results) - * - *

The input source of this method is a csv file on Google Cloud Storage. For the format of the - * csv file please see - * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
-   *   ImportProductSetsRequest request = ImportProductSetsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setInputConfig(inputConfig)
-   *     .build();
-   *   ImportProductSetsResponse response = productSearchClient.importProductSetsAsync(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 - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture - importProductSetsAsync(ImportProductSetsRequest request) { - return importProductSetsOperationCallable().futureCall(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Asynchronous API that imports a list of reference images to specified product sets based on a - * list of image information. - * - *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep - * track of the progress and results of the request. `Operation.metadata` contains - * `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. - * (results) - * - *

The input source of this method is a csv file on Google Cloud Storage. For the format of the - * csv file please see - * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
-   *   ImportProductSetsRequest request = ImportProductSetsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setInputConfig(inputConfig)
-   *     .build();
-   *   OperationFuture<ImportProductSetsResponse, BatchOperationMetadata> future = productSearchClient.importProductSetsOperationCallable().futureCall(request);
-   *   // Do something
-   *   ImportProductSetsResponse response = future.get();
-   * }
-   * 
- */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable< - ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> - importProductSetsOperationCallable() { - return stub.importProductSetsOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Asynchronous API that imports a list of reference images to specified product sets based on a - * list of image information. - * - *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep - * track of the progress and results of the request. `Operation.metadata` contains - * `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. - * (results) - * - *

The input source of this method is a csv file on Google Cloud Storage. For the format of the - * csv file please see - * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
-   *   ImportProductSetsRequest request = ImportProductSetsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setInputConfig(inputConfig)
-   *     .build();
-   *   ApiFuture<Operation> future = productSearchClient.importProductSetsCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable importProductSetsCallable() { - return stub.importProductSetsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Asynchronous API to delete all Products in a ProductSet or all Products that are in no - * ProductSet. - * - *

If a Product is a member of the specified ProductSet in addition to other ProductSets, the - * Product will still be deleted. - * - *

It is recommended to not delete the specified ProductSet until after this operation has - * completed. It is also recommended to not add any of the Products involved in the batch delete - * to a new ProductSet while this operation is running because those Products may still end up - * deleted. - * - *

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep - * the csv files used in ImportProductSets (if that was how you originally built the Product Set) - * before starting PurgeProducts, in case you need to re-import the data after deletion. - * - *

If the plan is to purge all of the Products from a ProductSet and then re-use the empty - * ProductSet to re-import new Products into the empty ProductSet, you must wait until the - * PurgeProducts operation has finished for that ProductSet. - * - *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep - * track of the progress and results of the request. `Operation.metadata` contains - * `BatchOperationMetadata`. (progress) - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   productSearchClient.purgeProductsAsync(parent).get();
-   * }
-   * 
- * - * @param parent Required. The project and location in which the Products should be deleted. - *

Format is `projects/PROJECT_ID/locations/LOC_ID`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture purgeProductsAsync( - LocationName parent) { - PurgeProductsRequest request = - PurgeProductsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); - return purgeProductsAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Asynchronous API to delete all Products in a ProductSet or all Products that are in no - * ProductSet. - * - *

If a Product is a member of the specified ProductSet in addition to other ProductSets, the - * Product will still be deleted. - * - *

It is recommended to not delete the specified ProductSet until after this operation has - * completed. It is also recommended to not add any of the Products involved in the batch delete - * to a new ProductSet while this operation is running because those Products may still end up - * deleted. - * - *

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep - * the csv files used in ImportProductSets (if that was how you originally built the Product Set) - * before starting PurgeProducts, in case you need to re-import the data after deletion. - * - *

If the plan is to purge all of the Products from a ProductSet and then re-use the empty - * ProductSet to re-import new Products into the empty ProductSet, you must wait until the - * PurgeProducts operation has finished for that ProductSet. - * - *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep - * track of the progress and results of the request. `Operation.metadata` contains - * `BatchOperationMetadata`. (progress) - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   productSearchClient.purgeProductsAsync(parent.toString()).get();
-   * }
-   * 
- * - * @param parent Required. The project and location in which the Products should be deleted. - *

Format is `projects/PROJECT_ID/locations/LOC_ID`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture purgeProductsAsync(String parent) { - PurgeProductsRequest request = PurgeProductsRequest.newBuilder().setParent(parent).build(); - return purgeProductsAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Asynchronous API to delete all Products in a ProductSet or all Products that are in no - * ProductSet. - * - *

If a Product is a member of the specified ProductSet in addition to other ProductSets, the - * Product will still be deleted. - * - *

It is recommended to not delete the specified ProductSet until after this operation has - * completed. It is also recommended to not add any of the Products involved in the batch delete - * to a new ProductSet while this operation is running because those Products may still end up - * deleted. - * - *

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep - * the csv files used in ImportProductSets (if that was how you originally built the Product Set) - * before starting PurgeProducts, in case you need to re-import the data after deletion. - * - *

If the plan is to purge all of the Products from a ProductSet and then re-use the empty - * ProductSet to re-import new Products into the empty ProductSet, you must wait until the - * PurgeProducts operation has finished for that ProductSet. - * - *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep - * track of the progress and results of the request. `Operation.metadata` contains - * `BatchOperationMetadata`. (progress) - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   PurgeProductsRequest request = PurgeProductsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   productSearchClient.purgeProductsAsync(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 - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture purgeProductsAsync( - PurgeProductsRequest request) { - return purgeProductsOperationCallable().futureCall(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Asynchronous API to delete all Products in a ProductSet or all Products that are in no - * ProductSet. - * - *

If a Product is a member of the specified ProductSet in addition to other ProductSets, the - * Product will still be deleted. - * - *

It is recommended to not delete the specified ProductSet until after this operation has - * completed. It is also recommended to not add any of the Products involved in the batch delete - * to a new ProductSet while this operation is running because those Products may still end up - * deleted. - * - *

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep - * the csv files used in ImportProductSets (if that was how you originally built the Product Set) - * before starting PurgeProducts, in case you need to re-import the data after deletion. - * - *

If the plan is to purge all of the Products from a ProductSet and then re-use the empty - * ProductSet to re-import new Products into the empty ProductSet, you must wait until the - * PurgeProducts operation has finished for that ProductSet. - * - *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep - * track of the progress and results of the request. `Operation.metadata` contains - * `BatchOperationMetadata`. (progress) - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   PurgeProductsRequest request = PurgeProductsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   OperationFuture<Empty, BatchOperationMetadata> future = productSearchClient.purgeProductsOperationCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - purgeProductsOperationCallable() { - return stub.purgeProductsOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Asynchronous API to delete all Products in a ProductSet or all Products that are in no - * ProductSet. - * - *

If a Product is a member of the specified ProductSet in addition to other ProductSets, the - * Product will still be deleted. - * - *

It is recommended to not delete the specified ProductSet until after this operation has - * completed. It is also recommended to not add any of the Products involved in the batch delete - * to a new ProductSet while this operation is running because those Products may still end up - * deleted. - * - *

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep - * the csv files used in ImportProductSets (if that was how you originally built the Product Set) - * before starting PurgeProducts, in case you need to re-import the data after deletion. - * - *

If the plan is to purge all of the Products from a ProductSet and then re-use the empty - * ProductSet to re-import new Products into the empty ProductSet, you must wait until the - * PurgeProducts operation has finished for that ProductSet. - * - *

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep - * track of the progress and results of the request. `Operation.metadata` contains - * `BatchOperationMetadata`. (progress) - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   PurgeProductsRequest request = PurgeProductsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<Operation> future = productSearchClient.purgeProductsCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable purgeProductsCallable() { - return stub.purgeProductsCallable(); - } - @Override public final void close() { stub.close(); diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchSettings.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchSettings.java index 6e47c427b..d8f4306b4 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchSettings.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchSettings.java @@ -72,6 +72,33 @@ */ @Generated("by gapic-generator") public class ProductSearchSettings extends ClientSettings { + /** Returns the object with the settings used for calls to importProductSets. */ + public UnaryCallSettings importProductSetsSettings() { + return ((ProductSearchStubSettings) getStubSettings()).importProductSetsSettings(); + } + + /** Returns the object with the settings used for calls to importProductSets. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings< + ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> + importProductSetsOperationSettings() { + return ((ProductSearchStubSettings) getStubSettings()).importProductSetsOperationSettings(); + } + + /** Returns the object with the settings used for calls to purgeProducts. */ + public UnaryCallSettings purgeProductsSettings() { + return ((ProductSearchStubSettings) getStubSettings()).purgeProductsSettings(); + } + + /** Returns the object with the settings used for calls to purgeProducts. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + purgeProductsOperationSettings() { + return ((ProductSearchStubSettings) getStubSettings()).purgeProductsOperationSettings(); + } + /** Returns the object with the settings used for calls to createProductSet. */ public UnaryCallSettings createProductSetSettings() { return ((ProductSearchStubSettings) getStubSettings()).createProductSetSettings(); @@ -168,33 +195,6 @@ public UnaryCallSettings addProductToProdu return ((ProductSearchStubSettings) getStubSettings()).listProductsInProductSetSettings(); } - /** Returns the object with the settings used for calls to importProductSets. */ - public UnaryCallSettings importProductSetsSettings() { - return ((ProductSearchStubSettings) getStubSettings()).importProductSetsSettings(); - } - - /** Returns the object with the settings used for calls to importProductSets. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings< - ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> - importProductSetsOperationSettings() { - return ((ProductSearchStubSettings) getStubSettings()).importProductSetsOperationSettings(); - } - - /** Returns the object with the settings used for calls to purgeProducts. */ - public UnaryCallSettings purgeProductsSettings() { - return ((ProductSearchStubSettings) getStubSettings()).purgeProductsSettings(); - } - - /** Returns the object with the settings used for calls to purgeProducts. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings - purgeProductsOperationSettings() { - return ((ProductSearchStubSettings) getStubSettings()).purgeProductsOperationSettings(); - } - public static final ProductSearchSettings create(ProductSearchStubSettings stub) throws IOException { return new ProductSearchSettings.Builder(stub.toBuilder()).build(); @@ -292,6 +292,34 @@ public Builder applyToAllUnaryMethods( return this; } + /** Returns the builder for the settings used for calls to importProductSets. */ + public UnaryCallSettings.Builder + importProductSetsSettings() { + return getStubSettingsBuilder().importProductSetsSettings(); + } + + /** Returns the builder for the settings used for calls to importProductSets. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> + importProductSetsOperationSettings() { + return getStubSettingsBuilder().importProductSetsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to purgeProducts. */ + public UnaryCallSettings.Builder purgeProductsSettings() { + return getStubSettingsBuilder().purgeProductsSettings(); + } + + /** Returns the builder for the settings used for calls to purgeProducts. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + purgeProductsOperationSettings() { + return getStubSettingsBuilder().purgeProductsOperationSettings(); + } + /** Returns the builder for the settings used for calls to createProductSet. */ public UnaryCallSettings.Builder createProductSetSettings() { @@ -396,34 +424,6 @@ public UnaryCallSettings.Builder deleteProductSetti return getStubSettingsBuilder().listProductsInProductSetSettings(); } - /** Returns the builder for the settings used for calls to importProductSets. */ - public UnaryCallSettings.Builder - importProductSetsSettings() { - return getStubSettingsBuilder().importProductSetsSettings(); - } - - /** Returns the builder for the settings used for calls to importProductSets. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings.Builder< - ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> - importProductSetsOperationSettings() { - return getStubSettingsBuilder().importProductSetsOperationSettings(); - } - - /** Returns the builder for the settings used for calls to purgeProducts. */ - public UnaryCallSettings.Builder purgeProductsSettings() { - return getStubSettingsBuilder().purgeProductsSettings(); - } - - /** Returns the builder for the settings used for calls to purgeProducts. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings.Builder - purgeProductsOperationSettings() { - return getStubSettingsBuilder().purgeProductsOperationSettings(); - } - @Override public ProductSearchSettings build() throws IOException { return new ProductSearchSettings(this); diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/package-info.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/package-info.java index 79a682665..2e9adcf8d 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/package-info.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/package-info.java @@ -61,8 +61,8 @@ *
  * 
  * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
- *   List<AnnotateImageRequest> requests = new ArrayList<>();
- *   BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
+ *   List<AnnotateFileRequest> requests = new ArrayList<>();
+ *   BatchAnnotateFilesResponse response = imageAnnotatorClient.batchAnnotateFiles(requests);
  * }
  * 
  * 
diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/GrpcImageAnnotatorStub.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/GrpcImageAnnotatorStub.java index 299651407..780c02967 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/GrpcImageAnnotatorStub.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/GrpcImageAnnotatorStub.java @@ -53,16 +53,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class GrpcImageAnnotatorStub extends ImageAnnotatorStub { - private static final MethodDescriptor - batchAnnotateImagesMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.vision.v1.ImageAnnotator/BatchAnnotateImages") - .setRequestMarshaller( - ProtoUtils.marshaller(BatchAnnotateImagesRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(BatchAnnotateImagesResponse.getDefaultInstance())) - .build(); private static final MethodDescriptor batchAnnotateFilesMethodDescriptor = MethodDescriptor.newBuilder() @@ -91,12 +81,20 @@ public class GrpcImageAnnotatorStub extends ImageAnnotatorStub { ProtoUtils.marshaller(AsyncBatchAnnotateFilesRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + batchAnnotateImagesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1.ImageAnnotator/BatchAnnotateImages") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchAnnotateImagesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(BatchAnnotateImagesResponse.getDefaultInstance())) + .build(); private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; - private final UnaryCallable - batchAnnotateImagesCallable; private final UnaryCallable batchAnnotateFilesCallable; private final UnaryCallable @@ -109,6 +107,8 @@ public class GrpcImageAnnotatorStub extends ImageAnnotatorStub { private final OperationCallable< AsyncBatchAnnotateFilesRequest, AsyncBatchAnnotateFilesResponse, OperationMetadata> asyncBatchAnnotateFilesOperationCallable; + private final UnaryCallable + batchAnnotateImagesCallable; private final GrpcStubCallableFactory callableFactory; @@ -152,20 +152,6 @@ protected GrpcImageAnnotatorStub( this.callableFactory = callableFactory; this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - GrpcCallSettings - batchAnnotateImagesTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(batchAnnotateImagesMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(BatchAnnotateImagesRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } - }) - .build(); GrpcCallSettings batchAnnotateFilesTransportSettings = GrpcCallSettings.newBuilder() @@ -208,12 +194,21 @@ public Map extract(AsyncBatchAnnotateFilesRequest request) { } }) .build(); + GrpcCallSettings + batchAnnotateImagesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchAnnotateImagesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(BatchAnnotateImagesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); - this.batchAnnotateImagesCallable = - callableFactory.createUnaryCallable( - batchAnnotateImagesTransportSettings, - settings.batchAnnotateImagesSettings(), - clientContext); this.batchAnnotateFilesCallable = callableFactory.createUnaryCallable( batchAnnotateFilesTransportSettings, @@ -241,6 +236,11 @@ public Map extract(AsyncBatchAnnotateFilesRequest request) { settings.asyncBatchAnnotateFilesOperationSettings(), clientContext, this.operationsStub); + this.batchAnnotateImagesCallable = + callableFactory.createUnaryCallable( + batchAnnotateImagesTransportSettings, + settings.batchAnnotateImagesSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -250,11 +250,6 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } - public UnaryCallable - batchAnnotateImagesCallable() { - return batchAnnotateImagesCallable; - } - public UnaryCallable batchAnnotateFilesCallable() { return batchAnnotateFilesCallable; @@ -284,6 +279,11 @@ public GrpcOperationsStub getOperationsStub() { return asyncBatchAnnotateFilesCallable; } + public UnaryCallable + batchAnnotateImagesCallable() { + return batchAnnotateImagesCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/GrpcProductSearchStub.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/GrpcProductSearchStub.java index cfbf09421..381a8a7a4 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/GrpcProductSearchStub.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/GrpcProductSearchStub.java @@ -78,6 +78,24 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class GrpcProductSearchStub extends ProductSearchStub { + private static final MethodDescriptor + importProductSetsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1.ProductSearch/ImportProductSets") + .setRequestMarshaller( + ProtoUtils.marshaller(ImportProductSetsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + purgeProductsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1.ProductSearch/PurgeProducts") + .setRequestMarshaller( + ProtoUtils.marshaller(PurgeProductsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); private static final MethodDescriptor createProductSetMethodDescriptor = MethodDescriptor.newBuilder() @@ -232,28 +250,17 @@ public class GrpcProductSearchStub extends ProductSearchStub { .setResponseMarshaller( ProtoUtils.marshaller(ListProductsInProductSetResponse.getDefaultInstance())) .build(); - private static final MethodDescriptor - importProductSetsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.vision.v1.ProductSearch/ImportProductSets") - .setRequestMarshaller( - ProtoUtils.marshaller(ImportProductSetsRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - private static final MethodDescriptor - purgeProductsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.vision.v1.ProductSearch/PurgeProducts") - .setRequestMarshaller( - ProtoUtils.marshaller(PurgeProductsRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; + private final UnaryCallable importProductSetsCallable; + private final OperationCallable< + ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> + importProductSetsOperationCallable; + private final UnaryCallable purgeProductsCallable; + private final OperationCallable + purgeProductsOperationCallable; private final UnaryCallable createProductSetCallable; private final UnaryCallable listProductSetsCallable; @@ -285,13 +292,6 @@ public class GrpcProductSearchStub extends ProductSearchStub { private final UnaryCallable< ListProductsInProductSetRequest, ListProductsInProductSetPagedResponse> listProductsInProductSetPagedCallable; - private final UnaryCallable importProductSetsCallable; - private final OperationCallable< - ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> - importProductSetsOperationCallable; - private final UnaryCallable purgeProductsCallable; - private final OperationCallable - purgeProductsOperationCallable; private final GrpcStubCallableFactory callableFactory; @@ -333,6 +333,32 @@ protected GrpcProductSearchStub( this.callableFactory = callableFactory; this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + GrpcCallSettings importProductSetsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importProductSetsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ImportProductSetsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings purgeProductsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(purgeProductsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(PurgeProductsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); GrpcCallSettings createProductSetTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createProductSetMethodDescriptor) @@ -562,33 +588,27 @@ public Map extract(ListProductsInProductSetRequest request) { } }) .build(); - GrpcCallSettings importProductSetsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(importProductSetsMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ImportProductSetsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } - }) - .build(); - GrpcCallSettings purgeProductsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(purgeProductsMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(PurgeProductsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } - }) - .build(); + this.importProductSetsCallable = + callableFactory.createUnaryCallable( + importProductSetsTransportSettings, + settings.importProductSetsSettings(), + clientContext); + this.importProductSetsOperationCallable = + callableFactory.createOperationCallable( + importProductSetsTransportSettings, + settings.importProductSetsOperationSettings(), + clientContext, + this.operationsStub); + this.purgeProductsCallable = + callableFactory.createUnaryCallable( + purgeProductsTransportSettings, settings.purgeProductsSettings(), clientContext); + this.purgeProductsOperationCallable = + callableFactory.createOperationCallable( + purgeProductsTransportSettings, + settings.purgeProductsOperationSettings(), + clientContext, + this.operationsStub); this.createProductSetCallable = callableFactory.createUnaryCallable( createProductSetTransportSettings, settings.createProductSetSettings(), clientContext); @@ -670,26 +690,6 @@ public Map extract(PurgeProductsRequest request) { listProductsInProductSetTransportSettings, settings.listProductsInProductSetSettings(), clientContext); - this.importProductSetsCallable = - callableFactory.createUnaryCallable( - importProductSetsTransportSettings, - settings.importProductSetsSettings(), - clientContext); - this.importProductSetsOperationCallable = - callableFactory.createOperationCallable( - importProductSetsTransportSettings, - settings.importProductSetsOperationSettings(), - clientContext, - this.operationsStub); - this.purgeProductsCallable = - callableFactory.createUnaryCallable( - purgeProductsTransportSettings, settings.purgeProductsSettings(), clientContext); - this.purgeProductsOperationCallable = - callableFactory.createOperationCallable( - purgeProductsTransportSettings, - settings.purgeProductsOperationSettings(), - clientContext, - this.operationsStub); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -699,6 +699,27 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable< + ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> + importProductSetsOperationCallable() { + return importProductSetsOperationCallable; + } + + public UnaryCallable importProductSetsCallable() { + return importProductSetsCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + purgeProductsOperationCallable() { + return purgeProductsOperationCallable; + } + + public UnaryCallable purgeProductsCallable() { + return purgeProductsCallable; + } + public UnaryCallable createProductSetCallable() { return createProductSetCallable; } @@ -789,27 +810,6 @@ public UnaryCallable addProductToProductSe return listProductsInProductSetCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable< - ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> - importProductSetsOperationCallable() { - return importProductSetsOperationCallable; - } - - public UnaryCallable importProductSetsCallable() { - return importProductSetsCallable; - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable - purgeProductsOperationCallable() { - return purgeProductsOperationCallable; - } - - public UnaryCallable purgeProductsCallable() { - return purgeProductsCallable; - } - @Override public final void close() { shutdown(); diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ImageAnnotatorStub.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ImageAnnotatorStub.java index 3413673ac..500af0bc5 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ImageAnnotatorStub.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ImageAnnotatorStub.java @@ -47,11 +47,6 @@ public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } - public UnaryCallable - batchAnnotateImagesCallable() { - throw new UnsupportedOperationException("Not implemented: batchAnnotateImagesCallable()"); - } - public UnaryCallable batchAnnotateFilesCallable() { throw new UnsupportedOperationException("Not implemented: batchAnnotateFilesCallable()"); @@ -83,6 +78,11 @@ public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: asyncBatchAnnotateFilesCallable()"); } + public UnaryCallable + batchAnnotateImagesCallable() { + throw new UnsupportedOperationException("Not implemented: batchAnnotateImagesCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ImageAnnotatorStubSettings.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ImageAnnotatorStubSettings.java index 0fbce116f..e48d175ed 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ImageAnnotatorStubSettings.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ImageAnnotatorStubSettings.java @@ -68,16 +68,16 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of batchAnnotateImages to 30 seconds: + *

For example, to set the total timeout of batchAnnotateFiles to 30 seconds: * *

  * 
  * ImageAnnotatorStubSettings.Builder imageAnnotatorSettingsBuilder =
  *     ImageAnnotatorStubSettings.newBuilder();
  * imageAnnotatorSettingsBuilder
- *     .batchAnnotateImagesSettings()
+ *     .batchAnnotateFilesSettings()
  *     .setRetrySettings(
- *         imageAnnotatorSettingsBuilder.batchAnnotateImagesSettings().getRetrySettings().toBuilder()
+ *         imageAnnotatorSettingsBuilder.batchAnnotateFilesSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * ImageAnnotatorStubSettings imageAnnotatorSettings = imageAnnotatorSettingsBuilder.build();
@@ -93,8 +93,6 @@ public class ImageAnnotatorStubSettings extends StubSettings
-      batchAnnotateImagesSettings;
   private final UnaryCallSettings
       batchAnnotateFilesSettings;
   private final UnaryCallSettings
@@ -107,12 +105,8 @@ public class ImageAnnotatorStubSettings extends StubSettings
       asyncBatchAnnotateFilesOperationSettings;
-
-  /** Returns the object with the settings used for calls to batchAnnotateImages. */
-  public UnaryCallSettings
-      batchAnnotateImagesSettings() {
-    return batchAnnotateImagesSettings;
-  }
+  private final UnaryCallSettings
+      batchAnnotateImagesSettings;
 
   /** Returns the object with the settings used for calls to batchAnnotateFiles. */
   public UnaryCallSettings
@@ -148,6 +142,12 @@ public class ImageAnnotatorStubSettings extends StubSettings
+      batchAnnotateImagesSettings() {
+    return batchAnnotateImagesSettings;
+  }
+
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public ImageAnnotatorStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -217,7 +217,6 @@ public Builder toBuilder() {
   protected ImageAnnotatorStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    batchAnnotateImagesSettings = settingsBuilder.batchAnnotateImagesSettings().build();
     batchAnnotateFilesSettings = settingsBuilder.batchAnnotateFilesSettings().build();
     asyncBatchAnnotateImagesSettings = settingsBuilder.asyncBatchAnnotateImagesSettings().build();
     asyncBatchAnnotateImagesOperationSettings =
@@ -225,14 +224,13 @@ protected ImageAnnotatorStubSettings(Builder settingsBuilder) throws IOException
     asyncBatchAnnotateFilesSettings = settingsBuilder.asyncBatchAnnotateFilesSettings().build();
     asyncBatchAnnotateFilesOperationSettings =
         settingsBuilder.asyncBatchAnnotateFilesOperationSettings().build();
+    batchAnnotateImagesSettings = settingsBuilder.batchAnnotateImagesSettings().build();
   }
 
   /** Builder for ImageAnnotatorStubSettings. */
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder
-        batchAnnotateImagesSettings;
     private final UnaryCallSettings.Builder
         batchAnnotateFilesSettings;
     private final UnaryCallSettings.Builder
@@ -245,6 +243,8 @@ public static class Builder extends StubSettings.Builder
         asyncBatchAnnotateFilesOperationSettings;
+    private final UnaryCallSettings.Builder
+        batchAnnotateImagesSettings;
 
     private static final ImmutableMap>
         RETRYABLE_CODE_DEFINITIONS;
@@ -253,11 +253,11 @@ public static class Builder extends StubSettings.Builder> definitions =
           ImmutableMap.builder();
       definitions.put(
-          "idempotent",
+          "retry_policy_1_codes",
           ImmutableSet.copyOf(
               Lists.newArrayList(
                   StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
+      definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -271,12 +271,14 @@ public static class Builder extends StubSettings.Builder>of(
-              batchAnnotateImagesSettings,
               batchAnnotateFilesSettings,
               asyncBatchAnnotateImagesSettings,
-              asyncBatchAnnotateFilesSettings);
+              asyncBatchAnnotateFilesSettings,
+              batchAnnotateImagesSettings);
 
       initDefaults(this);
     }
@@ -320,32 +322,32 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder
-          .batchAnnotateImagesSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
-
       builder
           .batchAnnotateFilesSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
 
       builder
           .asyncBatchAnnotateImagesSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
 
       builder
           .asyncBatchAnnotateFilesSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
+
+      builder
+          .batchAnnotateImagesSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
       builder
           .asyncBatchAnnotateImagesOperationSettings()
           .setInitialCallSettings(
               UnaryCallSettings
                   .newUnaryCallSettingsBuilder()
-                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
+                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
+                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"))
                   .build())
           .setResponseTransformer(
               ProtoOperationTransformers.ResponseTransformer.create(
@@ -368,8 +370,8 @@ private static Builder initDefaults(Builder builder) {
           .setInitialCallSettings(
               UnaryCallSettings
                   .newUnaryCallSettingsBuilder()
-                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
+                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
+                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"))
                   .build())
           .setResponseTransformer(
               ProtoOperationTransformers.ResponseTransformer.create(
@@ -394,7 +396,6 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(ImageAnnotatorStubSettings settings) {
       super(settings);
 
-      batchAnnotateImagesSettings = settings.batchAnnotateImagesSettings.toBuilder();
       batchAnnotateFilesSettings = settings.batchAnnotateFilesSettings.toBuilder();
       asyncBatchAnnotateImagesSettings = settings.asyncBatchAnnotateImagesSettings.toBuilder();
       asyncBatchAnnotateImagesOperationSettings =
@@ -402,13 +403,14 @@ protected Builder(ImageAnnotatorStubSettings settings) {
       asyncBatchAnnotateFilesSettings = settings.asyncBatchAnnotateFilesSettings.toBuilder();
       asyncBatchAnnotateFilesOperationSettings =
           settings.asyncBatchAnnotateFilesOperationSettings.toBuilder();
+      batchAnnotateImagesSettings = settings.batchAnnotateImagesSettings.toBuilder();
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
-              batchAnnotateImagesSettings,
               batchAnnotateFilesSettings,
               asyncBatchAnnotateImagesSettings,
-              asyncBatchAnnotateFilesSettings);
+              asyncBatchAnnotateFilesSettings,
+              batchAnnotateImagesSettings);
     }
 
     // NEXT_MAJOR_VER: remove 'throws Exception'
@@ -427,12 +429,6 @@ public Builder applyToAllUnaryMethods(
       return unaryMethodSettingsBuilders;
     }
 
-    /** Returns the builder for the settings used for calls to batchAnnotateImages. */
-    public UnaryCallSettings.Builder
-        batchAnnotateImagesSettings() {
-      return batchAnnotateImagesSettings;
-    }
-
     /** Returns the builder for the settings used for calls to batchAnnotateFiles. */
     public UnaryCallSettings.Builder
         batchAnnotateFilesSettings() {
@@ -469,6 +465,12 @@ public Builder applyToAllUnaryMethods(
       return asyncBatchAnnotateFilesOperationSettings;
     }
 
+    /** Returns the builder for the settings used for calls to batchAnnotateImages. */
+    public UnaryCallSettings.Builder
+        batchAnnotateImagesSettings() {
+      return batchAnnotateImagesSettings;
+    }
+
     @Override
     public ImageAnnotatorStubSettings build() throws IOException {
       return new ImageAnnotatorStubSettings(this);
diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ProductSearchStub.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ProductSearchStub.java
index 57e4a9e70..aed98f95f 100644
--- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ProductSearchStub.java
+++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ProductSearchStub.java
@@ -72,6 +72,28 @@ public OperationsStub getOperationsStub() {
     throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
   }
 
+  @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+  public OperationCallable<
+          ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata>
+      importProductSetsOperationCallable() {
+    throw new UnsupportedOperationException(
+        "Not implemented: importProductSetsOperationCallable()");
+  }
+
+  public UnaryCallable importProductSetsCallable() {
+    throw new UnsupportedOperationException("Not implemented: importProductSetsCallable()");
+  }
+
+  @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+  public OperationCallable
+      purgeProductsOperationCallable() {
+    throw new UnsupportedOperationException("Not implemented: purgeProductsOperationCallable()");
+  }
+
+  public UnaryCallable purgeProductsCallable() {
+    throw new UnsupportedOperationException("Not implemented: purgeProductsCallable()");
+  }
+
   public UnaryCallable createProductSetCallable() {
     throw new UnsupportedOperationException("Not implemented: createProductSetCallable()");
   }
@@ -164,28 +186,6 @@ public UnaryCallable addProductToProductSe
     throw new UnsupportedOperationException("Not implemented: listProductsInProductSetCallable()");
   }
 
-  @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
-  public OperationCallable<
-          ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata>
-      importProductSetsOperationCallable() {
-    throw new UnsupportedOperationException(
-        "Not implemented: importProductSetsOperationCallable()");
-  }
-
-  public UnaryCallable importProductSetsCallable() {
-    throw new UnsupportedOperationException("Not implemented: importProductSetsCallable()");
-  }
-
-  @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
-  public OperationCallable
-      purgeProductsOperationCallable() {
-    throw new UnsupportedOperationException("Not implemented: purgeProductsOperationCallable()");
-  }
-
-  public UnaryCallable purgeProductsCallable() {
-    throw new UnsupportedOperationException("Not implemented: purgeProductsCallable()");
-  }
-
   @Override
   public abstract void close();
 }
diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ProductSearchStubSettings.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ProductSearchStubSettings.java
index aa4d1d221..3aeec62d0 100644
--- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ProductSearchStubSettings.java
+++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ProductSearchStubSettings.java
@@ -125,6 +125,13 @@ public class ProductSearchStubSettings extends StubSettings importProductSetsSettings;
+  private final OperationCallSettings<
+          ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata>
+      importProductSetsOperationSettings;
+  private final UnaryCallSettings purgeProductsSettings;
+  private final OperationCallSettings
+      purgeProductsOperationSettings;
   private final UnaryCallSettings createProductSetSettings;
   private final PagedCallSettings<
           ListProductSetsRequest, ListProductSetsResponse, ListProductSetsPagedResponse>
@@ -156,13 +163,31 @@ public class ProductSearchStubSettings extends StubSettings
       listProductsInProductSetSettings;
-  private final UnaryCallSettings importProductSetsSettings;
-  private final OperationCallSettings<
+
+  /** Returns the object with the settings used for calls to importProductSets. */
+  public UnaryCallSettings importProductSetsSettings() {
+    return importProductSetsSettings;
+  }
+
+  /** Returns the object with the settings used for calls to importProductSets. */
+  @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+  public OperationCallSettings<
           ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata>
-      importProductSetsOperationSettings;
-  private final UnaryCallSettings purgeProductsSettings;
-  private final OperationCallSettings
-      purgeProductsOperationSettings;
+      importProductSetsOperationSettings() {
+    return importProductSetsOperationSettings;
+  }
+
+  /** Returns the object with the settings used for calls to purgeProducts. */
+  public UnaryCallSettings purgeProductsSettings() {
+    return purgeProductsSettings;
+  }
+
+  /** Returns the object with the settings used for calls to purgeProducts. */
+  @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+  public OperationCallSettings
+      purgeProductsOperationSettings() {
+    return purgeProductsOperationSettings;
+  }
 
   /** Returns the object with the settings used for calls to createProductSet. */
   public UnaryCallSettings createProductSetSettings() {
@@ -260,31 +285,6 @@ public UnaryCallSettings addProductToProdu
     return listProductsInProductSetSettings;
   }
 
-  /** Returns the object with the settings used for calls to importProductSets. */
-  public UnaryCallSettings importProductSetsSettings() {
-    return importProductSetsSettings;
-  }
-
-  /** Returns the object with the settings used for calls to importProductSets. */
-  @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
-  public OperationCallSettings<
-          ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata>
-      importProductSetsOperationSettings() {
-    return importProductSetsOperationSettings;
-  }
-
-  /** Returns the object with the settings used for calls to purgeProducts. */
-  public UnaryCallSettings purgeProductsSettings() {
-    return purgeProductsSettings;
-  }
-
-  /** Returns the object with the settings used for calls to purgeProducts. */
-  @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
-  public OperationCallSettings
-      purgeProductsOperationSettings() {
-    return purgeProductsOperationSettings;
-  }
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public ProductSearchStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -354,6 +354,11 @@ public Builder toBuilder() {
   protected ProductSearchStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
+    importProductSetsSettings = settingsBuilder.importProductSetsSettings().build();
+    importProductSetsOperationSettings =
+        settingsBuilder.importProductSetsOperationSettings().build();
+    purgeProductsSettings = settingsBuilder.purgeProductsSettings().build();
+    purgeProductsOperationSettings = settingsBuilder.purgeProductsOperationSettings().build();
     createProductSetSettings = settingsBuilder.createProductSetSettings().build();
     listProductSetsSettings = settingsBuilder.listProductSetsSettings().build();
     getProductSetSettings = settingsBuilder.getProductSetSettings().build();
@@ -372,11 +377,6 @@ protected ProductSearchStubSettings(Builder settingsBuilder) throws IOException
     removeProductFromProductSetSettings =
         settingsBuilder.removeProductFromProductSetSettings().build();
     listProductsInProductSetSettings = settingsBuilder.listProductsInProductSetSettings().build();
-    importProductSetsSettings = settingsBuilder.importProductSetsSettings().build();
-    importProductSetsOperationSettings =
-        settingsBuilder.importProductSetsOperationSettings().build();
-    purgeProductsSettings = settingsBuilder.purgeProductsSettings().build();
-    purgeProductsOperationSettings = settingsBuilder.purgeProductsOperationSettings().build();
   }
 
   private static final PagedListDescriptor<
@@ -622,6 +622,14 @@ public ApiFuture getFuturePagedResponse(
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
+    private final UnaryCallSettings.Builder
+        importProductSetsSettings;
+    private final OperationCallSettings.Builder<
+            ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata>
+        importProductSetsOperationSettings;
+    private final UnaryCallSettings.Builder purgeProductsSettings;
+    private final OperationCallSettings.Builder
+        purgeProductsOperationSettings;
     private final UnaryCallSettings.Builder
         createProductSetSettings;
     private final PagedCallSettings.Builder<
@@ -659,14 +667,6 @@ public static class Builder extends StubSettings.Builder
         listProductsInProductSetSettings;
-    private final UnaryCallSettings.Builder
-        importProductSetsSettings;
-    private final OperationCallSettings.Builder<
-            ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata>
-        importProductSetsOperationSettings;
-    private final UnaryCallSettings.Builder purgeProductsSettings;
-    private final OperationCallSettings.Builder
-        purgeProductsOperationSettings;
 
     private static final ImmutableMap>
         RETRYABLE_CODE_DEFINITIONS;
@@ -674,12 +674,14 @@ public static class Builder extends StubSettings.Builder> definitions =
           ImmutableMap.builder();
+      definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList()));
       definitions.put(
-          "idempotent",
+          "retry_policy_3_codes",
           ImmutableSet.copyOf(
               Lists.newArrayList(
                   StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
+      definitions.put(
+          "retry_policy_2_codes", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -693,12 +695,25 @@ public static class Builder extends StubSettings.Builder>of(
+              importProductSetsSettings,
+              purgeProductsSettings,
               createProductSetSettings,
               listProductSetsSettings,
               getProductSetSettings,
@@ -771,9 +788,7 @@ protected Builder(ClientContext clientContext) {
               getReferenceImageSettings,
               addProductToProductSetSettings,
               removeProductFromProductSetSettings,
-              listProductsInProductSetSettings,
-              importProductSetsSettings,
-              purgeProductsSettings);
+              listProductsInProductSetSettings);
 
       initDefaults(this);
     }
@@ -789,107 +804,107 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
+      builder
+          .importProductSetsSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
+
+      builder
+          .purgeProductsSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
+
       builder
           .createProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
 
       builder
           .listProductSetsSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .getProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .updateProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .deleteProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .createProductSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
 
       builder
           .listProductsSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .getProductSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .updateProductSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .deleteProductSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .createReferenceImageSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
 
       builder
           .deleteReferenceImageSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .listReferenceImagesSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .getReferenceImageSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .addProductToProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .removeProductFromProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .listProductsInProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
-
-      builder
-          .importProductSetsSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
-
-      builder
-          .purgeProductsSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
       builder
           .importProductSetsOperationSettings()
           .setInitialCallSettings(
               UnaryCallSettings
                   .newUnaryCallSettingsBuilder()
-                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
+                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"))
                   .build())
           .setResponseTransformer(
               ProtoOperationTransformers.ResponseTransformer.create(
@@ -912,8 +927,8 @@ private static Builder initDefaults(Builder builder) {
           .setInitialCallSettings(
               UnaryCallSettings
                   .newUnaryCallSettingsBuilder()
-                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
+                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"))
                   .build())
           .setResponseTransformer(
               ProtoOperationTransformers.ResponseTransformer.create(Empty.class))
@@ -937,6 +952,10 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(ProductSearchStubSettings settings) {
       super(settings);
 
+      importProductSetsSettings = settings.importProductSetsSettings.toBuilder();
+      importProductSetsOperationSettings = settings.importProductSetsOperationSettings.toBuilder();
+      purgeProductsSettings = settings.purgeProductsSettings.toBuilder();
+      purgeProductsOperationSettings = settings.purgeProductsOperationSettings.toBuilder();
       createProductSetSettings = settings.createProductSetSettings.toBuilder();
       listProductSetsSettings = settings.listProductSetsSettings.toBuilder();
       getProductSetSettings = settings.getProductSetSettings.toBuilder();
@@ -955,13 +974,11 @@ protected Builder(ProductSearchStubSettings settings) {
       removeProductFromProductSetSettings =
           settings.removeProductFromProductSetSettings.toBuilder();
       listProductsInProductSetSettings = settings.listProductsInProductSetSettings.toBuilder();
-      importProductSetsSettings = settings.importProductSetsSettings.toBuilder();
-      importProductSetsOperationSettings = settings.importProductSetsOperationSettings.toBuilder();
-      purgeProductsSettings = settings.purgeProductsSettings.toBuilder();
-      purgeProductsOperationSettings = settings.purgeProductsOperationSettings.toBuilder();
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
+              importProductSetsSettings,
+              purgeProductsSettings,
               createProductSetSettings,
               listProductSetsSettings,
               getProductSetSettings,
@@ -978,9 +995,7 @@ protected Builder(ProductSearchStubSettings settings) {
               getReferenceImageSettings,
               addProductToProductSetSettings,
               removeProductFromProductSetSettings,
-              listProductsInProductSetSettings,
-              importProductSetsSettings,
-              purgeProductsSettings);
+              listProductsInProductSetSettings);
     }
 
     // NEXT_MAJOR_VER: remove 'throws Exception'
@@ -999,6 +1014,34 @@ public Builder applyToAllUnaryMethods(
       return unaryMethodSettingsBuilders;
     }
 
+    /** Returns the builder for the settings used for calls to importProductSets. */
+    public UnaryCallSettings.Builder
+        importProductSetsSettings() {
+      return importProductSetsSettings;
+    }
+
+    /** Returns the builder for the settings used for calls to importProductSets. */
+    @BetaApi(
+        "The surface for use by generated code is not stable yet and may change in the future.")
+    public OperationCallSettings.Builder<
+            ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata>
+        importProductSetsOperationSettings() {
+      return importProductSetsOperationSettings;
+    }
+
+    /** Returns the builder for the settings used for calls to purgeProducts. */
+    public UnaryCallSettings.Builder purgeProductsSettings() {
+      return purgeProductsSettings;
+    }
+
+    /** Returns the builder for the settings used for calls to purgeProducts. */
+    @BetaApi(
+        "The surface for use by generated code is not stable yet and may change in the future.")
+    public OperationCallSettings.Builder
+        purgeProductsOperationSettings() {
+      return purgeProductsOperationSettings;
+    }
+
     /** Returns the builder for the settings used for calls to createProductSet. */
     public UnaryCallSettings.Builder
         createProductSetSettings() {
@@ -1103,34 +1146,6 @@ public UnaryCallSettings.Builder deleteProductSetti
       return listProductsInProductSetSettings;
     }
 
-    /** Returns the builder for the settings used for calls to importProductSets. */
-    public UnaryCallSettings.Builder
-        importProductSetsSettings() {
-      return importProductSetsSettings;
-    }
-
-    /** Returns the builder for the settings used for calls to importProductSets. */
-    @BetaApi(
-        "The surface for use by generated code is not stable yet and may change in the future.")
-    public OperationCallSettings.Builder<
-            ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata>
-        importProductSetsOperationSettings() {
-      return importProductSetsOperationSettings;
-    }
-
-    /** Returns the builder for the settings used for calls to purgeProducts. */
-    public UnaryCallSettings.Builder purgeProductsSettings() {
-      return purgeProductsSettings;
-    }
-
-    /** Returns the builder for the settings used for calls to purgeProducts. */
-    @BetaApi(
-        "The surface for use by generated code is not stable yet and may change in the future.")
-    public OperationCallSettings.Builder
-        purgeProductsOperationSettings() {
-      return purgeProductsOperationSettings;
-    }
-
     @Override
     public ProductSearchStubSettings build() throws IOException {
       return new ProductSearchStubSettings(this);
diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p1beta1/stub/ImageAnnotatorStubSettings.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p1beta1/stub/ImageAnnotatorStubSettings.java
index dc6a8e56d..fbe8d6cbc 100644
--- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p1beta1/stub/ImageAnnotatorStubSettings.java
+++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p1beta1/stub/ImageAnnotatorStubSettings.java
@@ -177,11 +177,11 @@ public static class Builder extends StubSettings.Builder> definitions =
           ImmutableMap.builder();
       definitions.put(
-          "idempotent",
+          "retry_policy_1_codes",
           ImmutableSet.copyOf(
               Lists.newArrayList(
-                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
+                  StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED)));
+      definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -195,12 +195,14 @@ public static class Builder extends StubSettings.BuilderSample code:
-   *
-   * 

-   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
-   *   List<AnnotateImageRequest> requests = new ArrayList<>();
-   *   BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
-   * }
-   * 
- * - * @param requests Required. Individual image annotation requests for this batch. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final BatchAnnotateImagesResponse batchAnnotateImages( - List requests) { - BatchAnnotateImagesRequest request = - BatchAnnotateImagesRequest.newBuilder().addAllRequests(requests).build(); - return batchAnnotateImages(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Run image detection and annotation for a batch of images. - * - *

Sample code: - * - *


-   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
-   *   List<AnnotateImageRequest> requests = new ArrayList<>();
-   *   BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
-   *     .addAllRequests(requests)
-   *     .build();
-   *   BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(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 - */ - public final BatchAnnotateImagesResponse batchAnnotateImages(BatchAnnotateImagesRequest request) { - return batchAnnotateImagesCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Run image detection and annotation for a batch of images. - * - *

Sample code: - * - *


-   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
-   *   List<AnnotateImageRequest> requests = new ArrayList<>();
-   *   BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
-   *     .addAllRequests(requests)
-   *     .build();
-   *   ApiFuture<BatchAnnotateImagesResponse> future = imageAnnotatorClient.batchAnnotateImagesCallable().futureCall(request);
-   *   // Do something
-   *   BatchAnnotateImagesResponse response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable - batchAnnotateImagesCallable() { - return stub.batchAnnotateImagesCallable(); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Run async image detection and annotation for a list of generic files (e.g. PDF) which may @@ -348,6 +279,75 @@ public final BatchAnnotateImagesResponse batchAnnotateImages(BatchAnnotateImages return stub.asyncBatchAnnotateFilesCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run image detection and annotation for a batch of images. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateImageRequest> requests = new ArrayList<>();
+   *   BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
+   * }
+   * 
+ * + * @param requests Required. Individual image annotation requests for this batch. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BatchAnnotateImagesResponse batchAnnotateImages( + List requests) { + BatchAnnotateImagesRequest request = + BatchAnnotateImagesRequest.newBuilder().addAllRequests(requests).build(); + return batchAnnotateImages(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run image detection and annotation for a batch of images. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateImageRequest> requests = new ArrayList<>();
+   *   BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(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 + */ + public final BatchAnnotateImagesResponse batchAnnotateImages(BatchAnnotateImagesRequest request) { + return batchAnnotateImagesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run image detection and annotation for a batch of images. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateImageRequest> requests = new ArrayList<>();
+   *   BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   ApiFuture<BatchAnnotateImagesResponse> future = imageAnnotatorClient.batchAnnotateImagesCallable().futureCall(request);
+   *   // Do something
+   *   BatchAnnotateImagesResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + batchAnnotateImagesCallable() { + return stub.batchAnnotateImagesCallable(); + } + @Override public final void close() { stub.close(); diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p2beta1/ImageAnnotatorSettings.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p2beta1/ImageAnnotatorSettings.java index 097df0206..086262bf6 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p2beta1/ImageAnnotatorSettings.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p2beta1/ImageAnnotatorSettings.java @@ -66,12 +66,6 @@ @Generated("by gapic-generator") @BetaApi public class ImageAnnotatorSettings extends ClientSettings { - /** Returns the object with the settings used for calls to batchAnnotateImages. */ - public UnaryCallSettings - batchAnnotateImagesSettings() { - return ((ImageAnnotatorStubSettings) getStubSettings()).batchAnnotateImagesSettings(); - } - /** Returns the object with the settings used for calls to asyncBatchAnnotateFiles. */ public UnaryCallSettings asyncBatchAnnotateFilesSettings() { @@ -88,6 +82,12 @@ public class ImageAnnotatorSettings extends ClientSettings + batchAnnotateImagesSettings() { + return ((ImageAnnotatorStubSettings) getStubSettings()).batchAnnotateImagesSettings(); + } + public static final ImageAnnotatorSettings create(ImageAnnotatorStubSettings stub) throws IOException { return new ImageAnnotatorSettings.Builder(stub.toBuilder()).build(); @@ -185,12 +185,6 @@ public Builder applyToAllUnaryMethods( return this; } - /** Returns the builder for the settings used for calls to batchAnnotateImages. */ - public UnaryCallSettings.Builder - batchAnnotateImagesSettings() { - return getStubSettingsBuilder().batchAnnotateImagesSettings(); - } - /** Returns the builder for the settings used for calls to asyncBatchAnnotateFiles. */ public UnaryCallSettings.Builder asyncBatchAnnotateFilesSettings() { @@ -206,6 +200,12 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().asyncBatchAnnotateFilesOperationSettings(); } + /** Returns the builder for the settings used for calls to batchAnnotateImages. */ + public UnaryCallSettings.Builder + batchAnnotateImagesSettings() { + return getStubSettingsBuilder().batchAnnotateImagesSettings(); + } + @Override public ImageAnnotatorSettings build() throws IOException { return new ImageAnnotatorSettings(this); diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p2beta1/stub/GrpcImageAnnotatorStub.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p2beta1/stub/GrpcImageAnnotatorStub.java index 75fde1c8a..aedad09c4 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p2beta1/stub/GrpcImageAnnotatorStub.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p2beta1/stub/GrpcImageAnnotatorStub.java @@ -46,16 +46,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class GrpcImageAnnotatorStub extends ImageAnnotatorStub { - private static final MethodDescriptor - batchAnnotateImagesMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.vision.v1p2beta1.ImageAnnotator/BatchAnnotateImages") - .setRequestMarshaller( - ProtoUtils.marshaller(BatchAnnotateImagesRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(BatchAnnotateImagesResponse.getDefaultInstance())) - .build(); private static final MethodDescriptor asyncBatchAnnotateFilesMethodDescriptor = MethodDescriptor.newBuilder() @@ -66,17 +56,27 @@ public class GrpcImageAnnotatorStub extends ImageAnnotatorStub { ProtoUtils.marshaller(AsyncBatchAnnotateFilesRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + batchAnnotateImagesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p2beta1.ImageAnnotator/BatchAnnotateImages") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchAnnotateImagesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(BatchAnnotateImagesResponse.getDefaultInstance())) + .build(); private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; - private final UnaryCallable - batchAnnotateImagesCallable; private final UnaryCallable asyncBatchAnnotateFilesCallable; private final OperationCallable< AsyncBatchAnnotateFilesRequest, AsyncBatchAnnotateFilesResponse, OperationMetadata> asyncBatchAnnotateFilesOperationCallable; + private final UnaryCallable + batchAnnotateImagesCallable; private final GrpcStubCallableFactory callableFactory; @@ -120,22 +120,17 @@ protected GrpcImageAnnotatorStub( this.callableFactory = callableFactory; this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - GrpcCallSettings - batchAnnotateImagesTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(batchAnnotateImagesMethodDescriptor) - .build(); GrpcCallSettings asyncBatchAnnotateFilesTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(asyncBatchAnnotateFilesMethodDescriptor) .build(); + GrpcCallSettings + batchAnnotateImagesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchAnnotateImagesMethodDescriptor) + .build(); - this.batchAnnotateImagesCallable = - callableFactory.createUnaryCallable( - batchAnnotateImagesTransportSettings, - settings.batchAnnotateImagesSettings(), - clientContext); this.asyncBatchAnnotateFilesCallable = callableFactory.createUnaryCallable( asyncBatchAnnotateFilesTransportSettings, @@ -147,6 +142,11 @@ protected GrpcImageAnnotatorStub( settings.asyncBatchAnnotateFilesOperationSettings(), clientContext, this.operationsStub); + this.batchAnnotateImagesCallable = + callableFactory.createUnaryCallable( + batchAnnotateImagesTransportSettings, + settings.batchAnnotateImagesSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -156,11 +156,6 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } - public UnaryCallable - batchAnnotateImagesCallable() { - return batchAnnotateImagesCallable; - } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable< AsyncBatchAnnotateFilesRequest, AsyncBatchAnnotateFilesResponse, OperationMetadata> @@ -173,6 +168,11 @@ public GrpcOperationsStub getOperationsStub() { return asyncBatchAnnotateFilesCallable; } + public UnaryCallable + batchAnnotateImagesCallable() { + return batchAnnotateImagesCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p2beta1/stub/ImageAnnotatorStub.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p2beta1/stub/ImageAnnotatorStub.java index f034243db..81a5a05de 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p2beta1/stub/ImageAnnotatorStub.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p2beta1/stub/ImageAnnotatorStub.java @@ -43,11 +43,6 @@ public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } - public UnaryCallable - batchAnnotateImagesCallable() { - throw new UnsupportedOperationException("Not implemented: batchAnnotateImagesCallable()"); - } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable< AsyncBatchAnnotateFilesRequest, AsyncBatchAnnotateFilesResponse, OperationMetadata> @@ -61,6 +56,11 @@ public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: asyncBatchAnnotateFilesCallable()"); } + public UnaryCallable + batchAnnotateImagesCallable() { + throw new UnsupportedOperationException("Not implemented: batchAnnotateImagesCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p2beta1/stub/ImageAnnotatorStubSettings.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p2beta1/stub/ImageAnnotatorStubSettings.java index 9078af7c4..ec36d7ffd 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p2beta1/stub/ImageAnnotatorStubSettings.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p2beta1/stub/ImageAnnotatorStubSettings.java @@ -90,19 +90,13 @@ public class ImageAnnotatorStubSettings extends StubSettings - batchAnnotateImagesSettings; private final UnaryCallSettings asyncBatchAnnotateFilesSettings; private final OperationCallSettings< AsyncBatchAnnotateFilesRequest, AsyncBatchAnnotateFilesResponse, OperationMetadata> asyncBatchAnnotateFilesOperationSettings; - - /** Returns the object with the settings used for calls to batchAnnotateImages. */ - public UnaryCallSettings - batchAnnotateImagesSettings() { - return batchAnnotateImagesSettings; - } + private final UnaryCallSettings + batchAnnotateImagesSettings; /** Returns the object with the settings used for calls to asyncBatchAnnotateFiles. */ public UnaryCallSettings @@ -118,6 +112,12 @@ public class ImageAnnotatorStubSettings extends StubSettings + batchAnnotateImagesSettings() { + return batchAnnotateImagesSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public ImageAnnotatorStub createStub() throws IOException { if (getTransportChannelProvider() @@ -187,23 +187,23 @@ public Builder toBuilder() { protected ImageAnnotatorStubSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder); - batchAnnotateImagesSettings = settingsBuilder.batchAnnotateImagesSettings().build(); asyncBatchAnnotateFilesSettings = settingsBuilder.asyncBatchAnnotateFilesSettings().build(); asyncBatchAnnotateFilesOperationSettings = settingsBuilder.asyncBatchAnnotateFilesOperationSettings().build(); + batchAnnotateImagesSettings = settingsBuilder.batchAnnotateImagesSettings().build(); } /** Builder for ImageAnnotatorStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder - batchAnnotateImagesSettings; private final UnaryCallSettings.Builder asyncBatchAnnotateFilesSettings; private final OperationCallSettings.Builder< AsyncBatchAnnotateFilesRequest, AsyncBatchAnnotateFilesResponse, OperationMetadata> asyncBatchAnnotateFilesOperationSettings; + private final UnaryCallSettings.Builder + batchAnnotateImagesSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -212,11 +212,11 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "idempotent", + "retry_policy_1_codes", ImmutableSet.copyOf( Lists.newArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -230,12 +230,14 @@ public static class Builder extends StubSettings.Builder>of( - batchAnnotateImagesSettings, asyncBatchAnnotateFilesSettings); + asyncBatchAnnotateFilesSettings, batchAnnotateImagesSettings); initDefaults(this); } @@ -271,21 +273,21 @@ private static Builder createDefault() { private static Builder initDefaults(Builder builder) { builder - .batchAnnotateImagesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .asyncBatchAnnotateFilesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder - .asyncBatchAnnotateFilesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .batchAnnotateImagesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .asyncBatchAnnotateFilesOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create( @@ -310,14 +312,14 @@ private static Builder initDefaults(Builder builder) { protected Builder(ImageAnnotatorStubSettings settings) { super(settings); - batchAnnotateImagesSettings = settings.batchAnnotateImagesSettings.toBuilder(); asyncBatchAnnotateFilesSettings = settings.asyncBatchAnnotateFilesSettings.toBuilder(); asyncBatchAnnotateFilesOperationSettings = settings.asyncBatchAnnotateFilesOperationSettings.toBuilder(); + batchAnnotateImagesSettings = settings.batchAnnotateImagesSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( - batchAnnotateImagesSettings, asyncBatchAnnotateFilesSettings); + asyncBatchAnnotateFilesSettings, batchAnnotateImagesSettings); } // NEXT_MAJOR_VER: remove 'throws Exception' @@ -336,12 +338,6 @@ public Builder applyToAllUnaryMethods( return unaryMethodSettingsBuilders; } - /** Returns the builder for the settings used for calls to batchAnnotateImages. */ - public UnaryCallSettings.Builder - batchAnnotateImagesSettings() { - return batchAnnotateImagesSettings; - } - /** Returns the builder for the settings used for calls to asyncBatchAnnotateFiles. */ public UnaryCallSettings.Builder asyncBatchAnnotateFilesSettings() { @@ -357,6 +353,12 @@ public Builder applyToAllUnaryMethods( return asyncBatchAnnotateFilesOperationSettings; } + /** Returns the builder for the settings used for calls to batchAnnotateImages. */ + public UnaryCallSettings.Builder + batchAnnotateImagesSettings() { + return batchAnnotateImagesSettings; + } + @Override public ImageAnnotatorStubSettings build() throws IOException { return new ImageAnnotatorStubSettings(this); diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchClient.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchClient.java index bd4012d28..5e4e86044 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchClient.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchClient.java @@ -63,8 +63,10 @@ *
  * 
  * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
- *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
- *   productSearchClient.deleteProductSet(name);
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   ProductSet productSet = ProductSet.newBuilder().build();
+ *   String productSetId = "";
+ *   ProductSet response = productSearchClient.createProductSet(parent, productSet, productSetId);
  * }
  * 
  * 
@@ -186,377 +188,6 @@ public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a ProductSet. All Products and ReferenceImages in the ProductSet will be - * deleted. - * - *

The actual image files are not deleted from Google Cloud Storage. - * - *

Possible errors: - * - *

* Returns NOT_FOUND if the ProductSet does not exist. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-   *   productSearchClient.deleteProductSet(name);
-   * }
-   * 
- * - * @param name Required. Resource name of the ProductSet to delete. - *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteProductSet(ProductSetName name) { - DeleteProductSetRequest request = - DeleteProductSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteProductSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a ProductSet. All Products and ReferenceImages in the ProductSet will be - * deleted. - * - *

The actual image files are not deleted from Google Cloud Storage. - * - *

Possible errors: - * - *

* Returns NOT_FOUND if the ProductSet does not exist. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-   *   productSearchClient.deleteProductSet(name.toString());
-   * }
-   * 
- * - * @param name Required. Resource name of the ProductSet to delete. - *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteProductSet(String name) { - DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder().setName(name).build(); - deleteProductSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a ProductSet. All Products and ReferenceImages in the ProductSet will be - * deleted. - * - *

The actual image files are not deleted from Google Cloud Storage. - * - *

Possible errors: - * - *

* Returns NOT_FOUND if the ProductSet does not exist. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-   *   DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   productSearchClient.deleteProductSet(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 - */ - public final void deleteProductSet(DeleteProductSetRequest request) { - deleteProductSetCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a ProductSet. All Products and ReferenceImages in the ProductSet will be - * deleted. - * - *

The actual image files are not deleted from Google Cloud Storage. - * - *

Possible errors: - * - *

* Returns NOT_FOUND if the ProductSet does not exist. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-   *   DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = productSearchClient.deleteProductSetCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable deleteProductSetCallable() { - return stub.deleteProductSetCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a product and its reference images. - * - *

Metadata of the product and all its images will be deleted right away, but search queries - * against ProductSets containing the product may still work until all related caches are - * refreshed. - * - *

Possible errors: - * - *

* Returns NOT_FOUND if the product does not exist. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
-   *   productSearchClient.deleteProduct(name);
-   * }
-   * 
- * - * @param name Required. Resource name of product to delete. - *

Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteProduct(ProductName name) { - DeleteProductRequest request = - DeleteProductRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteProduct(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a product and its reference images. - * - *

Metadata of the product and all its images will be deleted right away, but search queries - * against ProductSets containing the product may still work until all related caches are - * refreshed. - * - *

Possible errors: - * - *

* Returns NOT_FOUND if the product does not exist. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
-   *   productSearchClient.deleteProduct(name.toString());
-   * }
-   * 
- * - * @param name Required. Resource name of product to delete. - *

Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteProduct(String name) { - DeleteProductRequest request = DeleteProductRequest.newBuilder().setName(name).build(); - deleteProduct(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a product and its reference images. - * - *

Metadata of the product and all its images will be deleted right away, but search queries - * against ProductSets containing the product may still work until all related caches are - * refreshed. - * - *

Possible errors: - * - *

* Returns NOT_FOUND if the product does not exist. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
-   *   DeleteProductRequest request = DeleteProductRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   productSearchClient.deleteProduct(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 - */ - public final void deleteProduct(DeleteProductRequest request) { - deleteProductCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a product and its reference images. - * - *

Metadata of the product and all its images will be deleted right away, but search queries - * against ProductSets containing the product may still work until all related caches are - * refreshed. - * - *

Possible errors: - * - *

* Returns NOT_FOUND if the product does not exist. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
-   *   DeleteProductRequest request = DeleteProductRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = productSearchClient.deleteProductCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable deleteProductCallable() { - return stub.deleteProductCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a reference image. - * - *

The image metadata will be deleted right away, but search queries against ProductSets - * containing the image may still work until all related caches are refreshed. - * - *

The actual image files are not deleted from Google Cloud Storage. - * - *

Possible errors: - * - *

* Returns NOT_FOUND if the reference image does not exist. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
-   *   productSearchClient.deleteReferenceImage(name);
-   * }
-   * 
- * - * @param name Required. The resource name of the reference image to delete. - *

Format is: - *

`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteReferenceImage(ReferenceImageName name) { - DeleteReferenceImageRequest request = - DeleteReferenceImageRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - deleteReferenceImage(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a reference image. - * - *

The image metadata will be deleted right away, but search queries against ProductSets - * containing the image may still work until all related caches are refreshed. - * - *

The actual image files are not deleted from Google Cloud Storage. - * - *

Possible errors: - * - *

* Returns NOT_FOUND if the reference image does not exist. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
-   *   productSearchClient.deleteReferenceImage(name.toString());
-   * }
-   * 
- * - * @param name Required. The resource name of the reference image to delete. - *

Format is: - *

`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteReferenceImage(String name) { - DeleteReferenceImageRequest request = - DeleteReferenceImageRequest.newBuilder().setName(name).build(); - deleteReferenceImage(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a reference image. - * - *

The image metadata will be deleted right away, but search queries against ProductSets - * containing the image may still work until all related caches are refreshed. - * - *

The actual image files are not deleted from Google Cloud Storage. - * - *

Possible errors: - * - *

* Returns NOT_FOUND if the reference image does not exist. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
-   *   DeleteReferenceImageRequest request = DeleteReferenceImageRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   productSearchClient.deleteReferenceImage(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 - */ - public final void deleteReferenceImage(DeleteReferenceImageRequest request) { - deleteReferenceImageCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a reference image. - * - *

The image metadata will be deleted right away, but search queries against ProductSets - * containing the image may still work until all related caches are refreshed. - * - *

The actual image files are not deleted from Google Cloud Storage. - * - *

Possible errors: - * - *

* Returns NOT_FOUND if the reference image does not exist. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
-   *   DeleteReferenceImageRequest request = DeleteReferenceImageRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = productSearchClient.deleteReferenceImageCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable deleteReferenceImageCallable() { - return stub.deleteReferenceImageCallable(); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Asynchronous API that imports a list of reference images to specified product sets based on a @@ -1235,6 +866,124 @@ public final UnaryCallable updateProductSet return stub.updateProductSetCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a ProductSet. All Products and ReferenceImages in the ProductSet will be + * deleted. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   productSearchClient.deleteProductSet(name);
+   * }
+   * 
+ * + * @param name Required. Resource name of the ProductSet to delete. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteProductSet(ProductSetName name) { + DeleteProductSetRequest request = + DeleteProductSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a ProductSet. All Products and ReferenceImages in the ProductSet will be + * deleted. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   productSearchClient.deleteProductSet(name.toString());
+   * }
+   * 
+ * + * @param name Required. Resource name of the ProductSet to delete. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteProductSet(String name) { + DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder().setName(name).build(); + deleteProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a ProductSet. All Products and ReferenceImages in the ProductSet will be + * deleted. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   productSearchClient.deleteProductSet(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 + */ + public final void deleteProductSet(DeleteProductSetRequest request) { + deleteProductSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a ProductSet. All Products and ReferenceImages in the ProductSet will be + * deleted. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = productSearchClient.deleteProductSetCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteProductSetCallable() { + return stub.deleteProductSetCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Creates and returns a new product resource. @@ -1742,6 +1491,128 @@ public final UnaryCallable updateProductCallable( return stub.updateProductCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a product and its reference images. + * + *

Metadata of the product and all its images will be deleted right away, but search queries + * against ProductSets containing the product may still work until all related caches are + * refreshed. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the product does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   productSearchClient.deleteProduct(name);
+   * }
+   * 
+ * + * @param name Required. Resource name of product to delete. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteProduct(ProductName name) { + DeleteProductRequest request = + DeleteProductRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a product and its reference images. + * + *

Metadata of the product and all its images will be deleted right away, but search queries + * against ProductSets containing the product may still work until all related caches are + * refreshed. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the product does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   productSearchClient.deleteProduct(name.toString());
+   * }
+   * 
+ * + * @param name Required. Resource name of product to delete. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteProduct(String name) { + DeleteProductRequest request = DeleteProductRequest.newBuilder().setName(name).build(); + deleteProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a product and its reference images. + * + *

Metadata of the product and all its images will be deleted right away, but search queries + * against ProductSets containing the product may still work until all related caches are + * refreshed. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the product does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   DeleteProductRequest request = DeleteProductRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   productSearchClient.deleteProduct(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 + */ + public final void deleteProduct(DeleteProductRequest request) { + deleteProductCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a product and its reference images. + * + *

Metadata of the product and all its images will be deleted right away, but search queries + * against ProductSets containing the product may still work until all related caches are + * refreshed. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the product does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   DeleteProductRequest request = DeleteProductRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = productSearchClient.deleteProductCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteProductCallable() { + return stub.deleteProductCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Creates and returns a new ReferenceImage resource. @@ -1928,6 +1799,137 @@ public final ReferenceImage createReferenceImage(CreateReferenceImageRequest req return stub.createReferenceImageCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a reference image. + * + *

The image metadata will be deleted right away, but search queries against ProductSets + * containing the image may still work until all related caches are refreshed. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the reference image does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+   *   productSearchClient.deleteReferenceImage(name);
+   * }
+   * 
+ * + * @param name Required. The resource name of the reference image to delete. + *

Format is: + *

`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteReferenceImage(ReferenceImageName name) { + DeleteReferenceImageRequest request = + DeleteReferenceImageRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteReferenceImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a reference image. + * + *

The image metadata will be deleted right away, but search queries against ProductSets + * containing the image may still work until all related caches are refreshed. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the reference image does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+   *   productSearchClient.deleteReferenceImage(name.toString());
+   * }
+   * 
+ * + * @param name Required. The resource name of the reference image to delete. + *

Format is: + *

`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteReferenceImage(String name) { + DeleteReferenceImageRequest request = + DeleteReferenceImageRequest.newBuilder().setName(name).build(); + deleteReferenceImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a reference image. + * + *

The image metadata will be deleted right away, but search queries against ProductSets + * containing the image may still work until all related caches are refreshed. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the reference image does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+   *   DeleteReferenceImageRequest request = DeleteReferenceImageRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   productSearchClient.deleteReferenceImage(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 + */ + public final void deleteReferenceImage(DeleteReferenceImageRequest request) { + deleteReferenceImageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a reference image. + * + *

The image metadata will be deleted right away, but search queries against ProductSets + * containing the image may still work until all related caches are refreshed. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the reference image does not exist. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+   *   DeleteReferenceImageRequest request = DeleteReferenceImageRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = productSearchClient.deleteReferenceImageCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteReferenceImageCallable() { + return stub.deleteReferenceImageCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists reference images. diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchSettings.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchSettings.java index d55edf83e..c85306795 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchSettings.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchSettings.java @@ -54,16 +54,16 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of deleteProductSet to 30 seconds: + *

For example, to set the total timeout of createProductSet to 30 seconds: * *

  * 
  * ProductSearchSettings.Builder productSearchSettingsBuilder =
  *     ProductSearchSettings.newBuilder();
  * productSearchSettingsBuilder
- *     .deleteProductSetSettings()
+ *     .createProductSetSettings()
  *     .setRetrySettings(
- *         productSearchSettingsBuilder.deleteProductSetSettings().getRetrySettings().toBuilder()
+ *         productSearchSettingsBuilder.createProductSetSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * ProductSearchSettings productSearchSettings = productSearchSettingsBuilder.build();
@@ -73,21 +73,6 @@
 @Generated("by gapic-generator")
 @BetaApi
 public class ProductSearchSettings extends ClientSettings {
-  /** Returns the object with the settings used for calls to deleteProductSet. */
-  public UnaryCallSettings deleteProductSetSettings() {
-    return ((ProductSearchStubSettings) getStubSettings()).deleteProductSetSettings();
-  }
-
-  /** Returns the object with the settings used for calls to deleteProduct. */
-  public UnaryCallSettings deleteProductSettings() {
-    return ((ProductSearchStubSettings) getStubSettings()).deleteProductSettings();
-  }
-
-  /** Returns the object with the settings used for calls to deleteReferenceImage. */
-  public UnaryCallSettings deleteReferenceImageSettings() {
-    return ((ProductSearchStubSettings) getStubSettings()).deleteReferenceImageSettings();
-  }
-
   /** Returns the object with the settings used for calls to importProductSets. */
   public UnaryCallSettings importProductSetsSettings() {
     return ((ProductSearchStubSettings) getStubSettings()).importProductSetsSettings();
@@ -124,6 +109,11 @@ public UnaryCallSettings updateProductSetSe
     return ((ProductSearchStubSettings) getStubSettings()).updateProductSetSettings();
   }
 
+  /** Returns the object with the settings used for calls to deleteProductSet. */
+  public UnaryCallSettings deleteProductSetSettings() {
+    return ((ProductSearchStubSettings) getStubSettings()).deleteProductSetSettings();
+  }
+
   /** Returns the object with the settings used for calls to createProduct. */
   public UnaryCallSettings createProductSettings() {
     return ((ProductSearchStubSettings) getStubSettings()).createProductSettings();
@@ -145,12 +135,22 @@ public UnaryCallSettings updateProductSettings()
     return ((ProductSearchStubSettings) getStubSettings()).updateProductSettings();
   }
 
+  /** Returns the object with the settings used for calls to deleteProduct. */
+  public UnaryCallSettings deleteProductSettings() {
+    return ((ProductSearchStubSettings) getStubSettings()).deleteProductSettings();
+  }
+
   /** Returns the object with the settings used for calls to createReferenceImage. */
   public UnaryCallSettings
       createReferenceImageSettings() {
     return ((ProductSearchStubSettings) getStubSettings()).createReferenceImageSettings();
   }
 
+  /** Returns the object with the settings used for calls to deleteReferenceImage. */
+  public UnaryCallSettings deleteReferenceImageSettings() {
+    return ((ProductSearchStubSettings) getStubSettings()).deleteReferenceImageSettings();
+  }
+
   /** Returns the object with the settings used for calls to listReferenceImages. */
   public PagedCallSettings<
           ListReferenceImagesRequest, ListReferenceImagesResponse, ListReferenceImagesPagedResponse>
@@ -280,22 +280,6 @@ public Builder applyToAllUnaryMethods(
       return this;
     }
 
-    /** Returns the builder for the settings used for calls to deleteProductSet. */
-    public UnaryCallSettings.Builder deleteProductSetSettings() {
-      return getStubSettingsBuilder().deleteProductSetSettings();
-    }
-
-    /** Returns the builder for the settings used for calls to deleteProduct. */
-    public UnaryCallSettings.Builder deleteProductSettings() {
-      return getStubSettingsBuilder().deleteProductSettings();
-    }
-
-    /** Returns the builder for the settings used for calls to deleteReferenceImage. */
-    public UnaryCallSettings.Builder
-        deleteReferenceImageSettings() {
-      return getStubSettingsBuilder().deleteReferenceImageSettings();
-    }
-
     /** Returns the builder for the settings used for calls to importProductSets. */
     public UnaryCallSettings.Builder
         importProductSetsSettings() {
@@ -335,6 +319,11 @@ public UnaryCallSettings.Builder getProductSet
       return getStubSettingsBuilder().updateProductSetSettings();
     }
 
+    /** Returns the builder for the settings used for calls to deleteProductSet. */
+    public UnaryCallSettings.Builder deleteProductSetSettings() {
+      return getStubSettingsBuilder().deleteProductSetSettings();
+    }
+
     /** Returns the builder for the settings used for calls to createProduct. */
     public UnaryCallSettings.Builder createProductSettings() {
       return getStubSettingsBuilder().createProductSettings();
@@ -357,12 +346,23 @@ public UnaryCallSettings.Builder updateProductSet
       return getStubSettingsBuilder().updateProductSettings();
     }
 
+    /** Returns the builder for the settings used for calls to deleteProduct. */
+    public UnaryCallSettings.Builder deleteProductSettings() {
+      return getStubSettingsBuilder().deleteProductSettings();
+    }
+
     /** Returns the builder for the settings used for calls to createReferenceImage. */
     public UnaryCallSettings.Builder
         createReferenceImageSettings() {
       return getStubSettingsBuilder().createReferenceImageSettings();
     }
 
+    /** Returns the builder for the settings used for calls to deleteReferenceImage. */
+    public UnaryCallSettings.Builder
+        deleteReferenceImageSettings() {
+      return getStubSettingsBuilder().deleteReferenceImageSettings();
+    }
+
     /** Returns the builder for the settings used for calls to listReferenceImages. */
     public PagedCallSettings.Builder<
             ListReferenceImagesRequest,
diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/package-info.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/package-info.java
index bc47e5138..53bd9cd61 100644
--- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/package-info.java
+++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/package-info.java
@@ -42,8 +42,10 @@
  * 
  * 
  * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
- *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
- *   productSearchClient.deleteProductSet(name);
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   ProductSet productSet = ProductSet.newBuilder().build();
+ *   String productSetId = "";
+ *   ProductSet response = productSearchClient.createProductSet(parent, productSet, productSetId);
  * }
  * 
  * 
diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcProductSearchStub.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcProductSearchStub.java index 9831122e8..7ef1f8bf7 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcProductSearchStub.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/GrpcProductSearchStub.java @@ -77,31 +77,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class GrpcProductSearchStub extends ProductSearchStub { - private static final MethodDescriptor - deleteProductSetMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/DeleteProductSet") - .setRequestMarshaller( - ProtoUtils.marshaller(DeleteProductSetRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - private static final MethodDescriptor deleteProductMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/DeleteProduct") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteProductRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - private static final MethodDescriptor - deleteReferenceImageMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/DeleteReferenceImage") - .setRequestMarshaller( - ProtoUtils.marshaller(DeleteReferenceImageRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); private static final MethodDescriptor importProductSetsMethodDescriptor = MethodDescriptor.newBuilder() @@ -148,6 +123,15 @@ public class GrpcProductSearchStub extends ProductSearchStub { ProtoUtils.marshaller(UpdateProductSetRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ProductSet.getDefaultInstance())) .build(); + private static final MethodDescriptor + deleteProductSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/DeleteProductSet") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); private static final MethodDescriptor createProductMethodDescriptor = MethodDescriptor.newBuilder() @@ -182,6 +166,13 @@ public class GrpcProductSearchStub extends ProductSearchStub { ProtoUtils.marshaller(UpdateProductRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Product.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteProductMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/DeleteProduct") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteProductRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); private static final MethodDescriptor createReferenceImageMethodDescriptor = MethodDescriptor.newBuilder() @@ -191,6 +182,15 @@ public class GrpcProductSearchStub extends ProductSearchStub { ProtoUtils.marshaller(CreateReferenceImageRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ReferenceImage.getDefaultInstance())) .build(); + private static final MethodDescriptor + deleteReferenceImageMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p3beta1.ProductSearch/DeleteReferenceImage") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteReferenceImageRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); private static final MethodDescriptor listReferenceImagesMethodDescriptor = MethodDescriptor.newBuilder() @@ -247,9 +247,6 @@ public class GrpcProductSearchStub extends ProductSearchStub { private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; - private final UnaryCallable deleteProductSetCallable; - private final UnaryCallable deleteProductCallable; - private final UnaryCallable deleteReferenceImageCallable; private final UnaryCallable importProductSetsCallable; private final OperationCallable< ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> @@ -261,14 +258,17 @@ public class GrpcProductSearchStub extends ProductSearchStub { listProductSetsPagedCallable; private final UnaryCallable getProductSetCallable; private final UnaryCallable updateProductSetCallable; + private final UnaryCallable deleteProductSetCallable; private final UnaryCallable createProductCallable; private final UnaryCallable listProductsCallable; private final UnaryCallable listProductsPagedCallable; private final UnaryCallable getProductCallable; private final UnaryCallable updateProductCallable; + private final UnaryCallable deleteProductCallable; private final UnaryCallable createReferenceImageCallable; + private final UnaryCallable deleteReferenceImageCallable; private final UnaryCallable listReferenceImagesCallable; private final UnaryCallable @@ -323,45 +323,6 @@ protected GrpcProductSearchStub( this.callableFactory = callableFactory; this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - GrpcCallSettings deleteProductSetTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteProductSetMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteProductSetRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings deleteProductTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteProductMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteProductRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings deleteReferenceImageTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteReferenceImageMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteReferenceImageRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); GrpcCallSettings importProductSetsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(importProductSetsMethodDescriptor) @@ -429,6 +390,19 @@ public Map extract(UpdateProductSetRequest request) { } }) .build(); + GrpcCallSettings deleteProductSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteProductSetMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteProductSetRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); GrpcCallSettings createProductTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createProductMethodDescriptor) @@ -481,6 +455,19 @@ public Map extract(UpdateProductRequest request) { } }) .build(); + GrpcCallSettings deleteProductTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteProductMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteProductRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); GrpcCallSettings createReferenceImageTransportSettings = GrpcCallSettings.newBuilder() @@ -495,6 +482,19 @@ public Map extract(CreateReferenceImageRequest request) { } }) .build(); + GrpcCallSettings deleteReferenceImageTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteReferenceImageMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteReferenceImageRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); GrpcCallSettings listReferenceImagesTransportSettings = GrpcCallSettings.newBuilder() @@ -566,17 +566,6 @@ public Map extract(ListProductsInProductSetRequest request) { }) .build(); - this.deleteProductSetCallable = - callableFactory.createUnaryCallable( - deleteProductSetTransportSettings, settings.deleteProductSetSettings(), clientContext); - this.deleteProductCallable = - callableFactory.createUnaryCallable( - deleteProductTransportSettings, settings.deleteProductSettings(), clientContext); - this.deleteReferenceImageCallable = - callableFactory.createUnaryCallable( - deleteReferenceImageTransportSettings, - settings.deleteReferenceImageSettings(), - clientContext); this.importProductSetsCallable = callableFactory.createUnaryCallable( importProductSetsTransportSettings, @@ -603,6 +592,9 @@ public Map extract(ListProductsInProductSetRequest request) { this.updateProductSetCallable = callableFactory.createUnaryCallable( updateProductSetTransportSettings, settings.updateProductSetSettings(), clientContext); + this.deleteProductSetCallable = + callableFactory.createUnaryCallable( + deleteProductSetTransportSettings, settings.deleteProductSetSettings(), clientContext); this.createProductCallable = callableFactory.createUnaryCallable( createProductTransportSettings, settings.createProductSettings(), clientContext); @@ -618,11 +610,19 @@ public Map extract(ListProductsInProductSetRequest request) { this.updateProductCallable = callableFactory.createUnaryCallable( updateProductTransportSettings, settings.updateProductSettings(), clientContext); + this.deleteProductCallable = + callableFactory.createUnaryCallable( + deleteProductTransportSettings, settings.deleteProductSettings(), clientContext); this.createReferenceImageCallable = callableFactory.createUnaryCallable( createReferenceImageTransportSettings, settings.createReferenceImageSettings(), clientContext); + this.deleteReferenceImageCallable = + callableFactory.createUnaryCallable( + deleteReferenceImageTransportSettings, + settings.deleteReferenceImageSettings(), + clientContext); this.listReferenceImagesCallable = callableFactory.createUnaryCallable( listReferenceImagesTransportSettings, @@ -667,18 +667,6 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } - public UnaryCallable deleteProductSetCallable() { - return deleteProductSetCallable; - } - - public UnaryCallable deleteProductCallable() { - return deleteProductCallable; - } - - public UnaryCallable deleteReferenceImageCallable() { - return deleteReferenceImageCallable; - } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable< ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> @@ -711,6 +699,10 @@ public UnaryCallable updateProductSetCallab return updateProductSetCallable; } + public UnaryCallable deleteProductSetCallable() { + return deleteProductSetCallable; + } + public UnaryCallable createProductCallable() { return createProductCallable; } @@ -731,10 +723,18 @@ public UnaryCallable updateProductCallable() { return updateProductCallable; } + public UnaryCallable deleteProductCallable() { + return deleteProductCallable; + } + public UnaryCallable createReferenceImageCallable() { return createReferenceImageCallable; } + public UnaryCallable deleteReferenceImageCallable() { + return deleteReferenceImageCallable; + } + public UnaryCallable listReferenceImagesPagedCallable() { return listReferenceImagesPagedCallable; diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ImageAnnotatorStubSettings.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ImageAnnotatorStubSettings.java index 63759be64..ce32aa841 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ImageAnnotatorStubSettings.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ImageAnnotatorStubSettings.java @@ -212,11 +212,13 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "idempotent", + "retry_policy_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_4_codes", ImmutableSet.copyOf( Lists.newArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -230,12 +232,25 @@ public static class Builder extends StubSettings.BuildernewUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create( diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ProductSearchStub.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ProductSearchStub.java index b9e355e8f..b60227c20 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ProductSearchStub.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ProductSearchStub.java @@ -71,18 +71,6 @@ public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } - public UnaryCallable deleteProductSetCallable() { - throw new UnsupportedOperationException("Not implemented: deleteProductSetCallable()"); - } - - public UnaryCallable deleteProductCallable() { - throw new UnsupportedOperationException("Not implemented: deleteProductCallable()"); - } - - public UnaryCallable deleteReferenceImageCallable() { - throw new UnsupportedOperationException("Not implemented: deleteReferenceImageCallable()"); - } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable< ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> @@ -116,6 +104,10 @@ public UnaryCallable updateProductSetCallab throw new UnsupportedOperationException("Not implemented: updateProductSetCallable()"); } + public UnaryCallable deleteProductSetCallable() { + throw new UnsupportedOperationException("Not implemented: deleteProductSetCallable()"); + } + public UnaryCallable createProductCallable() { throw new UnsupportedOperationException("Not implemented: createProductCallable()"); } @@ -136,10 +128,18 @@ public UnaryCallable updateProductCallable() { throw new UnsupportedOperationException("Not implemented: updateProductCallable()"); } + public UnaryCallable deleteProductCallable() { + throw new UnsupportedOperationException("Not implemented: deleteProductCallable()"); + } + public UnaryCallable createReferenceImageCallable() { throw new UnsupportedOperationException("Not implemented: createReferenceImageCallable()"); } + public UnaryCallable deleteReferenceImageCallable() { + throw new UnsupportedOperationException("Not implemented: deleteReferenceImageCallable()"); + } + public UnaryCallable listReferenceImagesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listReferenceImagesPagedCallable()"); diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ProductSearchStubSettings.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ProductSearchStubSettings.java index f8757f7cc..2d573ea9f 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ProductSearchStubSettings.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/stub/ProductSearchStubSettings.java @@ -99,16 +99,16 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of deleteProductSet to 30 seconds: + *

For example, to set the total timeout of createProductSet to 30 seconds: * *

  * 
  * ProductSearchStubSettings.Builder productSearchSettingsBuilder =
  *     ProductSearchStubSettings.newBuilder();
  * productSearchSettingsBuilder
- *     .deleteProductSetSettings()
+ *     .createProductSetSettings()
  *     .setRetrySettings(
- *         productSearchSettingsBuilder.deleteProductSetSettings().getRetrySettings().toBuilder()
+ *         productSearchSettingsBuilder.createProductSetSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * ProductSearchStubSettings productSearchSettings = productSearchSettingsBuilder.build();
@@ -125,9 +125,6 @@ public class ProductSearchStubSettings extends StubSettings deleteProductSetSettings;
-  private final UnaryCallSettings deleteProductSettings;
-  private final UnaryCallSettings deleteReferenceImageSettings;
   private final UnaryCallSettings importProductSetsSettings;
   private final OperationCallSettings<
           ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata>
@@ -138,14 +135,17 @@ public class ProductSearchStubSettings extends StubSettings getProductSetSettings;
   private final UnaryCallSettings updateProductSetSettings;
+  private final UnaryCallSettings deleteProductSetSettings;
   private final UnaryCallSettings createProductSettings;
   private final PagedCallSettings<
           ListProductsRequest, ListProductsResponse, ListProductsPagedResponse>
       listProductsSettings;
   private final UnaryCallSettings getProductSettings;
   private final UnaryCallSettings updateProductSettings;
+  private final UnaryCallSettings deleteProductSettings;
   private final UnaryCallSettings
       createReferenceImageSettings;
+  private final UnaryCallSettings deleteReferenceImageSettings;
   private final PagedCallSettings<
           ListReferenceImagesRequest, ListReferenceImagesResponse, ListReferenceImagesPagedResponse>
       listReferenceImagesSettings;
@@ -161,21 +161,6 @@ public class ProductSearchStubSettings extends StubSettings
       listProductsInProductSetSettings;
 
-  /** Returns the object with the settings used for calls to deleteProductSet. */
-  public UnaryCallSettings deleteProductSetSettings() {
-    return deleteProductSetSettings;
-  }
-
-  /** Returns the object with the settings used for calls to deleteProduct. */
-  public UnaryCallSettings deleteProductSettings() {
-    return deleteProductSettings;
-  }
-
-  /** Returns the object with the settings used for calls to deleteReferenceImage. */
-  public UnaryCallSettings deleteReferenceImageSettings() {
-    return deleteReferenceImageSettings;
-  }
-
   /** Returns the object with the settings used for calls to importProductSets. */
   public UnaryCallSettings importProductSetsSettings() {
     return importProductSetsSettings;
@@ -211,6 +196,11 @@ public UnaryCallSettings updateProductSetSe
     return updateProductSetSettings;
   }
 
+  /** Returns the object with the settings used for calls to deleteProductSet. */
+  public UnaryCallSettings deleteProductSetSettings() {
+    return deleteProductSetSettings;
+  }
+
   /** Returns the object with the settings used for calls to createProduct. */
   public UnaryCallSettings createProductSettings() {
     return createProductSettings;
@@ -232,12 +222,22 @@ public UnaryCallSettings updateProductSettings()
     return updateProductSettings;
   }
 
+  /** Returns the object with the settings used for calls to deleteProduct. */
+  public UnaryCallSettings deleteProductSettings() {
+    return deleteProductSettings;
+  }
+
   /** Returns the object with the settings used for calls to createReferenceImage. */
   public UnaryCallSettings
       createReferenceImageSettings() {
     return createReferenceImageSettings;
   }
 
+  /** Returns the object with the settings used for calls to deleteReferenceImage. */
+  public UnaryCallSettings deleteReferenceImageSettings() {
+    return deleteReferenceImageSettings;
+  }
+
   /** Returns the object with the settings used for calls to listReferenceImages. */
   public PagedCallSettings<
           ListReferenceImagesRequest, ListReferenceImagesResponse, ListReferenceImagesPagedResponse>
@@ -339,9 +339,6 @@ public Builder toBuilder() {
   protected ProductSearchStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    deleteProductSetSettings = settingsBuilder.deleteProductSetSettings().build();
-    deleteProductSettings = settingsBuilder.deleteProductSettings().build();
-    deleteReferenceImageSettings = settingsBuilder.deleteReferenceImageSettings().build();
     importProductSetsSettings = settingsBuilder.importProductSetsSettings().build();
     importProductSetsOperationSettings =
         settingsBuilder.importProductSetsOperationSettings().build();
@@ -349,11 +346,14 @@ protected ProductSearchStubSettings(Builder settingsBuilder) throws IOException
     listProductSetsSettings = settingsBuilder.listProductSetsSettings().build();
     getProductSetSettings = settingsBuilder.getProductSetSettings().build();
     updateProductSetSettings = settingsBuilder.updateProductSetSettings().build();
+    deleteProductSetSettings = settingsBuilder.deleteProductSetSettings().build();
     createProductSettings = settingsBuilder.createProductSettings().build();
     listProductsSettings = settingsBuilder.listProductsSettings().build();
     getProductSettings = settingsBuilder.getProductSettings().build();
     updateProductSettings = settingsBuilder.updateProductSettings().build();
+    deleteProductSettings = settingsBuilder.deleteProductSettings().build();
     createReferenceImageSettings = settingsBuilder.createReferenceImageSettings().build();
+    deleteReferenceImageSettings = settingsBuilder.deleteReferenceImageSettings().build();
     listReferenceImagesSettings = settingsBuilder.listReferenceImagesSettings().build();
     getReferenceImageSettings = settingsBuilder.getReferenceImageSettings().build();
     addProductToProductSetSettings = settingsBuilder.addProductToProductSetSettings().build();
@@ -605,11 +605,6 @@ public ApiFuture getFuturePagedResponse(
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder
-        deleteProductSetSettings;
-    private final UnaryCallSettings.Builder deleteProductSettings;
-    private final UnaryCallSettings.Builder
-        deleteReferenceImageSettings;
     private final UnaryCallSettings.Builder
         importProductSetsSettings;
     private final OperationCallSettings.Builder<
@@ -623,14 +618,19 @@ public static class Builder extends StubSettings.Builder getProductSetSettings;
     private final UnaryCallSettings.Builder
         updateProductSetSettings;
+    private final UnaryCallSettings.Builder
+        deleteProductSetSettings;
     private final UnaryCallSettings.Builder createProductSettings;
     private final PagedCallSettings.Builder<
             ListProductsRequest, ListProductsResponse, ListProductsPagedResponse>
         listProductsSettings;
     private final UnaryCallSettings.Builder getProductSettings;
     private final UnaryCallSettings.Builder updateProductSettings;
+    private final UnaryCallSettings.Builder deleteProductSettings;
     private final UnaryCallSettings.Builder
         createReferenceImageSettings;
+    private final UnaryCallSettings.Builder
+        deleteReferenceImageSettings;
     private final PagedCallSettings.Builder<
             ListReferenceImagesRequest,
             ListReferenceImagesResponse,
@@ -654,12 +654,14 @@ public static class Builder extends StubSettings.Builder> definitions =
           ImmutableMap.builder();
+      definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList()));
       definitions.put(
-          "idempotent",
+          "retry_policy_3_codes",
           ImmutableSet.copyOf(
               Lists.newArrayList(
-                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
+                  StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED)));
+      definitions.put(
+          "retry_policy_2_codes", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -673,12 +675,25 @@ public static class Builder extends StubSettings.Builder>of(
-              deleteProductSetSettings,
-              deleteProductSettings,
-              deleteReferenceImageSettings,
               importProductSetsSettings,
               createProductSetSettings,
               listProductSetsSettings,
               getProductSetSettings,
               updateProductSetSettings,
+              deleteProductSetSettings,
               createProductSettings,
               listProductsSettings,
               getProductSettings,
               updateProductSettings,
+              deleteProductSettings,
               createReferenceImageSettings,
+              deleteReferenceImageSettings,
               listReferenceImagesSettings,
               getReferenceImageSettings,
               addProductToProductSetSettings,
@@ -764,102 +779,102 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder
-          .deleteProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
-
-      builder
-          .deleteProductSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
-
-      builder
-          .deleteReferenceImageSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
-
       builder
           .importProductSetsSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
 
       builder
           .createProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
 
       builder
           .listProductSetsSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .getProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .updateProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
+
+      builder
+          .deleteProductSetSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .createProductSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
 
       builder
           .listProductsSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .getProductSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .updateProductSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
+
+      builder
+          .deleteProductSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .createReferenceImageSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
+
+      builder
+          .deleteReferenceImageSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .listReferenceImagesSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .getReferenceImageSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .addProductToProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
 
       builder
           .removeProductFromProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
 
       builder
           .listProductsInProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
       builder
           .importProductSetsOperationSettings()
           .setInitialCallSettings(
               UnaryCallSettings
                   .newUnaryCallSettingsBuilder()
-                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
+                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"))
                   .build())
           .setResponseTransformer(
               ProtoOperationTransformers.ResponseTransformer.create(
@@ -884,20 +899,20 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(ProductSearchStubSettings settings) {
       super(settings);
 
-      deleteProductSetSettings = settings.deleteProductSetSettings.toBuilder();
-      deleteProductSettings = settings.deleteProductSettings.toBuilder();
-      deleteReferenceImageSettings = settings.deleteReferenceImageSettings.toBuilder();
       importProductSetsSettings = settings.importProductSetsSettings.toBuilder();
       importProductSetsOperationSettings = settings.importProductSetsOperationSettings.toBuilder();
       createProductSetSettings = settings.createProductSetSettings.toBuilder();
       listProductSetsSettings = settings.listProductSetsSettings.toBuilder();
       getProductSetSettings = settings.getProductSetSettings.toBuilder();
       updateProductSetSettings = settings.updateProductSetSettings.toBuilder();
+      deleteProductSetSettings = settings.deleteProductSetSettings.toBuilder();
       createProductSettings = settings.createProductSettings.toBuilder();
       listProductsSettings = settings.listProductsSettings.toBuilder();
       getProductSettings = settings.getProductSettings.toBuilder();
       updateProductSettings = settings.updateProductSettings.toBuilder();
+      deleteProductSettings = settings.deleteProductSettings.toBuilder();
       createReferenceImageSettings = settings.createReferenceImageSettings.toBuilder();
+      deleteReferenceImageSettings = settings.deleteReferenceImageSettings.toBuilder();
       listReferenceImagesSettings = settings.listReferenceImagesSettings.toBuilder();
       getReferenceImageSettings = settings.getReferenceImageSettings.toBuilder();
       addProductToProductSetSettings = settings.addProductToProductSetSettings.toBuilder();
@@ -907,19 +922,19 @@ protected Builder(ProductSearchStubSettings settings) {
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
-              deleteProductSetSettings,
-              deleteProductSettings,
-              deleteReferenceImageSettings,
               importProductSetsSettings,
               createProductSetSettings,
               listProductSetsSettings,
               getProductSetSettings,
               updateProductSetSettings,
+              deleteProductSetSettings,
               createProductSettings,
               listProductsSettings,
               getProductSettings,
               updateProductSettings,
+              deleteProductSettings,
               createReferenceImageSettings,
+              deleteReferenceImageSettings,
               listReferenceImagesSettings,
               getReferenceImageSettings,
               addProductToProductSetSettings,
@@ -943,22 +958,6 @@ public Builder applyToAllUnaryMethods(
       return unaryMethodSettingsBuilders;
     }
 
-    /** Returns the builder for the settings used for calls to deleteProductSet. */
-    public UnaryCallSettings.Builder deleteProductSetSettings() {
-      return deleteProductSetSettings;
-    }
-
-    /** Returns the builder for the settings used for calls to deleteProduct. */
-    public UnaryCallSettings.Builder deleteProductSettings() {
-      return deleteProductSettings;
-    }
-
-    /** Returns the builder for the settings used for calls to deleteReferenceImage. */
-    public UnaryCallSettings.Builder
-        deleteReferenceImageSettings() {
-      return deleteReferenceImageSettings;
-    }
-
     /** Returns the builder for the settings used for calls to importProductSets. */
     public UnaryCallSettings.Builder
         importProductSetsSettings() {
@@ -998,6 +997,11 @@ public UnaryCallSettings.Builder getProductSet
       return updateProductSetSettings;
     }
 
+    /** Returns the builder for the settings used for calls to deleteProductSet. */
+    public UnaryCallSettings.Builder deleteProductSetSettings() {
+      return deleteProductSetSettings;
+    }
+
     /** Returns the builder for the settings used for calls to createProduct. */
     public UnaryCallSettings.Builder createProductSettings() {
       return createProductSettings;
@@ -1020,12 +1024,23 @@ public UnaryCallSettings.Builder updateProductSet
       return updateProductSettings;
     }
 
+    /** Returns the builder for the settings used for calls to deleteProduct. */
+    public UnaryCallSettings.Builder deleteProductSettings() {
+      return deleteProductSettings;
+    }
+
     /** Returns the builder for the settings used for calls to createReferenceImage. */
     public UnaryCallSettings.Builder
         createReferenceImageSettings() {
       return createReferenceImageSettings;
     }
 
+    /** Returns the builder for the settings used for calls to deleteReferenceImage. */
+    public UnaryCallSettings.Builder
+        deleteReferenceImageSettings() {
+      return deleteReferenceImageSettings;
+    }
+
     /** Returns the builder for the settings used for calls to listReferenceImages. */
     public PagedCallSettings.Builder<
             ListReferenceImagesRequest,
diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorClient.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorClient.java
index 019b6adee..e0a5ed337 100644
--- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorClient.java
+++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorClient.java
@@ -164,159 +164,6 @@ public final OperationsClient getOperationsClient() {
     return operationsClient;
   }
 
-  // AUTO-GENERATED DOCUMENTATION AND METHOD
-  /**
-   * Run image detection and annotation for a batch of images.
-   *
-   * 

Sample code: - * - *


-   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
-   *   List<AnnotateImageRequest> requests = new ArrayList<>();
-   *   BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
-   * }
-   * 
- * - * @param requests Required. Individual image annotation requests for this batch. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final BatchAnnotateImagesResponse batchAnnotateImages( - List requests) { - BatchAnnotateImagesRequest request = - BatchAnnotateImagesRequest.newBuilder().addAllRequests(requests).build(); - return batchAnnotateImages(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Run image detection and annotation for a batch of images. - * - *

Sample code: - * - *


-   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
-   *   List<AnnotateImageRequest> requests = new ArrayList<>();
-   *   BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
-   *     .addAllRequests(requests)
-   *     .build();
-   *   BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(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 - */ - public final BatchAnnotateImagesResponse batchAnnotateImages(BatchAnnotateImagesRequest request) { - return batchAnnotateImagesCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Run image detection and annotation for a batch of images. - * - *

Sample code: - * - *


-   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
-   *   List<AnnotateImageRequest> requests = new ArrayList<>();
-   *   BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
-   *     .addAllRequests(requests)
-   *     .build();
-   *   ApiFuture<BatchAnnotateImagesResponse> future = imageAnnotatorClient.batchAnnotateImagesCallable().futureCall(request);
-   *   // Do something
-   *   BatchAnnotateImagesResponse response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable - batchAnnotateImagesCallable() { - return stub.batchAnnotateImagesCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Service that performs image detection and annotation for a batch of files. Now only - * "application/pdf", "image/tiff" and "image/gif" are supported. - * - *

This service will extract at most 5 (customers can specify which 5 in - * AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and - * perform detection and annotation for each image extracted. - * - *

Sample code: - * - *


-   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
-   *   List<AnnotateFileRequest> requests = new ArrayList<>();
-   *   BatchAnnotateFilesResponse response = imageAnnotatorClient.batchAnnotateFiles(requests);
-   * }
-   * 
- * - * @param requests Required. The list of file annotation requests. Right now we support only one - * AnnotateFileRequest in BatchAnnotateFilesRequest. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final BatchAnnotateFilesResponse batchAnnotateFiles(List requests) { - BatchAnnotateFilesRequest request = - BatchAnnotateFilesRequest.newBuilder().addAllRequests(requests).build(); - return batchAnnotateFiles(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Service that performs image detection and annotation for a batch of files. Now only - * "application/pdf", "image/tiff" and "image/gif" are supported. - * - *

This service will extract at most 5 (customers can specify which 5 in - * AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and - * perform detection and annotation for each image extracted. - * - *

Sample code: - * - *


-   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
-   *   List<AnnotateFileRequest> requests = new ArrayList<>();
-   *   BatchAnnotateFilesRequest request = BatchAnnotateFilesRequest.newBuilder()
-   *     .addAllRequests(requests)
-   *     .build();
-   *   BatchAnnotateFilesResponse response = imageAnnotatorClient.batchAnnotateFiles(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 - */ - public final BatchAnnotateFilesResponse batchAnnotateFiles(BatchAnnotateFilesRequest request) { - return batchAnnotateFilesCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Service that performs image detection and annotation for a batch of files. Now only - * "application/pdf", "image/tiff" and "image/gif" are supported. - * - *

This service will extract at most 5 (customers can specify which 5 in - * AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and - * perform detection and annotation for each image extracted. - * - *

Sample code: - * - *


-   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
-   *   List<AnnotateFileRequest> requests = new ArrayList<>();
-   *   BatchAnnotateFilesRequest request = BatchAnnotateFilesRequest.newBuilder()
-   *     .addAllRequests(requests)
-   *     .build();
-   *   ApiFuture<BatchAnnotateFilesResponse> future = imageAnnotatorClient.batchAnnotateFilesCallable().futureCall(request);
-   *   // Do something
-   *   BatchAnnotateFilesResponse response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable - batchAnnotateFilesCallable() { - return stub.batchAnnotateFilesCallable(); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Run asynchronous image detection and annotation for a list of images. @@ -571,6 +418,159 @@ public final BatchAnnotateFilesResponse batchAnnotateFiles(BatchAnnotateFilesReq return stub.asyncBatchAnnotateFilesCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run image detection and annotation for a batch of images. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateImageRequest> requests = new ArrayList<>();
+   *   BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
+   * }
+   * 
+ * + * @param requests Required. Individual image annotation requests for this batch. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BatchAnnotateImagesResponse batchAnnotateImages( + List requests) { + BatchAnnotateImagesRequest request = + BatchAnnotateImagesRequest.newBuilder().addAllRequests(requests).build(); + return batchAnnotateImages(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run image detection and annotation for a batch of images. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateImageRequest> requests = new ArrayList<>();
+   *   BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(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 + */ + public final BatchAnnotateImagesResponse batchAnnotateImages(BatchAnnotateImagesRequest request) { + return batchAnnotateImagesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Run image detection and annotation for a batch of images. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateImageRequest> requests = new ArrayList<>();
+   *   BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   ApiFuture<BatchAnnotateImagesResponse> future = imageAnnotatorClient.batchAnnotateImagesCallable().futureCall(request);
+   *   // Do something
+   *   BatchAnnotateImagesResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + batchAnnotateImagesCallable() { + return stub.batchAnnotateImagesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Service that performs image detection and annotation for a batch of files. Now only + * "application/pdf", "image/tiff" and "image/gif" are supported. + * + *

This service will extract at most 5 (customers can specify which 5 in + * AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and + * perform detection and annotation for each image extracted. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateFileRequest> requests = new ArrayList<>();
+   *   BatchAnnotateFilesResponse response = imageAnnotatorClient.batchAnnotateFiles(requests);
+   * }
+   * 
+ * + * @param requests Required. The list of file annotation requests. Right now we support only one + * AnnotateFileRequest in BatchAnnotateFilesRequest. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BatchAnnotateFilesResponse batchAnnotateFiles(List requests) { + BatchAnnotateFilesRequest request = + BatchAnnotateFilesRequest.newBuilder().addAllRequests(requests).build(); + return batchAnnotateFiles(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Service that performs image detection and annotation for a batch of files. Now only + * "application/pdf", "image/tiff" and "image/gif" are supported. + * + *

This service will extract at most 5 (customers can specify which 5 in + * AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and + * perform detection and annotation for each image extracted. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateFileRequest> requests = new ArrayList<>();
+   *   BatchAnnotateFilesRequest request = BatchAnnotateFilesRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   BatchAnnotateFilesResponse response = imageAnnotatorClient.batchAnnotateFiles(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 + */ + public final BatchAnnotateFilesResponse batchAnnotateFiles(BatchAnnotateFilesRequest request) { + return batchAnnotateFilesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Service that performs image detection and annotation for a batch of files. Now only + * "application/pdf", "image/tiff" and "image/gif" are supported. + * + *

This service will extract at most 5 (customers can specify which 5 in + * AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and + * perform detection and annotation for each image extracted. + * + *

Sample code: + * + *


+   * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
+   *   List<AnnotateFileRequest> requests = new ArrayList<>();
+   *   BatchAnnotateFilesRequest request = BatchAnnotateFilesRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   ApiFuture<BatchAnnotateFilesResponse> future = imageAnnotatorClient.batchAnnotateFilesCallable().futureCall(request);
+   *   // Do something
+   *   BatchAnnotateFilesResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + batchAnnotateFilesCallable() { + return stub.batchAnnotateFilesCallable(); + } + @Override public final void close() { stub.close(); diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorSettings.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorSettings.java index 2821efddd..8ff575c22 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorSettings.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorSettings.java @@ -66,18 +66,6 @@ @Generated("by gapic-generator") @BetaApi public class ImageAnnotatorSettings extends ClientSettings { - /** Returns the object with the settings used for calls to batchAnnotateImages. */ - public UnaryCallSettings - batchAnnotateImagesSettings() { - return ((ImageAnnotatorStubSettings) getStubSettings()).batchAnnotateImagesSettings(); - } - - /** Returns the object with the settings used for calls to batchAnnotateFiles. */ - public UnaryCallSettings - batchAnnotateFilesSettings() { - return ((ImageAnnotatorStubSettings) getStubSettings()).batchAnnotateFilesSettings(); - } - /** Returns the object with the settings used for calls to asyncBatchAnnotateImages. */ public UnaryCallSettings asyncBatchAnnotateImagesSettings() { @@ -110,6 +98,18 @@ public class ImageAnnotatorSettings extends ClientSettings + batchAnnotateImagesSettings() { + return ((ImageAnnotatorStubSettings) getStubSettings()).batchAnnotateImagesSettings(); + } + + /** Returns the object with the settings used for calls to batchAnnotateFiles. */ + public UnaryCallSettings + batchAnnotateFilesSettings() { + return ((ImageAnnotatorStubSettings) getStubSettings()).batchAnnotateFilesSettings(); + } + public static final ImageAnnotatorSettings create(ImageAnnotatorStubSettings stub) throws IOException { return new ImageAnnotatorSettings.Builder(stub.toBuilder()).build(); @@ -207,18 +207,6 @@ public Builder applyToAllUnaryMethods( return this; } - /** Returns the builder for the settings used for calls to batchAnnotateImages. */ - public UnaryCallSettings.Builder - batchAnnotateImagesSettings() { - return getStubSettingsBuilder().batchAnnotateImagesSettings(); - } - - /** Returns the builder for the settings used for calls to batchAnnotateFiles. */ - public UnaryCallSettings.Builder - batchAnnotateFilesSettings() { - return getStubSettingsBuilder().batchAnnotateFilesSettings(); - } - /** Returns the builder for the settings used for calls to asyncBatchAnnotateImages. */ public UnaryCallSettings.Builder asyncBatchAnnotateImagesSettings() { @@ -249,6 +237,18 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().asyncBatchAnnotateFilesOperationSettings(); } + /** Returns the builder for the settings used for calls to batchAnnotateImages. */ + public UnaryCallSettings.Builder + batchAnnotateImagesSettings() { + return getStubSettingsBuilder().batchAnnotateImagesSettings(); + } + + /** Returns the builder for the settings used for calls to batchAnnotateFiles. */ + public UnaryCallSettings.Builder + batchAnnotateFilesSettings() { + return getStubSettingsBuilder().batchAnnotateFilesSettings(); + } + @Override public ImageAnnotatorSettings build() throws IOException { return new ImageAnnotatorSettings(this); diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchClient.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchClient.java index b9ed3355c..77ac31938 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchClient.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchClient.java @@ -63,8 +63,10 @@ *
  * 
  * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
- *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
- *   productSearchClient.deleteProductSet(name);
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   ProductSet productSet = ProductSet.newBuilder().build();
+ *   String productSetId = "";
+ *   ProductSet response = productSearchClient.createProductSet(parent, productSet, productSetId);
  * }
  * 
  * 
@@ -186,329 +188,6 @@ public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not - * deleted. - * - *

The actual image files are not deleted from Google Cloud Storage. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-   *   productSearchClient.deleteProductSet(name);
-   * }
-   * 
- * - * @param name Required. Resource name of the ProductSet to delete. - *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteProductSet(ProductSetName name) { - DeleteProductSetRequest request = - DeleteProductSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteProductSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not - * deleted. - * - *

The actual image files are not deleted from Google Cloud Storage. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-   *   productSearchClient.deleteProductSet(name.toString());
-   * }
-   * 
- * - * @param name Required. Resource name of the ProductSet to delete. - *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteProductSet(String name) { - DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder().setName(name).build(); - deleteProductSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not - * deleted. - * - *

The actual image files are not deleted from Google Cloud Storage. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-   *   DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   productSearchClient.deleteProductSet(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 - */ - public final void deleteProductSet(DeleteProductSetRequest request) { - deleteProductSetCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not - * deleted. - * - *

The actual image files are not deleted from Google Cloud Storage. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-   *   DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = productSearchClient.deleteProductSetCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable deleteProductSetCallable() { - return stub.deleteProductSetCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a product and its reference images. - * - *

Metadata of the product and all its images will be deleted right away, but search queries - * against ProductSets containing the product may still work until all related caches are - * refreshed. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
-   *   productSearchClient.deleteProduct(name);
-   * }
-   * 
- * - * @param name Required. Resource name of product to delete. - *

Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteProduct(ProductName name) { - DeleteProductRequest request = - DeleteProductRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteProduct(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a product and its reference images. - * - *

Metadata of the product and all its images will be deleted right away, but search queries - * against ProductSets containing the product may still work until all related caches are - * refreshed. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
-   *   productSearchClient.deleteProduct(name.toString());
-   * }
-   * 
- * - * @param name Required. Resource name of product to delete. - *

Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteProduct(String name) { - DeleteProductRequest request = DeleteProductRequest.newBuilder().setName(name).build(); - deleteProduct(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a product and its reference images. - * - *

Metadata of the product and all its images will be deleted right away, but search queries - * against ProductSets containing the product may still work until all related caches are - * refreshed. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
-   *   DeleteProductRequest request = DeleteProductRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   productSearchClient.deleteProduct(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 - */ - public final void deleteProduct(DeleteProductRequest request) { - deleteProductCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a product and its reference images. - * - *

Metadata of the product and all its images will be deleted right away, but search queries - * against ProductSets containing the product may still work until all related caches are - * refreshed. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
-   *   DeleteProductRequest request = DeleteProductRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = productSearchClient.deleteProductCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable deleteProductCallable() { - return stub.deleteProductCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a reference image. - * - *

The image metadata will be deleted right away, but search queries against ProductSets - * containing the image may still work until all related caches are refreshed. - * - *

The actual image files are not deleted from Google Cloud Storage. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
-   *   productSearchClient.deleteReferenceImage(name);
-   * }
-   * 
- * - * @param name Required. The resource name of the reference image to delete. - *

Format is: - *

`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteReferenceImage(ReferenceImageName name) { - DeleteReferenceImageRequest request = - DeleteReferenceImageRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - deleteReferenceImage(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a reference image. - * - *

The image metadata will be deleted right away, but search queries against ProductSets - * containing the image may still work until all related caches are refreshed. - * - *

The actual image files are not deleted from Google Cloud Storage. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
-   *   productSearchClient.deleteReferenceImage(name.toString());
-   * }
-   * 
- * - * @param name Required. The resource name of the reference image to delete. - *

Format is: - *

`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteReferenceImage(String name) { - DeleteReferenceImageRequest request = - DeleteReferenceImageRequest.newBuilder().setName(name).build(); - deleteReferenceImage(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a reference image. - * - *

The image metadata will be deleted right away, but search queries against ProductSets - * containing the image may still work until all related caches are refreshed. - * - *

The actual image files are not deleted from Google Cloud Storage. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
-   *   DeleteReferenceImageRequest request = DeleteReferenceImageRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   productSearchClient.deleteReferenceImage(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 - */ - public final void deleteReferenceImage(DeleteReferenceImageRequest request) { - deleteReferenceImageCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Permanently deletes a reference image. - * - *

The image metadata will be deleted right away, but search queries against ProductSets - * containing the image may still work until all related caches are refreshed. - * - *

The actual image files are not deleted from Google Cloud Storage. - * - *

Sample code: - * - *


-   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
-   *   DeleteReferenceImageRequest request = DeleteReferenceImageRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = productSearchClient.deleteReferenceImageCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable deleteReferenceImageCallable() { - return stub.deleteReferenceImageCallable(); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Asynchronous API that imports a list of reference images to specified product sets based on a @@ -1144,47 +823,149 @@ public final ProductSet updateProductSet(ProductSet productSet, FieldMask update * *

    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductSet productSet = ProductSet.newBuilder().build();
-   *   UpdateProductSetRequest request = UpdateProductSetRequest.newBuilder()
-   *     .setProductSet(productSet)
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   UpdateProductSetRequest request = UpdateProductSetRequest.newBuilder()
+   *     .setProductSet(productSet)
+   *     .build();
+   *   ProductSet response = productSearchClient.updateProductSet(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 + */ + public final ProductSet updateProductSet(UpdateProductSetRequest request) { + return updateProductSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Makes changes to a ProductSet resource. Only display_name can be updated currently. + * + *

Possible errors: + * + *

* Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if + * display_name is present in update_mask but missing from the request or longer than 4096 + * characters. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   UpdateProductSetRequest request = UpdateProductSetRequest.newBuilder()
+   *     .setProductSet(productSet)
+   *     .build();
+   *   ApiFuture<ProductSet> future = productSearchClient.updateProductSetCallable().futureCall(request);
+   *   // Do something
+   *   ProductSet response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateProductSetCallable() { + return stub.updateProductSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not + * deleted. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   productSearchClient.deleteProductSet(name);
+   * }
+   * 
+ * + * @param name Required. Resource name of the ProductSet to delete. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteProductSet(ProductSetName name) { + DeleteProductSetRequest request = + DeleteProductSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not + * deleted. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   productSearchClient.deleteProductSet(name.toString());
+   * }
+   * 
+ * + * @param name Required. Resource name of the ProductSet to delete. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteProductSet(String name) { + DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder().setName(name).build(); + deleteProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not + * deleted. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   ProductSet response = productSearchClient.updateProductSet(request);
+   *   productSearchClient.deleteProductSet(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 */ - public final ProductSet updateProductSet(UpdateProductSetRequest request) { - return updateProductSetCallable().call(request); + public final void deleteProductSet(DeleteProductSetRequest request) { + deleteProductSetCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Makes changes to a ProductSet resource. Only display_name can be updated currently. - * - *

Possible errors: + * Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not + * deleted. * - *

* Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if - * display_name is present in update_mask but missing from the request or longer than 4096 - * characters. + *

The actual image files are not deleted from Google Cloud Storage. * *

Sample code: * *


    * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
-   *   ProductSet productSet = ProductSet.newBuilder().build();
-   *   UpdateProductSetRequest request = UpdateProductSetRequest.newBuilder()
-   *     .setProductSet(productSet)
+   *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<ProductSet> future = productSearchClient.updateProductSetCallable().futureCall(request);
+   *   ApiFuture<Void> future = productSearchClient.deleteProductSetCallable().futureCall(request);
    *   // Do something
-   *   ProductSet response = future.get();
+   *   future.get();
    * }
    * 
*/ - public final UnaryCallable updateProductSetCallable() { - return stub.updateProductSetCallable(); + public final UnaryCallable deleteProductSetCallable() { + return stub.deleteProductSetCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -1694,6 +1475,112 @@ public final UnaryCallable updateProductCallable( return stub.updateProductCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a product and its reference images. + * + *

Metadata of the product and all its images will be deleted right away, but search queries + * against ProductSets containing the product may still work until all related caches are + * refreshed. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   productSearchClient.deleteProduct(name);
+   * }
+   * 
+ * + * @param name Required. Resource name of product to delete. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteProduct(ProductName name) { + DeleteProductRequest request = + DeleteProductRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a product and its reference images. + * + *

Metadata of the product and all its images will be deleted right away, but search queries + * against ProductSets containing the product may still work until all related caches are + * refreshed. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   productSearchClient.deleteProduct(name.toString());
+   * }
+   * 
+ * + * @param name Required. Resource name of product to delete. + *

Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteProduct(String name) { + DeleteProductRequest request = DeleteProductRequest.newBuilder().setName(name).build(); + deleteProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a product and its reference images. + * + *

Metadata of the product and all its images will be deleted right away, but search queries + * against ProductSets containing the product may still work until all related caches are + * refreshed. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   DeleteProductRequest request = DeleteProductRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   productSearchClient.deleteProduct(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 + */ + public final void deleteProduct(DeleteProductRequest request) { + deleteProductCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a product and its reference images. + * + *

Metadata of the product and all its images will be deleted right away, but search queries + * against ProductSets containing the product may still work until all related caches are + * refreshed. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   DeleteProductRequest request = DeleteProductRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = productSearchClient.deleteProductCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteProductCallable() { + return stub.deleteProductCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Creates and returns a new ReferenceImage resource. @@ -1880,6 +1767,121 @@ public final ReferenceImage createReferenceImage(CreateReferenceImageRequest req return stub.createReferenceImageCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a reference image. + * + *

The image metadata will be deleted right away, but search queries against ProductSets + * containing the image may still work until all related caches are refreshed. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+   *   productSearchClient.deleteReferenceImage(name);
+   * }
+   * 
+ * + * @param name Required. The resource name of the reference image to delete. + *

Format is: + *

`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteReferenceImage(ReferenceImageName name) { + DeleteReferenceImageRequest request = + DeleteReferenceImageRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteReferenceImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a reference image. + * + *

The image metadata will be deleted right away, but search queries against ProductSets + * containing the image may still work until all related caches are refreshed. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+   *   productSearchClient.deleteReferenceImage(name.toString());
+   * }
+   * 
+ * + * @param name Required. The resource name of the reference image to delete. + *

Format is: + *

`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteReferenceImage(String name) { + DeleteReferenceImageRequest request = + DeleteReferenceImageRequest.newBuilder().setName(name).build(); + deleteReferenceImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a reference image. + * + *

The image metadata will be deleted right away, but search queries against ProductSets + * containing the image may still work until all related caches are refreshed. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+   *   DeleteReferenceImageRequest request = DeleteReferenceImageRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   productSearchClient.deleteReferenceImage(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 + */ + public final void deleteReferenceImage(DeleteReferenceImageRequest request) { + deleteReferenceImageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a reference image. + * + *

The image metadata will be deleted right away, but search queries against ProductSets + * containing the image may still work until all related caches are refreshed. + * + *

The actual image files are not deleted from Google Cloud Storage. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   ReferenceImageName name = ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+   *   DeleteReferenceImageRequest request = DeleteReferenceImageRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = productSearchClient.deleteReferenceImageCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteReferenceImageCallable() { + return stub.deleteReferenceImageCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists reference images. diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchSettings.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchSettings.java index c7fffd902..9c44629fe 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchSettings.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/ProductSearchSettings.java @@ -54,16 +54,16 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of deleteProductSet to 30 seconds: + *

For example, to set the total timeout of createProductSet to 30 seconds: * *

  * 
  * ProductSearchSettings.Builder productSearchSettingsBuilder =
  *     ProductSearchSettings.newBuilder();
  * productSearchSettingsBuilder
- *     .deleteProductSetSettings()
+ *     .createProductSetSettings()
  *     .setRetrySettings(
- *         productSearchSettingsBuilder.deleteProductSetSettings().getRetrySettings().toBuilder()
+ *         productSearchSettingsBuilder.createProductSetSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * ProductSearchSettings productSearchSettings = productSearchSettingsBuilder.build();
@@ -73,21 +73,6 @@
 @Generated("by gapic-generator")
 @BetaApi
 public class ProductSearchSettings extends ClientSettings {
-  /** Returns the object with the settings used for calls to deleteProductSet. */
-  public UnaryCallSettings deleteProductSetSettings() {
-    return ((ProductSearchStubSettings) getStubSettings()).deleteProductSetSettings();
-  }
-
-  /** Returns the object with the settings used for calls to deleteProduct. */
-  public UnaryCallSettings deleteProductSettings() {
-    return ((ProductSearchStubSettings) getStubSettings()).deleteProductSettings();
-  }
-
-  /** Returns the object with the settings used for calls to deleteReferenceImage. */
-  public UnaryCallSettings deleteReferenceImageSettings() {
-    return ((ProductSearchStubSettings) getStubSettings()).deleteReferenceImageSettings();
-  }
-
   /** Returns the object with the settings used for calls to importProductSets. */
   public UnaryCallSettings importProductSetsSettings() {
     return ((ProductSearchStubSettings) getStubSettings()).importProductSetsSettings();
@@ -124,6 +109,11 @@ public UnaryCallSettings updateProductSetSe
     return ((ProductSearchStubSettings) getStubSettings()).updateProductSetSettings();
   }
 
+  /** Returns the object with the settings used for calls to deleteProductSet. */
+  public UnaryCallSettings deleteProductSetSettings() {
+    return ((ProductSearchStubSettings) getStubSettings()).deleteProductSetSettings();
+  }
+
   /** Returns the object with the settings used for calls to createProduct. */
   public UnaryCallSettings createProductSettings() {
     return ((ProductSearchStubSettings) getStubSettings()).createProductSettings();
@@ -145,12 +135,22 @@ public UnaryCallSettings updateProductSettings()
     return ((ProductSearchStubSettings) getStubSettings()).updateProductSettings();
   }
 
+  /** Returns the object with the settings used for calls to deleteProduct. */
+  public UnaryCallSettings deleteProductSettings() {
+    return ((ProductSearchStubSettings) getStubSettings()).deleteProductSettings();
+  }
+
   /** Returns the object with the settings used for calls to createReferenceImage. */
   public UnaryCallSettings
       createReferenceImageSettings() {
     return ((ProductSearchStubSettings) getStubSettings()).createReferenceImageSettings();
   }
 
+  /** Returns the object with the settings used for calls to deleteReferenceImage. */
+  public UnaryCallSettings deleteReferenceImageSettings() {
+    return ((ProductSearchStubSettings) getStubSettings()).deleteReferenceImageSettings();
+  }
+
   /** Returns the object with the settings used for calls to listReferenceImages. */
   public PagedCallSettings<
           ListReferenceImagesRequest, ListReferenceImagesResponse, ListReferenceImagesPagedResponse>
@@ -293,22 +293,6 @@ public Builder applyToAllUnaryMethods(
       return this;
     }
 
-    /** Returns the builder for the settings used for calls to deleteProductSet. */
-    public UnaryCallSettings.Builder deleteProductSetSettings() {
-      return getStubSettingsBuilder().deleteProductSetSettings();
-    }
-
-    /** Returns the builder for the settings used for calls to deleteProduct. */
-    public UnaryCallSettings.Builder deleteProductSettings() {
-      return getStubSettingsBuilder().deleteProductSettings();
-    }
-
-    /** Returns the builder for the settings used for calls to deleteReferenceImage. */
-    public UnaryCallSettings.Builder
-        deleteReferenceImageSettings() {
-      return getStubSettingsBuilder().deleteReferenceImageSettings();
-    }
-
     /** Returns the builder for the settings used for calls to importProductSets. */
     public UnaryCallSettings.Builder
         importProductSetsSettings() {
@@ -348,6 +332,11 @@ public UnaryCallSettings.Builder getProductSet
       return getStubSettingsBuilder().updateProductSetSettings();
     }
 
+    /** Returns the builder for the settings used for calls to deleteProductSet. */
+    public UnaryCallSettings.Builder deleteProductSetSettings() {
+      return getStubSettingsBuilder().deleteProductSetSettings();
+    }
+
     /** Returns the builder for the settings used for calls to createProduct. */
     public UnaryCallSettings.Builder createProductSettings() {
       return getStubSettingsBuilder().createProductSettings();
@@ -370,12 +359,23 @@ public UnaryCallSettings.Builder updateProductSet
       return getStubSettingsBuilder().updateProductSettings();
     }
 
+    /** Returns the builder for the settings used for calls to deleteProduct. */
+    public UnaryCallSettings.Builder deleteProductSettings() {
+      return getStubSettingsBuilder().deleteProductSettings();
+    }
+
     /** Returns the builder for the settings used for calls to createReferenceImage. */
     public UnaryCallSettings.Builder
         createReferenceImageSettings() {
       return getStubSettingsBuilder().createReferenceImageSettings();
     }
 
+    /** Returns the builder for the settings used for calls to deleteReferenceImage. */
+    public UnaryCallSettings.Builder
+        deleteReferenceImageSettings() {
+      return getStubSettingsBuilder().deleteReferenceImageSettings();
+    }
+
     /** Returns the builder for the settings used for calls to listReferenceImages. */
     public PagedCallSettings.Builder<
             ListReferenceImagesRequest,
diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/package-info.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/package-info.java
index 783be873a..d4f3656c8 100644
--- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/package-info.java
+++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/package-info.java
@@ -42,8 +42,10 @@
  * 
  * 
  * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
- *   ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
- *   productSearchClient.deleteProductSet(name);
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   ProductSet productSet = ProductSet.newBuilder().build();
+ *   String productSetId = "";
+ *   ProductSet response = productSearchClient.createProductSet(parent, productSet, productSetId);
  * }
  * 
  * 
diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcImageAnnotatorStub.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcImageAnnotatorStub.java index 1ebf5c6ce..05b6794e5 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcImageAnnotatorStub.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcImageAnnotatorStub.java @@ -50,26 +50,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class GrpcImageAnnotatorStub extends ImageAnnotatorStub { - private static final MethodDescriptor - batchAnnotateImagesMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.vision.v1p4beta1.ImageAnnotator/BatchAnnotateImages") - .setRequestMarshaller( - ProtoUtils.marshaller(BatchAnnotateImagesRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(BatchAnnotateImagesResponse.getDefaultInstance())) - .build(); - private static final MethodDescriptor - batchAnnotateFilesMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.vision.v1p4beta1.ImageAnnotator/BatchAnnotateFiles") - .setRequestMarshaller( - ProtoUtils.marshaller(BatchAnnotateFilesRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(BatchAnnotateFilesResponse.getDefaultInstance())) - .build(); private static final MethodDescriptor asyncBatchAnnotateImagesMethodDescriptor = MethodDescriptor.newBuilder() @@ -90,14 +70,30 @@ public class GrpcImageAnnotatorStub extends ImageAnnotatorStub { ProtoUtils.marshaller(AsyncBatchAnnotateFilesRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + batchAnnotateImagesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p4beta1.ImageAnnotator/BatchAnnotateImages") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchAnnotateImagesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(BatchAnnotateImagesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + batchAnnotateFilesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p4beta1.ImageAnnotator/BatchAnnotateFiles") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchAnnotateFilesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(BatchAnnotateFilesResponse.getDefaultInstance())) + .build(); private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; - private final UnaryCallable - batchAnnotateImagesCallable; - private final UnaryCallable - batchAnnotateFilesCallable; private final UnaryCallable asyncBatchAnnotateImagesCallable; private final OperationCallable< @@ -108,6 +104,10 @@ public class GrpcImageAnnotatorStub extends ImageAnnotatorStub { private final OperationCallable< AsyncBatchAnnotateFilesRequest, AsyncBatchAnnotateFilesResponse, OperationMetadata> asyncBatchAnnotateFilesOperationCallable; + private final UnaryCallable + batchAnnotateImagesCallable; + private final UnaryCallable + batchAnnotateFilesCallable; private final GrpcStubCallableFactory callableFactory; @@ -151,16 +151,6 @@ protected GrpcImageAnnotatorStub( this.callableFactory = callableFactory; this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - GrpcCallSettings - batchAnnotateImagesTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(batchAnnotateImagesMethodDescriptor) - .build(); - GrpcCallSettings - batchAnnotateFilesTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(batchAnnotateFilesMethodDescriptor) - .build(); GrpcCallSettings asyncBatchAnnotateImagesTransportSettings = GrpcCallSettings.newBuilder() @@ -171,17 +161,17 @@ protected GrpcImageAnnotatorStub( GrpcCallSettings.newBuilder() .setMethodDescriptor(asyncBatchAnnotateFilesMethodDescriptor) .build(); + GrpcCallSettings + batchAnnotateImagesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchAnnotateImagesMethodDescriptor) + .build(); + GrpcCallSettings + batchAnnotateFilesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchAnnotateFilesMethodDescriptor) + .build(); - this.batchAnnotateImagesCallable = - callableFactory.createUnaryCallable( - batchAnnotateImagesTransportSettings, - settings.batchAnnotateImagesSettings(), - clientContext); - this.batchAnnotateFilesCallable = - callableFactory.createUnaryCallable( - batchAnnotateFilesTransportSettings, - settings.batchAnnotateFilesSettings(), - clientContext); this.asyncBatchAnnotateImagesCallable = callableFactory.createUnaryCallable( asyncBatchAnnotateImagesTransportSettings, @@ -204,6 +194,16 @@ protected GrpcImageAnnotatorStub( settings.asyncBatchAnnotateFilesOperationSettings(), clientContext, this.operationsStub); + this.batchAnnotateImagesCallable = + callableFactory.createUnaryCallable( + batchAnnotateImagesTransportSettings, + settings.batchAnnotateImagesSettings(), + clientContext); + this.batchAnnotateFilesCallable = + callableFactory.createUnaryCallable( + batchAnnotateFilesTransportSettings, + settings.batchAnnotateFilesSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -213,16 +213,6 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } - public UnaryCallable - batchAnnotateImagesCallable() { - return batchAnnotateImagesCallable; - } - - public UnaryCallable - batchAnnotateFilesCallable() { - return batchAnnotateFilesCallable; - } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable< AsyncBatchAnnotateImagesRequest, AsyncBatchAnnotateImagesResponse, OperationMetadata> @@ -247,6 +237,16 @@ public GrpcOperationsStub getOperationsStub() { return asyncBatchAnnotateFilesCallable; } + public UnaryCallable + batchAnnotateImagesCallable() { + return batchAnnotateImagesCallable; + } + + public UnaryCallable + batchAnnotateFilesCallable() { + return batchAnnotateFilesCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcProductSearchStub.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcProductSearchStub.java index 3f02e5619..2bd272123 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcProductSearchStub.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/GrpcProductSearchStub.java @@ -78,31 +78,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class GrpcProductSearchStub extends ProductSearchStub { - private static final MethodDescriptor - deleteProductSetMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.vision.v1p4beta1.ProductSearch/DeleteProductSet") - .setRequestMarshaller( - ProtoUtils.marshaller(DeleteProductSetRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - private static final MethodDescriptor deleteProductMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.vision.v1p4beta1.ProductSearch/DeleteProduct") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteProductRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - private static final MethodDescriptor - deleteReferenceImageMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.vision.v1p4beta1.ProductSearch/DeleteReferenceImage") - .setRequestMarshaller( - ProtoUtils.marshaller(DeleteReferenceImageRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); private static final MethodDescriptor importProductSetsMethodDescriptor = MethodDescriptor.newBuilder() @@ -149,6 +124,15 @@ public class GrpcProductSearchStub extends ProductSearchStub { ProtoUtils.marshaller(UpdateProductSetRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ProductSet.getDefaultInstance())) .build(); + private static final MethodDescriptor + deleteProductSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p4beta1.ProductSearch/DeleteProductSet") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); private static final MethodDescriptor createProductMethodDescriptor = MethodDescriptor.newBuilder() @@ -183,6 +167,13 @@ public class GrpcProductSearchStub extends ProductSearchStub { ProtoUtils.marshaller(UpdateProductRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Product.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteProductMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p4beta1.ProductSearch/DeleteProduct") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteProductRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); private static final MethodDescriptor createReferenceImageMethodDescriptor = MethodDescriptor.newBuilder() @@ -192,6 +183,15 @@ public class GrpcProductSearchStub extends ProductSearchStub { ProtoUtils.marshaller(CreateReferenceImageRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ReferenceImage.getDefaultInstance())) .build(); + private static final MethodDescriptor + deleteReferenceImageMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1p4beta1.ProductSearch/DeleteReferenceImage") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteReferenceImageRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); private static final MethodDescriptor listReferenceImagesMethodDescriptor = MethodDescriptor.newBuilder() @@ -257,9 +257,6 @@ public class GrpcProductSearchStub extends ProductSearchStub { private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; - private final UnaryCallable deleteProductSetCallable; - private final UnaryCallable deleteProductCallable; - private final UnaryCallable deleteReferenceImageCallable; private final UnaryCallable importProductSetsCallable; private final OperationCallable< ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> @@ -271,14 +268,17 @@ public class GrpcProductSearchStub extends ProductSearchStub { listProductSetsPagedCallable; private final UnaryCallable getProductSetCallable; private final UnaryCallable updateProductSetCallable; + private final UnaryCallable deleteProductSetCallable; private final UnaryCallable createProductCallable; private final UnaryCallable listProductsCallable; private final UnaryCallable listProductsPagedCallable; private final UnaryCallable getProductCallable; private final UnaryCallable updateProductCallable; + private final UnaryCallable deleteProductCallable; private final UnaryCallable createReferenceImageCallable; + private final UnaryCallable deleteReferenceImageCallable; private final UnaryCallable listReferenceImagesCallable; private final UnaryCallable @@ -336,45 +336,6 @@ protected GrpcProductSearchStub( this.callableFactory = callableFactory; this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - GrpcCallSettings deleteProductSetTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteProductSetMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteProductSetRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings deleteProductTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteProductMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteProductRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings deleteReferenceImageTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteReferenceImageMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteReferenceImageRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); GrpcCallSettings importProductSetsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(importProductSetsMethodDescriptor) @@ -442,6 +403,19 @@ public Map extract(UpdateProductSetRequest request) { } }) .build(); + GrpcCallSettings deleteProductSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteProductSetMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteProductSetRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); GrpcCallSettings createProductTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createProductMethodDescriptor) @@ -494,6 +468,19 @@ public Map extract(UpdateProductRequest request) { } }) .build(); + GrpcCallSettings deleteProductTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteProductMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteProductRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); GrpcCallSettings createReferenceImageTransportSettings = GrpcCallSettings.newBuilder() @@ -508,6 +495,19 @@ public Map extract(CreateReferenceImageRequest request) { } }) .build(); + GrpcCallSettings deleteReferenceImageTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteReferenceImageMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteReferenceImageRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); GrpcCallSettings listReferenceImagesTransportSettings = GrpcCallSettings.newBuilder() @@ -592,17 +592,6 @@ public Map extract(PurgeProductsRequest request) { }) .build(); - this.deleteProductSetCallable = - callableFactory.createUnaryCallable( - deleteProductSetTransportSettings, settings.deleteProductSetSettings(), clientContext); - this.deleteProductCallable = - callableFactory.createUnaryCallable( - deleteProductTransportSettings, settings.deleteProductSettings(), clientContext); - this.deleteReferenceImageCallable = - callableFactory.createUnaryCallable( - deleteReferenceImageTransportSettings, - settings.deleteReferenceImageSettings(), - clientContext); this.importProductSetsCallable = callableFactory.createUnaryCallable( importProductSetsTransportSettings, @@ -629,6 +618,9 @@ public Map extract(PurgeProductsRequest request) { this.updateProductSetCallable = callableFactory.createUnaryCallable( updateProductSetTransportSettings, settings.updateProductSetSettings(), clientContext); + this.deleteProductSetCallable = + callableFactory.createUnaryCallable( + deleteProductSetTransportSettings, settings.deleteProductSetSettings(), clientContext); this.createProductCallable = callableFactory.createUnaryCallable( createProductTransportSettings, settings.createProductSettings(), clientContext); @@ -644,11 +636,19 @@ public Map extract(PurgeProductsRequest request) { this.updateProductCallable = callableFactory.createUnaryCallable( updateProductTransportSettings, settings.updateProductSettings(), clientContext); + this.deleteProductCallable = + callableFactory.createUnaryCallable( + deleteProductTransportSettings, settings.deleteProductSettings(), clientContext); this.createReferenceImageCallable = callableFactory.createUnaryCallable( createReferenceImageTransportSettings, settings.createReferenceImageSettings(), clientContext); + this.deleteReferenceImageCallable = + callableFactory.createUnaryCallable( + deleteReferenceImageTransportSettings, + settings.deleteReferenceImageSettings(), + clientContext); this.listReferenceImagesCallable = callableFactory.createUnaryCallable( listReferenceImagesTransportSettings, @@ -702,18 +702,6 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } - public UnaryCallable deleteProductSetCallable() { - return deleteProductSetCallable; - } - - public UnaryCallable deleteProductCallable() { - return deleteProductCallable; - } - - public UnaryCallable deleteReferenceImageCallable() { - return deleteReferenceImageCallable; - } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable< ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> @@ -746,6 +734,10 @@ public UnaryCallable updateProductSetCallab return updateProductSetCallable; } + public UnaryCallable deleteProductSetCallable() { + return deleteProductSetCallable; + } + public UnaryCallable createProductCallable() { return createProductCallable; } @@ -766,10 +758,18 @@ public UnaryCallable updateProductCallable() { return updateProductCallable; } + public UnaryCallable deleteProductCallable() { + return deleteProductCallable; + } + public UnaryCallable createReferenceImageCallable() { return createReferenceImageCallable; } + public UnaryCallable deleteReferenceImageCallable() { + return deleteReferenceImageCallable; + } + public UnaryCallable listReferenceImagesPagedCallable() { return listReferenceImagesPagedCallable; diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ImageAnnotatorStub.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ImageAnnotatorStub.java index 3fc2bf7f4..07bd3446f 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ImageAnnotatorStub.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ImageAnnotatorStub.java @@ -47,16 +47,6 @@ public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } - public UnaryCallable - batchAnnotateImagesCallable() { - throw new UnsupportedOperationException("Not implemented: batchAnnotateImagesCallable()"); - } - - public UnaryCallable - batchAnnotateFilesCallable() { - throw new UnsupportedOperationException("Not implemented: batchAnnotateFilesCallable()"); - } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable< AsyncBatchAnnotateImagesRequest, AsyncBatchAnnotateImagesResponse, OperationMetadata> @@ -83,6 +73,16 @@ public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: asyncBatchAnnotateFilesCallable()"); } + public UnaryCallable + batchAnnotateImagesCallable() { + throw new UnsupportedOperationException("Not implemented: batchAnnotateImagesCallable()"); + } + + public UnaryCallable + batchAnnotateFilesCallable() { + throw new UnsupportedOperationException("Not implemented: batchAnnotateFilesCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ImageAnnotatorStubSettings.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ImageAnnotatorStubSettings.java index 257a623fb..7df9cff7c 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ImageAnnotatorStubSettings.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ImageAnnotatorStubSettings.java @@ -94,10 +94,6 @@ public class ImageAnnotatorStubSettings extends StubSettings - batchAnnotateImagesSettings; - private final UnaryCallSettings - batchAnnotateFilesSettings; private final UnaryCallSettings asyncBatchAnnotateImagesSettings; private final OperationCallSettings< @@ -108,18 +104,10 @@ public class ImageAnnotatorStubSettings extends StubSettings asyncBatchAnnotateFilesOperationSettings; - - /** Returns the object with the settings used for calls to batchAnnotateImages. */ - public UnaryCallSettings - batchAnnotateImagesSettings() { - return batchAnnotateImagesSettings; - } - - /** Returns the object with the settings used for calls to batchAnnotateFiles. */ - public UnaryCallSettings - batchAnnotateFilesSettings() { - return batchAnnotateFilesSettings; - } + private final UnaryCallSettings + batchAnnotateImagesSettings; + private final UnaryCallSettings + batchAnnotateFilesSettings; /** Returns the object with the settings used for calls to asyncBatchAnnotateImages. */ public UnaryCallSettings @@ -149,6 +137,18 @@ public class ImageAnnotatorStubSettings extends StubSettings + batchAnnotateImagesSettings() { + return batchAnnotateImagesSettings; + } + + /** Returns the object with the settings used for calls to batchAnnotateFiles. */ + public UnaryCallSettings + batchAnnotateFilesSettings() { + return batchAnnotateFilesSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public ImageAnnotatorStub createStub() throws IOException { if (getTransportChannelProvider() @@ -218,24 +218,20 @@ public Builder toBuilder() { protected ImageAnnotatorStubSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder); - batchAnnotateImagesSettings = settingsBuilder.batchAnnotateImagesSettings().build(); - batchAnnotateFilesSettings = settingsBuilder.batchAnnotateFilesSettings().build(); asyncBatchAnnotateImagesSettings = settingsBuilder.asyncBatchAnnotateImagesSettings().build(); asyncBatchAnnotateImagesOperationSettings = settingsBuilder.asyncBatchAnnotateImagesOperationSettings().build(); asyncBatchAnnotateFilesSettings = settingsBuilder.asyncBatchAnnotateFilesSettings().build(); asyncBatchAnnotateFilesOperationSettings = settingsBuilder.asyncBatchAnnotateFilesOperationSettings().build(); + batchAnnotateImagesSettings = settingsBuilder.batchAnnotateImagesSettings().build(); + batchAnnotateFilesSettings = settingsBuilder.batchAnnotateFilesSettings().build(); } /** Builder for ImageAnnotatorStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder - batchAnnotateImagesSettings; - private final UnaryCallSettings.Builder - batchAnnotateFilesSettings; private final UnaryCallSettings.Builder asyncBatchAnnotateImagesSettings; private final OperationCallSettings.Builder< @@ -246,6 +242,10 @@ public static class Builder extends StubSettings.Builder asyncBatchAnnotateFilesOperationSettings; + private final UnaryCallSettings.Builder + batchAnnotateImagesSettings; + private final UnaryCallSettings.Builder + batchAnnotateFilesSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -254,11 +254,8 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "idempotent", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + "retry_policy_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -272,12 +269,14 @@ public static class Builder extends StubSettings.Builder>of( - batchAnnotateImagesSettings, - batchAnnotateFilesSettings, asyncBatchAnnotateImagesSettings, - asyncBatchAnnotateFilesSettings); + asyncBatchAnnotateFilesSettings, + batchAnnotateImagesSettings, + batchAnnotateFilesSettings); initDefaults(this); } @@ -322,31 +321,31 @@ private static Builder createDefault() { private static Builder initDefaults(Builder builder) { builder - .batchAnnotateImagesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .asyncBatchAnnotateImagesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder - .batchAnnotateFilesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .asyncBatchAnnotateFilesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder - .asyncBatchAnnotateImagesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .batchAnnotateImagesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder - .asyncBatchAnnotateFilesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .batchAnnotateFilesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .asyncBatchAnnotateImagesOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create( @@ -369,8 +368,8 @@ private static Builder initDefaults(Builder builder) { .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create( @@ -395,21 +394,21 @@ private static Builder initDefaults(Builder builder) { protected Builder(ImageAnnotatorStubSettings settings) { super(settings); - batchAnnotateImagesSettings = settings.batchAnnotateImagesSettings.toBuilder(); - batchAnnotateFilesSettings = settings.batchAnnotateFilesSettings.toBuilder(); asyncBatchAnnotateImagesSettings = settings.asyncBatchAnnotateImagesSettings.toBuilder(); asyncBatchAnnotateImagesOperationSettings = settings.asyncBatchAnnotateImagesOperationSettings.toBuilder(); asyncBatchAnnotateFilesSettings = settings.asyncBatchAnnotateFilesSettings.toBuilder(); asyncBatchAnnotateFilesOperationSettings = settings.asyncBatchAnnotateFilesOperationSettings.toBuilder(); + batchAnnotateImagesSettings = settings.batchAnnotateImagesSettings.toBuilder(); + batchAnnotateFilesSettings = settings.batchAnnotateFilesSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( - batchAnnotateImagesSettings, - batchAnnotateFilesSettings, asyncBatchAnnotateImagesSettings, - asyncBatchAnnotateFilesSettings); + asyncBatchAnnotateFilesSettings, + batchAnnotateImagesSettings, + batchAnnotateFilesSettings); } // NEXT_MAJOR_VER: remove 'throws Exception' @@ -428,18 +427,6 @@ public Builder applyToAllUnaryMethods( return unaryMethodSettingsBuilders; } - /** Returns the builder for the settings used for calls to batchAnnotateImages. */ - public UnaryCallSettings.Builder - batchAnnotateImagesSettings() { - return batchAnnotateImagesSettings; - } - - /** Returns the builder for the settings used for calls to batchAnnotateFiles. */ - public UnaryCallSettings.Builder - batchAnnotateFilesSettings() { - return batchAnnotateFilesSettings; - } - /** Returns the builder for the settings used for calls to asyncBatchAnnotateImages. */ public UnaryCallSettings.Builder asyncBatchAnnotateImagesSettings() { @@ -470,6 +457,18 @@ public Builder applyToAllUnaryMethods( return asyncBatchAnnotateFilesOperationSettings; } + /** Returns the builder for the settings used for calls to batchAnnotateImages. */ + public UnaryCallSettings.Builder + batchAnnotateImagesSettings() { + return batchAnnotateImagesSettings; + } + + /** Returns the builder for the settings used for calls to batchAnnotateFiles. */ + public UnaryCallSettings.Builder + batchAnnotateFilesSettings() { + return batchAnnotateFilesSettings; + } + @Override public ImageAnnotatorStubSettings build() throws IOException { return new ImageAnnotatorStubSettings(this); diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ProductSearchStub.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ProductSearchStub.java index 3917da741..91a5a2a8f 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ProductSearchStub.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ProductSearchStub.java @@ -72,18 +72,6 @@ public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } - public UnaryCallable deleteProductSetCallable() { - throw new UnsupportedOperationException("Not implemented: deleteProductSetCallable()"); - } - - public UnaryCallable deleteProductCallable() { - throw new UnsupportedOperationException("Not implemented: deleteProductCallable()"); - } - - public UnaryCallable deleteReferenceImageCallable() { - throw new UnsupportedOperationException("Not implemented: deleteReferenceImageCallable()"); - } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable< ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata> @@ -117,6 +105,10 @@ public UnaryCallable updateProductSetCallab throw new UnsupportedOperationException("Not implemented: updateProductSetCallable()"); } + public UnaryCallable deleteProductSetCallable() { + throw new UnsupportedOperationException("Not implemented: deleteProductSetCallable()"); + } + public UnaryCallable createProductCallable() { throw new UnsupportedOperationException("Not implemented: createProductCallable()"); } @@ -137,10 +129,18 @@ public UnaryCallable updateProductCallable() { throw new UnsupportedOperationException("Not implemented: updateProductCallable()"); } + public UnaryCallable deleteProductCallable() { + throw new UnsupportedOperationException("Not implemented: deleteProductCallable()"); + } + public UnaryCallable createReferenceImageCallable() { throw new UnsupportedOperationException("Not implemented: createReferenceImageCallable()"); } + public UnaryCallable deleteReferenceImageCallable() { + throw new UnsupportedOperationException("Not implemented: deleteReferenceImageCallable()"); + } + public UnaryCallable listReferenceImagesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listReferenceImagesPagedCallable()"); diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ProductSearchStubSettings.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ProductSearchStubSettings.java index 468a74104..dc1b4612c 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ProductSearchStubSettings.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p4beta1/stub/ProductSearchStubSettings.java @@ -100,16 +100,16 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of deleteProductSet to 30 seconds: + *

For example, to set the total timeout of createProductSet to 30 seconds: * *

  * 
  * ProductSearchStubSettings.Builder productSearchSettingsBuilder =
  *     ProductSearchStubSettings.newBuilder();
  * productSearchSettingsBuilder
- *     .deleteProductSetSettings()
+ *     .createProductSetSettings()
  *     .setRetrySettings(
- *         productSearchSettingsBuilder.deleteProductSetSettings().getRetrySettings().toBuilder()
+ *         productSearchSettingsBuilder.createProductSetSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * ProductSearchStubSettings productSearchSettings = productSearchSettingsBuilder.build();
@@ -126,9 +126,6 @@ public class ProductSearchStubSettings extends StubSettings deleteProductSetSettings;
-  private final UnaryCallSettings deleteProductSettings;
-  private final UnaryCallSettings deleteReferenceImageSettings;
   private final UnaryCallSettings importProductSetsSettings;
   private final OperationCallSettings<
           ImportProductSetsRequest, ImportProductSetsResponse, BatchOperationMetadata>
@@ -139,14 +136,17 @@ public class ProductSearchStubSettings extends StubSettings getProductSetSettings;
   private final UnaryCallSettings updateProductSetSettings;
+  private final UnaryCallSettings deleteProductSetSettings;
   private final UnaryCallSettings createProductSettings;
   private final PagedCallSettings<
           ListProductsRequest, ListProductsResponse, ListProductsPagedResponse>
       listProductsSettings;
   private final UnaryCallSettings getProductSettings;
   private final UnaryCallSettings updateProductSettings;
+  private final UnaryCallSettings deleteProductSettings;
   private final UnaryCallSettings
       createReferenceImageSettings;
+  private final UnaryCallSettings deleteReferenceImageSettings;
   private final PagedCallSettings<
           ListReferenceImagesRequest, ListReferenceImagesResponse, ListReferenceImagesPagedResponse>
       listReferenceImagesSettings;
@@ -165,21 +165,6 @@ public class ProductSearchStubSettings extends StubSettings
       purgeProductsOperationSettings;
 
-  /** Returns the object with the settings used for calls to deleteProductSet. */
-  public UnaryCallSettings deleteProductSetSettings() {
-    return deleteProductSetSettings;
-  }
-
-  /** Returns the object with the settings used for calls to deleteProduct. */
-  public UnaryCallSettings deleteProductSettings() {
-    return deleteProductSettings;
-  }
-
-  /** Returns the object with the settings used for calls to deleteReferenceImage. */
-  public UnaryCallSettings deleteReferenceImageSettings() {
-    return deleteReferenceImageSettings;
-  }
-
   /** Returns the object with the settings used for calls to importProductSets. */
   public UnaryCallSettings importProductSetsSettings() {
     return importProductSetsSettings;
@@ -215,6 +200,11 @@ public UnaryCallSettings updateProductSetSe
     return updateProductSetSettings;
   }
 
+  /** Returns the object with the settings used for calls to deleteProductSet. */
+  public UnaryCallSettings deleteProductSetSettings() {
+    return deleteProductSetSettings;
+  }
+
   /** Returns the object with the settings used for calls to createProduct. */
   public UnaryCallSettings createProductSettings() {
     return createProductSettings;
@@ -236,12 +226,22 @@ public UnaryCallSettings updateProductSettings()
     return updateProductSettings;
   }
 
+  /** Returns the object with the settings used for calls to deleteProduct. */
+  public UnaryCallSettings deleteProductSettings() {
+    return deleteProductSettings;
+  }
+
   /** Returns the object with the settings used for calls to createReferenceImage. */
   public UnaryCallSettings
       createReferenceImageSettings() {
     return createReferenceImageSettings;
   }
 
+  /** Returns the object with the settings used for calls to deleteReferenceImage. */
+  public UnaryCallSettings deleteReferenceImageSettings() {
+    return deleteReferenceImageSettings;
+  }
+
   /** Returns the object with the settings used for calls to listReferenceImages. */
   public PagedCallSettings<
           ListReferenceImagesRequest, ListReferenceImagesResponse, ListReferenceImagesPagedResponse>
@@ -355,9 +355,6 @@ public Builder toBuilder() {
   protected ProductSearchStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    deleteProductSetSettings = settingsBuilder.deleteProductSetSettings().build();
-    deleteProductSettings = settingsBuilder.deleteProductSettings().build();
-    deleteReferenceImageSettings = settingsBuilder.deleteReferenceImageSettings().build();
     importProductSetsSettings = settingsBuilder.importProductSetsSettings().build();
     importProductSetsOperationSettings =
         settingsBuilder.importProductSetsOperationSettings().build();
@@ -365,11 +362,14 @@ protected ProductSearchStubSettings(Builder settingsBuilder) throws IOException
     listProductSetsSettings = settingsBuilder.listProductSetsSettings().build();
     getProductSetSettings = settingsBuilder.getProductSetSettings().build();
     updateProductSetSettings = settingsBuilder.updateProductSetSettings().build();
+    deleteProductSetSettings = settingsBuilder.deleteProductSetSettings().build();
     createProductSettings = settingsBuilder.createProductSettings().build();
     listProductsSettings = settingsBuilder.listProductsSettings().build();
     getProductSettings = settingsBuilder.getProductSettings().build();
     updateProductSettings = settingsBuilder.updateProductSettings().build();
+    deleteProductSettings = settingsBuilder.deleteProductSettings().build();
     createReferenceImageSettings = settingsBuilder.createReferenceImageSettings().build();
+    deleteReferenceImageSettings = settingsBuilder.deleteReferenceImageSettings().build();
     listReferenceImagesSettings = settingsBuilder.listReferenceImagesSettings().build();
     getReferenceImageSettings = settingsBuilder.getReferenceImageSettings().build();
     addProductToProductSetSettings = settingsBuilder.addProductToProductSetSettings().build();
@@ -623,11 +623,6 @@ public ApiFuture getFuturePagedResponse(
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder
-        deleteProductSetSettings;
-    private final UnaryCallSettings.Builder deleteProductSettings;
-    private final UnaryCallSettings.Builder
-        deleteReferenceImageSettings;
     private final UnaryCallSettings.Builder
         importProductSetsSettings;
     private final OperationCallSettings.Builder<
@@ -641,14 +636,19 @@ public static class Builder extends StubSettings.Builder getProductSetSettings;
     private final UnaryCallSettings.Builder
         updateProductSetSettings;
+    private final UnaryCallSettings.Builder
+        deleteProductSetSettings;
     private final UnaryCallSettings.Builder createProductSettings;
     private final PagedCallSettings.Builder<
             ListProductsRequest, ListProductsResponse, ListProductsPagedResponse>
         listProductsSettings;
     private final UnaryCallSettings.Builder getProductSettings;
     private final UnaryCallSettings.Builder updateProductSettings;
+    private final UnaryCallSettings.Builder deleteProductSettings;
     private final UnaryCallSettings.Builder
         createReferenceImageSettings;
+    private final UnaryCallSettings.Builder
+        deleteReferenceImageSettings;
     private final PagedCallSettings.Builder<
             ListReferenceImagesRequest,
             ListReferenceImagesResponse,
@@ -675,12 +675,14 @@ public static class Builder extends StubSettings.Builder> definitions =
           ImmutableMap.builder();
+      definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList()));
       definitions.put(
-          "idempotent",
+          "retry_policy_3_codes",
           ImmutableSet.copyOf(
               Lists.newArrayList(
                   StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
-      definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
+      definitions.put(
+          "retry_policy_2_codes", ImmutableSet.copyOf(Lists.newArrayList()));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -694,12 +696,25 @@ public static class Builder extends StubSettings.Builder>of(
-              deleteProductSetSettings,
-              deleteProductSettings,
-              deleteReferenceImageSettings,
               importProductSetsSettings,
               createProductSetSettings,
               listProductSetsSettings,
               getProductSetSettings,
               updateProductSetSettings,
+              deleteProductSetSettings,
               createProductSettings,
               listProductsSettings,
               getProductSettings,
               updateProductSettings,
+              deleteProductSettings,
               createReferenceImageSettings,
+              deleteReferenceImageSettings,
               listReferenceImagesSettings,
               getReferenceImageSettings,
               addProductToProductSetSettings,
@@ -790,107 +805,107 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
-      builder
-          .deleteProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
-
-      builder
-          .deleteProductSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
-
-      builder
-          .deleteReferenceImageSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
-
       builder
           .importProductSetsSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
 
       builder
           .createProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
 
       builder
           .listProductSetsSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .getProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .updateProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
+
+      builder
+          .deleteProductSetSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .createProductSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
 
       builder
           .listProductsSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .getProductSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .updateProductSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
+
+      builder
+          .deleteProductSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .createReferenceImageSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
+
+      builder
+          .deleteReferenceImageSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .listReferenceImagesSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .getReferenceImageSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .addProductToProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
 
       builder
           .removeProductFromProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));
 
       builder
           .listProductsInProductSetSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
 
       builder
           .purgeProductsSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
       builder
           .importProductSetsOperationSettings()
           .setInitialCallSettings(
               UnaryCallSettings
                   .newUnaryCallSettingsBuilder()
-                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
+                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
+                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"))
                   .build())
           .setResponseTransformer(
               ProtoOperationTransformers.ResponseTransformer.create(
@@ -913,8 +928,8 @@ private static Builder initDefaults(Builder builder) {
           .setInitialCallSettings(
               UnaryCallSettings
                   .newUnaryCallSettingsBuilder()
-                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
+                  .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+                  .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"))
                   .build())
           .setResponseTransformer(
               ProtoOperationTransformers.ResponseTransformer.create(Empty.class))
@@ -938,20 +953,20 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(ProductSearchStubSettings settings) {
       super(settings);
 
-      deleteProductSetSettings = settings.deleteProductSetSettings.toBuilder();
-      deleteProductSettings = settings.deleteProductSettings.toBuilder();
-      deleteReferenceImageSettings = settings.deleteReferenceImageSettings.toBuilder();
       importProductSetsSettings = settings.importProductSetsSettings.toBuilder();
       importProductSetsOperationSettings = settings.importProductSetsOperationSettings.toBuilder();
       createProductSetSettings = settings.createProductSetSettings.toBuilder();
       listProductSetsSettings = settings.listProductSetsSettings.toBuilder();
       getProductSetSettings = settings.getProductSetSettings.toBuilder();
       updateProductSetSettings = settings.updateProductSetSettings.toBuilder();
+      deleteProductSetSettings = settings.deleteProductSetSettings.toBuilder();
       createProductSettings = settings.createProductSettings.toBuilder();
       listProductsSettings = settings.listProductsSettings.toBuilder();
       getProductSettings = settings.getProductSettings.toBuilder();
       updateProductSettings = settings.updateProductSettings.toBuilder();
+      deleteProductSettings = settings.deleteProductSettings.toBuilder();
       createReferenceImageSettings = settings.createReferenceImageSettings.toBuilder();
+      deleteReferenceImageSettings = settings.deleteReferenceImageSettings.toBuilder();
       listReferenceImagesSettings = settings.listReferenceImagesSettings.toBuilder();
       getReferenceImageSettings = settings.getReferenceImageSettings.toBuilder();
       addProductToProductSetSettings = settings.addProductToProductSetSettings.toBuilder();
@@ -963,19 +978,19 @@ protected Builder(ProductSearchStubSettings settings) {
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
-              deleteProductSetSettings,
-              deleteProductSettings,
-              deleteReferenceImageSettings,
               importProductSetsSettings,
               createProductSetSettings,
               listProductSetsSettings,
               getProductSetSettings,
               updateProductSetSettings,
+              deleteProductSetSettings,
               createProductSettings,
               listProductsSettings,
               getProductSettings,
               updateProductSettings,
+              deleteProductSettings,
               createReferenceImageSettings,
+              deleteReferenceImageSettings,
               listReferenceImagesSettings,
               getReferenceImageSettings,
               addProductToProductSetSettings,
@@ -1000,22 +1015,6 @@ public Builder applyToAllUnaryMethods(
       return unaryMethodSettingsBuilders;
     }
 
-    /** Returns the builder for the settings used for calls to deleteProductSet. */
-    public UnaryCallSettings.Builder deleteProductSetSettings() {
-      return deleteProductSetSettings;
-    }
-
-    /** Returns the builder for the settings used for calls to deleteProduct. */
-    public UnaryCallSettings.Builder deleteProductSettings() {
-      return deleteProductSettings;
-    }
-
-    /** Returns the builder for the settings used for calls to deleteReferenceImage. */
-    public UnaryCallSettings.Builder
-        deleteReferenceImageSettings() {
-      return deleteReferenceImageSettings;
-    }
-
     /** Returns the builder for the settings used for calls to importProductSets. */
     public UnaryCallSettings.Builder
         importProductSetsSettings() {
@@ -1055,6 +1054,11 @@ public UnaryCallSettings.Builder getProductSet
       return updateProductSetSettings;
     }
 
+    /** Returns the builder for the settings used for calls to deleteProductSet. */
+    public UnaryCallSettings.Builder deleteProductSetSettings() {
+      return deleteProductSetSettings;
+    }
+
     /** Returns the builder for the settings used for calls to createProduct. */
     public UnaryCallSettings.Builder createProductSettings() {
       return createProductSettings;
@@ -1077,12 +1081,23 @@ public UnaryCallSettings.Builder updateProductSet
       return updateProductSettings;
     }
 
+    /** Returns the builder for the settings used for calls to deleteProduct. */
+    public UnaryCallSettings.Builder deleteProductSettings() {
+      return deleteProductSettings;
+    }
+
     /** Returns the builder for the settings used for calls to createReferenceImage. */
     public UnaryCallSettings.Builder
         createReferenceImageSettings() {
       return createReferenceImageSettings;
     }
 
+    /** Returns the builder for the settings used for calls to deleteReferenceImage. */
+    public UnaryCallSettings.Builder
+        deleteReferenceImageSettings() {
+      return deleteReferenceImageSettings;
+    }
+
     /** Returns the builder for the settings used for calls to listReferenceImages. */
     public PagedCallSettings.Builder<
             ListReferenceImagesRequest,
diff --git a/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/ImageAnnotatorClientTest.java b/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/ImageAnnotatorClientTest.java
index 496bc8dad..33b0a15bd 100644
--- a/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/ImageAnnotatorClientTest.java
+++ b/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/ImageAnnotatorClientTest.java
@@ -82,44 +82,6 @@ public void tearDown() throws Exception {
     client.close();
   }
 
-  @Test
-  @SuppressWarnings("all")
-  public void batchAnnotateImagesTest() {
-    BatchAnnotateImagesResponse expectedResponse = BatchAnnotateImagesResponse.newBuilder().build();
-    mockImageAnnotator.addResponse(expectedResponse);
-
-    List requests = new ArrayList<>();
-
-    BatchAnnotateImagesResponse actualResponse = client.batchAnnotateImages(requests);
-    Assert.assertEquals(expectedResponse, actualResponse);
-
-    List actualRequests = mockImageAnnotator.getRequests();
-    Assert.assertEquals(1, actualRequests.size());
-    BatchAnnotateImagesRequest actualRequest = (BatchAnnotateImagesRequest) actualRequests.get(0);
-
-    Assert.assertEquals(requests, actualRequest.getRequestsList());
-    Assert.assertTrue(
-        channelProvider.isHeaderSent(
-            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
-            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void batchAnnotateImagesExceptionTest() throws Exception {
-    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
-    mockImageAnnotator.addException(exception);
-
-    try {
-      List requests = new ArrayList<>();
-
-      client.batchAnnotateImages(requests);
-      Assert.fail("No exception raised");
-    } catch (InvalidArgumentException e) {
-      // Expected exception
-    }
-  }
-
   @Test
   @SuppressWarnings("all")
   public void batchAnnotateFilesTest() {
@@ -258,4 +220,42 @@ public void asyncBatchAnnotateFilesExceptionTest() throws Exception {
       Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode());
     }
   }
+
+  @Test
+  @SuppressWarnings("all")
+  public void batchAnnotateImagesTest() {
+    BatchAnnotateImagesResponse expectedResponse = BatchAnnotateImagesResponse.newBuilder().build();
+    mockImageAnnotator.addResponse(expectedResponse);
+
+    List requests = new ArrayList<>();
+
+    BatchAnnotateImagesResponse actualResponse = client.batchAnnotateImages(requests);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockImageAnnotator.getRequests();
+    Assert.assertEquals(1, actualRequests.size());
+    BatchAnnotateImagesRequest actualRequest = (BatchAnnotateImagesRequest) actualRequests.get(0);
+
+    Assert.assertEquals(requests, actualRequest.getRequestsList());
+    Assert.assertTrue(
+        channelProvider.isHeaderSent(
+            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
+            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void batchAnnotateImagesExceptionTest() throws Exception {
+    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
+    mockImageAnnotator.addException(exception);
+
+    try {
+      List requests = new ArrayList<>();
+
+      client.batchAnnotateImages(requests);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception
+    }
+  }
 }
diff --git a/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/ProductSearchClientTest.java b/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/ProductSearchClientTest.java
index c2e27ac06..b54b8d771 100644
--- a/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/ProductSearchClientTest.java
+++ b/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/ProductSearchClientTest.java
@@ -89,6 +89,102 @@ public void tearDown() throws Exception {
     client.close();
   }
 
+  @Test
+  @SuppressWarnings("all")
+  public void importProductSetsTest() throws Exception {
+    ImportProductSetsResponse expectedResponse = ImportProductSetsResponse.newBuilder().build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("importProductSetsTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockProductSearch.addResponse(resultOperation);
+
+    LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+    ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
+
+    ImportProductSetsResponse actualResponse =
+        client.importProductSetsAsync(parent, inputConfig).get();
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockProductSearch.getRequests();
+    Assert.assertEquals(1, actualRequests.size());
+    ImportProductSetsRequest actualRequest = (ImportProductSetsRequest) actualRequests.get(0);
+
+    Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent()));
+    Assert.assertEquals(inputConfig, actualRequest.getInputConfig());
+    Assert.assertTrue(
+        channelProvider.isHeaderSent(
+            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
+            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void importProductSetsExceptionTest() throws Exception {
+    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
+    mockProductSearch.addException(exception);
+
+    try {
+      LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+      ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
+
+      client.importProductSetsAsync(parent, inputConfig).get();
+      Assert.fail("No exception raised");
+    } catch (ExecutionException e) {
+      Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass());
+      InvalidArgumentException apiException = (InvalidArgumentException) e.getCause();
+      Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode());
+    }
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void purgeProductsTest() throws Exception {
+    Empty expectedResponse = Empty.newBuilder().build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("purgeProductsTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockProductSearch.addResponse(resultOperation);
+
+    LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+
+    Empty actualResponse = client.purgeProductsAsync(parent).get();
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockProductSearch.getRequests();
+    Assert.assertEquals(1, actualRequests.size());
+    PurgeProductsRequest actualRequest = (PurgeProductsRequest) actualRequests.get(0);
+
+    Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent()));
+    Assert.assertTrue(
+        channelProvider.isHeaderSent(
+            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
+            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void purgeProductsExceptionTest() throws Exception {
+    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
+    mockProductSearch.addException(exception);
+
+    try {
+      LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+
+      client.purgeProductsAsync(parent).get();
+      Assert.fail("No exception raised");
+    } catch (ExecutionException e) {
+      Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass());
+      InvalidArgumentException apiException = (InvalidArgumentException) e.getCause();
+      Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode());
+    }
+  }
+
   @Test
   @SuppressWarnings("all")
   public void createProductSetTest() {
@@ -856,100 +952,4 @@ public void listProductsInProductSetExceptionTest() throws Exception {
       // Expected exception
     }
   }
-
-  @Test
-  @SuppressWarnings("all")
-  public void importProductSetsTest() throws Exception {
-    ImportProductSetsResponse expectedResponse = ImportProductSetsResponse.newBuilder().build();
-    Operation resultOperation =
-        Operation.newBuilder()
-            .setName("importProductSetsTest")
-            .setDone(true)
-            .setResponse(Any.pack(expectedResponse))
-            .build();
-    mockProductSearch.addResponse(resultOperation);
-
-    LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-    ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
-
-    ImportProductSetsResponse actualResponse =
-        client.importProductSetsAsync(parent, inputConfig).get();
-    Assert.assertEquals(expectedResponse, actualResponse);
-
-    List actualRequests = mockProductSearch.getRequests();
-    Assert.assertEquals(1, actualRequests.size());
-    ImportProductSetsRequest actualRequest = (ImportProductSetsRequest) actualRequests.get(0);
-
-    Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent()));
-    Assert.assertEquals(inputConfig, actualRequest.getInputConfig());
-    Assert.assertTrue(
-        channelProvider.isHeaderSent(
-            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
-            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void importProductSetsExceptionTest() throws Exception {
-    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
-    mockProductSearch.addException(exception);
-
-    try {
-      LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-      ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
-
-      client.importProductSetsAsync(parent, inputConfig).get();
-      Assert.fail("No exception raised");
-    } catch (ExecutionException e) {
-      Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass());
-      InvalidArgumentException apiException = (InvalidArgumentException) e.getCause();
-      Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode());
-    }
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void purgeProductsTest() throws Exception {
-    Empty expectedResponse = Empty.newBuilder().build();
-    Operation resultOperation =
-        Operation.newBuilder()
-            .setName("purgeProductsTest")
-            .setDone(true)
-            .setResponse(Any.pack(expectedResponse))
-            .build();
-    mockProductSearch.addResponse(resultOperation);
-
-    LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-
-    Empty actualResponse = client.purgeProductsAsync(parent).get();
-    Assert.assertEquals(expectedResponse, actualResponse);
-
-    List actualRequests = mockProductSearch.getRequests();
-    Assert.assertEquals(1, actualRequests.size());
-    PurgeProductsRequest actualRequest = (PurgeProductsRequest) actualRequests.get(0);
-
-    Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent()));
-    Assert.assertTrue(
-        channelProvider.isHeaderSent(
-            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
-            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void purgeProductsExceptionTest() throws Exception {
-    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
-    mockProductSearch.addException(exception);
-
-    try {
-      LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-
-      client.purgeProductsAsync(parent).get();
-      Assert.fail("No exception raised");
-    } catch (ExecutionException e) {
-      Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass());
-      InvalidArgumentException apiException = (InvalidArgumentException) e.getCause();
-      Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode());
-    }
-  }
 }
diff --git a/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p2beta1/ImageAnnotatorClientTest.java b/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p2beta1/ImageAnnotatorClientTest.java
index 1d1f20039..11dd50ddf 100644
--- a/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p2beta1/ImageAnnotatorClientTest.java
+++ b/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p2beta1/ImageAnnotatorClientTest.java
@@ -81,18 +81,27 @@ public void tearDown() throws Exception {
 
   @Test
   @SuppressWarnings("all")
-  public void batchAnnotateImagesTest() {
-    BatchAnnotateImagesResponse expectedResponse = BatchAnnotateImagesResponse.newBuilder().build();
-    mockImageAnnotator.addResponse(expectedResponse);
+  public void asyncBatchAnnotateFilesTest() throws Exception {
+    AsyncBatchAnnotateFilesResponse expectedResponse =
+        AsyncBatchAnnotateFilesResponse.newBuilder().build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("asyncBatchAnnotateFilesTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockImageAnnotator.addResponse(resultOperation);
 
-    List requests = new ArrayList<>();
+    List requests = new ArrayList<>();
 
-    BatchAnnotateImagesResponse actualResponse = client.batchAnnotateImages(requests);
+    AsyncBatchAnnotateFilesResponse actualResponse =
+        client.asyncBatchAnnotateFilesAsync(requests).get();
     Assert.assertEquals(expectedResponse, actualResponse);
 
     List actualRequests = mockImageAnnotator.getRequests();
     Assert.assertEquals(1, actualRequests.size());
-    BatchAnnotateImagesRequest actualRequest = (BatchAnnotateImagesRequest) actualRequests.get(0);
+    AsyncBatchAnnotateFilesRequest actualRequest =
+        (AsyncBatchAnnotateFilesRequest) actualRequests.get(0);
 
     Assert.assertEquals(requests, actualRequest.getRequestsList());
     Assert.assertTrue(
@@ -103,43 +112,36 @@ public void batchAnnotateImagesTest() {
 
   @Test
   @SuppressWarnings("all")
-  public void batchAnnotateImagesExceptionTest() throws Exception {
+  public void asyncBatchAnnotateFilesExceptionTest() throws Exception {
     StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
     mockImageAnnotator.addException(exception);
 
     try {
-      List requests = new ArrayList<>();
+      List requests = new ArrayList<>();
 
-      client.batchAnnotateImages(requests);
+      client.asyncBatchAnnotateFilesAsync(requests).get();
       Assert.fail("No exception raised");
-    } catch (InvalidArgumentException e) {
-      // Expected exception
+    } catch (ExecutionException e) {
+      Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass());
+      InvalidArgumentException apiException = (InvalidArgumentException) e.getCause();
+      Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode());
     }
   }
 
   @Test
   @SuppressWarnings("all")
-  public void asyncBatchAnnotateFilesTest() throws Exception {
-    AsyncBatchAnnotateFilesResponse expectedResponse =
-        AsyncBatchAnnotateFilesResponse.newBuilder().build();
-    Operation resultOperation =
-        Operation.newBuilder()
-            .setName("asyncBatchAnnotateFilesTest")
-            .setDone(true)
-            .setResponse(Any.pack(expectedResponse))
-            .build();
-    mockImageAnnotator.addResponse(resultOperation);
+  public void batchAnnotateImagesTest() {
+    BatchAnnotateImagesResponse expectedResponse = BatchAnnotateImagesResponse.newBuilder().build();
+    mockImageAnnotator.addResponse(expectedResponse);
 
-    List requests = new ArrayList<>();
+    List requests = new ArrayList<>();
 
-    AsyncBatchAnnotateFilesResponse actualResponse =
-        client.asyncBatchAnnotateFilesAsync(requests).get();
+    BatchAnnotateImagesResponse actualResponse = client.batchAnnotateImages(requests);
     Assert.assertEquals(expectedResponse, actualResponse);
 
     List actualRequests = mockImageAnnotator.getRequests();
     Assert.assertEquals(1, actualRequests.size());
-    AsyncBatchAnnotateFilesRequest actualRequest =
-        (AsyncBatchAnnotateFilesRequest) actualRequests.get(0);
+    BatchAnnotateImagesRequest actualRequest = (BatchAnnotateImagesRequest) actualRequests.get(0);
 
     Assert.assertEquals(requests, actualRequest.getRequestsList());
     Assert.assertTrue(
@@ -150,19 +152,17 @@ public void asyncBatchAnnotateFilesTest() throws Exception {
 
   @Test
   @SuppressWarnings("all")
-  public void asyncBatchAnnotateFilesExceptionTest() throws Exception {
+  public void batchAnnotateImagesExceptionTest() throws Exception {
     StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
     mockImageAnnotator.addException(exception);
 
     try {
-      List requests = new ArrayList<>();
+      List requests = new ArrayList<>();
 
-      client.asyncBatchAnnotateFilesAsync(requests).get();
+      client.batchAnnotateImages(requests);
       Assert.fail("No exception raised");
-    } catch (ExecutionException e) {
-      Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass());
-      InvalidArgumentException apiException = (InvalidArgumentException) e.getCause();
-      Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode());
+    } catch (InvalidArgumentException e) {
+      // Expected exception
     }
   }
 }
diff --git a/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/ProductSearchClientTest.java b/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/ProductSearchClientTest.java
index b081b0e90..cf889f134 100644
--- a/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/ProductSearchClientTest.java
+++ b/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p3beta1/ProductSearchClientTest.java
@@ -89,119 +89,6 @@ public void tearDown() throws Exception {
     client.close();
   }
 
-  @Test
-  @SuppressWarnings("all")
-  public void deleteProductSetTest() {
-    Empty expectedResponse = Empty.newBuilder().build();
-    mockProductSearch.addResponse(expectedResponse);
-
-    ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-
-    client.deleteProductSet(name);
-
-    List actualRequests = mockProductSearch.getRequests();
-    Assert.assertEquals(1, actualRequests.size());
-    DeleteProductSetRequest actualRequest = (DeleteProductSetRequest) actualRequests.get(0);
-
-    Assert.assertEquals(name, ProductSetName.parse(actualRequest.getName()));
-    Assert.assertTrue(
-        channelProvider.isHeaderSent(
-            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
-            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void deleteProductSetExceptionTest() throws Exception {
-    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
-    mockProductSearch.addException(exception);
-
-    try {
-      ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-
-      client.deleteProductSet(name);
-      Assert.fail("No exception raised");
-    } catch (InvalidArgumentException e) {
-      // Expected exception
-    }
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void deleteProductTest() {
-    Empty expectedResponse = Empty.newBuilder().build();
-    mockProductSearch.addResponse(expectedResponse);
-
-    ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
-
-    client.deleteProduct(name);
-
-    List actualRequests = mockProductSearch.getRequests();
-    Assert.assertEquals(1, actualRequests.size());
-    DeleteProductRequest actualRequest = (DeleteProductRequest) actualRequests.get(0);
-
-    Assert.assertEquals(name, ProductName.parse(actualRequest.getName()));
-    Assert.assertTrue(
-        channelProvider.isHeaderSent(
-            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
-            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void deleteProductExceptionTest() throws Exception {
-    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
-    mockProductSearch.addException(exception);
-
-    try {
-      ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
-
-      client.deleteProduct(name);
-      Assert.fail("No exception raised");
-    } catch (InvalidArgumentException e) {
-      // Expected exception
-    }
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void deleteReferenceImageTest() {
-    Empty expectedResponse = Empty.newBuilder().build();
-    mockProductSearch.addResponse(expectedResponse);
-
-    ReferenceImageName name =
-        ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
-
-    client.deleteReferenceImage(name);
-
-    List actualRequests = mockProductSearch.getRequests();
-    Assert.assertEquals(1, actualRequests.size());
-    DeleteReferenceImageRequest actualRequest = (DeleteReferenceImageRequest) actualRequests.get(0);
-
-    Assert.assertEquals(name, ReferenceImageName.parse(actualRequest.getName()));
-    Assert.assertTrue(
-        channelProvider.isHeaderSent(
-            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
-            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void deleteReferenceImageExceptionTest() throws Exception {
-    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
-    mockProductSearch.addException(exception);
-
-    try {
-      ReferenceImageName name =
-          ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
-
-      client.deleteReferenceImage(name);
-      Assert.fail("No exception raised");
-    } catch (InvalidArgumentException e) {
-      // Expected exception
-    }
-  }
-
   @Test
   @SuppressWarnings("all")
   public void importProductSetsTest() throws Exception {
@@ -432,6 +319,43 @@ public void updateProductSetExceptionTest() throws Exception {
     }
   }
 
+  @Test
+  @SuppressWarnings("all")
+  public void deleteProductSetTest() {
+    Empty expectedResponse = Empty.newBuilder().build();
+    mockProductSearch.addResponse(expectedResponse);
+
+    ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+
+    client.deleteProductSet(name);
+
+    List actualRequests = mockProductSearch.getRequests();
+    Assert.assertEquals(1, actualRequests.size());
+    DeleteProductSetRequest actualRequest = (DeleteProductSetRequest) actualRequests.get(0);
+
+    Assert.assertEquals(name, ProductSetName.parse(actualRequest.getName()));
+    Assert.assertTrue(
+        channelProvider.isHeaderSent(
+            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
+            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void deleteProductSetExceptionTest() throws Exception {
+    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
+    mockProductSearch.addException(exception);
+
+    try {
+      ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+
+      client.deleteProductSet(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception
+    }
+  }
+
   @Test
   @SuppressWarnings("all")
   public void createProductTest() {
@@ -633,6 +557,43 @@ public void updateProductExceptionTest() throws Exception {
     }
   }
 
+  @Test
+  @SuppressWarnings("all")
+  public void deleteProductTest() {
+    Empty expectedResponse = Empty.newBuilder().build();
+    mockProductSearch.addResponse(expectedResponse);
+
+    ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+
+    client.deleteProduct(name);
+
+    List actualRequests = mockProductSearch.getRequests();
+    Assert.assertEquals(1, actualRequests.size());
+    DeleteProductRequest actualRequest = (DeleteProductRequest) actualRequests.get(0);
+
+    Assert.assertEquals(name, ProductName.parse(actualRequest.getName()));
+    Assert.assertTrue(
+        channelProvider.isHeaderSent(
+            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
+            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void deleteProductExceptionTest() throws Exception {
+    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
+    mockProductSearch.addException(exception);
+
+    try {
+      ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+
+      client.deleteProduct(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception
+    }
+  }
+
   @Test
   @SuppressWarnings("all")
   public void createReferenceImageTest() {
@@ -682,6 +643,45 @@ public void createReferenceImageExceptionTest() throws Exception {
     }
   }
 
+  @Test
+  @SuppressWarnings("all")
+  public void deleteReferenceImageTest() {
+    Empty expectedResponse = Empty.newBuilder().build();
+    mockProductSearch.addResponse(expectedResponse);
+
+    ReferenceImageName name =
+        ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+
+    client.deleteReferenceImage(name);
+
+    List actualRequests = mockProductSearch.getRequests();
+    Assert.assertEquals(1, actualRequests.size());
+    DeleteReferenceImageRequest actualRequest = (DeleteReferenceImageRequest) actualRequests.get(0);
+
+    Assert.assertEquals(name, ReferenceImageName.parse(actualRequest.getName()));
+    Assert.assertTrue(
+        channelProvider.isHeaderSent(
+            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
+            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void deleteReferenceImageExceptionTest() throws Exception {
+    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
+    mockProductSearch.addException(exception);
+
+    try {
+      ReferenceImageName name =
+          ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+
+      client.deleteReferenceImage(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception
+    }
+  }
+
   @Test
   @SuppressWarnings("all")
   public void listReferenceImagesTest() {
diff --git a/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorClientTest.java b/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorClientTest.java
index c429d60d9..cd6e5689e 100644
--- a/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorClientTest.java
+++ b/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/ImageAnnotatorClientTest.java
@@ -84,20 +84,31 @@ public void tearDown() throws Exception {
 
   @Test
   @SuppressWarnings("all")
-  public void batchAnnotateImagesTest() {
-    BatchAnnotateImagesResponse expectedResponse = BatchAnnotateImagesResponse.newBuilder().build();
-    mockImageAnnotator.addResponse(expectedResponse);
+  public void asyncBatchAnnotateImagesTest() throws Exception {
+    AsyncBatchAnnotateImagesResponse expectedResponse =
+        AsyncBatchAnnotateImagesResponse.newBuilder().build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("asyncBatchAnnotateImagesTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockImageAnnotator.addResponse(resultOperation);
 
     List requests = new ArrayList<>();
+    OutputConfig outputConfig = OutputConfig.newBuilder().build();
 
-    BatchAnnotateImagesResponse actualResponse = client.batchAnnotateImages(requests);
+    AsyncBatchAnnotateImagesResponse actualResponse =
+        client.asyncBatchAnnotateImagesAsync(requests, outputConfig).get();
     Assert.assertEquals(expectedResponse, actualResponse);
 
     List actualRequests = mockImageAnnotator.getRequests();
     Assert.assertEquals(1, actualRequests.size());
-    BatchAnnotateImagesRequest actualRequest = (BatchAnnotateImagesRequest) actualRequests.get(0);
+    AsyncBatchAnnotateImagesRequest actualRequest =
+        (AsyncBatchAnnotateImagesRequest) actualRequests.get(0);
 
     Assert.assertEquals(requests, actualRequest.getRequestsList());
+    Assert.assertEquals(outputConfig, actualRequest.getOutputConfig());
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -106,34 +117,46 @@ public void batchAnnotateImagesTest() {
 
   @Test
   @SuppressWarnings("all")
-  public void batchAnnotateImagesExceptionTest() throws Exception {
+  public void asyncBatchAnnotateImagesExceptionTest() throws Exception {
     StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
     mockImageAnnotator.addException(exception);
 
     try {
       List requests = new ArrayList<>();
+      OutputConfig outputConfig = OutputConfig.newBuilder().build();
 
-      client.batchAnnotateImages(requests);
+      client.asyncBatchAnnotateImagesAsync(requests, outputConfig).get();
       Assert.fail("No exception raised");
-    } catch (InvalidArgumentException e) {
-      // Expected exception
+    } catch (ExecutionException e) {
+      Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass());
+      InvalidArgumentException apiException = (InvalidArgumentException) e.getCause();
+      Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode());
     }
   }
 
   @Test
   @SuppressWarnings("all")
-  public void batchAnnotateFilesTest() {
-    BatchAnnotateFilesResponse expectedResponse = BatchAnnotateFilesResponse.newBuilder().build();
-    mockImageAnnotator.addResponse(expectedResponse);
+  public void asyncBatchAnnotateFilesTest() throws Exception {
+    AsyncBatchAnnotateFilesResponse expectedResponse =
+        AsyncBatchAnnotateFilesResponse.newBuilder().build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("asyncBatchAnnotateFilesTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockImageAnnotator.addResponse(resultOperation);
 
-    List requests = new ArrayList<>();
+    List requests = new ArrayList<>();
 
-    BatchAnnotateFilesResponse actualResponse = client.batchAnnotateFiles(requests);
+    AsyncBatchAnnotateFilesResponse actualResponse =
+        client.asyncBatchAnnotateFilesAsync(requests).get();
     Assert.assertEquals(expectedResponse, actualResponse);
 
     List actualRequests = mockImageAnnotator.getRequests();
     Assert.assertEquals(1, actualRequests.size());
-    BatchAnnotateFilesRequest actualRequest = (BatchAnnotateFilesRequest) actualRequests.get(0);
+    AsyncBatchAnnotateFilesRequest actualRequest =
+        (AsyncBatchAnnotateFilesRequest) actualRequests.get(0);
 
     Assert.assertEquals(requests, actualRequest.getRequestsList());
     Assert.assertTrue(
@@ -144,47 +167,38 @@ public void batchAnnotateFilesTest() {
 
   @Test
   @SuppressWarnings("all")
-  public void batchAnnotateFilesExceptionTest() throws Exception {
+  public void asyncBatchAnnotateFilesExceptionTest() throws Exception {
     StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
     mockImageAnnotator.addException(exception);
 
     try {
-      List requests = new ArrayList<>();
+      List requests = new ArrayList<>();
 
-      client.batchAnnotateFiles(requests);
+      client.asyncBatchAnnotateFilesAsync(requests).get();
       Assert.fail("No exception raised");
-    } catch (InvalidArgumentException e) {
-      // Expected exception
+    } catch (ExecutionException e) {
+      Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass());
+      InvalidArgumentException apiException = (InvalidArgumentException) e.getCause();
+      Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode());
     }
   }
 
   @Test
   @SuppressWarnings("all")
-  public void asyncBatchAnnotateImagesTest() throws Exception {
-    AsyncBatchAnnotateImagesResponse expectedResponse =
-        AsyncBatchAnnotateImagesResponse.newBuilder().build();
-    Operation resultOperation =
-        Operation.newBuilder()
-            .setName("asyncBatchAnnotateImagesTest")
-            .setDone(true)
-            .setResponse(Any.pack(expectedResponse))
-            .build();
-    mockImageAnnotator.addResponse(resultOperation);
+  public void batchAnnotateImagesTest() {
+    BatchAnnotateImagesResponse expectedResponse = BatchAnnotateImagesResponse.newBuilder().build();
+    mockImageAnnotator.addResponse(expectedResponse);
 
     List requests = new ArrayList<>();
-    OutputConfig outputConfig = OutputConfig.newBuilder().build();
 
-    AsyncBatchAnnotateImagesResponse actualResponse =
-        client.asyncBatchAnnotateImagesAsync(requests, outputConfig).get();
+    BatchAnnotateImagesResponse actualResponse = client.batchAnnotateImages(requests);
     Assert.assertEquals(expectedResponse, actualResponse);
 
     List actualRequests = mockImageAnnotator.getRequests();
     Assert.assertEquals(1, actualRequests.size());
-    AsyncBatchAnnotateImagesRequest actualRequest =
-        (AsyncBatchAnnotateImagesRequest) actualRequests.get(0);
+    BatchAnnotateImagesRequest actualRequest = (BatchAnnotateImagesRequest) actualRequests.get(0);
 
     Assert.assertEquals(requests, actualRequest.getRequestsList());
-    Assert.assertEquals(outputConfig, actualRequest.getOutputConfig());
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -193,46 +207,34 @@ public void asyncBatchAnnotateImagesTest() throws Exception {
 
   @Test
   @SuppressWarnings("all")
-  public void asyncBatchAnnotateImagesExceptionTest() throws Exception {
+  public void batchAnnotateImagesExceptionTest() throws Exception {
     StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
     mockImageAnnotator.addException(exception);
 
     try {
       List requests = new ArrayList<>();
-      OutputConfig outputConfig = OutputConfig.newBuilder().build();
 
-      client.asyncBatchAnnotateImagesAsync(requests, outputConfig).get();
+      client.batchAnnotateImages(requests);
       Assert.fail("No exception raised");
-    } catch (ExecutionException e) {
-      Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass());
-      InvalidArgumentException apiException = (InvalidArgumentException) e.getCause();
-      Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode());
+    } catch (InvalidArgumentException e) {
+      // Expected exception
     }
   }
 
   @Test
   @SuppressWarnings("all")
-  public void asyncBatchAnnotateFilesTest() throws Exception {
-    AsyncBatchAnnotateFilesResponse expectedResponse =
-        AsyncBatchAnnotateFilesResponse.newBuilder().build();
-    Operation resultOperation =
-        Operation.newBuilder()
-            .setName("asyncBatchAnnotateFilesTest")
-            .setDone(true)
-            .setResponse(Any.pack(expectedResponse))
-            .build();
-    mockImageAnnotator.addResponse(resultOperation);
+  public void batchAnnotateFilesTest() {
+    BatchAnnotateFilesResponse expectedResponse = BatchAnnotateFilesResponse.newBuilder().build();
+    mockImageAnnotator.addResponse(expectedResponse);
 
-    List requests = new ArrayList<>();
+    List requests = new ArrayList<>();
 
-    AsyncBatchAnnotateFilesResponse actualResponse =
-        client.asyncBatchAnnotateFilesAsync(requests).get();
+    BatchAnnotateFilesResponse actualResponse = client.batchAnnotateFiles(requests);
     Assert.assertEquals(expectedResponse, actualResponse);
 
     List actualRequests = mockImageAnnotator.getRequests();
     Assert.assertEquals(1, actualRequests.size());
-    AsyncBatchAnnotateFilesRequest actualRequest =
-        (AsyncBatchAnnotateFilesRequest) actualRequests.get(0);
+    BatchAnnotateFilesRequest actualRequest = (BatchAnnotateFilesRequest) actualRequests.get(0);
 
     Assert.assertEquals(requests, actualRequest.getRequestsList());
     Assert.assertTrue(
@@ -243,19 +245,17 @@ public void asyncBatchAnnotateFilesTest() throws Exception {
 
   @Test
   @SuppressWarnings("all")
-  public void asyncBatchAnnotateFilesExceptionTest() throws Exception {
+  public void batchAnnotateFilesExceptionTest() throws Exception {
     StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
     mockImageAnnotator.addException(exception);
 
     try {
-      List requests = new ArrayList<>();
+      List requests = new ArrayList<>();
 
-      client.asyncBatchAnnotateFilesAsync(requests).get();
+      client.batchAnnotateFiles(requests);
       Assert.fail("No exception raised");
-    } catch (ExecutionException e) {
-      Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass());
-      InvalidArgumentException apiException = (InvalidArgumentException) e.getCause();
-      Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode());
+    } catch (InvalidArgumentException e) {
+      // Expected exception
     }
   }
 }
diff --git a/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/ProductSearchClientTest.java b/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/ProductSearchClientTest.java
index 177930450..84731b4a4 100644
--- a/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/ProductSearchClientTest.java
+++ b/google-cloud-vision/src/test/java/com/google/cloud/vision/v1p4beta1/ProductSearchClientTest.java
@@ -89,119 +89,6 @@ public void tearDown() throws Exception {
     client.close();
   }
 
-  @Test
-  @SuppressWarnings("all")
-  public void deleteProductSetTest() {
-    Empty expectedResponse = Empty.newBuilder().build();
-    mockProductSearch.addResponse(expectedResponse);
-
-    ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-
-    client.deleteProductSet(name);
-
-    List actualRequests = mockProductSearch.getRequests();
-    Assert.assertEquals(1, actualRequests.size());
-    DeleteProductSetRequest actualRequest = (DeleteProductSetRequest) actualRequests.get(0);
-
-    Assert.assertEquals(name, ProductSetName.parse(actualRequest.getName()));
-    Assert.assertTrue(
-        channelProvider.isHeaderSent(
-            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
-            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void deleteProductSetExceptionTest() throws Exception {
-    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
-    mockProductSearch.addException(exception);
-
-    try {
-      ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
-
-      client.deleteProductSet(name);
-      Assert.fail("No exception raised");
-    } catch (InvalidArgumentException e) {
-      // Expected exception
-    }
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void deleteProductTest() {
-    Empty expectedResponse = Empty.newBuilder().build();
-    mockProductSearch.addResponse(expectedResponse);
-
-    ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
-
-    client.deleteProduct(name);
-
-    List actualRequests = mockProductSearch.getRequests();
-    Assert.assertEquals(1, actualRequests.size());
-    DeleteProductRequest actualRequest = (DeleteProductRequest) actualRequests.get(0);
-
-    Assert.assertEquals(name, ProductName.parse(actualRequest.getName()));
-    Assert.assertTrue(
-        channelProvider.isHeaderSent(
-            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
-            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void deleteProductExceptionTest() throws Exception {
-    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
-    mockProductSearch.addException(exception);
-
-    try {
-      ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
-
-      client.deleteProduct(name);
-      Assert.fail("No exception raised");
-    } catch (InvalidArgumentException e) {
-      // Expected exception
-    }
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void deleteReferenceImageTest() {
-    Empty expectedResponse = Empty.newBuilder().build();
-    mockProductSearch.addResponse(expectedResponse);
-
-    ReferenceImageName name =
-        ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
-
-    client.deleteReferenceImage(name);
-
-    List actualRequests = mockProductSearch.getRequests();
-    Assert.assertEquals(1, actualRequests.size());
-    DeleteReferenceImageRequest actualRequest = (DeleteReferenceImageRequest) actualRequests.get(0);
-
-    Assert.assertEquals(name, ReferenceImageName.parse(actualRequest.getName()));
-    Assert.assertTrue(
-        channelProvider.isHeaderSent(
-            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
-            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void deleteReferenceImageExceptionTest() throws Exception {
-    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
-    mockProductSearch.addException(exception);
-
-    try {
-      ReferenceImageName name =
-          ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
-
-      client.deleteReferenceImage(name);
-      Assert.fail("No exception raised");
-    } catch (InvalidArgumentException e) {
-      // Expected exception
-    }
-  }
-
   @Test
   @SuppressWarnings("all")
   public void importProductSetsTest() throws Exception {
@@ -432,6 +319,43 @@ public void updateProductSetExceptionTest() throws Exception {
     }
   }
 
+  @Test
+  @SuppressWarnings("all")
+  public void deleteProductSetTest() {
+    Empty expectedResponse = Empty.newBuilder().build();
+    mockProductSearch.addResponse(expectedResponse);
+
+    ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+
+    client.deleteProductSet(name);
+
+    List actualRequests = mockProductSearch.getRequests();
+    Assert.assertEquals(1, actualRequests.size());
+    DeleteProductSetRequest actualRequest = (DeleteProductSetRequest) actualRequests.get(0);
+
+    Assert.assertEquals(name, ProductSetName.parse(actualRequest.getName()));
+    Assert.assertTrue(
+        channelProvider.isHeaderSent(
+            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
+            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void deleteProductSetExceptionTest() throws Exception {
+    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
+    mockProductSearch.addException(exception);
+
+    try {
+      ProductSetName name = ProductSetName.of("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+
+      client.deleteProductSet(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception
+    }
+  }
+
   @Test
   @SuppressWarnings("all")
   public void createProductTest() {
@@ -633,6 +557,43 @@ public void updateProductExceptionTest() throws Exception {
     }
   }
 
+  @Test
+  @SuppressWarnings("all")
+  public void deleteProductTest() {
+    Empty expectedResponse = Empty.newBuilder().build();
+    mockProductSearch.addResponse(expectedResponse);
+
+    ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+
+    client.deleteProduct(name);
+
+    List actualRequests = mockProductSearch.getRequests();
+    Assert.assertEquals(1, actualRequests.size());
+    DeleteProductRequest actualRequest = (DeleteProductRequest) actualRequests.get(0);
+
+    Assert.assertEquals(name, ProductName.parse(actualRequest.getName()));
+    Assert.assertTrue(
+        channelProvider.isHeaderSent(
+            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
+            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void deleteProductExceptionTest() throws Exception {
+    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
+    mockProductSearch.addException(exception);
+
+    try {
+      ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+
+      client.deleteProduct(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception
+    }
+  }
+
   @Test
   @SuppressWarnings("all")
   public void createReferenceImageTest() {
@@ -682,6 +643,45 @@ public void createReferenceImageExceptionTest() throws Exception {
     }
   }
 
+  @Test
+  @SuppressWarnings("all")
+  public void deleteReferenceImageTest() {
+    Empty expectedResponse = Empty.newBuilder().build();
+    mockProductSearch.addResponse(expectedResponse);
+
+    ReferenceImageName name =
+        ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+
+    client.deleteReferenceImage(name);
+
+    List actualRequests = mockProductSearch.getRequests();
+    Assert.assertEquals(1, actualRequests.size());
+    DeleteReferenceImageRequest actualRequest = (DeleteReferenceImageRequest) actualRequests.get(0);
+
+    Assert.assertEquals(name, ReferenceImageName.parse(actualRequest.getName()));
+    Assert.assertTrue(
+        channelProvider.isHeaderSent(
+            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
+            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void deleteReferenceImageExceptionTest() throws Exception {
+    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
+    mockProductSearch.addException(exception);
+
+    try {
+      ReferenceImageName name =
+          ReferenceImageName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
+
+      client.deleteReferenceImage(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception
+    }
+  }
+
   @Test
   @SuppressWarnings("all")
   public void listReferenceImagesTest() {
diff --git a/synth.metadata b/synth.metadata
index d28db72d0..5a91938a9 100644
--- a/synth.metadata
+++ b/synth.metadata
@@ -4,47 +4,47 @@
       "git": {
         "name": ".",
         "remote": "https://github.com/googleapis/java-vision.git",
-        "sha": "5efa57b1daeb2a760dcca8cd3058e94386c414d5"
+        "sha": "e9f14072616f8952307ce97eddc7e1118b459fef"
       }
     },
     {
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "c4e37010d74071851ff24121f522e802231ac86e",
-        "internalRef": "313460921"
+        "sha": "d810c1d73c25b2a0051c26bc960e0044ebf939b1",
+        "internalRef": "317109460"
       }
     },
     {
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "c4e37010d74071851ff24121f522e802231ac86e",
-        "internalRef": "313460921"
+        "sha": "d810c1d73c25b2a0051c26bc960e0044ebf939b1",
+        "internalRef": "317109460"
       }
     },
     {
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "c4e37010d74071851ff24121f522e802231ac86e",
-        "internalRef": "313460921"
+        "sha": "d810c1d73c25b2a0051c26bc960e0044ebf939b1",
+        "internalRef": "317109460"
       }
     },
     {
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "c4e37010d74071851ff24121f522e802231ac86e",
-        "internalRef": "313460921"
+        "sha": "d810c1d73c25b2a0051c26bc960e0044ebf939b1",
+        "internalRef": "317109460"
       }
     },
     {
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "c4e37010d74071851ff24121f522e802231ac86e",
-        "internalRef": "313460921"
+        "sha": "d810c1d73c25b2a0051c26bc960e0044ebf939b1",
+        "internalRef": "317109460"
       }
     },
     {