diff --git a/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java b/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java index e2c442b4a106..bd218ee4816c 100644 --- a/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java +++ b/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java @@ -24,7 +24,9 @@ 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.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; @@ -44,6 +46,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; @@ -196,45 +199,135 @@ protected GrpcPublisherStub( GrpcCallSettings createTopicTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createTopicMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(Topic request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); GrpcCallSettings updateTopicTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateTopicMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateTopicRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("topic.name", String.valueOf(request.getTopic().getName())); + return params.build(); + } + }) .build(); GrpcCallSettings publishTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(publishMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(PublishRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("topic", String.valueOf(request.getTopic())); + return params.build(); + } + }) .build(); GrpcCallSettings getTopicTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getTopicMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetTopicRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("topic", String.valueOf(request.getTopic())); + return params.build(); + } + }) .build(); GrpcCallSettings listTopicsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listTopicsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListTopicsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("project", String.valueOf(request.getProject())); + return params.build(); + } + }) .build(); GrpcCallSettings listTopicSubscriptionsTransportSettings = GrpcCallSettings .newBuilder() .setMethodDescriptor(listTopicSubscriptionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListTopicSubscriptionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("topic", String.valueOf(request.getTopic())); + return params.build(); + } + }) .build(); GrpcCallSettings deleteTopicTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteTopicMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteTopicRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("topic", String.valueOf(request.getTopic())); + 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.createTopicCallable = diff --git a/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java b/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java index ba05a6290919..e83badf66798 100644 --- a/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java +++ b/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java @@ -25,7 +25,9 @@ import com.google.api.gax.grpc.GrpcStubCallableFactory; import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientContext; +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; @@ -56,6 +58,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; @@ -295,35 +298,108 @@ protected GrpcSubscriberStub( GrpcCallSettings createSubscriptionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createSubscriptionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(Subscription request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); GrpcCallSettings getSubscriptionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getSubscriptionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetSubscriptionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("subscription", String.valueOf(request.getSubscription())); + return params.build(); + } + }) .build(); GrpcCallSettings updateSubscriptionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateSubscriptionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateSubscriptionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "subscription.name", String.valueOf(request.getSubscription().getName())); + return params.build(); + } + }) .build(); GrpcCallSettings listSubscriptionsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listSubscriptionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListSubscriptionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("project", String.valueOf(request.getProject())); + return params.build(); + } + }) .build(); GrpcCallSettings deleteSubscriptionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteSubscriptionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteSubscriptionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("subscription", String.valueOf(request.getSubscription())); + return params.build(); + } + }) .build(); GrpcCallSettings modifyAckDeadlineTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(modifyAckDeadlineMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ModifyAckDeadlineRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("subscription", String.valueOf(request.getSubscription())); + return params.build(); + } + }) .build(); GrpcCallSettings acknowledgeTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(acknowledgeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(AcknowledgeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("subscription", String.valueOf(request.getSubscription())); + return params.build(); + } + }) .build(); GrpcCallSettings pullTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(pullMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(PullRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("subscription", String.valueOf(request.getSubscription())); + return params.build(); + } + }) .build(); GrpcCallSettings streamingPullTransportSettings = GrpcCallSettings.newBuilder() @@ -332,39 +408,120 @@ protected GrpcSubscriberStub( GrpcCallSettings modifyPushConfigTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(modifyPushConfigMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ModifyPushConfigRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("subscription", String.valueOf(request.getSubscription())); + return params.build(); + } + }) .build(); GrpcCallSettings listSnapshotsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listSnapshotsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListSnapshotsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("project", String.valueOf(request.getProject())); + return params.build(); + } + }) .build(); GrpcCallSettings createSnapshotTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createSnapshotMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateSnapshotRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) .build(); GrpcCallSettings updateSnapshotTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateSnapshotMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateSnapshotRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("snapshot.name", String.valueOf(request.getSnapshot().getName())); + return params.build(); + } + }) .build(); GrpcCallSettings deleteSnapshotTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteSnapshotMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteSnapshotRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("snapshot", String.valueOf(request.getSnapshot())); + return params.build(); + } + }) .build(); GrpcCallSettings seekTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(seekMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SeekRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("subscription", String.valueOf(request.getSubscription())); + 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.createSubscriptionCallable = diff --git a/google-cloud-clients/google-cloud-pubsub/synth.metadata b/google-cloud-clients/google-cloud-pubsub/synth.metadata index 0bb9804e4706..0e87efc6b207 100644 --- a/google-cloud-clients/google-cloud-pubsub/synth.metadata +++ b/google-cloud-clients/google-cloud-pubsub/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-03-24T07:48:10.875442Z", + "updateTime": "2019-03-28T07:51:12.284901Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.19", - "dockerImage": "googleapis/artman@sha256:70ba28fda87e032ae44e6df41b7fc342c1b0cce1ed90658c4890eb4f613038c2" + "version": "0.16.20", + "dockerImage": "googleapis/artman@sha256:e3c054a2fb85a12481c722af616c7fb6f1d02d862248385eecbec3e4240ebd1e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e80435a132c53da26f46daf0787035ee63fb942b", - "internalRef": "239938670" + "sha": "6a84b3267b0a95e922608b9891219075047eee29", + "internalRef": "240640999" } } ],