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

feat!: release gapic-generator-java v2.0.0 #600

Merged
merged 4 commits into from Aug 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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