Skip to content

Commit da345eb

Browse files
committed
Removed formatted prefix from parameters
1 parent e619db5 commit da345eb

File tree

4 files changed

+118
-126
lines changed

4 files changed

+118
-126
lines changed

gcloud-java-pubsub/baseline/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherApi.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -288,17 +288,17 @@ public void close() throws IOException {
288288
* <!-- manual edit -->
289289
* <!-- end manual edit -->
290290
*
291-
* @param formattedName The name of the topic. It must have the format
291+
* @param name The name of the topic. It must have the format
292292
* `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
293293
* and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
294294
* underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
295295
* signs (`%`). It must be between 3 and 255 characters in length, and it
296296
* must not start with `"goog"`.
297297
* @throws com.google.api.gax.grpc.ApiException if the remote call fails
298298
*/
299-
public final Topic createTopic(String formattedName) {
300-
TOPIC_PATH_TEMPLATE.validate(formattedName);
301-
Topic request = Topic.newBuilder().setName(formattedName).build();
299+
public final Topic createTopic(String name) {
300+
TOPIC_PATH_TEMPLATE.validate(name);
301+
Topic request = Topic.newBuilder().setName(name).build();
302302
return createTopic(request);
303303
}
304304

@@ -371,15 +371,15 @@ public final ApiCallable<Topic, Topic> createTopicCallable() {
371371
* <!-- manual edit -->
372372
* <!-- end manual edit -->
373373
*
374-
* @param formattedTopic The messages in the request will be published on this topic.
374+
* @param topic The messages in the request will be published on this topic.
375375
* @param messages The messages to publish.
376376
* @throws com.google.api.gax.grpc.ApiException if the remote call fails
377377
*/
378-
public final PublishResponse publish(String formattedTopic, List<PubsubMessage> messages) {
379-
TOPIC_PATH_TEMPLATE.validate(formattedTopic);
378+
public final PublishResponse publish(String topic, List<PubsubMessage> messages) {
379+
TOPIC_PATH_TEMPLATE.validate(topic);
380380

381381
PublishRequest request =
382-
PublishRequest.newBuilder().setTopic(formattedTopic).addAllMessages(messages).build();
382+
PublishRequest.newBuilder().setTopic(topic).addAllMessages(messages).build();
383383
return publish(request);
384384
}
385385

@@ -457,12 +457,12 @@ public final ApiCallable<PublishRequest, PublishResponse> publishCallable() {
457457
* <!-- manual edit -->
458458
* <!-- end manual edit -->
459459
*
460-
* @param formattedTopic The name of the topic to get.
460+
* @param topic The name of the topic to get.
461461
* @throws com.google.api.gax.grpc.ApiException if the remote call fails
462462
*/
463-
public final Topic getTopic(String formattedTopic) {
464-
TOPIC_PATH_TEMPLATE.validate(formattedTopic);
465-
GetTopicRequest request = GetTopicRequest.newBuilder().setTopic(formattedTopic).build();
463+
public final Topic getTopic(String topic) {
464+
TOPIC_PATH_TEMPLATE.validate(topic);
465+
GetTopicRequest request = GetTopicRequest.newBuilder().setTopic(topic).build();
466466
return getTopic(request);
467467
}
468468

@@ -534,12 +534,12 @@ public final ApiCallable<GetTopicRequest, Topic> getTopicCallable() {
534534
* <!-- manual edit -->
535535
* <!-- end manual edit -->
536536
*
537-
* @param formattedProject The name of the cloud project that topics belong to.
537+
* @param project The name of the cloud project that topics belong to.
538538
* @throws com.google.api.gax.grpc.ApiException if the remote call fails
539539
*/
540-
public final PageAccessor<Topic> listTopics(String formattedProject) {
541-
PROJECT_PATH_TEMPLATE.validate(formattedProject);
542-
ListTopicsRequest request = ListTopicsRequest.newBuilder().setProject(formattedProject).build();
540+
public final PageAccessor<Topic> listTopics(String project) {
541+
PROJECT_PATH_TEMPLATE.validate(project);
542+
ListTopicsRequest request = ListTopicsRequest.newBuilder().setProject(project).build();
543543
return listTopics(request);
544544
}
545545

@@ -648,13 +648,13 @@ public final ApiCallable<ListTopicsRequest, ListTopicsResponse> listTopicsCallab
648648
* <!-- manual edit -->
649649
* <!-- end manual edit -->
650650
*
651-
* @param formattedTopic The name of the topic that subscriptions are attached to.
651+
* @param topic The name of the topic that subscriptions are attached to.
652652
* @throws com.google.api.gax.grpc.ApiException if the remote call fails
653653
*/
654-
public final PageAccessor<String> listTopicSubscriptions(String formattedTopic) {
655-
TOPIC_PATH_TEMPLATE.validate(formattedTopic);
654+
public final PageAccessor<String> listTopicSubscriptions(String topic) {
655+
TOPIC_PATH_TEMPLATE.validate(topic);
656656
ListTopicSubscriptionsRequest request =
657-
ListTopicSubscriptionsRequest.newBuilder().setTopic(formattedTopic).build();
657+
ListTopicSubscriptionsRequest.newBuilder().setTopic(topic).build();
658658
return listTopicSubscriptions(request);
659659
}
660660

@@ -767,12 +767,12 @@ public final PageAccessor<String> listTopicSubscriptions(ListTopicSubscriptionsR
767767
* <!-- manual edit -->
768768
* <!-- end manual edit -->
769769
*
770-
* @param formattedTopic Name of the topic to delete.
770+
* @param topic Name of the topic to delete.
771771
* @throws com.google.api.gax.grpc.ApiException if the remote call fails
772772
*/
773-
public final void deleteTopic(String formattedTopic) {
774-
TOPIC_PATH_TEMPLATE.validate(formattedTopic);
775-
DeleteTopicRequest request = DeleteTopicRequest.newBuilder().setTopic(formattedTopic).build();
773+
public final void deleteTopic(String topic) {
774+
TOPIC_PATH_TEMPLATE.validate(topic);
775+
DeleteTopicRequest request = DeleteTopicRequest.newBuilder().setTopic(topic).build();
776776
deleteTopic(request);
777777
}
778778

gcloud-java-pubsub/baseline/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberApi.java

Lines changed: 35 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,13 @@ public void close() throws IOException {
335335
* <!-- manual edit -->
336336
* <!-- end manual edit -->
337337
*
338-
* @param formattedName The name of the subscription. It must have the format
338+
* @param name The name of the subscription. It must have the format
339339
* `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
340340
* start with a letter, and contain only letters (`[A-Za-z]`), numbers
341341
* (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
342342
* plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
343343
* in length, and it must not start with `"goog"`.
344-
* @param formattedTopic The name of the topic from which this subscription is receiving messages.
344+
* @param topic The name of the topic from which this subscription is receiving messages.
345345
* @param pushConfig If push delivery is used with this subscription, this field is
346346
* used to configure it. An empty `pushConfig` signifies that the subscriber
347347
* will pull and ack messages using API methods.
@@ -366,14 +366,14 @@ public void close() throws IOException {
366366
* @throws com.google.api.gax.grpc.ApiException if the remote call fails
367367
*/
368368
public final Subscription createSubscription(
369-
String formattedName, String formattedTopic, PushConfig pushConfig, int ackDeadlineSeconds) {
370-
SUBSCRIPTION_PATH_TEMPLATE.validate(formattedName);
371-
TOPIC_PATH_TEMPLATE.validate(formattedTopic);
369+
String name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) {
370+
SUBSCRIPTION_PATH_TEMPLATE.validate(name);
371+
TOPIC_PATH_TEMPLATE.validate(topic);
372372

373373
Subscription request =
374374
Subscription.newBuilder()
375-
.setName(formattedName)
376-
.setTopic(formattedTopic)
375+
.setName(name)
376+
.setTopic(topic)
377377
.setPushConfig(pushConfig)
378378
.setAckDeadlineSeconds(ackDeadlineSeconds)
379379
.build();
@@ -463,13 +463,13 @@ public final ApiCallable<Subscription, Subscription> createSubscriptionCallable(
463463
* <!-- manual edit -->
464464
* <!-- end manual edit -->
465465
*
466-
* @param formattedSubscription The name of the subscription to get.
466+
* @param subscription The name of the subscription to get.
467467
* @throws com.google.api.gax.grpc.ApiException if the remote call fails
468468
*/
469-
public final Subscription getSubscription(String formattedSubscription) {
470-
SUBSCRIPTION_PATH_TEMPLATE.validate(formattedSubscription);
469+
public final Subscription getSubscription(String subscription) {
470+
SUBSCRIPTION_PATH_TEMPLATE.validate(subscription);
471471
GetSubscriptionRequest request =
472-
GetSubscriptionRequest.newBuilder().setSubscription(formattedSubscription).build();
472+
GetSubscriptionRequest.newBuilder().setSubscription(subscription).build();
473473
return getSubscription(request);
474474
}
475475

@@ -550,13 +550,13 @@ public final ApiCallable<GetSubscriptionRequest, Subscription> getSubscriptionCa
550550
* <!-- manual edit -->
551551
* <!-- end manual edit -->
552552
*
553-
* @param formattedProject The name of the cloud project that subscriptions belong to.
553+
* @param project The name of the cloud project that subscriptions belong to.
554554
* @throws com.google.api.gax.grpc.ApiException if the remote call fails
555555
*/
556-
public final PageAccessor<Subscription> listSubscriptions(String formattedProject) {
557-
PROJECT_PATH_TEMPLATE.validate(formattedProject);
556+
public final PageAccessor<Subscription> listSubscriptions(String project) {
557+
PROJECT_PATH_TEMPLATE.validate(project);
558558
ListSubscriptionsRequest request =
559-
ListSubscriptionsRequest.newBuilder().setProject(formattedProject).build();
559+
ListSubscriptionsRequest.newBuilder().setProject(project).build();
560560
return listSubscriptions(request);
561561
}
562562

@@ -678,13 +678,13 @@ public final PageAccessor<Subscription> listSubscriptions(ListSubscriptionsReque
678678
* <!-- manual edit -->
679679
* <!-- end manual edit -->
680680
*
681-
* @param formattedSubscription The subscription to delete.
681+
* @param subscription The subscription to delete.
682682
* @throws com.google.api.gax.grpc.ApiException if the remote call fails
683683
*/
684-
public final void deleteSubscription(String formattedSubscription) {
685-
SUBSCRIPTION_PATH_TEMPLATE.validate(formattedSubscription);
684+
public final void deleteSubscription(String subscription) {
685+
SUBSCRIPTION_PATH_TEMPLATE.validate(subscription);
686686
DeleteSubscriptionRequest request =
687-
DeleteSubscriptionRequest.newBuilder().setSubscription(formattedSubscription).build();
687+
DeleteSubscriptionRequest.newBuilder().setSubscription(subscription).build();
688688
deleteSubscription(request);
689689
}
690690

@@ -767,7 +767,7 @@ public final ApiCallable<DeleteSubscriptionRequest, Empty> deleteSubscriptionCal
767767
* <!-- manual edit -->
768768
* <!-- end manual edit -->
769769
*
770-
* @param formattedSubscription The name of the subscription.
770+
* @param subscription The name of the subscription.
771771
* @param ackIds List of acknowledgment IDs.
772772
* @param ackDeadlineSeconds The new ack deadline with respect to the time this request was sent to
773773
* the Pub/Sub system. Must be &gt;= 0. For example, if the value is 10, the new
@@ -777,12 +777,12 @@ public final ApiCallable<DeleteSubscriptionRequest, Empty> deleteSubscriptionCal
777777
* @throws com.google.api.gax.grpc.ApiException if the remote call fails
778778
*/
779779
public final void modifyAckDeadline(
780-
String formattedSubscription, List<String> ackIds, int ackDeadlineSeconds) {
781-
SUBSCRIPTION_PATH_TEMPLATE.validate(formattedSubscription);
780+
String subscription, List<String> ackIds, int ackDeadlineSeconds) {
781+
SUBSCRIPTION_PATH_TEMPLATE.validate(subscription);
782782

783783
ModifyAckDeadlineRequest request =
784784
ModifyAckDeadlineRequest.newBuilder()
785-
.setSubscription(formattedSubscription)
785+
.setSubscription(subscription)
786786
.addAllAckIds(ackIds)
787787
.setAckDeadlineSeconds(ackDeadlineSeconds)
788788
.build();
@@ -876,19 +876,16 @@ public final ApiCallable<ModifyAckDeadlineRequest, Empty> modifyAckDeadlineCalla
876876
* <!-- manual edit -->
877877
* <!-- end manual edit -->
878878
*
879-
* @param formattedSubscription The subscription whose message is being acknowledged.
879+
* @param subscription The subscription whose message is being acknowledged.
880880
* @param ackIds The acknowledgment ID for the messages being acknowledged that was returned
881881
* by the Pub/Sub system in the `Pull` response. Must not be empty.
882882
* @throws com.google.api.gax.grpc.ApiException if the remote call fails
883883
*/
884-
public final void acknowledge(String formattedSubscription, List<String> ackIds) {
885-
SUBSCRIPTION_PATH_TEMPLATE.validate(formattedSubscription);
884+
public final void acknowledge(String subscription, List<String> ackIds) {
885+
SUBSCRIPTION_PATH_TEMPLATE.validate(subscription);
886886

887887
AcknowledgeRequest request =
888-
AcknowledgeRequest.newBuilder()
889-
.setSubscription(formattedSubscription)
890-
.addAllAckIds(ackIds)
891-
.build();
888+
AcknowledgeRequest.newBuilder().setSubscription(subscription).addAllAckIds(ackIds).build();
892889
acknowledge(request);
893890
}
894891

@@ -979,7 +976,7 @@ public final ApiCallable<AcknowledgeRequest, Empty> acknowledgeCallable() {
979976
* <!-- manual edit -->
980977
* <!-- end manual edit -->
981978
*
982-
* @param formattedSubscription The subscription from which messages should be pulled.
979+
* @param subscription The subscription from which messages should be pulled.
983980
* @param returnImmediately If this is specified as true the system will respond immediately even if
984981
* it is not able to return a message in the `Pull` response. Otherwise the
985982
* system is allowed to wait until at least one message is available rather
@@ -988,13 +985,12 @@ public final ApiCallable<AcknowledgeRequest, Empty> acknowledgeCallable() {
988985
* system may return fewer than the number specified.
989986
* @throws com.google.api.gax.grpc.ApiException if the remote call fails
990987
*/
991-
public final PullResponse pull(
992-
String formattedSubscription, boolean returnImmediately, int maxMessages) {
993-
SUBSCRIPTION_PATH_TEMPLATE.validate(formattedSubscription);
988+
public final PullResponse pull(String subscription, boolean returnImmediately, int maxMessages) {
989+
SUBSCRIPTION_PATH_TEMPLATE.validate(subscription);
994990

995991
PullRequest request =
996992
PullRequest.newBuilder()
997-
.setSubscription(formattedSubscription)
993+
.setSubscription(subscription)
998994
.setReturnImmediately(returnImmediately)
999995
.setMaxMessages(maxMessages)
1000996
.build();
@@ -1083,7 +1079,7 @@ public final ApiCallable<PullRequest, PullResponse> pullCallable() {
10831079
* <!-- manual edit -->
10841080
* <!-- end manual edit -->
10851081
*
1086-
* @param formattedSubscription The name of the subscription.
1082+
* @param subscription The name of the subscription.
10871083
* @param pushConfig The push configuration for future deliveries.
10881084
*
10891085
* An empty `pushConfig` indicates that the Pub/Sub system should
@@ -1092,12 +1088,12 @@ public final ApiCallable<PullRequest, PullResponse> pullCallable() {
10921088
* the subscription if `Pull` is not called.
10931089
* @throws com.google.api.gax.grpc.ApiException if the remote call fails
10941090
*/
1095-
public final void modifyPushConfig(String formattedSubscription, PushConfig pushConfig) {
1096-
SUBSCRIPTION_PATH_TEMPLATE.validate(formattedSubscription);
1091+
public final void modifyPushConfig(String subscription, PushConfig pushConfig) {
1092+
SUBSCRIPTION_PATH_TEMPLATE.validate(subscription);
10971093

10981094
ModifyPushConfigRequest request =
10991095
ModifyPushConfigRequest.newBuilder()
1100-
.setSubscription(formattedSubscription)
1096+
.setSubscription(subscription)
11011097
.setPushConfig(pushConfig)
11021098
.build();
11031099
modifyPushConfig(request);

0 commit comments

Comments
 (0)