Skip to content
Permalink
Browse files
feat!: Java 8 breaking generator changes (#960)
* chore: release gapic-generator-java v1.0.17

Committer: @miraleung
PiperOrigin-RevId: 388499329

Source-Author: Google APIs <noreply@google.com>
Source-Date: Tue Aug 3 11:12:29 2021 -0700
Source-Repo: googleapis/googleapis
Source-Sha: bb0a090d9204110042ab5dee2ce9e06e8071ce54
Source-Link: googleapis/googleapis@bb0a090

* feat!: release gapic-generator-java v2.0.0

Committer: @miraleung
PiperOrigin-RevId: 388535346

Source-Author: Google APIs <noreply@google.com>
Source-Date: Tue Aug 3 13:48:38 2021 -0700
Source-Repo: googleapis/googleapis
Source-Sha: d9eaf41de44d953458b18712a3f240bb4c564e48
Source-Link: googleapis/googleapis@d9eaf41
  • Loading branch information
yoshi-automation committed Aug 4, 2021
1 parent 8317ab0 commit b47c2b3600710bb5cceeb277944550c341d07b52
@@ -16,7 +16,6 @@

package com.google.cloud.bigquery.datatransfer.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;
@@ -1934,12 +1933,7 @@ public static ApiFuture<ListDataSourcesPagedResponse> createAsync(
ListDataSourcesPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListDataSourcesPage, ListDataSourcesPagedResponse>() {
@Override
public ListDataSourcesPagedResponse apply(ListDataSourcesPage input) {
return new ListDataSourcesPagedResponse(input);
}
},
input -> new ListDataSourcesPagedResponse(input),
MoreExecutors.directExecutor());
}

@@ -2017,12 +2011,7 @@ public static ApiFuture<ListTransferConfigsPagedResponse> createAsync(
ListTransferConfigsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListTransferConfigsPage, ListTransferConfigsPagedResponse>() {
@Override
public ListTransferConfigsPagedResponse apply(ListTransferConfigsPage input) {
return new ListTransferConfigsPagedResponse(input);
}
},
input -> new ListTransferConfigsPagedResponse(input),
MoreExecutors.directExecutor());
}

@@ -2105,12 +2094,7 @@ public static ApiFuture<ListTransferRunsPagedResponse> createAsync(
ListTransferRunsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListTransferRunsPage, ListTransferRunsPagedResponse>() {
@Override
public ListTransferRunsPagedResponse apply(ListTransferRunsPage input) {
return new ListTransferRunsPagedResponse(input);
}
},
input -> new ListTransferRunsPagedResponse(input),
MoreExecutors.directExecutor());
}

@@ -2187,12 +2171,7 @@ public static ApiFuture<ListTransferLogsPagedResponse> createAsync(
ListTransferLogsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListTransferLogsPage, ListTransferLogsPagedResponse>() {
@Override
public ListTransferLogsPagedResponse apply(ListTransferLogsPage input) {
return new ListTransferLogsPagedResponse(input);
}
},
input -> new ListTransferLogsPagedResponse(input),
MoreExecutors.directExecutor());
}

