diff --git a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/GrpcCloudRedisStub.java b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/GrpcCloudRedisStub.java index 9badb859dbe2..a06da0333be7 100644 --- a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/GrpcCloudRedisStub.java +++ b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/GrpcCloudRedisStub.java @@ -24,6 +24,7 @@ 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.redis.v1.CreateInstanceRequest; import com.google.cloud.redis.v1.DeleteInstanceRequest; @@ -34,12 +35,14 @@ import com.google.cloud.redis.v1.ListInstancesResponse; import com.google.cloud.redis.v1.OperationMetadata; import com.google.cloud.redis.v1.UpdateInstanceRequest; +import com.google.common.collect.ImmutableMap; import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; 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; @@ -170,26 +173,80 @@ protected GrpcCloudRedisStub( 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 failoverInstanceTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(failoverInstanceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(FailoverInstanceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); this.listInstancesCallable = diff --git a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisStub.java b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisStub.java index 61b09faeda93..5db310d4b001 100644 --- a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisStub.java +++ b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisStub.java @@ -24,6 +24,7 @@ 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.redis.v1beta1.CreateInstanceRequest; import com.google.cloud.redis.v1beta1.DeleteInstanceRequest; @@ -32,6 +33,7 @@ import com.google.cloud.redis.v1beta1.ListInstancesRequest; import com.google.cloud.redis.v1beta1.ListInstancesResponse; import com.google.cloud.redis.v1beta1.UpdateInstanceRequest; +import com.google.common.collect.ImmutableMap; import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Any; @@ -39,6 +41,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; @@ -157,22 +160,67 @@ protected GrpcCloudRedisStub( 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(); this.listInstancesCallable = diff --git a/google-cloud-clients/google-cloud-redis/synth.metadata b/google-cloud-clients/google-cloud-redis/synth.metadata index a8597d37c5e0..212e183e6ce5 100644 --- a/google-cloud-clients/google-cloud-redis/synth.metadata +++ b/google-cloud-clients/google-cloud-redis/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-03-06T08:49:45.177637Z", + "updateTime": "2019-03-28T07:52:01.915517Z", "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" } } ],