google-cloud-pubsub 1.7.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +2 -1
  3. data/CHANGELOG.md +47 -0
  4. data/TROUBLESHOOTING.md +2 -8
  5. data/lib/google-cloud-pubsub.rb +13 -13
  6. data/lib/google/cloud/pubsub.rb +15 -18
  7. data/lib/google/cloud/pubsub/async_publisher.rb +1 -2
  8. data/lib/google/cloud/pubsub/credentials.rb +2 -2
  9. data/lib/google/cloud/pubsub/service.rb +110 -255
  10. data/lib/google/cloud/pubsub/subscriber/stream.rb +3 -2
  11. data/lib/google/cloud/pubsub/subscription.rb +70 -3
  12. data/lib/google/cloud/pubsub/topic.rb +7 -3
  13. data/lib/google/cloud/pubsub/version.rb +1 -1
  14. metadata +8 -79
  15. data/lib/google/cloud/pubsub/v1.rb +0 -17
  16. data/lib/google/cloud/pubsub/v1/credentials.rb +0 -41
  17. data/lib/google/cloud/pubsub/v1/doc/google/iam/v1/iam_policy.rb +0 -21
  18. data/lib/google/cloud/pubsub/v1/doc/google/iam/v1/options.rb +0 -21
  19. data/lib/google/cloud/pubsub/v1/doc/google/iam/v1/policy.rb +0 -21
  20. data/lib/google/cloud/pubsub/v1/doc/google/protobuf/duration.rb +0 -91
  21. data/lib/google/cloud/pubsub/v1/doc/google/protobuf/empty.rb +0 -29
  22. data/lib/google/cloud/pubsub/v1/doc/google/protobuf/field_mask.rb +0 -222
  23. data/lib/google/cloud/pubsub/v1/doc/google/protobuf/timestamp.rb +0 -113
  24. data/lib/google/cloud/pubsub/v1/doc/google/pubsub/v1/pubsub.rb +0 -796
  25. data/lib/google/cloud/pubsub/v1/doc/google/type/expr.rb +0 -19
  26. data/lib/google/cloud/pubsub/v1/publisher_client.rb +0 -869
  27. data/lib/google/cloud/pubsub/v1/publisher_client_config.json +0 -114
  28. data/lib/google/cloud/pubsub/v1/subscriber_client.rb +0 -1463
  29. data/lib/google/cloud/pubsub/v1/subscriber_client_config.json +0 -153
  30. data/lib/google/pubsub/v1/pubsub_pb.rb +0 -259
  31. data/lib/google/pubsub/v1/pubsub_services_pb.rb +0 -210