@@ -248,14 +248,13 @@ public DataTransferServiceStubSettings.Builder getStubSettingsBuilder() {
return ((DataTransferServiceStubSettings.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;
@@ -810,14 +810,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;
}
@@ -26,7 +26,6 @@
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.RequestParamsExtractor;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest;
import com.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse;
@@ -58,7 +57,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;

@@ -313,111 +311,87 @@ protected GrpcDataTransferServiceStub(
GrpcCallSettings.<GetDataSourceRequest, DataSource>newBuilder()
.setMethodDescriptor(getDataSourceMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetDataSourceRequest>() {
@Override
public Map<String, String> extract(GetDataSourceRequest 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<ListDataSourcesRequest, ListDataSourcesResponse>
listDataSourcesTransportSettings =
GrpcCallSettings.<ListDataSourcesRequest, ListDataSourcesResponse>newBuilder()
.setMethodDescriptor(listDataSourcesMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListDataSourcesRequest>() {
@Override
public Map<String, String> extract(ListDataSourcesRequest 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<CreateTransferConfigRequest, TransferConfig>
createTransferConfigTransportSettings =
GrpcCallSettings.<CreateTransferConfigRequest, TransferConfig>newBuilder()
.setMethodDescriptor(createTransferConfigMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CreateTransferConfigRequest>() {
@Override
public Map<String, String> extract(CreateTransferConfigRequest 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<UpdateTransferConfigRequest, TransferConfig>
updateTransferConfigTransportSettings =
GrpcCallSettings.<UpdateTransferConfigRequest, TransferConfig>newBuilder()
.setMethodDescriptor(updateTransferConfigMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<UpdateTransferConfigRequest>() {
@Override
public Map<String, String> extract(UpdateTransferConfigRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"transfer_config.name",
String.valueOf(request.getTransferConfig().getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"transfer_config.name",
String.valueOf(request.getTransferConfig().getName()));
return params.build();
})
.build();
GrpcCallSettings<DeleteTransferConfigRequest, Empty> deleteTransferConfigTransportSettings =
GrpcCallSettings.<DeleteTransferConfigRequest, Empty>newBuilder()
.setMethodDescriptor(deleteTransferConfigMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<DeleteTransferConfigRequest>() {
@Override
public Map<String, String> extract(DeleteTransferConfigRequest 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<GetTransferConfigRequest, TransferConfig> getTransferConfigTransportSettings =
GrpcCallSettings.<GetTransferConfigRequest, TransferConfig>newBuilder()
.setMethodDescriptor(getTransferConfigMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetTransferConfigRequest>() {
@Override
public Map<String, String> extract(GetTransferConfigRequest 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<ListTransferConfigsRequest, ListTransferConfigsResponse>
listTransferConfigsTransportSettings =
GrpcCallSettings.<ListTransferConfigsRequest, ListTransferConfigsResponse>newBuilder()
.setMethodDescriptor(listTransferConfigsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListTransferConfigsRequest>() {
@Override
public Map<String, String> extract(ListTransferConfigsRequest 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<ScheduleTransferRunsRequest, ScheduleTransferRunsResponse>
scheduleTransferRunsTransportSettings =
GrpcCallSettings.<ScheduleTransferRunsRequest, ScheduleTransferRunsResponse>newBuilder()
.setMethodDescriptor(scheduleTransferRunsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ScheduleTransferRunsRequest>() {
@Override
public Map<String, String> extract(ScheduleTransferRunsRequest 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<StartManualTransferRunsRequest, StartManualTransferRunsResponse>
@@ -426,81 +400,63 @@ public Map<String, String> extract(ScheduleTransferRunsRequest request) {
.<StartManualTransferRunsRequest, StartManualTransferRunsResponse>newBuilder()
.setMethodDescriptor(startManualTransferRunsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<StartManualTransferRunsRequest>() {
@Override
public Map<String, String> extract(StartManualTransferRunsRequest 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<GetTransferRunRequest, TransferRun> getTransferRunTransportSettings =
GrpcCallSettings.<GetTransferRunRequest, TransferRun>newBuilder()
.setMethodDescriptor(getTransferRunMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetTransferRunRequest>() {
@Override
public Map<String, String> extract(GetTransferRunRequest 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<DeleteTransferRunRequest, Empty> deleteTransferRunTransportSettings =
GrpcCallSettings.<DeleteTransferRunRequest, Empty>newBuilder()
.setMethodDescriptor(deleteTransferRunMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<DeleteTransferRunRequest>() {
@Override
public Map<String, String> extract(DeleteTransferRunRequest 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<ListTransferRunsRequest, ListTransferRunsResponse>
listTransferRunsTransportSettings =
GrpcCallSettings.<ListTransferRunsRequest, ListTransferRunsResponse>newBuilder()
.setMethodDescriptor(listTransferRunsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListTransferRunsRequest>() {
@Override
public Map<String, String> extract(ListTransferRunsRequest 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<ListTransferLogsRequest, ListTransferLogsResponse>
listTransferLogsTransportSettings =
GrpcCallSettings.<ListTransferLogsRequest, ListTransferLogsResponse>newBuilder()
.setMethodDescriptor(listTransferLogsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListTransferLogsRequest>() {
@Override
public Map<String, String> extract(ListTransferLogsRequest 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<CheckValidCredsRequest, CheckValidCredsResponse>
checkValidCredsTransportSettings =
GrpcCallSettings.<CheckValidCredsRequest, CheckValidCredsResponse>newBuilder()
.setMethodDescriptor(checkValidCredsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CheckValidCredsRequest>() {
@Override
public Map<String, String> extract(CheckValidCredsRequest 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();

@@ -686,7 +642,13 @@ public UnaryCallable<CheckValidCredsRequest, CheckValidCredsResponse> checkValid

@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

0 comments on commit b47c2b3

Please sign in to comment.