@@ -88,7 +88,7 @@ service Publisher {
8888 option (google.api.method_signature ) = "project" ;
8989 }
9090
91- // Lists the names of the subscriptions on this topic.
91+ // Lists the names of the attached subscriptions on this topic.
9292 rpc ListTopicSubscriptions (ListTopicSubscriptionsRequest )
9393 returns (ListTopicSubscriptionsResponse ) {
9494 option (google.api.http ) = {
@@ -122,6 +122,17 @@ service Publisher {
122122 };
123123 option (google.api.method_signature ) = "topic" ;
124124 }
125+
126+ // Detaches a subscription from this topic. All messages retained in the
127+ // subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
128+ // will return FAILED_PRECONDITION. If the subscription is a push
129+ // subscription, pushes to the endpoint will stop.
130+ rpc DetachSubscription (DetachSubscriptionRequest )
131+ returns (DetachSubscriptionResponse ) {
132+ option (google.api.http ) = {
133+ post : "/v1/{subscription=projects/*/subscriptions/*}:detach"
134+ };
135+ }
125136}
126137
127138message MessageStoragePolicy {
@@ -300,7 +311,7 @@ message ListTopicSubscriptionsRequest {
300311
301312// Response for the `ListTopicSubscriptions` method.
302313message ListTopicSubscriptionsResponse {
303- // The names of the subscriptions that match the request.
314+ // The names of subscriptions attached to the topic specified in the request.
304315 repeated string subscriptions = 1 [(google.api.resource_reference ) = {
305316 type : "pubsub.googleapis.com/Subscription"
306317 }];
@@ -350,6 +361,20 @@ message DeleteTopicRequest {
350361 ];
351362}
352363
364+ // Request for the DetachSubscription method.
365+ message DetachSubscriptionRequest {
366+ // Required. The subscription to detach.
367+ // Format is `projects/{project}/subscriptions/{subscription}`.
368+ string subscription = 1 [
369+ (google.api.field_behavior ) = REQUIRED ,
370+ (google.api.resource_reference ) = { type : "pubsub.googleapis.com/Topic" }
371+ ];
372+ }
373+
374+ // Response for the DetachSubscription method.
375+ // Reserved for future use.
376+ message DetachSubscriptionResponse {}
377+
353378// The service that an application uses to manipulate subscriptions and to
354379// consume messages from a subscription via the `Pull` method or by
355380// establishing a bi-directional stream using the `StreamingPull` method.
0 commit comments