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

Commit

Permalink
fix: migrate retry settings to grpc_service_config (#171)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yoshi-automation committed Jun 22, 2020
1 parent 6db89ba commit e661954
Show file tree
Hide file tree
Showing 43 changed files with 3,427 additions and 3,354 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>5.7.0</version>
<version>7.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Expand Up @@ -41,8 +41,8 @@
* <pre>
* <code>
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
* List&lt;AnnotateImageRequest&gt; requests = new ArrayList&lt;&gt;();
* BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
* List&lt;AnnotateFileRequest&gt; requests = new ArrayList&lt;&gt;();
* BatchAnnotateFilesResponse response = imageAnnotatorClient.batchAnnotateFiles(requests);
* }
* </code>
* </pre>
Expand Down Expand Up @@ -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.
*
* <p>Sample code:
*
* <pre><code>
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
* List&lt;AnnotateImageRequest&gt; requests = new ArrayList&lt;&gt;();
* BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
* }
* </code></pre>
*
* @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<AnnotateImageRequest> 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.
*
* <p>Sample code:
*
* <pre><code>
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
* List&lt;AnnotateImageRequest&gt; requests = new ArrayList&lt;&gt;();
* BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
* .addAllRequests(requests)
* .build();
* BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(request);
* }
* </code></pre>
*
* @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.
*
* <p>Sample code:
*
* <pre><code>
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
* List&lt;AnnotateImageRequest&gt; requests = new ArrayList&lt;&gt;();
* BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
* .addAllRequests(requests)
* .build();
* ApiFuture&lt;BatchAnnotateImagesResponse&gt; future = imageAnnotatorClient.batchAnnotateImagesCallable().futureCall(request);
* // Do something
* BatchAnnotateImagesResponse response = future.get();
* }
* </code></pre>
*/
public final UnaryCallable<BatchAnnotateImagesRequest, BatchAnnotateImagesResponse>
batchAnnotateImagesCallable() {
return stub.batchAnnotateImagesCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Service that performs image detection and annotation for a batch of files. Now only
Expand Down Expand Up @@ -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.
*
* <p>Sample code:
*
* <pre><code>
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
* List&lt;AnnotateImageRequest&gt; requests = new ArrayList&lt;&gt;();
* BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
* }
* </code></pre>
*
* @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<AnnotateImageRequest> 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.
*
* <p>Sample code:
*
* <pre><code>
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
* List&lt;AnnotateImageRequest&gt; requests = new ArrayList&lt;&gt;();
* BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
* .addAllRequests(requests)
* .build();
* BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(request);
* }
* </code></pre>
*
* @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.
*
* <p>Sample code:
*
* <pre><code>
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
* List&lt;AnnotateImageRequest&gt; requests = new ArrayList&lt;&gt;();
* BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder()
* .addAllRequests(requests)
* .build();
* ApiFuture&lt;BatchAnnotateImagesResponse&gt; future = imageAnnotatorClient.batchAnnotateImagesCallable().futureCall(request);
* // Do something
* BatchAnnotateImagesResponse response = future.get();
* }
* </code></pre>
*/
public final UnaryCallable<BatchAnnotateImagesRequest, BatchAnnotateImagesResponse>
batchAnnotateImagesCallable() {
return stub.batchAnnotateImagesCallable();
}

@Override
public final void close() {
stub.close();
Expand Down
Expand Up @@ -47,16 +47,16 @@
* <p>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.
*
* <p>For example, to set the total timeout of batchAnnotateImages to 30 seconds:
* <p>For example, to set the total timeout of batchAnnotateFiles to 30 seconds:
*
* <pre>
* <code>
* 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();
Expand All @@ -65,12 +65,6 @@
*/
@Generated("by gapic-generator")
public class ImageAnnotatorSettings extends ClientSettings<ImageAnnotatorSettings> {
/** Returns the object with the settings used for calls to batchAnnotateImages. */
public UnaryCallSettings<BatchAnnotateImagesRequest, BatchAnnotateImagesResponse>
batchAnnotateImagesSettings() {
return ((ImageAnnotatorStubSettings) getStubSettings()).batchAnnotateImagesSettings();
}

/** Returns the object with the settings used for calls to batchAnnotateFiles. */
public UnaryCallSettings<BatchAnnotateFilesRequest, BatchAnnotateFilesResponse>
batchAnnotateFilesSettings() {
Expand Down Expand Up @@ -109,6 +103,12 @@ public class ImageAnnotatorSettings extends ClientSettings<ImageAnnotatorSetting
.asyncBatchAnnotateFilesOperationSettings();
}

/** Returns the object with the settings used for calls to batchAnnotateImages. */
public UnaryCallSettings<BatchAnnotateImagesRequest, BatchAnnotateImagesResponse>
batchAnnotateImagesSettings() {
return ((ImageAnnotatorStubSettings) getStubSettings()).batchAnnotateImagesSettings();
}

public static final ImageAnnotatorSettings create(ImageAnnotatorStubSettings stub)
throws IOException {
return new ImageAnnotatorSettings.Builder(stub.toBuilder()).build();
Expand Down Expand Up @@ -206,12 +206,6 @@ public Builder applyToAllUnaryMethods(
return this;
}

/** Returns the builder for the settings used for calls to batchAnnotateImages. */
public UnaryCallSettings.Builder<BatchAnnotateImagesRequest, BatchAnnotateImagesResponse>
batchAnnotateImagesSettings() {
return getStubSettingsBuilder().batchAnnotateImagesSettings();
}

/** Returns the builder for the settings used for calls to batchAnnotateFiles. */
public UnaryCallSettings.Builder<BatchAnnotateFilesRequest, BatchAnnotateFilesResponse>
batchAnnotateFilesSettings() {
Expand Down Expand Up @@ -248,6 +242,12 @@ public Builder applyToAllUnaryMethods(
return getStubSettingsBuilder().asyncBatchAnnotateFilesOperationSettings();
}

/** Returns the builder for the settings used for calls to batchAnnotateImages. */
public UnaryCallSettings.Builder<BatchAnnotateImagesRequest, BatchAnnotateImagesResponse>
batchAnnotateImagesSettings() {
return getStubSettingsBuilder().batchAnnotateImagesSettings();
}

@Override
public ImageAnnotatorSettings build() throws IOException {
return new ImageAnnotatorSettings(this);
Expand Down

0 comments on commit e661954

Please sign in to comment.