xref: /aosp_15_r20/external/googleapis/google/pubsub/v1beta2/pubsub.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1*d5c09012SAndroid Build Coastguard Worker// Copyright (c) 2015, Google Inc.
2*d5c09012SAndroid Build Coastguard Worker//
3*d5c09012SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License");
4*d5c09012SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License.
5*d5c09012SAndroid Build Coastguard Worker// You may obtain a copy of the License at
6*d5c09012SAndroid Build Coastguard Worker//
7*d5c09012SAndroid Build Coastguard Worker//     http://www.apache.org/licenses/LICENSE-2.0
8*d5c09012SAndroid Build Coastguard Worker//
9*d5c09012SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software
10*d5c09012SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS,
11*d5c09012SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*d5c09012SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and
13*d5c09012SAndroid Build Coastguard Worker// limitations under the License.
14*d5c09012SAndroid Build Coastguard Worker
15*d5c09012SAndroid Build Coastguard Workersyntax = "proto3";
16*d5c09012SAndroid Build Coastguard Worker
17*d5c09012SAndroid Build Coastguard Workerpackage google.pubsub.v1beta2;
18*d5c09012SAndroid Build Coastguard Worker
19*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/empty.proto";
20*d5c09012SAndroid Build Coastguard Worker
21*d5c09012SAndroid Build Coastguard Workeroption go_package = "google.golang.org/genproto/googleapis/pubsub/v1beta2;pubsub";
22*d5c09012SAndroid Build Coastguard Workeroption java_multiple_files = true;
23*d5c09012SAndroid Build Coastguard Workeroption java_outer_classname = "PubsubProto";
24*d5c09012SAndroid Build Coastguard Workeroption java_package = "com.google.pubsub.v1beta2";
25*d5c09012SAndroid Build Coastguard Worker
26*d5c09012SAndroid Build Coastguard Worker// The service that an application uses to manipulate subscriptions and to
27*d5c09012SAndroid Build Coastguard Worker// consume messages from a subscription via the Pull method.
28*d5c09012SAndroid Build Coastguard Workerservice Subscriber {
29*d5c09012SAndroid Build Coastguard Worker  // Creates a subscription to a given topic for a given subscriber.
30*d5c09012SAndroid Build Coastguard Worker  // If the subscription already exists, returns ALREADY_EXISTS.
31*d5c09012SAndroid Build Coastguard Worker  // If the corresponding topic doesn't exist, returns NOT_FOUND.
32*d5c09012SAndroid Build Coastguard Worker  //
33*d5c09012SAndroid Build Coastguard Worker  // If the name is not provided in the request, the server will assign a random
34*d5c09012SAndroid Build Coastguard Worker  // name for this subscription on the same project as the topic.
35*d5c09012SAndroid Build Coastguard Worker  rpc CreateSubscription(Subscription) returns (Subscription);
36*d5c09012SAndroid Build Coastguard Worker
37*d5c09012SAndroid Build Coastguard Worker  // Gets the configuration details of a subscription.
38*d5c09012SAndroid Build Coastguard Worker  rpc GetSubscription(GetSubscriptionRequest) returns (Subscription);
39*d5c09012SAndroid Build Coastguard Worker
40*d5c09012SAndroid Build Coastguard Worker  // Lists matching subscriptions.
41*d5c09012SAndroid Build Coastguard Worker  rpc ListSubscriptions(ListSubscriptionsRequest)
42*d5c09012SAndroid Build Coastguard Worker      returns (ListSubscriptionsResponse);
43*d5c09012SAndroid Build Coastguard Worker
44*d5c09012SAndroid Build Coastguard Worker  // Deletes an existing subscription. All pending messages in the subscription
45*d5c09012SAndroid Build Coastguard Worker  // are immediately dropped. Calls to Pull after deletion will return
46*d5c09012SAndroid Build Coastguard Worker  // NOT_FOUND. After a subscription is deleted, a new one may be created with
47*d5c09012SAndroid Build Coastguard Worker  // the same name, but the new one has no association with the old
48*d5c09012SAndroid Build Coastguard Worker  // subscription, or its topic unless the same topic is specified.
49*d5c09012SAndroid Build Coastguard Worker  rpc DeleteSubscription(DeleteSubscriptionRequest)
50*d5c09012SAndroid Build Coastguard Worker      returns (google.protobuf.Empty);
51*d5c09012SAndroid Build Coastguard Worker
52*d5c09012SAndroid Build Coastguard Worker  // Modifies the ack deadline for a specific message. This method is useful to
53*d5c09012SAndroid Build Coastguard Worker  // indicate that more time is needed to process a message by the subscriber,
54*d5c09012SAndroid Build Coastguard Worker  // or to make the message available for redelivery if the processing was
55*d5c09012SAndroid Build Coastguard Worker  // interrupted.
56*d5c09012SAndroid Build Coastguard Worker  rpc ModifyAckDeadline(ModifyAckDeadlineRequest)
57*d5c09012SAndroid Build Coastguard Worker      returns (google.protobuf.Empty);
58*d5c09012SAndroid Build Coastguard Worker
59*d5c09012SAndroid Build Coastguard Worker  // Acknowledges the messages associated with the ack tokens in the
60*d5c09012SAndroid Build Coastguard Worker  // AcknowledgeRequest. The Pub/Sub system can remove the relevant messages
61*d5c09012SAndroid Build Coastguard Worker  // from the subscription.
62*d5c09012SAndroid Build Coastguard Worker  //
63*d5c09012SAndroid Build Coastguard Worker  // Acknowledging a message whose ack deadline has expired may succeed,
64*d5c09012SAndroid Build Coastguard Worker  // but such a message may be redelivered later. Acknowledging a message more
65*d5c09012SAndroid Build Coastguard Worker  // than once will not result in an error.
66*d5c09012SAndroid Build Coastguard Worker  rpc Acknowledge(AcknowledgeRequest) returns (google.protobuf.Empty);
67*d5c09012SAndroid Build Coastguard Worker
68*d5c09012SAndroid Build Coastguard Worker  // Pulls messages from the server. Returns an empty list if there are no
69*d5c09012SAndroid Build Coastguard Worker  // messages available in the backlog. The server may return UNAVAILABLE if
70*d5c09012SAndroid Build Coastguard Worker  // there are too many concurrent pull requests pending for the given
71*d5c09012SAndroid Build Coastguard Worker  // subscription.
72*d5c09012SAndroid Build Coastguard Worker  rpc Pull(PullRequest) returns (PullResponse);
73*d5c09012SAndroid Build Coastguard Worker
74*d5c09012SAndroid Build Coastguard Worker  // Modifies the PushConfig for a specified subscription.
75*d5c09012SAndroid Build Coastguard Worker  //
76*d5c09012SAndroid Build Coastguard Worker  // This may be used to change a push subscription to a pull one (signified
77*d5c09012SAndroid Build Coastguard Worker  // by an empty PushConfig) or vice versa, or change the endpoint URL and other
78*d5c09012SAndroid Build Coastguard Worker  // attributes of a push subscription. Messages will accumulate for
79*d5c09012SAndroid Build Coastguard Worker  // delivery continuously through the call regardless of changes to the
80*d5c09012SAndroid Build Coastguard Worker  // PushConfig.
81*d5c09012SAndroid Build Coastguard Worker  rpc ModifyPushConfig(ModifyPushConfigRequest) returns (google.protobuf.Empty);
82*d5c09012SAndroid Build Coastguard Worker}
83*d5c09012SAndroid Build Coastguard Worker
84*d5c09012SAndroid Build Coastguard Worker// The service that an application uses to manipulate topics, and to send
85*d5c09012SAndroid Build Coastguard Worker// messages to a topic.
86*d5c09012SAndroid Build Coastguard Workerservice Publisher {
87*d5c09012SAndroid Build Coastguard Worker  // Creates the given topic with the given name.
88*d5c09012SAndroid Build Coastguard Worker  rpc CreateTopic(Topic) returns (Topic);
89*d5c09012SAndroid Build Coastguard Worker
90*d5c09012SAndroid Build Coastguard Worker  // Adds one or more messages to the topic. Returns NOT_FOUND if the topic does
91*d5c09012SAndroid Build Coastguard Worker  // not exist.
92*d5c09012SAndroid Build Coastguard Worker  rpc Publish(PublishRequest) returns (PublishResponse);
93*d5c09012SAndroid Build Coastguard Worker
94*d5c09012SAndroid Build Coastguard Worker  // Gets the configuration of a topic.
95*d5c09012SAndroid Build Coastguard Worker  rpc GetTopic(GetTopicRequest) returns (Topic);
96*d5c09012SAndroid Build Coastguard Worker
97*d5c09012SAndroid Build Coastguard Worker  // Lists matching topics.
98*d5c09012SAndroid Build Coastguard Worker  rpc ListTopics(ListTopicsRequest) returns (ListTopicsResponse);
99*d5c09012SAndroid Build Coastguard Worker
100*d5c09012SAndroid Build Coastguard Worker  // Lists the name of the subscriptions for this topic.
101*d5c09012SAndroid Build Coastguard Worker  rpc ListTopicSubscriptions(ListTopicSubscriptionsRequest)
102*d5c09012SAndroid Build Coastguard Worker      returns (ListTopicSubscriptionsResponse);
103*d5c09012SAndroid Build Coastguard Worker
104*d5c09012SAndroid Build Coastguard Worker  // Deletes the topic with the given name. Returns NOT_FOUND if the topic does
105*d5c09012SAndroid Build Coastguard Worker  // not exist. After a topic is deleted, a new topic may be created with the
106*d5c09012SAndroid Build Coastguard Worker  // same name; this is an entirely new topic with none of the old
107*d5c09012SAndroid Build Coastguard Worker  // configuration or subscriptions. Existing subscriptions to this topic are
108*d5c09012SAndroid Build Coastguard Worker  // not deleted.
109*d5c09012SAndroid Build Coastguard Worker  rpc DeleteTopic(DeleteTopicRequest) returns (google.protobuf.Empty);
110*d5c09012SAndroid Build Coastguard Worker}
111*d5c09012SAndroid Build Coastguard Worker
112*d5c09012SAndroid Build Coastguard Worker// A topic resource.
113*d5c09012SAndroid Build Coastguard Workermessage Topic {
114*d5c09012SAndroid Build Coastguard Worker  // Name of the topic.
115*d5c09012SAndroid Build Coastguard Worker  string name = 1;
116*d5c09012SAndroid Build Coastguard Worker}
117*d5c09012SAndroid Build Coastguard Worker
118*d5c09012SAndroid Build Coastguard Worker// A message data and its attributes.
119*d5c09012SAndroid Build Coastguard Workermessage PubsubMessage {
120*d5c09012SAndroid Build Coastguard Worker  // The message payload. For JSON requests, the value of this field must be
121*d5c09012SAndroid Build Coastguard Worker  // base64-encoded.
122*d5c09012SAndroid Build Coastguard Worker  bytes data = 1;
123*d5c09012SAndroid Build Coastguard Worker
124*d5c09012SAndroid Build Coastguard Worker  // Optional attributes for this message.
125*d5c09012SAndroid Build Coastguard Worker  map<string, string> attributes = 2;
126*d5c09012SAndroid Build Coastguard Worker
127*d5c09012SAndroid Build Coastguard Worker  // ID of this message assigned by the server at publication time. Guaranteed
128*d5c09012SAndroid Build Coastguard Worker  // to be unique within the topic. This value may be read by a subscriber
129*d5c09012SAndroid Build Coastguard Worker  // that receives a PubsubMessage via a Pull call or a push delivery. It must
130*d5c09012SAndroid Build Coastguard Worker  // not be populated by a publisher in a Publish call.
131*d5c09012SAndroid Build Coastguard Worker  string message_id = 3;
132*d5c09012SAndroid Build Coastguard Worker}
133*d5c09012SAndroid Build Coastguard Worker
134*d5c09012SAndroid Build Coastguard Worker// Request for the GetTopic method.
135*d5c09012SAndroid Build Coastguard Workermessage GetTopicRequest {
136*d5c09012SAndroid Build Coastguard Worker  // The name of the topic to get.
137*d5c09012SAndroid Build Coastguard Worker  string topic = 1;
138*d5c09012SAndroid Build Coastguard Worker}
139*d5c09012SAndroid Build Coastguard Worker
140*d5c09012SAndroid Build Coastguard Worker// Request for the Publish method.
141*d5c09012SAndroid Build Coastguard Workermessage PublishRequest {
142*d5c09012SAndroid Build Coastguard Worker  // The messages in the request will be published on this topic.
143*d5c09012SAndroid Build Coastguard Worker  string topic = 1;
144*d5c09012SAndroid Build Coastguard Worker
145*d5c09012SAndroid Build Coastguard Worker  // The messages to publish.
146*d5c09012SAndroid Build Coastguard Worker  repeated PubsubMessage messages = 2;
147*d5c09012SAndroid Build Coastguard Worker}
148*d5c09012SAndroid Build Coastguard Worker
149*d5c09012SAndroid Build Coastguard Worker// Response for the Publish method.
150*d5c09012SAndroid Build Coastguard Workermessage PublishResponse {
151*d5c09012SAndroid Build Coastguard Worker  // The server-assigned ID of each published message, in the same order as
152*d5c09012SAndroid Build Coastguard Worker  // the messages in the request. IDs are guaranteed to be unique within
153*d5c09012SAndroid Build Coastguard Worker  // the topic.
154*d5c09012SAndroid Build Coastguard Worker  repeated string message_ids = 1;
155*d5c09012SAndroid Build Coastguard Worker}
156*d5c09012SAndroid Build Coastguard Worker
157*d5c09012SAndroid Build Coastguard Worker// Request for the ListTopics method.
158*d5c09012SAndroid Build Coastguard Workermessage ListTopicsRequest {
159*d5c09012SAndroid Build Coastguard Worker  // The name of the cloud project that topics belong to.
160*d5c09012SAndroid Build Coastguard Worker  string project = 1;
161*d5c09012SAndroid Build Coastguard Worker
162*d5c09012SAndroid Build Coastguard Worker  // Maximum number of topics to return.
163*d5c09012SAndroid Build Coastguard Worker  int32 page_size = 2;
164*d5c09012SAndroid Build Coastguard Worker
165*d5c09012SAndroid Build Coastguard Worker  // The value returned by the last ListTopicsResponse; indicates that this is
166*d5c09012SAndroid Build Coastguard Worker  // a continuation of a prior ListTopics call, and that the system should
167*d5c09012SAndroid Build Coastguard Worker  // return the next page of data.
168*d5c09012SAndroid Build Coastguard Worker  string page_token = 3;
169*d5c09012SAndroid Build Coastguard Worker}
170*d5c09012SAndroid Build Coastguard Worker
171*d5c09012SAndroid Build Coastguard Worker// Response for the ListTopics method.
172*d5c09012SAndroid Build Coastguard Workermessage ListTopicsResponse {
173*d5c09012SAndroid Build Coastguard Worker  // The resulting topics.
174*d5c09012SAndroid Build Coastguard Worker  repeated Topic topics = 1;
175*d5c09012SAndroid Build Coastguard Worker
176*d5c09012SAndroid Build Coastguard Worker  // If not empty, indicates that there may be more topics that match the
177*d5c09012SAndroid Build Coastguard Worker  // request; this value should be passed in a new ListTopicsRequest.
178*d5c09012SAndroid Build Coastguard Worker  string next_page_token = 2;
179*d5c09012SAndroid Build Coastguard Worker}
180*d5c09012SAndroid Build Coastguard Worker
181*d5c09012SAndroid Build Coastguard Worker// Request for the ListTopicSubscriptions method.
182*d5c09012SAndroid Build Coastguard Workermessage ListTopicSubscriptionsRequest {
183*d5c09012SAndroid Build Coastguard Worker  // The name of the topic that subscriptions are attached to.
184*d5c09012SAndroid Build Coastguard Worker  string topic = 1;
185*d5c09012SAndroid Build Coastguard Worker
186*d5c09012SAndroid Build Coastguard Worker  // Maximum number of subscription names to return.
187*d5c09012SAndroid Build Coastguard Worker  int32 page_size = 2;
188*d5c09012SAndroid Build Coastguard Worker
189*d5c09012SAndroid Build Coastguard Worker  // The value returned by the last ListTopicSubscriptionsResponse; indicates
190*d5c09012SAndroid Build Coastguard Worker  // that this is a continuation of a prior ListTopicSubscriptions call, and
191*d5c09012SAndroid Build Coastguard Worker  // that the system should return the next page of data.
192*d5c09012SAndroid Build Coastguard Worker  string page_token = 3;
193*d5c09012SAndroid Build Coastguard Worker}
194*d5c09012SAndroid Build Coastguard Worker
195*d5c09012SAndroid Build Coastguard Worker// Response for the ListTopicSubscriptions method.
196*d5c09012SAndroid Build Coastguard Workermessage ListTopicSubscriptionsResponse {
197*d5c09012SAndroid Build Coastguard Worker  // The names of the subscriptions that match the request.
198*d5c09012SAndroid Build Coastguard Worker  repeated string subscriptions = 1;
199*d5c09012SAndroid Build Coastguard Worker
200*d5c09012SAndroid Build Coastguard Worker  // If not empty, indicates that there may be more subscriptions that match
201*d5c09012SAndroid Build Coastguard Worker  // the request; this value should be passed in a new
202*d5c09012SAndroid Build Coastguard Worker  // ListTopicSubscriptionsRequest to get more subscriptions.
203*d5c09012SAndroid Build Coastguard Worker  string next_page_token = 2;
204*d5c09012SAndroid Build Coastguard Worker}
205*d5c09012SAndroid Build Coastguard Worker
206*d5c09012SAndroid Build Coastguard Worker// Request for the DeleteTopic method.
207*d5c09012SAndroid Build Coastguard Workermessage DeleteTopicRequest {
208*d5c09012SAndroid Build Coastguard Worker  // Name of the topic to delete.
209*d5c09012SAndroid Build Coastguard Worker  string topic = 1;
210*d5c09012SAndroid Build Coastguard Worker}
211*d5c09012SAndroid Build Coastguard Worker
212*d5c09012SAndroid Build Coastguard Worker// A subscription resource.
213*d5c09012SAndroid Build Coastguard Workermessage Subscription {
214*d5c09012SAndroid Build Coastguard Worker  // Name of the subscription.
215*d5c09012SAndroid Build Coastguard Worker  string name = 1;
216*d5c09012SAndroid Build Coastguard Worker
217*d5c09012SAndroid Build Coastguard Worker  // The name of the topic from which this subscription is receiving messages.
218*d5c09012SAndroid Build Coastguard Worker  // This will be present if and only if the subscription has not been detached
219*d5c09012SAndroid Build Coastguard Worker  // from its topic.
220*d5c09012SAndroid Build Coastguard Worker  string topic = 2;
221*d5c09012SAndroid Build Coastguard Worker
222*d5c09012SAndroid Build Coastguard Worker  // If push delivery is used with this subscription, this field is
223*d5c09012SAndroid Build Coastguard Worker  // used to configure it. An empty pushConfig signifies that the subscriber
224*d5c09012SAndroid Build Coastguard Worker  // will pull and ack messages using API methods.
225*d5c09012SAndroid Build Coastguard Worker  PushConfig push_config = 4;
226*d5c09012SAndroid Build Coastguard Worker
227*d5c09012SAndroid Build Coastguard Worker  // This value is the maximum time after a subscriber receives a message
228*d5c09012SAndroid Build Coastguard Worker  // before the subscriber should acknowledge the message. After message
229*d5c09012SAndroid Build Coastguard Worker  // delivery but before the ack deadline expires and before the message is
230*d5c09012SAndroid Build Coastguard Worker  // acknowledged, it is an outstanding message and will not be delivered
231*d5c09012SAndroid Build Coastguard Worker  // again during that time (on a best-effort basis).
232*d5c09012SAndroid Build Coastguard Worker  //
233*d5c09012SAndroid Build Coastguard Worker  // For pull delivery this value
234*d5c09012SAndroid Build Coastguard Worker  // is used as the initial value for the ack deadline. It may be overridden
235*d5c09012SAndroid Build Coastguard Worker  // for a specific message by calling ModifyAckDeadline.
236*d5c09012SAndroid Build Coastguard Worker  //
237*d5c09012SAndroid Build Coastguard Worker  // For push delivery, this value is also used to set the request timeout for
238*d5c09012SAndroid Build Coastguard Worker  // the call to the push endpoint.
239*d5c09012SAndroid Build Coastguard Worker  //
240*d5c09012SAndroid Build Coastguard Worker  // If the subscriber never acknowledges the message, the Pub/Sub
241*d5c09012SAndroid Build Coastguard Worker  // system will eventually redeliver the message.
242*d5c09012SAndroid Build Coastguard Worker  int32 ack_deadline_seconds = 5;
243*d5c09012SAndroid Build Coastguard Worker}
244*d5c09012SAndroid Build Coastguard Worker
245*d5c09012SAndroid Build Coastguard Worker// Configuration for a push delivery endpoint.
246*d5c09012SAndroid Build Coastguard Workermessage PushConfig {
247*d5c09012SAndroid Build Coastguard Worker  // A URL locating the endpoint to which messages should be pushed.
248*d5c09012SAndroid Build Coastguard Worker  // For example, a Webhook endpoint might use "https://example.com/push".
249*d5c09012SAndroid Build Coastguard Worker  string push_endpoint = 1;
250*d5c09012SAndroid Build Coastguard Worker
251*d5c09012SAndroid Build Coastguard Worker  // Endpoint configuration attributes.
252*d5c09012SAndroid Build Coastguard Worker  //
253*d5c09012SAndroid Build Coastguard Worker  // Every endpoint has a set of API supported attributes that can be used to
254*d5c09012SAndroid Build Coastguard Worker  // control different aspects of the message delivery.
255*d5c09012SAndroid Build Coastguard Worker  //
256*d5c09012SAndroid Build Coastguard Worker  // The currently supported attribute is `x-goog-version`, which you can
257*d5c09012SAndroid Build Coastguard Worker  // use to change the format of the push message. This attribute
258*d5c09012SAndroid Build Coastguard Worker  // indicates the version of the data expected by the endpoint. This
259*d5c09012SAndroid Build Coastguard Worker  // controls the shape of the envelope (i.e. its fields and metadata).
260*d5c09012SAndroid Build Coastguard Worker  // The endpoint version is based on the version of the Pub/Sub
261*d5c09012SAndroid Build Coastguard Worker  // API.
262*d5c09012SAndroid Build Coastguard Worker  //
263*d5c09012SAndroid Build Coastguard Worker  // If not present during the CreateSubscription call, it will default to
264*d5c09012SAndroid Build Coastguard Worker  // the version of the API used to make such call. If not present during a
265*d5c09012SAndroid Build Coastguard Worker  // ModifyPushConfig call, its value will not be changed. GetSubscription
266*d5c09012SAndroid Build Coastguard Worker  // calls will always return a valid version, even if the subscription was
267*d5c09012SAndroid Build Coastguard Worker  // created without this attribute.
268*d5c09012SAndroid Build Coastguard Worker  //
269*d5c09012SAndroid Build Coastguard Worker  // The possible values for this attribute are:
270*d5c09012SAndroid Build Coastguard Worker  //
271*d5c09012SAndroid Build Coastguard Worker  // * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
272*d5c09012SAndroid Build Coastguard Worker  // * `v1beta2`: uses the push format defined in the v1beta2 Pub/Sub API.
273*d5c09012SAndroid Build Coastguard Worker  //
274*d5c09012SAndroid Build Coastguard Worker  map<string, string> attributes = 2;
275*d5c09012SAndroid Build Coastguard Worker}
276*d5c09012SAndroid Build Coastguard Worker
277*d5c09012SAndroid Build Coastguard Worker// A message and its corresponding acknowledgment ID.
278*d5c09012SAndroid Build Coastguard Workermessage ReceivedMessage {
279*d5c09012SAndroid Build Coastguard Worker  // This ID can be used to acknowledge the received message.
280*d5c09012SAndroid Build Coastguard Worker  string ack_id = 1;
281*d5c09012SAndroid Build Coastguard Worker
282*d5c09012SAndroid Build Coastguard Worker  // The message.
283*d5c09012SAndroid Build Coastguard Worker  PubsubMessage message = 2;
284*d5c09012SAndroid Build Coastguard Worker}
285*d5c09012SAndroid Build Coastguard Worker
286*d5c09012SAndroid Build Coastguard Worker// Request for the GetSubscription method.
287*d5c09012SAndroid Build Coastguard Workermessage GetSubscriptionRequest {
288*d5c09012SAndroid Build Coastguard Worker  // The name of the subscription to get.
289*d5c09012SAndroid Build Coastguard Worker  string subscription = 1;
290*d5c09012SAndroid Build Coastguard Worker}
291*d5c09012SAndroid Build Coastguard Worker
292*d5c09012SAndroid Build Coastguard Worker// Request for the ListSubscriptions method.
293*d5c09012SAndroid Build Coastguard Workermessage ListSubscriptionsRequest {
294*d5c09012SAndroid Build Coastguard Worker  // The name of the cloud project that subscriptions belong to.
295*d5c09012SAndroid Build Coastguard Worker  string project = 1;
296*d5c09012SAndroid Build Coastguard Worker
297*d5c09012SAndroid Build Coastguard Worker  // Maximum number of subscriptions to return.
298*d5c09012SAndroid Build Coastguard Worker  int32 page_size = 2;
299*d5c09012SAndroid Build Coastguard Worker
300*d5c09012SAndroid Build Coastguard Worker  // The value returned by the last ListSubscriptionsResponse; indicates that
301*d5c09012SAndroid Build Coastguard Worker  // this is a continuation of a prior ListSubscriptions call, and that the
302*d5c09012SAndroid Build Coastguard Worker  // system should return the next page of data.
303*d5c09012SAndroid Build Coastguard Worker  string page_token = 3;
304*d5c09012SAndroid Build Coastguard Worker}
305*d5c09012SAndroid Build Coastguard Worker
306*d5c09012SAndroid Build Coastguard Worker// Response for the ListSubscriptions method.
307*d5c09012SAndroid Build Coastguard Workermessage ListSubscriptionsResponse {
308*d5c09012SAndroid Build Coastguard Worker  // The subscriptions that match the request.
309*d5c09012SAndroid Build Coastguard Worker  repeated Subscription subscriptions = 1;
310*d5c09012SAndroid Build Coastguard Worker
311*d5c09012SAndroid Build Coastguard Worker  // If not empty, indicates that there may be more subscriptions that match
312*d5c09012SAndroid Build Coastguard Worker  // the request; this value should be passed in a new ListSubscriptionsRequest
313*d5c09012SAndroid Build Coastguard Worker  // to get more subscriptions.
314*d5c09012SAndroid Build Coastguard Worker  string next_page_token = 2;
315*d5c09012SAndroid Build Coastguard Worker}
316*d5c09012SAndroid Build Coastguard Worker
317*d5c09012SAndroid Build Coastguard Worker// Request for the DeleteSubscription method.
318*d5c09012SAndroid Build Coastguard Workermessage DeleteSubscriptionRequest {
319*d5c09012SAndroid Build Coastguard Worker  // The subscription to delete.
320*d5c09012SAndroid Build Coastguard Worker  string subscription = 1;
321*d5c09012SAndroid Build Coastguard Worker}
322*d5c09012SAndroid Build Coastguard Worker
323*d5c09012SAndroid Build Coastguard Worker// Request for the ModifyPushConfig method.
324*d5c09012SAndroid Build Coastguard Workermessage ModifyPushConfigRequest {
325*d5c09012SAndroid Build Coastguard Worker  // The name of the subscription.
326*d5c09012SAndroid Build Coastguard Worker  string subscription = 1;
327*d5c09012SAndroid Build Coastguard Worker
328*d5c09012SAndroid Build Coastguard Worker  // The push configuration for future deliveries.
329*d5c09012SAndroid Build Coastguard Worker  //
330*d5c09012SAndroid Build Coastguard Worker  // An empty pushConfig indicates that the Pub/Sub system should
331*d5c09012SAndroid Build Coastguard Worker  // stop pushing messages from the given subscription and allow
332*d5c09012SAndroid Build Coastguard Worker  // messages to be pulled and acknowledged - effectively pausing
333*d5c09012SAndroid Build Coastguard Worker  // the subscription if Pull is not called.
334*d5c09012SAndroid Build Coastguard Worker  PushConfig push_config = 2;
335*d5c09012SAndroid Build Coastguard Worker}
336*d5c09012SAndroid Build Coastguard Worker
337*d5c09012SAndroid Build Coastguard Worker// Request for the Pull method.
338*d5c09012SAndroid Build Coastguard Workermessage PullRequest {
339*d5c09012SAndroid Build Coastguard Worker  // The subscription from which messages should be pulled.
340*d5c09012SAndroid Build Coastguard Worker  string subscription = 1;
341*d5c09012SAndroid Build Coastguard Worker
342*d5c09012SAndroid Build Coastguard Worker  // If this is specified as true the system will respond immediately even if
343*d5c09012SAndroid Build Coastguard Worker  // it is not able to return a message in the Pull response. Otherwise the
344*d5c09012SAndroid Build Coastguard Worker  // system is allowed to wait until at least one message is available rather
345*d5c09012SAndroid Build Coastguard Worker  // than returning no messages. The client may cancel the request if it does
346*d5c09012SAndroid Build Coastguard Worker  // not wish to wait any longer for the response.
347*d5c09012SAndroid Build Coastguard Worker  bool return_immediately = 2;
348*d5c09012SAndroid Build Coastguard Worker
349*d5c09012SAndroid Build Coastguard Worker  // The maximum number of messages returned for this request. The Pub/Sub
350*d5c09012SAndroid Build Coastguard Worker  // system may return fewer than the number specified.
351*d5c09012SAndroid Build Coastguard Worker  int32 max_messages = 3;
352*d5c09012SAndroid Build Coastguard Worker}
353*d5c09012SAndroid Build Coastguard Worker
354*d5c09012SAndroid Build Coastguard Worker// Response for the Pull method.
355*d5c09012SAndroid Build Coastguard Workermessage PullResponse {
356*d5c09012SAndroid Build Coastguard Worker  // Received Pub/Sub messages. The Pub/Sub system will return zero messages if
357*d5c09012SAndroid Build Coastguard Worker  // there are no more available in the backlog. The Pub/Sub system may return
358*d5c09012SAndroid Build Coastguard Worker  // fewer than the maxMessages requested even if there are more messages
359*d5c09012SAndroid Build Coastguard Worker  // available in the backlog.
360*d5c09012SAndroid Build Coastguard Worker  repeated ReceivedMessage received_messages = 1;
361*d5c09012SAndroid Build Coastguard Worker}
362*d5c09012SAndroid Build Coastguard Worker
363*d5c09012SAndroid Build Coastguard Worker// Request for the ModifyAckDeadline method.
364*d5c09012SAndroid Build Coastguard Workermessage ModifyAckDeadlineRequest {
365*d5c09012SAndroid Build Coastguard Worker  // The name of the subscription.
366*d5c09012SAndroid Build Coastguard Worker  string subscription = 1;
367*d5c09012SAndroid Build Coastguard Worker
368*d5c09012SAndroid Build Coastguard Worker  // The acknowledgment ID.
369*d5c09012SAndroid Build Coastguard Worker  string ack_id = 2;
370*d5c09012SAndroid Build Coastguard Worker
371*d5c09012SAndroid Build Coastguard Worker  // The new ack deadline with respect to the time this request was sent to the
372*d5c09012SAndroid Build Coastguard Worker  // Pub/Sub system. Must be >= 0. For example, if the value is 10, the new ack
373*d5c09012SAndroid Build Coastguard Worker  // deadline will expire 10 seconds after the ModifyAckDeadline call was made.
374*d5c09012SAndroid Build Coastguard Worker  // Specifying zero may immediately make the message available for another pull
375*d5c09012SAndroid Build Coastguard Worker  // request.
376*d5c09012SAndroid Build Coastguard Worker  int32 ack_deadline_seconds = 3;
377*d5c09012SAndroid Build Coastguard Worker}
378*d5c09012SAndroid Build Coastguard Worker
379*d5c09012SAndroid Build Coastguard Worker// Request for the Acknowledge method.
380*d5c09012SAndroid Build Coastguard Workermessage AcknowledgeRequest {
381*d5c09012SAndroid Build Coastguard Worker  // The subscription whose message is being acknowledged.
382*d5c09012SAndroid Build Coastguard Worker  string subscription = 1;
383*d5c09012SAndroid Build Coastguard Worker
384*d5c09012SAndroid Build Coastguard Worker  // The acknowledgment ID for the messages being acknowledged that was returned
385*d5c09012SAndroid Build Coastguard Worker  // by the Pub/Sub system in the Pull response. Must not be empty.
386*d5c09012SAndroid Build Coastguard Worker  repeated string ack_ids = 2;
387*d5c09012SAndroid Build Coastguard Worker}
388