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

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

Merged
merged 5 commits into from
Aug 10, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

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

Expand Down Expand Up @@ -1028,12 +1022,7 @@ public static ApiFuture<ListScanRunsPagedResponse> createAsync(
ListScanRunsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListScanRunsPage, ListScanRunsPagedResponse>() {
@Override
public ListScanRunsPagedResponse apply(ListScanRunsPage input) {
return new ListScanRunsPagedResponse(input);
}
},
input -> new ListScanRunsPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down Expand Up @@ -1108,12 +1097,7 @@ public static ApiFuture<ListCrawledUrlsPagedResponse> createAsync(
ListCrawledUrlsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListCrawledUrlsPage, ListCrawledUrlsPagedResponse>() {
@Override
public ListCrawledUrlsPagedResponse apply(ListCrawledUrlsPage input) {
return new ListCrawledUrlsPagedResponse(input);
}
},
input -> new ListCrawledUrlsPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down Expand Up @@ -1190,12 +1174,7 @@ public static ApiFuture<ListFindingsPagedResponse> createAsync(
ListFindingsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListFindingsPage, ListFindingsPagedResponse>() {
@Override
public ListFindingsPagedResponse apply(ListFindingsPage input) {
return new ListFindingsPagedResponse(input);
}
},
input -> new ListFindingsPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,13 @@ public WebSecurityScannerStubSettings.Builder getStubSettingsBuilder() {
return ((WebSecurityScannerStubSettings.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
Original file line number Diff line number Diff line change
Expand Up @@ -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.websecurityscanner.v1.CreateScanConfigRequest;
import com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest;
Expand Down Expand Up @@ -55,7 +54,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 @@ -274,173 +272,133 @@ protected GrpcWebSecurityScannerStub(
GrpcCallSettings.<CreateScanConfigRequest, ScanConfig>newBuilder()
.setMethodDescriptor(createScanConfigMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CreateScanConfigRequest>() {
@Override
public Map<String, String> extract(CreateScanConfigRequest 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<DeleteScanConfigRequest, Empty> deleteScanConfigTransportSettings =
GrpcCallSettings.<DeleteScanConfigRequest, Empty>newBuilder()
.setMethodDescriptor(deleteScanConfigMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<DeleteScanConfigRequest>() {
@Override
public Map<String, String> extract(DeleteScanConfigRequest 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<GetScanConfigRequest, ScanConfig> getScanConfigTransportSettings =
GrpcCallSettings.<GetScanConfigRequest, ScanConfig>newBuilder()
.setMethodDescriptor(getScanConfigMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetScanConfigRequest>() {
@Override
public Map<String, String> extract(GetScanConfigRequest 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<ListScanConfigsRequest, ListScanConfigsResponse>
listScanConfigsTransportSettings =
GrpcCallSettings.<ListScanConfigsRequest, ListScanConfigsResponse>newBuilder()
.setMethodDescriptor(listScanConfigsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListScanConfigsRequest>() {
@Override
public Map<String, String> extract(ListScanConfigsRequest 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<UpdateScanConfigRequest, ScanConfig> updateScanConfigTransportSettings =
GrpcCallSettings.<UpdateScanConfigRequest, ScanConfig>newBuilder()
.setMethodDescriptor(updateScanConfigMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<UpdateScanConfigRequest>() {
@Override
public Map<String, String> extract(UpdateScanConfigRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"scan_config.name", String.valueOf(request.getScanConfig().getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("scan_config.name", String.valueOf(request.getScanConfig().getName()));
return params.build();
})
.build();
GrpcCallSettings<StartScanRunRequest, ScanRun> startScanRunTransportSettings =
GrpcCallSettings.<StartScanRunRequest, ScanRun>newBuilder()
.setMethodDescriptor(startScanRunMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<StartScanRunRequest>() {
@Override
public Map<String, String> extract(StartScanRunRequest 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<GetScanRunRequest, ScanRun> getScanRunTransportSettings =
GrpcCallSettings.<GetScanRunRequest, ScanRun>newBuilder()
.setMethodDescriptor(getScanRunMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetScanRunRequest>() {
@Override
public Map<String, String> extract(GetScanRunRequest 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<ListScanRunsRequest, ListScanRunsResponse> listScanRunsTransportSettings =
GrpcCallSettings.<ListScanRunsRequest, ListScanRunsResponse>newBuilder()
.setMethodDescriptor(listScanRunsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListScanRunsRequest>() {
@Override
public Map<String, String> extract(ListScanRunsRequest 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<StopScanRunRequest, ScanRun> stopScanRunTransportSettings =
GrpcCallSettings.<StopScanRunRequest, ScanRun>newBuilder()
.setMethodDescriptor(stopScanRunMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<StopScanRunRequest>() {
@Override
public Map<String, String> extract(StopScanRunRequest 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<ListCrawledUrlsRequest, ListCrawledUrlsResponse>
listCrawledUrlsTransportSettings =
GrpcCallSettings.<ListCrawledUrlsRequest, ListCrawledUrlsResponse>newBuilder()
.setMethodDescriptor(listCrawledUrlsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListCrawledUrlsRequest>() {
@Override
public Map<String, String> extract(ListCrawledUrlsRequest 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<GetFindingRequest, Finding> getFindingTransportSettings =
GrpcCallSettings.<GetFindingRequest, Finding>newBuilder()
.setMethodDescriptor(getFindingMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetFindingRequest>() {
@Override
public Map<String, String> extract(GetFindingRequest 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<ListFindingsRequest, ListFindingsResponse> listFindingsTransportSettings =
GrpcCallSettings.<ListFindingsRequest, ListFindingsResponse>newBuilder()
.setMethodDescriptor(listFindingsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListFindingsRequest>() {
@Override
public Map<String, String> extract(ListFindingsRequest 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<ListFindingTypeStatsRequest, ListFindingTypeStatsResponse>
listFindingTypeStatsTransportSettings =
GrpcCallSettings.<ListFindingTypeStatsRequest, ListFindingTypeStatsResponse>newBuilder()
.setMethodDescriptor(listFindingTypeStatsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListFindingTypeStatsRequest>() {
@Override
public Map<String, String> extract(ListFindingTypeStatsRequest 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();

Expand Down Expand Up @@ -596,7 +554,13 @@ public UnaryCallable<ListFindingsRequest, ListFindingsPagedResponse> listFinding

@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
Original file line number Diff line number Diff line change
Expand Up @@ -745,14 +745,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
Loading