Skip to content

Commit

Permalink
feat!: release gapic-generator-java v2.0.0 (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] authored Aug 4, 2021
1 parent 86cc52f commit 1541cad
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,13 @@ public WorkflowsStubSettings.Builder getStubSettingsBuilder() {
return ((WorkflowsStubSettings.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 @@ -24,7 +24,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.workflows.v1.CreateWorkflowRequest;
import com.google.cloud.workflows.v1.DeleteWorkflowRequest;
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 @@ -161,65 +159,50 @@ protected GrpcWorkflowsStub(
GrpcCallSettings.<ListWorkflowsRequest, ListWorkflowsResponse>newBuilder()
.setMethodDescriptor(listWorkflowsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListWorkflowsRequest>() {
@Override
public Map<String, String> extract(ListWorkflowsRequest 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<GetWorkflowRequest, Workflow> getWorkflowTransportSettings =
GrpcCallSettings.<GetWorkflowRequest, Workflow>newBuilder()
.setMethodDescriptor(getWorkflowMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetWorkflowRequest>() {
@Override
public Map<String, String> extract(GetWorkflowRequest 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<CreateWorkflowRequest, Operation> createWorkflowTransportSettings =
GrpcCallSettings.<CreateWorkflowRequest, Operation>newBuilder()
.setMethodDescriptor(createWorkflowMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CreateWorkflowRequest>() {
@Override
public Map<String, String> extract(CreateWorkflowRequest 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<DeleteWorkflowRequest, Operation> deleteWorkflowTransportSettings =
GrpcCallSettings.<DeleteWorkflowRequest, Operation>newBuilder()
.setMethodDescriptor(deleteWorkflowMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<DeleteWorkflowRequest>() {
@Override
public Map<String, String> extract(DeleteWorkflowRequest 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<UpdateWorkflowRequest, Operation> updateWorkflowTransportSettings =
GrpcCallSettings.<UpdateWorkflowRequest, Operation>newBuilder()
.setMethodDescriptor(updateWorkflowMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<UpdateWorkflowRequest>() {
@Override
public Map<String, String> extract(UpdateWorkflowRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("workflow.name", String.valueOf(request.getWorkflow().getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("workflow.name", String.valueOf(request.getWorkflow().getName()));
return params.build();
})
.build();

Expand Down Expand Up @@ -319,7 +302,13 @@ public UnaryCallable<UpdateWorkflowRequest, Operation> updateWorkflowCallable()

@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 @@ -494,14 +494,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 @@ -16,7 +16,6 @@

package com.google.cloud.workflows.v1beta;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,13 @@ public WorkflowsStubSettings.Builder getStubSettingsBuilder() {
return ((WorkflowsStubSettings.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 @@ -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.workflows.v1beta.CreateWorkflowRequest;
import com.google.cloud.workflows.v1beta.DeleteWorkflowRequest;
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 @@ -163,65 +161,50 @@ protected GrpcWorkflowsStub(
GrpcCallSettings.<ListWorkflowsRequest, ListWorkflowsResponse>newBuilder()
.setMethodDescriptor(listWorkflowsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListWorkflowsRequest>() {
@Override
public Map<String, String> extract(ListWorkflowsRequest 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<GetWorkflowRequest, Workflow> getWorkflowTransportSettings =
GrpcCallSettings.<GetWorkflowRequest, Workflow>newBuilder()
.setMethodDescriptor(getWorkflowMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetWorkflowRequest>() {
@Override
public Map<String, String> extract(GetWorkflowRequest 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<CreateWorkflowRequest, Operation> createWorkflowTransportSettings =
GrpcCallSettings.<CreateWorkflowRequest, Operation>newBuilder()
.setMethodDescriptor(createWorkflowMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CreateWorkflowRequest>() {
@Override
public Map<String, String> extract(CreateWorkflowRequest 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<DeleteWorkflowRequest, Operation> deleteWorkflowTransportSettings =
GrpcCallSettings.<DeleteWorkflowRequest, Operation>newBuilder()
.setMethodDescriptor(deleteWorkflowMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<DeleteWorkflowRequest>() {
@Override
public Map<String, String> extract(DeleteWorkflowRequest 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<UpdateWorkflowRequest, Operation> updateWorkflowTransportSettings =
GrpcCallSettings.<UpdateWorkflowRequest, Operation>newBuilder()
.setMethodDescriptor(updateWorkflowMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<UpdateWorkflowRequest>() {
@Override
public Map<String, String> extract(UpdateWorkflowRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("workflow.name", String.valueOf(request.getWorkflow().getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("workflow.name", String.valueOf(request.getWorkflow().getName()));
return params.build();
})
.build();

Expand Down Expand Up @@ -321,7 +304,13 @@ public UnaryCallable<UpdateWorkflowRequest, Operation> updateWorkflowCallable()

@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 @@ -495,14 +495,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

0 comments on commit 1541cad

Please sign in to comment.