Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit e661954

Browse files
fix: migrate retry settings to grpc_service_config (#171)
This PR was generated using Autosynth. 🌈 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: googleapis/googleapis@d810c1d PiperOrigin-RevId: 317109190 Source-Link: googleapis/googleapis@025ee9e PiperOrigin-RevId: 317108363 Source-Link: googleapis/googleapis@074e5b2 PiperOrigin-RevId: 317108263 Source-Link: googleapis/googleapis@2ec6c62 PiperOrigin-RevId: 317107948 Source-Link: googleapis/googleapis@316e611
1 parent 6db89ba commit e661954

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3427
-3354
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
1717
<dependency>
1818
<groupId>com.google.cloud</groupId>
1919
<artifactId>libraries-bom</artifactId>
20-
<version>5.7.0</version>
20+
<version>7.0.0</version>
2121
<type>pom</type>
2222
<scope>import</scope>
2323
</dependency>

google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ImageAnnotatorClient.java

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
* <pre>
4242
* <code>
4343
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
44-
* List&lt;AnnotateImageRequest&gt; requests = new ArrayList&lt;&gt;();
45-
* BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
44+
* List&lt;AnnotateFileRequest&gt; requests = new ArrayList&lt;&gt;();
45+
* BatchAnnotateFilesResponse response = imageAnnotatorClient.batchAnnotateFiles(requests);
4646
* }
4747
* </code>
4848
* </pre>
@@ -163,75 +163,6 @@ public final OperationsClient getOperationsClient() {
163163
return operationsClient;
164164
}
165165