@@ -1,29 +0,0 @@
1
- # Copyright 2020 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 Protobuf
18
- # A generic empty message that you can re-use to avoid defining duplicated
19
- # empty messages in your APIs. A typical example is to use it as the request
20
- # or the response type of an API method. For instance:
21
- #
22
- # service Foo {
23
- # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
24
- # }
25
- #
26
- # The JSON representation for `Empty` is empty JSON object `{}`.
27
- class Empty; end
28
- end
29
- end
@@ -1,222 +0,0 @@
1
- # Copyright 2020 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 Protobuf
18
- # `FieldMask` represents a set of symbolic field paths, for example:
19
- #
20
- # paths: "f.a"
21
- # paths: "f.b.d"
22
- #
23
- # Here `f` represents a field in some root message, `a` and `b`
24
- # fields in the message found in `f`, and `d` a field found in the
25
- # message in `f.b`.
26
- #
27
- # Field masks are used to specify a subset of fields that should be
28
- # returned by a get operation or modified by an update operation.
29
- # Field masks also have a custom JSON encoding (see below).
30
- #
31
- # = Field Masks in Projections
32
- #
33
- # When used in the context of a projection, a response message or
34
- # sub-message is filtered by the API to only contain those fields as
35
- # specified in the mask. For example, if the mask in the previous
36
- # example is applied to a response message as follows:
37
- #
38
- # f {
39
- # a : 22
40
- # b {
41
- # d : 1
42
- # x : 2
43
- # }
44
- # y : 13
45
- # }
46
- # z: 8
47
- #
48
- # The result will not contain specific values for fields x,y and z
49
- # (their value will be set to the default, and omitted in proto text
50
- # output):
51
- #
52
- #
53
- # f {
54
- # a : 22
55
- # b {
56
- # d : 1
57
- # }
58
- # }
59
- #
60
- # A repeated field is not allowed except at the last position of a
61
- # paths string.
62
- #
63
- # If a FieldMask object is not present in a get operation, the
64
- # operation applies to all fields (as if a FieldMask of all fields
65
- # had been specified).
66
- #
67
- # Note that a field mask does not necessarily apply to the
68
- # top-level response message. In case of a REST get operation, the
69
- # field mask applies directly to the response, but in case of a REST
70
- # list operation, the mask instead applies to each individual message
71
- # in the returned resource list. In case of a REST custom method,
72
- # other definitions may be used. Where the mask applies will be
73
- # clearly documented together with its declaration in the API. In
74
- # any case, the effect on the returned resource/resources is required
75
- # behavior for APIs.
76
- #
77
- # = Field Masks in Update Operations
78
- #
79
- # A field mask in update operations specifies which fields of the
80
- # targeted resource are going to be updated. The API is required
81
- # to only change the values of the fields as specified in the mask
82
- # and leave the others untouched. If a resource is passed in to
83
- # describe the updated values, the API ignores the values of all
84
- # fields not covered by the mask.
85
- #
86
- # If a repeated field is specified for an update operation, new values will
87
- # be appended to the existing repeated field in the target resource. Note that
88
- # a repeated field is only allowed in the last position of a `paths` string.
89
- #
90
- # If a sub-message is specified in the last position of the field mask for an
91
- # update operation, then new value will be merged into the existing sub-message
92
- # in the target resource.
93
- #
94
- # For example, given the target message:
95
- #
96
- # f {
97
- # b {
98
- # d: 1
99
- # x: 2
100
- # }
101
- # c: [1]
102
- # }
103
- #
104
- # And an update message:
105
- #
106
- # f {
107
- # b {
108
- # d: 10
109
- # }
110
- # c: [2]
111
- # }
112
- #
113
- # then if the field mask is:
114
- #
115
- # paths: ["f.b", "f.c"]
116
- #
117
- # then the result will be:
118
- #
119
- # f {
120
- # b {
121
- # d: 10
122
- # x: 2
123
- # }
124
- # c: [1, 2]
125
- # }
126
- #
127
- # An implementation may provide options to override this default behavior for
128
- # repeated and message fields.
129
- #
130
- # In order to reset a field's value to the default, the field must
131
- # be in the mask and set to the default value in the provided resource.
132
- # Hence, in order to reset all fields of a resource, provide a default
133
- # instance of the resource and set all fields in the mask, or do
134
- # not provide a mask as described below.
135
- #
136
- # If a field mask is not present on update, the operation applies to
137
- # all fields (as if a field mask of all fields has been specified).
138
- # Note that in the presence of schema evolution, this may mean that
139
- # fields the client does not know and has therefore not filled into
140
- # the request will be reset to their default. If this is unwanted
141
- # behavior, a specific service may require a client to always specify
142
- # a field mask, producing an error if not.
143
- #
144
- # As with get operations, the location of the resource which
145
- # describes the updated values in the request message depends on the
146
- # operation kind. In any case, the effect of the field mask is
147
- # required to be honored by the API.
148
- #
149
- # == Considerations for HTTP REST
150
- #
151
- # The HTTP kind of an update operation which uses a field mask must
152
- # be set to PATCH instead of PUT in order to satisfy HTTP semantics
153
- # (PUT must only be used for full updates).
154
- #
155
- # = JSON Encoding of Field Masks
156
- #
157
- # In JSON, a field mask is encoded as a single string where paths are
158
- # separated by a comma. Fields name in each path are converted
159
- # to/from lower-camel naming conventions.
160
- #
161
- # As an example, consider the following message declarations:
162
- #
163
- # message Profile {
164
- # User user = 1;
165
- # Photo photo = 2;
166
- # }
167
- # message User {
168
- # string display_name = 1;
169
- # string address = 2;
170
- # }
171
- #
172
- # In proto a field mask for `Profile` may look as such:
173
- #
174
- # mask {
175
- # paths: "user.display_name"
176
- # paths: "photo"
177
- # }
178
- #
179
- # In JSON, the same mask is represented as below:
180
- #
181
- # {
182
- # mask: "user.displayName,photo"
183
- # }
184
- #
185
- # = Field Masks and Oneof Fields
186
- #
187
- # Field masks treat fields in oneofs just as regular fields. Consider the
188
- # following message:
189
- #
190
- # message SampleMessage {
191
- # oneof test_oneof {
192
- # string name = 4;
193
- # SubMessage sub_message = 9;
194
- # }
195
- # }
196
- #
197
- # The field mask can be:
198
- #
199
- # mask {
200
- # paths: "name"
201
- # }
202
- #
203
- # Or:
204
- #
205
- # mask {
206
- # paths: "sub_message"
207
- # }
208
- #
209
- # Note that oneof type names ("test_oneof" in this case) cannot be used in
210
- # paths.
211
- #
212
- # == Field Mask Verification
213
- #
214
- # The implementation of any API method which has a FieldMask type field in the
215
- # request should verify the included field paths, and return an
216
- # `INVALID_ARGUMENT` error if any path is duplicated or unmappable.
217
- # @!attribute [rw] paths
218
- # @return [Array<String>]
219
- # The set of field mask paths.
220
- class FieldMask; end
221
- end
222
- end
@@ -1,113 +0,0 @@
1
- # Copyright 2020 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 Protobuf
18
- # A Timestamp represents a point in time independent of any time zone or local
19
- # calendar, encoded as a count of seconds and fractions of seconds at
20
- # nanosecond resolution. The count is relative to an epoch at UTC midnight on
21
- # January 1, 1970, in the proleptic Gregorian calendar which extends the
22
- # Gregorian calendar backwards to year one.
23
- #
24
- # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
25
- # second table is needed for interpretation, using a [24-hour linear
26
- # smear](https://developers.google.com/time/smear).
27
- #
28
- # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
29
- # restricting to that range, we ensure that we can convert to and from [RFC
30
- # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
31
- #
32
- # = Examples
33
- #
34
- # Example 1: Compute Timestamp from POSIX `time()`.
35
- #
36
- # Timestamp timestamp;
37
- # timestamp.set_seconds(time(NULL));
38
- # timestamp.set_nanos(0);
39
- #
40
- # Example 2: Compute Timestamp from POSIX `gettimeofday()`.
41
- #
42
- # struct timeval tv;
43
- # gettimeofday(&tv, NULL);
44
- #
45
- # Timestamp timestamp;
46
- # timestamp.set_seconds(tv.tv_sec);
47
- # timestamp.set_nanos(tv.tv_usec * 1000);
48
- #
49
- # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
50
- #
51
- # FILETIME ft;
52
- # GetSystemTimeAsFileTime(&ft);
53
- # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
54
- #
55
- # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
56
- # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
57
- # Timestamp timestamp;
58
- # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
59
- # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
60
- #
61
- # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
62
- #
63
- # long millis = System.currentTimeMillis();
64
- #
65
- # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
66
- # .setNanos((int) ((millis % 1000) * 1000000)).build();
67
- #
68
- #
69
- # Example 5: Compute Timestamp from current time in Python.
70
- #
71
- # timestamp = Timestamp()
72
- # timestamp.GetCurrentTime()
73
- #
74
- # = JSON Mapping
75
- #
76
- # In JSON format, the Timestamp type is encoded as a string in the
77
- # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
78
- # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z"
79
- # where \\{year} is always expressed using four digits while \\{month}, \\{day},
80
- # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional
81
- # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
82
- # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
83
- # is required. A proto3 JSON serializer should always use UTC (as indicated by
84
- # "Z") when printing the Timestamp type and a proto3 JSON parser should be
85
- # able to accept both UTC and other timezones (as indicated by an offset).
86
- #
87
- # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
88
- # 01:30 UTC on January 15, 2017.
89
- #
90
- # In JavaScript, one can convert a Date object to this format using the
91
- # standard
92
- # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
93
- # method. In Python, a standard `datetime.datetime` object can be converted
94
- # to this format using
95
- # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
96
- # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
97
- # the Joda Time's [`ISODateTimeFormat.dateTime()`](
98
- # http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
99
- # ) to obtain a formatter capable of generating timestamps in this format.
100
- # @!attribute [rw] seconds
101
- # @return [Integer]
102
- # Represents seconds of UTC time since Unix epoch
103
- # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
104
- # 9999-12-31T23:59:59Z inclusive.
105
- # @!attribute [rw] nanos
106
- # @return [Integer]
107
- # Non-negative fractions of a second at nanosecond resolution. Negative
108
- # second values with fractions must still have non-negative nanos values
109
- # that count forward in time. Must be from 0 to 999,999,999
110
- # inclusive.
111
- class Timestamp; end
112
- end
113
- end
@@ -1,796 +0,0 @@
1
- # Copyright 2020 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
- # Required. 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
- # Attributes for this message. If this field is empty, the message must
70
- # contain non-empty data.
71
- # @!attribute [rw] message_id
72
- # @return [String]
73
- # ID of this message, assigned by the server when the message is published.
74
- # Guaranteed to be unique within the topic. This value may be read by a
75
- # subscriber that receives a `PubsubMessage` via a `Pull` call or a push
76
- # delivery. It must not be populated by the publisher in a `Publish` call.
77
- # @!attribute [rw] publish_time
78
- # @return [Google::Protobuf::Timestamp]
79
- # The time at which the message was published, populated by the server when
80
- # it receives the `Publish` call. It must not be populated by the
81
- # publisher in a `Publish` call.
82
- # @!attribute [rw] ordering_key
83
- # @return [String]
84
- # If non-empty, identifies related messages for which publish order should be
85
- # respected. If a `Subscription` has `enable_message_ordering` set to `true`,
86
- # messages published with the same non-empty `ordering_key` value will be
87
- # delivered to subscribers in the order in which they are received by the
88
- # Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest`
89
- # must specify the same `ordering_key` value.
90
- # <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
91
- # API might be changed in backward-incompatible ways and is not recommended
92
- # for production use. It is not subject to any SLA or deprecation policy.
93
- class PubsubMessage; end
94
-
95
- # Request for the GetTopic method.
96
- # @!attribute [rw] topic
97
- # @return [String]
98
- # Required. The name of the topic to get.
99
- # Format is `projects/{project}/topics/{topic}`.
100
- class GetTopicRequest; end
101
-
102
- # Request for the UpdateTopic method.
103
- # @!attribute [rw] topic
104
- # @return [Google::Cloud::PubSub::V1::Topic]
105
- # Required. The updated topic object.
106
- # @!attribute [rw] update_mask
107
- # @return [Google::Protobuf::FieldMask]
108
- # Required. Indicates which fields in the provided topic to update. Must be
109
- # specified and non-empty. Note that if `update_mask` contains
110
- # "message_storage_policy" but the `message_storage_policy` is not set in
111
- # the `topic` provided above, then the updated value is determined by the
112
- # policy configured at the project or organization level.
113
- class UpdateTopicRequest; end
114
-
115
- # Request for the Publish method.
116
- # @!attribute [rw] topic
117
- # @return [String]
118
- # Required. The messages in the request will be published on this topic.
119
- # Format is `projects/{project}/topics/{topic}`.
120
- # @!attribute [rw] messages
121
- # @return [Array<Google::Cloud::PubSub::V1::PubsubMessage>]
122
- # Required. The messages to publish.
123
- class PublishRequest; end
124
-
125
- # Response for the `Publish` method.
126
- # @!attribute [rw] message_ids
127
- # @return [Array<String>]
128
- # The server-assigned ID of each published message, in the same order as
129
- # the messages in the request. IDs are guaranteed to be unique within
130
- # the topic.
131
- class PublishResponse; end
132
-
133
- # Request for the `ListTopics` method.
134
- # @!attribute [rw] project
135
- # @return [String]
136
- # Required. The name of the project in which to list topics.
137
- # Format is `projects/{project-id}`.
138
- # @!attribute [rw] page_size
139
- # @return [Integer]
140
- # Maximum number of topics to return.
141
- # @!attribute [rw] page_token
142
- # @return [String]
143
- # The value returned by the last `ListTopicsResponse`; indicates that this is
144
- # a continuation of a prior `ListTopics` call, and that the system should
145
- # return the next page of data.
146
- class ListTopicsRequest; end
147
-
148
- # Response for the `ListTopics` method.
149
- # @!attribute [rw] topics
150
- # @return [Array<Google::Cloud::PubSub::V1::Topic>]
151
- # The resulting topics.
152
- # @!attribute [rw] next_page_token
153
- # @return [String]
154
- # If not empty, indicates that there may be more topics that match the
155
- # request; this value should be passed in a new `ListTopicsRequest`.
156
- class ListTopicsResponse; end
157
-
158
- # Request for the `ListTopicSubscriptions` method.
159
- # @!attribute [rw] topic
160
- # @return [String]
161
- # Required. The name of the topic that subscriptions are attached to.
162
- # Format is `projects/{project}/topics/{topic}`.
163
- # @!attribute [rw] page_size
164
- # @return [Integer]
165
- # Maximum number of subscription names to return.
166
- # @!attribute [rw] page_token
167
- # @return [String]
168
- # The value returned by the last `ListTopicSubscriptionsResponse`; indicates
169
- # that this is a continuation of a prior `ListTopicSubscriptions` call, and
170
- # that the system should return the next page of data.
171
- class ListTopicSubscriptionsRequest; end
172
-
173
- # Response for the `ListTopicSubscriptions` method.
174
- # @!attribute [rw] subscriptions
175
- # @return [Array<String>]
176
- # The names of the subscriptions that match the request.
177
- # @!attribute [rw] next_page_token
178
- # @return [String]
179
- # If not empty, indicates that there may be more subscriptions that match
180
- # the request; this value should be passed in a new
181
- # `ListTopicSubscriptionsRequest` to get more subscriptions.
182
- class ListTopicSubscriptionsResponse; end
183
-
184
- # Request for the `ListTopicSnapshots` method.
185
- # @!attribute [rw] topic
186
- # @return [String]
187
- # Required. The name of the topic that snapshots are attached to.
188
- # Format is `projects/{project}/topics/{topic}`.
189
- # @!attribute [rw] page_size
190
- # @return [Integer]
191
- # Maximum number of snapshot names to return.
192
- # @!attribute [rw] page_token
193
- # @return [String]
194
- # The value returned by the last `ListTopicSnapshotsResponse`; indicates
195
- # that this is a continuation of a prior `ListTopicSnapshots` call, and
196
- # that the system should return the next page of data.
197
- class ListTopicSnapshotsRequest; end
198
-
199
- # Response for the `ListTopicSnapshots` method.
200
- # @!attribute [rw] snapshots
201
- # @return [Array<String>]
202
- # The names of the snapshots that match the request.
203
- # @!attribute [rw] next_page_token
204
- # @return [String]
205
- # If not empty, indicates that there may be more snapshots that match
206
- # the request; this value should be passed in a new
207
- # `ListTopicSnapshotsRequest` to get more snapshots.
208
- class ListTopicSnapshotsResponse; end
209
-
210
- # Request for the `DeleteTopic` method.
211
- # @!attribute [rw] topic
212
- # @return [String]
213
- # Required. Name of the topic to delete.
214
- # Format is `projects/{project}/topics/{topic}`.
215
- class DeleteTopicRequest; end
216
-
217
- # A subscription resource.
218
- # @!attribute [rw] name
219
- # @return [String]
220
- # Required. The name of the subscription. It must have the format
221
- # `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
222
- # start with a letter, and contain only letters (`[A-Za-z]`), numbers
223
- # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
224
- # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
225
- # in length, and it must not start with `"goog"`.
226
- # @!attribute [rw] topic
227
- # @return [String]
228
- # Required. The name of the topic from which this subscription is receiving
229
- # messages. Format is `projects/{project}/topics/{topic}`. The value of this
230
- # field will be `_deleted-topic_` if the topic has been deleted.
231
- # @!attribute [rw] push_config
232
- # @return [Google::Cloud::PubSub::V1::PushConfig]
233
- # If push delivery is used with this subscription, this field is
234
- # used to configure it. An empty `pushConfig` signifies that the subscriber
235
- # will pull and ack messages using API methods.
236
- # @!attribute [rw] ack_deadline_seconds
237
- # @return [Integer]
238
- # The approximate amount of time (on a best-effort basis) Pub/Sub waits for
239
- # the subscriber to acknowledge receipt before resending the message. In the
240
- # interval after the message is delivered and before it is acknowledged, it
241
- # is considered to be <i>outstanding</i>. During that time period, the
242
- # message will not be redelivered (on a best-effort basis).
243
- #
244
- # For pull subscriptions, this value is used as the initial value for the ack
245
- # deadline. To override this value for a given message, call
246
- # `ModifyAckDeadline` with the corresponding `ack_id` if using
247
- # non-streaming pull or send the `ack_id` in a
248
- # `StreamingModifyAckDeadlineRequest` if using streaming pull.
249
- # The minimum custom deadline you can specify is 10 seconds.
250
- # The maximum custom deadline you can specify is 600 seconds (10 minutes).
251
- # If this parameter is 0, a default value of 10 seconds is used.
252
- #
253
- # For push delivery, this value is also used to set the request timeout for
254
- # the call to the push endpoint.
255
- #
256
- # If the subscriber never acknowledges the message, the Pub/Sub
257
- # system will eventually redeliver the message.
258
- # @!attribute [rw] retain_acked_messages
259
- # @return [true, false]
260
- # Indicates whether to retain acknowledged messages. If true, then
261
- # messages are not expunged from the subscription's backlog, even if they are
262
- # acknowledged, until they fall out of the `message_retention_duration`
263
- # window. This must be true if you would like to
264
- # <a
265
- # href="https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time">
266
- # Seek to a timestamp</a>.
267
- # @!attribute [rw] message_retention_duration
268
- # @return [Google::Protobuf::Duration]
269
- # How long to retain unacknowledged messages in the subscription's backlog,
270
- # from the moment a message is published.
271
- # If `retain_acked_messages` is true, then this also configures the retention
272
- # of acknowledged messages, and thus configures how far back in time a `Seek`
273
- # can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
274
- # minutes.
275
- # @!attribute [rw] labels
276
- # @return [Hash{String => String}]
277
- # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
278
- # managing labels</a>.
279
- # @!attribute [rw] enable_message_ordering
280
- # @return [true, false]
281
- # If true, messages published with the same `ordering_key` in `PubsubMessage`
282
- # will be delivered to the subscribers in the order in which they
283
- # are received by the Pub/Sub system. Otherwise, they may be delivered in
284
- # any order.
285
- # <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
286
- # API might be changed in backward-incompatible ways and is not recommended
287
- # for production use. It is not subject to any SLA or deprecation policy.
288
- # @!attribute [rw] expiration_policy
289
- # @return [Google::Cloud::PubSub::V1::ExpirationPolicy]
290
- # A policy that specifies the conditions for this subscription's expiration.
291
- # A subscription is considered active as long as any connected subscriber is
292
- # successfully consuming messages from the subscription or is issuing
293
- # operations on the subscription. If `expiration_policy` is not set, a
294
- # *default policy* with `ttl` of 31 days will be used. The minimum allowed
295
- # value for `expiration_policy.ttl` is 1 day.
296
- # @!attribute [rw] filter
297
- # @return [String]
298
- # An expression written in the Cloud Pub/Sub filter language. If non-empty,
299
- # then only `PubsubMessage`s whose `attributes` field matches the filter are
300
- # delivered on this subscription. If empty, then no messages are filtered
301
- # out.
302
- # <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
303
- # API might be changed in backward-incompatible ways and is not recommended
304
- # for production use. It is not subject to any SLA or deprecation policy.
305
- # @!attribute [rw] dead_letter_policy
306
- # @return [Google::Cloud::PubSub::V1::DeadLetterPolicy]
307
- # A policy that specifies the conditions for dead lettering messages in
308
- # this subscription. If dead_letter_policy is not set, dead lettering
309
- # is disabled.
310
- #
311
- # The Cloud Pub/Sub service account associated with this subscriptions's
312
- # parent project (i.e.,
313
- # service-\\{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
314
- # permission to Acknowledge() messages on this subscription.
315
- # @!attribute [rw] retry_policy
316
- # @return [Google::Cloud::PubSub::V1::RetryPolicy]
317
- # A policy that specifies how Cloud Pub/Sub retries message delivery for this
318
- # subscription.
319
- #
320
- # If not set, the default retry policy is applied. This generally implies
321
- # that messages will be retried as soon as possible for healthy subscribers.
322
- # RetryPolicy will be triggered on NACKs or acknowledgement deadline
323
- # exceeded events for a given message.
324
- # <b>EXPERIMENTAL:</b> This API might be changed in backward-incompatible
325
- # ways and is not recommended for production use. It is not subject to any
326
- # SLA or deprecation policy.
327
- class Subscription; end
328
-
329
- # A policy that specifies how Cloud Pub/Sub retries message delivery.
330
- #
331
- # Retry delay will be exponential based on provided minimum and maximum
332
- # backoffs. https://en.wikipedia.org/wiki/Exponential_backoff.
333
- #
334
- # RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded
335
- # events for a given message.
336
- #
337
- # Retry Policy is implemented on a best effort basis. At times, the delay
338
- # between consecutive deliveries may not match the configuration. That is,
339
- # delay can be more or less than configured backoff.
340
- # @!attribute [rw] minimum_backoff
341
- # @return [Google::Protobuf::Duration]
342
- # The minimum delay between consecutive deliveries of a given message.
343
- # Value should be between 0 and 600 seconds. Defaults to 10 seconds.
344
- # @!attribute [rw] maximum_backoff
345
- # @return [Google::Protobuf::Duration]
346
- # The maximum delay between consecutive deliveries of a given message.
347
- # Value should be between 0 and 600 seconds. Defaults to 600 seconds.
348
- class RetryPolicy; end
349
-
350
- # Dead lettering is done on a best effort basis. The same message might be
351
- # dead lettered multiple times.
352
- #
353
- # If validation on any of the fields fails at subscription creation/updation,
354
- # the create/update subscription request will fail.
355
- # @!attribute [rw] dead_letter_topic
356
- # @return [String]
357
- # The name of the topic to which dead letter messages should be published.
358
- # Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
359
- # account associated with the enclosing subscription's parent project (i.e.,
360
- # service-\\{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
361
- # permission to Publish() to this topic.
362
- #
363
- # The operation will fail if the topic does not exist.
364
- # Users should ensure that there is a subscription attached to this topic
365
- # since messages published to a topic with no subscriptions are lost.
366
- # @!attribute [rw] max_delivery_attempts
367
- # @return [Integer]
368
- # The maximum number of delivery attempts for any message. The value must be
369
- # between 5 and 100.
370
- #
371
- # The number of delivery attempts is defined as 1 + (the sum of number of
372
- # NACKs and number of times the acknowledgement deadline has been exceeded
373
- # for the message).
374
- #
375
- # A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
376
- # client libraries may automatically extend ack_deadlines.
377
- #
378
- # This field will be honored on a best effort basis.
379
- #
380
- # If this parameter is 0, a default value of 5 is used.
381
- class DeadLetterPolicy; end
382
-
383
- # A policy that specifies the conditions for resource expiration (i.e.,
384
- # automatic resource deletion).
385
- # @!attribute [rw] ttl
386
- # @return [Google::Protobuf::Duration]
387
- # Specifies the "time-to-live" duration for an associated resource. The
388
- # resource expires if it is not active for a period of `ttl`. The definition
389
- # of "activity" depends on the type of the associated resource. The minimum
390
- # and maximum allowed values for `ttl` depend on the type of the associated
391
- # resource, as well. If `ttl` is not set, the associated resource never
392
- # expires.
393
- class ExpirationPolicy; end
394
-
395
- # Configuration for a push delivery endpoint.
396
- # @!attribute [rw] push_endpoint
397
- # @return [String]
398
- # A URL locating the endpoint to which messages should be pushed.
399
- # For example, a Webhook endpoint might use `https://example.com/push`.
400
- # @!attribute [rw] attributes
401
- # @return [Hash{String => String}]
402
- # Endpoint configuration attributes that can be used to control different
403
- # aspects of the message delivery.
404
- #
405
- # The only currently supported attribute is `x-goog-version`, which you can
406
- # use to change the format of the pushed message. This attribute
407
- # indicates the version of the data expected by the endpoint. This
408
- # controls the shape of the pushed message (i.e., its fields and metadata).
409
- #
410
- # If not present during the `CreateSubscription` call, it will default to
411
- # the version of the Pub/Sub API used to make such call. If not present in a
412
- # `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
413
- # calls will always return a valid version, even if the subscription was
414
- # created without this attribute.
415
- #
416
- # The only supported values for the `x-goog-version` attribute are:
417
- #
418
- # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
419
- # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
420
- #
421
- # For example:
422
- # <pre><code>attributes { "x-goog-version": "v1" } </code></pre>
423
- # @!attribute [rw] oidc_token
424
- # @return [Google::Cloud::PubSub::V1::PushConfig::OidcToken]
425
- # If specified, Pub/Sub will generate and attach an OIDC JWT token as an
426
- # `Authorization` header in the HTTP request for every pushed message.
427
- class PushConfig
428
- # Contains information needed for generating an
429
- # [OpenID Connect
430
- # token](https://developers.google.com/identity/protocols/OpenIDConnect).
431
- # @!attribute [rw] service_account_email
432
- # @return [String]
433
- # [Service account
434
- # email](https://cloud.google.com/iam/docs/service-accounts)
435
- # to be used for generating the OIDC token. The caller (for
436
- # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must
437
- # have the iam.serviceAccounts.actAs permission for the service account.
438
- # @!attribute [rw] audience
439
- # @return [String]
440
- # Audience to be used when generating OIDC token. The audience claim
441
- # identifies the recipients that the JWT is intended for. The audience
442
- # value is a single case-sensitive string. Having multiple values (array)
443
- # for the audience field is not supported. More info about the OIDC JWT
444
- # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
445
- # Note: if not specified, the Push endpoint URL will be used.
446
- class OidcToken; end
447
- end
448
-
449
- # A message and its corresponding acknowledgment ID.
450
- # @!attribute [rw] ack_id
451
- # @return [String]
452
- # This ID can be used to acknowledge the received message.
453
- # @!attribute [rw] message
454
- # @return [Google::Cloud::PubSub::V1::PubsubMessage]
455
- # The message.
456
- # @!attribute [rw] delivery_attempt
457
- # @return [Integer]
458
- # The approximate number of times that Cloud Pub/Sub has attempted to deliver
459
- # the associated message to a subscriber.
460
- #
461
- # More precisely, this is 1 + (number of NACKs) +
462
- # (number of ack_deadline exceeds) for this message.
463
- #
464
- # A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline
465
- # exceeds event is whenever a message is not acknowledged within
466
- # ack_deadline. Note that ack_deadline is initially
467
- # Subscription.ackDeadlineSeconds, but may get extended automatically by
468
- # the client library.
469
- #
470
- # Upon the first delivery of a given message, `delivery_attempt` will have a
471
- # value of 1. The value is calculated at best effort and is approximate.
472
- #
473
- # If a DeadLetterPolicy is not set on the subscription, this will be 0.
474
- class ReceivedMessage; end
475
-
476
- # Request for the GetSubscription method.
477
- # @!attribute [rw] subscription
478
- # @return [String]
479
- # Required. The name of the subscription to get.
480
- # Format is `projects/{project}/subscriptions/{sub}`.
481
- class GetSubscriptionRequest; end
482
-
483
- # Request for the UpdateSubscription method.
484
- # @!attribute [rw] subscription
485
- # @return [Google::Cloud::PubSub::V1::Subscription]
486
- # Required. The updated subscription object.
487
- # @!attribute [rw] update_mask
488
- # @return [Google::Protobuf::FieldMask]
489
- # Required. Indicates which fields in the provided subscription to update.
490
- # Must be specified and non-empty.
491
- class UpdateSubscriptionRequest; end
492
-
493
- # Request for the `ListSubscriptions` method.
494
- # @!attribute [rw] project
495
- # @return [String]
496
- # Required. The name of the project in which to list subscriptions.
497
- # Format is `projects/{project-id}`.
498
- # @!attribute [rw] page_size
499
- # @return [Integer]
500
- # Maximum number of subscriptions to return.
501
- # @!attribute [rw] page_token
502
- # @return [String]
503
- # The value returned by the last `ListSubscriptionsResponse`; indicates that
504
- # this is a continuation of a prior `ListSubscriptions` call, and that the
505
- # system should return the next page of data.
506
- class ListSubscriptionsRequest; end
507
-
508
- # Response for the `ListSubscriptions` method.
509
- # @!attribute [rw] subscriptions
510
- # @return [Array<Google::Cloud::PubSub::V1::Subscription>]
511
- # The subscriptions that match the request.
512
- # @!attribute [rw] next_page_token
513
- # @return [String]
514
- # If not empty, indicates that there may be more subscriptions that match
515
- # the request; this value should be passed in a new
516
- # `ListSubscriptionsRequest` to get more subscriptions.
517
- class ListSubscriptionsResponse; end
518
-
519
- # Request for the DeleteSubscription method.
520
- # @!attribute [rw] subscription
521
- # @return [String]
522
- # Required. The subscription to delete.
523
- # Format is `projects/{project}/subscriptions/{sub}`.
524
- class DeleteSubscriptionRequest; end
525
-
526
- # Request for the ModifyPushConfig method.
527
- # @!attribute [rw] subscription
528
- # @return [String]
529
- # Required. The name of the subscription.
530
- # Format is `projects/{project}/subscriptions/{sub}`.
531
- # @!attribute [rw] push_config
532
- # @return [Google::Cloud::PubSub::V1::PushConfig]
533
- # Required. The push configuration for future deliveries.
534
- #
535
- # An empty `pushConfig` indicates that the Pub/Sub system should
536
- # stop pushing messages from the given subscription and allow
537
- # messages to be pulled and acknowledged - effectively pausing
538
- # the subscription if `Pull` or `StreamingPull` is not called.
539
- class ModifyPushConfigRequest; end
540
-
541
- # Request for the `Pull` method.
542
- # @!attribute [rw] subscription
543
- # @return [String]
544
- # Required. The subscription from which messages should be pulled.
545
- # Format is `projects/{project}/subscriptions/{sub}`.
546
- # @!attribute [rw] return_immediately
547
- # @return [true, false]
548
- # Optional. If this field set to true, the system will respond immediately
549
- # even if it there are no messages available to return in the `Pull`
550
- # response. Otherwise, the system may wait (for a bounded amount of time)
551
- # until at least one message is available, rather than returning no messages.
552
- # Warning: setting this field to `true` is discouraged because it adversely
553
- # impacts the performance of `Pull` operations. We recommend that users do
554
- # not set this field.
555
- # @!attribute [rw] max_messages
556
- # @return [Integer]
557
- # Required. The maximum number of messages to return for this request. Must
558
- # be a positive integer. The Pub/Sub system may return fewer than the number
559
- # specified.
560
- class PullRequest; end
561
-
562
- # Response for the `Pull` method.
563
- # @!attribute [rw] received_messages
564
- # @return [Array<Google::Cloud::PubSub::V1::ReceivedMessage>]
565
- # Received Pub/Sub messages. The list will be empty if there are no more
566
- # messages available in the backlog. For JSON, the response can be entirely
567
- # empty. The Pub/Sub system may return fewer than the `maxMessages` requested
568
- # even if there are more messages available in the backlog.
569
- class PullResponse; end
570
-
571
- # Request for the ModifyAckDeadline method.
572
- # @!attribute [rw] subscription
573
- # @return [String]
574
- # Required. The name of the subscription.
575
- # Format is `projects/{project}/subscriptions/{sub}`.
576
- # @!attribute [rw] ack_ids
577
- # @return [Array<String>]
578
- # Required. List of acknowledgment IDs.
579
- # @!attribute [rw] ack_deadline_seconds
580
- # @return [Integer]
581
- # Required. The new ack deadline with respect to the time this request was
582
- # sent to the Pub/Sub system. For example, if the value is 10, the new ack
583
- # deadline will expire 10 seconds after the `ModifyAckDeadline` call was
584
- # made. Specifying zero might immediately make the message available for
585
- # delivery to another subscriber client. This typically results in an
586
- # increase in the rate of message redeliveries (that is, duplicates).
587
- # The minimum deadline you can specify is 0 seconds.
588
- # The maximum deadline you can specify is 600 seconds (10 minutes).
589
- class ModifyAckDeadlineRequest; end
590
-
591
- # Request for the Acknowledge method.
592
- # @!attribute [rw] subscription
593
- # @return [String]
594
- # Required. The subscription whose message is being acknowledged.
595
- # Format is `projects/{project}/subscriptions/{sub}`.
596
- # @!attribute [rw] ack_ids
597
- # @return [Array<String>]
598
- # Required. The acknowledgment ID for the messages being acknowledged that
599
- # was returned by the Pub/Sub system in the `Pull` response. Must not be
600
- # empty.
601
- class AcknowledgeRequest; end
602
-
603
- # Request for the `StreamingPull` streaming RPC method. This request is used to
604
- # establish the initial stream as well as to stream acknowledgements and ack
605
- # deadline modifications from the client to the server.
606
- # @!attribute [rw] subscription
607
- # @return [String]
608
- # Required. The subscription for which to initialize the new stream. This
609
- # must be provided in the first request on the stream, and must not be set in
610
- # subsequent requests from client to server.
611
- # Format is `projects/{project}/subscriptions/{sub}`.
612
- # @!attribute [rw] ack_ids
613
- # @return [Array<String>]
614
- # List of acknowledgement IDs for acknowledging previously received messages
615
- # (received on this stream or a different stream). If an ack ID has expired,
616
- # the corresponding message may be redelivered later. Acknowledging a message
617
- # more than once will not result in an error. If the acknowledgement ID is
618
- # malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
619
- # @!attribute [rw] modify_deadline_seconds
620
- # @return [Array<Integer>]
621
- # The list of new ack deadlines for the IDs listed in
622
- # `modify_deadline_ack_ids`. The size of this list must be the same as the
623
- # size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
624
- # with `INVALID_ARGUMENT`. Each element in this list is applied to the
625
- # element in the same position in `modify_deadline_ack_ids`. The new ack
626
- # deadline is with respect to the time this request was sent to the Pub/Sub
627
- # system. Must be >= 0. For example, if the value is 10, the new ack deadline
628
- # will expire 10 seconds after this request is received. If the value is 0,
629
- # the message is immediately made available for another streaming or
630
- # non-streaming pull request. If the value is < 0 (an error), the stream will
631
- # be aborted with status `INVALID_ARGUMENT`.
632
- # @!attribute [rw] modify_deadline_ack_ids
633
- # @return [Array<String>]
634
- # List of acknowledgement IDs whose deadline will be modified based on the
635
- # corresponding element in `modify_deadline_seconds`. This field can be used
636
- # to indicate that more time is needed to process a message by the
637
- # subscriber, or to make the message available for redelivery if the
638
- # processing was interrupted.
639
- # @!attribute [rw] stream_ack_deadline_seconds
640
- # @return [Integer]
641
- # Required. The ack deadline to use for the stream. This must be provided in
642
- # the first request on the stream, but it can also be updated on subsequent
643
- # requests from client to server. The minimum deadline you can specify is 10
644
- # seconds. The maximum deadline you can specify is 600 seconds (10 minutes).
645
- # @!attribute [rw] client_id
646
- # @return [String]
647
- # A unique identifier that is used to distinguish client instances from each
648
- # other. Only needs to be provided on the initial request. When a stream
649
- # disconnects and reconnects for the same stream, the client_id should be set
650
- # to the same value so that state associated with the old stream can be
651
- # transferred to the new stream. The same client_id should not be used for
652
- # different client instances.
653
- class StreamingPullRequest; end
654
-
655
- # Response for the `StreamingPull` method. This response is used to stream
656
- # messages from the server to the client.
657
- # @!attribute [rw] received_messages
658
- # @return [Array<Google::Cloud::PubSub::V1::ReceivedMessage>]
659
- # Received Pub/Sub messages. This will not be empty.
660
- class StreamingPullResponse; end
661
-
662
- # Request for the `CreateSnapshot` method.
663
- # @!attribute [rw] name
664
- # @return [String]
665
- # Required. User-provided name for this snapshot. If the name is not provided
666
- # in the request, the server will assign a random name for this snapshot on
667
- # the same project as the subscription. Note that for REST API requests, you
668
- # must specify a name. See the <a
669
- # href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource
670
- # name rules</a>. Format is `projects/{project}/snapshots/{snap}`.
671
- # @!attribute [rw] subscription
672
- # @return [String]
673
- # Required. The subscription whose backlog the snapshot retains.
674
- # Specifically, the created snapshot is guaranteed to retain:
675
- # (a) The existing backlog on the subscription. More precisely, this is
676
- # defined as the messages in the subscription's backlog that are
677
- # unacknowledged upon the successful completion of the
678
- # `CreateSnapshot` request; as well as:
679
- # (b) Any messages published to the subscription's topic following the
680
- # successful completion of the CreateSnapshot request.
681
- # Format is `projects/{project}/subscriptions/{sub}`.
682
- # @!attribute [rw] labels
683
- # @return [Hash{String => String}]
684
- # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
685
- # managing labels</a>.
686
- class CreateSnapshotRequest; end
687
-
688
- # Request for the UpdateSnapshot method.
689
- # @!attribute [rw] snapshot
690
- # @return [Google::Cloud::PubSub::V1::Snapshot]
691
- # Required. The updated snapshot object.
692
- # @!attribute [rw] update_mask
693
- # @return [Google::Protobuf::FieldMask]
694
- # Required. Indicates which fields in the provided snapshot to update.
695
- # Must be specified and non-empty.
696
- class UpdateSnapshotRequest; end
697
-
698
- # A snapshot resource. Snapshots are used in
699
- # <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a>
700
- # operations, which allow
701
- # you to manage message acknowledgments in bulk. That is, you can set the
702
- # acknowledgment state of messages in an existing subscription to the state
703
- # captured by a snapshot.
704
- # @!attribute [rw] name
705
- # @return [String]
706
- # The name of the snapshot.
707
- # @!attribute [rw] topic
708
- # @return [String]
709
- # The name of the topic from which this snapshot is retaining messages.
710
- # @!attribute [rw] expire_time
711
- # @return [Google::Protobuf::Timestamp]
712
- # The snapshot is guaranteed to exist up until this time.
713
- # A newly-created snapshot expires no later than 7 days from the time of its
714
- # creation. Its exact lifetime is determined at creation by the existing
715
- # backlog in the source subscription. Specifically, the lifetime of the
716
- # snapshot is `7 days - (age of oldest unacked message in the subscription)`.
717
- # For example, consider a subscription whose oldest unacked message is 3 days
718
- # old. If a snapshot is created from this subscription, the snapshot -- which
719
- # will always capture this 3-day-old backlog as long as the snapshot
720
- # exists -- will expire in 4 days. The service will refuse to create a
721
- # snapshot that would expire in less than 1 hour after creation.
722
- # @!attribute [rw] labels
723
- # @return [Hash{String => String}]
724
- # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
725
- # managing labels</a>.
726
- class Snapshot; end
727
-
728
- # Request for the GetSnapshot method.
729
- # @!attribute [rw] snapshot
730
- # @return [String]
731
- # Required. The name of the snapshot to get.
732
- # Format is `projects/{project}/snapshots/{snap}`.
733
- class GetSnapshotRequest; end
734
-
735
- # Request for the `ListSnapshots` method.
736
- # @!attribute [rw] project
737
- # @return [String]
738
- # Required. The name of the project in which to list snapshots.
739
- # Format is `projects/{project-id}`.
740
- # @!attribute [rw] page_size
741
- # @return [Integer]
742
- # Maximum number of snapshots to return.
743
- # @!attribute [rw] page_token
744
- # @return [String]
745
- # The value returned by the last `ListSnapshotsResponse`; indicates that this
746
- # is a continuation of a prior `ListSnapshots` call, and that the system
747
- # should return the next page of data.
748
- class ListSnapshotsRequest; end
749
-
750
- # Response for the `ListSnapshots` method.
751
- # @!attribute [rw] snapshots
752
- # @return [Array<Google::Cloud::PubSub::V1::Snapshot>]
753
- # The resulting snapshots.
754
- # @!attribute [rw] next_page_token
755
- # @return [String]
756
- # If not empty, indicates that there may be more snapshot that match the
757
- # request; this value should be passed in a new `ListSnapshotsRequest`.
758
- class ListSnapshotsResponse; end
759
-
760
- # Request for the `DeleteSnapshot` method.
761
- # @!attribute [rw] snapshot
762
- # @return [String]
763
- # Required. The name of the snapshot to delete.
764
- # Format is `projects/{project}/snapshots/{snap}`.
765
- class DeleteSnapshotRequest; end
766
-
767
- # Request for the `Seek` method.
768
- # @!attribute [rw] subscription
769
- # @return [String]
770
- # Required. The subscription to affect.
771
- # @!attribute [rw] time
772
- # @return [Google::Protobuf::Timestamp]
773
- # The time to seek to.
774
- # Messages retained in the subscription that were published before this
775
- # time are marked as acknowledged, and messages retained in the
776
- # subscription that were published after this time are marked as
777
- # unacknowledged. Note that this operation affects only those messages
778
- # retained in the subscription (configured by the combination of
779
- # `message_retention_duration` and `retain_acked_messages`). For example,
780
- # if `time` corresponds to a point before the message retention
781
- # window (or to a point before the system's notion of the subscription
782
- # creation time), only retained messages will be marked as unacknowledged,
783
- # and already-expunged messages will not be restored.
784
- # @!attribute [rw] snapshot
785
- # @return [String]
786
- # The snapshot to seek to. The snapshot's topic must be the same as that of
787
- # the provided subscription.
788
- # Format is `projects/{project}/snapshots/{snap}`.
789
- class SeekRequest; end
790
-
791
- # Response for the `Seek` method (this response is empty).
792
- class SeekResponse; end
793
- end
794
- end
795
- end
796
- end