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

Commit

Permalink
feat!: release gapic-generator-java v2.0.0 (#600)
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/2a082ef0-c330-4a6e-9973-9c369e5572b8/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

PiperOrigin-RevId: 388535346
Source-Link: googleapis/googleapis@d9eaf41
PiperOrigin-RevId: 388499329
Source-Link: googleapis/googleapis@bb0a090
  • Loading branch information
yoshi-automation committed Aug 6, 2021
1 parent 1f87644 commit 747c5a0
Show file tree
Hide file tree
Showing 28 changed files with 335 additions and 560 deletions.
Expand Up @@ -193,14 +193,13 @@ public ImageAnnotatorStubSettings.Builder getStubSettingsBuilder() {
return ((ImageAnnotatorStubSettings.Builder) getStubSettings());
}

// NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
return this;
Expand Down
Expand Up @@ -16,7 +16,6 @@

package com.google.cloud.vision.v1;

import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
Expand Down Expand Up @@ -3300,12 +3299,7 @@ public static ApiFuture<ListProductSetsPagedResponse> createAsync(
ListProductSetsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListProductSetsPage, ListProductSetsPagedResponse>() {
@Override
public ListProductSetsPagedResponse apply(ListProductSetsPage input) {
return new ListProductSetsPagedResponse(input);
}
},
input -> new ListProductSetsPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down Expand Up @@ -3382,12 +3376,7 @@ public static ApiFuture<ListProductsPagedResponse> createAsync(
ListProductsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListProductsPage, ListProductsPagedResponse>() {
@Override
public ListProductsPagedResponse apply(ListProductsPage input) {
return new ListProductsPagedResponse(input);
}
},
input -> new ListProductsPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down Expand Up @@ -3463,12 +3452,7 @@ public static ApiFuture<ListReferenceImagesPagedResponse> createAsync(
ListReferenceImagesPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListReferenceImagesPage, ListReferenceImagesPagedResponse>() {
@Override
public ListReferenceImagesPagedResponse apply(ListReferenceImagesPage input) {
return new ListReferenceImagesPagedResponse(input);
}
},
input -> new ListReferenceImagesPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down Expand Up @@ -3552,12 +3536,7 @@ public static ApiFuture<ListProductsInProductSetPagedResponse> createAsync(
ListProductsInProductSetPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListProductsInProductSetPage, ListProductsInProductSetPagedResponse>() {
@Override
public ListProductsInProductSetPagedResponse apply(ListProductsInProductSetPage input) {
return new ListProductsInProductSetPagedResponse(input);
}
},
input -> new ListProductsInProductSetPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down
Expand Up @@ -278,14 +278,13 @@ public ProductSearchStubSettings.Builder getStubSettingsBuilder() {
return ((ProductSearchStubSettings.Builder) getStubSettings());
}

// NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
return this;
Expand Down
Expand Up @@ -22,7 +22,6 @@
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.RequestParamsExtractor;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest;
import com.google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse;
Expand All @@ -39,7 +38,6 @@
import io.grpc.MethodDescriptor;
import io.grpc.protobuf.ProtoUtils;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;

Expand Down Expand Up @@ -157,55 +155,43 @@ protected GrpcImageAnnotatorStub(
GrpcCallSettings.<BatchAnnotateImagesRequest, BatchAnnotateImagesResponse>newBuilder()
.setMethodDescriptor(batchAnnotateImagesMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<BatchAnnotateImagesRequest>() {
@Override
public Map<String, String> extract(BatchAnnotateImagesRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
})
.build();
GrpcCallSettings<BatchAnnotateFilesRequest, BatchAnnotateFilesResponse>
batchAnnotateFilesTransportSettings =
GrpcCallSettings.<BatchAnnotateFilesRequest, BatchAnnotateFilesResponse>newBuilder()
.setMethodDescriptor(batchAnnotateFilesMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<BatchAnnotateFilesRequest>() {
@Override
public Map<String, String> extract(BatchAnnotateFilesRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
})
.build();
GrpcCallSettings<AsyncBatchAnnotateImagesRequest, Operation>
asyncBatchAnnotateImagesTransportSettings =
GrpcCallSettings.<AsyncBatchAnnotateImagesRequest, Operation>newBuilder()
.setMethodDescriptor(asyncBatchAnnotateImagesMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<AsyncBatchAnnotateImagesRequest>() {
@Override
public Map<String, String> extract(AsyncBatchAnnotateImagesRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
})
.build();
GrpcCallSettings<AsyncBatchAnnotateFilesRequest, Operation>
asyncBatchAnnotateFilesTransportSettings =
GrpcCallSettings.<AsyncBatchAnnotateFilesRequest, Operation>newBuilder()
.setMethodDescriptor(asyncBatchAnnotateFilesMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<AsyncBatchAnnotateFilesRequest>() {
@Override
public Map<String, String> extract(AsyncBatchAnnotateFilesRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
})
.build();

Expand Down Expand Up @@ -290,7 +276,13 @@ public GrpcOperationsStub getOperationsStub() {

@Override
public final void close() {
shutdown();
try {
backgroundResources.close();
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new IllegalStateException("Failed to close resource", e);
}
}

@Override
Expand Down

0 comments on commit 747c5a0

Please sign in to comment.