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

Commit 6e94a08

Browse files
feat!: release gapic-generator-java v2.0.0 (#833)
Committer: @miraleung PiperOrigin-RevId: 388535346 Source-Link: googleapis/googleapis@d9eaf41 Source-Link: https://github.com/googleapis/googleapis-gen/commit/976c5ab6f24b58c91fe04847ead1953f99d19e6a
1 parent b55113b commit 6e94a08

14 files changed

+200
-401
lines changed

google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlClient.java

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.cloud.automl.v1;
1818

19-
import com.google.api.core.ApiFunction;
2019
import com.google.api.core.ApiFuture;
2120
import com.google.api.core.ApiFutures;
2221
import com.google.api.core.BetaApi;
@@ -2442,12 +2441,7 @@ public static ApiFuture<ListDatasetsPagedResponse> createAsync(
24422441
ListDatasetsPage.createEmptyPage().createPageAsync(context, futureResponse);
24432442
return ApiFutures.transform(
24442443
futurePage,
2445-
new ApiFunction<ListDatasetsPage, ListDatasetsPagedResponse>() {
2446-
@Override
2447-
public ListDatasetsPagedResponse apply(ListDatasetsPage input) {
2448-
return new ListDatasetsPagedResponse(input);
2449-
}
2450-
},
2444+
input -> new ListDatasetsPagedResponse(input),
24512445
MoreExecutors.directExecutor());
24522446
}
24532447

@@ -2521,14 +2515,7 @@ public static ApiFuture<ListModelsPagedResponse> createAsync(
25212515
ApiFuture<ListModelsPage> futurePage =
25222516
ListModelsPage.createEmptyPage().createPageAsync(context, futureResponse);
25232517
return ApiFutures.transform(
2524-
futurePage,
2525-
new ApiFunction<ListModelsPage, ListModelsPagedResponse>() {
2526-
@Override
2527-
public ListModelsPagedResponse apply(ListModelsPage input) {
2528-
return new ListModelsPagedResponse(input);
2529-
}
2530-
},
2531-
MoreExecutors.directExecutor());
2518+
futurePage, input -> new ListModelsPagedResponse(input), MoreExecutors.directExecutor());
25322519
}
25332520

