From cd05bc422053cd202db204a676789815081ed90c Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Thu, 28 Mar 2019 00:55:17 -0700 Subject: [PATCH] Regenerate spanner client --- .../v1/stub/GrpcDatabaseAdminStub.java | 84 ++++++++++++ .../v1/stub/GrpcInstanceAdminStub.java | 93 +++++++++++++ .../spanner/v1/stub/GrpcSpannerStub.java | 129 ++++++++++++++++++ .../google-cloud-spanner/synth.metadata | 10 +- 4 files changed, 311 insertions(+), 5 deletions(-) diff --git a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminStub.java b/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminStub.java index ab043ba0131f..c1152861e7ec 100644 --- a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminStub.java +++ b/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminStub.java @@ -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; @@ -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; @@ -201,40 +204,121 @@ protected GrpcDatabaseAdminStub( GrpcCallSettings listDatabasesTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listDatabasesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListDatabasesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) .build(); GrpcCallSettings createDatabaseTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createDatabaseMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateDatabaseRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) .build(); GrpcCallSettings getDatabaseTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getDatabaseMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetDatabaseRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); GrpcCallSettings updateDatabaseDdlTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateDatabaseDdlMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateDatabaseDdlRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("database", String.valueOf(request.getDatabase())); + return params.build(); + } + }) .build(); GrpcCallSettings dropDatabaseTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(dropDatabaseMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DropDatabaseRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("database", String.valueOf(request.getDatabase())); + return params.build(); + } + }) .build(); GrpcCallSettings getDatabaseDdlTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getDatabaseDdlMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetDatabaseDdlRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("database", String.valueOf(request.getDatabase())); + return params.build(); + } + }) .build(); GrpcCallSettings setIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) .build(); GrpcCallSettings getIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) .build(); GrpcCallSettings testIamPermissionsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(TestIamPermissionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) .build(); this.listDatabasesCallable = diff --git a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/GrpcInstanceAdminStub.java b/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/GrpcInstanceAdminStub.java index c9ab3dc6d289..e190dd65d7af 100644 --- a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/GrpcInstanceAdminStub.java +++ b/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/GrpcInstanceAdminStub.java @@ -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; @@ -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; @@ -221,43 +224,133 @@ protected GrpcInstanceAdminStub( listInstanceConfigsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listInstanceConfigsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListInstanceConfigsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) .build(); GrpcCallSettings getInstanceConfigTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getInstanceConfigMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetInstanceConfigRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); GrpcCallSettings listInstancesTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listInstancesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListInstancesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) .build(); GrpcCallSettings getInstanceTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getInstanceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetInstanceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); GrpcCallSettings createInstanceTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createInstanceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateInstanceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) .build(); GrpcCallSettings updateInstanceTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateInstanceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateInstanceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("instance.name", String.valueOf(request.getInstance().getName())); + return params.build(); + } + }) .build(); GrpcCallSettings deleteInstanceTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteInstanceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteInstanceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); GrpcCallSettings setIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) .build(); GrpcCallSettings getIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) .build(); GrpcCallSettings testIamPermissionsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(TestIamPermissionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) .build(); this.listInstanceConfigsCallable = diff --git a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/stub/GrpcSpannerStub.java b/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/stub/GrpcSpannerStub.java index 326ec0816c08..f38dd404abf8 100644 --- a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/stub/GrpcSpannerStub.java +++ b/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/stub/GrpcSpannerStub.java @@ -23,8 +23,10 @@ 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.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; import com.google.protobuf.Empty; import com.google.spanner.v1.BeginTransactionRequest; import com.google.spanner.v1.CommitRequest; @@ -49,6 +51,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; @@ -236,59 +239,185 @@ protected GrpcSpannerStub( GrpcCallSettings createSessionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createSessionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateSessionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("database", String.valueOf(request.getDatabase())); + return params.build(); + } + }) .build(); GrpcCallSettings getSessionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getSessionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetSessionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); GrpcCallSettings listSessionsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listSessionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListSessionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("database", String.valueOf(request.getDatabase())); + return params.build(); + } + }) .build(); GrpcCallSettings deleteSessionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteSessionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteSessionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); GrpcCallSettings executeSqlTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(executeSqlMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ExecuteSqlRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("session", String.valueOf(request.getSession())); + return params.build(); + } + }) .build(); GrpcCallSettings executeStreamingSqlTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(executeStreamingSqlMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ExecuteSqlRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("session", String.valueOf(request.getSession())); + return params.build(); + } + }) .build(); GrpcCallSettings executeBatchDmlTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(executeBatchDmlMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ExecuteBatchDmlRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("session", String.valueOf(request.getSession())); + return params.build(); + } + }) .build(); GrpcCallSettings readTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(readMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ReadRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("session", String.valueOf(request.getSession())); + return params.build(); + } + }) .build(); GrpcCallSettings streamingReadTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(streamingReadMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ReadRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("session", String.valueOf(request.getSession())); + return params.build(); + } + }) .build(); GrpcCallSettings beginTransactionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(beginTransactionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(BeginTransactionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("session", String.valueOf(request.getSession())); + return params.build(); + } + }) .build(); GrpcCallSettings commitTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(commitMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CommitRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("session", String.valueOf(request.getSession())); + return params.build(); + } + }) .build(); GrpcCallSettings rollbackTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(rollbackMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(RollbackRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("session", String.valueOf(request.getSession())); + return params.build(); + } + }) .build(); GrpcCallSettings partitionQueryTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(partitionQueryMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(PartitionQueryRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("session", String.valueOf(request.getSession())); + return params.build(); + } + }) .build(); GrpcCallSettings partitionReadTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(partitionReadMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(PartitionReadRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("session", String.valueOf(request.getSession())); + return params.build(); + } + }) .build(); this.createSessionCallable = diff --git a/google-cloud-clients/google-cloud-spanner/synth.metadata b/google-cloud-clients/google-cloud-spanner/synth.metadata index 9e4f94580108..f0bc523f5b19 100644 --- a/google-cloud-clients/google-cloud-spanner/synth.metadata +++ b/google-cloud-clients/google-cloud-spanner/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-03-06T08:52:00.759549Z", + "updateTime": "2019-03-28T07:55:17.523663Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.15", - "dockerImage": "googleapis/artman@sha256:9caadfa59d48224cba5f3217eb9d61a155b78ccf31e628abef385bc5b7ed3bd2" + "version": "0.16.20", + "dockerImage": "googleapis/artman@sha256:e3c054a2fb85a12481c722af616c7fb6f1d02d862248385eecbec3e4240ebd1e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "856117505ff9075b3e9c0b5674113667b6cf9e00", - "internalRef": "236931378" + "sha": "6a84b3267b0a95e922608b9891219075047eee29", + "internalRef": "240640999" } } ],