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

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

Merged
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 @@ -16,7 +16,6 @@

package com.google.cloud.gaming.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 @@ -1088,12 +1087,7 @@ public static ApiFuture<ListGameServerClustersPagedResponse> createAsync(
ListGameServerClustersPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListGameServerClustersPage, ListGameServerClustersPagedResponse>() {
@Override
public ListGameServerClustersPagedResponse apply(ListGameServerClustersPage input) {
return new ListGameServerClustersPagedResponse(input);
}
},
input -> new ListGameServerClustersPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down
Expand Up @@ -243,14 +243,13 @@ public GameServerClustersServiceStubSettings.Builder getStubSettingsBuilder() {
return ((GameServerClustersServiceStubSettings.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.gaming.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 @@ -796,12 +795,7 @@ public static ApiFuture<ListGameServerConfigsPagedResponse> createAsync(
ListGameServerConfigsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListGameServerConfigsPage, ListGameServerConfigsPagedResponse>() {
@Override
public ListGameServerConfigsPagedResponse apply(ListGameServerConfigsPage input) {
return new ListGameServerConfigsPagedResponse(input);
}
},
input -> new ListGameServerConfigsPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down
Expand Up @@ -204,14 +204,13 @@ public GameServerConfigsServiceStubSettings.Builder getStubSettingsBuilder() {
return ((GameServerConfigsServiceStubSettings.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.gaming.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 @@ -1267,13 +1266,7 @@ public static ApiFuture<ListGameServerDeploymentsPagedResponse> createAsync(
ListGameServerDeploymentsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListGameServerDeploymentsPage, ListGameServerDeploymentsPagedResponse>() {
@Override
public ListGameServerDeploymentsPagedResponse apply(
ListGameServerDeploymentsPage input) {
return new ListGameServerDeploymentsPagedResponse(input);
}
},
input -> new ListGameServerDeploymentsPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down
Expand Up @@ -258,14 +258,13 @@ public GameServerDeploymentsServiceStubSettings.Builder getStubSettingsBuilder()
return ((GameServerDeploymentsServiceStubSettings.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.gaming.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 @@ -848,14 +847,7 @@ public static ApiFuture<ListRealmsPagedResponse> createAsync(
ApiFuture<ListRealmsPage> futurePage =
ListRealmsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListRealmsPage, ListRealmsPagedResponse>() {
@Override
public ListRealmsPagedResponse apply(ListRealmsPage input) {
return new ListRealmsPagedResponse(input);
}
},
MoreExecutors.directExecutor());
futurePage, input -> new ListRealmsPagedResponse(input), MoreExecutors.directExecutor());
}

private ListRealmsPagedResponse(ListRealmsPage page) {
Expand Down
Expand Up @@ -206,14 +206,13 @@ public RealmsServiceStubSettings.Builder getStubSettingsBuilder() {
return ((RealmsServiceStubSettings.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 @@ -656,14 +656,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.
*
* <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(unaryMethodSettingsBuilders, settingsUpdater);
return this;
}
Expand Down
Expand Up @@ -498,14 +498,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.
*
* <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(unaryMethodSettingsBuilders, settingsUpdater);
return this;
}
Expand Down
Expand Up @@ -735,14 +735,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.
*
* <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(unaryMethodSettingsBuilders, settingsUpdater);
return this;
}
Expand Down
Expand Up @@ -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.gaming.v1.CreateGameServerClusterRequest;
import com.google.cloud.gaming.v1.DeleteGameServerClusterRequest;
Expand All @@ -47,7 +46,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 @@ -246,41 +244,32 @@ protected GrpcGameServerClustersServiceStub(
.<ListGameServerClustersRequest, ListGameServerClustersResponse>newBuilder()
.setMethodDescriptor(listGameServerClustersMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListGameServerClustersRequest>() {
@Override
public Map<String, String> extract(ListGameServerClustersRequest 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<GetGameServerClusterRequest, GameServerCluster>
getGameServerClusterTransportSettings =
GrpcCallSettings.<GetGameServerClusterRequest, GameServerCluster>newBuilder()
.setMethodDescriptor(getGameServerClusterMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetGameServerClusterRequest>() {
@Override
public Map<String, String> extract(GetGameServerClusterRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
})
.build();
GrpcCallSettings<CreateGameServerClusterRequest, Operation>
createGameServerClusterTransportSettings =
GrpcCallSettings.<CreateGameServerClusterRequest, Operation>newBuilder()
.setMethodDescriptor(createGameServerClusterMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CreateGameServerClusterRequest>() {
@Override
public Map<String, String> extract(CreateGameServerClusterRequest 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<PreviewCreateGameServerClusterRequest, PreviewCreateGameServerClusterResponse>
Expand All @@ -290,28 +279,21 @@ public Map<String, String> extract(CreateGameServerClusterRequest request) {
newBuilder()
.setMethodDescriptor(previewCreateGameServerClusterMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<PreviewCreateGameServerClusterRequest>() {
@Override
public Map<String, String> extract(
PreviewCreateGameServerClusterRequest 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<DeleteGameServerClusterRequest, Operation>
deleteGameServerClusterTransportSettings =
GrpcCallSettings.<DeleteGameServerClusterRequest, Operation>newBuilder()
.setMethodDescriptor(deleteGameServerClusterMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<DeleteGameServerClusterRequest>() {
@Override
public Map<String, String> extract(DeleteGameServerClusterRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
})
.build();
GrpcCallSettings<PreviewDeleteGameServerClusterRequest, PreviewDeleteGameServerClusterResponse>
Expand All @@ -321,30 +303,23 @@ public Map<String, String> extract(DeleteGameServerClusterRequest request) {
newBuilder()
.setMethodDescriptor(previewDeleteGameServerClusterMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<PreviewDeleteGameServerClusterRequest>() {
@Override
public Map<String, String> extract(
PreviewDeleteGameServerClusterRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
})
.build();
GrpcCallSettings<UpdateGameServerClusterRequest, Operation>
updateGameServerClusterTransportSettings =
GrpcCallSettings.<UpdateGameServerClusterRequest, Operation>newBuilder()
.setMethodDescriptor(updateGameServerClusterMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<UpdateGameServerClusterRequest>() {
@Override
public Map<String, String> extract(UpdateGameServerClusterRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"game_server_cluster.name",
String.valueOf(request.getGameServerCluster().getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"game_server_cluster.name",
String.valueOf(request.getGameServerCluster().getName()));
return params.build();
})
.build();
GrpcCallSettings<PreviewUpdateGameServerClusterRequest, PreviewUpdateGameServerClusterResponse>
Expand All @@ -354,16 +329,12 @@ public Map<String, String> extract(UpdateGameServerClusterRequest request) {
newBuilder()
.setMethodDescriptor(previewUpdateGameServerClusterMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<PreviewUpdateGameServerClusterRequest>() {
@Override
public Map<String, String> extract(
PreviewUpdateGameServerClusterRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"game_server_cluster.name",
String.valueOf(request.getGameServerCluster().getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"game_server_cluster.name",
String.valueOf(request.getGameServerCluster().getName()));
return params.build();
})
.build();

Expand Down Expand Up @@ -516,7 +487,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