diff --git a/google-cloud-vpcaccess/src/main/java/com/google/cloud/vpcaccess/v1/VpcAccessServiceClient.java b/google-cloud-vpcaccess/src/main/java/com/google/cloud/vpcaccess/v1/VpcAccessServiceClient.java index e92d7a71..1a50ff3c 100644 --- a/google-cloud-vpcaccess/src/main/java/com/google/cloud/vpcaccess/v1/VpcAccessServiceClient.java +++ b/google-cloud-vpcaccess/src/main/java/com/google/cloud/vpcaccess/v1/VpcAccessServiceClient.java @@ -16,7 +16,6 @@ package com.google.cloud.vpcaccess.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; @@ -698,12 +697,7 @@ public static ApiFuture createAsync( ListConnectorsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { - @Override - public ListConnectorsPagedResponse apply(ListConnectorsPage input) { - return new ListConnectorsPagedResponse(input); - } - }, + input -> new ListConnectorsPagedResponse(input), MoreExecutors.directExecutor()); } diff --git a/google-cloud-vpcaccess/src/main/java/com/google/cloud/vpcaccess/v1/VpcAccessServiceSettings.java b/google-cloud-vpcaccess/src/main/java/com/google/cloud/vpcaccess/v1/VpcAccessServiceSettings.java index d3fa75e2..8bf9ae56 100644 --- a/google-cloud-vpcaccess/src/main/java/com/google/cloud/vpcaccess/v1/VpcAccessServiceSettings.java +++ b/google-cloud-vpcaccess/src/main/java/com/google/cloud/vpcaccess/v1/VpcAccessServiceSettings.java @@ -191,14 +191,13 @@ public VpcAccessServiceStubSettings.Builder getStubSettingsBuilder() { return ((VpcAccessServiceStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * *

Note: This method does not support applying settings to streaming methods. */ public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { + ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods( getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; diff --git a/google-cloud-vpcaccess/src/main/java/com/google/cloud/vpcaccess/v1/stub/GrpcVpcAccessServiceStub.java b/google-cloud-vpcaccess/src/main/java/com/google/cloud/vpcaccess/v1/stub/GrpcVpcAccessServiceStub.java index dbaa9208..1950c7d7 100644 --- a/google-cloud-vpcaccess/src/main/java/com/google/cloud/vpcaccess/v1/stub/GrpcVpcAccessServiceStub.java +++ b/google-cloud-vpcaccess/src/main/java/com/google/cloud/vpcaccess/v1/stub/GrpcVpcAccessServiceStub.java @@ -24,7 +24,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.vpcaccess.v1.Connector; import com.google.cloud.vpcaccess.v1.CreateConnectorRequest; @@ -40,7 +39,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; @@ -151,26 +149,20 @@ protected GrpcVpcAccessServiceStub( GrpcCallSettings.newBuilder() .setMethodDescriptor(createConnectorMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreateConnectorRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings getConnectorTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getConnectorMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetConnectorRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings @@ -178,26 +170,20 @@ public Map extract(GetConnectorRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(listConnectorsMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListConnectorsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings deleteConnectorTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteConnectorMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteConnectorRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); diff --git a/google-cloud-vpcaccess/src/main/java/com/google/cloud/vpcaccess/v1/stub/VpcAccessServiceStubSettings.java b/google-cloud-vpcaccess/src/main/java/com/google/cloud/vpcaccess/v1/stub/VpcAccessServiceStubSettings.java index 20825c66..d97d6aaf 100644 --- a/google-cloud-vpcaccess/src/main/java/com/google/cloud/vpcaccess/v1/stub/VpcAccessServiceStubSettings.java +++ b/google-cloud-vpcaccess/src/main/java/com/google/cloud/vpcaccess/v1/stub/VpcAccessServiceStubSettings.java @@ -450,14 +450,13 @@ private static Builder initDefaults(Builder builder) { return builder; } - // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * *

Note: This method does not support applying settings to streaming methods. */ public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { + ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; }