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

Commit 760ed31

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

14 files changed

+173
-594
lines changed

google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigServiceClient.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.osconfig.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;
@@ -1193,12 +1192,7 @@ public static ApiFuture<ListPatchJobsPagedResponse> createAsync(
11931192
ListPatchJobsPage.createEmptyPage().createPageAsync(context, futureResponse);
11941193
return ApiFutures.transform(
11951194
futurePage,
1196-
new ApiFunction<ListPatchJobsPage, ListPatchJobsPagedResponse>() {
1197-
@Override
1198-
public ListPatchJobsPagedResponse apply(ListPatchJobsPage input) {
1199-
return new ListPatchJobsPagedResponse(input);
1200-
}
1201-
},
1195+
input -> new ListPatchJobsPagedResponse(input),
12021196
MoreExecutors.directExecutor());
12031197
}
12041198

@@ -1288,14 +1282,7 @@ public static ApiFuture<ListPatchJobInstanceDetailsPagedResponse> createAsync(
12881282
.createPageAsync(context, futureResponse);
12891283
return ApiFutures.transform(
12901284
futurePage,
1291-
new ApiFunction<
1292-
ListPatchJobInstanceDetailsPage, ListPatchJobInstanceDetailsPagedResponse>() {
1293-
@Override
1294-
public ListPatchJobInstanceDetailsPagedResponse apply(
1295-
ListPatchJobInstanceDetailsPage input) {
1296-
return new ListPatchJobInstanceDetailsPagedResponse(input);
1297-
}
1298-
},
1285+
input -> new ListPatchJobInstanceDetailsPagedResponse(input),
12991286
MoreExecutors.directExecutor());
13001287
}
13011288

@@ -1391,12 +1378,7 @@ public static ApiFuture<ListPatchDeploymentsPagedResponse> createAsync(
13911378
ListPatchDeploymentsPage.createEmptyPage().createPageAsync(context, futureResponse);
13921379
return ApiFutures.transform(
13931380
futurePage,
1394-
new ApiFunction<ListPatchDeploymentsPage, ListPatchDeploymentsPagedResponse>() {
1395-
@Override
1396-
public ListPatchDeploymentsPagedResponse apply(ListPatchDeploymentsPage input) {
1397-
return new ListPatchDeploymentsPagedResponse(input);
1398-
}
1399-
},
1381+
input -> new ListPatchDeploymentsPagedResponse(input),
14001382
MoreExecutors.directExecutor());
14011383
}
14021384

google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigServiceSettings.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,13 @@ public OsConfigServiceStubSettings.Builder getStubSettingsBuilder() {
221221
return ((OsConfigServiceStubSettings.Builder) getStubSettings());
222222
}
223223

