google-apis-pubsub_v1beta1a 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
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
+ module Google
16
+ module Apis
17
+ module PubsubV1beta1a
18
+ # Version of the google-apis-pubsub_v1beta1a gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20200807"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,306 @@
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 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module PubsubV1beta1a
24
+
25
+ class AcknowledgeRequest
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class Empty
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class Label
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class ListSubscriptionsResponse
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class ListTopicsResponse
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class ModifyAckDeadlineRequest
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class ModifyPushConfigRequest
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class PublishBatchRequest
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class PublishBatchResponse
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class PublishRequest
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class PubsubEvent
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class PubsubMessage
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class PullBatchRequest
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class PullBatchResponse
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class PullRequest
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class PullResponse
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class PushConfig
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class Subscription
128
+ class Representation < Google::Apis::Core::JsonRepresentation; end
129
+
130
+ include Google::Apis::Core::JsonObjectSupport
131
+ end
132
+
133
+ class Topic
134
+ class Representation < Google::Apis::Core::JsonRepresentation; end
135
+
136
+ include Google::Apis::Core::JsonObjectSupport
137
+ end
138
+
139
+ class AcknowledgeRequest
140
+ # @private
141
+ class Representation < Google::Apis::Core::JsonRepresentation
142
+ collection :ack_id, as: 'ackId'
143
+ property :subscription, as: 'subscription'
144
+ end
145
+ end
146
+
147
+ class Empty
148
+ # @private
149
+ class Representation < Google::Apis::Core::JsonRepresentation
150
+ end
151
+ end
152
+
153
+ class Label
154
+ # @private
155
+ class Representation < Google::Apis::Core::JsonRepresentation
156
+ property :key, as: 'key'
157
+ property :num_value, :numeric_string => true, as: 'numValue'
158
+ property :str_value, as: 'strValue'
159
+ end
160
+ end
161
+
162
+ class ListSubscriptionsResponse
163
+ # @private
164
+ class Representation < Google::Apis::Core::JsonRepresentation
165
+ property :next_page_token, as: 'nextPageToken'
166
+ collection :subscription, as: 'subscription', class: Google::Apis::PubsubV1beta1a::Subscription, decorator: Google::Apis::PubsubV1beta1a::Subscription::Representation
167
+
168
+ end
169
+ end
170
+
171
+ class ListTopicsResponse
172
+ # @private
173
+ class Representation < Google::Apis::Core::JsonRepresentation
174
+ property :next_page_token, as: 'nextPageToken'
175
+ collection :topic, as: 'topic', class: Google::Apis::PubsubV1beta1a::Topic, decorator: Google::Apis::PubsubV1beta1a::Topic::Representation
176
+
177
+ end
178
+ end
179
+
180
+ class ModifyAckDeadlineRequest
181
+ # @private
182
+ class Representation < Google::Apis::Core::JsonRepresentation
183
+ property :ack_deadline_seconds, as: 'ackDeadlineSeconds'
184
+ property :ack_id, as: 'ackId'
185
+ collection :ack_ids, as: 'ackIds'
186
+ property :subscription, as: 'subscription'
187
+ end
188
+ end
189
+
190
+ class ModifyPushConfigRequest
191
+ # @private
192
+ class Representation < Google::Apis::Core::JsonRepresentation
193
+ property :push_config, as: 'pushConfig', class: Google::Apis::PubsubV1beta1a::PushConfig, decorator: Google::Apis::PubsubV1beta1a::PushConfig::Representation
194
+
195
+ property :subscription, as: 'subscription'
196
+ end
197
+ end
198
+
199
+ class PublishBatchRequest
200
+ # @private
201
+ class Representation < Google::Apis::Core::JsonRepresentation
202
+ collection :messages, as: 'messages', class: Google::Apis::PubsubV1beta1a::PubsubMessage, decorator: Google::Apis::PubsubV1beta1a::PubsubMessage::Representation
203
+
204
+ property :topic, as: 'topic'
205
+ end
206
+ end
207
+
208
+ class PublishBatchResponse
209
+ # @private
210
+ class Representation < Google::Apis::Core::JsonRepresentation
211
+ collection :message_ids, as: 'messageIds'
212
+ end
213
+ end
214
+
215
+ class PublishRequest
216
+ # @private
217
+ class Representation < Google::Apis::Core::JsonRepresentation
218
+ property :message, as: 'message', class: Google::Apis::PubsubV1beta1a::PubsubMessage, decorator: Google::Apis::PubsubV1beta1a::PubsubMessage::Representation
219
+
220
+ property :topic, as: 'topic'
221
+ end
222
+ end
223
+
224
+ class PubsubEvent
225
+ # @private
226
+ class Representation < Google::Apis::Core::JsonRepresentation
227
+ property :deleted, as: 'deleted'
228
+ property :message, as: 'message', class: Google::Apis::PubsubV1beta1a::PubsubMessage, decorator: Google::Apis::PubsubV1beta1a::PubsubMessage::Representation
229
+
230
+ property :subscription, as: 'subscription'
231
+ property :truncated, as: 'truncated'
232
+ end
233
+ end
234
+
235
+ class PubsubMessage
236
+ # @private
237
+ class Representation < Google::Apis::Core::JsonRepresentation
238
+ property :data, :base64 => true, as: 'data'
239
+ collection :label, as: 'label', class: Google::Apis::PubsubV1beta1a::Label, decorator: Google::Apis::PubsubV1beta1a::Label::Representation
240
+
241
+ property :message_id, as: 'messageId'
242
+ property :publish_time, :numeric_string => true, as: 'publishTime'
243
+ end
244
+ end
245
+
246
+ class PullBatchRequest
247
+ # @private
248
+ class Representation < Google::Apis::Core::JsonRepresentation
249
+ property :max_events, as: 'maxEvents'
250
+ property :return_immediately, as: 'returnImmediately'
251
+ property :subscription, as: 'subscription'
252
+ end
253
+ end
254
+
255
+ class PullBatchResponse
256
+ # @private
257
+ class Representation < Google::Apis::Core::JsonRepresentation
258
+ collection :pull_responses, as: 'pullResponses', class: Google::Apis::PubsubV1beta1a::PullResponse, decorator: Google::Apis::PubsubV1beta1a::PullResponse::Representation
259
+
260
+ end
261
+ end
262
+
263
+ class PullRequest
264
+ # @private
265
+ class Representation < Google::Apis::Core::JsonRepresentation
266
+ property :return_immediately, as: 'returnImmediately'
267
+ property :subscription, as: 'subscription'
268
+ end
269
+ end
270
+
271
+ class PullResponse
272
+ # @private
273
+ class Representation < Google::Apis::Core::JsonRepresentation
274
+ property :ack_id, as: 'ackId'
275
+ property :pubsub_event, as: 'pubsubEvent', class: Google::Apis::PubsubV1beta1a::PubsubEvent, decorator: Google::Apis::PubsubV1beta1a::PubsubEvent::Representation
276
+
277
+ end
278
+ end
279
+
280
+ class PushConfig
281
+ # @private
282
+ class Representation < Google::Apis::Core::JsonRepresentation
283
+ property :push_endpoint, as: 'pushEndpoint'
284
+ end
285
+ end
286
+
287
+ class Subscription
288
+ # @private
289
+ class Representation < Google::Apis::Core::JsonRepresentation
290
+ property :ack_deadline_seconds, as: 'ackDeadlineSeconds'
291
+ property :name, as: 'name'
292
+ property :push_config, as: 'pushConfig', class: Google::Apis::PubsubV1beta1a::PushConfig, decorator: Google::Apis::PubsubV1beta1a::PushConfig::Representation
293
+
294
+ property :topic, as: 'topic'
295
+ end
296
+ end
297
+
298
+ class Topic
299
+ # @private
300
+ class Representation < Google::Apis::Core::JsonRepresentation
301
+ property :name, as: 'name'
302
+ end
303
+ end
304
+ end
305
+ end
306
+ end
@@ -0,0 +1,544 @@
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 PubsubV1beta1a
23
+ # Cloud Pub/Sub API
24
+ #
25
+ # Provides reliable, many-to-many, asynchronous messaging between applications.
26
+ #
27
+ # @example
28
+ # require 'google/apis/pubsub_v1beta1a'
29
+ #
30
+ # Pubsub = Google::Apis::PubsubV1beta1a # 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_v1beta1a',
48
+ client_version: Google::Apis::PubsubV1beta1a::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Acknowledges a particular received message: the Pub/Sub system can remove the
53
+ # given message from the subscription. Acknowledging a message whose Ack
54
+ # deadline has expired may succeed, but the message could have been already
55
+ # redelivered. Acknowledging a message more than once will not result in an
56
+ # error. This is only used for messages received via pull.
57
+ # @param [Google::Apis::PubsubV1beta1a::AcknowledgeRequest] acknowledge_request_object
58
+ # @param [String] fields
59
+ # Selector specifying which fields to include in a partial response.
60
+ # @param [String] quota_user
61
+ # Available to use for quota purposes for server-side applications. Can be any
62
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
63
+ # @param [Google::Apis::RequestOptions] options
64
+ # Request-specific options
65
+ #
66
+ # @yield [result, err] Result & error if block supplied
67
+ # @yieldparam result [Google::Apis::PubsubV1beta1a::Empty] parsed result object
68
+ # @yieldparam err [StandardError] error object if request failed
69
+ #
70
+ # @return [Google::Apis::PubsubV1beta1a::Empty]
71
+ #
72
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
73
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
74
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
75
+ def acknowledge_subscription(acknowledge_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
76
+ command = make_simple_command(:post, 'v1beta1a/subscriptions/acknowledge', options)
77
+ command.request_representation = Google::Apis::PubsubV1beta1a::AcknowledgeRequest::Representation
78
+ command.request_object = acknowledge_request_object
79
+ command.response_representation = Google::Apis::PubsubV1beta1a::Empty::Representation
80
+ command.response_class = Google::Apis::PubsubV1beta1a::Empty
81
+ command.query['fields'] = fields unless fields.nil?
82
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
83
+ execute_or_queue_command(command, &block)
84
+ end
85
+
86
+ # Creates a subscription on a given topic for a given subscriber. If the
87
+ # subscription already exists, returns ALREADY_EXISTS. If the corresponding
88
+ # topic doesn't exist, returns NOT_FOUND. If the name is not provided in the
89
+ # request, the server will assign a random name for this subscription on the
90
+ # same project as the topic.
91
+ # @param [Google::Apis::PubsubV1beta1a::Subscription] subscription_object
92
+ # @param [String] fields
93
+ # Selector specifying which fields to include in a partial response.
94
+ # @param [String] quota_user
95
+ # Available to use for quota purposes for server-side applications. Can be any
96
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
97
+ # @param [Google::Apis::RequestOptions] options
98
+ # Request-specific options
99
+ #
100
+ # @yield [result, err] Result & error if block supplied
101
+ # @yieldparam result [Google::Apis::PubsubV1beta1a::Subscription] parsed result object
102
+ # @yieldparam err [StandardError] error object if request failed
103
+ #
104
+ # @return [Google::Apis::PubsubV1beta1a::Subscription]
105
+ #
106
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
107
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
108
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
109
+ def create_subscription(subscription_object = nil, fields: nil, quota_user: nil, options: nil, &block)
110
+ command = make_simple_command(:post, 'v1beta1a/subscriptions', options)
111
+ command.request_representation = Google::Apis::PubsubV1beta1a::Subscription::Representation
112
+ command.request_object = subscription_object
113
+ command.response_representation = Google::Apis::PubsubV1beta1a::Subscription::Representation
114
+ command.response_class = Google::Apis::PubsubV1beta1a::Subscription
115
+ command.query['fields'] = fields unless fields.nil?
116
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
117
+ execute_or_queue_command(command, &block)
118
+ end
119
+
120
+ # Deletes an existing subscription. All pending messages in the subscription are
121
+ # immediately dropped. Calls to Pull after deletion will return NOT_FOUND.
122
+ # @param [String] subscription
123
+ # The subscription to delete.
124
+ # @param [String] fields
125
+ # Selector specifying which fields to include in a partial response.
126
+ # @param [String] quota_user
127
+ # Available to use for quota purposes for server-side applications. Can be any
128
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
129
+ # @param [Google::Apis::RequestOptions] options
130
+ # Request-specific options
131
+ #
132
+ # @yield [result, err] Result & error if block supplied
133
+ # @yieldparam result [Google::Apis::PubsubV1beta1a::Empty] parsed result object
134
+ # @yieldparam err [StandardError] error object if request failed
135
+ #
136
+ # @return [Google::Apis::PubsubV1beta1a::Empty]
137
+ #
138
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
139
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
140
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
141
+ def delete_subscription(subscription, fields: nil, quota_user: nil, options: nil, &block)
142
+ command = make_simple_command(:delete, 'v1beta1a/subscriptions/{+subscription}', options)
143
+ command.response_representation = Google::Apis::PubsubV1beta1a::Empty::Representation
144
+ command.response_class = Google::Apis::PubsubV1beta1a::Empty
145
+ command.params['subscription'] = subscription unless subscription.nil?
146
+ command.query['fields'] = fields unless fields.nil?
147
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
148
+ execute_or_queue_command(command, &block)
149
+ end
150
+
151
+ # Gets the configuration details of a subscription.
152
+ # @param [String] subscription
153
+ # The name of the subscription to get.
154
+ # @param [String] fields
155
+ # Selector specifying which fields to include in a partial response.
156
+ # @param [String] quota_user
157
+ # Available to use for quota purposes for server-side applications. Can be any
158
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
159
+ # @param [Google::Apis::RequestOptions] options
160
+ # Request-specific options
161
+ #
162
+ # @yield [result, err] Result & error if block supplied
163
+ # @yieldparam result [Google::Apis::PubsubV1beta1a::Subscription] parsed result object
164
+ # @yieldparam err [StandardError] error object if request failed
165
+ #
166
+ # @return [Google::Apis::PubsubV1beta1a::Subscription]
167
+ #
168
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
169
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
170
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
171
+ def get_subscription(subscription, fields: nil, quota_user: nil, options: nil, &block)
172
+ command = make_simple_command(:get, 'v1beta1a/subscriptions/{+subscription}', options)
173
+ command.response_representation = Google::Apis::PubsubV1beta1a::Subscription::Representation
174
+ command.response_class = Google::Apis::PubsubV1beta1a::Subscription
175
+ command.params['subscription'] = subscription unless subscription.nil?
176
+ command.query['fields'] = fields unless fields.nil?
177
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
178
+ execute_or_queue_command(command, &block)
179
+ end
180
+
181
+ # Lists matching subscriptions.
182
+ # @param [Fixnum] max_results
183
+ # Maximum number of subscriptions to return.
184
+ # @param [String] page_token
185
+ # The value obtained in the last ListSubscriptionsResponse for continuation.
186
+ # @param [String] query
187
+ # A valid label query expression.
188
+ # @param [String] fields
189
+ # Selector specifying which fields to include in a partial response.
190
+ # @param [String] quota_user
191
+ # Available to use for quota purposes for server-side applications. Can be any
192
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
193
+ # @param [Google::Apis::RequestOptions] options
194
+ # Request-specific options
195
+ #
196
+ # @yield [result, err] Result & error if block supplied
197
+ # @yieldparam result [Google::Apis::PubsubV1beta1a::ListSubscriptionsResponse] parsed result object
198
+ # @yieldparam err [StandardError] error object if request failed
199
+ #
200
+ # @return [Google::Apis::PubsubV1beta1a::ListSubscriptionsResponse]
201
+ #
202
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
203
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
204
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
205
+ def list_subscriptions(max_results: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil, &block)
206
+ command = make_simple_command(:get, 'v1beta1a/subscriptions', options)
207
+ command.response_representation = Google::Apis::PubsubV1beta1a::ListSubscriptionsResponse::Representation
208
+ command.response_class = Google::Apis::PubsubV1beta1a::ListSubscriptionsResponse
209
+ command.query['maxResults'] = max_results unless max_results.nil?
210
+ command.query['pageToken'] = page_token unless page_token.nil?
211
+ command.query['query'] = query unless query.nil?
212
+ command.query['fields'] = fields unless fields.nil?
213
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
214
+ execute_or_queue_command(command, &block)
215
+ end
216
+
217
+ # Modifies the Ack deadline for a message received from a pull request.
218
+ # @param [Google::Apis::PubsubV1beta1a::ModifyAckDeadlineRequest] modify_ack_deadline_request_object
219
+ # @param [String] fields
220
+ # Selector specifying which fields to include in a partial response.
221
+ # @param [String] quota_user
222
+ # Available to use for quota purposes for server-side applications. Can be any
223
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
224
+ # @param [Google::Apis::RequestOptions] options
225
+ # Request-specific options
226
+ #
227
+ # @yield [result, err] Result & error if block supplied
228
+ # @yieldparam result [Google::Apis::PubsubV1beta1a::Empty] parsed result object
229
+ # @yieldparam err [StandardError] error object if request failed
230
+ #
231
+ # @return [Google::Apis::PubsubV1beta1a::Empty]
232
+ #
233
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
234
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
235
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
236
+ def modify_subscription_ack_deadline(modify_ack_deadline_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
237
+ command = make_simple_command(:post, 'v1beta1a/subscriptions/modifyAckDeadline', options)
238
+ command.request_representation = Google::Apis::PubsubV1beta1a::ModifyAckDeadlineRequest::Representation
239
+ command.request_object = modify_ack_deadline_request_object
240
+ command.response_representation = Google::Apis::PubsubV1beta1a::Empty::Representation
241
+ command.response_class = Google::Apis::PubsubV1beta1a::Empty
242
+ command.query['fields'] = fields unless fields.nil?
243
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
244
+ execute_or_queue_command(command, &block)
245
+ end
246
+
247
+ # Modifies the PushConfig for a specified subscription. This method can be used
248
+ # to suspend the flow of messages to an endpoint by clearing the PushConfig
249
+ # field in the request. Messages will be accumulated for delivery even if no
250
+ # push configuration is defined or while the configuration is modified.
251
+ # @param [Google::Apis::PubsubV1beta1a::ModifyPushConfigRequest] modify_push_config_request_object
252
+ # @param [String] fields
253
+ # Selector specifying which fields to include in a partial response.
254
+ # @param [String] quota_user
255
+ # Available to use for quota purposes for server-side applications. Can be any
256
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
257
+ # @param [Google::Apis::RequestOptions] options
258
+ # Request-specific options
259
+ #
260
+ # @yield [result, err] Result & error if block supplied
261
+ # @yieldparam result [Google::Apis::PubsubV1beta1a::Empty] parsed result object
262
+ # @yieldparam err [StandardError] error object if request failed
263
+ #
264
+ # @return [Google::Apis::PubsubV1beta1a::Empty]
265
+ #
266
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
267
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
268
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
269
+ def modify_subscription_push_config(modify_push_config_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
270
+ command = make_simple_command(:post, 'v1beta1a/subscriptions/modifyPushConfig', options)
271
+ command.request_representation = Google::Apis::PubsubV1beta1a::ModifyPushConfigRequest::Representation
272
+ command.request_object = modify_push_config_request_object
273
+ command.response_representation = Google::Apis::PubsubV1beta1a::Empty::Representation
274
+ command.response_class = Google::Apis::PubsubV1beta1a::Empty
275
+ command.query['fields'] = fields unless fields.nil?
276
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
277
+ execute_or_queue_command(command, &block)
278
+ end
279
+
280
+ # Pulls a single message from the server. If return_immediately is true, and no
281
+ # messages are available in the subscription, this method returns
282
+ # FAILED_PRECONDITION. The system is free to return an UNAVAILABLE error if no
283
+ # messages are available in a reasonable amount of time (to reduce system load).
284
+ # @param [Google::Apis::PubsubV1beta1a::PullRequest] pull_request_object
285
+ # @param [String] fields
286
+ # Selector specifying which fields to include in a partial response.
287
+ # @param [String] quota_user
288
+ # Available to use for quota purposes for server-side applications. Can be any
289
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
290
+ # @param [Google::Apis::RequestOptions] options
291
+ # Request-specific options
292
+ #
293
+ # @yield [result, err] Result & error if block supplied
294
+ # @yieldparam result [Google::Apis::PubsubV1beta1a::PullResponse] parsed result object
295
+ # @yieldparam err [StandardError] error object if request failed
296
+ #
297
+ # @return [Google::Apis::PubsubV1beta1a::PullResponse]
298
+ #
299
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
300
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
301
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
302
+ def pull_subscription(pull_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
303
+ command = make_simple_command(:post, 'v1beta1a/subscriptions/pull', options)
304
+ command.request_representation = Google::Apis::PubsubV1beta1a::PullRequest::Representation
305
+ command.request_object = pull_request_object
306
+ command.response_representation = Google::Apis::PubsubV1beta1a::PullResponse::Representation
307
+ command.response_class = Google::Apis::PubsubV1beta1a::PullResponse
308
+ command.query['fields'] = fields unless fields.nil?
309
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
310
+ execute_or_queue_command(command, &block)
311
+ end
312
+
313
+ # Pulls messages from the server. Returns an empty list if there are no messages
314
+ # available in the backlog. The system is free to return UNAVAILABLE if there
315
+ # are too many pull requests outstanding for the given subscription.
316
+ # @param [Google::Apis::PubsubV1beta1a::PullBatchRequest] pull_batch_request_object
317
+ # @param [String] fields
318
+ # Selector specifying which fields to include in a partial response.
319
+ # @param [String] quota_user
320
+ # Available to use for quota purposes for server-side applications. Can be any
321
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
322
+ # @param [Google::Apis::RequestOptions] options
323
+ # Request-specific options
324
+ #
325
+ # @yield [result, err] Result & error if block supplied
326
+ # @yieldparam result [Google::Apis::PubsubV1beta1a::PullBatchResponse] parsed result object
327
+ # @yieldparam err [StandardError] error object if request failed
328
+ #
329
+ # @return [Google::Apis::PubsubV1beta1a::PullBatchResponse]
330
+ #
331
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
332
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
333
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
334
+ def pull_subscription_batch(pull_batch_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
335
+ command = make_simple_command(:post, 'v1beta1a/subscriptions/pullBatch', options)
336
+ command.request_representation = Google::Apis::PubsubV1beta1a::PullBatchRequest::Representation
337
+ command.request_object = pull_batch_request_object
338
+ command.response_representation = Google::Apis::PubsubV1beta1a::PullBatchResponse::Representation
339
+ command.response_class = Google::Apis::PubsubV1beta1a::PullBatchResponse
340
+ command.query['fields'] = fields unless fields.nil?
341
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
342
+ execute_or_queue_command(command, &block)
343
+ end
344
+
345
+ # Creates the given topic with the given name.
346
+ # @param [Google::Apis::PubsubV1beta1a::Topic] topic_object
347
+ # @param [String] fields
348
+ # Selector specifying which fields to include in a partial response.
349
+ # @param [String] quota_user
350
+ # Available to use for quota purposes for server-side applications. Can be any
351
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
352
+ # @param [Google::Apis::RequestOptions] options
353
+ # Request-specific options
354
+ #
355
+ # @yield [result, err] Result & error if block supplied
356
+ # @yieldparam result [Google::Apis::PubsubV1beta1a::Topic] parsed result object
357
+ # @yieldparam err [StandardError] error object if request failed
358
+ #
359
+ # @return [Google::Apis::PubsubV1beta1a::Topic]
360
+ #
361
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
362
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
363
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
364
+ def create_topic(topic_object = nil, fields: nil, quota_user: nil, options: nil, &block)
365
+ command = make_simple_command(:post, 'v1beta1a/topics', options)
366
+ command.request_representation = Google::Apis::PubsubV1beta1a::Topic::Representation
367
+ command.request_object = topic_object
368
+ command.response_representation = Google::Apis::PubsubV1beta1a::Topic::Representation
369
+ command.response_class = Google::Apis::PubsubV1beta1a::Topic
370
+ command.query['fields'] = fields unless fields.nil?
371
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
372
+ execute_or_queue_command(command, &block)
373
+ end
374
+
375
+ # Deletes the topic with the given name. Returns NOT_FOUND if the topic does not
376
+ # exist. After a topic is deleted, a new topic may be created with the same name.
377
+ # @param [String] topic
378
+ # Name of the topic to delete.
379
+ # @param [String] fields
380
+ # Selector specifying which fields to include in a partial response.
381
+ # @param [String] quota_user
382
+ # Available to use for quota purposes for server-side applications. Can be any
383
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
384
+ # @param [Google::Apis::RequestOptions] options
385
+ # Request-specific options
386
+ #
387
+ # @yield [result, err] Result & error if block supplied
388
+ # @yieldparam result [Google::Apis::PubsubV1beta1a::Empty] parsed result object
389
+ # @yieldparam err [StandardError] error object if request failed
390
+ #
391
+ # @return [Google::Apis::PubsubV1beta1a::Empty]
392
+ #
393
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
394
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
395
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
396
+ def delete_topic(topic, fields: nil, quota_user: nil, options: nil, &block)
397
+ command = make_simple_command(:delete, 'v1beta1a/topics/{+topic}', options)
398
+ command.response_representation = Google::Apis::PubsubV1beta1a::Empty::Representation
399
+ command.response_class = Google::Apis::PubsubV1beta1a::Empty
400
+ command.params['topic'] = topic unless topic.nil?
401
+ command.query['fields'] = fields unless fields.nil?
402
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
403
+ execute_or_queue_command(command, &block)
404
+ end
405
+
406
+ # Gets the configuration of a topic. Since the topic only has the name attribute,
407
+ # this method is only useful to check the existence of a topic. If other
408
+ # attributes are added in the future, they will be returned here.
409
+ # @param [String] topic
410
+ # The name of the topic to get.
411
+ # @param [String] fields
412
+ # Selector specifying which fields to include in a partial response.
413
+ # @param [String] quota_user
414
+ # Available to use for quota purposes for server-side applications. Can be any
415
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
416
+ # @param [Google::Apis::RequestOptions] options
417
+ # Request-specific options
418
+ #
419
+ # @yield [result, err] Result & error if block supplied
420
+ # @yieldparam result [Google::Apis::PubsubV1beta1a::Topic] parsed result object
421
+ # @yieldparam err [StandardError] error object if request failed
422
+ #
423
+ # @return [Google::Apis::PubsubV1beta1a::Topic]
424
+ #
425
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
426
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
427
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
428
+ def get_topic(topic, fields: nil, quota_user: nil, options: nil, &block)
429
+ command = make_simple_command(:get, 'v1beta1a/topics/{+topic}', options)
430
+ command.response_representation = Google::Apis::PubsubV1beta1a::Topic::Representation
431
+ command.response_class = Google::Apis::PubsubV1beta1a::Topic
432
+ command.params['topic'] = topic unless topic.nil?
433
+ command.query['fields'] = fields unless fields.nil?
434
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
435
+ execute_or_queue_command(command, &block)
436
+ end
437
+
438
+ # Lists matching topics.
439
+ # @param [Fixnum] max_results
440
+ # Maximum number of topics to return.
441
+ # @param [String] page_token
442
+ # The value obtained in the last ListTopicsResponse for continuation.
443
+ # @param [String] query
444
+ # A valid label query expression.
445
+ # @param [String] fields
446
+ # Selector specifying which fields to include in a partial response.
447
+ # @param [String] quota_user
448
+ # Available to use for quota purposes for server-side applications. Can be any
449
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
450
+ # @param [Google::Apis::RequestOptions] options
451
+ # Request-specific options
452
+ #
453
+ # @yield [result, err] Result & error if block supplied
454
+ # @yieldparam result [Google::Apis::PubsubV1beta1a::ListTopicsResponse] parsed result object
455
+ # @yieldparam err [StandardError] error object if request failed
456
+ #
457
+ # @return [Google::Apis::PubsubV1beta1a::ListTopicsResponse]
458
+ #
459
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
460
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
461
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
462
+ def list_topics(max_results: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil, &block)
463
+ command = make_simple_command(:get, 'v1beta1a/topics', options)
464
+ command.response_representation = Google::Apis::PubsubV1beta1a::ListTopicsResponse::Representation
465
+ command.response_class = Google::Apis::PubsubV1beta1a::ListTopicsResponse
466
+ command.query['maxResults'] = max_results unless max_results.nil?
467
+ command.query['pageToken'] = page_token unless page_token.nil?
468
+ command.query['query'] = query unless query.nil?
469
+ command.query['fields'] = fields unless fields.nil?
470
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
471
+ execute_or_queue_command(command, &block)
472
+ end
473
+
474
+ # Adds a message to the topic. Returns NOT_FOUND if the topic does not exist.
475
+ # @param [Google::Apis::PubsubV1beta1a::PublishRequest] publish_request_object
476
+ # @param [String] fields
477
+ # Selector specifying which fields to include in a partial response.
478
+ # @param [String] quota_user
479
+ # Available to use for quota purposes for server-side applications. Can be any
480
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
481
+ # @param [Google::Apis::RequestOptions] options
482
+ # Request-specific options
483
+ #
484
+ # @yield [result, err] Result & error if block supplied
485
+ # @yieldparam result [Google::Apis::PubsubV1beta1a::Empty] parsed result object
486
+ # @yieldparam err [StandardError] error object if request failed
487
+ #
488
+ # @return [Google::Apis::PubsubV1beta1a::Empty]
489
+ #
490
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
491
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
492
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
493
+ def publish_topic(publish_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
494
+ command = make_simple_command(:post, 'v1beta1a/topics/publish', options)
495
+ command.request_representation = Google::Apis::PubsubV1beta1a::PublishRequest::Representation
496
+ command.request_object = publish_request_object
497
+ command.response_representation = Google::Apis::PubsubV1beta1a::Empty::Representation
498
+ command.response_class = Google::Apis::PubsubV1beta1a::Empty
499
+ command.query['fields'] = fields unless fields.nil?
500
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
501
+ execute_or_queue_command(command, &block)
502
+ end
503
+
504
+ # Adds one or more messages to the topic. Returns NOT_FOUND if the topic does
505
+ # not exist.
506
+ # @param [Google::Apis::PubsubV1beta1a::PublishBatchRequest] publish_batch_request_object
507
+ # @param [String] fields
508
+ # Selector specifying which fields to include in a partial response.
509
+ # @param [String] quota_user
510
+ # Available to use for quota purposes for server-side applications. Can be any
511
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
512
+ # @param [Google::Apis::RequestOptions] options
513
+ # Request-specific options
514
+ #
515
+ # @yield [result, err] Result & error if block supplied
516
+ # @yieldparam result [Google::Apis::PubsubV1beta1a::PublishBatchResponse] parsed result object
517
+ # @yieldparam err [StandardError] error object if request failed
518
+ #
519
+ # @return [Google::Apis::PubsubV1beta1a::PublishBatchResponse]
520
+ #
521
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
522
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
523
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
524
+ def publish_topic_batch(publish_batch_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
525
+ command = make_simple_command(:post, 'v1beta1a/topics/publishBatch', options)
526
+ command.request_representation = Google::Apis::PubsubV1beta1a::PublishBatchRequest::Representation
527
+ command.request_object = publish_batch_request_object
528
+ command.response_representation = Google::Apis::PubsubV1beta1a::PublishBatchResponse::Representation
529
+ command.response_class = Google::Apis::PubsubV1beta1a::PublishBatchResponse
530
+ command.query['fields'] = fields unless fields.nil?
531
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
532
+ execute_or_queue_command(command, &block)
533
+ end
534
+
535
+ protected
536
+
537
+ def apply_command_defaults(command)
538
+ command.query['key'] = key unless key.nil?
539
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
540
+ end
541
+ end
542
+ end
543
+ end
544
+ end