OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
1 library googleapis_beta.pubsub.v1beta1; | 3 library googleapis_beta.pubsub.v1beta1; |
2 | 4 |
3 import "dart:core" as core; | 5 import 'dart:core' as core; |
4 import "dart:collection" as collection; | 6 import 'dart:collection' as collection; |
5 import "dart:async" as async; | 7 import 'dart:async' as async; |
6 import "dart:convert" as convert; | 8 import 'dart:convert' as convert; |
7 | 9 |
8 import "package:crypto/crypto.dart" as crypto; | 10 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 11 import 'package:crypto/crypto.dart' as crypto; |
9 import 'package:http/http.dart' as http; | 12 import 'package:http/http.dart' as http; |
10 import '../src/common_internal.dart' as common_internal; | |
11 import '../common/common.dart' as common; | |
12 | 13 |
13 export '../common/common.dart' show ApiRequestError; | 14 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
14 export '../common/common.dart' show DetailedApiRequestError; | 15 ApiRequestError, DetailedApiRequestError; |
| 16 |
| 17 const core.String USER_AGENT = 'dart-api-client pubsub/v1beta1'; |
15 | 18 |
16 /** | 19 /** |
17 * Provides reliable, many-to-many, asynchronous messaging between applications. | 20 * Provides reliable, many-to-many, asynchronous messaging between applications. |
18 */ | 21 */ |
19 class PubsubApi { | 22 class PubsubApi { |
20 /** View and manage your data across Google Cloud Platform services */ | 23 /** View and manage your data across Google Cloud Platform services */ |
21 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; | 24 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; |
22 | 25 |
23 /** View and manage Pub/Sub topics and subscriptions */ | 26 /** View and manage Pub/Sub topics and subscriptions */ |
24 static const PubsubScope = "https://www.googleapis.com/auth/pubsub"; | 27 static const PubsubScope = "https://www.googleapis.com/auth/pubsub"; |
25 | 28 |
26 | 29 |
27 final common_internal.ApiRequester _requester; | 30 final commons.ApiRequester _requester; |
28 | 31 |
29 SubscriptionsResourceApi get subscriptions => new SubscriptionsResourceApi(_re
quester); | 32 SubscriptionsResourceApi get subscriptions => new SubscriptionsResourceApi(_re
quester); |
30 TopicsResourceApi get topics => new TopicsResourceApi(_requester); | 33 TopicsResourceApi get topics => new TopicsResourceApi(_requester); |
31 | 34 |
32 PubsubApi(http.Client client, {core.String rootUrl: "https://www.googleapis.co
m/", core.String servicePath: "pubsub/v1beta1/"}) : | 35 PubsubApi(http.Client client, {core.String rootUrl: "https://www.googleapis.co
m/", core.String servicePath: "pubsub/v1beta1/"}) : |
33 _requester = new common_internal.ApiRequester(client, rootUrl, servicePath
); | 36 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
34 } | 37 } |
35 | 38 |
36 | 39 |
37 /** Not documented yet. */ | |
38 class SubscriptionsResourceApi { | 40 class SubscriptionsResourceApi { |
39 final common_internal.ApiRequester _requester; | 41 final commons.ApiRequester _requester; |
40 | 42 |
41 SubscriptionsResourceApi(common_internal.ApiRequester client) : | 43 SubscriptionsResourceApi(commons.ApiRequester client) : |
42 _requester = client; | 44 _requester = client; |
43 | 45 |
44 /** | 46 /** |
45 * Acknowledges a particular received message: the Pub/Sub system can remove | 47 * Acknowledges a particular received message: the Pub/Sub system can remove |
46 * the given message from the subscription. Acknowledging a message whose Ack | 48 * the given message from the subscription. Acknowledging a message whose Ack |
47 * deadline has expired may succeed, but the message could have been already | 49 * deadline has expired may succeed, but the message could have been already |
48 * redelivered. Acknowledging a message more than once will not result in an | 50 * redelivered. Acknowledging a message more than once will not result in an |
49 * error. This is only used for messages received via pull. | 51 * error. This is only used for messages received via pull. |
50 * | 52 * |
51 * [request] - The metadata request object. | 53 * [request] - The metadata request object. |
52 * | 54 * |
53 * Request parameters: | 55 * Request parameters: |
54 * | 56 * |
55 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 57 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
56 * error. | 58 * error. |
57 * | 59 * |
58 * If the used [http.Client] completes with an error when making a REST call, | 60 * If the used [http.Client] completes with an error when making a REST call, |
59 * this method will complete with the same error. | 61 * this method will complete with the same error. |
60 */ | 62 */ |
61 async.Future acknowledge(AcknowledgeRequest request) { | 63 async.Future acknowledge(AcknowledgeRequest request) { |
62 var _url = null; | 64 var _url = null; |
63 var _queryParams = new core.Map(); | 65 var _queryParams = new core.Map(); |
64 var _uploadMedia = null; | 66 var _uploadMedia = null; |
65 var _uploadOptions = null; | 67 var _uploadOptions = null; |
66 var _downloadOptions = common.DownloadOptions.Metadata; | 68 var _downloadOptions = commons.DownloadOptions.Metadata; |
67 var _body = null; | 69 var _body = null; |
68 | 70 |
69 if (request != null) { | 71 if (request != null) { |
70 _body = convert.JSON.encode((request).toJson()); | 72 _body = convert.JSON.encode((request).toJson()); |
71 } | 73 } |
72 | 74 |
73 _downloadOptions = null; | 75 _downloadOptions = null; |
74 | 76 |
75 _url = 'subscriptions/acknowledge'; | 77 _url = 'subscriptions/acknowledge'; |
76 | 78 |
(...skipping 14 matching lines...) Expand all Loading... |
91 * | 93 * |
92 * If the name is not provided in the request, the server will assign a random | 94 * If the name is not provided in the request, the server will assign a random |
93 * name for this subscription on the same project as the topic. | 95 * name for this subscription on the same project as the topic. |
94 * | 96 * |
95 * [request] - The metadata request object. | 97 * [request] - The metadata request object. |
96 * | 98 * |
97 * Request parameters: | 99 * Request parameters: |
98 * | 100 * |
99 * Completes with a [Subscription]. | 101 * Completes with a [Subscription]. |
100 * | 102 * |
101 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 103 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
102 * error. | 104 * error. |
103 * | 105 * |
104 * If the used [http.Client] completes with an error when making a REST call, | 106 * If the used [http.Client] completes with an error when making a REST call, |
105 * this method will complete with the same error. | 107 * this method will complete with the same error. |
106 */ | 108 */ |
107 async.Future<Subscription> create(Subscription request) { | 109 async.Future<Subscription> create(Subscription request) { |
108 var _url = null; | 110 var _url = null; |
109 var _queryParams = new core.Map(); | 111 var _queryParams = new core.Map(); |
110 var _uploadMedia = null; | 112 var _uploadMedia = null; |
111 var _uploadOptions = null; | 113 var _uploadOptions = null; |
112 var _downloadOptions = common.DownloadOptions.Metadata; | 114 var _downloadOptions = commons.DownloadOptions.Metadata; |
113 var _body = null; | 115 var _body = null; |
114 | 116 |
115 if (request != null) { | 117 if (request != null) { |
116 _body = convert.JSON.encode((request).toJson()); | 118 _body = convert.JSON.encode((request).toJson()); |
117 } | 119 } |
118 | 120 |
119 | 121 |
120 _url = 'subscriptions'; | 122 _url = 'subscriptions'; |
121 | 123 |
122 var _response = _requester.request(_url, | 124 var _response = _requester.request(_url, |
123 "POST", | 125 "POST", |
124 body: _body, | 126 body: _body, |
125 queryParams: _queryParams, | 127 queryParams: _queryParams, |
126 uploadOptions: _uploadOptions, | 128 uploadOptions: _uploadOptions, |
127 uploadMedia: _uploadMedia, | 129 uploadMedia: _uploadMedia, |
128 downloadOptions: _downloadOptions); | 130 downloadOptions: _downloadOptions); |
129 return _response.then((data) => new Subscription.fromJson(data)); | 131 return _response.then((data) => new Subscription.fromJson(data)); |
130 } | 132 } |
131 | 133 |
132 /** | 134 /** |
133 * Deletes an existing subscription. All pending messages in the subscription | 135 * Deletes an existing subscription. All pending messages in the subscription |
134 * are immediately dropped. Calls to Pull after deletion will return | 136 * are immediately dropped. Calls to Pull after deletion will return |
135 * NOT_FOUND. | 137 * NOT_FOUND. |
136 * | 138 * |
137 * Request parameters: | 139 * Request parameters: |
138 * | 140 * |
139 * [subscription] - The subscription to delete. | 141 * [subscription] - The subscription to delete. |
140 * | 142 * |
141 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 143 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
142 * error. | 144 * error. |
143 * | 145 * |
144 * If the used [http.Client] completes with an error when making a REST call, | 146 * If the used [http.Client] completes with an error when making a REST call, |
145 * this method will complete with the same error. | 147 * this method will complete with the same error. |
146 */ | 148 */ |
147 async.Future delete(core.String subscription) { | 149 async.Future delete(core.String subscription) { |
148 var _url = null; | 150 var _url = null; |
149 var _queryParams = new core.Map(); | 151 var _queryParams = new core.Map(); |
150 var _uploadMedia = null; | 152 var _uploadMedia = null; |
151 var _uploadOptions = null; | 153 var _uploadOptions = null; |
152 var _downloadOptions = common.DownloadOptions.Metadata; | 154 var _downloadOptions = commons.DownloadOptions.Metadata; |
153 var _body = null; | 155 var _body = null; |
154 | 156 |
155 if (subscription == null) { | 157 if (subscription == null) { |
156 throw new core.ArgumentError("Parameter subscription is required."); | 158 throw new core.ArgumentError("Parameter subscription is required."); |
157 } | 159 } |
158 | 160 |
159 _downloadOptions = null; | 161 _downloadOptions = null; |
160 | 162 |
161 _url = 'subscriptions/' + common_internal.Escaper.ecapeVariableReserved('$su
bscription'); | 163 _url = 'subscriptions/' + commons.Escaper.ecapeVariableReserved('$subscripti
on'); |
162 | 164 |
163 var _response = _requester.request(_url, | 165 var _response = _requester.request(_url, |
164 "DELETE", | 166 "DELETE", |
165 body: _body, | 167 body: _body, |
166 queryParams: _queryParams, | 168 queryParams: _queryParams, |
167 uploadOptions: _uploadOptions, | 169 uploadOptions: _uploadOptions, |
168 uploadMedia: _uploadMedia, | 170 uploadMedia: _uploadMedia, |
169 downloadOptions: _downloadOptions); | 171 downloadOptions: _downloadOptions); |
170 return _response.then((data) => null); | 172 return _response.then((data) => null); |
171 } | 173 } |
172 | 174 |
173 /** | 175 /** |
174 * Gets the configuration details of a subscription. | 176 * Gets the configuration details of a subscription. |
175 * | 177 * |
176 * Request parameters: | 178 * Request parameters: |
177 * | 179 * |
178 * [subscription] - The name of the subscription to get. | 180 * [subscription] - The name of the subscription to get. |
179 * | 181 * |
180 * Completes with a [Subscription]. | 182 * Completes with a [Subscription]. |
181 * | 183 * |
182 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 184 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
183 * error. | 185 * error. |
184 * | 186 * |
185 * If the used [http.Client] completes with an error when making a REST call, | 187 * If the used [http.Client] completes with an error when making a REST call, |
186 * this method will complete with the same error. | 188 * this method will complete with the same error. |
187 */ | 189 */ |
188 async.Future<Subscription> get(core.String subscription) { | 190 async.Future<Subscription> get(core.String subscription) { |
189 var _url = null; | 191 var _url = null; |
190 var _queryParams = new core.Map(); | 192 var _queryParams = new core.Map(); |
191 var _uploadMedia = null; | 193 var _uploadMedia = null; |
192 var _uploadOptions = null; | 194 var _uploadOptions = null; |
193 var _downloadOptions = common.DownloadOptions.Metadata; | 195 var _downloadOptions = commons.DownloadOptions.Metadata; |
194 var _body = null; | 196 var _body = null; |
195 | 197 |
196 if (subscription == null) { | 198 if (subscription == null) { |
197 throw new core.ArgumentError("Parameter subscription is required."); | 199 throw new core.ArgumentError("Parameter subscription is required."); |
198 } | 200 } |
199 | 201 |
200 | 202 |
201 _url = 'subscriptions/' + common_internal.Escaper.ecapeVariableReserved('$su
bscription'); | 203 _url = 'subscriptions/' + commons.Escaper.ecapeVariableReserved('$subscripti
on'); |
202 | 204 |
203 var _response = _requester.request(_url, | 205 var _response = _requester.request(_url, |
204 "GET", | 206 "GET", |
205 body: _body, | 207 body: _body, |
206 queryParams: _queryParams, | 208 queryParams: _queryParams, |
207 uploadOptions: _uploadOptions, | 209 uploadOptions: _uploadOptions, |
208 uploadMedia: _uploadMedia, | 210 uploadMedia: _uploadMedia, |
209 downloadOptions: _downloadOptions); | 211 downloadOptions: _downloadOptions); |
210 return _response.then((data) => new Subscription.fromJson(data)); | 212 return _response.then((data) => new Subscription.fromJson(data)); |
211 } | 213 } |
212 | 214 |
213 /** | 215 /** |
214 * Lists matching subscriptions. | 216 * Lists matching subscriptions. |
215 * | 217 * |
216 * Request parameters: | 218 * Request parameters: |
217 * | 219 * |
218 * [maxResults] - Maximum number of subscriptions to return. | 220 * [maxResults] - Maximum number of subscriptions to return. |
219 * | 221 * |
220 * [pageToken] - The value obtained in the last ListSubscriptionsResponse for | 222 * [pageToken] - The value obtained in the last ListSubscriptionsResponse for |
221 * continuation. | 223 * continuation. |
222 * | 224 * |
223 * [query] - A valid label query expression. | 225 * [query] - A valid label query expression. |
224 * | 226 * |
225 * Completes with a [ListSubscriptionsResponse]. | 227 * Completes with a [ListSubscriptionsResponse]. |
226 * | 228 * |
227 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 229 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
228 * error. | 230 * error. |
229 * | 231 * |
230 * If the used [http.Client] completes with an error when making a REST call, | 232 * If the used [http.Client] completes with an error when making a REST call, |
231 * this method will complete with the same error. | 233 * this method will complete with the same error. |
232 */ | 234 */ |
233 async.Future<ListSubscriptionsResponse> list({core.int maxResults, core.String
pageToken, core.String query}) { | 235 async.Future<ListSubscriptionsResponse> list({core.int maxResults, core.String
pageToken, core.String query}) { |
234 var _url = null; | 236 var _url = null; |
235 var _queryParams = new core.Map(); | 237 var _queryParams = new core.Map(); |
236 var _uploadMedia = null; | 238 var _uploadMedia = null; |
237 var _uploadOptions = null; | 239 var _uploadOptions = null; |
238 var _downloadOptions = common.DownloadOptions.Metadata; | 240 var _downloadOptions = commons.DownloadOptions.Metadata; |
239 var _body = null; | 241 var _body = null; |
240 | 242 |
241 if (maxResults != null) { | 243 if (maxResults != null) { |
242 _queryParams["maxResults"] = ["${maxResults}"]; | 244 _queryParams["maxResults"] = ["${maxResults}"]; |
243 } | 245 } |
244 if (pageToken != null) { | 246 if (pageToken != null) { |
245 _queryParams["pageToken"] = [pageToken]; | 247 _queryParams["pageToken"] = [pageToken]; |
246 } | 248 } |
247 if (query != null) { | 249 if (query != null) { |
248 _queryParams["query"] = [query]; | 250 _queryParams["query"] = [query]; |
(...skipping 12 matching lines...) Expand all Loading... |
261 return _response.then((data) => new ListSubscriptionsResponse.fromJson(data)
); | 263 return _response.then((data) => new ListSubscriptionsResponse.fromJson(data)
); |
262 } | 264 } |
263 | 265 |
264 /** | 266 /** |
265 * Modifies the Ack deadline for a message received from a pull request. | 267 * Modifies the Ack deadline for a message received from a pull request. |
266 * | 268 * |
267 * [request] - The metadata request object. | 269 * [request] - The metadata request object. |
268 * | 270 * |
269 * Request parameters: | 271 * Request parameters: |
270 * | 272 * |
271 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 273 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
272 * error. | 274 * error. |
273 * | 275 * |
274 * If the used [http.Client] completes with an error when making a REST call, | 276 * If the used [http.Client] completes with an error when making a REST call, |
275 * this method will complete with the same error. | 277 * this method will complete with the same error. |
276 */ | 278 */ |
277 async.Future modifyAckDeadline(ModifyAckDeadlineRequest request) { | 279 async.Future modifyAckDeadline(ModifyAckDeadlineRequest request) { |
278 var _url = null; | 280 var _url = null; |
279 var _queryParams = new core.Map(); | 281 var _queryParams = new core.Map(); |
280 var _uploadMedia = null; | 282 var _uploadMedia = null; |
281 var _uploadOptions = null; | 283 var _uploadOptions = null; |
282 var _downloadOptions = common.DownloadOptions.Metadata; | 284 var _downloadOptions = commons.DownloadOptions.Metadata; |
283 var _body = null; | 285 var _body = null; |
284 | 286 |
285 if (request != null) { | 287 if (request != null) { |
286 _body = convert.JSON.encode((request).toJson()); | 288 _body = convert.JSON.encode((request).toJson()); |
287 } | 289 } |
288 | 290 |
289 _downloadOptions = null; | 291 _downloadOptions = null; |
290 | 292 |
291 _url = 'subscriptions/modifyAckDeadline'; | 293 _url = 'subscriptions/modifyAckDeadline'; |
292 | 294 |
(...skipping 11 matching lines...) Expand all Loading... |
304 * Modifies the PushConfig for a specified subscription. This method can be | 306 * Modifies the PushConfig for a specified subscription. This method can be |
305 * used to suspend the flow of messages to an endpoint by clearing the | 307 * used to suspend the flow of messages to an endpoint by clearing the |
306 * PushConfig field in the request. Messages will be accumulated for delivery | 308 * PushConfig field in the request. Messages will be accumulated for delivery |
307 * even if no push configuration is defined or while the configuration is | 309 * even if no push configuration is defined or while the configuration is |
308 * modified. | 310 * modified. |
309 * | 311 * |
310 * [request] - The metadata request object. | 312 * [request] - The metadata request object. |
311 * | 313 * |
312 * Request parameters: | 314 * Request parameters: |
313 * | 315 * |
314 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 316 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
315 * error. | 317 * error. |
316 * | 318 * |
317 * If the used [http.Client] completes with an error when making a REST call, | 319 * If the used [http.Client] completes with an error when making a REST call, |
318 * this method will complete with the same error. | 320 * this method will complete with the same error. |
319 */ | 321 */ |
320 async.Future modifyPushConfig(ModifyPushConfigRequest request) { | 322 async.Future modifyPushConfig(ModifyPushConfigRequest request) { |
321 var _url = null; | 323 var _url = null; |
322 var _queryParams = new core.Map(); | 324 var _queryParams = new core.Map(); |
323 var _uploadMedia = null; | 325 var _uploadMedia = null; |
324 var _uploadOptions = null; | 326 var _uploadOptions = null; |
325 var _downloadOptions = common.DownloadOptions.Metadata; | 327 var _downloadOptions = commons.DownloadOptions.Metadata; |
326 var _body = null; | 328 var _body = null; |
327 | 329 |
328 if (request != null) { | 330 if (request != null) { |
329 _body = convert.JSON.encode((request).toJson()); | 331 _body = convert.JSON.encode((request).toJson()); |
330 } | 332 } |
331 | 333 |
332 _downloadOptions = null; | 334 _downloadOptions = null; |
333 | 335 |
334 _url = 'subscriptions/modifyPushConfig'; | 336 _url = 'subscriptions/modifyPushConfig'; |
335 | 337 |
(...skipping 13 matching lines...) Expand all Loading... |
349 * FAILED_PRECONDITION. The system is free to return an UNAVAILABLE error if | 351 * FAILED_PRECONDITION. The system is free to return an UNAVAILABLE error if |
350 * no messages are available in a reasonable amount of time (to reduce system | 352 * no messages are available in a reasonable amount of time (to reduce system |
351 * load). | 353 * load). |
352 * | 354 * |
353 * [request] - The metadata request object. | 355 * [request] - The metadata request object. |
354 * | 356 * |
355 * Request parameters: | 357 * Request parameters: |
356 * | 358 * |
357 * Completes with a [PullResponse]. | 359 * Completes with a [PullResponse]. |
358 * | 360 * |
359 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 361 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
360 * error. | 362 * error. |
361 * | 363 * |
362 * If the used [http.Client] completes with an error when making a REST call, | 364 * If the used [http.Client] completes with an error when making a REST call, |
363 * this method will complete with the same error. | 365 * this method will complete with the same error. |
364 */ | 366 */ |
365 async.Future<PullResponse> pull(PullRequest request) { | 367 async.Future<PullResponse> pull(PullRequest request) { |
366 var _url = null; | 368 var _url = null; |
367 var _queryParams = new core.Map(); | 369 var _queryParams = new core.Map(); |
368 var _uploadMedia = null; | 370 var _uploadMedia = null; |
369 var _uploadOptions = null; | 371 var _uploadOptions = null; |
370 var _downloadOptions = common.DownloadOptions.Metadata; | 372 var _downloadOptions = commons.DownloadOptions.Metadata; |
371 var _body = null; | 373 var _body = null; |
372 | 374 |
373 if (request != null) { | 375 if (request != null) { |
374 _body = convert.JSON.encode((request).toJson()); | 376 _body = convert.JSON.encode((request).toJson()); |
375 } | 377 } |
376 | 378 |
377 | 379 |
378 _url = 'subscriptions/pull'; | 380 _url = 'subscriptions/pull'; |
379 | 381 |
380 var _response = _requester.request(_url, | 382 var _response = _requester.request(_url, |
(...skipping 10 matching lines...) Expand all Loading... |
391 * Pulls messages from the server. Returns an empty list if there are no | 393 * Pulls messages from the server. Returns an empty list if there are no |
392 * messages available in the backlog. The system is free to return UNAVAILABLE | 394 * messages available in the backlog. The system is free to return UNAVAILABLE |
393 * if there are too many pull requests outstanding for the given subscription. | 395 * if there are too many pull requests outstanding for the given subscription. |
394 * | 396 * |
395 * [request] - The metadata request object. | 397 * [request] - The metadata request object. |
396 * | 398 * |
397 * Request parameters: | 399 * Request parameters: |
398 * | 400 * |
399 * Completes with a [PullBatchResponse]. | 401 * Completes with a [PullBatchResponse]. |
400 * | 402 * |
401 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 403 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
402 * error. | 404 * error. |
403 * | 405 * |
404 * If the used [http.Client] completes with an error when making a REST call, | 406 * If the used [http.Client] completes with an error when making a REST call, |
405 * this method will complete with the same error. | 407 * this method will complete with the same error. |
406 */ | 408 */ |
407 async.Future<PullBatchResponse> pullBatch(PullBatchRequest request) { | 409 async.Future<PullBatchResponse> pullBatch(PullBatchRequest request) { |
408 var _url = null; | 410 var _url = null; |
409 var _queryParams = new core.Map(); | 411 var _queryParams = new core.Map(); |
410 var _uploadMedia = null; | 412 var _uploadMedia = null; |
411 var _uploadOptions = null; | 413 var _uploadOptions = null; |
412 var _downloadOptions = common.DownloadOptions.Metadata; | 414 var _downloadOptions = commons.DownloadOptions.Metadata; |
413 var _body = null; | 415 var _body = null; |
414 | 416 |
415 if (request != null) { | 417 if (request != null) { |
416 _body = convert.JSON.encode((request).toJson()); | 418 _body = convert.JSON.encode((request).toJson()); |
417 } | 419 } |
418 | 420 |
419 | 421 |
420 _url = 'subscriptions/pullBatch'; | 422 _url = 'subscriptions/pullBatch'; |
421 | 423 |
422 var _response = _requester.request(_url, | 424 var _response = _requester.request(_url, |
423 "POST", | 425 "POST", |
424 body: _body, | 426 body: _body, |
425 queryParams: _queryParams, | 427 queryParams: _queryParams, |
426 uploadOptions: _uploadOptions, | 428 uploadOptions: _uploadOptions, |
427 uploadMedia: _uploadMedia, | 429 uploadMedia: _uploadMedia, |
428 downloadOptions: _downloadOptions); | 430 downloadOptions: _downloadOptions); |
429 return _response.then((data) => new PullBatchResponse.fromJson(data)); | 431 return _response.then((data) => new PullBatchResponse.fromJson(data)); |
430 } | 432 } |
431 | 433 |
432 } | 434 } |
433 | 435 |
434 | 436 |
435 /** Not documented yet. */ | |
436 class TopicsResourceApi { | 437 class TopicsResourceApi { |
437 final common_internal.ApiRequester _requester; | 438 final commons.ApiRequester _requester; |
438 | 439 |
439 TopicsResourceApi(common_internal.ApiRequester client) : | 440 TopicsResourceApi(commons.ApiRequester client) : |
440 _requester = client; | 441 _requester = client; |
441 | 442 |
442 /** | 443 /** |
443 * Creates the given topic with the given name. | 444 * Creates the given topic with the given name. |
444 * | 445 * |
445 * [request] - The metadata request object. | 446 * [request] - The metadata request object. |
446 * | 447 * |
447 * Request parameters: | 448 * Request parameters: |
448 * | 449 * |
449 * Completes with a [Topic]. | 450 * Completes with a [Topic]. |
450 * | 451 * |
451 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 452 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
452 * error. | 453 * error. |
453 * | 454 * |
454 * If the used [http.Client] completes with an error when making a REST call, | 455 * If the used [http.Client] completes with an error when making a REST call, |
455 * this method will complete with the same error. | 456 * this method will complete with the same error. |
456 */ | 457 */ |
457 async.Future<Topic> create(Topic request) { | 458 async.Future<Topic> create(Topic request) { |
458 var _url = null; | 459 var _url = null; |
459 var _queryParams = new core.Map(); | 460 var _queryParams = new core.Map(); |
460 var _uploadMedia = null; | 461 var _uploadMedia = null; |
461 var _uploadOptions = null; | 462 var _uploadOptions = null; |
462 var _downloadOptions = common.DownloadOptions.Metadata; | 463 var _downloadOptions = commons.DownloadOptions.Metadata; |
463 var _body = null; | 464 var _body = null; |
464 | 465 |
465 if (request != null) { | 466 if (request != null) { |
466 _body = convert.JSON.encode((request).toJson()); | 467 _body = convert.JSON.encode((request).toJson()); |
467 } | 468 } |
468 | 469 |
469 | 470 |
470 _url = 'topics'; | 471 _url = 'topics'; |
471 | 472 |
472 var _response = _requester.request(_url, | 473 var _response = _requester.request(_url, |
473 "POST", | 474 "POST", |
474 body: _body, | 475 body: _body, |
475 queryParams: _queryParams, | 476 queryParams: _queryParams, |
476 uploadOptions: _uploadOptions, | 477 uploadOptions: _uploadOptions, |
477 uploadMedia: _uploadMedia, | 478 uploadMedia: _uploadMedia, |
478 downloadOptions: _downloadOptions); | 479 downloadOptions: _downloadOptions); |
479 return _response.then((data) => new Topic.fromJson(data)); | 480 return _response.then((data) => new Topic.fromJson(data)); |
480 } | 481 } |
481 | 482 |
482 /** | 483 /** |
483 * Deletes the topic with the given name. All subscriptions to this topic are | 484 * Deletes the topic with the given name. All subscriptions to this topic are |
484 * also deleted. Returns NOT_FOUND if the topic does not exist. After a topic | 485 * also deleted. Returns NOT_FOUND if the topic does not exist. After a topic |
485 * is deleted, a new topic may be created with the same name. | 486 * is deleted, a new topic may be created with the same name. |
486 * | 487 * |
487 * Request parameters: | 488 * Request parameters: |
488 * | 489 * |
489 * [topic] - Name of the topic to delete. | 490 * [topic] - Name of the topic to delete. |
490 * | 491 * |
491 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 492 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
492 * error. | 493 * error. |
493 * | 494 * |
494 * If the used [http.Client] completes with an error when making a REST call, | 495 * If the used [http.Client] completes with an error when making a REST call, |
495 * this method will complete with the same error. | 496 * this method will complete with the same error. |
496 */ | 497 */ |
497 async.Future delete(core.String topic) { | 498 async.Future delete(core.String topic) { |
498 var _url = null; | 499 var _url = null; |
499 var _queryParams = new core.Map(); | 500 var _queryParams = new core.Map(); |
500 var _uploadMedia = null; | 501 var _uploadMedia = null; |
501 var _uploadOptions = null; | 502 var _uploadOptions = null; |
502 var _downloadOptions = common.DownloadOptions.Metadata; | 503 var _downloadOptions = commons.DownloadOptions.Metadata; |
503 var _body = null; | 504 var _body = null; |
504 | 505 |
505 if (topic == null) { | 506 if (topic == null) { |
506 throw new core.ArgumentError("Parameter topic is required."); | 507 throw new core.ArgumentError("Parameter topic is required."); |
507 } | 508 } |
508 | 509 |
509 _downloadOptions = null; | 510 _downloadOptions = null; |
510 | 511 |
511 _url = 'topics/' + common_internal.Escaper.ecapeVariableReserved('$topic'); | 512 _url = 'topics/' + commons.Escaper.ecapeVariableReserved('$topic'); |
512 | 513 |
513 var _response = _requester.request(_url, | 514 var _response = _requester.request(_url, |
514 "DELETE", | 515 "DELETE", |
515 body: _body, | 516 body: _body, |
516 queryParams: _queryParams, | 517 queryParams: _queryParams, |
517 uploadOptions: _uploadOptions, | 518 uploadOptions: _uploadOptions, |
518 uploadMedia: _uploadMedia, | 519 uploadMedia: _uploadMedia, |
519 downloadOptions: _downloadOptions); | 520 downloadOptions: _downloadOptions); |
520 return _response.then((data) => null); | 521 return _response.then((data) => null); |
521 } | 522 } |
522 | 523 |
523 /** | 524 /** |
524 * Gets the configuration of a topic. Since the topic only has the name | 525 * Gets the configuration of a topic. Since the topic only has the name |
525 * attribute, this method is only useful to check the existence of a topic. If | 526 * attribute, this method is only useful to check the existence of a topic. If |
526 * other attributes are added in the future, they will be returned here. | 527 * other attributes are added in the future, they will be returned here. |
527 * | 528 * |
528 * Request parameters: | 529 * Request parameters: |
529 * | 530 * |
530 * [topic] - The name of the topic to get. | 531 * [topic] - The name of the topic to get. |
531 * | 532 * |
532 * Completes with a [Topic]. | 533 * Completes with a [Topic]. |
533 * | 534 * |
534 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 535 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
535 * error. | 536 * error. |
536 * | 537 * |
537 * If the used [http.Client] completes with an error when making a REST call, | 538 * If the used [http.Client] completes with an error when making a REST call, |
538 * this method will complete with the same error. | 539 * this method will complete with the same error. |
539 */ | 540 */ |
540 async.Future<Topic> get(core.String topic) { | 541 async.Future<Topic> get(core.String topic) { |
541 var _url = null; | 542 var _url = null; |
542 var _queryParams = new core.Map(); | 543 var _queryParams = new core.Map(); |
543 var _uploadMedia = null; | 544 var _uploadMedia = null; |
544 var _uploadOptions = null; | 545 var _uploadOptions = null; |
545 var _downloadOptions = common.DownloadOptions.Metadata; | 546 var _downloadOptions = commons.DownloadOptions.Metadata; |
546 var _body = null; | 547 var _body = null; |
547 | 548 |
548 if (topic == null) { | 549 if (topic == null) { |
549 throw new core.ArgumentError("Parameter topic is required."); | 550 throw new core.ArgumentError("Parameter topic is required."); |
550 } | 551 } |
551 | 552 |
552 | 553 |
553 _url = 'topics/' + common_internal.Escaper.ecapeVariableReserved('$topic'); | 554 _url = 'topics/' + commons.Escaper.ecapeVariableReserved('$topic'); |
554 | 555 |
555 var _response = _requester.request(_url, | 556 var _response = _requester.request(_url, |
556 "GET", | 557 "GET", |
557 body: _body, | 558 body: _body, |
558 queryParams: _queryParams, | 559 queryParams: _queryParams, |
559 uploadOptions: _uploadOptions, | 560 uploadOptions: _uploadOptions, |
560 uploadMedia: _uploadMedia, | 561 uploadMedia: _uploadMedia, |
561 downloadOptions: _downloadOptions); | 562 downloadOptions: _downloadOptions); |
562 return _response.then((data) => new Topic.fromJson(data)); | 563 return _response.then((data) => new Topic.fromJson(data)); |
563 } | 564 } |
564 | 565 |
565 /** | 566 /** |
566 * Lists matching topics. | 567 * Lists matching topics. |
567 * | 568 * |
568 * Request parameters: | 569 * Request parameters: |
569 * | 570 * |
570 * [maxResults] - Maximum number of topics to return. | 571 * [maxResults] - Maximum number of topics to return. |
571 * | 572 * |
572 * [pageToken] - The value obtained in the last ListTopicsResponse for | 573 * [pageToken] - The value obtained in the last ListTopicsResponse for |
573 * continuation. | 574 * continuation. |
574 * | 575 * |
575 * [query] - A valid label query expression. | 576 * [query] - A valid label query expression. |
576 * | 577 * |
577 * Completes with a [ListTopicsResponse]. | 578 * Completes with a [ListTopicsResponse]. |
578 * | 579 * |
579 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 580 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
580 * error. | 581 * error. |
581 * | 582 * |
582 * If the used [http.Client] completes with an error when making a REST call, | 583 * If the used [http.Client] completes with an error when making a REST call, |
583 * this method will complete with the same error. | 584 * this method will complete with the same error. |
584 */ | 585 */ |
585 async.Future<ListTopicsResponse> list({core.int maxResults, core.String pageTo
ken, core.String query}) { | 586 async.Future<ListTopicsResponse> list({core.int maxResults, core.String pageTo
ken, core.String query}) { |
586 var _url = null; | 587 var _url = null; |
587 var _queryParams = new core.Map(); | 588 var _queryParams = new core.Map(); |
588 var _uploadMedia = null; | 589 var _uploadMedia = null; |
589 var _uploadOptions = null; | 590 var _uploadOptions = null; |
590 var _downloadOptions = common.DownloadOptions.Metadata; | 591 var _downloadOptions = commons.DownloadOptions.Metadata; |
591 var _body = null; | 592 var _body = null; |
592 | 593 |
593 if (maxResults != null) { | 594 if (maxResults != null) { |
594 _queryParams["maxResults"] = ["${maxResults}"]; | 595 _queryParams["maxResults"] = ["${maxResults}"]; |
595 } | 596 } |
596 if (pageToken != null) { | 597 if (pageToken != null) { |
597 _queryParams["pageToken"] = [pageToken]; | 598 _queryParams["pageToken"] = [pageToken]; |
598 } | 599 } |
599 if (query != null) { | 600 if (query != null) { |
600 _queryParams["query"] = [query]; | 601 _queryParams["query"] = [query]; |
(...skipping 12 matching lines...) Expand all Loading... |
613 return _response.then((data) => new ListTopicsResponse.fromJson(data)); | 614 return _response.then((data) => new ListTopicsResponse.fromJson(data)); |
614 } | 615 } |
615 | 616 |
616 /** | 617 /** |
617 * Adds a message to the topic. Returns NOT_FOUND if the topic does not exist. | 618 * Adds a message to the topic. Returns NOT_FOUND if the topic does not exist. |
618 * | 619 * |
619 * [request] - The metadata request object. | 620 * [request] - The metadata request object. |
620 * | 621 * |
621 * Request parameters: | 622 * Request parameters: |
622 * | 623 * |
623 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 624 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
624 * error. | 625 * error. |
625 * | 626 * |
626 * If the used [http.Client] completes with an error when making a REST call, | 627 * If the used [http.Client] completes with an error when making a REST call, |
627 * this method will complete with the same error. | 628 * this method will complete with the same error. |
628 */ | 629 */ |
629 async.Future publish(PublishRequest request) { | 630 async.Future publish(PublishRequest request) { |
630 var _url = null; | 631 var _url = null; |
631 var _queryParams = new core.Map(); | 632 var _queryParams = new core.Map(); |
632 var _uploadMedia = null; | 633 var _uploadMedia = null; |
633 var _uploadOptions = null; | 634 var _uploadOptions = null; |
634 var _downloadOptions = common.DownloadOptions.Metadata; | 635 var _downloadOptions = commons.DownloadOptions.Metadata; |
635 var _body = null; | 636 var _body = null; |
636 | 637 |
637 if (request != null) { | 638 if (request != null) { |
638 _body = convert.JSON.encode((request).toJson()); | 639 _body = convert.JSON.encode((request).toJson()); |
639 } | 640 } |
640 | 641 |
641 _downloadOptions = null; | 642 _downloadOptions = null; |
642 | 643 |
643 _url = 'topics/publish'; | 644 _url = 'topics/publish'; |
644 | 645 |
(...skipping 10 matching lines...) Expand all Loading... |
655 /** | 656 /** |
656 * Adds one or more messages to the topic. Returns NOT_FOUND if the topic does | 657 * Adds one or more messages to the topic. Returns NOT_FOUND if the topic does |
657 * not exist. | 658 * not exist. |
658 * | 659 * |
659 * [request] - The metadata request object. | 660 * [request] - The metadata request object. |
660 * | 661 * |
661 * Request parameters: | 662 * Request parameters: |
662 * | 663 * |
663 * Completes with a [PublishBatchResponse]. | 664 * Completes with a [PublishBatchResponse]. |
664 * | 665 * |
665 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 666 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
666 * error. | 667 * error. |
667 * | 668 * |
668 * If the used [http.Client] completes with an error when making a REST call, | 669 * If the used [http.Client] completes with an error when making a REST call, |
669 * this method will complete with the same error. | 670 * this method will complete with the same error. |
670 */ | 671 */ |
671 async.Future<PublishBatchResponse> publishBatch(PublishBatchRequest request) { | 672 async.Future<PublishBatchResponse> publishBatch(PublishBatchRequest request) { |
672 var _url = null; | 673 var _url = null; |
673 var _queryParams = new core.Map(); | 674 var _queryParams = new core.Map(); |
674 var _uploadMedia = null; | 675 var _uploadMedia = null; |
675 var _uploadOptions = null; | 676 var _uploadOptions = null; |
676 var _downloadOptions = common.DownloadOptions.Metadata; | 677 var _downloadOptions = commons.DownloadOptions.Metadata; |
677 var _body = null; | 678 var _body = null; |
678 | 679 |
679 if (request != null) { | 680 if (request != null) { |
680 _body = convert.JSON.encode((request).toJson()); | 681 _body = convert.JSON.encode((request).toJson()); |
681 } | 682 } |
682 | 683 |
683 | 684 |
684 _url = 'topics/publishBatch'; | 685 _url = 'topics/publishBatch'; |
685 | 686 |
686 var _response = _requester.request(_url, | 687 var _response = _requester.request(_url, |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1420 } | 1421 } |
1421 | 1422 |
1422 core.Map toJson() { | 1423 core.Map toJson() { |
1423 var _json = new core.Map(); | 1424 var _json = new core.Map(); |
1424 if (name != null) { | 1425 if (name != null) { |
1425 _json["name"] = name; | 1426 _json["name"] = name; |
1426 } | 1427 } |
1427 return _json; | 1428 return _json; |
1428 } | 1429 } |
1429 } | 1430 } |
1430 | |
1431 | |
OLD | NEW |