@google-cloud/pubsub 4.1.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -53,8 +53,8 @@ service Publisher {
53
53
  option (google.api.method_signature) = "name";
54
54
  }
55
55
 
56
- // Updates an existing topic. Note that certain properties of a
57
- // topic are not modifiable.
56
+ // Updates an existing topic by updating the fields specified in the update
57
+ // mask. Note that certain properties of a topic are not modifiable.
58
58
  rpc UpdateTopic(UpdateTopicRequest) returns (Topic) {
59
59
  option (google.api.http) = {
60
60
  patch: "/v1/{topic.name=projects/*/topics/*}"
@@ -137,13 +137,21 @@ service Publisher {
137
137
 
138
138
  // A policy constraining the storage of messages published to the topic.
139
139
  message MessageStoragePolicy {
140
- // A list of IDs of Google Cloud regions where messages that are published
141
- // to the topic may be persisted in storage. Messages published by publishers
142
- // running in non-allowed Google Cloud regions (or running outside of Google
143
- // Cloud altogether) are routed for storage in one of the allowed regions.
144
- // An empty list means that no regions are allowed, and is not a valid
145
- // configuration.
146
- repeated string allowed_persistence_regions = 1;
140
+ // Optional. A list of IDs of Google Cloud regions where messages that are
141
+ // published to the topic may be persisted in storage. Messages published by
142
+ // publishers running in non-allowed Google Cloud regions (or running outside
143
+ // of Google Cloud altogether) are routed for storage in one of the allowed
144
+ // regions. An empty list means that no regions are allowed, and is not a
145
+ // valid configuration.
146
+ repeated string allowed_persistence_regions = 1
147
+ [(google.api.field_behavior) = OPTIONAL];
148
+
149
+ // Optional. If true, `allowed_persistence_regions` is also used to enforce
150
+ // in-transit guarantees for messages. That is, Pub/Sub will fail
151
+ // Publish operations on this topic and subscribe operations
152
+ // on any subscription attached to this topic in any region that is
153
+ // not in `allowed_persistence_regions`.
154
+ bool enforce_in_transit = 2 [(google.api.field_behavior) = OPTIONAL];
147
155
  }
148
156
 
149
157
  // Settings for validating messages published against a schema.
@@ -157,18 +165,83 @@ message SchemaSettings {
157
165
  (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" }
158
166
  ];
159
167
 
160
- // The encoding of messages validated against `schema`.
161
- Encoding encoding = 2;
168
+ // Optional. The encoding of messages validated against `schema`.
169
+ Encoding encoding = 2 [(google.api.field_behavior) = OPTIONAL];
162
170
 
163
- // The minimum (inclusive) revision allowed for validating messages. If empty
164
- // or not present, allow any revision to be validated against last_revision or
165
- // any revision created before.
166
- string first_revision_id = 3;
171
+ // Optional. The minimum (inclusive) revision allowed for validating messages.
172
+ // If empty or not present, allow any revision to be validated against
173
+ // last_revision or any revision created before.
174
+ string first_revision_id = 3 [(google.api.field_behavior) = OPTIONAL];
167
175
 
168
- // The maximum (inclusive) revision allowed for validating messages. If empty
169
- // or not present, allow any revision to be validated against first_revision
170
- // or any revision created after.
171
- string last_revision_id = 4;
176
+ // Optional. The maximum (inclusive) revision allowed for validating messages.
177
+ // If empty or not present, allow any revision to be validated against
178
+ // first_revision or any revision created after.
179
+ string last_revision_id = 4 [(google.api.field_behavior) = OPTIONAL];
180
+ }
181
+
182
+ // Settings for an ingestion data source on a topic.
183
+ message IngestionDataSourceSettings {
184
+ // Ingestion settings for Amazon Kinesis Data Streams.
185
+ message AwsKinesis {
186
+ // Possible states for managed ingestion from Amazon Kinesis Data Streams.
187
+ enum State {
188
+ // Default value. This value is unused.
189
+ STATE_UNSPECIFIED = 0;
190
+
191
+ // Ingestion is active.
192
+ ACTIVE = 1;
193
+
194
+ // Permission denied encountered while consuming data from Kinesis.
195
+ // This can happen if:
196
+ // - The provided `aws_role_arn` does not exist or does not have the
197
+ // appropriate permissions attached.
198
+ // - The provided `aws_role_arn` is not set up properly for Identity
199
+ // Federation using `gcp_service_account`.
200
+ // - The Pub/Sub SA is not granted the
201
+ // `iam.serviceAccounts.getOpenIdToken` permission on
202
+ // `gcp_service_account`.
203
+ KINESIS_PERMISSION_DENIED = 2;
204
+
205
+ // Permission denied encountered while publishing to the topic. This can
206
+ // happen due to Pub/Sub SA has not been granted the [appropriate publish
207
+ // permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher)
208
+ PUBLISH_PERMISSION_DENIED = 3;
209
+
210
+ // The Kinesis stream does not exist.
211
+ STREAM_NOT_FOUND = 4;
212
+
213
+ // The Kinesis consumer does not exist.
214
+ CONSUMER_NOT_FOUND = 5;
215
+ }
216
+
217
+ // Output only. An output-only field that indicates the state of the Kinesis
218
+ // ingestion source.
219
+ State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
220
+
221
+ // Required. The Kinesis stream ARN to ingest data from.
222
+ string stream_arn = 2 [(google.api.field_behavior) = REQUIRED];
223
+
224
+ // Required. The Kinesis consumer ARN to used for ingestion in Enhanced
225
+ // Fan-Out mode. The consumer must be already created and ready to be used.
226
+ string consumer_arn = 3 [(google.api.field_behavior) = REQUIRED];
227
+
228
+ // Required. AWS role ARN to be used for Federated Identity authentication
229
+ // with Kinesis. Check the Pub/Sub docs for how to set up this role and the
230
+ // required permissions that need to be attached to it.
231
+ string aws_role_arn = 4 [(google.api.field_behavior) = REQUIRED];
232
+
233
+ // Required. The GCP service account to be used for Federated Identity
234
+ // authentication with Kinesis (via a `AssumeRoleWithWebIdentity` call for
235
+ // the provided role). The `aws_role_arn` must be set up with
236
+ // `accounts.google.com:sub` equals to this service account number.
237
+ string gcp_service_account = 5 [(google.api.field_behavior) = REQUIRED];
238
+ }
239
+
240
+ // Only one source type can have settings set.
241
+ oneof source {
242
+ // Optional. Amazon Kinesis Data Streams.
243
+ AwsKinesis aws_kinesis = 1 [(google.api.field_behavior) = OPTIONAL];
244
+ }
172
245
  }
173
246
 
174
247
  // A topic resource.
@@ -179,6 +252,20 @@ message Topic {
179
252
  pattern: "_deleted-topic_"
180
253
  };
181
254
 
255
+ // The state of the topic.
256
+ enum State {
257
+ // Default value. This value is unused.
258
+ STATE_UNSPECIFIED = 0;
259
+
260
+ // The topic does not have any persistent errors.
261
+ ACTIVE = 1;
262
+
263
+ // Ingestion from the data source has encountered a permanent error.
264
+ // See the more detailed error state in the corresponding ingestion
265
+ // source configuration.
266
+ INGESTION_RESOURCE_ERROR = 2;
267
+ }
268
+
182
269
  // Required. The name of the topic. It must have the format
183
270
  // `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
184
271
  // and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
@@ -187,37 +274,48 @@ message Topic {
187
274
  // must not start with `"goog"`.
188
275
  string name = 1 [(google.api.field_behavior) = REQUIRED];
189
276
 
190
- // See [Creating and managing labels]
277
+ // Optional. See [Creating and managing labels]
191
278
  // (https://cloud.google.com/pubsub/docs/labels).
192
- map<string, string> labels = 2;
279
+ map<string, string> labels = 2 [(google.api.field_behavior) = OPTIONAL];
193
280
 
194
- // Policy constraining the set of Google Cloud Platform regions where messages
195
- // published to the topic may be stored. If not present, then no constraints
196
- // are in effect.
197
- MessageStoragePolicy message_storage_policy = 3;
281
+ // Optional. Policy constraining the set of Google Cloud Platform regions
282
+ // where messages published to the topic may be stored. If not present, then
283
+ // no constraints are in effect.
284
+ MessageStoragePolicy message_storage_policy = 3
285
+ [(google.api.field_behavior) = OPTIONAL];
198
286
 
199
- // The resource name of the Cloud KMS CryptoKey to be used to protect access
200
- // to messages published on this topic.
287
+ // Optional. The resource name of the Cloud KMS CryptoKey to be used to
288
+ // protect access to messages published on this topic.
201
289
  //
202
290
  // The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
203
- string kms_key_name = 5;
291
+ string kms_key_name = 5 [(google.api.field_behavior) = OPTIONAL];
204
292
 
205
- // Settings for validating messages published against a schema.
206
- SchemaSettings schema_settings = 6;
293
+ // Optional. Settings for validating messages published against a schema.
294
+ SchemaSettings schema_settings = 6 [(google.api.field_behavior) = OPTIONAL];
207
295
 
208
- // Reserved for future use. This field is set only in responses from the
209
- // server; it is ignored if it is set in any requests.
210
- bool satisfies_pzs = 7;
296
+ // Optional. Reserved for future use. This field is set only in responses from
297
+ // the server; it is ignored if it is set in any requests.
298
+ bool satisfies_pzs = 7 [(google.api.field_behavior) = OPTIONAL];
211
299
 
212
- // Indicates the minimum duration to retain a message after it is published to
213
- // the topic. If this field is set, messages published to the topic in the
214
- // last `message_retention_duration` are always available to subscribers. For
215
- // instance, it allows any attached subscription to [seek to a
300
+ // Optional. Indicates the minimum duration to retain a message after it is
301
+ // published to the topic. If this field is set, messages published to the
302
+ // topic in the last `message_retention_duration` are always available to
303
+ // subscribers. For instance, it allows any attached subscription to [seek to
304
+ // a
216
305
  // timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
217
306
  // that is up to `message_retention_duration` in the past. If this field is
218
307
  // not set, message retention is controlled by settings on individual
219
308
  // subscriptions. Cannot be more than 31 days or less than 10 minutes.
220
- google.protobuf.Duration message_retention_duration = 8;
309
+ google.protobuf.Duration message_retention_duration = 8
310
+ [(google.api.field_behavior) = OPTIONAL];
311
+
312
+ // Output only. An output-only field indicating the state of the topic.
313
+ State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
314
+
315
+ // Optional. Settings for managed ingestion from a data source into this
316
+ // topic.
317
+ IngestionDataSourceSettings ingestion_data_source_settings = 10
318
+ [(google.api.field_behavior) = OPTIONAL];
221
319
  }
222
320
 
223
321
  // A message that is published by publishers and consumed by subscribers. The
@@ -229,14 +327,14 @@ message Topic {
229
327
  // (https://cloud.google.com/pubsub/quotas) for more information about message
230
328
  // limits.
231
329
  message PubsubMessage {
232
- // The message data field. If this field is empty, the message must contain
233
- // at least one attribute.
234
- bytes data = 1;
330
+ // Optional. The message data field. If this field is empty, the message must
331
+ // contain at least one attribute.
332
+ bytes data = 1 [(google.api.field_behavior) = OPTIONAL];
235
333
 
236
- // Attributes for this message. If this field is empty, the message must
237
- // contain non-empty data. This can be used to filter messages on the
334
+ // Optional. Attributes for this message. If this field is empty, the message
335
+ // must contain non-empty data. This can be used to filter messages on the
238
336
  // subscription.
239
- map<string, string> attributes = 2;
337
+ map<string, string> attributes = 2 [(google.api.field_behavior) = OPTIONAL];
240
338
 
241
339
  // ID of this message, assigned by the server when the message is published.
242
340
  // Guaranteed to be unique within the topic. This value may be read by a
@@ -249,15 +347,15 @@ message PubsubMessage {
249
347
  // publisher in a `Publish` call.
250
348
  google.protobuf.Timestamp publish_time = 4;
251
349
 
252
- // If non-empty, identifies related messages for which publish order should be
253
- // respected. If a `Subscription` has `enable_message_ordering` set to `true`,
254
- // messages published with the same non-empty `ordering_key` value will be
255
- // delivered to subscribers in the order in which they are received by the
256
- // Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest`
257
- // must specify the same `ordering_key` value.
258
- // For more information, see [ordering
350
+ // Optional. If non-empty, identifies related messages for which publish order
351
+ // should be respected. If a `Subscription` has `enable_message_ordering` set
352
+ // to `true`, messages published with the same non-empty `ordering_key` value
353
+ // will be delivered to subscribers in the order in which they are received by
354
+ // the Pub/Sub system. All `PubsubMessage`s published in a given
355
+ // `PublishRequest` must specify the same `ordering_key` value. For more
356
+ // information, see [ordering
259
357
  // messages](https://cloud.google.com/pubsub/docs/ordering).
260
- string ordering_key = 5;
358
+ string ordering_key = 5 [(google.api.field_behavior) = OPTIONAL];
261
359
  }
262
360
 
263
361
  // Request for the GetTopic method.
@@ -299,10 +397,10 @@ message PublishRequest {
299
397
 
300
398
  // Response for the `Publish` method.
301
399
  message PublishResponse {
302
- // The server-assigned ID of each published message, in the same order as
303
- // the messages in the request. IDs are guaranteed to be unique within
304
- // the topic.
305
- repeated string message_ids = 1;
400
+ // Optional. The server-assigned ID of each published message, in the same
401
+ // order as the messages in the request. IDs are guaranteed to be unique
402
+ // within the topic.
403
+ repeated string message_ids = 1 [(google.api.field_behavior) = OPTIONAL];
306
404
  }
307
405
 
308
406
  // Request for the `ListTopics` method.
@@ -316,23 +414,23 @@ message ListTopicsRequest {
316
414
  }
317
415
  ];
318
416
 
319
- // Maximum number of topics to return.
320
- int32 page_size = 2;
417
+ // Optional. Maximum number of topics to return.
418
+ int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
321
419
 
322
- // The value returned by the last `ListTopicsResponse`; indicates that this is
323
- // a continuation of a prior `ListTopics` call, and that the system should
324
- // return the next page of data.
325
- string page_token = 3;
420
+ // Optional. The value returned by the last `ListTopicsResponse`; indicates
421
+ // that this is a continuation of a prior `ListTopics` call, and that the
422
+ // system should return the next page of data.
423
+ string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
326
424
  }
327
425
 
328
426
  // Response for the `ListTopics` method.
329
427
  message ListTopicsResponse {
330
- // The resulting topics.
331
- repeated Topic topics = 1;
428
+ // Optional. The resulting topics.
429
+ repeated Topic topics = 1 [(google.api.field_behavior) = OPTIONAL];
332
430
 
333
- // If not empty, indicates that there may be more topics that match the
334
- // request; this value should be passed in a new `ListTopicsRequest`.
335
- string next_page_token = 2;
431
+ // Optional. If not empty, indicates that there may be more topics that match
432
+ // the request; this value should be passed in a new `ListTopicsRequest`.
433
+ string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL];
336
434
  }
337
435
 
338
436
  // Request for the `ListTopicSubscriptions` method.
@@ -344,26 +442,30 @@ message ListTopicSubscriptionsRequest {
344
442
  (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
345
443
  ];
346
444
 
347
- // Maximum number of subscription names to return.
348
- int32 page_size = 2;
445
+ // Optional. Maximum number of subscription names to return.
446
+ int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
349
447
 
350
- // The value returned by the last `ListTopicSubscriptionsResponse`; indicates
351
- // that this is a continuation of a prior `ListTopicSubscriptions` call, and
352
- // that the system should return the next page of data.
353
- string page_token = 3;
448
+ // Optional. The value returned by the last `ListTopicSubscriptionsResponse`;
449
+ // indicates that this is a continuation of a prior `ListTopicSubscriptions`
450
+ // call, and that the system should return the next page of data.
451
+ string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
354
452
  }
355
453
 
356
454
  // Response for the `ListTopicSubscriptions` method.
357
455
  message ListTopicSubscriptionsResponse {
358
- // The names of subscriptions attached to the topic specified in the request.
359
- repeated string subscriptions = 1 [(google.api.resource_reference) = {
360
- type: "pubsub.googleapis.com/Subscription"
361
- }];
456
+ // Optional. The names of subscriptions attached to the topic specified in the
457
+ // request.
458
+ repeated string subscriptions = 1 [
459
+ (google.api.field_behavior) = OPTIONAL,
460
+ (google.api.resource_reference) = {
461
+ type: "pubsub.googleapis.com/Subscription"
462
+ }
463
+ ];
362
464
 
363
- // If not empty, indicates that there may be more subscriptions that match
364
- // the request; this value should be passed in a new
465
+ // Optional. If not empty, indicates that there may be more subscriptions that
466
+ // match the request; this value should be passed in a new
365
467
  // `ListTopicSubscriptionsRequest` to get more subscriptions.
366
- string next_page_token = 2;
468
+ string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL];
367
469
  }
368
470
 
369
471
  // Request for the `ListTopicSnapshots` method.
@@ -375,24 +477,24 @@ message ListTopicSnapshotsRequest {
375
477
  (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
376
478
  ];
377
479
 
378
- // Maximum number of snapshot names to return.
379
- int32 page_size = 2;
480
+ // Optional. Maximum number of snapshot names to return.
481
+ int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
380
482
 
381
- // The value returned by the last `ListTopicSnapshotsResponse`; indicates
382
- // that this is a continuation of a prior `ListTopicSnapshots` call, and
383
- // that the system should return the next page of data.
384
- string page_token = 3;
483
+ // Optional. The value returned by the last `ListTopicSnapshotsResponse`;
484
+ // indicates that this is a continuation of a prior `ListTopicSnapshots` call,
485
+ // and that the system should return the next page of data.
486
+ string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
385
487
  }
386
488
 
387
489
  // Response for the `ListTopicSnapshots` method.
388
490
  message ListTopicSnapshotsResponse {
389
- // The names of the snapshots that match the request.
390
- repeated string snapshots = 1;
491
+ // Optional. The names of the snapshots that match the request.
492
+ repeated string snapshots = 1 [(google.api.field_behavior) = OPTIONAL];
391
493
 
392
- // If not empty, indicates that there may be more snapshots that match
393
- // the request; this value should be passed in a new
494
+ // Optional. If not empty, indicates that there may be more snapshots that
495
+ // match the request; this value should be passed in a new
394
496
  // `ListTopicSnapshotsRequest` to get more snapshots.
395
- string next_page_token = 2;
497
+ string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL];
396
498
  }
397
499
 
398
500
  // Request for the `DeleteTopic` method.
@@ -458,8 +560,9 @@ service Subscriber {
458
560
  option (google.api.method_signature) = "subscription";
459
561
  }
460
562
 
461
- // Updates an existing subscription. Note that certain properties of a
462
- // subscription, such as its topic, are not modifiable.
563
+ // Updates an existing subscription by updating the fields specified in the
564
+ // update mask. Note that certain properties of a subscription, such as its
565
+ // topic, are not modifiable.
463
566
  rpc UpdateSubscription(UpdateSubscriptionRequest) returns (Subscription) {
464
567
  option (google.api.http) = {
465
568
  patch: "/v1/{subscription.name=projects/*/subscriptions/*}"
@@ -604,7 +707,8 @@ service Subscriber {
604
707
  option (google.api.method_signature) = "name,subscription";
605
708
  }
606
709
 
607
- // Updates an existing snapshot. Snapshots are used in
710
+ // Updates an existing snapshot by updating the fields specified in the update
711
+ // mask. Snapshots are used in
608
712
  // [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
609
713
  // which allow you to manage message acknowledgments in bulk. That is, you can
610
714
  // set the acknowledgment state of messages in an existing subscription to the
@@ -687,23 +791,24 @@ message Subscription {
687
791
  (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
688
792
  ];
689
793
 
690
- // If push delivery is used with this subscription, this field is
691
- // used to configure it.
692
- PushConfig push_config = 4;
693
-
694
- // If delivery to BigQuery is used with this subscription, this field is
794
+ // Optional. If push delivery is used with this subscription, this field is
695
795
  // used to configure it.
696
- BigQueryConfig bigquery_config = 18;
796
+ PushConfig push_config = 4 [(google.api.field_behavior) = OPTIONAL];
697
797
 
698
- // If delivery to Google Cloud Storage is used with this subscription, this
798
+ // Optional. If delivery to BigQuery is used with this subscription, this
699
799
  // field is used to configure it.
700
- CloudStorageConfig cloud_storage_config = 22;
701
-
702
- // The approximate amount of time (on a best-effort basis) Pub/Sub waits for
703
- // the subscriber to acknowledge receipt before resending the message. In the
704
- // interval after the message is delivered and before it is acknowledged, it
705
- // is considered to be _outstanding_. During that time period, the
706
- // message will not be redelivered (on a best-effort basis).
800
+ BigQueryConfig bigquery_config = 18 [(google.api.field_behavior) = OPTIONAL];
801
+
802
+ // Optional. If delivery to Google Cloud Storage is used with this
803
+ // subscription, this field is used to configure it.
804
+ CloudStorageConfig cloud_storage_config = 22
805
+ [(google.api.field_behavior) = OPTIONAL];
806
+
807
+ // Optional. The approximate amount of time (on a best-effort basis) Pub/Sub
808
+ // waits for the subscriber to acknowledge receipt before resending the
809
+ // message. In the interval after the message is delivered and before it is
810
+ // acknowledged, it is considered to be _outstanding_. During that time
811
+ // period, the message will not be redelivered (on a best-effort basis).
707
812
  //
708
813
  // For pull subscriptions, this value is used as the initial value for the ack
709
814
  // deadline. To override this value for a given message, call
@@ -719,78 +824,81 @@ message Subscription {
719
824
  //
720
825
  // If the subscriber never acknowledges the message, the Pub/Sub
721
826
  // system will eventually redeliver the message.
722
- int32 ack_deadline_seconds = 5;
827
+ int32 ack_deadline_seconds = 5 [(google.api.field_behavior) = OPTIONAL];
723
828
 
724
- // Indicates whether to retain acknowledged messages. If true, then
829
+ // Optional. Indicates whether to retain acknowledged messages. If true, then
725
830
  // messages are not expunged from the subscription's backlog, even if they are
726
831
  // acknowledged, until they fall out of the `message_retention_duration`
727
832
  // window. This must be true if you would like to [`Seek` to a timestamp]
728
833
  // (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in
729
834
  // the past to replay previously-acknowledged messages.
730
- bool retain_acked_messages = 7;
835
+ bool retain_acked_messages = 7 [(google.api.field_behavior) = OPTIONAL];
731
836
 
732
- // How long to retain unacknowledged messages in the subscription's backlog,
733
- // from the moment a message is published.
734
- // If `retain_acked_messages` is true, then this also configures the retention
735
- // of acknowledged messages, and thus configures how far back in time a `Seek`
736
- // can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
737
- // minutes.
738
- google.protobuf.Duration message_retention_duration = 8;
837
+ // Optional. How long to retain unacknowledged messages in the subscription's
838
+ // backlog, from the moment a message is published. If `retain_acked_messages`
839
+ // is true, then this also configures the retention of acknowledged messages,
840
+ // and thus configures how far back in time a `Seek` can be done. Defaults to
841
+ // 7 days. Cannot be more than 7 days or less than 10 minutes.
842
+ google.protobuf.Duration message_retention_duration = 8
843
+ [(google.api.field_behavior) = OPTIONAL];
739
844
 
740
- // See [Creating and managing
845
+ // Optional. See [Creating and managing
741
846
  // labels](https://cloud.google.com/pubsub/docs/labels).
742
- map<string, string> labels = 9;
743
-
744
- // If true, messages published with the same `ordering_key` in `PubsubMessage`
745
- // will be delivered to the subscribers in the order in which they
746
- // are received by the Pub/Sub system. Otherwise, they may be delivered in
747
- // any order.
748
- bool enable_message_ordering = 10;
749
-
750
- // A policy that specifies the conditions for this subscription's expiration.
751
- // A subscription is considered active as long as any connected subscriber is
752
- // successfully consuming messages from the subscription or is issuing
753
- // operations on the subscription. If `expiration_policy` is not set, a
754
- // *default policy* with `ttl` of 31 days will be used. The minimum allowed
847
+ map<string, string> labels = 9 [(google.api.field_behavior) = OPTIONAL];
848
+
849
+ // Optional. If true, messages published with the same `ordering_key` in
850
+ // `PubsubMessage` will be delivered to the subscribers in the order in which
851
+ // they are received by the Pub/Sub system. Otherwise, they may be delivered
852
+ // in any order.
853
+ bool enable_message_ordering = 10 [(google.api.field_behavior) = OPTIONAL];
854
+
855
+ // Optional. A policy that specifies the conditions for this subscription's
856
+ // expiration. A subscription is considered active as long as any connected
857
+ // subscriber is successfully consuming messages from the subscription or is
858
+ // issuing operations on the subscription. If `expiration_policy` is not set,
859
+ // a *default policy* with `ttl` of 31 days will be used. The minimum allowed
755
860
  // value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
756
861
  // but `expiration_policy.ttl` is not set, the subscription never expires.
757
- ExpirationPolicy expiration_policy = 11;
862
+ ExpirationPolicy expiration_policy = 11
863
+ [(google.api.field_behavior) = OPTIONAL];
758
864
 
759
- // An expression written in the Pub/Sub [filter
865
+ // Optional. An expression written in the Pub/Sub [filter
760
866
  // language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
761
867
  // then only `PubsubMessage`s whose `attributes` field matches the filter are
762
868
  // delivered on this subscription. If empty, then no messages are filtered
763
869
  // out.
764
- string filter = 12;
870
+ string filter = 12 [(google.api.field_behavior) = OPTIONAL];
765
871
 
766
- // A policy that specifies the conditions for dead lettering messages in
767
- // this subscription. If dead_letter_policy is not set, dead lettering
768
- // is disabled.
872
+ // Optional. A policy that specifies the conditions for dead lettering
873
+ // messages in this subscription. If dead_letter_policy is not set, dead
874
+ // lettering is disabled.
769
875
  //
770
- // The Cloud Pub/Sub service account associated with this subscriptions's
876
+ // The Pub/Sub service account associated with this subscriptions's
771
877
  // parent project (i.e.,
772
878
  // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
773
879
  // permission to Acknowledge() messages on this subscription.
774
- DeadLetterPolicy dead_letter_policy = 13;
880
+ DeadLetterPolicy dead_letter_policy = 13
881
+ [(google.api.field_behavior) = OPTIONAL];
775
882
 
776
- // A policy that specifies how Pub/Sub retries message delivery for this
777
- // subscription.
883
+ // Optional. A policy that specifies how Pub/Sub retries message delivery for
884
+ // this subscription.
778
885
  //
779
886
  // If not set, the default retry policy is applied. This generally implies
780
887
  // that messages will be retried as soon as possible for healthy subscribers.
781
888
  // RetryPolicy will be triggered on NACKs or acknowledgement deadline
782
889
  // exceeded events for a given message.
783
- RetryPolicy retry_policy = 14;
890
+ RetryPolicy retry_policy = 14 [(google.api.field_behavior) = OPTIONAL];
784
891
 
785
- // Indicates whether the subscription is detached from its topic. Detached
786
- // subscriptions don't receive messages from their topic and don't retain any
787
- // backlog. `Pull` and `StreamingPull` requests will return
892
+ // Optional. Indicates whether the subscription is detached from its topic.
893
+ // Detached subscriptions don't receive messages from their topic and don't
894
+ // retain any backlog. `Pull` and `StreamingPull` requests will return
788
895
  // FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
789
896
  // the endpoint will not be made.
790
- bool detached = 15;
897
+ bool detached = 15 [(google.api.field_behavior) = OPTIONAL];
791
898
 
792
- // If true, Pub/Sub provides the following guarantees for the delivery of
793
- // a message with a given value of `message_id` on this subscription:
899
+ // Optional. If true, Pub/Sub provides the following guarantees for the
900
+ // delivery of a message with a given value of `message_id` on this
901
+ // subscription:
794
902
  //
795
903
  // * The message sent to a subscriber is guaranteed not to be resent
796
904
  // before the message's acknowledgement deadline expires.
@@ -800,7 +908,8 @@ message Subscription {
800
908
  // when `enable_exactly_once_delivery` is true if the message was published
801
909
  // multiple times by a publisher client. These copies are considered distinct
802
910
  // by Pub/Sub and have distinct `message_id` values.
803
- bool enable_exactly_once_delivery = 16;
911
+ bool enable_exactly_once_delivery = 16
912
+ [(google.api.field_behavior) = OPTIONAL];
804
913
 
805
914
  // Output only. Indicates the minimum duration for which a message is retained
806
915
  // after it is published to the subscription's topic. If this field is set,
@@ -816,7 +925,7 @@ message Subscription {
816
925
  State state = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
817
926
  }
818
927
 
819
- // A policy that specifies how Cloud Pub/Sub retries message delivery.
928
+ // A policy that specifies how Pub/Sub retries message delivery.
820
929
  //
821
930
  // Retry delay will be exponential based on provided minimum and maximum
822
931
  // backoffs. https://en.wikipedia.org/wiki/Exponential_backoff.
@@ -828,13 +937,16 @@ message Subscription {
828
937
  // between consecutive deliveries may not match the configuration. That is,
829
938
  // delay can be more or less than configured backoff.
830
939
  message RetryPolicy {
831
- // The minimum delay between consecutive deliveries of a given message.
832
- // Value should be between 0 and 600 seconds. Defaults to 10 seconds.
833
- google.protobuf.Duration minimum_backoff = 1;
834
-
835
- // The maximum delay between consecutive deliveries of a given message.
836
- // Value should be between 0 and 600 seconds. Defaults to 600 seconds.
837
- google.protobuf.Duration maximum_backoff = 2;
940
+ // Optional. The minimum delay between consecutive deliveries of a given
941
+ // message. Value should be between 0 and 600 seconds. Defaults to 10 seconds.
942
+ google.protobuf.Duration minimum_backoff = 1
943
+ [(google.api.field_behavior) = OPTIONAL];
944
+
945
+ // Optional. The maximum delay between consecutive deliveries of a given
946
+ // message. Value should be between 0 and 600 seconds. Defaults to 600
947
+ // seconds.
948
+ google.protobuf.Duration maximum_backoff = 2
949
+ [(google.api.field_behavior) = OPTIONAL];
838
950
  }
839
951
 
840
952
  // Dead lettering is done on a best effort basis. The same message might be
@@ -843,19 +955,19 @@ message RetryPolicy {
843
955
  // If validation on any of the fields fails at subscription creation/updation,
844
956
  // the create/update subscription request will fail.
845
957
  message DeadLetterPolicy {
846
- // The name of the topic to which dead letter messages should be published.
847
- // Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
848
- // account associated with the enclosing subscription's parent project (i.e.,
849
- // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
850
- // permission to Publish() to this topic.
958
+ // Optional. The name of the topic to which dead letter messages should be
959
+ // published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub
960
+ // service account associated with the enclosing subscription's parent project
961
+ // (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must
962
+ // have permission to Publish() to this topic.
851
963
  //
852
964
  // The operation will fail if the topic does not exist.
853
965
  // Users should ensure that there is a subscription attached to this topic
854
966
  // since messages published to a topic with no subscriptions are lost.
855
- string dead_letter_topic = 1;
967
+ string dead_letter_topic = 1 [(google.api.field_behavior) = OPTIONAL];
856
968
 
857
- // The maximum number of delivery attempts for any message. The value must be
858
- // between 5 and 100.
969
+ // Optional. The maximum number of delivery attempts for any message. The
970
+ // value must be between 5 and 100.
859
971
  //
860
972
  // The number of delivery attempts is defined as 1 + (the sum of number of
861
973
  // NACKs and number of times the acknowledgement deadline has been exceeded
@@ -867,19 +979,19 @@ message DeadLetterPolicy {
867
979
  // This field will be honored on a best effort basis.
868
980
  //
869
981
  // If this parameter is 0, a default value of 5 is used.
870
- int32 max_delivery_attempts = 2;
982
+ int32 max_delivery_attempts = 2 [(google.api.field_behavior) = OPTIONAL];
871
983
  }
872
984
 
873
985
  // A policy that specifies the conditions for resource expiration (i.e.,
874
986
  // automatic resource deletion).
875
987
  message ExpirationPolicy {
876
- // Specifies the "time-to-live" duration for an associated resource. The
877
- // resource expires if it is not active for a period of `ttl`. The definition
878
- // of "activity" depends on the type of the associated resource. The minimum
879
- // and maximum allowed values for `ttl` depend on the type of the associated
880
- // resource, as well. If `ttl` is not set, the associated resource never
881
- // expires.
882
- google.protobuf.Duration ttl = 1;
988
+ // Optional. Specifies the "time-to-live" duration for an associated resource.
989
+ // The resource expires if it is not active for a period of `ttl`. The
990
+ // definition of "activity" depends on the type of the associated resource.
991
+ // The minimum and maximum allowed values for `ttl` depend on the type of the
992
+ // associated resource, as well. If `ttl` is not set, the associated resource
993
+ // never expires.
994
+ google.protobuf.Duration ttl = 1 [(google.api.field_behavior) = OPTIONAL];
883
995
  }
884
996
 
885
997
  // Configuration for a push delivery endpoint.
@@ -888,20 +1000,21 @@ message PushConfig {
888
1000
  // [OpenID Connect
889
1001
  // token](https://developers.google.com/identity/protocols/OpenIDConnect).
890
1002
  message OidcToken {
891
- // [Service account
1003
+ // Optional. [Service account
892
1004
  // email](https://cloud.google.com/iam/docs/service-accounts)
893
1005
  // used for generating the OIDC token. For more information
894
1006
  // on setting up authentication, see
895
1007
  // [Push subscriptions](https://cloud.google.com/pubsub/docs/push).
896
- string service_account_email = 1;
897
-
898
- // Audience to be used when generating OIDC token. The audience claim
899
- // identifies the recipients that the JWT is intended for. The audience
900
- // value is a single case-sensitive string. Having multiple values (array)
901
- // for the audience field is not supported. More info about the OIDC JWT
902
- // token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
903
- // Note: if not specified, the Push endpoint URL will be used.
904
- string audience = 2;
1008
+ string service_account_email = 1 [(google.api.field_behavior) = OPTIONAL];
1009
+
1010
+ // Optional. Audience to be used when generating OIDC token. The audience
1011
+ // claim identifies the recipients that the JWT is intended for. The
1012
+ // audience value is a single case-sensitive string. Having multiple values
1013
+ // (array) for the audience field is not supported. More info about the OIDC
1014
+ // JWT token audience here:
1015
+ // https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified,
1016
+ // the Push endpoint URL will be used.
1017
+ string audience = 2 [(google.api.field_behavior) = OPTIONAL];
905
1018
  }
906
1019
 
907
1020
  // The payload to the push endpoint is in the form of the JSON representation
@@ -911,18 +1024,18 @@ message PushConfig {
911
1024
 
912
1025
  // Sets the `data` field as the HTTP body for delivery.
913
1026
  message NoWrapper {
914
- // When true, writes the Pub/Sub message metadata to
1027
+ // Optional. When true, writes the Pub/Sub message metadata to
915
1028
  // `x-goog-pubsub-<KEY>:<VAL>` headers of the HTTP request. Writes the
916
1029
  // Pub/Sub message attributes to `<KEY>:<VAL>` headers of the HTTP request.
917
- bool write_metadata = 1;
1030
+ bool write_metadata = 1 [(google.api.field_behavior) = OPTIONAL];
918
1031
  }
919
1032
 
920
- // A URL locating the endpoint to which messages should be pushed.
1033
+ // Optional. A URL locating the endpoint to which messages should be pushed.
921
1034
  // For example, a Webhook endpoint might use `https://example.com/push`.
922
- string push_endpoint = 1;
1035
+ string push_endpoint = 1 [(google.api.field_behavior) = OPTIONAL];
923
1036
 
924
- // Endpoint configuration attributes that can be used to control different
925
- // aspects of the message delivery.
1037
+ // Optional. Endpoint configuration attributes that can be used to control
1038
+ // different aspects of the message delivery.
926
1039
  //
927
1040
  // The only currently supported attribute is `x-goog-version`, which you can
928
1041
  // use to change the format of the pushed message. This attribute
@@ -942,29 +1055,30 @@ message PushConfig {
942
1055
  //
943
1056
  // For example:
944
1057
  // `attributes { "x-goog-version": "v1" }`
945
- map<string, string> attributes = 2;
1058
+ map<string, string> attributes = 2 [(google.api.field_behavior) = OPTIONAL];
946
1059
 
947
1060
  // An authentication method used by push endpoints to verify the source of
948
1061
  // push requests. This can be used with push endpoints that are private by
949
- // default to allow requests only from the Cloud Pub/Sub system, for example.
1062
+ // default to allow requests only from the Pub/Sub system, for example.
950
1063
  // This field is optional and should be set only by users interested in
951
1064
  // authenticated push.
952
1065
  oneof authentication_method {
953
- // If specified, Pub/Sub will generate and attach an OIDC JWT token as an
954
- // `Authorization` header in the HTTP request for every pushed message.
955
- OidcToken oidc_token = 3;
1066
+ // Optional. If specified, Pub/Sub will generate and attach an OIDC JWT
1067
+ // token as an `Authorization` header in the HTTP request for every pushed
1068
+ // message.
1069
+ OidcToken oidc_token = 3 [(google.api.field_behavior) = OPTIONAL];
956
1070
  }
957
1071
 
958
1072
  // The format of the delivered message to the push endpoint is defined by
959
1073
  // the chosen wrapper. When unset, `PubsubWrapper` is used.
960
1074
  oneof wrapper {
961
- // When set, the payload to the push endpoint is in the form of the JSON
962
- // representation of a PubsubMessage
1075
+ // Optional. When set, the payload to the push endpoint is in the form of
1076
+ // the JSON representation of a PubsubMessage
963
1077
  // (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
964
- PubsubWrapper pubsub_wrapper = 4;
1078
+ PubsubWrapper pubsub_wrapper = 4 [(google.api.field_behavior) = OPTIONAL];
965
1079
 
966
- // When set, the payload to the push endpoint is not wrapped.
967
- NoWrapper no_wrapper = 5;
1080
+ // Optional. When set, the payload to the push endpoint is not wrapped.
1081
+ NoWrapper no_wrapper = 5 [(google.api.field_behavior) = OPTIONAL];
968
1082
  }
969
1083
  }
970
1084
 
@@ -991,30 +1105,34 @@ message BigQueryConfig {
991
1105
 
992
1106
  // Cannot write to the BigQuery table due to a schema mismatch.
993
1107
  SCHEMA_MISMATCH = 4;
1108
+
1109
+ // Cannot write to the destination because enforce_in_transit is set to true
1110
+ // and the destination locations are not in the allowed regions.
1111
+ IN_TRANSIT_LOCATION_RESTRICTION = 5;
994
1112
  }
995
1113
 
996
- // The name of the table to which to write data, of the form
1114
+ // Optional. The name of the table to which to write data, of the form
997
1115
  // {projectId}.{datasetId}.{tableId}
998
- string table = 1;
1116
+ string table = 1 [(google.api.field_behavior) = OPTIONAL];
999
1117
 
1000
1118
  // Optional. When true, use the topic's schema as the columns to write to in
1001
1119
  // BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
1002
1120
  // enabled at the same time.
1003
1121
  bool use_topic_schema = 2 [(google.api.field_behavior) = OPTIONAL];
1004
1122
 
1005
- // When true, write the subscription name, message_id, publish_time,
1123
+ // Optional. When true, write the subscription name, message_id, publish_time,
1006
1124
  // attributes, and ordering_key to additional columns in the table. The
1007
1125
  // subscription name, message_id, and publish_time fields are put in their own
1008
1126
  // columns while all other message properties (other than data) are written to
1009
1127
  // a JSON object in the attributes column.
1010
- bool write_metadata = 3;
1128
+ bool write_metadata = 3 [(google.api.field_behavior) = OPTIONAL];
1011
1129
 
1012
- // When true and use_topic_schema is true, any fields that are a part of the
1013
- // topic schema that are not part of the BigQuery table schema are dropped
1014
- // when writing to BigQuery. Otherwise, the schemas must be kept in sync and
1015
- // any messages with extra fields are not written and remain in the
1130
+ // Optional. When true and use_topic_schema is true, any fields that are a
1131
+ // part of the topic schema that are not part of the BigQuery table schema are
1132
+ // dropped when writing to BigQuery. Otherwise, the schemas must be kept in
1133
+ // sync and any messages with extra fields are not written and remain in the
1016
1134
  // subscription's backlog.
1017
- bool drop_unknown_fields = 4;
1135
+ bool drop_unknown_fields = 4 [(google.api.field_behavior) = OPTIONAL];
1018
1136
 
1019
1137
  // Output only. An output-only field that indicates whether or not the
1020
1138
  // subscription can receive messages.
@@ -1036,13 +1154,13 @@ message CloudStorageConfig {
1036
1154
  // Configuration for writing message data in Avro format.
1037
1155
  // Message payloads and metadata will be written to files as an Avro binary.
1038
1156
  message AvroConfig {
1039
- // When true, write the subscription name, message_id, publish_time,
1040
- // attributes, and ordering_key as additional fields in the output. The
1041
- // subscription name, message_id, and publish_time fields are put in their
1042
- // own fields while all other message properties other than data (for
1043
- // example, an ordering_key, if present) are added as entries in the
1044
- // attributes map.
1045
- bool write_metadata = 1;
1157
+ // Optional. When true, write the subscription name, message_id,
1158
+ // publish_time, attributes, and ordering_key as additional fields in the
1159
+ // output. The subscription name, message_id, and publish_time fields are
1160
+ // put in their own fields while all other message properties other than
1161
+ // data (for example, an ordering_key, if present) are added as entries in
1162
+ // the attributes map.
1163
+ bool write_metadata = 1 [(google.api.field_behavior) = OPTIONAL];
1046
1164
  }
1047
1165
 
1048
1166
  // Possible states for a Cloud Storage subscription.
@@ -1059,6 +1177,10 @@ message CloudStorageConfig {
1059
1177
 
1060
1178
  // Cannot write to the Cloud Storage bucket because it does not exist.
1061
1179
  NOT_FOUND = 3;
1180
+
1181
+ // Cannot write to the destination because enforce_in_transit is set to true
1182
+ // and the destination locations are not in the allowed regions.
1183
+ IN_TRANSIT_LOCATION_RESTRICTION = 4;
1062
1184
  }
1063
1185
 
1064
1186
  // Required. User-provided name for the Cloud Storage bucket.
@@ -1067,33 +1189,36 @@ message CloudStorageConfig {
1067
1189
  // requirements] (https://cloud.google.com/storage/docs/buckets#naming).
1068
1190
  string bucket = 1 [(google.api.field_behavior) = REQUIRED];
1069
1191
 
1070
- // User-provided prefix for Cloud Storage filename. See the [object naming
1071
- // requirements](https://cloud.google.com/storage/docs/objects#naming).
1072
- string filename_prefix = 2;
1192
+ // Optional. User-provided prefix for Cloud Storage filename. See the [object
1193
+ // naming requirements](https://cloud.google.com/storage/docs/objects#naming).
1194
+ string filename_prefix = 2 [(google.api.field_behavior) = OPTIONAL];
1073
1195
 
1074
- // User-provided suffix for Cloud Storage filename. See the [object naming
1075
- // requirements](https://cloud.google.com/storage/docs/objects#naming). Must
1076
- // not end in "/".
1077
- string filename_suffix = 3;
1196
+ // Optional. User-provided suffix for Cloud Storage filename. See the [object
1197
+ // naming requirements](https://cloud.google.com/storage/docs/objects#naming).
1198
+ // Must not end in "/".
1199
+ string filename_suffix = 3 [(google.api.field_behavior) = OPTIONAL];
1078
1200
 
1079
1201
  // Defaults to text format.
1080
1202
  oneof output_format {
1081
- // If set, message data will be written to Cloud Storage in text format.
1082
- TextConfig text_config = 4;
1203
+ // Optional. If set, message data will be written to Cloud Storage in text
1204
+ // format.
1205
+ TextConfig text_config = 4 [(google.api.field_behavior) = OPTIONAL];
1083
1206
 
1084
- // If set, message data will be written to Cloud Storage in Avro format.
1085
- AvroConfig avro_config = 5;
1207
+ // Optional. If set, message data will be written to Cloud Storage in Avro
1208
+ // format.
1209
+ AvroConfig avro_config = 5 [(google.api.field_behavior) = OPTIONAL];
1086
1210
  }
1087
1211
 
1088
- // The maximum duration that can elapse before a new Cloud Storage file is
1089
- // created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
1090
- // the subscription's acknowledgement deadline.
1091
- google.protobuf.Duration max_duration = 6;
1212
+ // Optional. The maximum duration that can elapse before a new Cloud Storage
1213
+ // file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not
1214
+ // exceed the subscription's acknowledgement deadline.
1215
+ google.protobuf.Duration max_duration = 6
1216
+ [(google.api.field_behavior) = OPTIONAL];
1092
1217
 
1093
- // The maximum bytes that can be written to a Cloud Storage file before a new
1094
- // file is created. Min 1 KB, max 10 GiB. The max_bytes limit may be exceeded
1095
- // in cases where messages are larger than the limit.
1096
- int64 max_bytes = 7;
1218
+ // Optional. The maximum bytes that can be written to a Cloud Storage file
1219
+ // before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may
1220
+ // be exceeded in cases where messages are larger than the limit.
1221
+ int64 max_bytes = 7 [(google.api.field_behavior) = OPTIONAL];
1097
1222
 
1098
1223
  // Output only. An output-only field that indicates whether or not the
1099
1224
  // subscription can receive messages.
@@ -1102,14 +1227,14 @@ message CloudStorageConfig {
1102
1227
 
1103
1228
  // A message and its corresponding acknowledgment ID.
1104
1229
  message ReceivedMessage {
1105
- // This ID can be used to acknowledge the received message.
1106
- string ack_id = 1;
1230
+ // Optional. This ID can be used to acknowledge the received message.
1231
+ string ack_id = 1 [(google.api.field_behavior) = OPTIONAL];
1107
1232
 
1108
- // The message.
1109
- PubsubMessage message = 2;
1233
+ // Optional. The message.
1234
+ PubsubMessage message = 2 [(google.api.field_behavior) = OPTIONAL];
1110
1235
 
1111
- // The approximate number of times that Cloud Pub/Sub has attempted to deliver
1112
- // the associated message to a subscriber.
1236
+ // Optional. The approximate number of times that Pub/Sub has attempted to
1237
+ // deliver the associated message to a subscriber.
1113
1238
  //
1114
1239
  // More precisely, this is 1 + (number of NACKs) +
1115
1240
  // (number of ack_deadline exceeds) for this message.
@@ -1124,7 +1249,7 @@ message ReceivedMessage {
1124
1249
  // value of 1. The value is calculated at best effort and is approximate.
1125
1250
  //
1126
1251
  // If a DeadLetterPolicy is not set on the subscription, this will be 0.
1127
- int32 delivery_attempt = 3;
1252
+ int32 delivery_attempt = 3 [(google.api.field_behavior) = OPTIONAL];
1128
1253
  }
1129
1254
 
1130
1255
  // Request for the GetSubscription method.
@@ -1161,24 +1286,25 @@ message ListSubscriptionsRequest {
1161
1286
  }
1162
1287
  ];
1163
1288
 
1164
- // Maximum number of subscriptions to return.
1165
- int32 page_size = 2;
1289
+ // Optional. Maximum number of subscriptions to return.
1290
+ int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
1166
1291
 
1167
- // The value returned by the last `ListSubscriptionsResponse`; indicates that
1168
- // this is a continuation of a prior `ListSubscriptions` call, and that the
1169
- // system should return the next page of data.
1170
- string page_token = 3;
1292
+ // Optional. The value returned by the last `ListSubscriptionsResponse`;
1293
+ // indicates that this is a continuation of a prior `ListSubscriptions` call,
1294
+ // and that the system should return the next page of data.
1295
+ string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
1171
1296
  }
1172
1297
 
1173
1298
  // Response for the `ListSubscriptions` method.
1174
1299
  message ListSubscriptionsResponse {
1175
- // The subscriptions that match the request.
1176
- repeated Subscription subscriptions = 1;
1300
+ // Optional. The subscriptions that match the request.
1301
+ repeated Subscription subscriptions = 1
1302
+ [(google.api.field_behavior) = OPTIONAL];
1177
1303
 
1178
- // If not empty, indicates that there may be more subscriptions that match
1179
- // the request; this value should be passed in a new
1304
+ // Optional. If not empty, indicates that there may be more subscriptions that
1305
+ // match the request; this value should be passed in a new
1180
1306
  // `ListSubscriptionsRequest` to get more subscriptions.
1181
- string next_page_token = 2;
1307
+ string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL];
1182
1308
  }
1183
1309
 
1184
1310
  // Request for the DeleteSubscription method.
@@ -1242,12 +1368,13 @@ message PullRequest {
1242
1368
 
1243
1369
  // Response for the `Pull` method.
1244
1370
  message PullResponse {
1245
- // Received Pub/Sub messages. The list will be empty if there are no more
1246
- // messages available in the backlog, or if no messages could be returned
1371
+ // Optional. Received Pub/Sub messages. The list will be empty if there are no
1372
+ // more messages available in the backlog, or if no messages could be returned
1247
1373
  // before the request timeout. For JSON, the response can be entirely
1248
1374
  // empty. The Pub/Sub system may return fewer than the `maxMessages` requested
1249
1375
  // even if there are more messages available in the backlog.
1250
- repeated ReceivedMessage received_messages = 1;
1376
+ repeated ReceivedMessage received_messages = 1
1377
+ [(google.api.field_behavior) = OPTIONAL];
1251
1378
  }
1252
1379
 
1253
1380
  // Request for the ModifyAckDeadline method.
@@ -1271,7 +1398,8 @@ message ModifyAckDeadlineRequest {
1271
1398
  // delivery to another subscriber client. This typically results in an
1272
1399
  // increase in the rate of message redeliveries (that is, duplicates).
1273
1400
  // The minimum deadline you can specify is 0 seconds.
1274
- // The maximum deadline you can specify is 600 seconds (10 minutes).
1401
+ // The maximum deadline you can specify in a single request is 600 seconds
1402
+ // (10 minutes).
1275
1403
  int32 ack_deadline_seconds = 3 [(google.api.field_behavior) = REQUIRED];
1276
1404
  }
1277
1405
 
@@ -1307,14 +1435,15 @@ message StreamingPullRequest {
1307
1435
  }
1308
1436
  ];
1309
1437
 
1310
- // List of acknowledgement IDs for acknowledging previously received messages
1311
- // (received on this stream or a different stream). If an ack ID has expired,
1312
- // the corresponding message may be redelivered later. Acknowledging a message
1313
- // more than once will not result in an error. If the acknowledgement ID is
1314
- // malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
1315
- repeated string ack_ids = 2;
1438
+ // Optional. List of acknowledgement IDs for acknowledging previously received
1439
+ // messages (received on this stream or a different stream). If an ack ID has
1440
+ // expired, the corresponding message may be redelivered later. Acknowledging
1441
+ // a message more than once will not result in an error. If the
1442
+ // acknowledgement ID is malformed, the stream will be aborted with status
1443
+ // `INVALID_ARGUMENT`.
1444
+ repeated string ack_ids = 2 [(google.api.field_behavior) = OPTIONAL];
1316
1445
 
1317
- // The list of new ack deadlines for the IDs listed in
1446
+ // Optional. The list of new ack deadlines for the IDs listed in
1318
1447
  // `modify_deadline_ack_ids`. The size of this list must be the same as the
1319
1448
  // size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
1320
1449
  // with `INVALID_ARGUMENT`. Each element in this list is applied to the
@@ -1325,14 +1454,16 @@ message StreamingPullRequest {
1325
1454
  // the message is immediately made available for another streaming or
1326
1455
  // non-streaming pull request. If the value is < 0 (an error), the stream will
1327
1456
  // be aborted with status `INVALID_ARGUMENT`.
1328
- repeated int32 modify_deadline_seconds = 3;
1457
+ repeated int32 modify_deadline_seconds = 3
1458
+ [(google.api.field_behavior) = OPTIONAL];
1329
1459
 
1330
- // List of acknowledgement IDs whose deadline will be modified based on the
1331
- // corresponding element in `modify_deadline_seconds`. This field can be used
1332
- // to indicate that more time is needed to process a message by the
1460
+ // Optional. List of acknowledgement IDs whose deadline will be modified based
1461
+ // on the corresponding element in `modify_deadline_seconds`. This field can
1462
+ // be used to indicate that more time is needed to process a message by the
1333
1463
  // subscriber, or to make the message available for redelivery if the
1334
1464
  // processing was interrupted.
1335
- repeated string modify_deadline_ack_ids = 4;
1465
+ repeated string modify_deadline_ack_ids = 4
1466
+ [(google.api.field_behavior) = OPTIONAL];
1336
1467
 
1337
1468
  // Required. The ack deadline to use for the stream. This must be provided in
1338
1469
  // the first request on the stream, but it can also be updated on subsequent
@@ -1341,16 +1472,16 @@ message StreamingPullRequest {
1341
1472
  int32 stream_ack_deadline_seconds = 5
1342
1473
  [(google.api.field_behavior) = REQUIRED];
1343
1474
 
1344
- // A unique identifier that is used to distinguish client instances from each
1345
- // other. Only needs to be provided on the initial request. When a stream
1346
- // disconnects and reconnects for the same stream, the client_id should be set
1347
- // to the same value so that state associated with the old stream can be
1348
- // transferred to the new stream. The same client_id should not be used for
1475
+ // Optional. A unique identifier that is used to distinguish client instances
1476
+ // from each other. Only needs to be provided on the initial request. When a
1477
+ // stream disconnects and reconnects for the same stream, the client_id should
1478
+ // be set to the same value so that state associated with the old stream can
1479
+ // be transferred to the new stream. The same client_id should not be used for
1349
1480
  // different client instances.
1350
- string client_id = 6;
1481
+ string client_id = 6 [(google.api.field_behavior) = OPTIONAL];
1351
1482
 
1352
- // Flow control settings for the maximum number of outstanding messages. When
1353
- // there are `max_outstanding_messages` or more currently sent to the
1483
+ // Optional. Flow control settings for the maximum number of outstanding
1484
+ // messages. When there are `max_outstanding_messages` currently sent to the
1354
1485
  // streaming pull client that have not yet been acked or nacked, the server
1355
1486
  // stops sending more messages. The sending of messages resumes once the
1356
1487
  // number of outstanding messages is less than this value. If the value is
@@ -1358,18 +1489,18 @@ message StreamingPullRequest {
1358
1489
  // property can only be set on the initial StreamingPullRequest. If it is set
1359
1490
  // on a subsequent request, the stream will be aborted with status
1360
1491
  // `INVALID_ARGUMENT`.
1361
- int64 max_outstanding_messages = 7;
1362
-
1363
- // Flow control settings for the maximum number of outstanding bytes. When
1364
- // there are `max_outstanding_bytes` or more worth of messages currently sent
1365
- // to the streaming pull client that have not yet been acked or nacked, the
1366
- // server will stop sending more messages. The sending of messages resumes
1367
- // once the number of outstanding bytes is less than this value. If the value
1368
- // is <= 0, there is no limit to the number of outstanding bytes. This
1369
- // property can only be set on the initial StreamingPullRequest. If it is set
1370
- // on a subsequent request, the stream will be aborted with status
1492
+ int64 max_outstanding_messages = 7 [(google.api.field_behavior) = OPTIONAL];
1493
+
1494
+ // Optional. Flow control settings for the maximum number of outstanding
1495
+ // bytes. When there are `max_outstanding_bytes` or more worth of messages
1496
+ // currently sent to the streaming pull client that have not yet been acked or
1497
+ // nacked, the server will stop sending more messages. The sending of messages
1498
+ // resumes once the number of outstanding bytes is less than this value. If
1499
+ // the value is <= 0, there is no limit to the number of outstanding bytes.
1500
+ // This property can only be set on the initial StreamingPullRequest. If it is
1501
+ // set on a subsequent request, the stream will be aborted with status
1371
1502
  // `INVALID_ARGUMENT`.
1372
- int64 max_outstanding_bytes = 8;
1503
+ int64 max_outstanding_bytes = 8 [(google.api.field_behavior) = OPTIONAL];
1373
1504
  }
1374
1505
 
1375
1506
  // Response for the `StreamingPull` method. This response is used to stream
@@ -1378,56 +1509,69 @@ message StreamingPullResponse {
1378
1509
  // Acknowledgement IDs sent in one or more previous requests to acknowledge a
1379
1510
  // previously received message.
1380
1511
  message AcknowledgeConfirmation {
1381
- // Successfully processed acknowledgement IDs.
1382
- repeated string ack_ids = 1;
1383
-
1384
- // List of acknowledgement IDs that were malformed or whose acknowledgement
1385
- // deadline has expired.
1386
- repeated string invalid_ack_ids = 2;
1387
-
1388
- // List of acknowledgement IDs that were out of order.
1389
- repeated string unordered_ack_ids = 3;
1390
-
1391
- // List of acknowledgement IDs that failed processing with temporary issues.
1392
- repeated string temporary_failed_ack_ids = 4;
1512
+ // Optional. Successfully processed acknowledgement IDs.
1513
+ repeated string ack_ids = 1 [(google.api.field_behavior) = OPTIONAL];
1514
+
1515
+ // Optional. List of acknowledgement IDs that were malformed or whose
1516
+ // acknowledgement deadline has expired.
1517
+ repeated string invalid_ack_ids = 2
1518
+ [(google.api.field_behavior) = OPTIONAL];
1519
+
1520
+ // Optional. List of acknowledgement IDs that were out of order.
1521
+ repeated string unordered_ack_ids = 3
1522
+ [(google.api.field_behavior) = OPTIONAL];
1523
+
1524
+ // Optional. List of acknowledgement IDs that failed processing with
1525
+ // temporary issues.
1526
+ repeated string temporary_failed_ack_ids = 4
1527
+ [(google.api.field_behavior) = OPTIONAL];
1393
1528
  }
1394
1529
 
1395
1530
  // Acknowledgement IDs sent in one or more previous requests to modify the
1396
1531
  // deadline for a specific message.
1397
1532
  message ModifyAckDeadlineConfirmation {
1398
- // Successfully processed acknowledgement IDs.
1399
- repeated string ack_ids = 1;
1400
-
1401
- // List of acknowledgement IDs that were malformed or whose acknowledgement
1402
- // deadline has expired.
1403
- repeated string invalid_ack_ids = 2;
1404
-
1405
- // List of acknowledgement IDs that failed processing with temporary issues.
1406
- repeated string temporary_failed_ack_ids = 3;
1533
+ // Optional. Successfully processed acknowledgement IDs.
1534
+ repeated string ack_ids = 1 [(google.api.field_behavior) = OPTIONAL];
1535
+
1536
+ // Optional. List of acknowledgement IDs that were malformed or whose
1537
+ // acknowledgement deadline has expired.
1538
+ repeated string invalid_ack_ids = 2
1539
+ [(google.api.field_behavior) = OPTIONAL];
1540
+
1541
+ // Optional. List of acknowledgement IDs that failed processing with
1542
+ // temporary issues.
1543
+ repeated string temporary_failed_ack_ids = 3
1544
+ [(google.api.field_behavior) = OPTIONAL];
1407
1545
  }
1408
1546
 
1409
1547
  // Subscription properties sent as part of the response.
1410
1548
  message SubscriptionProperties {
1411
- // True iff exactly once delivery is enabled for this subscription.
1412
- bool exactly_once_delivery_enabled = 1;
1549
+ // Optional. True iff exactly once delivery is enabled for this
1550
+ // subscription.
1551
+ bool exactly_once_delivery_enabled = 1
1552
+ [(google.api.field_behavior) = OPTIONAL];
1413
1553
 
1414
- // True iff message ordering is enabled for this subscription.
1415
- bool message_ordering_enabled = 2;
1554
+ // Optional. True iff message ordering is enabled for this subscription.
1555
+ bool message_ordering_enabled = 2 [(google.api.field_behavior) = OPTIONAL];
1416
1556
  }
1417
1557
 
1418
- // Received Pub/Sub messages. This will not be empty.
1419
- repeated ReceivedMessage received_messages = 1;
1558
+ // Optional. Received Pub/Sub messages. This will not be empty.
1559
+ repeated ReceivedMessage received_messages = 1
1560
+ [(google.api.field_behavior) = OPTIONAL];
1420
1561
 
1421
- // This field will only be set if `enable_exactly_once_delivery` is set to
1422
- // `true`.
1423
- AcknowledgeConfirmation acknowledge_confirmation = 5;
1562
+ // Optional. This field will only be set if `enable_exactly_once_delivery` is
1563
+ // set to `true`.
1564
+ AcknowledgeConfirmation acknowledge_confirmation = 5
1565
+ [(google.api.field_behavior) = OPTIONAL];
1424
1566
 
1425
- // This field will only be set if `enable_exactly_once_delivery` is set to
1426
- // `true`.
1427
- ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3;
1567
+ // Optional. This field will only be set if `enable_exactly_once_delivery` is
1568
+ // set to `true`.
1569
+ ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3
1570
+ [(google.api.field_behavior) = OPTIONAL];
1428
1571
 
1429
- // Properties associated with this subscription.
1430
- SubscriptionProperties subscription_properties = 4;
1572
+ // Optional. Properties associated with this subscription.
1573
+ SubscriptionProperties subscription_properties = 4
1574
+ [(google.api.field_behavior) = OPTIONAL];
1431
1575
  }
1432
1576
 
1433
1577
  // Request for the `CreateSnapshot` method.
@@ -1459,9 +1603,9 @@ message CreateSnapshotRequest {
1459
1603
  }
1460
1604
  ];
1461
1605
 
1462
- // See [Creating and managing
1606
+ // Optional. See [Creating and managing
1463
1607
  // labels](https://cloud.google.com/pubsub/docs/labels).
1464
- map<string, string> labels = 3;
1608
+ map<string, string> labels = 3 [(google.api.field_behavior) = OPTIONAL];
1465
1609
  }
1466
1610
 
1467
1611
  // Request for the UpdateSnapshot method.
@@ -1486,15 +1630,17 @@ message Snapshot {
1486
1630
  pattern: "projects/{project}/snapshots/{snapshot}"
1487
1631
  };
1488
1632
 
1489
- // The name of the snapshot.
1490
- string name = 1;
1633
+ // Optional. The name of the snapshot.
1634
+ string name = 1 [(google.api.field_behavior) = OPTIONAL];
1491
1635
 
1492
- // The name of the topic from which this snapshot is retaining messages.
1636
+ // Optional. The name of the topic from which this snapshot is retaining
1637
+ // messages.
1493
1638
  string topic = 2 [
1639
+ (google.api.field_behavior) = OPTIONAL,
1494
1640
  (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
1495
1641
  ];
1496
1642
 
1497
- // The snapshot is guaranteed to exist up until this time.
1643
+ // Optional. The snapshot is guaranteed to exist up until this time.
1498
1644
  // A newly-created snapshot expires no later than 7 days from the time of its
1499
1645
  // creation. Its exact lifetime is determined at creation by the existing
1500
1646
  // backlog in the source subscription. Specifically, the lifetime of the
@@ -1504,11 +1650,12 @@ message Snapshot {
1504
1650
  // will always capture this 3-day-old backlog as long as the snapshot
1505
1651
  // exists -- will expire in 4 days. The service will refuse to create a
1506
1652
  // snapshot that would expire in less than 1 hour after creation.
1507
- google.protobuf.Timestamp expire_time = 3;
1653
+ google.protobuf.Timestamp expire_time = 3
1654
+ [(google.api.field_behavior) = OPTIONAL];
1508
1655
 
1509
- // See [Creating and managing labels]
1656
+ // Optional. See [Creating and managing labels]
1510
1657
  // (https://cloud.google.com/pubsub/docs/labels).
1511
- map<string, string> labels = 4;
1658
+ map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];
1512
1659
  }
1513
1660
 
1514
1661
  // Request for the GetSnapshot method.
@@ -1532,23 +1679,24 @@ message ListSnapshotsRequest {
1532
1679
  }
1533
1680
  ];
1534
1681
 
1535
- // Maximum number of snapshots to return.
1536
- int32 page_size = 2;
1682
+ // Optional. Maximum number of snapshots to return.
1683
+ int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
1537
1684
 
1538
- // The value returned by the last `ListSnapshotsResponse`; indicates that this
1539
- // is a continuation of a prior `ListSnapshots` call, and that the system
1540
- // should return the next page of data.
1541
- string page_token = 3;
1685
+ // Optional. The value returned by the last `ListSnapshotsResponse`; indicates
1686
+ // that this is a continuation of a prior `ListSnapshots` call, and that the
1687
+ // system should return the next page of data.
1688
+ string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
1542
1689
  }
1543
1690
 
1544
1691
  // Response for the `ListSnapshots` method.
1545
1692
  message ListSnapshotsResponse {
1546
- // The resulting snapshots.
1547
- repeated Snapshot snapshots = 1;
1693
+ // Optional. The resulting snapshots.
1694
+ repeated Snapshot snapshots = 1 [(google.api.field_behavior) = OPTIONAL];
1548
1695
 
1549
- // If not empty, indicates that there may be more snapshot that match the
1550
- // request; this value should be passed in a new `ListSnapshotsRequest`.
1551
- string next_page_token = 2;
1696
+ // Optional. If not empty, indicates that there may be more snapshot that
1697
+ // match the request; this value should be passed in a new
1698
+ // `ListSnapshotsRequest`.
1699
+ string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL];
1552
1700
  }
1553
1701
 
1554
1702
  // Request for the `DeleteSnapshot` method.
@@ -1572,7 +1720,7 @@ message SeekRequest {
1572
1720
  ];
1573
1721
 
1574
1722
  oneof target {
1575
- // The time to seek to.
1723
+ // Optional. The time to seek to.
1576
1724
  // Messages retained in the subscription that were published before this
1577
1725
  // time are marked as acknowledged, and messages retained in the
1578
1726
  // subscription that were published after this time are marked as
@@ -1583,14 +1731,17 @@ message SeekRequest {
1583
1731
  // window (or to a point before the system's notion of the subscription
1584
1732
  // creation time), only retained messages will be marked as unacknowledged,
1585
1733
  // and already-expunged messages will not be restored.
1586
- google.protobuf.Timestamp time = 2;
1587
-
1588
- // The snapshot to seek to. The snapshot's topic must be the same as that of
1589
- // the provided subscription.
1590
- // Format is `projects/{project}/snapshots/{snap}`.
1591
- string snapshot = 3 [(google.api.resource_reference) = {
1592
- type: "pubsub.googleapis.com/Snapshot"
1593
- }];
1734
+ google.protobuf.Timestamp time = 2 [(google.api.field_behavior) = OPTIONAL];
1735
+
1736
+ // Optional. The snapshot to seek to. The snapshot's topic must be the same
1737
+ // as that of the provided subscription. Format is
1738
+ // `projects/{project}/snapshots/{snap}`.
1739
+ string snapshot = 3 [
1740
+ (google.api.field_behavior) = OPTIONAL,
1741
+ (google.api.resource_reference) = {
1742
+ type: "pubsub.googleapis.com/Snapshot"
1743
+ }
1744
+ ];
1594
1745
  }
1595
1746
  }
1596
1747