224-
// NEXT_MAJOR_VER: remove 'throws Exception'.
225224
/**
226225
* Applies the given settings updater function to all of the unary API methods in this service.
227226
*
228227
* <p>Note: This method does not support applying settings to streaming methods.
229228
*/
230229
public Builder applyToAllUnaryMethods(
231-
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
230+
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
232231
super.applyToAllUnaryMethods(
233232
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
234233
return this;

google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/GrpcOsConfigServiceStub.java

Lines changed: 36 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import com.google.api.gax.grpc.GrpcCallSettings;
2626
import com.google.api.gax.grpc.GrpcStubCallableFactory;
2727
import com.google.api.gax.rpc.ClientContext;
28-
import com.google.api.gax.rpc.RequestParamsExtractor;
2928
import com.google.api.gax.rpc.UnaryCallable;
3029
import com.google.cloud.osconfig.v1.PatchDeployments;
3130
import com.google.cloud.osconfig.v1.PatchJobs;
@@ -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

@@ -249,41 +247,32 @@ protected GrpcOsConfigServiceStub(
249247
GrpcCallSettings.<PatchJobs.ExecutePatchJobRequest, PatchJobs.PatchJob>newBuilder()
250248
.setMethodDescriptor(executePatchJobMethodDescriptor)
251249
.setParamsExtractor(
252-
new RequestParamsExtractor<PatchJobs.ExecutePatchJobRequest>() {
253-
@Override
254-
public Map<String, String> extract(PatchJobs.ExecutePatchJobRequest request) {
255-
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
256-
params.put("parent", String.valueOf(request.getParent()));
257-
return params.build();
258-
}
250+
request -> {
251+
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
252+
params.put("parent", String.valueOf(request.getParent()));
253+
return params.build();
259254
})
260255
.build();
261256
GrpcCallSettings<PatchJobs.GetPatchJobRequest, PatchJobs.PatchJob>
262257
getPatchJobTransportSettings =
263258
GrpcCallSettings.<PatchJobs.GetPatchJobRequest, PatchJobs.PatchJob>newBuilder()
264259
.setMethodDescriptor(getPatchJobMethodDescriptor)
265260
.setParamsExtractor(
266-
new RequestParamsExtractor<PatchJobs.GetPatchJobRequest>() {
267-
@Override
268-
public Map<String, String> extract(PatchJobs.GetPatchJobRequest request) {
269-
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
270-
params.put("name", String.valueOf(request.getName()));
271-
return params.build();
272-
}
261+
request -> {
262+
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
263+
params.put("name", String.valueOf(request.getName()));
264+
return params.build();
273265
})
274266
.build();
275267
GrpcCallSettings<PatchJobs.CancelPatchJobRequest, PatchJobs.PatchJob>
276268
cancelPatchJobTransportSettings =
277269
GrpcCallSettings.<PatchJobs.CancelPatchJobRequest, PatchJobs.PatchJob>newBuilder()
278270
.setMethodDescriptor(cancelPatchJobMethodDescriptor)
279271
.setParamsExtractor(
280-
new RequestParamsExtractor<PatchJobs.CancelPatchJobRequest>() {
281-
@Override
282-
public Map<String, String> extract(PatchJobs.CancelPatchJobRequest request) {
283-
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
284-
params.put("name", String.valueOf(request.getName()));
285-
return params.build();
286-
}
272+
request -> {
273+
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
274+
params.put("name", String.valueOf(request.getName()));
275+
return params.build();
287276
})
288277
.build();
289278
GrpcCallSettings<PatchJobs.ListPatchJobsRequest, PatchJobs.ListPatchJobsResponse>
@@ -292,13 +281,10 @@ public Map<String, String> extract(PatchJobs.CancelPatchJobRequest request) {
292281
.<PatchJobs.ListPatchJobsRequest, PatchJobs.ListPatchJobsResponse>newBuilder()
293282
.setMethodDescriptor(listPatchJobsMethodDescriptor)
294283
.setParamsExtractor(
295-
new RequestParamsExtractor<PatchJobs.ListPatchJobsRequest>() {
296-
@Override
297-
public Map<String, String> extract(PatchJobs.ListPatchJobsRequest request) {
298-
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
299-
params.put("parent", String.valueOf(request.getParent()));
300-
return params.build();
301-
}
284+
request -> {
285+
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
286+
params.put("parent", String.valueOf(request.getParent()));
287+
return params.build();
302288
})
303289
.build();
304290
GrpcCallSettings<
@@ -311,14 +297,10 @@ public Map<String, String> extract(PatchJobs.ListPatchJobsRequest request) {
311297
newBuilder()
312298
.setMethodDescriptor(listPatchJobInstanceDetailsMethodDescriptor)
313299
.setParamsExtractor(
314-
new RequestParamsExtractor<PatchJobs.ListPatchJobInstanceDetailsRequest>() {
315-
@Override
316-
public Map<String, String> extract(
317-
PatchJobs.ListPatchJobInstanceDetailsRequest request) {
318-
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
319-
params.put("parent", String.valueOf(request.getParent()));
320-
return params.build();
321-
}
300+
request -> {
301+
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
302+
params.put("parent", String.valueOf(request.getParent()));
303+
return params.build();
322304
})
323305
.build();
324306
GrpcCallSettings<
@@ -329,14 +311,10 @@ public Map<String, String> extract(
329311
newBuilder()
330312
.setMethodDescriptor(createPatchDeploymentMethodDescriptor)
331313
.setParamsExtractor(
332-
new RequestParamsExtractor<PatchDeployments.CreatePatchDeploymentRequest>() {
333-
@Override
334-
public Map<String, String> extract(
335-
PatchDeployments.CreatePatchDeploymentRequest request) {
336-
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
337-
params.put("parent", String.valueOf(request.getParent()));
338-
return params.build();
339-
}
314+
request -> {
315+
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
316+
params.put("parent", String.valueOf(request.getParent()));
317+
return params.build();
340318
})
341319
.build();
342320
GrpcCallSettings<PatchDeployments.GetPatchDeploymentRequest, PatchDeployments.PatchDeployment>
@@ -346,14 +324,10 @@ public Map<String, String> extract(
346324
newBuilder()
347325
.setMethodDescriptor(getPatchDeploymentMethodDescriptor)
348326
.setParamsExtractor(
349-
new RequestParamsExtractor<PatchDeployments.GetPatchDeploymentRequest>() {
350-
@Override
351-
public Map<String, String> extract(
352-
PatchDeployments.GetPatchDeploymentRequest request) {
353-
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
354-
params.put("name", String.valueOf(request.getName()));
355-
return params.build();
356-
}
327+
request -> {
328+
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
329+
params.put("name", String.valueOf(request.getName()));
330+
return params.build();
357331
})
358332
.build();
359333
GrpcCallSettings<
@@ -366,29 +340,21 @@ public Map<String, String> extract(
366340
newBuilder()
367341
.setMethodDescriptor(listPatchDeploymentsMethodDescriptor)
368342
.setParamsExtractor(
369-
new RequestParamsExtractor<PatchDeployments.ListPatchDeploymentsRequest>() {
370-
@Override
371-
public Map<String, String> extract(
372-
PatchDeployments.ListPatchDeploymentsRequest request) {
373-
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
374-
params.put("parent", String.valueOf(request.getParent()));
375-
return params.build();
376-
}
343+
request -> {
344+
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
345+
params.put("parent", String.valueOf(request.getParent()));
346+
return params.build();
377347
})
378348
.build();
379349
GrpcCallSettings<PatchDeployments.DeletePatchDeploymentRequest, Empty>
380350
deletePatchDeploymentTransportSettings =
381351
GrpcCallSettings.<PatchDeployments.DeletePatchDeploymentRequest, Empty>newBuilder()
382352
.setMethodDescriptor(deletePatchDeploymentMethodDescriptor)
383353
.setParamsExtractor(
384-
new RequestParamsExtractor<PatchDeployments.DeletePatchDeploymentRequest>() {
385-
@Override
386-
public Map<String, String> extract(
387-
PatchDeployments.DeletePatchDeploymentRequest request) {
388-
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
389-
params.put("name", String.valueOf(request.getName()));
390-
return params.build();
391-
}
354+
request -> {
355+
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
356+
params.put("name", String.valueOf(request.getName()));
357+
return params.build();
392358
})
393359
.build();
394360

google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/OsConfigServiceStubSettings.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,14 +688,13 @@ private static Builder initDefaults(Builder builder) {
688688
return builder;
689689
}
690690

691-
// NEXT_MAJOR_VER: remove 'throws Exception'.
692691
/**
693692
* Applies the given settings updater function to all of the unary API methods in this service.
694693
*
695694
* <p>Note: This method does not support applying settings to streaming methods.
696695
*/
697696
public Builder applyToAllUnaryMethods(
698-
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
697+
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
699698
super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater);
700699
return this;
701700
}

google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1alpha/OsConfigZonalServiceClient.java

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

1717
package com.google.cloud.osconfig.v1alpha;
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;
@@ -2025,12 +2024,7 @@ public static ApiFuture<ListOSPolicyAssignmentsPagedResponse> createAsync(
20252024
ListOSPolicyAssignmentsPage.createEmptyPage().createPageAsync(context, futureResponse);
20262025
return ApiFutures.transform(
20272026
futurePage,
2028-
new ApiFunction<ListOSPolicyAssignmentsPage, ListOSPolicyAssignmentsPagedResponse>() {
2029-
@Override
2030-
public ListOSPolicyAssignmentsPagedResponse apply(ListOSPolicyAssignmentsPage input) {
2031-
return new ListOSPolicyAssignmentsPagedResponse(input);
2032-
}
2033-
},
2027+
input -> new ListOSPolicyAssignmentsPagedResponse(input),
20342028
MoreExecutors.directExecutor());
20352029
}
20362030

@@ -2121,14 +2115,7 @@ public static ApiFuture<ListOSPolicyAssignmentRevisionsPagedResponse> createAsyn
21212115
.createPageAsync(context, futureResponse);
21222116
return ApiFutures.transform(
21232117
futurePage,
2124-
new ApiFunction<
2125-
ListOSPolicyAssignmentRevisionsPage, ListOSPolicyAssignmentRevisionsPagedResponse>() {
2126-
@Override
2127-
public ListOSPolicyAssignmentRevisionsPagedResponse apply(
2128-
ListOSPolicyAssignmentRevisionsPage input) {
2129-
return new ListOSPolicyAssignmentRevisionsPagedResponse(input);
2130-
}
2131-
},
2118+
input -> new ListOSPolicyAssignmentRevisionsPagedResponse(input),
21322119
MoreExecutors.directExecutor());
21332120
}
21342121

@@ -2225,15 +2212,7 @@ public static ApiFuture<ListInstanceOSPoliciesCompliancesPagedResponse> createAs
22252212
.createPageAsync(context, futureResponse);
22262213
return ApiFutures.transform(
22272214
futurePage,
2228-
new ApiFunction<
2229-
ListInstanceOSPoliciesCompliancesPage,
2230-
ListInstanceOSPoliciesCompliancesPagedResponse>() {
2231-
@Override
2232-
public ListInstanceOSPoliciesCompliancesPagedResponse apply(
2233-
ListInstanceOSPoliciesCompliancesPage input) {
2234-
return new ListInstanceOSPoliciesCompliancesPagedResponse(input);
2235-
}
2236-
},
2215+
input -> new ListInstanceOSPoliciesCompliancesPagedResponse(input),
22372216
MoreExecutors.directExecutor());
22382217
}
22392218

@@ -2326,12 +2305,7 @@ public static ApiFuture<ListInventoriesPagedResponse> createAsync(
23262305
ListInventoriesPage.createEmptyPage().createPageAsync(context, futureResponse);
23272306
return ApiFutures.transform(
23282307
futurePage,
2329-
new ApiFunction<ListInventoriesPage, ListInventoriesPagedResponse>() {
2330-
@Override
2331-
public ListInventoriesPagedResponse apply(ListInventoriesPage input) {
2332-
return new ListInventoriesPagedResponse(input);
2333-
}
2334-
},
2308+
input -> new ListInventoriesPagedResponse(input),
23352309
MoreExecutors.directExecutor());
23362310
}
23372311

@@ -2412,12 +2386,7 @@ public static ApiFuture<ListVulnerabilityReportsPagedResponse> createAsync(
24122386
ListVulnerabilityReportsPage.createEmptyPage().createPageAsync(context, futureResponse);
24132387
return ApiFutures.transform(
24142388
futurePage,
2415-
new ApiFunction<ListVulnerabilityReportsPage, ListVulnerabilityReportsPagedResponse>() {
2416-
@Override
2417-
public ListVulnerabilityReportsPagedResponse apply(ListVulnerabilityReportsPage input) {
2418-
return new ListVulnerabilityReportsPagedResponse(input);
2419-
}
2420-
},
2389+
input -> new ListVulnerabilityReportsPagedResponse(input),
24212390
MoreExecutors.directExecutor());
24222391
}
24232392

google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1alpha/OsConfigZonalServiceSettings.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,13 @@ public OsConfigZonalServiceStubSettings.Builder getStubSettingsBuilder() {
279279
return ((OsConfigZonalServiceStubSettings.Builder) getStubSettings());
280280
}
281281

282-
// NEXT_MAJOR_VER: remove 'throws Exception'.
283282
/**
284283
* Applies the given settings updater function to all of the unary API methods in this service.
285284
*
286285
* <p>Note: This method does not support applying settings to streaming methods.
287286
*/
288287
public Builder applyToAllUnaryMethods(
289-
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
288+
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
290289
super.applyToAllUnaryMethods(
291290
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
292291
return this;

0 commit comments

Comments
 (0)