Skip to content

Commit

Permalink
Regenerate spanner client (#4776)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and Praful Makani committed Mar 28, 2019
1 parent 7c23d2b commit 02d1441
Show file tree
Hide file tree
Showing 4 changed files with 311 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
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.common.collect.ImmutableMap;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
Expand All @@ -47,6 +49,7 @@
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 @@ -201,40 +204,121 @@ protected GrpcDatabaseAdminStub(
GrpcCallSettings<ListDatabasesRequest, ListDatabasesResponse> listDatabasesTransportSettings =
GrpcCallSettings.<ListDatabasesRequest, ListDatabasesResponse>newBuilder()
.setMethodDescriptor(listDatabasesMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListDatabasesRequest>() {
@Override
public Map<String, String> extract(ListDatabasesRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();
GrpcCallSettings<CreateDatabaseRequest, Operation> createDatabaseTransportSettings =
GrpcCallSettings.<CreateDatabaseRequest, Operation>newBuilder()
.setMethodDescriptor(createDatabaseMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CreateDatabaseRequest>() {
@Override
public Map<String, String> extract(CreateDatabaseRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();
GrpcCallSettings<GetDatabaseRequest, Database> getDatabaseTransportSettings =
GrpcCallSettings.<GetDatabaseRequest, Database>newBuilder()
.setMethodDescriptor(getDatabaseMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetDatabaseRequest>() {
@Override
public Map<String, String> extract(GetDatabaseRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings<UpdateDatabaseDdlRequest, Operation> updateDatabaseDdlTransportSettings =
GrpcCallSettings.<UpdateDatabaseDdlRequest, Operation>newBuilder()
.setMethodDescriptor(updateDatabaseDdlMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<UpdateDatabaseDdlRequest>() {
@Override
public Map<String, String> extract(UpdateDatabaseDdlRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("database", String.valueOf(request.getDatabase()));
return params.build();
}
})
.build();
GrpcCallSettings<DropDatabaseRequest, Empty> dropDatabaseTransportSettings =
GrpcCallSettings.<DropDatabaseRequest, Empty>newBuilder()
.setMethodDescriptor(dropDatabaseMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<DropDatabaseRequest>() {
@Override
public Map<String, String> extract(DropDatabaseRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("database", String.valueOf(request.getDatabase()));
return params.build();
}
})
.build();
GrpcCallSettings<GetDatabaseDdlRequest, GetDatabaseDdlResponse>
getDatabaseDdlTransportSettings =
GrpcCallSettings.<GetDatabaseDdlRequest, GetDatabaseDdlResponse>newBuilder()
.setMethodDescriptor(getDatabaseDdlMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetDatabaseDdlRequest>() {
@Override
public Map<String, String> extract(GetDatabaseDdlRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("database", String.valueOf(request.getDatabase()));
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();
}
})
.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();
}
})
.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();
}
})
.build();

this.listDatabasesCallable =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
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.common.collect.ImmutableMap;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
Expand All @@ -50,6 +52,7 @@
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 @@ -221,43 +224,133 @@ protected GrpcInstanceAdminStub(
listInstanceConfigsTransportSettings =
GrpcCallSettings.<ListInstanceConfigsRequest, ListInstanceConfigsResponse>newBuilder()
.setMethodDescriptor(listInstanceConfigsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListInstanceConfigsRequest>() {
@Override
public Map<String, String> extract(ListInstanceConfigsRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();
GrpcCallSettings<GetInstanceConfigRequest, InstanceConfig> getInstanceConfigTransportSettings =
GrpcCallSettings.<GetInstanceConfigRequest, InstanceConfig>newBuilder()
.setMethodDescriptor(getInstanceConfigMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetInstanceConfigRequest>() {
@Override
public Map<String, String> extract(GetInstanceConfigRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings<ListInstancesRequest, ListInstancesResponse> listInstancesTransportSettings =
GrpcCallSettings.<ListInstancesRequest, ListInstancesResponse>newBuilder()
.setMethodDescriptor(listInstancesMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListInstancesRequest>() {
@Override
public Map<String, String> extract(ListInstancesRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();
GrpcCallSettings<GetInstanceRequest, Instance> getInstanceTransportSettings =
GrpcCallSettings.<GetInstanceRequest, Instance>newBuilder()
.setMethodDescriptor(getInstanceMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetInstanceRequest>() {
@Override
public Map<String, String> extract(GetInstanceRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings<CreateInstanceRequest, Operation> createInstanceTransportSettings =
GrpcCallSettings.<CreateInstanceRequest, Operation>newBuilder()
.setMethodDescriptor(createInstanceMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CreateInstanceRequest>() {
@Override
public Map<String, String> extract(CreateInstanceRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();
GrpcCallSettings<UpdateInstanceRequest, Operation> updateInstanceTransportSettings =
GrpcCallSettings.<UpdateInstanceRequest, Operation>newBuilder()
.setMethodDescriptor(updateInstanceMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<UpdateInstanceRequest>() {
@Override
public Map<String, String> extract(UpdateInstanceRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("instance.name", String.valueOf(request.getInstance().getName()));
return params.build();
}
})
.build();
GrpcCallSettings<DeleteInstanceRequest, Empty> deleteInstanceTransportSettings =
GrpcCallSettings.<DeleteInstanceRequest, Empty>newBuilder()
.setMethodDescriptor(deleteInstanceMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<DeleteInstanceRequest>() {
@Override
public Map<String, String> extract(DeleteInstanceRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
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();
}
})
.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();
}
})
.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();
}
})
.build();

this.listInstanceConfigsCallable =
Expand Down
Loading

0 comments on commit 02d1441

Please sign in to comment.