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

Commit

Permalink
feat!: release gapic-generator-java v2.0.0 (#815)
Browse files Browse the repository at this point in the history
* feat!: release gapic-generator-java v2.0.0

Committer: @miraleung
PiperOrigin-RevId: 388535346
Source-Link: googleapis/googleapis@d9eaf41
Source-Link: googleapis/googleapis-gen@976c5ab

chore(docs): remove mention about samples README
Fixes googleapis/java-logging#586.
Since no java repos have README in samples/ subfolder, we remove the mentioning from README
Source-Link: googleapis/synthtool@82fe6d9
Post-Processor: gcr.io/repo-automation-bots/owlbot-java:latest@sha256:7384f9f7e64785e8d765266519fe217f3b7ab15837326e5bda548b23dc16aeeb

chore(java): add a method to copy a java method and rename it
chore: add method to deprecate java methods
Source-Link: googleapis/synthtool@f7d068c
Post-Processor: gcr.io/repo-automation-bots/owlbot-java:latest@sha256:8aaf4b4336ac8ca344681866b3a78f73be5999750179022393ecbedd7069acb5

*the metadata field change for AnalyzeIamPolicyLongrunning is BACKWARD INCOMPATIBLE. Adding this change expand our ability to return richer metadata information for the longrunning operation. Due to the small usage of this API, we've contacted all the customers to make sure they are not using the metadata field and hence won't be broken by this change.

Committer: @aaronlichen-hp
PiperOrigin-RevId: 386530026
feat!: Change metadata field for the AnalyzeIamPolicyLongrunning
Source-Link: googleapis/googleapis@746461e
Source-Link: googleapis/googleapis-gen@c2c1745
feat: Add AnalyzeMove API. feat: Add read_mask field for SearchAllResourcesRequest
feat: Add VersionedResource/AttachedResource fields for ResourceSearchResult
  • Loading branch information
gcf-owl-bot[bot] authored Aug 11, 2021
1 parent ebbc36c commit ce9a80c
Show file tree
Hide file tree
Showing 21 changed files with 122 additions and 256 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.google.cloud.asset.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 @@ -1510,14 +1509,7 @@ public static ApiFuture<ListAssetsPagedResponse> createAsync(
ApiFuture<ListAssetsPage> futurePage =
ListAssetsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListAssetsPage, ListAssetsPagedResponse>() {
@Override
public ListAssetsPagedResponse apply(ListAssetsPage input) {
return new ListAssetsPagedResponse(input);
}
},
MoreExecutors.directExecutor());
futurePage, input -> new ListAssetsPagedResponse(input), MoreExecutors.directExecutor());
}

