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 (#288)
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] authored Aug 4, 2021
1 parent ee89fc8 commit c3fb37b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.google.cloud.assuredworkloads.v1beta1;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,13 @@ public AssuredWorkloadsServiceStubSettings.Builder getStubSettingsBuilder() {
return ((AssuredWorkloadsServiceStubSettings.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 @@ -449,14 +449,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 @@ -25,7 +25,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.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata;
import com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest;
Expand All @@ -42,7 +41,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 @@ -168,65 +166,50 @@ protected GrpcAssuredWorkloadsServiceStub(
GrpcCallSettings.<CreateWorkloadRequest, Operation>newBuilder()
.setMethodDescriptor(createWorkloadMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CreateWorkloadRequest>() {
@Override
public Map<String, String> extract(CreateWorkloadRequest 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<UpdateWorkloadRequest, Workload> updateWorkloadTransportSettings =
GrpcCallSettings.<UpdateWorkloadRequest, Workload>newBuilder()
.setMethodDescriptor(updateWorkloadMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<UpdateWorkloadRequest>() {
@Override
public Map<String, String> extract(UpdateWorkloadRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("workload.name", String.valueOf(request.getWorkload().getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("workload.name", String.valueOf(request.getWorkload().getName()));
return params.build();
})
.build();
GrpcCallSettings<DeleteWorkloadRequest, Empty> deleteWorkloadTransportSettings =
GrpcCallSettings.<DeleteWorkloadRequest, Empty>newBuilder()
.setMethodDescriptor(deleteWorkloadMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<DeleteWorkloadRequest>() {
@Override
public Map<String, String> extract(DeleteWorkloadRequest 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<GetWorkloadRequest, Workload> getWorkloadTransportSettings =
GrpcCallSettings.<GetWorkloadRequest, Workload>newBuilder()
.setMethodDescriptor(getWorkloadMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetWorkloadRequest>() {
@Override
public Map<String, String> extract(GetWorkloadRequest 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<ListWorkloadsRequest, ListWorkloadsResponse> listWorkloadsTransportSettings =
GrpcCallSettings.<ListWorkloadsRequest, ListWorkloadsResponse>newBuilder()
.setMethodDescriptor(listWorkloadsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListWorkloadsRequest>() {
@Override
public Map<String, String> extract(ListWorkloadsRequest 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

0 comments on commit c3fb37b

Please sign in to comment.