google-cloud-pubsub 1.1.3 → 2.0.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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +2 -1
  3. data/CHANGELOG.md +145 -0
  4. data/EMULATOR.md +1 -1
  5. data/TROUBLESHOOTING.md +2 -8
  6. data/lib/google/cloud/pubsub/async_publisher.rb +16 -21
  7. data/lib/google/cloud/pubsub/credentials.rb +2 -2
  8. data/lib/google/cloud/pubsub/project.rb +18 -26
  9. data/lib/google/cloud/pubsub/received_message.rb +38 -0
  10. data/lib/google/cloud/pubsub/retry_policy.rb +90 -0
  11. data/lib/google/cloud/pubsub/service.rb +125 -252
  12. data/lib/google/cloud/pubsub/subscriber/inventory.rb +43 -15
  13. data/lib/google/cloud/pubsub/subscriber/stream.rb +8 -10
  14. data/lib/google/cloud/pubsub/subscriber.rb +86 -15
  15. data/lib/google/cloud/pubsub/subscription/push_config.rb +2 -2
  16. data/lib/google/cloud/pubsub/subscription.rb +297 -7
  17. data/lib/google/cloud/pubsub/topic.rb +65 -2
  18. data/lib/google/cloud/pubsub/version.rb +1 -1
  19. data/lib/google/cloud/pubsub.rb +15 -18
  20. data/lib/google-cloud-pubsub.rb +13 -13
  21. metadata +11 -81
  22. data/lib/google/cloud/pubsub/v1/credentials.rb +0 -41
  23. data/lib/google/cloud/pubsub/v1/doc/google/iam/v1/iam_policy.rb +0 -21
  24. data/lib/google/cloud/pubsub/v1/doc/google/iam/v1/options.rb +0 -21
  25. data/lib/google/cloud/pubsub/v1/doc/google/iam/v1/policy.rb +0 -21
  26. data/lib/google/cloud/pubsub/v1/doc/google/protobuf/duration.rb +0 -91
  27. data/lib/google/cloud/pubsub/v1/doc/google/protobuf/empty.rb +0 -29
  28. data/lib/google/cloud/pubsub/v1/doc/google/protobuf/field_mask.rb +0 -222
  29. data/lib/google/cloud/pubsub/v1/doc/google/protobuf/timestamp.rb +0 -113
  30. data/lib/google/cloud/pubsub/v1/doc/google/pubsub/v1/pubsub.rb +0 -744
  31. data/lib/google/cloud/pubsub/v1/doc/google/type/expr.rb +0 -19
  32. data/lib/google/cloud/pubsub/v1/publisher_client.rb +0 -786
  33. data/lib/google/cloud/pubsub/v1/publisher_client_config.json +0 -105
  34. data/lib/google/cloud/pubsub/v1/subscriber_client.rb +0 -1385
  35. data/lib/google/cloud/pubsub/v1/subscriber_client_config.json +0 -144
  36. data/lib/google/cloud/pubsub/v1.rb +0 -17
  37. data/lib/google/pubsub/v1/pubsub_pb.rb +0 -249
  38. data/lib/google/pubsub/v1/pubsub_services_pb.rb +0 -211