166-
// AUTO-GENERATED DOCUMENTATION AND METHOD
167-
/**
168-
* Run image detection and annotation for a batch of images.
169-
*
170-
* <p>Sample code:
171-
*
172-
* <pre><code>
173-
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
174-
* List&lt;AnnotateImageRequest&gt; requests = new ArrayList&lt;&gt;();
175-
* BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
176-
* }
177-
* </code></pre>
178-
*
179-
* @param requests Required. Individual image annotation requests for this batch.
180-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
181-
*/
182-
public final BatchAnnotateImagesResponse batchAnnotateImages(
183-
List<AnnotateImageRequest> requests) {
184-
BatchAnnotateImagesRequest request =
185-
BatchAnnotateImagesRequest.newBuilder().addAllRequests(requests).build();
186-
return batchAnnotateImages(request);
187-
}
188-
189-
// AUTO-GENERATED DOCUMENTATION AND METHOD
190-
/**
191-
* Run image detection and annotation for a batch of images.
192-
*
193-
* <p>Sample code:
194-
*
195-
* <pre><code>
196-
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
197-
* List&lt;AnnotateImageRequest&gt; requests = new ArrayList&lt;&gt;();
198-
* BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
199-
* .addAllRequests(requests)
200-
* .build();
201-
* BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(request);
202-
* }
203-
* </code></pre>
204-
*
205-
* @param request The request object containing all of the parameters for the API call.
206-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
207-
*/
208-
public final BatchAnnotateImagesResponse batchAnnotateImages(BatchAnnotateImagesRequest request) {
209-
return batchAnnotateImagesCallable().call(request);
210-
}
211-
212-
// AUTO-GENERATED DOCUMENTATION AND METHOD
213-
/**
214-
* Run image detection and annotation for a batch of images.
215-
*
216-
* <p>Sample code:
217-
*
218-
* <pre><code>
219-
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
220-
* List&lt;AnnotateImageRequest&gt; requests = new ArrayList&lt;&gt;();
221-
* BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
222-
* .addAllRequests(requests)
223-
* .build();
224-
* ApiFuture&lt;BatchAnnotateImagesResponse&gt; future = imageAnnotatorClient.batchAnnotateImagesCallable().futureCall(request);
225-
* // Do something
226-
* BatchAnnotateImagesResponse response = future.get();
227-
* }
228-
* </code></pre>
229-
*/
230-
public final UnaryCallable<BatchAnnotateImagesRequest, BatchAnnotateImagesResponse>
231-
batchAnnotateImagesCallable() {
232-
return stub.batchAnnotateImagesCallable();
233-
}
234-
235166
// AUTO-GENERATED DOCUMENTATION AND METHOD
236167
/**
237168
* Service that performs image detection and annotation for a batch of files. Now only
@@ -570,6 +501,75 @@ public final BatchAnnotateFilesResponse batchAnnotateFiles(BatchAnnotateFilesReq
570501
return stub.asyncBatchAnnotateFilesCallable();
571502
}
572503

504+
// AUTO-GENERATED DOCUMENTATION AND METHOD
505+
/**
506+
* Run image detection and annotation for a batch of images.
507+
*
508+
* <p>Sample code:
509+
*
510+
* <pre><code>
511+
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
512+
* List&lt;AnnotateImageRequest&gt; requests = new ArrayList&lt;&gt;();
513+
* BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
514+
* }
515+
* </code></pre>
516+
*
517+
* @param requests Required. Individual image annotation requests for this batch.
518+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
519+
*/
520+
public final BatchAnnotateImagesResponse batchAnnotateImages(
521+
List<AnnotateImageRequest> requests) {
522+
BatchAnnotateImagesRequest request =
523+
BatchAnnotateImagesRequest.newBuilder().addAllRequests(requests).build();
524+
return batchAnnotateImages(request);
525+
}
526+
527+
// AUTO-GENERATED DOCUMENTATION AND METHOD
528+
/**
529+
* Run image detection and annotation for a batch of images.
530+
*
531+
* <p>Sample code:
532+
*
533+
* <pre><code>
534+
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
535+
* List&lt;AnnotateImageRequest&gt; requests = new ArrayList&lt;&gt;();
536+
* BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
537+
* .addAllRequests(requests)
538+
* .build();
539+
* BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(request);
540+
* }
541+
* </code></pre>
542+
*
543+
* @param request The request object containing all of the parameters for the API call.
544+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
545+
*/
546+
public final BatchAnnotateImagesResponse batchAnnotateImages(BatchAnnotateImagesRequest request) {
547+
return batchAnnotateImagesCallable().call(request);
548+
}
549+
550+
// AUTO-GENERATED DOCUMENTATION AND METHOD
551+
/**
552+
* Run image detection and annotation for a batch of images.
553+
*
554+
* <p>Sample code:
555+
*
556+
* <pre><code>
557+
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
558+
* List&lt;AnnotateImageRequest&gt; requests = new ArrayList&lt;&gt;();
559+
* BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
560+
* .addAllRequests(requests)
561+
* .build();
562+
* ApiFuture&lt;BatchAnnotateImagesResponse&gt; future = imageAnnotatorClient.batchAnnotateImagesCallable().futureCall(request);
563+
* // Do something
564+
* BatchAnnotateImagesResponse response = future.get();
565+
* }
566+
* </code></pre>
567+
*/
568+
public final UnaryCallable<BatchAnnotateImagesRequest, BatchAnnotateImagesResponse>
569+
batchAnnotateImagesCallable() {
570+
return stub.batchAnnotateImagesCallable();
571+
}
572+
573573
@Override
574574
public final void close() {
575575
stub.close();

google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ImageAnnotatorSettings.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@
4747
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
4848
* build() is called, the tree of builders is called to create the complete settings object.
4949
*
50-
* <p>For example, to set the total timeout of batchAnnotateImages to 30 seconds:
50+
* <p>For example, to set the total timeout of batchAnnotateFiles to 30 seconds:
5151
*
5252
* <pre>
5353
* <code>
5454
* ImageAnnotatorSettings.Builder imageAnnotatorSettingsBuilder =
5555
* ImageAnnotatorSettings.newBuilder();
5656
* imageAnnotatorSettingsBuilder
57-
* .batchAnnotateImagesSettings()
57+
* .batchAnnotateFilesSettings()
5858
* .setRetrySettings(
59-
* imageAnnotatorSettingsBuilder.batchAnnotateImagesSettings().getRetrySettings().toBuilder()
59+
* imageAnnotatorSettingsBuilder.batchAnnotateFilesSettings().getRetrySettings().toBuilder()
6060
* .setTotalTimeout(Duration.ofSeconds(30))
6161
* .build());
6262
* ImageAnnotatorSettings imageAnnotatorSettings = imageAnnotatorSettingsBuilder.build();
@@ -65,12 +65,6 @@
6565
*/
6666
@Generated("by gapic-generator")
6767
public class ImageAnnotatorSettings extends ClientSettings<ImageAnnotatorSettings> {
68-
/** Returns the object with the settings used for calls to batchAnnotateImages. */
69-
public UnaryCallSettings<BatchAnnotateImagesRequest, BatchAnnotateImagesResponse>
70-
batchAnnotateImagesSettings() {
71-
return ((ImageAnnotatorStubSettings) getStubSettings()).batchAnnotateImagesSettings();
72-
}
73-
7468
/** Returns the object with the settings used for calls to batchAnnotateFiles. */
7569
public UnaryCallSettings<BatchAnnotateFilesRequest, BatchAnnotateFilesResponse>
7670
batchAnnotateFilesSettings() {
@@ -109,6 +103,12 @@ public class ImageAnnotatorSettings extends ClientSettings<ImageAnnotatorSetting
109103
.asyncBatchAnnotateFilesOperationSettings();
110104
}
111105

106+
/** Returns the object with the settings used for calls to batchAnnotateImages. */
107+
public UnaryCallSettings<BatchAnnotateImagesRequest, BatchAnnotateImagesResponse>
108+
batchAnnotateImagesSettings() {
109+
return ((ImageAnnotatorStubSettings) getStubSettings()).batchAnnotateImagesSettings();
110+
}
111+
112112
public static final ImageAnnotatorSettings create(ImageAnnotatorStubSettings stub)
113113
throws IOException {
114114
return new ImageAnnotatorSettings.Builder(stub.toBuilder()).build();
@@ -206,12 +206,6 @@ public Builder applyToAllUnaryMethods(
206206
return this;
207207
}
208208

209-
/** Returns the builder for the settings used for calls to batchAnnotateImages. */
210-
public UnaryCallSettings.Builder<BatchAnnotateImagesRequest, BatchAnnotateImagesResponse>
211-
batchAnnotateImagesSettings() {
212-
return getStubSettingsBuilder().batchAnnotateImagesSettings();
213-
}
214-
215209
/** Returns the builder for the settings used for calls to batchAnnotateFiles. */
216210
public UnaryCallSettings.Builder<BatchAnnotateFilesRequest, BatchAnnotateFilesResponse>
217211
batchAnnotateFilesSettings() {
@@ -248,6 +242,12 @@ public Builder applyToAllUnaryMethods(
248242
return getStubSettingsBuilder().asyncBatchAnnotateFilesOperationSettings();
249243
}
250244

245+
/** Returns the builder for the settings used for calls to batchAnnotateImages. */
246+
public UnaryCallSettings.Builder<BatchAnnotateImagesRequest, BatchAnnotateImagesResponse>
247+
batchAnnotateImagesSettings() {
248+
return getStubSettingsBuilder().batchAnnotateImagesSettings();
249+
}
250+
251251
@Override
252252
public ImageAnnotatorSettings build() throws IOException {
253253
return new ImageAnnotatorSettings(this);

0 commit comments

Comments
 (0)