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 (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] authored Aug 10, 2021
1 parent 56a01da commit 83cc576
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 524 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

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

private ListJobsPagedResponse(ListJobsPage page) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,13 @@ public CloudSchedulerStubSettings.Builder getStubSettingsBuilder() {
return ((CloudSchedulerStubSettings.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 @@ -452,14 +452,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 @@ -23,7 +23,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.scheduler.v1.CreateJobRequest;
import com.google.cloud.scheduler.v1.DeleteJobRequest;
Expand All @@ -41,7 +40,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 @@ -176,104 +174,80 @@ protected GrpcCloudSchedulerStub(
GrpcCallSettings.<ListJobsRequest, ListJobsResponse>newBuilder()
.setMethodDescriptor(listJobsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListJobsRequest>() {
@Override
public Map<String, String> extract(ListJobsRequest 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<GetJobRequest, Job> getJobTransportSettings =
GrpcCallSettings.<GetJobRequest, Job>newBuilder()
.setMethodDescriptor(getJobMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetJobRequest>() {
@Override
public Map<String, String> extract(GetJobRequest 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<CreateJobRequest, Job> createJobTransportSettings =
GrpcCallSettings.<CreateJobRequest, Job>newBuilder()
.setMethodDescriptor(createJobMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CreateJobRequest>() {
@Override
public Map<String, String> extract(CreateJobRequest 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<UpdateJobRequest, Job> updateJobTransportSettings =
GrpcCallSettings.<UpdateJobRequest, Job>newBuilder()
.setMethodDescriptor(updateJobMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<UpdateJobRequest>() {
@Override
public Map<String, String> extract(UpdateJobRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("job.name", String.valueOf(request.getJob().getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("job.name", String.valueOf(request.getJob().getName()));
return params.build();
})
.build();
GrpcCallSettings<DeleteJobRequest, Empty> deleteJobTransportSettings =
GrpcCallSettings.<DeleteJobRequest, Empty>newBuilder()
.setMethodDescriptor(deleteJobMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<DeleteJobRequest>() {
@Override
public Map<String, String> extract(DeleteJobRequest 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<PauseJobRequest, Job> pauseJobTransportSettings =
GrpcCallSettings.<PauseJobRequest, Job>newBuilder()
.setMethodDescriptor(pauseJobMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<PauseJobRequest>() {
@Override
public Map<String, String> extract(PauseJobRequest 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<ResumeJobRequest, Job> resumeJobTransportSettings =
GrpcCallSettings.<ResumeJobRequest, Job>newBuilder()
.setMethodDescriptor(resumeJobMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ResumeJobRequest>() {
@Override
public Map<String, String> extract(ResumeJobRequest 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<RunJobRequest, Job> runJobTransportSettings =
GrpcCallSettings.<RunJobRequest, Job>newBuilder()
.setMethodDescriptor(runJobMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<RunJobRequest>() {
@Override
public Map<String, String> extract(RunJobRequest 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();

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

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

private ListJobsPagedResponse(ListJobsPage page) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,13 @@ public CloudSchedulerStubSettings.Builder getStubSettingsBuilder() {
return ((CloudSchedulerStubSettings.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 @@ -453,14 +453,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

0 comments on commit 83cc576

Please sign in to comment.