From da345eb390c9fd66950d3e0e5af99224c328cc59 Mon Sep 17 00:00:00 2001 From: Michael Bausor Date: Fri, 13 May 2016 14:14:17 -0700 Subject: [PATCH] Removed formatted prefix from parameters --- .../cloud/pubsub/spi/v1/PublisherApi.java | 48 ++++++------ .../cloud/pubsub/spi/v1/SubscriberApi.java | 74 +++++++++---------- .../cloud/pubsub/spi/v1/PublisherApi.java | 48 ++++++------ .../cloud/pubsub/spi/v1/SubscriberApi.java | 74 +++++++++---------- 4 files changed, 118 insertions(+), 126 deletions(-) diff --git a/gcloud-java-pubsub/baseline/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherApi.java b/gcloud-java-pubsub/baseline/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherApi.java index 644d19188200..7d8eb0f15e79 100644 --- a/gcloud-java-pubsub/baseline/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherApi.java +++ b/gcloud-java-pubsub/baseline/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherApi.java @@ -288,7 +288,7 @@ public void close() throws IOException { * * * - * @param formattedName The name of the topic. It must have the format + * @param name The name of the topic. It must have the format * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent @@ -296,9 +296,9 @@ public void close() throws IOException { * must not start with `"goog"`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final Topic createTopic(String formattedName) { - TOPIC_PATH_TEMPLATE.validate(formattedName); - Topic request = Topic.newBuilder().setName(formattedName).build(); + public final Topic createTopic(String name) { + TOPIC_PATH_TEMPLATE.validate(name); + Topic request = Topic.newBuilder().setName(name).build(); return createTopic(request); } @@ -371,15 +371,15 @@ public final ApiCallable createTopicCallable() { * * * - * @param formattedTopic The messages in the request will be published on this topic. + * @param topic The messages in the request will be published on this topic. * @param messages The messages to publish. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final PublishResponse publish(String formattedTopic, List messages) { - TOPIC_PATH_TEMPLATE.validate(formattedTopic); + public final PublishResponse publish(String topic, List messages) { + TOPIC_PATH_TEMPLATE.validate(topic); PublishRequest request = - PublishRequest.newBuilder().setTopic(formattedTopic).addAllMessages(messages).build(); + PublishRequest.newBuilder().setTopic(topic).addAllMessages(messages).build(); return publish(request); } @@ -457,12 +457,12 @@ public final ApiCallable publishCallable() { * * * - * @param formattedTopic The name of the topic to get. + * @param topic The name of the topic to get. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final Topic getTopic(String formattedTopic) { - TOPIC_PATH_TEMPLATE.validate(formattedTopic); - GetTopicRequest request = GetTopicRequest.newBuilder().setTopic(formattedTopic).build(); + public final Topic getTopic(String topic) { + TOPIC_PATH_TEMPLATE.validate(topic); + GetTopicRequest request = GetTopicRequest.newBuilder().setTopic(topic).build(); return getTopic(request); } @@ -534,12 +534,12 @@ public final ApiCallable getTopicCallable() { * * * - * @param formattedProject The name of the cloud project that topics belong to. + * @param project The name of the cloud project that topics belong to. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final PageAccessor listTopics(String formattedProject) { - PROJECT_PATH_TEMPLATE.validate(formattedProject); - ListTopicsRequest request = ListTopicsRequest.newBuilder().setProject(formattedProject).build(); + public final PageAccessor listTopics(String project) { + PROJECT_PATH_TEMPLATE.validate(project); + ListTopicsRequest request = ListTopicsRequest.newBuilder().setProject(project).build(); return listTopics(request); } @@ -648,13 +648,13 @@ public final ApiCallable listTopicsCallab * * * - * @param formattedTopic The name of the topic that subscriptions are attached to. + * @param topic The name of the topic that subscriptions are attached to. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final PageAccessor listTopicSubscriptions(String formattedTopic) { - TOPIC_PATH_TEMPLATE.validate(formattedTopic); + public final PageAccessor listTopicSubscriptions(String topic) { + TOPIC_PATH_TEMPLATE.validate(topic); ListTopicSubscriptionsRequest request = - ListTopicSubscriptionsRequest.newBuilder().setTopic(formattedTopic).build(); + ListTopicSubscriptionsRequest.newBuilder().setTopic(topic).build(); return listTopicSubscriptions(request); } @@ -767,12 +767,12 @@ public final PageAccessor listTopicSubscriptions(ListTopicSubscriptionsR * * * - * @param formattedTopic Name of the topic to delete. + * @param topic Name of the topic to delete. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final void deleteTopic(String formattedTopic) { - TOPIC_PATH_TEMPLATE.validate(formattedTopic); - DeleteTopicRequest request = DeleteTopicRequest.newBuilder().setTopic(formattedTopic).build(); + public final void deleteTopic(String topic) { + TOPIC_PATH_TEMPLATE.validate(topic); + DeleteTopicRequest request = DeleteTopicRequest.newBuilder().setTopic(topic).build(); deleteTopic(request); } diff --git a/gcloud-java-pubsub/baseline/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberApi.java b/gcloud-java-pubsub/baseline/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberApi.java index 7fd76395b8e7..bbb1bf629f8f 100644 --- a/gcloud-java-pubsub/baseline/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberApi.java +++ b/gcloud-java-pubsub/baseline/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberApi.java @@ -335,13 +335,13 @@ public void close() throws IOException { * * * - * @param formattedName The name of the subscription. It must have the format + * @param name The name of the subscription. It must have the format * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must * start with a letter, and contain only letters (`[A-Za-z]`), numbers * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters * in length, and it must not start with `"goog"`. - * @param formattedTopic The name of the topic from which this subscription is receiving messages. + * @param topic The name of the topic from which this subscription is receiving messages. * @param pushConfig If push delivery is used with this subscription, this field is * used to configure it. An empty `pushConfig` signifies that the subscriber * will pull and ack messages using API methods. @@ -366,14 +366,14 @@ public void close() throws IOException { * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final Subscription createSubscription( - String formattedName, String formattedTopic, PushConfig pushConfig, int ackDeadlineSeconds) { - SUBSCRIPTION_PATH_TEMPLATE.validate(formattedName); - TOPIC_PATH_TEMPLATE.validate(formattedTopic); + String name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) { + SUBSCRIPTION_PATH_TEMPLATE.validate(name); + TOPIC_PATH_TEMPLATE.validate(topic); Subscription request = Subscription.newBuilder() - .setName(formattedName) - .setTopic(formattedTopic) + .setName(name) + .setTopic(topic) .setPushConfig(pushConfig) .setAckDeadlineSeconds(ackDeadlineSeconds) .build(); @@ -463,13 +463,13 @@ public final ApiCallable createSubscriptionCallable( * * * - * @param formattedSubscription The name of the subscription to get. + * @param subscription The name of the subscription to get. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final Subscription getSubscription(String formattedSubscription) { - SUBSCRIPTION_PATH_TEMPLATE.validate(formattedSubscription); + public final Subscription getSubscription(String subscription) { + SUBSCRIPTION_PATH_TEMPLATE.validate(subscription); GetSubscriptionRequest request = - GetSubscriptionRequest.newBuilder().setSubscription(formattedSubscription).build(); + GetSubscriptionRequest.newBuilder().setSubscription(subscription).build(); return getSubscription(request); } @@ -550,13 +550,13 @@ public final ApiCallable getSubscriptionCa * * * - * @param formattedProject The name of the cloud project that subscriptions belong to. + * @param project The name of the cloud project that subscriptions belong to. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final PageAccessor listSubscriptions(String formattedProject) { - PROJECT_PATH_TEMPLATE.validate(formattedProject); + public final PageAccessor listSubscriptions(String project) { + PROJECT_PATH_TEMPLATE.validate(project); ListSubscriptionsRequest request = - ListSubscriptionsRequest.newBuilder().setProject(formattedProject).build(); + ListSubscriptionsRequest.newBuilder().setProject(project).build(); return listSubscriptions(request); } @@ -678,13 +678,13 @@ public final PageAccessor listSubscriptions(ListSubscriptionsReque * * * - * @param formattedSubscription The subscription to delete. + * @param subscription The subscription to delete. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final void deleteSubscription(String formattedSubscription) { - SUBSCRIPTION_PATH_TEMPLATE.validate(formattedSubscription); + public final void deleteSubscription(String subscription) { + SUBSCRIPTION_PATH_TEMPLATE.validate(subscription); DeleteSubscriptionRequest request = - DeleteSubscriptionRequest.newBuilder().setSubscription(formattedSubscription).build(); + DeleteSubscriptionRequest.newBuilder().setSubscription(subscription).build(); deleteSubscription(request); } @@ -767,7 +767,7 @@ public final ApiCallable deleteSubscriptionCal * * * - * @param formattedSubscription The name of the subscription. + * @param subscription The name of the subscription. * @param ackIds List of acknowledgment IDs. * @param ackDeadlineSeconds The new ack deadline with respect to the time this request was sent to * the Pub/Sub system. Must be >= 0. For example, if the value is 10, the new @@ -777,12 +777,12 @@ public final ApiCallable deleteSubscriptionCal * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final void modifyAckDeadline( - String formattedSubscription, List ackIds, int ackDeadlineSeconds) { - SUBSCRIPTION_PATH_TEMPLATE.validate(formattedSubscription); + String subscription, List ackIds, int ackDeadlineSeconds) { + SUBSCRIPTION_PATH_TEMPLATE.validate(subscription); ModifyAckDeadlineRequest request = ModifyAckDeadlineRequest.newBuilder() - .setSubscription(formattedSubscription) + .setSubscription(subscription) .addAllAckIds(ackIds) .setAckDeadlineSeconds(ackDeadlineSeconds) .build(); @@ -876,19 +876,16 @@ public final ApiCallable modifyAckDeadlineCalla * * * - * @param formattedSubscription The subscription whose message is being acknowledged. + * @param subscription The subscription whose message is being acknowledged. * @param ackIds The acknowledgment ID for the messages being acknowledged that was returned * by the Pub/Sub system in the `Pull` response. Must not be empty. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final void acknowledge(String formattedSubscription, List ackIds) { - SUBSCRIPTION_PATH_TEMPLATE.validate(formattedSubscription); + public final void acknowledge(String subscription, List ackIds) { + SUBSCRIPTION_PATH_TEMPLATE.validate(subscription); AcknowledgeRequest request = - AcknowledgeRequest.newBuilder() - .setSubscription(formattedSubscription) - .addAllAckIds(ackIds) - .build(); + AcknowledgeRequest.newBuilder().setSubscription(subscription).addAllAckIds(ackIds).build(); acknowledge(request); } @@ -979,7 +976,7 @@ public final ApiCallable acknowledgeCallable() { * * * - * @param formattedSubscription The subscription from which messages should be pulled. + * @param subscription The subscription from which messages should be pulled. * @param returnImmediately If this is specified as true the system will respond immediately even if * it is not able to return a message in the `Pull` response. Otherwise the * system is allowed to wait until at least one message is available rather @@ -988,13 +985,12 @@ public final ApiCallable acknowledgeCallable() { * system may return fewer than the number specified. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final PullResponse pull( - String formattedSubscription, boolean returnImmediately, int maxMessages) { - SUBSCRIPTION_PATH_TEMPLATE.validate(formattedSubscription); + public final PullResponse pull(String subscription, boolean returnImmediately, int maxMessages) { + SUBSCRIPTION_PATH_TEMPLATE.validate(subscription); PullRequest request = PullRequest.newBuilder() - .setSubscription(formattedSubscription) + .setSubscription(subscription) .setReturnImmediately(returnImmediately) .setMaxMessages(maxMessages) .build(); @@ -1083,7 +1079,7 @@ public final ApiCallable pullCallable() { * * * - * @param formattedSubscription The name of the subscription. + * @param subscription The name of the subscription. * @param pushConfig The push configuration for future deliveries. * * An empty `pushConfig` indicates that the Pub/Sub system should @@ -1092,12 +1088,12 @@ public final ApiCallable pullCallable() { * the subscription if `Pull` is not called. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final void modifyPushConfig(String formattedSubscription, PushConfig pushConfig) { - SUBSCRIPTION_PATH_TEMPLATE.validate(formattedSubscription); + public final void modifyPushConfig(String subscription, PushConfig pushConfig) { + SUBSCRIPTION_PATH_TEMPLATE.validate(subscription); ModifyPushConfigRequest request = ModifyPushConfigRequest.newBuilder() - .setSubscription(formattedSubscription) + .setSubscription(subscription) .setPushConfig(pushConfig) .build(); modifyPushConfig(request); diff --git a/gcloud-java-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherApi.java b/gcloud-java-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherApi.java index 644d19188200..7d8eb0f15e79 100644 --- a/gcloud-java-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherApi.java +++ b/gcloud-java-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherApi.java @@ -288,7 +288,7 @@ public void close() throws IOException { * * * - * @param formattedName The name of the topic. It must have the format + * @param name The name of the topic. It must have the format * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent @@ -296,9 +296,9 @@ public void close() throws IOException { * must not start with `"goog"`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final Topic createTopic(String formattedName) { - TOPIC_PATH_TEMPLATE.validate(formattedName); - Topic request = Topic.newBuilder().setName(formattedName).build(); + public final Topic createTopic(String name) { + TOPIC_PATH_TEMPLATE.validate(name); + Topic request = Topic.newBuilder().setName(name).build(); return createTopic(request); } @@ -371,15 +371,15 @@ public final ApiCallable createTopicCallable() { * * * - * @param formattedTopic The messages in the request will be published on this topic. + * @param topic The messages in the request will be published on this topic. * @param messages The messages to publish. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final PublishResponse publish(String formattedTopic, List messages) { - TOPIC_PATH_TEMPLATE.validate(formattedTopic); + public final PublishResponse publish(String topic, List messages) { + TOPIC_PATH_TEMPLATE.validate(topic); PublishRequest request = - PublishRequest.newBuilder().setTopic(formattedTopic).addAllMessages(messages).build(); + PublishRequest.newBuilder().setTopic(topic).addAllMessages(messages).build(); return publish(request); } @@ -457,12 +457,12 @@ public final ApiCallable publishCallable() { * * * - * @param formattedTopic The name of the topic to get. + * @param topic The name of the topic to get. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final Topic getTopic(String formattedTopic) { - TOPIC_PATH_TEMPLATE.validate(formattedTopic); - GetTopicRequest request = GetTopicRequest.newBuilder().setTopic(formattedTopic).build(); + public final Topic getTopic(String topic) { + TOPIC_PATH_TEMPLATE.validate(topic); + GetTopicRequest request = GetTopicRequest.newBuilder().setTopic(topic).build(); return getTopic(request); } @@ -534,12 +534,12 @@ public final ApiCallable getTopicCallable() { * * * - * @param formattedProject The name of the cloud project that topics belong to. + * @param project The name of the cloud project that topics belong to. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final PageAccessor listTopics(String formattedProject) { - PROJECT_PATH_TEMPLATE.validate(formattedProject); - ListTopicsRequest request = ListTopicsRequest.newBuilder().setProject(formattedProject).build(); + public final PageAccessor listTopics(String project) { + PROJECT_PATH_TEMPLATE.validate(project); + ListTopicsRequest request = ListTopicsRequest.newBuilder().setProject(project).build(); return listTopics(request); } @@ -648,13 +648,13 @@ public final ApiCallable listTopicsCallab * * * - * @param formattedTopic The name of the topic that subscriptions are attached to. + * @param topic The name of the topic that subscriptions are attached to. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final PageAccessor listTopicSubscriptions(String formattedTopic) { - TOPIC_PATH_TEMPLATE.validate(formattedTopic); + public final PageAccessor listTopicSubscriptions(String topic) { + TOPIC_PATH_TEMPLATE.validate(topic); ListTopicSubscriptionsRequest request = - ListTopicSubscriptionsRequest.newBuilder().setTopic(formattedTopic).build(); + ListTopicSubscriptionsRequest.newBuilder().setTopic(topic).build(); return listTopicSubscriptions(request); } @@ -767,12 +767,12 @@ public final PageAccessor listTopicSubscriptions(ListTopicSubscriptionsR * * * - * @param formattedTopic Name of the topic to delete. + * @param topic Name of the topic to delete. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final void deleteTopic(String formattedTopic) { - TOPIC_PATH_TEMPLATE.validate(formattedTopic); - DeleteTopicRequest request = DeleteTopicRequest.newBuilder().setTopic(formattedTopic).build(); + public final void deleteTopic(String topic) { + TOPIC_PATH_TEMPLATE.validate(topic); + DeleteTopicRequest request = DeleteTopicRequest.newBuilder().setTopic(topic).build(); deleteTopic(request); } diff --git a/gcloud-java-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberApi.java b/gcloud-java-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberApi.java index 7fd76395b8e7..bbb1bf629f8f 100644 --- a/gcloud-java-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberApi.java +++ b/gcloud-java-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberApi.java @@ -335,13 +335,13 @@ public void close() throws IOException { * * * - * @param formattedName The name of the subscription. It must have the format + * @param name The name of the subscription. It must have the format * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must * start with a letter, and contain only letters (`[A-Za-z]`), numbers * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters * in length, and it must not start with `"goog"`. - * @param formattedTopic The name of the topic from which this subscription is receiving messages. + * @param topic The name of the topic from which this subscription is receiving messages. * @param pushConfig If push delivery is used with this subscription, this field is * used to configure it. An empty `pushConfig` signifies that the subscriber * will pull and ack messages using API methods. @@ -366,14 +366,14 @@ public void close() throws IOException { * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final Subscription createSubscription( - String formattedName, String formattedTopic, PushConfig pushConfig, int ackDeadlineSeconds) { - SUBSCRIPTION_PATH_TEMPLATE.validate(formattedName); - TOPIC_PATH_TEMPLATE.validate(formattedTopic); + String name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) { + SUBSCRIPTION_PATH_TEMPLATE.validate(name); + TOPIC_PATH_TEMPLATE.validate(topic); Subscription request = Subscription.newBuilder() - .setName(formattedName) - .setTopic(formattedTopic) + .setName(name) + .setTopic(topic) .setPushConfig(pushConfig) .setAckDeadlineSeconds(ackDeadlineSeconds) .build(); @@ -463,13 +463,13 @@ public final ApiCallable createSubscriptionCallable( * * * - * @param formattedSubscription The name of the subscription to get. + * @param subscription The name of the subscription to get. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final Subscription getSubscription(String formattedSubscription) { - SUBSCRIPTION_PATH_TEMPLATE.validate(formattedSubscription); + public final Subscription getSubscription(String subscription) { + SUBSCRIPTION_PATH_TEMPLATE.validate(subscription); GetSubscriptionRequest request = - GetSubscriptionRequest.newBuilder().setSubscription(formattedSubscription).build(); + GetSubscriptionRequest.newBuilder().setSubscription(subscription).build(); return getSubscription(request); } @@ -550,13 +550,13 @@ public final ApiCallable getSubscriptionCa * * * - * @param formattedProject The name of the cloud project that subscriptions belong to. + * @param project The name of the cloud project that subscriptions belong to. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final PageAccessor listSubscriptions(String formattedProject) { - PROJECT_PATH_TEMPLATE.validate(formattedProject); + public final PageAccessor listSubscriptions(String project) { + PROJECT_PATH_TEMPLATE.validate(project); ListSubscriptionsRequest request = - ListSubscriptionsRequest.newBuilder().setProject(formattedProject).build(); + ListSubscriptionsRequest.newBuilder().setProject(project).build(); return listSubscriptions(request); } @@ -678,13 +678,13 @@ public final PageAccessor listSubscriptions(ListSubscriptionsReque * * * - * @param formattedSubscription The subscription to delete. + * @param subscription The subscription to delete. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final void deleteSubscription(String formattedSubscription) { - SUBSCRIPTION_PATH_TEMPLATE.validate(formattedSubscription); + public final void deleteSubscription(String subscription) { + SUBSCRIPTION_PATH_TEMPLATE.validate(subscription); DeleteSubscriptionRequest request = - DeleteSubscriptionRequest.newBuilder().setSubscription(formattedSubscription).build(); + DeleteSubscriptionRequest.newBuilder().setSubscription(subscription).build(); deleteSubscription(request); } @@ -767,7 +767,7 @@ public final ApiCallable deleteSubscriptionCal * * * - * @param formattedSubscription The name of the subscription. + * @param subscription The name of the subscription. * @param ackIds List of acknowledgment IDs. * @param ackDeadlineSeconds The new ack deadline with respect to the time this request was sent to * the Pub/Sub system. Must be >= 0. For example, if the value is 10, the new @@ -777,12 +777,12 @@ public final ApiCallable deleteSubscriptionCal * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final void modifyAckDeadline( - String formattedSubscription, List ackIds, int ackDeadlineSeconds) { - SUBSCRIPTION_PATH_TEMPLATE.validate(formattedSubscription); + String subscription, List ackIds, int ackDeadlineSeconds) { + SUBSCRIPTION_PATH_TEMPLATE.validate(subscription); ModifyAckDeadlineRequest request = ModifyAckDeadlineRequest.newBuilder() - .setSubscription(formattedSubscription) + .setSubscription(subscription) .addAllAckIds(ackIds) .setAckDeadlineSeconds(ackDeadlineSeconds) .build(); @@ -876,19 +876,16 @@ public final ApiCallable modifyAckDeadlineCalla * * * - * @param formattedSubscription The subscription whose message is being acknowledged. + * @param subscription The subscription whose message is being acknowledged. * @param ackIds The acknowledgment ID for the messages being acknowledged that was returned * by the Pub/Sub system in the `Pull` response. Must not be empty. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final void acknowledge(String formattedSubscription, List ackIds) { - SUBSCRIPTION_PATH_TEMPLATE.validate(formattedSubscription); + public final void acknowledge(String subscription, List ackIds) { + SUBSCRIPTION_PATH_TEMPLATE.validate(subscription); AcknowledgeRequest request = - AcknowledgeRequest.newBuilder() - .setSubscription(formattedSubscription) - .addAllAckIds(ackIds) - .build(); + AcknowledgeRequest.newBuilder().setSubscription(subscription).addAllAckIds(ackIds).build(); acknowledge(request); } @@ -979,7 +976,7 @@ public final ApiCallable acknowledgeCallable() { * * * - * @param formattedSubscription The subscription from which messages should be pulled. + * @param subscription The subscription from which messages should be pulled. * @param returnImmediately If this is specified as true the system will respond immediately even if * it is not able to return a message in the `Pull` response. Otherwise the * system is allowed to wait until at least one message is available rather @@ -988,13 +985,12 @@ public final ApiCallable acknowledgeCallable() { * system may return fewer than the number specified. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final PullResponse pull( - String formattedSubscription, boolean returnImmediately, int maxMessages) { - SUBSCRIPTION_PATH_TEMPLATE.validate(formattedSubscription); + public final PullResponse pull(String subscription, boolean returnImmediately, int maxMessages) { + SUBSCRIPTION_PATH_TEMPLATE.validate(subscription); PullRequest request = PullRequest.newBuilder() - .setSubscription(formattedSubscription) + .setSubscription(subscription) .setReturnImmediately(returnImmediately) .setMaxMessages(maxMessages) .build(); @@ -1083,7 +1079,7 @@ public final ApiCallable pullCallable() { * * * - * @param formattedSubscription The name of the subscription. + * @param subscription The name of the subscription. * @param pushConfig The push configuration for future deliveries. * * An empty `pushConfig` indicates that the Pub/Sub system should @@ -1092,12 +1088,12 @@ public final ApiCallable pullCallable() { * the subscription if `Pull` is not called. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ - public final void modifyPushConfig(String formattedSubscription, PushConfig pushConfig) { - SUBSCRIPTION_PATH_TEMPLATE.validate(formattedSubscription); + public final void modifyPushConfig(String subscription, PushConfig pushConfig) { + SUBSCRIPTION_PATH_TEMPLATE.validate(subscription); ModifyPushConfigRequest request = ModifyPushConfigRequest.newBuilder() - .setSubscription(formattedSubscription) + .setSubscription(subscription) .setPushConfig(pushConfig) .build(); modifyPushConfig(request);