Debian Codegraph @

third_party/googleapis/google/pubsub/v1/pubsub.proto

raw
1 // Copyright 2017 Google Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 syntax = "proto3";
16
17 package google.pubsub.v1;
18
19 import "google/api/annotations.proto";
20 import "google/protobuf/duration.proto";
21 import "google/protobuf/empty.proto";
22 import "google/protobuf/field_mask.proto";
23 import "google/protobuf/timestamp.proto";
24
25 option cc_enable_arenas = true;
26 option csharp_namespace = "Google.Cloud.PubSub.V1";
27 option go_package = "google.golang.org/genproto/googleapis/pubsub/v1;pubsub";
28 option java_multiple_files = true;
29 option java_outer_classname = "PubsubProto";
30 option java_package = "com.google.pubsub.v1";
31
32
33 // The service that an application uses to manipulate subscriptions and to
34 // consume messages from a subscription via the `Pull` method.
35 service Subscriber {
36 // Creates a subscription to a given topic.
37 // If the subscription already exists, returns `ALREADY_EXISTS`.
38 // If the corresponding topic doesn't exist, returns `NOT_FOUND`.
39 //
40 // If the name is not provided in the request, the server will assign a random
41 // name for this subscription on the same project as the topic, conforming
42 // to the
43 // [resource name format](https://cloud.google.com/pubsub/docs/overview#names).
44 // The generated name is populated in the returned Subscription object.
45 // Note that for REST API requests, you must specify a name in the request.
46 rpc CreateSubscription(Subscription) returns (Subscription) {
47 option (google.api.http) = { put: "/v1/{name=projects/*/subscriptions/*}" body: "*" };
48 }
49
50 // Gets the configuration details of a subscription.
51 rpc GetSubscription(GetSubscriptionRequest) returns (Subscription) {
52 option (google.api.http) = { get: "/v1/{subscription=projects/*/subscriptions/*}" };
53 }
54
55 // Updates an existing subscription. Note that certain properties of a
56 // subscription, such as its topic, are not modifiable.
57 rpc UpdateSubscription(UpdateSubscriptionRequest) returns (Subscription) {
58 option (google.api.http) = { patch: "/v1/{subscription.name=projects/*/subscriptions/*}" body: "*" };
59 }
60
61 // Lists matching subscriptions.
62 rpc ListSubscriptions(ListSubscriptionsRequest) returns (ListSubscriptionsResponse) {
63 option (google.api.http) = { get: "/v1/{project=projects/*}/subscriptions" };
64 }
65
66 // Deletes an existing subscription. All messages retained in the subscription
67 // are immediately dropped. Calls to `Pull` after deletion will return
68 // `NOT_FOUND`. After a subscription is deleted, a new one may be created with
69 // the same name, but the new one has no association with the old
70 // subscription or its topic unless the same topic is specified.
71 rpc DeleteSubscription(DeleteSubscriptionRequest) returns (google.protobuf.Empty) {
72 option (google.api.http) = { delete: "/v1/{subscription=projects/*/subscriptions/*}" };
73 }
74
75 // Modifies the ack deadline for a specific message. This method is useful
76 // to indicate that more time is needed to process a message by the
77 // subscriber, or to make the message available for redelivery if the
78 // processing was interrupted. Note that this does not modify the
79 // subscription-level `ackDeadlineSeconds` used for subsequent messages.
80 rpc ModifyAckDeadline(ModifyAckDeadlineRequest) returns (google.protobuf.Empty) {
81 option (google.api.http) = { post: "/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline" body: "*" };
82 }
83
84 // Acknowledges the messages associated with the `ack_ids` in the
85 // `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages
86 // from the subscription.
87 //
88 // Acknowledging a message whose ack deadline has expired may succeed,
89 // but such a message may be redelivered later. Acknowledging a message more
90 // than once will not result in an error.
91 rpc Acknowledge(AcknowledgeRequest) returns (google.protobuf.Empty) {
92 option (google.api.http) = { post: "/v1/{subscription=projects/*/subscriptions/*}:acknowledge" body: "*" };
93 }
94
95 // Pulls messages from the server. Returns an empty list if there are no
96 // messages available in the backlog. The server may return `UNAVAILABLE` if
97 // there are too many concurrent pull requests pending for the given
98 // subscription.
99 rpc Pull(PullRequest) returns (PullResponse) {
100 option (google.api.http) = { post: "/v1/{subscription=projects/*/subscriptions/*}:pull" body: "*" };
101 }
102
103 // (EXPERIMENTAL) StreamingPull is an experimental feature. This RPC will
104 // respond with UNIMPLEMENTED errors unless you have been invited to test
105 // this feature. Contact [email protected] with any questions.
106 //
107 // Establishes a stream with the server, which sends messages down to the
108 // client. The client streams acknowledgements and ack deadline modifications
109 // back to the server. The server will close the stream and return the status
110 // on any error. The server may close the stream with status `OK` to reassign
111 // server-side resources, in which case, the client should re-establish the
112 // stream. `UNAVAILABLE` may also be returned in the case of a transient error
113 // (e.g., a server restart). These should also be retried by the client. Flow
114 // control can be achieved by configuring the underlying RPC channel.
115 rpc StreamingPull(stream StreamingPullRequest) returns (stream StreamingPullResponse);
116
117 // Modifies the `PushConfig` for a specified subscription.
118 //
119 // This may be used to change a push subscription to a pull one (signified by
120 // an empty `PushConfig`) or vice versa, or change the endpoint URL and other
121 // attributes of a push subscription. Messages will accumulate for delivery
122 // continuously through the call regardless of changes to the `PushConfig`.
123 rpc ModifyPushConfig(ModifyPushConfigRequest) returns (google.protobuf.Empty) {
124 option (google.api.http) = { post: "/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig" body: "*" };
125 }
126
127 // Lists the existing snapshots.
128 rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) {
129 option (google.api.http) = { get: "/v1/{project=projects/*}/snapshots" };
130 }
131
132 // Creates a snapshot from the requested subscription.
133 // If the snapshot already exists, returns `ALREADY_EXISTS`.
134 // If the requested subscription doesn't exist, returns `NOT_FOUND`.
135 //
136 // If the name is not provided in the request, the server will assign a random
137 // name for this snapshot on the same project as the subscription, conforming
138 // to the
139 // [resource name format](https://cloud.google.com/pubsub/docs/overview#names).
140 // The generated name is populated in the returned Snapshot object.
141 // Note that for REST API requests, you must specify a name in the request.
142 rpc CreateSnapshot(CreateSnapshotRequest) returns (Snapshot) {
143 option (google.api.http) = { put: "/v1/{name=projects/*/snapshots/*}" body: "*" };
144 }
145
146 // Removes an existing snapshot. All messages retained in the snapshot
147 // are immediately dropped. After a snapshot is deleted, a new one may be
148 // created with the same name, but the new one has no association with the old
149 // snapshot or its subscription, unless the same subscription is specified.
150 rpc DeleteSnapshot(DeleteSnapshotRequest) returns (google.protobuf.Empty) {
151 option (google.api.http) = { delete: "/v1/{snapshot=projects/*/snapshots/*}" };
152 }
153
154 // Seeks an existing subscription to a point in time or to a given snapshot,
155 // whichever is provided in the request.
156 rpc Seek(SeekRequest) returns (SeekResponse) {
157 option (google.api.http) = { post: "/v1/{subscription=projects/*/subscriptions/*}:seek" body: "*" };
158 }
159 }
160
161 // The service that an application uses to manipulate topics, and to send
162 // messages to a topic.
163 service Publisher {
164 // Creates the given topic with the given name.
165 rpc CreateTopic(Topic) returns (Topic) {
166 option (google.api.http) = { put: "/v1/{name=projects/*/topics/*}" body: "*" };
167 }
168
169 // Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
170 // does not exist. The message payload must not be empty; it must contain
171 // either a non-empty data field, or at least one attribute.
172 rpc Publish(PublishRequest) returns (PublishResponse) {
173 option (google.api.http) = { post: "/v1/{topic=projects/*/topics/*}:publish" body: "*" };
174 }
175
176 // Gets the configuration of a topic.
177 rpc GetTopic(GetTopicRequest) returns (Topic) {
178 option (google.api.http) = { get: "/v1/{topic=projects/*/topics/*}" };
179 }
180
181 // Lists matching topics.
182 rpc ListTopics(ListTopicsRequest) returns (ListTopicsResponse) {
183 option (google.api.http) = { get: "/v1/{project=projects/*}/topics" };
184 }
185
186 // Lists the name of the subscriptions for this topic.
187 rpc ListTopicSubscriptions(ListTopicSubscriptionsRequest) returns (ListTopicSubscriptionsResponse) {
188 option (google.api.http) = { get: "/v1/{topic=projects/*/topics/*}/subscriptions" };
189 }
190
191 // Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
192 // does not exist. After a topic is deleted, a new topic may be created with
193 // the same name; this is an entirely new topic with none of the old
194 // configuration or subscriptions. Existing subscriptions to this topic are
195 // not deleted, but their `topic` field is set to `_deleted-topic_`.
196 rpc DeleteTopic(DeleteTopicRequest) returns (google.protobuf.Empty) {
197 option (google.api.http) = { delete: "/v1/{topic=projects/*/topics/*}" };
198 }
199 }
200
201 // A topic resource.
202 message Topic {
203 // The name of the topic. It must have the format
204 // `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
205 // and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
206 // underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
207 // signs (`%`). It must be between 3 and 255 characters in length, and it
208 // must not start with `"goog"`.
209 string name = 1;
210 }
211
212 // A message data and its attributes. The message payload must not be empty;
213 // it must contain either a non-empty data field, or at least one attribute.
214 message PubsubMessage {
215 // The message payload.
216 bytes data = 1;
217
218 // Optional attributes for this message.
219 map<string, string> attributes = 2;
220
221 // ID of this message, assigned by the server when the message is published.
222 // Guaranteed to be unique within the topic. This value may be read by a
223 // subscriber that receives a `PubsubMessage` via a `Pull` call or a push
224 // delivery. It must not be populated by the publisher in a `Publish` call.
225 string message_id = 3;
226
227 // The time at which the message was published, populated by the server when
228 // it receives the `Publish` call. It must not be populated by the
229 // publisher in a `Publish` call.
230 google.protobuf.Timestamp publish_time = 4;
231 }
232
233 // Request for the GetTopic method.
234 message GetTopicRequest {
235 // The name of the topic to get.
236 // Format is `projects/{project}/topics/{topic}`.
237 string topic = 1;
238 }
239
240 // Request for the Publish method.
241 message PublishRequest {
242 // The messages in the request will be published on this topic.
243 // Format is `projects/{project}/topics/{topic}`.
244 string topic = 1;
245
246 // The messages to publish.
247 repeated PubsubMessage messages = 2;
248 }
249
250 // Response for the `Publish` method.
251 message PublishResponse {
252 // The server-assigned ID of each published message, in the same order as
253 // the messages in the request. IDs are guaranteed to be unique within
254 // the topic.
255 repeated string message_ids = 1;
256 }
257
258 // Request for the `ListTopics` method.
259 message ListTopicsRequest {
260 // The name of the cloud project that topics belong to.
261 // Format is `projects/{project}`.
262 string project = 1;
263
264 // Maximum number of topics to return.
265 int32 page_size = 2;
266
267 // The value returned by the last `ListTopicsResponse`; indicates that this is
268 // a continuation of a prior `ListTopics` call, and that the system should
269 // return the next page of data.
270 string page_token = 3;
271 }
272
273 // Response for the `ListTopics` method.
274 message ListTopicsResponse {
275 // The resulting topics.
276 repeated Topic topics = 1;
277
278 // If not empty, indicates that there may be more topics that match the
279 // request; this value should be passed in a new `ListTopicsRequest`.
280 string next_page_token = 2;
281 }
282
283 // Request for the `ListTopicSubscriptions` method.
284 message ListTopicSubscriptionsRequest {
285 // The name of the topic that subscriptions are attached to.
286 // Format is `projects/{project}/topics/{topic}`.
287 string topic = 1;
288
289 // Maximum number of subscription names to return.
290 int32 page_size = 2;
291
292 // The value returned by the last `ListTopicSubscriptionsResponse`; indicates
293 // that this is a continuation of a prior `ListTopicSubscriptions` call, and
294 // that the system should return the next page of data.
295 string page_token = 3;
296 }
297
298 // Response for the `ListTopicSubscriptions` method.
299 message ListTopicSubscriptionsResponse {
300 // The names of the subscriptions that match the request.
301 repeated string subscriptions = 1;
302
303 // If not empty, indicates that there may be more subscriptions that match
304 // the request; this value should be passed in a new
305 // `ListTopicSubscriptionsRequest` to get more subscriptions.
306 string next_page_token = 2;
307 }
308
309 // Request for the `DeleteTopic` method.
310 message DeleteTopicRequest {
311 // Name of the topic to delete.
312 // Format is `projects/{project}/topics/{topic}`.
313 string topic = 1;
314 }
315
316 // A subscription resource.
317 message Subscription {
318 // The name of the subscription. It must have the format
319 // `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
320 // start with a letter, and contain only letters (`[A-Za-z]`), numbers
321 // (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
322 // plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
323 // in length, and it must not start with `"goog"`.
324 string name = 1;
325
326 // The name of the topic from which this subscription is receiving messages.
327 // Format is `projects/{project}/topics/{topic}`.
328 // The value of this field will be `_deleted-topic_` if the topic has been
329 // deleted.
330 string topic = 2;
331
332 // If push delivery is used with this subscription, this field is
333 // used to configure it. An empty `pushConfig` signifies that the subscriber
334 // will pull and ack messages using API methods.
335 PushConfig push_config = 4;
336
337 // This value is the maximum time after a subscriber receives a message
338 // before the subscriber should acknowledge the message. After message
339 // delivery but before the ack deadline expires and before the message is
340 // acknowledged, it is an outstanding message and will not be delivered
341 // again during that time (on a best-effort basis).
342 //
343 // For pull subscriptions, this value is used as the initial value for the ack
344 // deadline. To override this value for a given message, call
345 // `ModifyAckDeadline` with the corresponding `ack_id` if using
346 // pull.
347 // The minimum custom deadline you can specify is 10 seconds.
348 // The maximum custom deadline you can specify is 600 seconds (10 minutes).
349 // If this parameter is 0, a default value of 10 seconds is used.
350 //
351 // For push delivery, this value is also used to set the request timeout for
352 // the call to the push endpoint.
353 //
354 // If the subscriber never acknowledges the message, the Pub/Sub
355 // system will eventually redeliver the message.
356 int32 ack_deadline_seconds = 5;
357
358 // Indicates whether to retain acknowledged messages. If true, then
359 // messages are not expunged from the subscription's backlog, even if they are
360 // acknowledged, until they fall out of the `message_retention_duration`
361 // window.
362 bool retain_acked_messages = 7;
363
364 // How long to retain unacknowledged messages in the subscription's backlog,
365 // from the moment a message is published.
366 // If `retain_acked_messages` is true, then this also configures the retention
367 // of acknowledged messages, and thus configures how far back in time a `Seek`
368 // can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
369 // minutes.
370 google.protobuf.Duration message_retention_duration = 8;
371 }
372
373 // Configuration for a push delivery endpoint.
374 message PushConfig {
375 // A URL locating the endpoint to which messages should be pushed.
376 // For example, a Webhook endpoint might use "https://example.com/push".
377 string push_endpoint = 1;
378
379 // Endpoint configuration attributes.
380 //
381 // Every endpoint has a set of API supported attributes that can be used to
382 // control different aspects of the message delivery.
383 //
384 // The currently supported attribute is `x-goog-version`, which you can
385 // use to change the format of the pushed message. This attribute
386 // indicates the version of the data expected by the endpoint. This
387 // controls the shape of the pushed message (i.e., its fields and metadata).
388 // The endpoint version is based on the version of the Pub/Sub API.
389 //
390 // If not present during the `CreateSubscription` call, it will default to
391 // the version of the API used to make such call. If not present during a
392 // `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
393 // calls will always return a valid version, even if the subscription was
394 // created without this attribute.
395 //
396 // The possible values for this attribute are:
397 //
398 // * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
399 // * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
400 map<string, string> attributes = 2;
401 }
402
403 // A message and its corresponding acknowledgment ID.
404 message ReceivedMessage {
405 // This ID can be used to acknowledge the received message.
406 string ack_id = 1;
407
408 // The message.
409 PubsubMessage message = 2;
410 }
411
412 // Request for the GetSubscription method.
413 message GetSubscriptionRequest {
414 // The name of the subscription to get.
415 // Format is `projects/{project}/subscriptions/{sub}`.
416 string subscription = 1;
417 }
418
419 // Request for the UpdateSubscription method.
420 message UpdateSubscriptionRequest {
421 // The updated subscription object.
422 Subscription subscription = 1;
423
424 // Indicates which fields in the provided subscription to update.
425 // Must be specified and non-empty.
426 google.protobuf.FieldMask update_mask = 2;
427 }
428
429 // Request for the `ListSubscriptions` method.
430 message ListSubscriptionsRequest {
431 // The name of the cloud project that subscriptions belong to.
432 // Format is `projects/{project}`.
433 string project = 1;
434
435 // Maximum number of subscriptions to return.
436 int32 page_size = 2;
437
438 // The value returned by the last `ListSubscriptionsResponse`; indicates that
439 // this is a continuation of a prior `ListSubscriptions` call, and that the
440 // system should return the next page of data.
441 string page_token = 3;
442 }
443
444 // Response for the `ListSubscriptions` method.
445 message ListSubscriptionsResponse {
446 // The subscriptions that match the request.
447 repeated Subscription subscriptions = 1;
448
449 // If not empty, indicates that there may be more subscriptions that match
450 // the request; this value should be passed in a new
451 // `ListSubscriptionsRequest` to get more subscriptions.
452 string next_page_token = 2;
453 }
454
455 // Request for the DeleteSubscription method.
456 message DeleteSubscriptionRequest {
457 // The subscription to delete.
458 // Format is `projects/{project}/subscriptions/{sub}`.
459 string subscription = 1;
460 }
461
462 // Request for the ModifyPushConfig method.
463 message ModifyPushConfigRequest {
464 // The name of the subscription.
465 // Format is `projects/{project}/subscriptions/{sub}`.
466 string subscription = 1;
467
468 // The push configuration for future deliveries.
469 //
470 // An empty `pushConfig` indicates that the Pub/Sub system should
471 // stop pushing messages from the given subscription and allow
472 // messages to be pulled and acknowledged - effectively pausing
473 // the subscription if `Pull` is not called.
474 PushConfig push_config = 2;
475 }
476
477 // Request for the `Pull` method.
478 message PullRequest {
479 // The subscription from which messages should be pulled.
480 // Format is `projects/{project}/subscriptions/{sub}`.
481 string subscription = 1;
482
483 // If this field set to true, the system will respond immediately even if
484 // it there are no messages available to return in the `Pull` response.
485 // Otherwise, the system may wait (for a bounded amount of time) until at
486 // least one message is available, rather than returning no messages. The
487 // client may cancel the request if it does not wish to wait any longer for
488 // the response.
489 bool return_immediately = 2;
490
491 // The maximum number of messages returned for this request. The Pub/Sub
492 // system may return fewer than the number specified.
493 int32 max_messages = 3;
494 }
495
496 // Response for the `Pull` method.
497 message PullResponse {
498 // Received Pub/Sub messages. The Pub/Sub system will return zero messages if
499 // there are no more available in the backlog. The Pub/Sub system may return
500 // fewer than the `maxMessages` requested even if there are more messages
501 // available in the backlog.
502 repeated ReceivedMessage received_messages = 1;
503 }
504
505 // Request for the ModifyAckDeadline method.
506 message ModifyAckDeadlineRequest {
507 // The name of the subscription.
508 // Format is `projects/{project}/subscriptions/{sub}`.
509 string subscription = 1;
510
511 // List of acknowledgment IDs.
512 repeated string ack_ids = 4;
513
514 // The new ack deadline with respect to the time this request was sent to
515 // the Pub/Sub system. For example, if the value is 10, the new
516 // ack deadline will expire 10 seconds after the `ModifyAckDeadline` call
517 // was made. Specifying zero may immediately make the message available for
518 // another pull request.
519 // The minimum deadline you can specify is 0 seconds.
520 // The maximum deadline you can specify is 600 seconds (10 minutes).
521 int32 ack_deadline_seconds = 3;
522 }
523
524 // Request for the Acknowledge method.
525 message AcknowledgeRequest {
526 // The subscription whose message is being acknowledged.
527 // Format is `projects/{project}/subscriptions/{sub}`.
528 string subscription = 1;
529
530 // The acknowledgment ID for the messages being acknowledged that was returned
531 // by the Pub/Sub system in the `Pull` response. Must not be empty.
532 repeated string ack_ids = 2;
533 }
534
535 // Request for the `StreamingPull` streaming RPC method. This request is used to
536 // establish the initial stream as well as to stream acknowledgements and ack
537 // deadline modifications from the client to the server.
538 message StreamingPullRequest {
539 // The subscription for which to initialize the new stream. This must be
540 // provided in the first request on the stream, and must not be set in
541 // subsequent requests from client to server.
542 // Format is `projects/{project}/subscriptions/{sub}`.
543 string subscription = 1;
544
545 // List of acknowledgement IDs for acknowledging previously received messages
546 // (received on this stream or a different stream). If an ack ID has expired,
547 // the corresponding message may be redelivered later. Acknowledging a message
548 // more than once will not result in an error. If the acknowledgement ID is
549 // malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
550 repeated string ack_ids = 2;
551
552 // The list of new ack deadlines for the IDs listed in
553 // `modify_deadline_ack_ids`. The size of this list must be the same as the
554 // size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
555 // with `INVALID_ARGUMENT`. Each element in this list is applied to the
556 // element in the same position in `modify_deadline_ack_ids`. The new ack
557 // deadline is with respect to the time this request was sent to the Pub/Sub
558 // system. Must be >= 0. For example, if the value is 10, the new ack deadline
559 // will expire 10 seconds after this request is received. If the value is 0,
560 // the message is immediately made available for another streaming or
561 // non-streaming pull request. If the value is < 0 (an error), the stream will
562 // be aborted with status `INVALID_ARGUMENT`.
563 repeated int32 modify_deadline_seconds = 3;
564
565 // List of acknowledgement IDs whose deadline will be modified based on the
566 // corresponding element in `modify_deadline_seconds`. This field can be used
567 // to indicate that more time is needed to process a message by the
568 // subscriber, or to make the message available for redelivery if the
569 // processing was interrupted.
570 repeated string modify_deadline_ack_ids = 4;
571
572 // The ack deadline to use for the stream. This must be provided in the
573 // first request on the stream, but it can also be updated on subsequent
574 // requests from client to server. The minimum deadline you can specify is 10
575 // seconds. The maximum deadline you can specify is 600 seconds (10 minutes).
576 int32 stream_ack_deadline_seconds = 5;
577 }
578
579 // Response for the `StreamingPull` method. This response is used to stream
580 // messages from the server to the client.
581 message StreamingPullResponse {
582 // Received Pub/Sub messages. This will not be empty.
583 repeated ReceivedMessage received_messages = 1;
584 }
585
586 // Request for the `CreateSnapshot` method.
587 message CreateSnapshotRequest {
588 // Optional user-provided name for this snapshot.
589 // If the name is not provided in the request, the server will assign a random
590 // name for this snapshot on the same project as the subscription.
591 // Note that for REST API requests, you must specify a name.
592 // Format is `projects/{project}/snapshots/{snap}`.
593 string name = 1;
594
595 // The subscription whose backlog the snapshot retains.
596 // Specifically, the created snapshot is guaranteed to retain:
597 // (a) The existing backlog on the subscription. More precisely, this is
598 // defined as the messages in the subscription's backlog that are
599 // unacknowledged upon the successful completion of the
600 // `CreateSnapshot` request; as well as:
601 // (b) Any messages published to the subscription's topic following the
602 // successful completion of the CreateSnapshot request.
603 // Format is `projects/{project}/subscriptions/{sub}`.
604 string subscription = 2;
605 }
606
607 // A snapshot resource.
608 message Snapshot {
609 // The name of the snapshot.
610 string name = 1;
611
612 // The name of the topic from which this snapshot is retaining messages.
613 string topic = 2;
614
615 // The snapshot is guaranteed to exist up until this time.
616 // A newly-created snapshot expires no later than 7 days from the time of its
617 // creation. Its exact lifetime is determined at creation by the existing
618 // backlog in the source subscription. Specifically, the lifetime of the
619 // snapshot is `7 days - (age of oldest unacked message in the subscription)`.
620 // For example, consider a subscription whose oldest unacked message is 3 days
621 // old. If a snapshot is created from this subscription, the snapshot -- which
622 // will always capture this 3-day-old backlog as long as the snapshot
623 // exists -- will expire in 4 days.
624 google.protobuf.Timestamp expire_time = 3;
625 }
626
627 // Request for the `ListSnapshots` method.
628 message ListSnapshotsRequest {
629 // The name of the cloud project that snapshots belong to.
630 // Format is `projects/{project}`.
631 string project = 1;
632
633 // Maximum number of snapshots to return.
634 int32 page_size = 2;
635
636 // The value returned by the last `ListSnapshotsResponse`; indicates that this
637 // is a continuation of a prior `ListSnapshots` call, and that the system
638 // should return the next page of data.
639 string page_token = 3;
640 }
641
642 // Response for the `ListSnapshots` method.
643 message ListSnapshotsResponse {
644 // The resulting snapshots.
645 repeated Snapshot snapshots = 1;
646
647 // If not empty, indicates that there may be more snapshot that match the
648 // request; this value should be passed in a new `ListSnapshotsRequest`.
649 string next_page_token = 2;
650 }
651
652 // Request for the `DeleteSnapshot` method.
653 message DeleteSnapshotRequest {
654 // The name of the snapshot to delete.
655 // Format is `projects/{project}/snapshots/{snap}`.
656 string snapshot = 1;
657 }
658
659 // Request for the `Seek` method.
660 message SeekRequest {
661 // The subscription to affect.
662 string subscription = 1;
663
664 oneof target {
665 // The time to seek to.
666 // Messages retained in the subscription that were published before this
667 // time are marked as acknowledged, and messages retained in the
668 // subscription that were published after this time are marked as
669 // unacknowledged. Note that this operation affects only those messages
670 // retained in the subscription (configured by the combination of
671 // `message_retention_duration` and `retain_acked_messages`). For example,
672 // if `time` corresponds to a point before the message retention
673 // window (or to a point before the system's notion of the subscription
674 // creation time), only retained messages will be marked as unacknowledged,
675 // and already-expunged messages will not be restored.
676 google.protobuf.Timestamp time = 2;
677
678 // The snapshot to seek to. The snapshot's topic must be the same as that of
679 // the provided subscription.
680 // Format is `projects/{project}/snapshots/{snap}`.
681 string snapshot = 3;
682 }
683 }
684
685 message SeekResponse {
686
687 }