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

Commit

Permalink
feat!: release gapic-generator-java v2.0.0 (#485)
Browse files Browse the repository at this point in the history
Committer: @miraleung
PiperOrigin-RevId: 388535346

Source-Link: googleapis/googleapis@d9eaf41

Source-Link: googleapis/googleapis-gen@976c5ab
  • Loading branch information
gcf-owl-bot[bot] committed Aug 6, 2021
1 parent d0a0cbe commit 733fd5e
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 294 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

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

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

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

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

Expand Down Expand Up @@ -517,14 +511,7 @@ public static ApiFuture<ListSkusPagedResponse> createAsync(
ApiFuture<ListSkusPage> futurePage =
ListSkusPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListSkusPage, ListSkusPagedResponse>() {
@Override
public ListSkusPagedResponse apply(ListSkusPage input) {
return new ListSkusPagedResponse(input);
}
},
MoreExecutors.directExecutor());
futurePage, input -> new ListSkusPagedResponse(input), MoreExecutors.directExecutor());
}

private ListSkusPagedResponse(ListSkusPage page) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,13 @@ public CloudCatalogStubSettings.Builder getStubSettingsBuilder() {
return ((CloudCatalogStubSettings.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 @@ -605,14 +605,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 @@ -383,14 +383,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 @@ -24,7 +24,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.billing.v1.BillingAccount;
import com.google.cloud.billing.v1.CreateBillingAccountRequest;
Expand All @@ -47,7 +46,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 @@ -228,13 +226,10 @@ protected GrpcCloudBillingStub(
GrpcCallSettings.<GetBillingAccountRequest, BillingAccount>newBuilder()
.setMethodDescriptor(getBillingAccountMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetBillingAccountRequest>() {
@Override
public Map<String, String> extract(GetBillingAccountRequest 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<ListBillingAccountsRequest, ListBillingAccountsResponse>
Expand All @@ -247,13 +242,10 @@ public Map<String, String> extract(GetBillingAccountRequest request) {
GrpcCallSettings.<UpdateBillingAccountRequest, BillingAccount>newBuilder()
.setMethodDescriptor(updateBillingAccountMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<UpdateBillingAccountRequest>() {
@Override
public Map<String, String> extract(UpdateBillingAccountRequest 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<CreateBillingAccountRequest, BillingAccount>
Expand All @@ -267,81 +259,63 @@ public Map<String, String> extract(UpdateBillingAccountRequest request) {
.<ListProjectBillingInfoRequest, ListProjectBillingInfoResponse>newBuilder()
.setMethodDescriptor(listProjectBillingInfoMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListProjectBillingInfoRequest>() {
@Override
public Map<String, String> extract(ListProjectBillingInfoRequest 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<GetProjectBillingInfoRequest, ProjectBillingInfo>
getProjectBillingInfoTransportSettings =
GrpcCallSettings.<GetProjectBillingInfoRequest, ProjectBillingInfo>newBuilder()
.setMethodDescriptor(getProjectBillingInfoMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetProjectBillingInfoRequest>() {
@Override
public Map<String, String> extract(GetProjectBillingInfoRequest 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<UpdateProjectBillingInfoRequest, ProjectBillingInfo>
updateProjectBillingInfoTransportSettings =
GrpcCallSettings.<UpdateProjectBillingInfoRequest, ProjectBillingInfo>newBuilder()
.setMethodDescriptor(updateProjectBillingInfoMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<UpdateProjectBillingInfoRequest>() {
@Override
public Map<String, String> extract(UpdateProjectBillingInfoRequest 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<GetIamPolicyRequest, Policy> getIamPolicyTransportSettings =
GrpcCallSettings.<GetIamPolicyRequest, Policy>newBuilder()
.setMethodDescriptor(getIamPolicyMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetIamPolicyRequest>() {
@Override
public Map<String, String> extract(GetIamPolicyRequest 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();
GrpcCallSettings<SetIamPolicyRequest, Policy> setIamPolicyTransportSettings =
GrpcCallSettings.<SetIamPolicyRequest, Policy>newBuilder()
.setMethodDescriptor(setIamPolicyMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<SetIamPolicyRequest>() {
@Override
public Map<String, String> extract(SetIamPolicyRequest 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();
GrpcCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsTransportSettings =
GrpcCallSettings.<TestIamPermissionsRequest, TestIamPermissionsResponse>newBuilder()
.setMethodDescriptor(testIamPermissionsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<TestIamPermissionsRequest>() {
@Override
public Map<String, String> extract(TestIamPermissionsRequest 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 @@ -24,7 +24,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.billing.v1.ListServicesRequest;
import com.google.cloud.billing.v1.ListServicesResponse;
Expand All @@ -35,7 +34,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 @@ -122,13 +120,10 @@ protected GrpcCloudCatalogStub(
GrpcCallSettings.<ListSkusRequest, ListSkusResponse>newBuilder()
.setMethodDescriptor(listSkusMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListSkusRequest>() {
@Override
public Map<String, String> extract(ListSkusRequest 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
4 changes: 4 additions & 0 deletions proto-google-cloud-billing-v1/clirr-ignored-differences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@
<className>com/google/cloud/billing/v1/*OrBuilder</className>
<method>boolean has*(*)</method>
</difference>
<difference>
<differenceType>8001</differenceType>
<className>com/google/cloud/billing/v1/SkuName*</className>
</difference>
</differences>
Loading

0 comments on commit 733fd5e

Please sign in to comment.