@@ -1,744 +0,0 @@
1
- # Copyright 2019 Google LLC
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
- # https://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
-
16
- module Google
17
- module Cloud
18
- module PubSub
19
- module V1
20
- # @!attribute [rw] allowed_persistence_regions
21
- # @return [Array<String>]
22
- # A list of IDs of GCP regions where messages that are published to the topic
23
- # may be persisted in storage. Messages published by publishers running in
24
- # non-allowed GCP regions (or running outside of GCP altogether) will be
25
- # routed for storage in one of the allowed regions. An empty list means that
26
- # no regions are allowed, and is not a valid configuration.
27
- class MessageStoragePolicy; end
28
-
29
- # A topic resource.
30
- # @!attribute [rw] name
31
- # @return [String]
32
- # The name of the topic. It must have the format
33
- # `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
34
- # and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
35
- # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
36
- # signs (`%`). It must be between 3 and 255 characters in length, and it
37
- # must not start with `"goog"`.
38
- # @!attribute [rw] labels
39
- # @return [Hash{String => String}]
40
- # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
41
- # managing labels</a>.
42
- # @!attribute [rw] message_storage_policy
43
- # @return [Google::Cloud::PubSub::V1::MessageStoragePolicy]
44
- # Policy constraining the set of Google Cloud Platform regions where messages
45
- # published to the topic may be stored. If not present, then no constraints
46
- # are in effect.
47
- # @!attribute [rw] kms_key_name
48
- # @return [String]
49
- # The resource name of the Cloud KMS CryptoKey to be used to protect access
50
- # to messages published on this topic.
51
- #
52
- # The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
53
- class Topic; end
54
-
55
- # A message that is published by publishers and consumed by subscribers. The
56
- # message must contain either a non-empty data field or at least one attribute.
57
- # Note that client libraries represent this object differently
58
- # depending on the language. See the corresponding
59
- # <a href="https://cloud.google.com/pubsub/docs/reference/libraries">client
60
- # library documentation</a> for more information. See
61
- # <a href="https://cloud.google.com/pubsub/quotas">Quotas and limits</a>
62
- # for more information about message limits.
63
- # @!attribute [rw] data
64
- # @return [String]
65
- # The message data field. If this field is empty, the message must contain
66
- # at least one attribute.
67
- # @!attribute [rw] attributes
68
- # @return [Hash{String => String}]
69
- # Optional attributes for this message.
70
- # @!attribute [rw] message_id
71
- # @return [String]
72
- # ID of this message, assigned by the server when the message is published.
73
- # Guaranteed to be unique within the topic. This value may be read by a
74
- # subscriber that receives a `PubsubMessage` via a `Pull` call or a push
75
- # delivery. It must not be populated by the publisher in a `Publish` call.
76
- # @!attribute [rw] publish_time
77
- # @return [Google::Protobuf::Timestamp]
78
- # The time at which the message was published, populated by the server when
79
- # it receives the `Publish` call. It must not be populated by the
80
- # publisher in a `Publish` call.
81
- # @!attribute [rw] ordering_key
82
- # @return [String]
83
- # Identifies related messages for which publish order should be respected.
84
- # If a `Subscription` has `enable_message_ordering` set to `true`, messages
85
- # published with the same `ordering_key` value will be delivered to
86
- # subscribers in the order in which they are received by the Pub/Sub system.
87
- # <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
88
- # API might be changed in backward-incompatible ways and is not recommended
89
- # for production use. It is not subject to any SLA or deprecation policy.
90
- class PubsubMessage; end
91
-
92
- # Request for the GetTopic method.
93
- # @!attribute [rw] topic
94
- # @return [String]
95
- # The name of the topic to get.
96
- # Format is `projects/{project}/topics/{topic}`.
97
- class GetTopicRequest; end
98
-
99
- # Request for the UpdateTopic method.
100
- # @!attribute [rw] topic
101
- # @return [Google::Cloud::PubSub::V1::Topic]
102
- # The updated topic object.
103
- # @!attribute [rw] update_mask
104
- # @return [Google::Protobuf::FieldMask]
105
- # Indicates which fields in the provided topic to update. Must be specified
106
- # and non-empty. Note that if `update_mask` contains
107
- # "message_storage_policy" then the new value will be determined based on the
108
- # policy configured at the project or organization level. The
109
- # `message_storage_policy` must not be set in the `topic` provided above.
110
- class UpdateTopicRequest; end
111
-
112
- # Request for the Publish method.
113
- # @!attribute [rw] topic
114
- # @return [String]
115
- # The messages in the request will be published on this topic.
116
- # Format is `projects/{project}/topics/{topic}`.
117
- # @!attribute [rw] messages
118
- # @return [Array<Google::Cloud::PubSub::V1::PubsubMessage>]
119
- # The messages to publish.
120
- class PublishRequest; end
121
-
122
- # Response for the `Publish` method.
123
- # @!attribute [rw] message_ids
124
- # @return [Array<String>]
125
- # The server-assigned ID of each published message, in the same order as
126
- # the messages in the request. IDs are guaranteed to be unique within
127
- # the topic.
128
- class PublishResponse; end
129
-
130
- # Request for the `ListTopics` method.
131
- # @!attribute [rw] project
132
- # @return [String]
133
- # The name of the project in which to list topics.
134
- # Format is `projects/{project-id}`.
135
- # @!attribute [rw] page_size
136
- # @return [Integer]
137
- # Maximum number of topics to return.
138
- # @!attribute [rw] page_token
139
- # @return [String]
140
- # The value returned by the last `ListTopicsResponse`; indicates that this is
141
- # a continuation of a prior `ListTopics` call, and that the system should
142
- # return the next page of data.
143
- class ListTopicsRequest; end
144
-
145
- # Response for the `ListTopics` method.
146
- # @!attribute [rw] topics
147
- # @return [Array<Google::Cloud::PubSub::V1::Topic>]
148
- # The resulting topics.
149
- # @!attribute [rw] next_page_token
150
- # @return [String]
151
- # If not empty, indicates that there may be more topics that match the
152
- # request; this value should be passed in a new `ListTopicsRequest`.
153
- class ListTopicsResponse; end
154
-
155
- # Request for the `ListTopicSubscriptions` method.
156
- # @!attribute [rw] topic
157
- # @return [String]
158
- # The name of the topic that subscriptions are attached to.
159
- # Format is `projects/{project}/topics/{topic}`.
160
- # @!attribute [rw] page_size
161
- # @return [Integer]
162
- # Maximum number of subscription names to return.
163
- # @!attribute [rw] page_token
164
- # @return [String]
165
- # The value returned by the last `ListTopicSubscriptionsResponse`; indicates
166
- # that this is a continuation of a prior `ListTopicSubscriptions` call, and
167
- # that the system should return the next page of data.
168
- class ListTopicSubscriptionsRequest; end
169
-
170
- # Response for the `ListTopicSubscriptions` method.
171
- # @!attribute [rw] subscriptions
172
- # @return [Array<String>]
173
- # The names of the subscriptions that match the request.
174
- # @!attribute [rw] next_page_token
175
- # @return [String]
176
- # If not empty, indicates that there may be more subscriptions that match
177
- # the request; this value should be passed in a new
178
- # `ListTopicSubscriptionsRequest` to get more subscriptions.
179
- class ListTopicSubscriptionsResponse; end
180
-
181
- # Request for the `ListTopicSnapshots` method.
182
- # @!attribute [rw] topic
183
- # @return [String]
184
- # The name of the topic that snapshots are attached to.
185
- # Format is `projects/{project}/topics/{topic}`.
186
- # @!attribute [rw] page_size
187
- # @return [Integer]
188
- # Maximum number of snapshot names to return.
189
- # @!attribute [rw] page_token
190
- # @return [String]
191
- # The value returned by the last `ListTopicSnapshotsResponse`; indicates
192
- # that this is a continuation of a prior `ListTopicSnapshots` call, and
193
- # that the system should return the next page of data.
194
- class ListTopicSnapshotsRequest; end
195
-
196
- # Response for the `ListTopicSnapshots` method.
197
- # @!attribute [rw] snapshots
198
- # @return [Array<String>]
199
- # The names of the snapshots that match the request.
200
- # @!attribute [rw] next_page_token
201
- # @return [String]
202
- # If not empty, indicates that there may be more snapshots that match
203
- # the request; this value should be passed in a new
204
- # `ListTopicSnapshotsRequest` to get more snapshots.
205
- class ListTopicSnapshotsResponse; end
206
-
207
- # Request for the `DeleteTopic` method.
208
- # @!attribute [rw] topic
209
- # @return [String]
210
- # Name of the topic to delete.
211
- # Format is `projects/{project}/topics/{topic}`.
212
- class DeleteTopicRequest; end
213
-
214
- # A subscription resource.
215
- # @!attribute [rw] name
216
- # @return [String]
217
- # The name of the subscription. It must have the format
218
- # `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
219
- # start with a letter, and contain only letters (`[A-Za-z]`), numbers
220
- # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
221
- # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
222
- # in length, and it must not start with `"goog"`
223
- # @!attribute [rw] topic
224
- # @return [String]
225
- # The name of the topic from which this subscription is receiving messages.
226
- # Format is `projects/{project}/topics/{topic}`.
227
- # The value of this field will be `_deleted-topic_` if the topic has been
228
- # deleted.
229
- # @!attribute [rw] push_config
230
- # @return [Google::Cloud::PubSub::V1::PushConfig]
231
- # If push delivery is used with this subscription, this field is
232
- # used to configure it. An empty `pushConfig` signifies that the subscriber
233
- # will pull and ack messages using API methods.
234
- # @!attribute [rw] ack_deadline_seconds
235
- # @return [Integer]
236
- # The approximate amount of time (on a best-effort basis) Pub/Sub waits for
237
- # the subscriber to acknowledge receipt before resending the message. In the
238
- # interval after the message is delivered and before it is acknowledged, it
239
- # is considered to be <i>outstanding</i>. During that time period, the
240
- # message will not be redelivered (on a best-effort basis).
241
- #
242
- # For pull subscriptions, this value is used as the initial value for the ack
243
- # deadline. To override this value for a given message, call
244
- # `ModifyAckDeadline` with the corresponding `ack_id` if using
245
- # non-streaming pull or send the `ack_id` in a
246
- # `StreamingModifyAckDeadlineRequest` if using streaming pull.
247
- # The minimum custom deadline you can specify is 10 seconds.
248
- # The maximum custom deadline you can specify is 600 seconds (10 minutes).
249
- # If this parameter is 0, a default value of 10 seconds is used.
250
- #
251
- # For push delivery, this value is also used to set the request timeout for
252
- # the call to the push endpoint.
253
- #
254
- # If the subscriber never acknowledges the message, the Pub/Sub
255
- # system will eventually redeliver the message.
256
- # @!attribute [rw] retain_acked_messages
257
- # @return [true, false]
258
- # Indicates whether to retain acknowledged messages. If true, then
259
- # messages are not expunged from the subscription's backlog, even if they are
260
- # acknowledged, until they fall out of the `message_retention_duration`
261
- # window. This must be true if you would like to
262
- # <a
263
- # href="https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time">
264
- # Seek to a timestamp</a>.
265
- # @!attribute [rw] message_retention_duration
266
- # @return [Google::Protobuf::Duration]
267
- # How long to retain unacknowledged messages in the subscription's backlog,
268
- # from the moment a message is published.
269
- # If `retain_acked_messages` is true, then this also configures the retention
270
- # of acknowledged messages, and thus configures how far back in time a `Seek`
271
- # can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
272
- # minutes.
273
- # @!attribute [rw] labels
274
- # @return [Hash{String => String}]
275
- # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
276
- # managing labels</a>.
277
- # @!attribute [rw] enable_message_ordering
278
- # @return [true, false]
279
- # If true, messages published with the same `ordering_key` in `PubsubMessage`
280
- # will be delivered to the subscribers in the order in which they
281
- # are received by the Pub/Sub system. Otherwise, they may be delivered in
282
- # any order.
283
- # <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
284
- # API might be changed in backward-incompatible ways and is not recommended
285
- # for production use. It is not subject to any SLA or deprecation policy.
286
- # @!attribute [rw] expiration_policy
287
- # @return [Google::Cloud::PubSub::V1::ExpirationPolicy]
288
- # A policy that specifies the conditions for this subscription's expiration.
289
- # A subscription is considered active as long as any connected subscriber is
290
- # successfully consuming messages from the subscription or is issuing
291
- # operations on the subscription. If `expiration_policy` is not set, a
292
- # *default policy* with `ttl` of 31 days will be used. The minimum allowed
293
- # value for `expiration_policy.ttl` is 1 day.
294
- # @!attribute [rw] dead_letter_policy
295
- # @return [Google::Cloud::PubSub::V1::DeadLetterPolicy]
296
- # A policy that specifies the conditions for dead lettering messages in
297
- # this subscription. If dead_letter_policy is not set, dead lettering
298
- # is disabled.
299
- #
300
- # The Cloud Pub/Sub service account associated with this subscriptions's
301
- # parent project (i.e.,
302
- # service-\\{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
303
- # permission to Acknowledge() messages on this subscription.
304
- # <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
305
- # API might be changed in backward-incompatible ways and is not recommended
306
- # for production use. It is not subject to any SLA or deprecation policy.
307
- class Subscription; end
308
-
309
- # Dead lettering is done on a best effort basis. The same message might be
310
- # dead lettered multiple times.
311
- #
312
- # If validation on any of the fields fails at subscription creation/updation,
313
- # the create/update subscription request will fail.
314
- # @!attribute [rw] dead_letter_topic
315
- # @return [String]
316
- # The name of the topic to which dead letter messages should be published.
317
- # Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
318
- # account associated with the enclosing subscription's parent project (i.e.,
319
- # service-\\{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
320
- # permission to Publish() to this topic.
321
- #
322
- # The operation will fail if the topic does not exist.
323
- # Users should ensure that there is a subscription attached to this topic
324
- # since messages published to a topic with no subscriptions are lost.
325
- # @!attribute [rw] max_delivery_attempts
326
- # @return [Integer]
327
- # The maximum number of delivery attempts for any message. The value must be
328
- # between 5 and 100.
329
- #
330
- # The number of delivery attempts is defined as 1 + (the sum of number of
331
- # NACKs and number of times the acknowledgement deadline has been exceeded
332
- # for the message).
333
- #
334
- # A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
335
- # client libraries may automatically extend ack_deadlines.
336
- #
337
- # This field will be honored on a best effort basis.
338
- #
339
- # If this parameter is 0, a default value of 5 is used.
340
- class DeadLetterPolicy; end
341
-
342
- # A policy that specifies the conditions for resource expiration (i.e.,
343
- # automatic resource deletion).
344
- # @!attribute [rw] ttl
345
- # @return [Google::Protobuf::Duration]
346
- # Specifies the "time-to-live" duration for an associated resource. The
347
- # resource expires if it is not active for a period of `ttl`. The definition
348
- # of "activity" depends on the type of the associated resource. The minimum
349
- # and maximum allowed values for `ttl` depend on the type of the associated
350
- # resource, as well. If `ttl` is not set, the associated resource never
351
- # expires.
352
- class ExpirationPolicy; end
353
-
354
- # Configuration for a push delivery endpoint.
355
- # @!attribute [rw] push_endpoint
356
- # @return [String]
357
- # A URL locating the endpoint to which messages should be pushed.
358
- # For example, a Webhook endpoint might use "https://example.com/push".
359
- # @!attribute [rw] attributes
360
- # @return [Hash{String => String}]
361
- # Endpoint configuration attributes that can be used to control different
362
- # aspects of the message delivery.
363
- #
364
- # The only currently supported attribute is `x-goog-version`, which you can
365
- # use to change the format of the pushed message. This attribute
366
- # indicates the version of the data expected by the endpoint. This
367
- # controls the shape of the pushed message (i.e., its fields and metadata).
368
- #
369
- # If not present during the `CreateSubscription` call, it will default to
370
- # the version of the Pub/Sub API used to make such call. If not present in a
371
- # `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
372
- # calls will always return a valid version, even if the subscription was
373
- # created without this attribute.
374
- #
375
- # The only supported values for the `x-goog-version` attribute are:
376
- #
377
- # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
378
- # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
379
- #
380
- # For example:
381
- # <pre><code>attributes { "x-goog-version": "v1" } </code></pre>
382
- # @!attribute [rw] oidc_token
383
- # @return [Google::Cloud::PubSub::V1::PushConfig::OidcToken]
384
- # If specified, Pub/Sub will generate and attach an OIDC JWT token as an
385
- # `Authorization` header in the HTTP request for every pushed message.
386
- class PushConfig
387
- # Contains information needed for generating an
388
- # [OpenID Connect
389
- # token](https://developers.google.com/identity/protocols/OpenIDConnect).
390
- # @!attribute [rw] service_account_email
391
- # @return [String]
392
- # [Service account
393
- # email](https://cloud.google.com/iam/docs/service-accounts)
394
- # to be used for generating the OIDC token. The caller (for
395
- # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must
396
- # have the iam.serviceAccounts.actAs permission for the service account.
397
- # @!attribute [rw] audience
398
- # @return [String]
399
- # Audience to be used when generating OIDC token. The audience claim
400
- # identifies the recipients that the JWT is intended for. The audience
401
- # value is a single case-sensitive string. Having multiple values (array)
402
- # for the audience field is not supported. More info about the OIDC JWT
403
- # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
404
- # Note: if not specified, the Push endpoint URL will be used.
405
- class OidcToken; end
406
- end
407
-
408
- # A message and its corresponding acknowledgment ID.
409
- # @!attribute [rw] ack_id
410
- # @return [String]
411
- # This ID can be used to acknowledge the received message.
412
- # @!attribute [rw] message
413
- # @return [Google::Cloud::PubSub::V1::PubsubMessage]
414
- # The message.
415
- # @!attribute [rw] delivery_attempt
416
- # @return [Integer]
417
- # Delivery attempt counter is 1 + (the sum of number of NACKs and number of
418
- # ack_deadline exceeds) for this message.
419
- #
420
- # A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline
421
- # exceeds event is whenever a message is not acknowledged within
422
- # ack_deadline. Note that ack_deadline is initially
423
- # Subscription.ackDeadlineSeconds, but may get extended automatically by
424
- # the client library.
425
- #
426
- # The first delivery of a given message will have this value as 1. The value
427
- # is calculated at best effort and is approximate.
428
- #
429
- # If a DeadLetterPolicy is not set on the subscription, this will be 0.
430
- # <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
431
- # API might be changed in backward-incompatible ways and is not recommended
432
- # for production use. It is not subject to any SLA or deprecation policy.
433
- class ReceivedMessage; end
434
-
435
- # Request for the GetSubscription method.
436
- # @!attribute [rw] subscription
437
- # @return [String]
438
- # The name of the subscription to get.
439
- # Format is `projects/{project}/subscriptions/{sub}`.
440
- class GetSubscriptionRequest; end
441
-
442
- # Request for the UpdateSubscription method.
443
- # @!attribute [rw] subscription
444
- # @return [Google::Cloud::PubSub::V1::Subscription]
445
- # The updated subscription object.
446
- # @!attribute [rw] update_mask
447
- # @return [Google::Protobuf::FieldMask]
448
- # Indicates which fields in the provided subscription to update.
449
- # Must be specified and non-empty.
450
- class UpdateSubscriptionRequest; end
451
-
452
- # Request for the `ListSubscriptions` method.
453
- # @!attribute [rw] project
454
- # @return [String]
455
- # The name of the project in which to list subscriptions.
456
- # Format is `projects/{project-id}`.
457
- # @!attribute [rw] page_size
458
- # @return [Integer]
459
- # Maximum number of subscriptions to return.
460
- # @!attribute [rw] page_token
461
- # @return [String]
462
- # The value returned by the last `ListSubscriptionsResponse`; indicates that
463
- # this is a continuation of a prior `ListSubscriptions` call, and that the
464
- # system should return the next page of data.
465
- class ListSubscriptionsRequest; end
466
-
467
- # Response for the `ListSubscriptions` method.
468
- # @!attribute [rw] subscriptions
469
- # @return [Array<Google::Cloud::PubSub::V1::Subscription>]
470
- # The subscriptions that match the request.
471
- # @!attribute [rw] next_page_token
472
- # @return [String]
473
- # If not empty, indicates that there may be more subscriptions that match
474
- # the request; this value should be passed in a new
475
- # `ListSubscriptionsRequest` to get more subscriptions.
476
- class ListSubscriptionsResponse; end
477
-
478
- # Request for the DeleteSubscription method.
479
- # @!attribute [rw] subscription
480
- # @return [String]
481
- # The subscription to delete.
482
- # Format is `projects/{project}/subscriptions/{sub}`.
483
- class DeleteSubscriptionRequest; end
484
-
485
- # Request for the ModifyPushConfig method.
486
- # @!attribute [rw] subscription
487
- # @return [String]
488
- # The name of the subscription.
489
- # Format is `projects/{project}/subscriptions/{sub}`.
490
- # @!attribute [rw] push_config
491
- # @return [Google::Cloud::PubSub::V1::PushConfig]
492
- # The push configuration for future deliveries.
493
- #
494
- # An empty `pushConfig` indicates that the Pub/Sub system should
495
- # stop pushing messages from the given subscription and allow
496
- # messages to be pulled and acknowledged - effectively pausing
497
- # the subscription if `Pull` or `StreamingPull` is not called.
498
- class ModifyPushConfigRequest; end
499
-
500
- # Request for the `Pull` method.
501
- # @!attribute [rw] subscription
502
- # @return [String]
503
- # The subscription from which messages should be pulled.
504
- # Format is `projects/{project}/subscriptions/{sub}`.
505
- # @!attribute [rw] return_immediately
506
- # @return [true, false]
507
- # If this field set to true, the system will respond immediately even if
508
- # it there are no messages available to return in the `Pull` response.
509
- # Otherwise, the system may wait (for a bounded amount of time) until at
510
- # least one message is available, rather than returning no messages.
511
- # @!attribute [rw] max_messages
512
- # @return [Integer]
513
- # The maximum number of messages to return for this request. Must be a
514
- # positive integer. The Pub/Sub system may return fewer than the number
515
- # specified.
516
- class PullRequest; end
517
-
518
- # Response for the `Pull` method.
519
- # @!attribute [rw] received_messages
520
- # @return [Array<Google::Cloud::PubSub::V1::ReceivedMessage>]
521
- # Received Pub/Sub messages. The list will be empty if there are no more
522
- # messages available in the backlog. For JSON, the response can be entirely
523
- # empty. The Pub/Sub system may return fewer than the `maxMessages` requested
524
- # even if there are more messages available in the backlog.
525
- class PullResponse; end
526
-
527
- # Request for the ModifyAckDeadline method.
528
- # @!attribute [rw] subscription
529
- # @return [String]
530
- # The name of the subscription.
531
- # Format is `projects/{project}/subscriptions/{sub}`.
532
- # @!attribute [rw] ack_ids
533
- # @return [Array<String>]
534
- # List of acknowledgment IDs.
535
- # @!attribute [rw] ack_deadline_seconds
536
- # @return [Integer]
537
- # The new ack deadline with respect to the time this request was sent to
538
- # the Pub/Sub system. For example, if the value is 10, the new
539
- # ack deadline will expire 10 seconds after the `ModifyAckDeadline` call
540
- # was made. Specifying zero might immediately make the message available for
541
- # delivery to another subscriber client. This typically results in an
542
- # increase in the rate of message redeliveries (that is, duplicates).
543
- # The minimum deadline you can specify is 0 seconds.
544
- # The maximum deadline you can specify is 600 seconds (10 minutes).
545
- class ModifyAckDeadlineRequest; end
546
-
547
- # Request for the Acknowledge method.
548
- # @!attribute [rw] subscription
549
- # @return [String]
550
- # The subscription whose message is being acknowledged.
551
- # Format is `projects/{project}/subscriptions/{sub}`.
552
- # @!attribute [rw] ack_ids
553
- # @return [Array<String>]
554
- # The acknowledgment ID for the messages being acknowledged that was returned
555
- # by the Pub/Sub system in the `Pull` response. Must not be empty.
556
- class AcknowledgeRequest; end
557
-
558
- # Request for the `StreamingPull` streaming RPC method. This request is used to
559
- # establish the initial stream as well as to stream acknowledgements and ack
560
- # deadline modifications from the client to the server.
561
- # @!attribute [rw] subscription
562
- # @return [String]
563
- # The subscription for which to initialize the new stream. This must be
564
- # provided in the first request on the stream, and must not be set in
565
- # subsequent requests from client to server.
566
- # Format is `projects/{project}/subscriptions/{sub}`.
567
- # @!attribute [rw] ack_ids
568
- # @return [Array<String>]
569
- # List of acknowledgement IDs for acknowledging previously received messages
570
- # (received on this stream or a different stream). If an ack ID has expired,
571
- # the corresponding message may be redelivered later. Acknowledging a message
572
- # more than once will not result in an error. If the acknowledgement ID is
573
- # malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
574
- # @!attribute [rw] modify_deadline_seconds
575
- # @return [Array<Integer>]
576
- # The list of new ack deadlines for the IDs listed in
577
- # `modify_deadline_ack_ids`. The size of this list must be the same as the
578
- # size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
579
- # with `INVALID_ARGUMENT`. Each element in this list is applied to the
580
- # element in the same position in `modify_deadline_ack_ids`. The new ack
581
- # deadline is with respect to the time this request was sent to the Pub/Sub
582
- # system. Must be >= 0. For example, if the value is 10, the new ack deadline
583
- # will expire 10 seconds after this request is received. If the value is 0,
584
- # the message is immediately made available for another streaming or
585
- # non-streaming pull request. If the value is < 0 (an error), the stream will
586
- # be aborted with status `INVALID_ARGUMENT`.
587
- # @!attribute [rw] modify_deadline_ack_ids
588
- # @return [Array<String>]
589
- # List of acknowledgement IDs whose deadline will be modified based on the
590
- # corresponding element in `modify_deadline_seconds`. This field can be used
591
- # to indicate that more time is needed to process a message by the
592
- # subscriber, or to make the message available for redelivery if the
593
- # processing was interrupted.
594
- # @!attribute [rw] stream_ack_deadline_seconds
595
- # @return [Integer]
596
- # The ack deadline to use for the stream. This must be provided in the
597
- # first request on the stream, but it can also be updated on subsequent
598
- # requests from client to server. The minimum deadline you can specify is 10
599
- # seconds. The maximum deadline you can specify is 600 seconds (10 minutes).
600
- class StreamingPullRequest; end
601
-
602
- # Response for the `StreamingPull` method. This response is used to stream
603
- # messages from the server to the client.
604
- # @!attribute [rw] received_messages
605
- # @return [Array<Google::Cloud::PubSub::V1::ReceivedMessage>]
606
- # Received Pub/Sub messages. This will not be empty.
607
- class StreamingPullResponse; end
608
-
609
- # Request for the `CreateSnapshot` method.
610
- # @!attribute [rw] name
611
- # @return [String]
612
- # Optional user-provided name for this snapshot.
613
- # If the name is not provided in the request, the server will assign a random
614
- # name for this snapshot on the same project as the subscription.
615
- # Note that for REST API requests, you must specify a name. See the
616
- # <a href="https://cloud.google.com/pubsub/docs/admin#resource_names">
617
- # resource name rules</a>.
618
- # Format is `projects/{project}/snapshots/{snap}`.
619
- # @!attribute [rw] subscription
620
- # @return [String]
621
- # The subscription whose backlog the snapshot retains.
622
- # Specifically, the created snapshot is guaranteed to retain:
623
- # (a) The existing backlog on the subscription. More precisely, this is
624
- # defined as the messages in the subscription's backlog that are
625
- # unacknowledged upon the successful completion of the
626
- # `CreateSnapshot` request; as well as:
627
- # (b) Any messages published to the subscription's topic following the
628
- # successful completion of the CreateSnapshot request.
629
- # Format is `projects/{project}/subscriptions/{sub}`.
630
- # @!attribute [rw] labels
631
- # @return [Hash{String => String}]
632
- # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
633
- # managing labels</a>.
634
- class CreateSnapshotRequest; end
635
-
636
- # Request for the UpdateSnapshot method.
637
- # @!attribute [rw] snapshot
638
- # @return [Google::Cloud::PubSub::V1::Snapshot]
639
- # The updated snapshot object.
640
- # @!attribute [rw] update_mask
641
- # @return [Google::Protobuf::FieldMask]
642
- # Indicates which fields in the provided snapshot to update.
643
- # Must be specified and non-empty.
644
- class UpdateSnapshotRequest; end
645
-
646
- # A snapshot resource. Snapshots are used in
647
- # <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a>
648
- # operations, which allow
649
- # you to manage message acknowledgments in bulk. That is, you can set the
650
- # acknowledgment state of messages in an existing subscription to the state
651
- # captured by a snapshot.
652
- # @!attribute [rw] name
653
- # @return [String]
654
- # The name of the snapshot.
655
- # @!attribute [rw] topic
656
- # @return [String]
657
- # The name of the topic from which this snapshot is retaining messages.
658
- # @!attribute [rw] expire_time
659
- # @return [Google::Protobuf::Timestamp]
660
- # The snapshot is guaranteed to exist up until this time.
661
- # A newly-created snapshot expires no later than 7 days from the time of its
662
- # creation. Its exact lifetime is determined at creation by the existing
663
- # backlog in the source subscription. Specifically, the lifetime of the
664
- # snapshot is `7 days - (age of oldest unacked message in the subscription)`.
665
- # For example, consider a subscription whose oldest unacked message is 3 days
666
- # old. If a snapshot is created from this subscription, the snapshot -- which
667
- # will always capture this 3-day-old backlog as long as the snapshot
668
- # exists -- will expire in 4 days. The service will refuse to create a
669
- # snapshot that would expire in less than 1 hour after creation.
670
- # @!attribute [rw] labels
671
- # @return [Hash{String => String}]
672
- # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
673
- # managing labels</a>.
674
- class Snapshot; end
675
-
676
- # Request for the GetSnapshot method.
677
- # @!attribute [rw] snapshot
678
- # @return [String]
679
- # The name of the snapshot to get.
680
- # Format is `projects/{project}/snapshots/{snap}`.
681
- class GetSnapshotRequest; end
682
-
683
- # Request for the `ListSnapshots` method.
684
- # @!attribute [rw] project
685
- # @return [String]
686
- # The name of the project in which to list snapshots.
687
- # Format is `projects/{project-id}`.
688
- # @!attribute [rw] page_size
689
- # @return [Integer]
690
- # Maximum number of snapshots to return.
691
- # @!attribute [rw] page_token
692
- # @return [String]
693
- # The value returned by the last `ListSnapshotsResponse`; indicates that this
694
- # is a continuation of a prior `ListSnapshots` call, and that the system
695
- # should return the next page of data.
696
- class ListSnapshotsRequest; end
697
-
698
- # Response for the `ListSnapshots` method.
699
- # @!attribute [rw] snapshots
700
- # @return [Array<Google::Cloud::PubSub::V1::Snapshot>]
701
- # The resulting snapshots.
702
- # @!attribute [rw] next_page_token
703
- # @return [String]
704
- # If not empty, indicates that there may be more snapshot that match the
705
- # request; this value should be passed in a new `ListSnapshotsRequest`.
706
- class ListSnapshotsResponse; end
707
-
708
- # Request for the `DeleteSnapshot` method.
709
- # @!attribute [rw] snapshot
710
- # @return [String]
711
- # The name of the snapshot to delete.
712
- # Format is `projects/{project}/snapshots/{snap}`.
713
- class DeleteSnapshotRequest; end
714
-
715
- # Request for the `Seek` method.
716
- # @!attribute [rw] subscription
717
- # @return [String]
718
- # The subscription to affect.
719
- # @!attribute [rw] time
720
- # @return [Google::Protobuf::Timestamp]
721
- # The time to seek to.
722
- # Messages retained in the subscription that were published before this
723
- # time are marked as acknowledged, and messages retained in the
724
- # subscription that were published after this time are marked as
725
- # unacknowledged. Note that this operation affects only those messages
726
- # retained in the subscription (configured by the combination of
727
- # `message_retention_duration` and `retain_acked_messages`). For example,
728
- # if `time` corresponds to a point before the message retention
729
- # window (or to a point before the system's notion of the subscription
730
- # creation time), only retained messages will be marked as unacknowledged,
731
- # and already-expunged messages will not be restored.
732
- # @!attribute [rw] snapshot
733
- # @return [String]
734
- # The snapshot to seek to. The snapshot's topic must be the same as that of
735
- # the provided subscription.
736
- # Format is `projects/{project}/snapshots/{snap}`.
737
- class SeekRequest; end
738
-
739
- # Response for the `Seek` method (this response is empty).
740
- class SeekResponse; end
741
- end
742
- end
743
- end
744
- end