google-apis-pubsub_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1316 @@
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
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module PubsubV1
23
+ # Cloud Pub/Sub API
24
+ #
25
+ # Provides reliable, many-to-many, asynchronous messaging between applications.
26
+ #
27
+ # @example
28
+ # require 'google/apis/pubsub_v1'
29
+ #
30
+ # Pubsub = Google::Apis::PubsubV1 # Alias the module
31
+ # service = Pubsub::PubsubService.new
32
+ #
33
+ # @see https://cloud.google.com/pubsub/docs
34
+ class PubsubService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://pubsub.googleapis.com/', '',
47
+ client_name: 'google-apis-pubsub_v1',
48
+ client_version: Google::Apis::PubsubV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Creates a snapshot from the requested subscription. Snapshots are used in [
53
+ # Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which
54
+ # allow you to manage message acknowledgments in bulk. That is, you can set the
55
+ # acknowledgment state of messages in an existing subscription to the state
56
+ # captured by a snapshot. If the snapshot already exists, returns `
57
+ # ALREADY_EXISTS`. If the requested subscription doesn't exist, returns `
58
+ # NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting
59
+ # snapshot would expire in less than 1 hour -- then `FAILED_PRECONDITION` is
60
+ # returned. See also the `Snapshot.expire_time` field. If the name is not
61
+ # provided in the request, the server will assign a random name for this
62
+ # snapshot on the same project as the subscription, conforming to the [resource
63
+ # name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The
64
+ # generated name is populated in the returned Snapshot object. Note that for
65
+ # REST API requests, you must specify a name in the request.
66
+ # @param [String] name
67
+ # Required. User-provided name for this snapshot. If the name is not provided in
68
+ # the request, the server will assign a random name for this snapshot on the
69
+ # same project as the subscription. Note that for REST API requests, you must
70
+ # specify a name. See the resource name rules. Format is `projects/`project`/
71
+ # snapshots/`snap``.
72
+ # @param [Google::Apis::PubsubV1::CreateSnapshotRequest] create_snapshot_request_object
73
+ # @param [String] fields
74
+ # Selector specifying which fields to include in a partial response.
75
+ # @param [String] quota_user
76
+ # Available to use for quota purposes for server-side applications. Can be any
77
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
78
+ # @param [Google::Apis::RequestOptions] options
79
+ # Request-specific options
80
+ #
81
+ # @yield [result, err] Result & error if block supplied
82
+ # @yieldparam result [Google::Apis::PubsubV1::Snapshot] parsed result object
83
+ # @yieldparam err [StandardError] error object if request failed
84
+ #
85
+ # @return [Google::Apis::PubsubV1::Snapshot]
86
+ #
87
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
88
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
89
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
90
+ def create_snapshot(name, create_snapshot_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
91
+ command = make_simple_command(:put, 'v1/{+name}', options)
92
+ command.request_representation = Google::Apis::PubsubV1::CreateSnapshotRequest::Representation
93
+ command.request_object = create_snapshot_request_object
94
+ command.response_representation = Google::Apis::PubsubV1::Snapshot::Representation
95
+ command.response_class = Google::Apis::PubsubV1::Snapshot
96
+ command.params['name'] = name unless name.nil?
97
+ command.query['fields'] = fields unless fields.nil?
98
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
99
+ execute_or_queue_command(command, &block)
100
+ end
101
+
102
+ # Removes an existing snapshot. Snapshots are used in [Seek] (https://cloud.
103
+ # google.com/pubsub/docs/replay-overview) operations, which allow you to manage
104
+ # message acknowledgments in bulk. That is, you can set the acknowledgment state
105
+ # of messages in an existing subscription to the state captured by a snapshot.
106
+ # When the snapshot is deleted, all messages retained in the snapshot are
107
+ # immediately dropped. After a snapshot is deleted, a new one may be created
108
+ # with the same name, but the new one has no association with the old snapshot
109
+ # or its subscription, unless the same subscription is specified.
110
+ # @param [String] snapshot
111
+ # Required. The name of the snapshot to delete. Format is `projects/`project`/
112
+ # snapshots/`snap``.
113
+ # @param [String] fields
114
+ # Selector specifying which fields to include in a partial response.
115
+ # @param [String] quota_user
116
+ # Available to use for quota purposes for server-side applications. Can be any
117
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
118
+ # @param [Google::Apis::RequestOptions] options
119
+ # Request-specific options
120
+ #
121
+ # @yield [result, err] Result & error if block supplied
122
+ # @yieldparam result [Google::Apis::PubsubV1::Empty] parsed result object
123
+ # @yieldparam err [StandardError] error object if request failed
124
+ #
125
+ # @return [Google::Apis::PubsubV1::Empty]
126
+ #
127
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
128
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
129
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
130
+ def delete_project_snapshot(snapshot, fields: nil, quota_user: nil, options: nil, &block)
131
+ command = make_simple_command(:delete, 'v1/{+snapshot}', options)
132
+ command.response_representation = Google::Apis::PubsubV1::Empty::Representation
133
+ command.response_class = Google::Apis::PubsubV1::Empty
134
+ command.params['snapshot'] = snapshot unless snapshot.nil?
135
+ command.query['fields'] = fields unless fields.nil?
136
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
137
+ execute_or_queue_command(command, &block)
138
+ end
139
+
140
+ # Gets the configuration details of a snapshot. Snapshots are used in Seek
141
+ # operations, which allow you to manage message acknowledgments in bulk. That is,
142
+ # you can set the acknowledgment state of messages in an existing subscription
143
+ # to the state captured by a snapshot.
144
+ # @param [String] snapshot
145
+ # Required. The name of the snapshot to get. Format is `projects/`project`/
146
+ # snapshots/`snap``.
147
+ # @param [String] fields
148
+ # Selector specifying which fields to include in a partial response.
149
+ # @param [String] quota_user
150
+ # Available to use for quota purposes for server-side applications. Can be any
151
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
152
+ # @param [Google::Apis::RequestOptions] options
153
+ # Request-specific options
154
+ #
155
+ # @yield [result, err] Result & error if block supplied
156
+ # @yieldparam result [Google::Apis::PubsubV1::Snapshot] parsed result object
157
+ # @yieldparam err [StandardError] error object if request failed
158
+ #
159
+ # @return [Google::Apis::PubsubV1::Snapshot]
160
+ #
161
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
162
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
163
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
164
+ def get_project_snapshot(snapshot, fields: nil, quota_user: nil, options: nil, &block)
165
+ command = make_simple_command(:get, 'v1/{+snapshot}', options)
166
+ command.response_representation = Google::Apis::PubsubV1::Snapshot::Representation
167
+ command.response_class = Google::Apis::PubsubV1::Snapshot
168
+ command.params['snapshot'] = snapshot unless snapshot.nil?
169
+ command.query['fields'] = fields unless fields.nil?
170
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
171
+ execute_or_queue_command(command, &block)
172
+ end
173
+
174
+ # Gets the access control policy for a resource. Returns an empty policy if the
175
+ # resource exists and does not have a policy set.
176
+ # @param [String] resource
177
+ # REQUIRED: The resource for which the policy is being requested. See the
178
+ # operation documentation for the appropriate value for this field.
179
+ # @param [Fixnum] options_requested_policy_version
180
+ # Optional. The policy format version to be returned. Valid values are 0, 1, and
181
+ # 3. Requests specifying an invalid value will be rejected. Requests for
182
+ # policies with any conditional bindings must specify version 3. Policies
183
+ # without any conditional bindings may specify any valid value or leave the
184
+ # field unset. To learn which resources support conditions in their IAM policies,
185
+ # see the [IAM documentation](https://cloud.google.com/iam/help/conditions/
186
+ # resource-policies).
187
+ # @param [String] fields
188
+ # Selector specifying which fields to include in a partial response.
189
+ # @param [String] quota_user
190
+ # Available to use for quota purposes for server-side applications. Can be any
191
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
192
+ # @param [Google::Apis::RequestOptions] options
193
+ # Request-specific options
194
+ #
195
+ # @yield [result, err] Result & error if block supplied
196
+ # @yieldparam result [Google::Apis::PubsubV1::Policy] parsed result object
197
+ # @yieldparam err [StandardError] error object if request failed
198
+ #
199
+ # @return [Google::Apis::PubsubV1::Policy]
200
+ #
201
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
202
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
203
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
204
+ def get_project_snapshot_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
205
+ command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
206
+ command.response_representation = Google::Apis::PubsubV1::Policy::Representation
207
+ command.response_class = Google::Apis::PubsubV1::Policy
208
+ command.params['resource'] = resource unless resource.nil?
209
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
210
+ command.query['fields'] = fields unless fields.nil?
211
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
212
+ execute_or_queue_command(command, &block)
213
+ end
214
+
215
+ # Lists the existing snapshots. Snapshots are used in [Seek]( https://cloud.
216
+ # google.com/pubsub/docs/replay-overview) operations, which allow you to manage
217
+ # message acknowledgments in bulk. That is, you can set the acknowledgment state
218
+ # of messages in an existing subscription to the state captured by a snapshot.
219
+ # @param [String] project
220
+ # Required. The name of the project in which to list snapshots. Format is `
221
+ # projects/`project-id``.
222
+ # @param [Fixnum] page_size
223
+ # Maximum number of snapshots to return.
224
+ # @param [String] page_token
225
+ # The value returned by the last `ListSnapshotsResponse`; indicates that this is
226
+ # a continuation of a prior `ListSnapshots` call, and that the system should
227
+ # return the next page of data.
228
+ # @param [String] fields
229
+ # Selector specifying which fields to include in a partial response.
230
+ # @param [String] quota_user
231
+ # Available to use for quota purposes for server-side applications. Can be any
232
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
233
+ # @param [Google::Apis::RequestOptions] options
234
+ # Request-specific options
235
+ #
236
+ # @yield [result, err] Result & error if block supplied
237
+ # @yieldparam result [Google::Apis::PubsubV1::ListSnapshotsResponse] parsed result object
238
+ # @yieldparam err [StandardError] error object if request failed
239
+ #
240
+ # @return [Google::Apis::PubsubV1::ListSnapshotsResponse]
241
+ #
242
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
243
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
244
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
245
+ def list_project_snapshots(project, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
246
+ command = make_simple_command(:get, 'v1/{+project}/snapshots', options)
247
+ command.response_representation = Google::Apis::PubsubV1::ListSnapshotsResponse::Representation
248
+ command.response_class = Google::Apis::PubsubV1::ListSnapshotsResponse
249
+ command.params['project'] = project unless project.nil?
250
+ command.query['pageSize'] = page_size unless page_size.nil?
251
+ command.query['pageToken'] = page_token unless page_token.nil?
252
+ command.query['fields'] = fields unless fields.nil?
253
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
254
+ execute_or_queue_command(command, &block)
255
+ end
256
+
257
+ # Updates an existing snapshot. Snapshots are used in Seek operations, which
258
+ # allow you to manage message acknowledgments in bulk. That is, you can set the
259
+ # acknowledgment state of messages in an existing subscription to the state
260
+ # captured by a snapshot.
261
+ # @param [String] name
262
+ # The name of the snapshot.
263
+ # @param [Google::Apis::PubsubV1::UpdateSnapshotRequest] update_snapshot_request_object
264
+ # @param [String] fields
265
+ # Selector specifying which fields to include in a partial response.
266
+ # @param [String] quota_user
267
+ # Available to use for quota purposes for server-side applications. Can be any
268
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
269
+ # @param [Google::Apis::RequestOptions] options
270
+ # Request-specific options
271
+ #
272
+ # @yield [result, err] Result & error if block supplied
273
+ # @yieldparam result [Google::Apis::PubsubV1::Snapshot] parsed result object
274
+ # @yieldparam err [StandardError] error object if request failed
275
+ #
276
+ # @return [Google::Apis::PubsubV1::Snapshot]
277
+ #
278
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
279
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
280
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
281
+ def patch_project_snapshot(name, update_snapshot_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
282
+ command = make_simple_command(:patch, 'v1/{+name}', options)
283
+ command.request_representation = Google::Apis::PubsubV1::UpdateSnapshotRequest::Representation
284
+ command.request_object = update_snapshot_request_object
285
+ command.response_representation = Google::Apis::PubsubV1::Snapshot::Representation
286
+ command.response_class = Google::Apis::PubsubV1::Snapshot
287
+ command.params['name'] = name unless name.nil?
288
+ command.query['fields'] = fields unless fields.nil?
289
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
290
+ execute_or_queue_command(command, &block)
291
+ end
292
+
293
+ # Sets the access control policy on the specified resource. Replaces any
294
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
295
+ # PERMISSION_DENIED` errors.
296
+ # @param [String] resource
297
+ # REQUIRED: The resource for which the policy is being specified. See the
298
+ # operation documentation for the appropriate value for this field.
299
+ # @param [Google::Apis::PubsubV1::SetIamPolicyRequest] set_iam_policy_request_object
300
+ # @param [String] fields
301
+ # Selector specifying which fields to include in a partial response.
302
+ # @param [String] quota_user
303
+ # Available to use for quota purposes for server-side applications. Can be any
304
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
305
+ # @param [Google::Apis::RequestOptions] options
306
+ # Request-specific options
307
+ #
308
+ # @yield [result, err] Result & error if block supplied
309
+ # @yieldparam result [Google::Apis::PubsubV1::Policy] parsed result object
310
+ # @yieldparam err [StandardError] error object if request failed
311
+ #
312
+ # @return [Google::Apis::PubsubV1::Policy]
313
+ #
314
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
315
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
316
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
317
+ def set_snapshot_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
318
+ command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
319
+ command.request_representation = Google::Apis::PubsubV1::SetIamPolicyRequest::Representation
320
+ command.request_object = set_iam_policy_request_object
321
+ command.response_representation = Google::Apis::PubsubV1::Policy::Representation
322
+ command.response_class = Google::Apis::PubsubV1::Policy
323
+ command.params['resource'] = resource unless resource.nil?
324
+ command.query['fields'] = fields unless fields.nil?
325
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
326
+ execute_or_queue_command(command, &block)
327
+ end
328
+
329
+ # Returns permissions that a caller has on the specified resource. If the
330
+ # resource does not exist, this will return an empty set of permissions, not a `
331
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
332
+ # permission-aware UIs and command-line tools, not for authorization checking.
333
+ # This operation may "fail open" without warning.
334
+ # @param [String] resource
335
+ # REQUIRED: The resource for which the policy detail is being requested. See the
336
+ # operation documentation for the appropriate value for this field.
337
+ # @param [Google::Apis::PubsubV1::TestIamPermissionsRequest] test_iam_permissions_request_object
338
+ # @param [String] fields
339
+ # Selector specifying which fields to include in a partial response.
340
+ # @param [String] quota_user
341
+ # Available to use for quota purposes for server-side applications. Can be any
342
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
343
+ # @param [Google::Apis::RequestOptions] options
344
+ # Request-specific options
345
+ #
346
+ # @yield [result, err] Result & error if block supplied
347
+ # @yieldparam result [Google::Apis::PubsubV1::TestIamPermissionsResponse] parsed result object
348
+ # @yieldparam err [StandardError] error object if request failed
349
+ #
350
+ # @return [Google::Apis::PubsubV1::TestIamPermissionsResponse]
351
+ #
352
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
353
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
354
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
355
+ def test_snapshot_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
356
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
357
+ command.request_representation = Google::Apis::PubsubV1::TestIamPermissionsRequest::Representation
358
+ command.request_object = test_iam_permissions_request_object
359
+ command.response_representation = Google::Apis::PubsubV1::TestIamPermissionsResponse::Representation
360
+ command.response_class = Google::Apis::PubsubV1::TestIamPermissionsResponse
361
+ command.params['resource'] = resource unless resource.nil?
362
+ command.query['fields'] = fields unless fields.nil?
363
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
364
+ execute_or_queue_command(command, &block)
365
+ end
366
+
367
+ # Acknowledges the messages associated with the `ack_ids` in the `
368
+ # AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages from
369
+ # the subscription. Acknowledging a message whose ack deadline has expired may
370
+ # succeed, but such a message may be redelivered later. Acknowledging a message
371
+ # more than once will not result in an error.
372
+ # @param [String] subscription
373
+ # Required. The subscription whose message is being acknowledged. Format is `
374
+ # projects/`project`/subscriptions/`sub``.
375
+ # @param [Google::Apis::PubsubV1::AcknowledgeRequest] acknowledge_request_object
376
+ # @param [String] fields
377
+ # Selector specifying which fields to include in a partial response.
378
+ # @param [String] quota_user
379
+ # Available to use for quota purposes for server-side applications. Can be any
380
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
381
+ # @param [Google::Apis::RequestOptions] options
382
+ # Request-specific options
383
+ #
384
+ # @yield [result, err] Result & error if block supplied
385
+ # @yieldparam result [Google::Apis::PubsubV1::Empty] parsed result object
386
+ # @yieldparam err [StandardError] error object if request failed
387
+ #
388
+ # @return [Google::Apis::PubsubV1::Empty]
389
+ #
390
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
391
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
392
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
393
+ def acknowledge_subscription(subscription, acknowledge_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
394
+ command = make_simple_command(:post, 'v1/{+subscription}:acknowledge', options)
395
+ command.request_representation = Google::Apis::PubsubV1::AcknowledgeRequest::Representation
396
+ command.request_object = acknowledge_request_object
397
+ command.response_representation = Google::Apis::PubsubV1::Empty::Representation
398
+ command.response_class = Google::Apis::PubsubV1::Empty
399
+ command.params['subscription'] = subscription unless subscription.nil?
400
+ command.query['fields'] = fields unless fields.nil?
401
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
402
+ execute_or_queue_command(command, &block)
403
+ end
404
+
405
+ # Creates a subscription to a given topic. See the [resource name rules] (https:/
406
+ # /cloud.google.com/pubsub/docs/admin#resource_names). If the subscription
407
+ # already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't
408
+ # exist, returns `NOT_FOUND`. If the name is not provided in the request, the
409
+ # server will assign a random name for this subscription on the same project as
410
+ # the topic, conforming to the [resource name format] (https://cloud.google.com/
411
+ # pubsub/docs/admin#resource_names). The generated name is populated in the
412
+ # returned Subscription object. Note that for REST API requests, you must
413
+ # specify a name in the request.
414
+ # @param [String] name
415
+ # Required. The name of the subscription. It must have the format `"projects/`
416
+ # project`/subscriptions/`subscription`"`. ``subscription`` must start with a
417
+ # letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
418
+ # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`
419
+ # %`). It must be between 3 and 255 characters in length, and it must not start
420
+ # with `"goog"`.
421
+ # @param [Google::Apis::PubsubV1::Subscription] subscription_object
422
+ # @param [String] fields
423
+ # Selector specifying which fields to include in a partial response.
424
+ # @param [String] quota_user
425
+ # Available to use for quota purposes for server-side applications. Can be any
426
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
427
+ # @param [Google::Apis::RequestOptions] options
428
+ # Request-specific options
429
+ #
430
+ # @yield [result, err] Result & error if block supplied
431
+ # @yieldparam result [Google::Apis::PubsubV1::Subscription] parsed result object
432
+ # @yieldparam err [StandardError] error object if request failed
433
+ #
434
+ # @return [Google::Apis::PubsubV1::Subscription]
435
+ #
436
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
437
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
438
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
439
+ def create_subscription(name, subscription_object = nil, fields: nil, quota_user: nil, options: nil, &block)
440
+ command = make_simple_command(:put, 'v1/{+name}', options)
441
+ command.request_representation = Google::Apis::PubsubV1::Subscription::Representation
442
+ command.request_object = subscription_object
443
+ command.response_representation = Google::Apis::PubsubV1::Subscription::Representation
444
+ command.response_class = Google::Apis::PubsubV1::Subscription
445
+ command.params['name'] = name unless name.nil?
446
+ command.query['fields'] = fields unless fields.nil?
447
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
448
+ execute_or_queue_command(command, &block)
449
+ end
450
+
451
+ # Deletes an existing subscription. All messages retained in the subscription
452
+ # are immediately dropped. Calls to `Pull` after deletion will return `NOT_FOUND`
453
+ # . After a subscription is deleted, a new one may be created with the same name,
454
+ # but the new one has no association with the old subscription or its topic
455
+ # unless the same topic is specified.
456
+ # @param [String] subscription
457
+ # Required. The subscription to delete. Format is `projects/`project`/
458
+ # subscriptions/`sub``.
459
+ # @param [String] fields
460
+ # Selector specifying which fields to include in a partial response.
461
+ # @param [String] quota_user
462
+ # Available to use for quota purposes for server-side applications. Can be any
463
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
464
+ # @param [Google::Apis::RequestOptions] options
465
+ # Request-specific options
466
+ #
467
+ # @yield [result, err] Result & error if block supplied
468
+ # @yieldparam result [Google::Apis::PubsubV1::Empty] parsed result object
469
+ # @yieldparam err [StandardError] error object if request failed
470
+ #
471
+ # @return [Google::Apis::PubsubV1::Empty]
472
+ #
473
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
474
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
475
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
476
+ def delete_subscription(subscription, fields: nil, quota_user: nil, options: nil, &block)
477
+ command = make_simple_command(:delete, 'v1/{+subscription}', options)
478
+ command.response_representation = Google::Apis::PubsubV1::Empty::Representation
479
+ command.response_class = Google::Apis::PubsubV1::Empty
480
+ command.params['subscription'] = subscription unless subscription.nil?
481
+ command.query['fields'] = fields unless fields.nil?
482
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
483
+ execute_or_queue_command(command, &block)
484
+ end
485
+
486
+ # Detaches a subscription from this topic. All messages retained in the
487
+ # subscription are dropped. Subsequent `Pull` and `StreamingPull` requests will
488
+ # return FAILED_PRECONDITION. If the subscription is a push subscription, pushes
489
+ # to the endpoint will stop.
490
+ # @param [String] subscription
491
+ # Required. The subscription to detach. Format is `projects/`project`/
492
+ # subscriptions/`subscription``.
493
+ # @param [String] fields
494
+ # Selector specifying which fields to include in a partial response.
495
+ # @param [String] quota_user
496
+ # Available to use for quota purposes for server-side applications. Can be any
497
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
498
+ # @param [Google::Apis::RequestOptions] options
499
+ # Request-specific options
500
+ #
501
+ # @yield [result, err] Result & error if block supplied
502
+ # @yieldparam result [Google::Apis::PubsubV1::DetachSubscriptionResponse] parsed result object
503
+ # @yieldparam err [StandardError] error object if request failed
504
+ #
505
+ # @return [Google::Apis::PubsubV1::DetachSubscriptionResponse]
506
+ #
507
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
508
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
509
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
510
+ def detach_project_subscription(subscription, fields: nil, quota_user: nil, options: nil, &block)
511
+ command = make_simple_command(:post, 'v1/{+subscription}:detach', options)
512
+ command.response_representation = Google::Apis::PubsubV1::DetachSubscriptionResponse::Representation
513
+ command.response_class = Google::Apis::PubsubV1::DetachSubscriptionResponse
514
+ command.params['subscription'] = subscription unless subscription.nil?
515
+ command.query['fields'] = fields unless fields.nil?
516
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
517
+ execute_or_queue_command(command, &block)
518
+ end
519
+
520
+ # Gets the configuration details of a subscription.
521
+ # @param [String] subscription
522
+ # Required. The name of the subscription to get. Format is `projects/`project`/
523
+ # subscriptions/`sub``.
524
+ # @param [String] fields
525
+ # Selector specifying which fields to include in a partial response.
526
+ # @param [String] quota_user
527
+ # Available to use for quota purposes for server-side applications. Can be any
528
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
529
+ # @param [Google::Apis::RequestOptions] options
530
+ # Request-specific options
531
+ #
532
+ # @yield [result, err] Result & error if block supplied
533
+ # @yieldparam result [Google::Apis::PubsubV1::Subscription] parsed result object
534
+ # @yieldparam err [StandardError] error object if request failed
535
+ #
536
+ # @return [Google::Apis::PubsubV1::Subscription]
537
+ #
538
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
539
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
540
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
541
+ def get_subscription(subscription, fields: nil, quota_user: nil, options: nil, &block)
542
+ command = make_simple_command(:get, 'v1/{+subscription}', options)
543
+ command.response_representation = Google::Apis::PubsubV1::Subscription::Representation
544
+ command.response_class = Google::Apis::PubsubV1::Subscription
545
+ command.params['subscription'] = subscription unless subscription.nil?
546
+ command.query['fields'] = fields unless fields.nil?
547
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
548
+ execute_or_queue_command(command, &block)
549
+ end
550
+
551
+ # Gets the access control policy for a resource. Returns an empty policy if the
552
+ # resource exists and does not have a policy set.
553
+ # @param [String] resource
554
+ # REQUIRED: The resource for which the policy is being requested. See the
555
+ # operation documentation for the appropriate value for this field.
556
+ # @param [Fixnum] options_requested_policy_version
557
+ # Optional. The policy format version to be returned. Valid values are 0, 1, and
558
+ # 3. Requests specifying an invalid value will be rejected. Requests for
559
+ # policies with any conditional bindings must specify version 3. Policies
560
+ # without any conditional bindings may specify any valid value or leave the
561
+ # field unset. To learn which resources support conditions in their IAM policies,
562
+ # see the [IAM documentation](https://cloud.google.com/iam/help/conditions/
563
+ # resource-policies).
564
+ # @param [String] fields
565
+ # Selector specifying which fields to include in a partial response.
566
+ # @param [String] quota_user
567
+ # Available to use for quota purposes for server-side applications. Can be any
568
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
569
+ # @param [Google::Apis::RequestOptions] options
570
+ # Request-specific options
571
+ #
572
+ # @yield [result, err] Result & error if block supplied
573
+ # @yieldparam result [Google::Apis::PubsubV1::Policy] parsed result object
574
+ # @yieldparam err [StandardError] error object if request failed
575
+ #
576
+ # @return [Google::Apis::PubsubV1::Policy]
577
+ #
578
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
579
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
580
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
581
+ def get_project_subscription_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
582
+ command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
583
+ command.response_representation = Google::Apis::PubsubV1::Policy::Representation
584
+ command.response_class = Google::Apis::PubsubV1::Policy
585
+ command.params['resource'] = resource unless resource.nil?
586
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
587
+ command.query['fields'] = fields unless fields.nil?
588
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
589
+ execute_or_queue_command(command, &block)
590
+ end
591
+
592
+ # Lists matching subscriptions.
593
+ # @param [String] project
594
+ # Required. The name of the project in which to list subscriptions. Format is `
595
+ # projects/`project-id``.
596
+ # @param [Fixnum] page_size
597
+ # Maximum number of subscriptions to return.
598
+ # @param [String] page_token
599
+ # The value returned by the last `ListSubscriptionsResponse`; indicates that
600
+ # this is a continuation of a prior `ListSubscriptions` call, and that the
601
+ # system should return the next page of data.
602
+ # @param [String] fields
603
+ # Selector specifying which fields to include in a partial response.
604
+ # @param [String] quota_user
605
+ # Available to use for quota purposes for server-side applications. Can be any
606
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
607
+ # @param [Google::Apis::RequestOptions] options
608
+ # Request-specific options
609
+ #
610
+ # @yield [result, err] Result & error if block supplied
611
+ # @yieldparam result [Google::Apis::PubsubV1::ListSubscriptionsResponse] parsed result object
612
+ # @yieldparam err [StandardError] error object if request failed
613
+ #
614
+ # @return [Google::Apis::PubsubV1::ListSubscriptionsResponse]
615
+ #
616
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
617
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
618
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
619
+ def list_subscriptions(project, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
620
+ command = make_simple_command(:get, 'v1/{+project}/subscriptions', options)
621
+ command.response_representation = Google::Apis::PubsubV1::ListSubscriptionsResponse::Representation
622
+ command.response_class = Google::Apis::PubsubV1::ListSubscriptionsResponse
623
+ command.params['project'] = project unless project.nil?
624
+ command.query['pageSize'] = page_size unless page_size.nil?
625
+ command.query['pageToken'] = page_token unless page_token.nil?
626
+ command.query['fields'] = fields unless fields.nil?
627
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
628
+ execute_or_queue_command(command, &block)
629
+ end
630
+
631
+ # Modifies the ack deadline for a specific message. This method is useful to
632
+ # indicate that more time is needed to process a message by the subscriber, or
633
+ # to make the message available for redelivery if the processing was interrupted.
634
+ # Note that this does not modify the subscription-level `ackDeadlineSeconds`
635
+ # used for subsequent messages.
636
+ # @param [String] subscription
637
+ # Required. The name of the subscription. Format is `projects/`project`/
638
+ # subscriptions/`sub``.
639
+ # @param [Google::Apis::PubsubV1::ModifyAckDeadlineRequest] modify_ack_deadline_request_object
640
+ # @param [String] fields
641
+ # Selector specifying which fields to include in a partial response.
642
+ # @param [String] quota_user
643
+ # Available to use for quota purposes for server-side applications. Can be any
644
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
645
+ # @param [Google::Apis::RequestOptions] options
646
+ # Request-specific options
647
+ #
648
+ # @yield [result, err] Result & error if block supplied
649
+ # @yieldparam result [Google::Apis::PubsubV1::Empty] parsed result object
650
+ # @yieldparam err [StandardError] error object if request failed
651
+ #
652
+ # @return [Google::Apis::PubsubV1::Empty]
653
+ #
654
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
655
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
656
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
657
+ def modify_subscription_ack_deadline(subscription, modify_ack_deadline_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
658
+ command = make_simple_command(:post, 'v1/{+subscription}:modifyAckDeadline', options)
659
+ command.request_representation = Google::Apis::PubsubV1::ModifyAckDeadlineRequest::Representation
660
+ command.request_object = modify_ack_deadline_request_object
661
+ command.response_representation = Google::Apis::PubsubV1::Empty::Representation
662
+ command.response_class = Google::Apis::PubsubV1::Empty
663
+ command.params['subscription'] = subscription unless subscription.nil?
664
+ command.query['fields'] = fields unless fields.nil?
665
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
666
+ execute_or_queue_command(command, &block)
667
+ end
668
+
669
+ # Modifies the `PushConfig` for a specified subscription. This may be used to
670
+ # change a push subscription to a pull one (signified by an empty `PushConfig`)
671
+ # or vice versa, or change the endpoint URL and other attributes of a push
672
+ # subscription. Messages will accumulate for delivery continuously through the
673
+ # call regardless of changes to the `PushConfig`.
674
+ # @param [String] subscription
675
+ # Required. The name of the subscription. Format is `projects/`project`/
676
+ # subscriptions/`sub``.
677
+ # @param [Google::Apis::PubsubV1::ModifyPushConfigRequest] modify_push_config_request_object
678
+ # @param [String] fields
679
+ # Selector specifying which fields to include in a partial response.
680
+ # @param [String] quota_user
681
+ # Available to use for quota purposes for server-side applications. Can be any
682
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
683
+ # @param [Google::Apis::RequestOptions] options
684
+ # Request-specific options
685
+ #
686
+ # @yield [result, err] Result & error if block supplied
687
+ # @yieldparam result [Google::Apis::PubsubV1::Empty] parsed result object
688
+ # @yieldparam err [StandardError] error object if request failed
689
+ #
690
+ # @return [Google::Apis::PubsubV1::Empty]
691
+ #
692
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
693
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
694
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
695
+ def modify_subscription_push_config(subscription, modify_push_config_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
696
+ command = make_simple_command(:post, 'v1/{+subscription}:modifyPushConfig', options)
697
+ command.request_representation = Google::Apis::PubsubV1::ModifyPushConfigRequest::Representation
698
+ command.request_object = modify_push_config_request_object
699
+ command.response_representation = Google::Apis::PubsubV1::Empty::Representation
700
+ command.response_class = Google::Apis::PubsubV1::Empty
701
+ command.params['subscription'] = subscription unless subscription.nil?
702
+ command.query['fields'] = fields unless fields.nil?
703
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
704
+ execute_or_queue_command(command, &block)
705
+ end
706
+
707
+ # Updates an existing subscription. Note that certain properties of a
708
+ # subscription, such as its topic, are not modifiable.
709
+ # @param [String] name
710
+ # Required. The name of the subscription. It must have the format `"projects/`
711
+ # project`/subscriptions/`subscription`"`. ``subscription`` must start with a
712
+ # letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
713
+ # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`
714
+ # %`). It must be between 3 and 255 characters in length, and it must not start
715
+ # with `"goog"`.
716
+ # @param [Google::Apis::PubsubV1::UpdateSubscriptionRequest] update_subscription_request_object
717
+ # @param [String] fields
718
+ # Selector specifying which fields to include in a partial response.
719
+ # @param [String] quota_user
720
+ # Available to use for quota purposes for server-side applications. Can be any
721
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
722
+ # @param [Google::Apis::RequestOptions] options
723
+ # Request-specific options
724
+ #
725
+ # @yield [result, err] Result & error if block supplied
726
+ # @yieldparam result [Google::Apis::PubsubV1::Subscription] parsed result object
727
+ # @yieldparam err [StandardError] error object if request failed
728
+ #
729
+ # @return [Google::Apis::PubsubV1::Subscription]
730
+ #
731
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
732
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
733
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
734
+ def patch_project_subscription(name, update_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
735
+ command = make_simple_command(:patch, 'v1/{+name}', options)
736
+ command.request_representation = Google::Apis::PubsubV1::UpdateSubscriptionRequest::Representation
737
+ command.request_object = update_subscription_request_object
738
+ command.response_representation = Google::Apis::PubsubV1::Subscription::Representation
739
+ command.response_class = Google::Apis::PubsubV1::Subscription
740
+ command.params['name'] = name unless name.nil?
741
+ command.query['fields'] = fields unless fields.nil?
742
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
743
+ execute_or_queue_command(command, &block)
744
+ end
745
+
746
+ # Pulls messages from the server. The server may return `UNAVAILABLE` if there
747
+ # are too many concurrent pull requests pending for the given subscription.
748
+ # @param [String] subscription
749
+ # Required. The subscription from which messages should be pulled. Format is `
750
+ # projects/`project`/subscriptions/`sub``.
751
+ # @param [Google::Apis::PubsubV1::PullRequest] pull_request_object
752
+ # @param [String] fields
753
+ # Selector specifying which fields to include in a partial response.
754
+ # @param [String] quota_user
755
+ # Available to use for quota purposes for server-side applications. Can be any
756
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
757
+ # @param [Google::Apis::RequestOptions] options
758
+ # Request-specific options
759
+ #
760
+ # @yield [result, err] Result & error if block supplied
761
+ # @yieldparam result [Google::Apis::PubsubV1::PullResponse] parsed result object
762
+ # @yieldparam err [StandardError] error object if request failed
763
+ #
764
+ # @return [Google::Apis::PubsubV1::PullResponse]
765
+ #
766
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
767
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
768
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
769
+ def pull_subscription(subscription, pull_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
770
+ command = make_simple_command(:post, 'v1/{+subscription}:pull', options)
771
+ command.request_representation = Google::Apis::PubsubV1::PullRequest::Representation
772
+ command.request_object = pull_request_object
773
+ command.response_representation = Google::Apis::PubsubV1::PullResponse::Representation
774
+ command.response_class = Google::Apis::PubsubV1::PullResponse
775
+ command.params['subscription'] = subscription unless subscription.nil?
776
+ command.query['fields'] = fields unless fields.nil?
777
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
778
+ execute_or_queue_command(command, &block)
779
+ end
780
+
781
+ # Seeks an existing subscription to a point in time or to a given snapshot,
782
+ # whichever is provided in the request. Snapshots are used in [Seek] (https://
783
+ # cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to
784
+ # manage message acknowledgments in bulk. That is, you can set the
785
+ # acknowledgment state of messages in an existing subscription to the state
786
+ # captured by a snapshot. Note that both the subscription and the snapshot must
787
+ # be on the same topic.
788
+ # @param [String] subscription
789
+ # Required. The subscription to affect.
790
+ # @param [Google::Apis::PubsubV1::SeekRequest] seek_request_object
791
+ # @param [String] fields
792
+ # Selector specifying which fields to include in a partial response.
793
+ # @param [String] quota_user
794
+ # Available to use for quota purposes for server-side applications. Can be any
795
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
796
+ # @param [Google::Apis::RequestOptions] options
797
+ # Request-specific options
798
+ #
799
+ # @yield [result, err] Result & error if block supplied
800
+ # @yieldparam result [Google::Apis::PubsubV1::SeekResponse] parsed result object
801
+ # @yieldparam err [StandardError] error object if request failed
802
+ #
803
+ # @return [Google::Apis::PubsubV1::SeekResponse]
804
+ #
805
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
806
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
807
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
808
+ def seek_subscription(subscription, seek_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
809
+ command = make_simple_command(:post, 'v1/{+subscription}:seek', options)
810
+ command.request_representation = Google::Apis::PubsubV1::SeekRequest::Representation
811
+ command.request_object = seek_request_object
812
+ command.response_representation = Google::Apis::PubsubV1::SeekResponse::Representation
813
+ command.response_class = Google::Apis::PubsubV1::SeekResponse
814
+ command.params['subscription'] = subscription unless subscription.nil?
815
+ command.query['fields'] = fields unless fields.nil?
816
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
817
+ execute_or_queue_command(command, &block)
818
+ end
819
+
820
+ # Sets the access control policy on the specified resource. Replaces any
821
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
822
+ # PERMISSION_DENIED` errors.
823
+ # @param [String] resource
824
+ # REQUIRED: The resource for which the policy is being specified. See the
825
+ # operation documentation for the appropriate value for this field.
826
+ # @param [Google::Apis::PubsubV1::SetIamPolicyRequest] set_iam_policy_request_object
827
+ # @param [String] fields
828
+ # Selector specifying which fields to include in a partial response.
829
+ # @param [String] quota_user
830
+ # Available to use for quota purposes for server-side applications. Can be any
831
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
832
+ # @param [Google::Apis::RequestOptions] options
833
+ # Request-specific options
834
+ #
835
+ # @yield [result, err] Result & error if block supplied
836
+ # @yieldparam result [Google::Apis::PubsubV1::Policy] parsed result object
837
+ # @yieldparam err [StandardError] error object if request failed
838
+ #
839
+ # @return [Google::Apis::PubsubV1::Policy]
840
+ #
841
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
842
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
843
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
844
+ def set_subscription_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
845
+ command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
846
+ command.request_representation = Google::Apis::PubsubV1::SetIamPolicyRequest::Representation
847
+ command.request_object = set_iam_policy_request_object
848
+ command.response_representation = Google::Apis::PubsubV1::Policy::Representation
849
+ command.response_class = Google::Apis::PubsubV1::Policy
850
+ command.params['resource'] = resource unless resource.nil?
851
+ command.query['fields'] = fields unless fields.nil?
852
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
853
+ execute_or_queue_command(command, &block)
854
+ end
855
+
856
+ # Returns permissions that a caller has on the specified resource. If the
857
+ # resource does not exist, this will return an empty set of permissions, not a `
858
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
859
+ # permission-aware UIs and command-line tools, not for authorization checking.
860
+ # This operation may "fail open" without warning.
861
+ # @param [String] resource
862
+ # REQUIRED: The resource for which the policy detail is being requested. See the
863
+ # operation documentation for the appropriate value for this field.
864
+ # @param [Google::Apis::PubsubV1::TestIamPermissionsRequest] test_iam_permissions_request_object
865
+ # @param [String] fields
866
+ # Selector specifying which fields to include in a partial response.
867
+ # @param [String] quota_user
868
+ # Available to use for quota purposes for server-side applications. Can be any
869
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
870
+ # @param [Google::Apis::RequestOptions] options
871
+ # Request-specific options
872
+ #
873
+ # @yield [result, err] Result & error if block supplied
874
+ # @yieldparam result [Google::Apis::PubsubV1::TestIamPermissionsResponse] parsed result object
875
+ # @yieldparam err [StandardError] error object if request failed
876
+ #
877
+ # @return [Google::Apis::PubsubV1::TestIamPermissionsResponse]
878
+ #
879
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
880
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
881
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
882
+ def test_subscription_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
883
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
884
+ command.request_representation = Google::Apis::PubsubV1::TestIamPermissionsRequest::Representation
885
+ command.request_object = test_iam_permissions_request_object
886
+ command.response_representation = Google::Apis::PubsubV1::TestIamPermissionsResponse::Representation
887
+ command.response_class = Google::Apis::PubsubV1::TestIamPermissionsResponse
888
+ command.params['resource'] = resource unless resource.nil?
889
+ command.query['fields'] = fields unless fields.nil?
890
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
891
+ execute_or_queue_command(command, &block)
892
+ end
893
+
894
+ # Creates the given topic with the given name. See the [resource name rules] (
895
+ # https://cloud.google.com/pubsub/docs/admin#resource_names).
896
+ # @param [String] name
897
+ # Required. The name of the topic. It must have the format `"projects/`project`/
898
+ # topics/`topic`"`. ``topic`` must start with a letter, and contain only letters
899
+ # (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`)
900
+ # , tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and
901
+ # 255 characters in length, and it must not start with `"goog"`.
902
+ # @param [Google::Apis::PubsubV1::Topic] topic_object
903
+ # @param [String] fields
904
+ # Selector specifying which fields to include in a partial response.
905
+ # @param [String] quota_user
906
+ # Available to use for quota purposes for server-side applications. Can be any
907
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
908
+ # @param [Google::Apis::RequestOptions] options
909
+ # Request-specific options
910
+ #
911
+ # @yield [result, err] Result & error if block supplied
912
+ # @yieldparam result [Google::Apis::PubsubV1::Topic] parsed result object
913
+ # @yieldparam err [StandardError] error object if request failed
914
+ #
915
+ # @return [Google::Apis::PubsubV1::Topic]
916
+ #
917
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
918
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
919
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
920
+ def create_topic(name, topic_object = nil, fields: nil, quota_user: nil, options: nil, &block)
921
+ command = make_simple_command(:put, 'v1/{+name}', options)
922
+ command.request_representation = Google::Apis::PubsubV1::Topic::Representation
923
+ command.request_object = topic_object
924
+ command.response_representation = Google::Apis::PubsubV1::Topic::Representation
925
+ command.response_class = Google::Apis::PubsubV1::Topic
926
+ command.params['name'] = name unless name.nil?
927
+ command.query['fields'] = fields unless fields.nil?
928
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
929
+ execute_or_queue_command(command, &block)
930
+ end
931
+
932
+ # Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does
933
+ # not exist. After a topic is deleted, a new topic may be created with the same
934
+ # name; this is an entirely new topic with none of the old configuration or
935
+ # subscriptions. Existing subscriptions to this topic are not deleted, but their
936
+ # `topic` field is set to `_deleted-topic_`.
937
+ # @param [String] topic
938
+ # Required. Name of the topic to delete. Format is `projects/`project`/topics/`
939
+ # topic``.
940
+ # @param [String] fields
941
+ # Selector specifying which fields to include in a partial response.
942
+ # @param [String] quota_user
943
+ # Available to use for quota purposes for server-side applications. Can be any
944
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
945
+ # @param [Google::Apis::RequestOptions] options
946
+ # Request-specific options
947
+ #
948
+ # @yield [result, err] Result & error if block supplied
949
+ # @yieldparam result [Google::Apis::PubsubV1::Empty] parsed result object
950
+ # @yieldparam err [StandardError] error object if request failed
951
+ #
952
+ # @return [Google::Apis::PubsubV1::Empty]
953
+ #
954
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
955
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
956
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
957
+ def delete_topic(topic, fields: nil, quota_user: nil, options: nil, &block)
958
+ command = make_simple_command(:delete, 'v1/{+topic}', options)
959
+ command.response_representation = Google::Apis::PubsubV1::Empty::Representation
960
+ command.response_class = Google::Apis::PubsubV1::Empty
961
+ command.params['topic'] = topic unless topic.nil?
962
+ command.query['fields'] = fields unless fields.nil?
963
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
964
+ execute_or_queue_command(command, &block)
965
+ end
966
+
967
+ # Gets the configuration of a topic.
968
+ # @param [String] topic
969
+ # Required. The name of the topic to get. Format is `projects/`project`/topics/`
970
+ # topic``.
971
+ # @param [String] fields
972
+ # Selector specifying which fields to include in a partial response.
973
+ # @param [String] quota_user
974
+ # Available to use for quota purposes for server-side applications. Can be any
975
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
976
+ # @param [Google::Apis::RequestOptions] options
977
+ # Request-specific options
978
+ #
979
+ # @yield [result, err] Result & error if block supplied
980
+ # @yieldparam result [Google::Apis::PubsubV1::Topic] parsed result object
981
+ # @yieldparam err [StandardError] error object if request failed
982
+ #
983
+ # @return [Google::Apis::PubsubV1::Topic]
984
+ #
985
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
986
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
987
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
988
+ def get_topic(topic, fields: nil, quota_user: nil, options: nil, &block)
989
+ command = make_simple_command(:get, 'v1/{+topic}', options)
990
+ command.response_representation = Google::Apis::PubsubV1::Topic::Representation
991
+ command.response_class = Google::Apis::PubsubV1::Topic
992
+ command.params['topic'] = topic unless topic.nil?
993
+ command.query['fields'] = fields unless fields.nil?
994
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
995
+ execute_or_queue_command(command, &block)
996
+ end
997
+
998
+ # Gets the access control policy for a resource. Returns an empty policy if the
999
+ # resource exists and does not have a policy set.
1000
+ # @param [String] resource
1001
+ # REQUIRED: The resource for which the policy is being requested. See the
1002
+ # operation documentation for the appropriate value for this field.
1003
+ # @param [Fixnum] options_requested_policy_version
1004
+ # Optional. The policy format version to be returned. Valid values are 0, 1, and
1005
+ # 3. Requests specifying an invalid value will be rejected. Requests for
1006
+ # policies with any conditional bindings must specify version 3. Policies
1007
+ # without any conditional bindings may specify any valid value or leave the
1008
+ # field unset. To learn which resources support conditions in their IAM policies,
1009
+ # see the [IAM documentation](https://cloud.google.com/iam/help/conditions/
1010
+ # resource-policies).
1011
+ # @param [String] fields
1012
+ # Selector specifying which fields to include in a partial response.
1013
+ # @param [String] quota_user
1014
+ # Available to use for quota purposes for server-side applications. Can be any
1015
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1016
+ # @param [Google::Apis::RequestOptions] options
1017
+ # Request-specific options
1018
+ #
1019
+ # @yield [result, err] Result & error if block supplied
1020
+ # @yieldparam result [Google::Apis::PubsubV1::Policy] parsed result object
1021
+ # @yieldparam err [StandardError] error object if request failed
1022
+ #
1023
+ # @return [Google::Apis::PubsubV1::Policy]
1024
+ #
1025
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1026
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1027
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1028
+ def get_project_topic_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
1029
+ command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
1030
+ command.response_representation = Google::Apis::PubsubV1::Policy::Representation
1031
+ command.response_class = Google::Apis::PubsubV1::Policy
1032
+ command.params['resource'] = resource unless resource.nil?
1033
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
1034
+ command.query['fields'] = fields unless fields.nil?
1035
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1036
+ execute_or_queue_command(command, &block)
1037
+ end
1038
+
1039
+ # Lists matching topics.
1040
+ # @param [String] project
1041
+ # Required. The name of the project in which to list topics. Format is `projects/
1042
+ # `project-id``.
1043
+ # @param [Fixnum] page_size
1044
+ # Maximum number of topics to return.
1045
+ # @param [String] page_token
1046
+ # The value returned by the last `ListTopicsResponse`; indicates that this is a
1047
+ # continuation of a prior `ListTopics` call, and that the system should return
1048
+ # the next page of data.
1049
+ # @param [String] fields
1050
+ # Selector specifying which fields to include in a partial response.
1051
+ # @param [String] quota_user
1052
+ # Available to use for quota purposes for server-side applications. Can be any
1053
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1054
+ # @param [Google::Apis::RequestOptions] options
1055
+ # Request-specific options
1056
+ #
1057
+ # @yield [result, err] Result & error if block supplied
1058
+ # @yieldparam result [Google::Apis::PubsubV1::ListTopicsResponse] parsed result object
1059
+ # @yieldparam err [StandardError] error object if request failed
1060
+ #
1061
+ # @return [Google::Apis::PubsubV1::ListTopicsResponse]
1062
+ #
1063
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1064
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1065
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1066
+ def list_topics(project, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1067
+ command = make_simple_command(:get, 'v1/{+project}/topics', options)
1068
+ command.response_representation = Google::Apis::PubsubV1::ListTopicsResponse::Representation
1069
+ command.response_class = Google::Apis::PubsubV1::ListTopicsResponse
1070
+ command.params['project'] = project unless project.nil?
1071
+ command.query['pageSize'] = page_size unless page_size.nil?
1072
+ command.query['pageToken'] = page_token unless page_token.nil?
1073
+ command.query['fields'] = fields unless fields.nil?
1074
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1075
+ execute_or_queue_command(command, &block)
1076
+ end
1077
+
1078
+ # Updates an existing topic. Note that certain properties of a topic are not
1079
+ # modifiable.
1080
+ # @param [String] name
1081
+ # Required. The name of the topic. It must have the format `"projects/`project`/
1082
+ # topics/`topic`"`. ``topic`` must start with a letter, and contain only letters
1083
+ # (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`)
1084
+ # , tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and
1085
+ # 255 characters in length, and it must not start with `"goog"`.
1086
+ # @param [Google::Apis::PubsubV1::UpdateTopicRequest] update_topic_request_object
1087
+ # @param [String] fields
1088
+ # Selector specifying which fields to include in a partial response.
1089
+ # @param [String] quota_user
1090
+ # Available to use for quota purposes for server-side applications. Can be any
1091
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1092
+ # @param [Google::Apis::RequestOptions] options
1093
+ # Request-specific options
1094
+ #
1095
+ # @yield [result, err] Result & error if block supplied
1096
+ # @yieldparam result [Google::Apis::PubsubV1::Topic] parsed result object
1097
+ # @yieldparam err [StandardError] error object if request failed
1098
+ #
1099
+ # @return [Google::Apis::PubsubV1::Topic]
1100
+ #
1101
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1102
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1103
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1104
+ def patch_project_topic(name, update_topic_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1105
+ command = make_simple_command(:patch, 'v1/{+name}', options)
1106
+ command.request_representation = Google::Apis::PubsubV1::UpdateTopicRequest::Representation
1107
+ command.request_object = update_topic_request_object
1108
+ command.response_representation = Google::Apis::PubsubV1::Topic::Representation
1109
+ command.response_class = Google::Apis::PubsubV1::Topic
1110
+ command.params['name'] = name unless name.nil?
1111
+ command.query['fields'] = fields unless fields.nil?
1112
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1113
+ execute_or_queue_command(command, &block)
1114
+ end
1115
+
1116
+ # Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does
1117
+ # not exist.
1118
+ # @param [String] topic
1119
+ # Required. The messages in the request will be published on this topic. Format
1120
+ # is `projects/`project`/topics/`topic``.
1121
+ # @param [Google::Apis::PubsubV1::PublishRequest] publish_request_object
1122
+ # @param [String] fields
1123
+ # Selector specifying which fields to include in a partial response.
1124
+ # @param [String] quota_user
1125
+ # Available to use for quota purposes for server-side applications. Can be any
1126
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1127
+ # @param [Google::Apis::RequestOptions] options
1128
+ # Request-specific options
1129
+ #
1130
+ # @yield [result, err] Result & error if block supplied
1131
+ # @yieldparam result [Google::Apis::PubsubV1::PublishResponse] parsed result object
1132
+ # @yieldparam err [StandardError] error object if request failed
1133
+ #
1134
+ # @return [Google::Apis::PubsubV1::PublishResponse]
1135
+ #
1136
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1137
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1138
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1139
+ def publish_topic(topic, publish_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1140
+ command = make_simple_command(:post, 'v1/{+topic}:publish', options)
1141
+ command.request_representation = Google::Apis::PubsubV1::PublishRequest::Representation
1142
+ command.request_object = publish_request_object
1143
+ command.response_representation = Google::Apis::PubsubV1::PublishResponse::Representation
1144
+ command.response_class = Google::Apis::PubsubV1::PublishResponse
1145
+ command.params['topic'] = topic unless topic.nil?
1146
+ command.query['fields'] = fields unless fields.nil?
1147
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1148
+ execute_or_queue_command(command, &block)
1149
+ end
1150
+
1151
+ # Sets the access control policy on the specified resource. Replaces any
1152
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
1153
+ # PERMISSION_DENIED` errors.
1154
+ # @param [String] resource
1155
+ # REQUIRED: The resource for which the policy is being specified. See the
1156
+ # operation documentation for the appropriate value for this field.
1157
+ # @param [Google::Apis::PubsubV1::SetIamPolicyRequest] set_iam_policy_request_object
1158
+ # @param [String] fields
1159
+ # Selector specifying which fields to include in a partial response.
1160
+ # @param [String] quota_user
1161
+ # Available to use for quota purposes for server-side applications. Can be any
1162
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1163
+ # @param [Google::Apis::RequestOptions] options
1164
+ # Request-specific options
1165
+ #
1166
+ # @yield [result, err] Result & error if block supplied
1167
+ # @yieldparam result [Google::Apis::PubsubV1::Policy] parsed result object
1168
+ # @yieldparam err [StandardError] error object if request failed
1169
+ #
1170
+ # @return [Google::Apis::PubsubV1::Policy]
1171
+ #
1172
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1173
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1174
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1175
+ def set_topic_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1176
+ command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
1177
+ command.request_representation = Google::Apis::PubsubV1::SetIamPolicyRequest::Representation
1178
+ command.request_object = set_iam_policy_request_object
1179
+ command.response_representation = Google::Apis::PubsubV1::Policy::Representation
1180
+ command.response_class = Google::Apis::PubsubV1::Policy
1181
+ command.params['resource'] = resource unless resource.nil?
1182
+ command.query['fields'] = fields unless fields.nil?
1183
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1184
+ execute_or_queue_command(command, &block)
1185
+ end
1186
+
1187
+ # Returns permissions that a caller has on the specified resource. If the
1188
+ # resource does not exist, this will return an empty set of permissions, not a `
1189
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
1190
+ # permission-aware UIs and command-line tools, not for authorization checking.
1191
+ # This operation may "fail open" without warning.
1192
+ # @param [String] resource
1193
+ # REQUIRED: The resource for which the policy detail is being requested. See the
1194
+ # operation documentation for the appropriate value for this field.
1195
+ # @param [Google::Apis::PubsubV1::TestIamPermissionsRequest] test_iam_permissions_request_object
1196
+ # @param [String] fields
1197
+ # Selector specifying which fields to include in a partial response.
1198
+ # @param [String] quota_user
1199
+ # Available to use for quota purposes for server-side applications. Can be any
1200
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1201
+ # @param [Google::Apis::RequestOptions] options
1202
+ # Request-specific options
1203
+ #
1204
+ # @yield [result, err] Result & error if block supplied
1205
+ # @yieldparam result [Google::Apis::PubsubV1::TestIamPermissionsResponse] parsed result object
1206
+ # @yieldparam err [StandardError] error object if request failed
1207
+ #
1208
+ # @return [Google::Apis::PubsubV1::TestIamPermissionsResponse]
1209
+ #
1210
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1211
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1212
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1213
+ def test_topic_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1214
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
1215
+ command.request_representation = Google::Apis::PubsubV1::TestIamPermissionsRequest::Representation
1216
+ command.request_object = test_iam_permissions_request_object
1217
+ command.response_representation = Google::Apis::PubsubV1::TestIamPermissionsResponse::Representation
1218
+ command.response_class = Google::Apis::PubsubV1::TestIamPermissionsResponse
1219
+ command.params['resource'] = resource unless resource.nil?
1220
+ command.query['fields'] = fields unless fields.nil?
1221
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1222
+ execute_or_queue_command(command, &block)
1223
+ end
1224
+
1225
+ # Lists the names of the snapshots on this topic. Snapshots are used in [Seek](
1226
+ # https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow
1227
+ # you to manage message acknowledgments in bulk. That is, you can set the
1228
+ # acknowledgment state of messages in an existing subscription to the state
1229
+ # captured by a snapshot.
1230
+ # @param [String] topic
1231
+ # Required. The name of the topic that snapshots are attached to. Format is `
1232
+ # projects/`project`/topics/`topic``.
1233
+ # @param [Fixnum] page_size
1234
+ # Maximum number of snapshot names to return.
1235
+ # @param [String] page_token
1236
+ # The value returned by the last `ListTopicSnapshotsResponse`; indicates that
1237
+ # this is a continuation of a prior `ListTopicSnapshots` call, and that the
1238
+ # system should return the next page of data.
1239
+ # @param [String] fields
1240
+ # Selector specifying which fields to include in a partial response.
1241
+ # @param [String] quota_user
1242
+ # Available to use for quota purposes for server-side applications. Can be any
1243
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1244
+ # @param [Google::Apis::RequestOptions] options
1245
+ # Request-specific options
1246
+ #
1247
+ # @yield [result, err] Result & error if block supplied
1248
+ # @yieldparam result [Google::Apis::PubsubV1::ListTopicSnapshotsResponse] parsed result object
1249
+ # @yieldparam err [StandardError] error object if request failed
1250
+ #
1251
+ # @return [Google::Apis::PubsubV1::ListTopicSnapshotsResponse]
1252
+ #
1253
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1254
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1255
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1256
+ def list_project_topic_snapshots(topic, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1257
+ command = make_simple_command(:get, 'v1/{+topic}/snapshots', options)
1258
+ command.response_representation = Google::Apis::PubsubV1::ListTopicSnapshotsResponse::Representation
1259
+ command.response_class = Google::Apis::PubsubV1::ListTopicSnapshotsResponse
1260
+ command.params['topic'] = topic unless topic.nil?
1261
+ command.query['pageSize'] = page_size unless page_size.nil?
1262
+ command.query['pageToken'] = page_token unless page_token.nil?
1263
+ command.query['fields'] = fields unless fields.nil?
1264
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1265
+ execute_or_queue_command(command, &block)
1266
+ end
1267
+
1268
+ # Lists the names of the attached subscriptions on this topic.
1269
+ # @param [String] topic
1270
+ # Required. The name of the topic that subscriptions are attached to. Format is `
1271
+ # projects/`project`/topics/`topic``.
1272
+ # @param [Fixnum] page_size
1273
+ # Maximum number of subscription names to return.
1274
+ # @param [String] page_token
1275
+ # The value returned by the last `ListTopicSubscriptionsResponse`; indicates
1276
+ # that this is a continuation of a prior `ListTopicSubscriptions` call, and that
1277
+ # the system should return the next page of data.
1278
+ # @param [String] fields
1279
+ # Selector specifying which fields to include in a partial response.
1280
+ # @param [String] quota_user
1281
+ # Available to use for quota purposes for server-side applications. Can be any
1282
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1283
+ # @param [Google::Apis::RequestOptions] options
1284
+ # Request-specific options
1285
+ #
1286
+ # @yield [result, err] Result & error if block supplied
1287
+ # @yieldparam result [Google::Apis::PubsubV1::ListTopicSubscriptionsResponse] parsed result object
1288
+ # @yieldparam err [StandardError] error object if request failed
1289
+ #
1290
+ # @return [Google::Apis::PubsubV1::ListTopicSubscriptionsResponse]
1291
+ #
1292
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1293
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1294
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1295
+ def list_topic_subscriptions(topic, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1296
+ command = make_simple_command(:get, 'v1/{+topic}/subscriptions', options)
1297
+ command.response_representation = Google::Apis::PubsubV1::ListTopicSubscriptionsResponse::Representation
1298
+ command.response_class = Google::Apis::PubsubV1::ListTopicSubscriptionsResponse
1299
+ command.params['topic'] = topic unless topic.nil?
1300
+ command.query['pageSize'] = page_size unless page_size.nil?
1301
+ command.query['pageToken'] = page_token unless page_token.nil?
1302
+ command.query['fields'] = fields unless fields.nil?
1303
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1304
+ execute_or_queue_command(command, &block)
1305
+ end
1306
+
1307
+ protected
1308
+
1309
+ def apply_command_defaults(command)
1310
+ command.query['key'] = key unless key.nil?
1311
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1312
+ end
1313
+ end
1314
+ end
1315
+ end
1316
+ end