25342521
private ListModelsPagedResponse(ListModelsPage page) {
@@ -2603,12 +2590,7 @@ public static ApiFuture<ListModelEvaluationsPagedResponse> createAsync(
26032590
ListModelEvaluationsPage.createEmptyPage().createPageAsync(context, futureResponse);
26042591
return ApiFutures.transform(
26052592
futurePage,
2606-
new ApiFunction<ListModelEvaluationsPage, ListModelEvaluationsPagedResponse>() {
2607-
@Override
2608-
public ListModelEvaluationsPagedResponse apply(ListModelEvaluationsPage input) {
2609-
return new ListModelEvaluationsPagedResponse(input);
2610-
}
2611-
},
2593+
input -> new ListModelEvaluationsPagedResponse(input),
26122594
MoreExecutors.directExecutor());
26132595
}
26142596

google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlSettings.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,14 +308,13 @@ public AutoMlStubSettings.Builder getStubSettingsBuilder() {
308308
return ((AutoMlStubSettings.Builder) getStubSettings());
309309
}
310310

311-
// NEXT_MAJOR_VER: remove 'throws Exception'.
312311
/**
313312
* Applies the given settings updater function to all of the unary API methods in this service.
314313
*
315314
* <p>Note: This method does not support applying settings to streaming methods.
316315
*/
317316
public Builder applyToAllUnaryMethods(
318-
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
317+
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
319318
super.applyToAllUnaryMethods(
320319
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
321320
return this;

google-cloud-automl/src/main/java/com/google/cloud/automl/v1/PredictionServiceSettings.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,13 @@ public PredictionServiceStubSettings.Builder getStubSettingsBuilder() {
169169
return ((PredictionServiceStubSettings.Builder) getStubSettings());
170170
}
171171

172-
// NEXT_MAJOR_VER: remove 'throws Exception'.
173172
/**
174173
* Applies the given settings updater function to all of the unary API methods in this service.
175174
*
176175
* <p>Note: This method does not support applying settings to streaming methods.
177176
*/
178177
public Builder applyToAllUnaryMethods(
179-
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
178+
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
180179
super.applyToAllUnaryMethods(
181180
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
182181
return this;

google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStubSettings.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,14 +1111,13 @@ private static Builder initDefaults(Builder builder) {
11111111
return builder;
11121112
}
11131113

1114-
// NEXT_MAJOR_VER: remove 'throws Exception'.
11151114
/**
11161115
* Applies the given settings updater function to all of the unary API methods in this service.
11171116
*
11181117
* <p>Note: This method does not support applying settings to streaming methods.
11191118
*/
11201119
public Builder applyToAllUnaryMethods(
1121-
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
1120+
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
11221121
super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater);
11231122
return this;
11241123
}

google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcAutoMlStub.java

Lines changed: 72 additions & 128 deletions
Large diffs are not rendered by default.

google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcPredictionServiceStub.java

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import com.google.api.gax.grpc.GrpcStubCallableFactory;
2323
import com.google.api.gax.rpc.ClientContext;
2424
import com.google.api.gax.rpc.OperationCallable;
25-
import com.google.api.gax.rpc.RequestParamsExtractor;
2625
import com.google.api.gax.rpc.UnaryCallable;
2726
import com.google.cloud.automl.v1.BatchPredictRequest;
2827
import com.google.cloud.automl.v1.BatchPredictResult;
@@ -35,7 +34,6 @@
3534
import io.grpc.MethodDescriptor;
3635
import io.grpc.protobuf.ProtoUtils;
3736
import java.io.IOException;
38-
import java.util.Map;
3937
import java.util.concurrent.TimeUnit;
4038
import javax.annotation.Generated;
4139

@@ -117,26 +115,20 @@ protected GrpcPredictionServiceStub(
117115
GrpcCallSettings.<PredictRequest, PredictResponse>newBuilder()
118116
.setMethodDescriptor(predictMethodDescriptor)
119117
.setParamsExtractor(
120-
new RequestParamsExtractor<PredictRequest>() {
121-
@Override
122-
public Map<String, String> extract(PredictRequest request) {
123-
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
124-
params.put("name", String.valueOf(request.getName()));
125-
return params.build();
126-
}
118+
request -> {
119+
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
120+
params.put("name", String.valueOf(request.getName()));
121+
return params.build();
127122
})
128123
.build();
129124
GrpcCallSettings<BatchPredictRequest, Operation> batchPredictTransportSettings =
130125
GrpcCallSettings.<BatchPredictRequest, Operation>newBuilder()
131126
.setMethodDescriptor(batchPredictMethodDescriptor)
132127
.setParamsExtractor(
133-
new RequestParamsExtractor<BatchPredictRequest>() {
134-
@Override
135-
public Map<String, String> extract(BatchPredictRequest request) {
136-
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
137-
params.put("name", String.valueOf(request.getName()));
138-
return params.build();
139-
}
128+
request -> {
129+
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
130+
params.put("name", String.valueOf(request.getName()));
131+
return params.build();
140132
})
141133
.build();
142134

google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/PredictionServiceStubSettings.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,14 +302,13 @@ private static Builder initDefaults(Builder builder) {
302302
return builder;
303303
}
304304

305-
// NEXT_MAJOR_VER: remove 'throws Exception'.
306305
/**
307306
* Applies the given settings updater function to all of the unary API methods in this service.
308307
*
309308
* <p>Note: This method does not support applying settings to streaming methods.
310309
*/
311310
public Builder applyToAllUnaryMethods(
312-
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
311+
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
313312
super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater);
314313
return this;
315314
}

google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.cloud.automl.v1beta1;
1818

19-
import com.google.api.core.ApiFunction;
2019
import com.google.api.core.ApiFuture;
2120
import com.google.api.core.ApiFutures;
2221
import com.google.api.core.BetaApi;
@@ -3140,12 +3139,7 @@ public static ApiFuture<ListDatasetsPagedResponse> createAsync(
31403139
ListDatasetsPage.createEmptyPage().createPageAsync(context, futureResponse);
31413140
return ApiFutures.transform(
31423141
futurePage,
3143-
new ApiFunction<ListDatasetsPage, ListDatasetsPagedResponse>() {
3144-
@Override
3145-
public ListDatasetsPagedResponse apply(ListDatasetsPage input) {
3146-
return new ListDatasetsPagedResponse(input);
3147-
}
3148-
},
3142+
input -> new ListDatasetsPagedResponse(input),
31493143
MoreExecutors.directExecutor());
31503144
}
31513145

@@ -3220,12 +3214,7 @@ public static ApiFuture<ListTableSpecsPagedResponse> createAsync(
32203214
ListTableSpecsPage.createEmptyPage().createPageAsync(context, futureResponse);
32213215
return ApiFutures.transform(
32223216
futurePage,
3223-
new ApiFunction<ListTableSpecsPage, ListTableSpecsPagedResponse>() {
3224-
@Override
3225-
public ListTableSpecsPagedResponse apply(ListTableSpecsPage input) {
3226-
return new ListTableSpecsPagedResponse(input);
3227-
}
3228-
},
3217+
input -> new ListTableSpecsPagedResponse(input),
32293218
MoreExecutors.directExecutor());
32303219
}
32313220

@@ -3301,12 +3290,7 @@ public static ApiFuture<ListColumnSpecsPagedResponse> createAsync(
33013290
ListColumnSpecsPage.createEmptyPage().createPageAsync(context, futureResponse);
33023291
return ApiFutures.transform(
33033292
futurePage,
3304-
new ApiFunction<ListColumnSpecsPage, ListColumnSpecsPagedResponse>() {
3305-
@Override
3306-
public ListColumnSpecsPagedResponse apply(ListColumnSpecsPage input) {
3307-
return new ListColumnSpecsPagedResponse(input);
3308-
}
3309-
},
3293+
input -> new ListColumnSpecsPagedResponse(input),
33103294
MoreExecutors.directExecutor());
33113295
}
33123296

@@ -3382,14 +3366,7 @@ public static ApiFuture<ListModelsPagedResponse> createAsync(
33823366
ApiFuture<ListModelsPage> futurePage =
33833367
ListModelsPage.createEmptyPage().createPageAsync(context, futureResponse);
33843368
return ApiFutures.transform(
3385-
futurePage,
3386-
new ApiFunction<ListModelsPage, ListModelsPagedResponse>() {
3387-
@Override
3388-
public ListModelsPagedResponse apply(ListModelsPage input) {
3389-
return new ListModelsPagedResponse(input);
3390-
}
3391-
},
3392-
MoreExecutors.directExecutor());
3369+
futurePage, input -> new ListModelsPagedResponse(input), MoreExecutors.directExecutor());
33933370
}
33943371

33953372
private ListModelsPagedResponse(ListModelsPage page) {
@@ -3464,12 +3441,7 @@ public static ApiFuture<ListModelEvaluationsPagedResponse> createAsync(
34643441
ListModelEvaluationsPage.createEmptyPage().createPageAsync(context, futureResponse);
34653442
return ApiFutures.transform(
34663443
futurePage,
3467-
new ApiFunction<ListModelEvaluationsPage, ListModelEvaluationsPagedResponse>() {
3468-
@Override
3469-
public ListModelEvaluationsPagedResponse apply(ListModelEvaluationsPage input) {
3470-
return new ListModelEvaluationsPagedResponse(input);
3471-
}
3472-
},
3444+
input -> new ListModelEvaluationsPagedResponse(input),
34733445
MoreExecutors.directExecutor());
34743446
}
34753447

google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlSettings.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,14 +346,13 @@ public AutoMlStubSettings.Builder getStubSettingsBuilder() {
346346
return ((AutoMlStubSettings.Builder) getStubSettings());
347347
}
348348

349-
// NEXT_MAJOR_VER: remove 'throws Exception'.
350349
/**
351350
* Applies the given settings updater function to all of the unary API methods in this service.
352351
*
353352
* <p>Note: This method does not support applying settings to streaming methods.
354353
*/
355354
public Builder applyToAllUnaryMethods(
356-
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
355+
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
357356
super.applyToAllUnaryMethods(
358357
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
359358
return this;

google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceSettings.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,13 @@ public PredictionServiceStubSettings.Builder getStubSettingsBuilder() {
170170
return ((PredictionServiceStubSettings.Builder) getStubSettings());
171171
}
172172

173-
// NEXT_MAJOR_VER: remove 'throws Exception'.
174173
/**
175174
* Applies the given settings updater function to all of the unary API methods in this service.
176175
*
177176
* <p>Note: This method does not support applying settings to streaming methods.
178177
*/
179178
public Builder applyToAllUnaryMethods(
180-
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
179+
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
181180
super.applyToAllUnaryMethods(
182181
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
183182
return this;

0 commit comments

Comments
 (0)