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 (#47)
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 d3fcbba commit 2e458a9
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

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

private ListNodesPagedResponse(ListNodesPage page) {
Expand Down Expand Up @@ -1448,12 +1440,7 @@ public static ApiFuture<ListTensorFlowVersionsPagedResponse> createAsync(
ListTensorFlowVersionsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListTensorFlowVersionsPage, ListTensorFlowVersionsPagedResponse>() {
@Override
public ListTensorFlowVersionsPagedResponse apply(ListTensorFlowVersionsPage input) {
return new ListTensorFlowVersionsPagedResponse(input);
}
},
input -> new ListTensorFlowVersionsPagedResponse(input),
MoreExecutors.directExecutor());
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,13 @@ public TpuStubSettings.Builder getStubSettingsBuilder() {
return ((TpuStubSettings.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 @@ -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.tpu.v1.AcceleratorType;
import com.google.cloud.tpu.v1.CreateNodeRequest;
Expand All @@ -52,7 +51,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 @@ -237,91 +235,70 @@ protected GrpcTpuStub(
GrpcCallSettings.<ListNodesRequest, ListNodesResponse>newBuilder()
.setMethodDescriptor(listNodesMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListNodesRequest>() {
@Override
public Map<String, String> extract(ListNodesRequest 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<GetNodeRequest, Node> getNodeTransportSettings =
GrpcCallSettings.<GetNodeRequest, Node>newBuilder()
.setMethodDescriptor(getNodeMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetNodeRequest>() {
@Override
public Map<String, String> extract(GetNodeRequest 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<CreateNodeRequest, Operation> createNodeTransportSettings =
GrpcCallSettings.<CreateNodeRequest, Operation>newBuilder()
.setMethodDescriptor(createNodeMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CreateNodeRequest>() {
@Override
public Map<String, String> extract(CreateNodeRequest 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<DeleteNodeRequest, Operation> deleteNodeTransportSettings =
GrpcCallSettings.<DeleteNodeRequest, Operation>newBuilder()
.setMethodDescriptor(deleteNodeMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<DeleteNodeRequest>() {
@Override
public Map<String, String> extract(DeleteNodeRequest 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<ReimageNodeRequest, Operation> reimageNodeTransportSettings =
GrpcCallSettings.<ReimageNodeRequest, Operation>newBuilder()
.setMethodDescriptor(reimageNodeMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ReimageNodeRequest>() {
@Override
public Map<String, String> extract(ReimageNodeRequest 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<StopNodeRequest, Operation> stopNodeTransportSettings =
GrpcCallSettings.<StopNodeRequest, Operation>newBuilder()
.setMethodDescriptor(stopNodeMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<StopNodeRequest>() {
@Override
public Map<String, String> extract(StopNodeRequest 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<StartNodeRequest, Operation> startNodeTransportSettings =
GrpcCallSettings.<StartNodeRequest, Operation>newBuilder()
.setMethodDescriptor(startNodeMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<StartNodeRequest>() {
@Override
public Map<String, String> extract(StartNodeRequest 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<ListTensorFlowVersionsRequest, ListTensorFlowVersionsResponse>
Expand All @@ -330,55 +307,43 @@ public Map<String, String> extract(StartNodeRequest request) {
.<ListTensorFlowVersionsRequest, ListTensorFlowVersionsResponse>newBuilder()
.setMethodDescriptor(listTensorFlowVersionsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListTensorFlowVersionsRequest>() {
@Override
public Map<String, String> extract(ListTensorFlowVersionsRequest 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<GetTensorFlowVersionRequest, TensorFlowVersion>
getTensorFlowVersionTransportSettings =
GrpcCallSettings.<GetTensorFlowVersionRequest, TensorFlowVersion>newBuilder()
.setMethodDescriptor(getTensorFlowVersionMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetTensorFlowVersionRequest>() {
@Override
public Map<String, String> extract(GetTensorFlowVersionRequest 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<ListAcceleratorTypesRequest, ListAcceleratorTypesResponse>
listAcceleratorTypesTransportSettings =
GrpcCallSettings.<ListAcceleratorTypesRequest, ListAcceleratorTypesResponse>newBuilder()
.setMethodDescriptor(listAcceleratorTypesMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListAcceleratorTypesRequest>() {
@Override
public Map<String, String> extract(ListAcceleratorTypesRequest 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<GetAcceleratorTypeRequest, AcceleratorType>
getAcceleratorTypeTransportSettings =
GrpcCallSettings.<GetAcceleratorTypeRequest, AcceleratorType>newBuilder()
.setMethodDescriptor(getAcceleratorTypeMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetAcceleratorTypeRequest>() {
@Override
public Map<String, String> extract(GetAcceleratorTypeRequest 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 @@ -841,14 +841,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 2e458a9

Please sign in to comment.