private ListAssetsPagedResponse(ListAssetsPage page) {
Expand Down Expand Up @@ -1592,12 +1584,7 @@ public static ApiFuture<SearchAllResourcesPagedResponse> createAsync(
SearchAllResourcesPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<SearchAllResourcesPage, SearchAllResourcesPagedResponse>() {
@Override
public SearchAllResourcesPagedResponse apply(SearchAllResourcesPage input) {
return new SearchAllResourcesPagedResponse(input);
}
},
input -> new SearchAllResourcesPagedResponse(input),
MoreExecutors.directExecutor());
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,13 @@ public AssetServiceStubSettings.Builder getStubSettingsBuilder() {
return ((AssetServiceStubSettings.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 @@ -844,14 +844,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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,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.asset.v1.AnalyzeIamPolicyLongrunningMetadata;
import com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest;
Expand Down Expand Up @@ -59,7 +58,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 @@ -271,26 +269,20 @@ protected GrpcAssetServiceStub(
GrpcCallSettings.<ExportAssetsRequest, Operation>newBuilder()
.setMethodDescriptor(exportAssetsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ExportAssetsRequest>() {
@Override
public Map<String, String> extract(ExportAssetsRequest 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<ListAssetsRequest, ListAssetsResponse> listAssetsTransportSettings =
GrpcCallSettings.<ListAssetsRequest, ListAssetsResponse>newBuilder()
.setMethodDescriptor(listAssetsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListAssetsRequest>() {
@Override
public Map<String, String> extract(ListAssetsRequest 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<BatchGetAssetsHistoryRequest, BatchGetAssetsHistoryResponse>
Expand All @@ -299,152 +291,118 @@ public Map<String, String> extract(ListAssetsRequest request) {
.<BatchGetAssetsHistoryRequest, BatchGetAssetsHistoryResponse>newBuilder()
.setMethodDescriptor(batchGetAssetsHistoryMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<BatchGetAssetsHistoryRequest>() {
@Override
public Map<String, String> extract(BatchGetAssetsHistoryRequest 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<CreateFeedRequest, Feed> createFeedTransportSettings =
GrpcCallSettings.<CreateFeedRequest, Feed>newBuilder()
.setMethodDescriptor(createFeedMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CreateFeedRequest>() {
@Override
public Map<String, String> extract(CreateFeedRequest 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<GetFeedRequest, Feed> getFeedTransportSettings =
GrpcCallSettings.<GetFeedRequest, Feed>newBuilder()
.setMethodDescriptor(getFeedMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetFeedRequest>() {
@Override
public Map<String, String> extract(GetFeedRequest 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<ListFeedsRequest, ListFeedsResponse> listFeedsTransportSettings =
GrpcCallSettings.<ListFeedsRequest, ListFeedsResponse>newBuilder()
.setMethodDescriptor(listFeedsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListFeedsRequest>() {
@Override
public Map<String, String> extract(ListFeedsRequest 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<UpdateFeedRequest, Feed> updateFeedTransportSettings =
GrpcCallSettings.<UpdateFeedRequest, Feed>newBuilder()
.setMethodDescriptor(updateFeedMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<UpdateFeedRequest>() {
@Override
public Map<String, String> extract(UpdateFeedRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("feed.name", String.valueOf(request.getFeed().getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("feed.name", String.valueOf(request.getFeed().getName()));
return params.build();
})
.build();
GrpcCallSettings<DeleteFeedRequest, Empty> deleteFeedTransportSettings =
GrpcCallSettings.<DeleteFeedRequest, Empty>newBuilder()
.setMethodDescriptor(deleteFeedMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<DeleteFeedRequest>() {
@Override
public Map<String, String> extract(DeleteFeedRequest 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<SearchAllResourcesRequest, SearchAllResourcesResponse>
searchAllResourcesTransportSettings =
GrpcCallSettings.<SearchAllResourcesRequest, SearchAllResourcesResponse>newBuilder()
.setMethodDescriptor(searchAllResourcesMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<SearchAllResourcesRequest>() {
@Override
public Map<String, String> extract(SearchAllResourcesRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("scope", String.valueOf(request.getScope()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("scope", String.valueOf(request.getScope()));
return params.build();
})
.build();
GrpcCallSettings<SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse>
searchAllIamPoliciesTransportSettings =
GrpcCallSettings.<SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse>newBuilder()
.setMethodDescriptor(searchAllIamPoliciesMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<SearchAllIamPoliciesRequest>() {
@Override
public Map<String, String> extract(SearchAllIamPoliciesRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("scope", String.valueOf(request.getScope()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("scope", String.valueOf(request.getScope()));
return params.build();
})
.build();
GrpcCallSettings<AnalyzeIamPolicyRequest, AnalyzeIamPolicyResponse>
analyzeIamPolicyTransportSettings =
GrpcCallSettings.<AnalyzeIamPolicyRequest, AnalyzeIamPolicyResponse>newBuilder()
.setMethodDescriptor(analyzeIamPolicyMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<AnalyzeIamPolicyRequest>() {
@Override
public Map<String, String> extract(AnalyzeIamPolicyRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"analysis_query.scope",
String.valueOf(request.getAnalysisQuery().getScope()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"analysis_query.scope",
String.valueOf(request.getAnalysisQuery().getScope()));
return params.build();
})
.build();
GrpcCallSettings<AnalyzeIamPolicyLongrunningRequest, Operation>
analyzeIamPolicyLongrunningTransportSettings =
GrpcCallSettings.<AnalyzeIamPolicyLongrunningRequest, Operation>newBuilder()
.setMethodDescriptor(analyzeIamPolicyLongrunningMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<AnalyzeIamPolicyLongrunningRequest>() {
@Override
public Map<String, String> extract(
AnalyzeIamPolicyLongrunningRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"analysis_query.scope",
String.valueOf(request.getAnalysisQuery().getScope()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"analysis_query.scope",
String.valueOf(request.getAnalysisQuery().getScope()));
return params.build();
})
.build();
GrpcCallSettings<AnalyzeMoveRequest, AnalyzeMoveResponse> analyzeMoveTransportSettings =
GrpcCallSettings.<AnalyzeMoveRequest, AnalyzeMoveResponse>newBuilder()
.setMethodDescriptor(analyzeMoveMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<AnalyzeMoveRequest>() {
@Override
public Map<String, String> extract(AnalyzeMoveRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("resource", String.valueOf(request.getResource()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("resource", String.valueOf(request.getResource()));
return params.build();
})
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.google.cloud.asset.v1p1beta1;

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 @@ -509,12 +508,7 @@ public static ApiFuture<SearchAllResourcesPagedResponse> createAsync(
SearchAllResourcesPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<SearchAllResourcesPage, SearchAllResourcesPagedResponse>() {
@Override
public SearchAllResourcesPagedResponse apply(SearchAllResourcesPage input) {
return new SearchAllResourcesPagedResponse(input);
}
},
input -> new SearchAllResourcesPagedResponse(input),
MoreExecutors.directExecutor());
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,13 @@ public AssetServiceStubSettings.Builder getStubSettingsBuilder() {
return ((AssetServiceStubSettings.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
Loading

0 comments on commit ce9a80c

Please sign in to comment.