Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: generated/googleapis/lib/pubsub/v1.dart

Issue 3006323002: Api-Roll 54: 2017-09-11 (Closed)
Patch Set: use 2.0.0-dev.infinity sdk constraint in pubspecs Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // This is a generated file (see the discoveryapis_generator project). 1 // This is a generated file (see the discoveryapis_generator project).
2 2
3 library googleapis.pubsub.v1; 3 library googleapis.pubsub.v1;
4 4
5 import 'dart:core' as core; 5 import 'dart:core' as core;
6 import 'dart:async' as async; 6 import 'dart:async' as async;
7 import 'dart:convert' as convert; 7 import 'dart:convert' as convert;
8 8
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons;
10 import 'package:http/http.dart' as http; 10 import 'package:http/http.dart' as http;
11 11
12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart'
13 ApiRequestError, DetailedApiRequestError; 13 show ApiRequestError, DetailedApiRequestError;
14 14
15 const core.String USER_AGENT = 'dart-api-client pubsub/v1'; 15 const core.String USER_AGENT = 'dart-api-client pubsub/v1';
16 16
17 /** 17 /// Provides reliable, many-to-many, asynchronous messaging between
18 * Provides reliable, many-to-many, asynchronous messaging between applications. 18 /// applications.
19 */
20 class PubsubApi { 19 class PubsubApi {
21 /** View and manage your data across Google Cloud Platform services */ 20 /// View and manage your data across Google Cloud Platform services
22 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf orm"; 21 static const CloudPlatformScope =
22 "https://www.googleapis.com/auth/cloud-platform";
23 23
24 /** View and manage Pub/Sub topics and subscriptions */ 24 /// View and manage Pub/Sub topics and subscriptions
25 static const PubsubScope = "https://www.googleapis.com/auth/pubsub"; 25 static const PubsubScope = "https://www.googleapis.com/auth/pubsub";
26 26
27
28 final commons.ApiRequester _requester; 27 final commons.ApiRequester _requester;
29 28
30 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); 29 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester);
31 30
32 PubsubApi(http.Client client, {core.String rootUrl: "https://pubsub.googleapis .com/", core.String servicePath: ""}) : 31 PubsubApi(http.Client client,
33 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A GENT); 32 {core.String rootUrl: "https://pubsub.googleapis.com/",
33 core.String servicePath: ""})
34 : _requester =
35 new commons.ApiRequester(client, rootUrl, servicePath, USER_AGENT);
34 } 36 }
35 37
36
37 class ProjectsResourceApi { 38 class ProjectsResourceApi {
38 final commons.ApiRequester _requester; 39 final commons.ApiRequester _requester;
39 40
40 ProjectsSnapshotsResourceApi get snapshots => new ProjectsSnapshotsResourceApi (_requester); 41 ProjectsSnapshotsResourceApi get snapshots =>
41 ProjectsSubscriptionsResourceApi get subscriptions => new ProjectsSubscription sResourceApi(_requester); 42 new ProjectsSnapshotsResourceApi(_requester);
42 ProjectsTopicsResourceApi get topics => new ProjectsTopicsResourceApi(_request er); 43 ProjectsSubscriptionsResourceApi get subscriptions =>
44 new ProjectsSubscriptionsResourceApi(_requester);
45 ProjectsTopicsResourceApi get topics =>
46 new ProjectsTopicsResourceApi(_requester);
43 47
44 ProjectsResourceApi(commons.ApiRequester client) : 48 ProjectsResourceApi(commons.ApiRequester client) : _requester = client;
45 _requester = client;
46 } 49 }
47 50
48
49 class ProjectsSnapshotsResourceApi { 51 class ProjectsSnapshotsResourceApi {
50 final commons.ApiRequester _requester; 52 final commons.ApiRequester _requester;
51 53
52 ProjectsSnapshotsResourceApi(commons.ApiRequester client) : 54 ProjectsSnapshotsResourceApi(commons.ApiRequester client)
53 _requester = client; 55 : _requester = client;
54 56
55 /** 57 /// Gets the access control policy for a resource.
56 * Gets the access control policy for a resource. 58 /// Returns an empty policy if the resource exists and does not have a policy
57 * Returns an empty policy if the resource exists and does not have a policy 59 /// set.
58 * set. 60 ///
59 * 61 /// Request parameters:
60 * Request parameters: 62 ///
61 * 63 /// [resource] - REQUIRED: The resource for which the policy is being
62 * [resource] - REQUIRED: The resource for which the policy is being 64 /// requested.
63 * requested. 65 /// See the operation documentation for the appropriate value for this field.
64 * See the operation documentation for the appropriate value for this field. 66 /// Value must have pattern "^projects/[^/]+/snapshots/[^/]+$".
65 * Value must have pattern "^projects/[^/]+/snapshots/[^/]+$". 67 ///
66 * 68 /// Completes with a [Policy].
67 * Completes with a [Policy]. 69 ///
68 * 70 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
69 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 71 /// an error.
70 * error. 72 ///
71 * 73 /// If the used [http.Client] completes with an error when making a REST
72 * If the used [http.Client] completes with an error when making a REST call, 74 /// call, this method will complete with the same error.
73 * this method will complete with the same error.
74 */
75 async.Future<Policy> getIamPolicy(core.String resource) { 75 async.Future<Policy> getIamPolicy(core.String resource) {
76 var _url = null; 76 var _url = null;
77 var _queryParams = new core.Map(); 77 var _queryParams = new core.Map();
78 var _uploadMedia = null; 78 var _uploadMedia = null;
79 var _uploadOptions = null; 79 var _uploadOptions = null;
80 var _downloadOptions = commons.DownloadOptions.Metadata; 80 var _downloadOptions = commons.DownloadOptions.Metadata;
81 var _body = null; 81 var _body = null;
82 82
83 if (resource == null) { 83 if (resource == null) {
84 throw new core.ArgumentError("Parameter resource is required."); 84 throw new core.ArgumentError("Parameter resource is required.");
85 } 85 }
86 86
87 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getIam Policy'; 87 _url = 'v1/' +
88 commons.Escaper.ecapeVariableReserved('$resource') +
89 ':getIamPolicy';
88 90
89 var _response = _requester.request(_url, 91 var _response = _requester.request(_url, "GET",
90 "GET", 92 body: _body,
91 body: _body, 93 queryParams: _queryParams,
92 queryParams: _queryParams, 94 uploadOptions: _uploadOptions,
93 uploadOptions: _uploadOptions, 95 uploadMedia: _uploadMedia,
94 uploadMedia: _uploadMedia, 96 downloadOptions: _downloadOptions);
95 downloadOptions: _downloadOptions);
96 return _response.then((data) => new Policy.fromJson(data)); 97 return _response.then((data) => new Policy.fromJson(data));
97 } 98 }
98 99
99 /** 100 /// Sets the access control policy on the specified resource. Replaces any
100 * Sets the access control policy on the specified resource. Replaces any 101 /// existing policy.
101 * existing policy. 102 ///
102 * 103 /// [request] - The metadata request object.
103 * [request] - The metadata request object. 104 ///
104 * 105 /// Request parameters:
105 * Request parameters: 106 ///
106 * 107 /// [resource] - REQUIRED: The resource for which the policy is being
107 * [resource] - REQUIRED: The resource for which the policy is being 108 /// specified.
108 * specified. 109 /// See the operation documentation for the appropriate value for this field.
109 * See the operation documentation for the appropriate value for this field. 110 /// Value must have pattern "^projects/[^/]+/snapshots/[^/]+$".
110 * Value must have pattern "^projects/[^/]+/snapshots/[^/]+$". 111 ///
111 * 112 /// Completes with a [Policy].
112 * Completes with a [Policy]. 113 ///
113 * 114 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
114 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 115 /// an error.
115 * error. 116 ///
116 * 117 /// If the used [http.Client] completes with an error when making a REST
117 * If the used [http.Client] completes with an error when making a REST call, 118 /// call, this method will complete with the same error.
118 * this method will complete with the same error. 119 async.Future<Policy> setIamPolicy(
119 */ 120 SetIamPolicyRequest request, core.String resource) {
120 async.Future<Policy> setIamPolicy(SetIamPolicyRequest request, core.String res ource) {
121 var _url = null; 121 var _url = null;
122 var _queryParams = new core.Map(); 122 var _queryParams = new core.Map();
123 var _uploadMedia = null; 123 var _uploadMedia = null;
124 var _uploadOptions = null; 124 var _uploadOptions = null;
125 var _downloadOptions = commons.DownloadOptions.Metadata; 125 var _downloadOptions = commons.DownloadOptions.Metadata;
126 var _body = null; 126 var _body = null;
127 127
128 if (request != null) { 128 if (request != null) {
129 _body = convert.JSON.encode((request).toJson()); 129 _body = convert.JSON.encode((request).toJson());
130 } 130 }
131 if (resource == null) { 131 if (resource == null) {
132 throw new core.ArgumentError("Parameter resource is required."); 132 throw new core.ArgumentError("Parameter resource is required.");
133 } 133 }
134 134
135 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':setIam Policy'; 135 _url = 'v1/' +
136 commons.Escaper.ecapeVariableReserved('$resource') +
137 ':setIamPolicy';
136 138
137 var _response = _requester.request(_url, 139 var _response = _requester.request(_url, "POST",
138 "POST", 140 body: _body,
139 body: _body, 141 queryParams: _queryParams,
140 queryParams: _queryParams, 142 uploadOptions: _uploadOptions,
141 uploadOptions: _uploadOptions, 143 uploadMedia: _uploadMedia,
142 uploadMedia: _uploadMedia, 144 downloadOptions: _downloadOptions);
143 downloadOptions: _downloadOptions);
144 return _response.then((data) => new Policy.fromJson(data)); 145 return _response.then((data) => new Policy.fromJson(data));
145 } 146 }
146 147
147 /** 148 /// Returns permissions that a caller has on the specified resource.
148 * Returns permissions that a caller has on the specified resource. 149 /// If the resource does not exist, this will return an empty set of
149 * If the resource does not exist, this will return an empty set of 150 /// permissions, not a NOT_FOUND error.
150 * permissions, not a NOT_FOUND error. 151 ///
151 * 152 /// Note: This operation is designed to be used for building permission-aware
152 * Note: This operation is designed to be used for building permission-aware 153 /// UIs and command-line tools, not for authorization checking. This
153 * UIs and command-line tools, not for authorization checking. This operation 154 /// operation
154 * may "fail open" without warning. 155 /// may "fail open" without warning.
155 * 156 ///
156 * [request] - The metadata request object. 157 /// [request] - The metadata request object.
157 * 158 ///
158 * Request parameters: 159 /// Request parameters:
159 * 160 ///
160 * [resource] - REQUIRED: The resource for which the policy detail is being 161 /// [resource] - REQUIRED: The resource for which the policy detail is being
161 * requested. 162 /// requested.
162 * See the operation documentation for the appropriate value for this field. 163 /// See the operation documentation for the appropriate value for this field.
163 * Value must have pattern "^projects/[^/]+/snapshots/[^/]+$". 164 /// Value must have pattern "^projects/[^/]+/snapshots/[^/]+$".
164 * 165 ///
165 * Completes with a [TestIamPermissionsResponse]. 166 /// Completes with a [TestIamPermissionsResponse].
166 * 167 ///
167 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 168 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
168 * error. 169 /// an error.
169 * 170 ///
170 * If the used [http.Client] completes with an error when making a REST call, 171 /// If the used [http.Client] completes with an error when making a REST
171 * this method will complete with the same error. 172 /// call, this method will complete with the same error.
172 */ 173 async.Future<TestIamPermissionsResponse> testIamPermissions(
173 async.Future<TestIamPermissionsResponse> testIamPermissions(TestIamPermissions Request request, core.String resource) { 174 TestIamPermissionsRequest request, core.String resource) {
174 var _url = null; 175 var _url = null;
175 var _queryParams = new core.Map(); 176 var _queryParams = new core.Map();
176 var _uploadMedia = null; 177 var _uploadMedia = null;
177 var _uploadOptions = null; 178 var _uploadOptions = null;
178 var _downloadOptions = commons.DownloadOptions.Metadata; 179 var _downloadOptions = commons.DownloadOptions.Metadata;
179 var _body = null; 180 var _body = null;
180 181
181 if (request != null) { 182 if (request != null) {
182 _body = convert.JSON.encode((request).toJson()); 183 _body = convert.JSON.encode((request).toJson());
183 } 184 }
184 if (resource == null) { 185 if (resource == null) {
185 throw new core.ArgumentError("Parameter resource is required."); 186 throw new core.ArgumentError("Parameter resource is required.");
186 } 187 }
187 188
188 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':testIa mPermissions'; 189 _url = 'v1/' +
190 commons.Escaper.ecapeVariableReserved('$resource') +
191 ':testIamPermissions';
189 192
190 var _response = _requester.request(_url, 193 var _response = _requester.request(_url, "POST",
191 "POST", 194 body: _body,
192 body: _body, 195 queryParams: _queryParams,
193 queryParams: _queryParams, 196 uploadOptions: _uploadOptions,
194 uploadOptions: _uploadOptions, 197 uploadMedia: _uploadMedia,
195 uploadMedia: _uploadMedia, 198 downloadOptions: _downloadOptions);
196 downloadOptions: _downloadOptions); 199 return _response
197 return _response.then((data) => new TestIamPermissionsResponse.fromJson(data )); 200 .then((data) => new TestIamPermissionsResponse.fromJson(data));
198 } 201 }
199
200 } 202 }
201 203
202
203 class ProjectsSubscriptionsResourceApi { 204 class ProjectsSubscriptionsResourceApi {
204 final commons.ApiRequester _requester; 205 final commons.ApiRequester _requester;
205 206
206 ProjectsSubscriptionsResourceApi(commons.ApiRequester client) : 207 ProjectsSubscriptionsResourceApi(commons.ApiRequester client)
207 _requester = client; 208 : _requester = client;
208 209
209 /** 210 /// Acknowledges the messages associated with the `ack_ids` in the
210 * Acknowledges the messages associated with the `ack_ids` in the 211 /// `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages
211 * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages 212 /// from the subscription.
212 * from the subscription. 213 ///
213 * 214 /// Acknowledging a message whose ack deadline has expired may succeed,
214 * Acknowledging a message whose ack deadline has expired may succeed, 215 /// but such a message may be redelivered later. Acknowledging a message more
215 * but such a message may be redelivered later. Acknowledging a message more 216 /// than once will not result in an error.
216 * than once will not result in an error. 217 ///
217 * 218 /// [request] - The metadata request object.
218 * [request] - The metadata request object. 219 ///
219 * 220 /// Request parameters:
220 * Request parameters: 221 ///
221 * 222 /// [subscription] - The subscription whose message is being acknowledged.
222 * [subscription] - The subscription whose message is being acknowledged. 223 /// Format is `projects/{project}/subscriptions/{sub}`.
223 * Format is `projects/{project}/subscriptions/{sub}`. 224 /// Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$".
224 * Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$". 225 ///
225 * 226 /// Completes with a [Empty].
226 * Completes with a [Empty]. 227 ///
227 * 228 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
228 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 229 /// an error.
229 * error. 230 ///
230 * 231 /// If the used [http.Client] completes with an error when making a REST
231 * If the used [http.Client] completes with an error when making a REST call, 232 /// call, this method will complete with the same error.
232 * this method will complete with the same error. 233 async.Future<Empty> acknowledge(
233 */ 234 AcknowledgeRequest request, core.String subscription) {
234 async.Future<Empty> acknowledge(AcknowledgeRequest request, core.String subscr iption) {
235 var _url = null; 235 var _url = null;
236 var _queryParams = new core.Map(); 236 var _queryParams = new core.Map();
237 var _uploadMedia = null; 237 var _uploadMedia = null;
238 var _uploadOptions = null; 238 var _uploadOptions = null;
239 var _downloadOptions = commons.DownloadOptions.Metadata; 239 var _downloadOptions = commons.DownloadOptions.Metadata;
240 var _body = null; 240 var _body = null;
241 241
242 if (request != null) { 242 if (request != null) {
243 _body = convert.JSON.encode((request).toJson()); 243 _body = convert.JSON.encode((request).toJson());
244 } 244 }
245 if (subscription == null) { 245 if (subscription == null) {
246 throw new core.ArgumentError("Parameter subscription is required."); 246 throw new core.ArgumentError("Parameter subscription is required.");
247 } 247 }
248 248
249 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$subscription') + ':ac knowledge'; 249 _url = 'v1/' +
250 commons.Escaper.ecapeVariableReserved('$subscription') +
251 ':acknowledge';
250 252
251 var _response = _requester.request(_url, 253 var _response = _requester.request(_url, "POST",
252 "POST", 254 body: _body,
253 body: _body, 255 queryParams: _queryParams,
254 queryParams: _queryParams, 256 uploadOptions: _uploadOptions,
255 uploadOptions: _uploadOptions, 257 uploadMedia: _uploadMedia,
256 uploadMedia: _uploadMedia, 258 downloadOptions: _downloadOptions);
257 downloadOptions: _downloadOptions);
258 return _response.then((data) => new Empty.fromJson(data)); 259 return _response.then((data) => new Empty.fromJson(data));
259 } 260 }
260 261
261 /** 262 /// Creates a subscription to a given topic.
262 * Creates a subscription to a given topic. 263 /// If the subscription already exists, returns `ALREADY_EXISTS`.
263 * If the subscription already exists, returns `ALREADY_EXISTS`. 264 /// If the corresponding topic doesn't exist, returns `NOT_FOUND`.
264 * If the corresponding topic doesn't exist, returns `NOT_FOUND`. 265 ///
265 * 266 /// If the name is not provided in the request, the server will assign a
266 * If the name is not provided in the request, the server will assign a random 267 /// random
267 * name for this subscription on the same project as the topic, conforming 268 /// name for this subscription on the same project as the topic, conforming
268 * to the 269 /// to the
269 * [resource name 270 /// [resource name
270 * format](https://cloud.google.com/pubsub/docs/overview#names). 271 /// format](https://cloud.google.com/pubsub/docs/overview#names).
271 * The generated name is populated in the returned Subscription object. 272 /// The generated name is populated in the returned Subscription object.
272 * Note that for REST API requests, you must specify a name in the request. 273 /// Note that for REST API requests, you must specify a name in the request.
273 * 274 ///
274 * [request] - The metadata request object. 275 /// [request] - The metadata request object.
275 * 276 ///
276 * Request parameters: 277 /// Request parameters:
277 * 278 ///
278 * [name] - The name of the subscription. It must have the format 279 /// [name] - The name of the subscription. It must have the format
279 * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must 280 /// `"projects/{project}/subscriptions/{subscription}"`. `{subscription}`
280 * start with a letter, and contain only letters (`[A-Za-z]`), numbers 281 /// must
281 * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), 282 /// start with a letter, and contain only letters (`[A-Za-z]`), numbers
282 * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters 283 /// (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
283 * in length, and it must not start with `"goog"`. 284 /// plus (`+`) or percent signs (`%`). It must be between 3 and 255
284 * Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$". 285 /// characters
285 * 286 /// in length, and it must not start with `"goog"`.
286 * Completes with a [Subscription]. 287 /// Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$".
287 * 288 ///
288 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 289 /// Completes with a [Subscription].
289 * error. 290 ///
290 * 291 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
291 * If the used [http.Client] completes with an error when making a REST call, 292 /// an error.
292 * this method will complete with the same error. 293 ///
293 */ 294 /// If the used [http.Client] completes with an error when making a REST
295 /// call, this method will complete with the same error.
294 async.Future<Subscription> create(Subscription request, core.String name) { 296 async.Future<Subscription> create(Subscription request, core.String name) {
295 var _url = null; 297 var _url = null;
296 var _queryParams = new core.Map(); 298 var _queryParams = new core.Map();
297 var _uploadMedia = null; 299 var _uploadMedia = null;
298 var _uploadOptions = null; 300 var _uploadOptions = null;
299 var _downloadOptions = commons.DownloadOptions.Metadata; 301 var _downloadOptions = commons.DownloadOptions.Metadata;
300 var _body = null; 302 var _body = null;
301 303
302 if (request != null) { 304 if (request != null) {
303 _body = convert.JSON.encode((request).toJson()); 305 _body = convert.JSON.encode((request).toJson());
304 } 306 }
305 if (name == null) { 307 if (name == null) {
306 throw new core.ArgumentError("Parameter name is required."); 308 throw new core.ArgumentError("Parameter name is required.");
307 } 309 }
308 310
309 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); 311 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name');
310 312
311 var _response = _requester.request(_url, 313 var _response = _requester.request(_url, "PUT",
312 "PUT", 314 body: _body,
313 body: _body, 315 queryParams: _queryParams,
314 queryParams: _queryParams, 316 uploadOptions: _uploadOptions,
315 uploadOptions: _uploadOptions, 317 uploadMedia: _uploadMedia,
316 uploadMedia: _uploadMedia, 318 downloadOptions: _downloadOptions);
317 downloadOptions: _downloadOptions);
318 return _response.then((data) => new Subscription.fromJson(data)); 319 return _response.then((data) => new Subscription.fromJson(data));
319 } 320 }
320 321
321 /** 322 /// Deletes an existing subscription. All messages retained in the
322 * Deletes an existing subscription. All messages retained in the subscription 323 /// subscription
323 * are immediately dropped. Calls to `Pull` after deletion will return 324 /// are immediately dropped. Calls to `Pull` after deletion will return
324 * `NOT_FOUND`. After a subscription is deleted, a new one may be created with 325 /// `NOT_FOUND`. After a subscription is deleted, a new one may be created
325 * the same name, but the new one has no association with the old 326 /// with
326 * subscription or its topic unless the same topic is specified. 327 /// the same name, but the new one has no association with the old
327 * 328 /// subscription or its topic unless the same topic is specified.
328 * Request parameters: 329 ///
329 * 330 /// Request parameters:
330 * [subscription] - The subscription to delete. 331 ///
331 * Format is `projects/{project}/subscriptions/{sub}`. 332 /// [subscription] - The subscription to delete.
332 * Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$". 333 /// Format is `projects/{project}/subscriptions/{sub}`.
333 * 334 /// Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$".
334 * Completes with a [Empty]. 335 ///
335 * 336 /// Completes with a [Empty].
336 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 337 ///
337 * error. 338 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
338 * 339 /// an error.
339 * If the used [http.Client] completes with an error when making a REST call, 340 ///
340 * this method will complete with the same error. 341 /// If the used [http.Client] completes with an error when making a REST
341 */ 342 /// call, this method will complete with the same error.
342 async.Future<Empty> delete(core.String subscription) { 343 async.Future<Empty> delete(core.String subscription) {
343 var _url = null; 344 var _url = null;
344 var _queryParams = new core.Map(); 345 var _queryParams = new core.Map();
345 var _uploadMedia = null; 346 var _uploadMedia = null;
346 var _uploadOptions = null; 347 var _uploadOptions = null;
347 var _downloadOptions = commons.DownloadOptions.Metadata; 348 var _downloadOptions = commons.DownloadOptions.Metadata;
348 var _body = null; 349 var _body = null;
349 350
350 if (subscription == null) { 351 if (subscription == null) {
351 throw new core.ArgumentError("Parameter subscription is required."); 352 throw new core.ArgumentError("Parameter subscription is required.");
352 } 353 }
353 354
354 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$subscription'); 355 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$subscription');
355 356
356 var _response = _requester.request(_url, 357 var _response = _requester.request(_url, "DELETE",
357 "DELETE", 358 body: _body,
358 body: _body, 359 queryParams: _queryParams,
359 queryParams: _queryParams, 360 uploadOptions: _uploadOptions,
360 uploadOptions: _uploadOptions, 361 uploadMedia: _uploadMedia,
361 uploadMedia: _uploadMedia, 362 downloadOptions: _downloadOptions);
362 downloadOptions: _downloadOptions);
363 return _response.then((data) => new Empty.fromJson(data)); 363 return _response.then((data) => new Empty.fromJson(data));
364 } 364 }
365 365
366 /** 366 /// Gets the configuration details of a subscription.
367 * Gets the configuration details of a subscription. 367 ///
368 * 368 /// Request parameters:
369 * Request parameters: 369 ///
370 * 370 /// [subscription] - The name of the subscription to get.
371 * [subscription] - The name of the subscription to get. 371 /// Format is `projects/{project}/subscriptions/{sub}`.
372 * Format is `projects/{project}/subscriptions/{sub}`. 372 /// Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$".
373 * Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$". 373 ///
374 * 374 /// Completes with a [Subscription].
375 * Completes with a [Subscription]. 375 ///
376 * 376 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
377 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 377 /// an error.
378 * error. 378 ///
379 * 379 /// If the used [http.Client] completes with an error when making a REST
380 * If the used [http.Client] completes with an error when making a REST call, 380 /// call, this method will complete with the same error.
381 * this method will complete with the same error.
382 */
383 async.Future<Subscription> get(core.String subscription) { 381 async.Future<Subscription> get(core.String subscription) {
384 var _url = null; 382 var _url = null;
385 var _queryParams = new core.Map(); 383 var _queryParams = new core.Map();
386 var _uploadMedia = null; 384 var _uploadMedia = null;
387 var _uploadOptions = null; 385 var _uploadOptions = null;
388 var _downloadOptions = commons.DownloadOptions.Metadata; 386 var _downloadOptions = commons.DownloadOptions.Metadata;
389 var _body = null; 387 var _body = null;
390 388
391 if (subscription == null) { 389 if (subscription == null) {
392 throw new core.ArgumentError("Parameter subscription is required."); 390 throw new core.ArgumentError("Parameter subscription is required.");
393 } 391 }
394 392
395 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$subscription'); 393 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$subscription');
396 394
397 var _response = _requester.request(_url, 395 var _response = _requester.request(_url, "GET",
398 "GET", 396 body: _body,
399 body: _body, 397 queryParams: _queryParams,
400 queryParams: _queryParams, 398 uploadOptions: _uploadOptions,
401 uploadOptions: _uploadOptions, 399 uploadMedia: _uploadMedia,
402 uploadMedia: _uploadMedia, 400 downloadOptions: _downloadOptions);
403 downloadOptions: _downloadOptions);
404 return _response.then((data) => new Subscription.fromJson(data)); 401 return _response.then((data) => new Subscription.fromJson(data));
405 } 402 }
406 403
407 /** 404 /// Gets the access control policy for a resource.
408 * Gets the access control policy for a resource. 405 /// Returns an empty policy if the resource exists and does not have a policy
409 * Returns an empty policy if the resource exists and does not have a policy 406 /// set.
410 * set. 407 ///
411 * 408 /// Request parameters:
412 * Request parameters: 409 ///
413 * 410 /// [resource] - REQUIRED: The resource for which the policy is being
414 * [resource] - REQUIRED: The resource for which the policy is being 411 /// requested.
415 * requested. 412 /// See the operation documentation for the appropriate value for this field.
416 * See the operation documentation for the appropriate value for this field. 413 /// Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$".
417 * Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$". 414 ///
418 * 415 /// Completes with a [Policy].
419 * Completes with a [Policy]. 416 ///
420 * 417 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
421 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 418 /// an error.
422 * error. 419 ///
423 * 420 /// If the used [http.Client] completes with an error when making a REST
424 * If the used [http.Client] completes with an error when making a REST call, 421 /// call, this method will complete with the same error.
425 * this method will complete with the same error.
426 */
427 async.Future<Policy> getIamPolicy(core.String resource) { 422 async.Future<Policy> getIamPolicy(core.String resource) {
428 var _url = null; 423 var _url = null;
429 var _queryParams = new core.Map(); 424 var _queryParams = new core.Map();
430 var _uploadMedia = null; 425 var _uploadMedia = null;
431 var _uploadOptions = null; 426 var _uploadOptions = null;
432 var _downloadOptions = commons.DownloadOptions.Metadata; 427 var _downloadOptions = commons.DownloadOptions.Metadata;
433 var _body = null; 428 var _body = null;
434 429
435 if (resource == null) { 430 if (resource == null) {
436 throw new core.ArgumentError("Parameter resource is required."); 431 throw new core.ArgumentError("Parameter resource is required.");
437 } 432 }
438 433
439 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getIam Policy'; 434 _url = 'v1/' +
435 commons.Escaper.ecapeVariableReserved('$resource') +
436 ':getIamPolicy';
440 437
441 var _response = _requester.request(_url, 438 var _response = _requester.request(_url, "GET",
442 "GET", 439 body: _body,
443 body: _body, 440 queryParams: _queryParams,
444 queryParams: _queryParams, 441 uploadOptions: _uploadOptions,
445 uploadOptions: _uploadOptions, 442 uploadMedia: _uploadMedia,
446 uploadMedia: _uploadMedia, 443 downloadOptions: _downloadOptions);
447 downloadOptions: _downloadOptions);
448 return _response.then((data) => new Policy.fromJson(data)); 444 return _response.then((data) => new Policy.fromJson(data));
449 } 445 }
450 446
451 /** 447 /// Lists matching subscriptions.
452 * Lists matching subscriptions. 448 ///
453 * 449 /// Request parameters:
454 * Request parameters: 450 ///
455 * 451 /// [project] - The name of the cloud project that subscriptions belong to.
456 * [project] - The name of the cloud project that subscriptions belong to. 452 /// Format is `projects/{project}`.
457 * Format is `projects/{project}`. 453 /// Value must have pattern "^projects/[^/]+$".
458 * Value must have pattern "^projects/[^/]+$". 454 ///
459 * 455 /// [pageSize] - Maximum number of subscriptions to return.
460 * [pageToken] - The value returned by the last `ListSubscriptionsResponse`; 456 ///
461 * indicates that 457 /// [pageToken] - The value returned by the last `ListSubscriptionsResponse`;
462 * this is a continuation of a prior `ListSubscriptions` call, and that the 458 /// indicates that
463 * system should return the next page of data. 459 /// this is a continuation of a prior `ListSubscriptions` call, and that the
464 * 460 /// system should return the next page of data.
465 * [pageSize] - Maximum number of subscriptions to return. 461 ///
466 * 462 /// Completes with a [ListSubscriptionsResponse].
467 * Completes with a [ListSubscriptionsResponse]. 463 ///
468 * 464 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
469 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 465 /// an error.
470 * error. 466 ///
471 * 467 /// If the used [http.Client] completes with an error when making a REST
472 * If the used [http.Client] completes with an error when making a REST call, 468 /// call, this method will complete with the same error.
473 * this method will complete with the same error. 469 async.Future<ListSubscriptionsResponse> list(core.String project,
474 */ 470 {core.int pageSize, core.String pageToken}) {
475 async.Future<ListSubscriptionsResponse> list(core.String project, {core.String pageToken, core.int pageSize}) {
476 var _url = null; 471 var _url = null;
477 var _queryParams = new core.Map(); 472 var _queryParams = new core.Map();
478 var _uploadMedia = null; 473 var _uploadMedia = null;
479 var _uploadOptions = null; 474 var _uploadOptions = null;
480 var _downloadOptions = commons.DownloadOptions.Metadata; 475 var _downloadOptions = commons.DownloadOptions.Metadata;
481 var _body = null; 476 var _body = null;
482 477
483 if (project == null) { 478 if (project == null) {
484 throw new core.ArgumentError("Parameter project is required."); 479 throw new core.ArgumentError("Parameter project is required.");
485 } 480 }
481 if (pageSize != null) {
482 _queryParams["pageSize"] = ["${pageSize}"];
483 }
486 if (pageToken != null) { 484 if (pageToken != null) {
487 _queryParams["pageToken"] = [pageToken]; 485 _queryParams["pageToken"] = [pageToken];
488 } 486 }
489 if (pageSize != null) {
490 _queryParams["pageSize"] = ["${pageSize}"];
491 }
492 487
493 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$project') + '/subscri ptions'; 488 _url = 'v1/' +
489 commons.Escaper.ecapeVariableReserved('$project') +
490 '/subscriptions';
494 491
495 var _response = _requester.request(_url, 492 var _response = _requester.request(_url, "GET",
496 "GET", 493 body: _body,
497 body: _body, 494 queryParams: _queryParams,
498 queryParams: _queryParams, 495 uploadOptions: _uploadOptions,
499 uploadOptions: _uploadOptions, 496 uploadMedia: _uploadMedia,
500 uploadMedia: _uploadMedia, 497 downloadOptions: _downloadOptions);
501 downloadOptions: _downloadOptions); 498 return _response
502 return _response.then((data) => new ListSubscriptionsResponse.fromJson(data) ); 499 .then((data) => new ListSubscriptionsResponse.fromJson(data));
503 } 500 }
504 501
505 /** 502 /// Modifies the ack deadline for a specific message. This method is useful
506 * Modifies the ack deadline for a specific message. This method is useful 503 /// to indicate that more time is needed to process a message by the
507 * to indicate that more time is needed to process a message by the 504 /// subscriber, or to make the message available for redelivery if the
508 * subscriber, or to make the message available for redelivery if the 505 /// processing was interrupted. Note that this does not modify the
509 * processing was interrupted. Note that this does not modify the 506 /// subscription-level `ackDeadlineSeconds` used for subsequent messages.
510 * subscription-level `ackDeadlineSeconds` used for subsequent messages. 507 ///
511 * 508 /// [request] - The metadata request object.
512 * [request] - The metadata request object. 509 ///
513 * 510 /// Request parameters:
514 * Request parameters: 511 ///
515 * 512 /// [subscription] - The name of the subscription.
516 * [subscription] - The name of the subscription. 513 /// Format is `projects/{project}/subscriptions/{sub}`.
517 * Format is `projects/{project}/subscriptions/{sub}`. 514 /// Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$".
518 * Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$". 515 ///
519 * 516 /// Completes with a [Empty].
520 * Completes with a [Empty]. 517 ///
521 * 518 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
522 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 519 /// an error.
523 * error. 520 ///
524 * 521 /// If the used [http.Client] completes with an error when making a REST
525 * If the used [http.Client] completes with an error when making a REST call, 522 /// call, this method will complete with the same error.
526 * this method will complete with the same error. 523 async.Future<Empty> modifyAckDeadline(
527 */ 524 ModifyAckDeadlineRequest request, core.String subscription) {
528 async.Future<Empty> modifyAckDeadline(ModifyAckDeadlineRequest request, core.S tring subscription) {
529 var _url = null; 525 var _url = null;
530 var _queryParams = new core.Map(); 526 var _queryParams = new core.Map();
531 var _uploadMedia = null; 527 var _uploadMedia = null;
532 var _uploadOptions = null; 528 var _uploadOptions = null;
533 var _downloadOptions = commons.DownloadOptions.Metadata; 529 var _downloadOptions = commons.DownloadOptions.Metadata;
534 var _body = null; 530 var _body = null;
535 531
536 if (request != null) { 532 if (request != null) {
537 _body = convert.JSON.encode((request).toJson()); 533 _body = convert.JSON.encode((request).toJson());
538 } 534 }
539 if (subscription == null) { 535 if (subscription == null) {
540 throw new core.ArgumentError("Parameter subscription is required."); 536 throw new core.ArgumentError("Parameter subscription is required.");
541 } 537 }
542 538
543 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$subscription') + ':mo difyAckDeadline'; 539 _url = 'v1/' +
540 commons.Escaper.ecapeVariableReserved('$subscription') +
541 ':modifyAckDeadline';
544 542
545 var _response = _requester.request(_url, 543 var _response = _requester.request(_url, "POST",
546 "POST", 544 body: _body,
547 body: _body, 545 queryParams: _queryParams,
548 queryParams: _queryParams, 546 uploadOptions: _uploadOptions,
549 uploadOptions: _uploadOptions, 547 uploadMedia: _uploadMedia,
550 uploadMedia: _uploadMedia, 548 downloadOptions: _downloadOptions);
551 downloadOptions: _downloadOptions);
552 return _response.then((data) => new Empty.fromJson(data)); 549 return _response.then((data) => new Empty.fromJson(data));
553 } 550 }
554 551
555 /** 552 /// Modifies the `PushConfig` for a specified subscription.
556 * Modifies the `PushConfig` for a specified subscription. 553 ///
557 * 554 /// This may be used to change a push subscription to a pull one (signified
558 * This may be used to change a push subscription to a pull one (signified by 555 /// by
559 * an empty `PushConfig`) or vice versa, or change the endpoint URL and other 556 /// an empty `PushConfig`) or vice versa, or change the endpoint URL and
560 * attributes of a push subscription. Messages will accumulate for delivery 557 /// other
561 * continuously through the call regardless of changes to the `PushConfig`. 558 /// attributes of a push subscription. Messages will accumulate for delivery
562 * 559 /// continuously through the call regardless of changes to the `PushConfig`.
563 * [request] - The metadata request object. 560 ///
564 * 561 /// [request] - The metadata request object.
565 * Request parameters: 562 ///
566 * 563 /// Request parameters:
567 * [subscription] - The name of the subscription. 564 ///
568 * Format is `projects/{project}/subscriptions/{sub}`. 565 /// [subscription] - The name of the subscription.
569 * Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$". 566 /// Format is `projects/{project}/subscriptions/{sub}`.
570 * 567 /// Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$".
571 * Completes with a [Empty]. 568 ///
572 * 569 /// Completes with a [Empty].
573 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 570 ///
574 * error. 571 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
575 * 572 /// an error.
576 * If the used [http.Client] completes with an error when making a REST call, 573 ///
577 * this method will complete with the same error. 574 /// If the used [http.Client] completes with an error when making a REST
578 */ 575 /// call, this method will complete with the same error.
579 async.Future<Empty> modifyPushConfig(ModifyPushConfigRequest request, core.Str ing subscription) { 576 async.Future<Empty> modifyPushConfig(
577 ModifyPushConfigRequest request, core.String subscription) {
580 var _url = null; 578 var _url = null;
581 var _queryParams = new core.Map(); 579 var _queryParams = new core.Map();
582 var _uploadMedia = null; 580 var _uploadMedia = null;
583 var _uploadOptions = null; 581 var _uploadOptions = null;
584 var _downloadOptions = commons.DownloadOptions.Metadata; 582 var _downloadOptions = commons.DownloadOptions.Metadata;
585 var _body = null; 583 var _body = null;
586 584
587 if (request != null) { 585 if (request != null) {
588 _body = convert.JSON.encode((request).toJson()); 586 _body = convert.JSON.encode((request).toJson());
589 } 587 }
590 if (subscription == null) { 588 if (subscription == null) {
591 throw new core.ArgumentError("Parameter subscription is required."); 589 throw new core.ArgumentError("Parameter subscription is required.");
592 } 590 }
593 591
594 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$subscription') + ':mo difyPushConfig'; 592 _url = 'v1/' +
593 commons.Escaper.ecapeVariableReserved('$subscription') +
594 ':modifyPushConfig';
595 595
596 var _response = _requester.request(_url, 596 var _response = _requester.request(_url, "POST",
597 "POST", 597 body: _body,
598 body: _body, 598 queryParams: _queryParams,
599 queryParams: _queryParams, 599 uploadOptions: _uploadOptions,
600 uploadOptions: _uploadOptions, 600 uploadMedia: _uploadMedia,
601 uploadMedia: _uploadMedia, 601 downloadOptions: _downloadOptions);
602 downloadOptions: _downloadOptions);
603 return _response.then((data) => new Empty.fromJson(data)); 602 return _response.then((data) => new Empty.fromJson(data));
604 } 603 }
605 604
606 /** 605 /// Pulls messages from the server. Returns an empty list if there are no
607 * Pulls messages from the server. Returns an empty list if there are no 606 /// messages available in the backlog. The server may return `UNAVAILABLE` if
608 * messages available in the backlog. The server may return `UNAVAILABLE` if 607 /// there are too many concurrent pull requests pending for the given
609 * there are too many concurrent pull requests pending for the given 608 /// subscription.
610 * subscription. 609 ///
611 * 610 /// [request] - The metadata request object.
612 * [request] - The metadata request object. 611 ///
613 * 612 /// Request parameters:
614 * Request parameters: 613 ///
615 * 614 /// [subscription] - The subscription from which messages should be pulled.
616 * [subscription] - The subscription from which messages should be pulled. 615 /// Format is `projects/{project}/subscriptions/{sub}`.
617 * Format is `projects/{project}/subscriptions/{sub}`. 616 /// Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$".
618 * Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$". 617 ///
619 * 618 /// Completes with a [PullResponse].
620 * Completes with a [PullResponse]. 619 ///
621 * 620 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
622 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 621 /// an error.
623 * error. 622 ///
624 * 623 /// If the used [http.Client] completes with an error when making a REST
625 * If the used [http.Client] completes with an error when making a REST call, 624 /// call, this method will complete with the same error.
626 * this method will complete with the same error. 625 async.Future<PullResponse> pull(
627 */ 626 PullRequest request, core.String subscription) {
628 async.Future<PullResponse> pull(PullRequest request, core.String subscription) {
629 var _url = null; 627 var _url = null;
630 var _queryParams = new core.Map(); 628 var _queryParams = new core.Map();
631 var _uploadMedia = null; 629 var _uploadMedia = null;
632 var _uploadOptions = null; 630 var _uploadOptions = null;
633 var _downloadOptions = commons.DownloadOptions.Metadata; 631 var _downloadOptions = commons.DownloadOptions.Metadata;
634 var _body = null; 632 var _body = null;
635 633
636 if (request != null) { 634 if (request != null) {
637 _body = convert.JSON.encode((request).toJson()); 635 _body = convert.JSON.encode((request).toJson());
638 } 636 }
639 if (subscription == null) { 637 if (subscription == null) {
640 throw new core.ArgumentError("Parameter subscription is required."); 638 throw new core.ArgumentError("Parameter subscription is required.");
641 } 639 }
642 640
643 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$subscription') + ':pu ll'; 641 _url = 'v1/' +
642 commons.Escaper.ecapeVariableReserved('$subscription') +
643 ':pull';
644 644
645 var _response = _requester.request(_url, 645 var _response = _requester.request(_url, "POST",
646 "POST", 646 body: _body,
647 body: _body, 647 queryParams: _queryParams,
648 queryParams: _queryParams, 648 uploadOptions: _uploadOptions,
649 uploadOptions: _uploadOptions, 649 uploadMedia: _uploadMedia,
650 uploadMedia: _uploadMedia, 650 downloadOptions: _downloadOptions);
651 downloadOptions: _downloadOptions);
652 return _response.then((data) => new PullResponse.fromJson(data)); 651 return _response.then((data) => new PullResponse.fromJson(data));
653 } 652 }
654 653
655 /** 654 /// Sets the access control policy on the specified resource. Replaces any
656 * Sets the access control policy on the specified resource. Replaces any 655 /// existing policy.
657 * existing policy. 656 ///
658 * 657 /// [request] - The metadata request object.
659 * [request] - The metadata request object. 658 ///
660 * 659 /// Request parameters:
661 * Request parameters: 660 ///
662 * 661 /// [resource] - REQUIRED: The resource for which the policy is being
663 * [resource] - REQUIRED: The resource for which the policy is being 662 /// specified.
664 * specified. 663 /// See the operation documentation for the appropriate value for this field.
665 * See the operation documentation for the appropriate value for this field. 664 /// Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$".
666 * Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$". 665 ///
667 * 666 /// Completes with a [Policy].
668 * Completes with a [Policy]. 667 ///
669 * 668 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
670 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 669 /// an error.
671 * error. 670 ///
672 * 671 /// If the used [http.Client] completes with an error when making a REST
673 * If the used [http.Client] completes with an error when making a REST call, 672 /// call, this method will complete with the same error.
674 * this method will complete with the same error. 673 async.Future<Policy> setIamPolicy(
675 */ 674 SetIamPolicyRequest request, core.String resource) {
676 async.Future<Policy> setIamPolicy(SetIamPolicyRequest request, core.String res ource) {
677 var _url = null; 675 var _url = null;
678 var _queryParams = new core.Map(); 676 var _queryParams = new core.Map();
679 var _uploadMedia = null; 677 var _uploadMedia = null;
680 var _uploadOptions = null; 678 var _uploadOptions = null;
681 var _downloadOptions = commons.DownloadOptions.Metadata; 679 var _downloadOptions = commons.DownloadOptions.Metadata;
682 var _body = null; 680 var _body = null;
683 681
684 if (request != null) { 682 if (request != null) {
685 _body = convert.JSON.encode((request).toJson()); 683 _body = convert.JSON.encode((request).toJson());
686 } 684 }
687 if (resource == null) { 685 if (resource == null) {
688 throw new core.ArgumentError("Parameter resource is required."); 686 throw new core.ArgumentError("Parameter resource is required.");
689 } 687 }
690 688
691 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':setIam Policy'; 689 _url = 'v1/' +
690 commons.Escaper.ecapeVariableReserved('$resource') +
691 ':setIamPolicy';
692 692
693 var _response = _requester.request(_url, 693 var _response = _requester.request(_url, "POST",
694 "POST", 694 body: _body,
695 body: _body, 695 queryParams: _queryParams,
696 queryParams: _queryParams, 696 uploadOptions: _uploadOptions,
697 uploadOptions: _uploadOptions, 697 uploadMedia: _uploadMedia,
698 uploadMedia: _uploadMedia, 698 downloadOptions: _downloadOptions);
699 downloadOptions: _downloadOptions);
700 return _response.then((data) => new Policy.fromJson(data)); 699 return _response.then((data) => new Policy.fromJson(data));
701 } 700 }
702 701
703 /** 702 /// Returns permissions that a caller has on the specified resource.
704 * Returns permissions that a caller has on the specified resource. 703 /// If the resource does not exist, this will return an empty set of
705 * If the resource does not exist, this will return an empty set of 704 /// permissions, not a NOT_FOUND error.
706 * permissions, not a NOT_FOUND error. 705 ///
707 * 706 /// Note: This operation is designed to be used for building permission-aware
708 * Note: This operation is designed to be used for building permission-aware 707 /// UIs and command-line tools, not for authorization checking. This
709 * UIs and command-line tools, not for authorization checking. This operation 708 /// operation
710 * may "fail open" without warning. 709 /// may "fail open" without warning.
711 * 710 ///
712 * [request] - The metadata request object. 711 /// [request] - The metadata request object.
713 * 712 ///
714 * Request parameters: 713 /// Request parameters:
715 * 714 ///
716 * [resource] - REQUIRED: The resource for which the policy detail is being 715 /// [resource] - REQUIRED: The resource for which the policy detail is being
717 * requested. 716 /// requested.
718 * See the operation documentation for the appropriate value for this field. 717 /// See the operation documentation for the appropriate value for this field.
719 * Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$". 718 /// Value must have pattern "^projects/[^/]+/subscriptions/[^/]+$".
720 * 719 ///
721 * Completes with a [TestIamPermissionsResponse]. 720 /// Completes with a [TestIamPermissionsResponse].
722 * 721 ///
723 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 722 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
724 * error. 723 /// an error.
725 * 724 ///
726 * If the used [http.Client] completes with an error when making a REST call, 725 /// If the used [http.Client] completes with an error when making a REST
727 * this method will complete with the same error. 726 /// call, this method will complete with the same error.
728 */ 727 async.Future<TestIamPermissionsResponse> testIamPermissions(
729 async.Future<TestIamPermissionsResponse> testIamPermissions(TestIamPermissions Request request, core.String resource) { 728 TestIamPermissionsRequest request, core.String resource) {
730 var _url = null; 729 var _url = null;
731 var _queryParams = new core.Map(); 730 var _queryParams = new core.Map();
732 var _uploadMedia = null; 731 var _uploadMedia = null;
733 var _uploadOptions = null; 732 var _uploadOptions = null;
734 var _downloadOptions = commons.DownloadOptions.Metadata; 733 var _downloadOptions = commons.DownloadOptions.Metadata;
735 var _body = null; 734 var _body = null;
736 735
737 if (request != null) { 736 if (request != null) {
738 _body = convert.JSON.encode((request).toJson()); 737 _body = convert.JSON.encode((request).toJson());
739 } 738 }
740 if (resource == null) { 739 if (resource == null) {
741 throw new core.ArgumentError("Parameter resource is required."); 740 throw new core.ArgumentError("Parameter resource is required.");
742 } 741 }
743 742
744 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':testIa mPermissions'; 743 _url = 'v1/' +
744 commons.Escaper.ecapeVariableReserved('$resource') +
745 ':testIamPermissions';
745 746
746 var _response = _requester.request(_url, 747 var _response = _requester.request(_url, "POST",
747 "POST", 748 body: _body,
748 body: _body, 749 queryParams: _queryParams,
749 queryParams: _queryParams, 750 uploadOptions: _uploadOptions,
750 uploadOptions: _uploadOptions, 751 uploadMedia: _uploadMedia,
751 uploadMedia: _uploadMedia, 752 downloadOptions: _downloadOptions);
752 downloadOptions: _downloadOptions); 753 return _response
753 return _response.then((data) => new TestIamPermissionsResponse.fromJson(data )); 754 .then((data) => new TestIamPermissionsResponse.fromJson(data));
754 } 755 }
755
756 } 756 }
757 757
758
759 class ProjectsTopicsResourceApi { 758 class ProjectsTopicsResourceApi {
760 final commons.ApiRequester _requester; 759 final commons.ApiRequester _requester;
761 760
762 ProjectsTopicsSubscriptionsResourceApi get subscriptions => new ProjectsTopics SubscriptionsResourceApi(_requester); 761 ProjectsTopicsSubscriptionsResourceApi get subscriptions =>
762 new ProjectsTopicsSubscriptionsResourceApi(_requester);
763 763
764 ProjectsTopicsResourceApi(commons.ApiRequester client) : 764 ProjectsTopicsResourceApi(commons.ApiRequester client) : _requester = client;
765 _requester = client;
766 765
767 /** 766 /// Creates the given topic with the given name.
768 * Creates the given topic with the given name. 767 ///
769 * 768 /// [request] - The metadata request object.
770 * [request] - The metadata request object. 769 ///
771 * 770 /// Request parameters:
772 * Request parameters: 771 ///
773 * 772 /// [name] - The name of the topic. It must have the format
774 * [name] - The name of the topic. It must have the format 773 /// `"projects/{project}/topics/{topic}"`. `{topic}` must start with a
775 * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, 774 /// letter,
776 * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), 775 /// and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
777 * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent 776 /// underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
778 * signs (`%`). It must be between 3 and 255 characters in length, and it 777 /// signs (`%`). It must be between 3 and 255 characters in length, and it
779 * must not start with `"goog"`. 778 /// must not start with `"goog"`.
780 * Value must have pattern "^projects/[^/]+/topics/[^/]+$". 779 /// Value must have pattern "^projects/[^/]+/topics/[^/]+$".
781 * 780 ///
782 * Completes with a [Topic]. 781 /// Completes with a [Topic].
783 * 782 ///
784 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 783 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
785 * error. 784 /// an error.
786 * 785 ///
787 * If the used [http.Client] completes with an error when making a REST call, 786 /// If the used [http.Client] completes with an error when making a REST
788 * this method will complete with the same error. 787 /// call, this method will complete with the same error.
789 */
790 async.Future<Topic> create(Topic request, core.String name) { 788 async.Future<Topic> create(Topic request, core.String name) {
791 var _url = null; 789 var _url = null;
792 var _queryParams = new core.Map(); 790 var _queryParams = new core.Map();
793 var _uploadMedia = null; 791 var _uploadMedia = null;
794 var _uploadOptions = null; 792 var _uploadOptions = null;
795 var _downloadOptions = commons.DownloadOptions.Metadata; 793 var _downloadOptions = commons.DownloadOptions.Metadata;
796 var _body = null; 794 var _body = null;
797 795
798 if (request != null) { 796 if (request != null) {
799 _body = convert.JSON.encode((request).toJson()); 797 _body = convert.JSON.encode((request).toJson());
800 } 798 }
801 if (name == null) { 799 if (name == null) {
802 throw new core.ArgumentError("Parameter name is required."); 800 throw new core.ArgumentError("Parameter name is required.");
803 } 801 }
804 802
805 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); 803 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name');
806 804
807 var _response = _requester.request(_url, 805 var _response = _requester.request(_url, "PUT",
808 "PUT", 806 body: _body,
809 body: _body, 807 queryParams: _queryParams,
810 queryParams: _queryParams, 808 uploadOptions: _uploadOptions,
811 uploadOptions: _uploadOptions, 809 uploadMedia: _uploadMedia,
812 uploadMedia: _uploadMedia, 810 downloadOptions: _downloadOptions);
813 downloadOptions: _downloadOptions);
814 return _response.then((data) => new Topic.fromJson(data)); 811 return _response.then((data) => new Topic.fromJson(data));
815 } 812 }
816 813
817 /** 814 /// Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
818 * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic 815 /// does not exist. After a topic is deleted, a new topic may be created with
819 * does not exist. After a topic is deleted, a new topic may be created with 816 /// the same name; this is an entirely new topic with none of the old
820 * the same name; this is an entirely new topic with none of the old 817 /// configuration or subscriptions. Existing subscriptions to this topic are
821 * configuration or subscriptions. Existing subscriptions to this topic are 818 /// not deleted, but their `topic` field is set to `_deleted-topic_`.
822 * not deleted, but their `topic` field is set to `_deleted-topic_`. 819 ///
823 * 820 /// Request parameters:
824 * Request parameters: 821 ///
825 * 822 /// [topic] - Name of the topic to delete.
826 * [topic] - Name of the topic to delete. 823 /// Format is `projects/{project}/topics/{topic}`.
827 * Format is `projects/{project}/topics/{topic}`. 824 /// Value must have pattern "^projects/[^/]+/topics/[^/]+$".
828 * Value must have pattern "^projects/[^/]+/topics/[^/]+$". 825 ///
829 * 826 /// Completes with a [Empty].
830 * Completes with a [Empty]. 827 ///
831 * 828 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
832 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 829 /// an error.
833 * error. 830 ///
834 * 831 /// If the used [http.Client] completes with an error when making a REST
835 * If the used [http.Client] completes with an error when making a REST call, 832 /// call, this method will complete with the same error.
836 * this method will complete with the same error.
837 */
838 async.Future<Empty> delete(core.String topic) { 833 async.Future<Empty> delete(core.String topic) {
839 var _url = null; 834 var _url = null;
840 var _queryParams = new core.Map(); 835 var _queryParams = new core.Map();
841 var _uploadMedia = null; 836 var _uploadMedia = null;
842 var _uploadOptions = null; 837 var _uploadOptions = null;
843 var _downloadOptions = commons.DownloadOptions.Metadata; 838 var _downloadOptions = commons.DownloadOptions.Metadata;
844 var _body = null; 839 var _body = null;
845 840
846 if (topic == null) { 841 if (topic == null) {
847 throw new core.ArgumentError("Parameter topic is required."); 842 throw new core.ArgumentError("Parameter topic is required.");
848 } 843 }
849 844
850 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$topic'); 845 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$topic');
851 846
852 var _response = _requester.request(_url, 847 var _response = _requester.request(_url, "DELETE",
853 "DELETE", 848 body: _body,
854 body: _body, 849 queryParams: _queryParams,
855 queryParams: _queryParams, 850 uploadOptions: _uploadOptions,
856 uploadOptions: _uploadOptions, 851 uploadMedia: _uploadMedia,
857 uploadMedia: _uploadMedia, 852 downloadOptions: _downloadOptions);
858 downloadOptions: _downloadOptions);
859 return _response.then((data) => new Empty.fromJson(data)); 853 return _response.then((data) => new Empty.fromJson(data));
860 } 854 }
861 855
862 /** 856 /// Gets the configuration of a topic.
863 * Gets the configuration of a topic. 857 ///
864 * 858 /// Request parameters:
865 * Request parameters: 859 ///
866 * 860 /// [topic] - The name of the topic to get.
867 * [topic] - The name of the topic to get. 861 /// Format is `projects/{project}/topics/{topic}`.
868 * Format is `projects/{project}/topics/{topic}`. 862 /// Value must have pattern "^projects/[^/]+/topics/[^/]+$".
869 * Value must have pattern "^projects/[^/]+/topics/[^/]+$". 863 ///
870 * 864 /// Completes with a [Topic].
871 * Completes with a [Topic]. 865 ///
872 * 866 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
873 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 867 /// an error.
874 * error. 868 ///
875 * 869 /// If the used [http.Client] completes with an error when making a REST
876 * If the used [http.Client] completes with an error when making a REST call, 870 /// call, this method will complete with the same error.
877 * this method will complete with the same error.
878 */
879 async.Future<Topic> get(core.String topic) { 871 async.Future<Topic> get(core.String topic) {
880 var _url = null; 872 var _url = null;
881 var _queryParams = new core.Map(); 873 var _queryParams = new core.Map();
882 var _uploadMedia = null; 874 var _uploadMedia = null;
883 var _uploadOptions = null; 875 var _uploadOptions = null;
884 var _downloadOptions = commons.DownloadOptions.Metadata; 876 var _downloadOptions = commons.DownloadOptions.Metadata;
885 var _body = null; 877 var _body = null;
886 878
887 if (topic == null) { 879 if (topic == null) {
888 throw new core.ArgumentError("Parameter topic is required."); 880 throw new core.ArgumentError("Parameter topic is required.");
889 } 881 }
890 882
891 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$topic'); 883 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$topic');
892 884
893 var _response = _requester.request(_url, 885 var _response = _requester.request(_url, "GET",
894 "GET", 886 body: _body,
895 body: _body, 887 queryParams: _queryParams,
896 queryParams: _queryParams, 888 uploadOptions: _uploadOptions,
897 uploadOptions: _uploadOptions, 889 uploadMedia: _uploadMedia,
898 uploadMedia: _uploadMedia, 890 downloadOptions: _downloadOptions);
899 downloadOptions: _downloadOptions);
900 return _response.then((data) => new Topic.fromJson(data)); 891 return _response.then((data) => new Topic.fromJson(data));
901 } 892 }
902 893
903 /** 894 /// Gets the access control policy for a resource.
904 * Gets the access control policy for a resource. 895 /// Returns an empty policy if the resource exists and does not have a policy
905 * Returns an empty policy if the resource exists and does not have a policy 896 /// set.
906 * set. 897 ///
907 * 898 /// Request parameters:
908 * Request parameters: 899 ///
909 * 900 /// [resource] - REQUIRED: The resource for which the policy is being
910 * [resource] - REQUIRED: The resource for which the policy is being 901 /// requested.
911 * requested. 902 /// See the operation documentation for the appropriate value for this field.
912 * See the operation documentation for the appropriate value for this field. 903 /// Value must have pattern "^projects/[^/]+/topics/[^/]+$".
913 * Value must have pattern "^projects/[^/]+/topics/[^/]+$". 904 ///
914 * 905 /// Completes with a [Policy].
915 * Completes with a [Policy]. 906 ///
916 * 907 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
917 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 908 /// an error.
918 * error. 909 ///
919 * 910 /// If the used [http.Client] completes with an error when making a REST
920 * If the used [http.Client] completes with an error when making a REST call, 911 /// call, this method will complete with the same error.
921 * this method will complete with the same error.
922 */
923 async.Future<Policy> getIamPolicy(core.String resource) { 912 async.Future<Policy> getIamPolicy(core.String resource) {
924 var _url = null; 913 var _url = null;
925 var _queryParams = new core.Map(); 914 var _queryParams = new core.Map();
926 var _uploadMedia = null; 915 var _uploadMedia = null;
927 var _uploadOptions = null; 916 var _uploadOptions = null;
928 var _downloadOptions = commons.DownloadOptions.Metadata; 917 var _downloadOptions = commons.DownloadOptions.Metadata;
929 var _body = null; 918 var _body = null;
930 919
931 if (resource == null) { 920 if (resource == null) {
932 throw new core.ArgumentError("Parameter resource is required."); 921 throw new core.ArgumentError("Parameter resource is required.");
933 } 922 }
934 923
935 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getIam Policy'; 924 _url = 'v1/' +
925 commons.Escaper.ecapeVariableReserved('$resource') +
926 ':getIamPolicy';
936 927
937 var _response = _requester.request(_url, 928 var _response = _requester.request(_url, "GET",
938 "GET", 929 body: _body,
939 body: _body, 930 queryParams: _queryParams,
940 queryParams: _queryParams, 931 uploadOptions: _uploadOptions,
941 uploadOptions: _uploadOptions, 932 uploadMedia: _uploadMedia,
942 uploadMedia: _uploadMedia, 933 downloadOptions: _downloadOptions);
943 downloadOptions: _downloadOptions);
944 return _response.then((data) => new Policy.fromJson(data)); 934 return _response.then((data) => new Policy.fromJson(data));
945 } 935 }
946 936
947 /** 937 /// Lists matching topics.
948 * Lists matching topics. 938 ///
949 * 939 /// Request parameters:
950 * Request parameters: 940 ///
951 * 941 /// [project] - The name of the cloud project that topics belong to.
952 * [project] - The name of the cloud project that topics belong to. 942 /// Format is `projects/{project}`.
953 * Format is `projects/{project}`. 943 /// Value must have pattern "^projects/[^/]+$".
954 * Value must have pattern "^projects/[^/]+$". 944 ///
955 * 945 /// [pageToken] - The value returned by the last `ListTopicsResponse`;
956 * [pageToken] - The value returned by the last `ListTopicsResponse`; 946 /// indicates that this is
957 * indicates that this is 947 /// a continuation of a prior `ListTopics` call, and that the system should
958 * a continuation of a prior `ListTopics` call, and that the system should 948 /// return the next page of data.
959 * return the next page of data. 949 ///
960 * 950 /// [pageSize] - Maximum number of topics to return.
961 * [pageSize] - Maximum number of topics to return. 951 ///
962 * 952 /// Completes with a [ListTopicsResponse].
963 * Completes with a [ListTopicsResponse]. 953 ///
964 * 954 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
965 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 955 /// an error.
966 * error. 956 ///
967 * 957 /// If the used [http.Client] completes with an error when making a REST
968 * If the used [http.Client] completes with an error when making a REST call, 958 /// call, this method will complete with the same error.
969 * this method will complete with the same error. 959 async.Future<ListTopicsResponse> list(core.String project,
970 */ 960 {core.String pageToken, core.int pageSize}) {
971 async.Future<ListTopicsResponse> list(core.String project, {core.String pageTo ken, core.int pageSize}) {
972 var _url = null; 961 var _url = null;
973 var _queryParams = new core.Map(); 962 var _queryParams = new core.Map();
974 var _uploadMedia = null; 963 var _uploadMedia = null;
975 var _uploadOptions = null; 964 var _uploadOptions = null;
976 var _downloadOptions = commons.DownloadOptions.Metadata; 965 var _downloadOptions = commons.DownloadOptions.Metadata;
977 var _body = null; 966 var _body = null;
978 967
979 if (project == null) { 968 if (project == null) {
980 throw new core.ArgumentError("Parameter project is required."); 969 throw new core.ArgumentError("Parameter project is required.");
981 } 970 }
982 if (pageToken != null) { 971 if (pageToken != null) {
983 _queryParams["pageToken"] = [pageToken]; 972 _queryParams["pageToken"] = [pageToken];
984 } 973 }
985 if (pageSize != null) { 974 if (pageSize != null) {
986 _queryParams["pageSize"] = ["${pageSize}"]; 975 _queryParams["pageSize"] = ["${pageSize}"];
987 } 976 }
988 977
989 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$project') + '/topics' ; 978 _url =
979 'v1/' + commons.Escaper.ecapeVariableReserved('$project') + '/topics';
990 980
991 var _response = _requester.request(_url, 981 var _response = _requester.request(_url, "GET",
992 "GET", 982 body: _body,
993 body: _body, 983 queryParams: _queryParams,
994 queryParams: _queryParams, 984 uploadOptions: _uploadOptions,
995 uploadOptions: _uploadOptions, 985 uploadMedia: _uploadMedia,
996 uploadMedia: _uploadMedia, 986 downloadOptions: _downloadOptions);
997 downloadOptions: _downloadOptions);
998 return _response.then((data) => new ListTopicsResponse.fromJson(data)); 987 return _response.then((data) => new ListTopicsResponse.fromJson(data));
999 } 988 }
1000 989
1001 /** 990 /// Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
1002 * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic 991 /// does not exist. The message payload must not be empty; it must contain
1003 * does not exist. The message payload must not be empty; it must contain 992 /// either a non-empty data field, or at least one attribute.
1004 * either a non-empty data field, or at least one attribute. 993 ///
1005 * 994 /// [request] - The metadata request object.
1006 * [request] - The metadata request object. 995 ///
1007 * 996 /// Request parameters:
1008 * Request parameters: 997 ///
1009 * 998 /// [topic] - The messages in the request will be published on this topic.
1010 * [topic] - The messages in the request will be published on this topic. 999 /// Format is `projects/{project}/topics/{topic}`.
1011 * Format is `projects/{project}/topics/{topic}`. 1000 /// Value must have pattern "^projects/[^/]+/topics/[^/]+$".
1012 * Value must have pattern "^projects/[^/]+/topics/[^/]+$". 1001 ///
1013 * 1002 /// Completes with a [PublishResponse].
1014 * Completes with a [PublishResponse]. 1003 ///
1015 * 1004 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
1016 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 1005 /// an error.
1017 * error. 1006 ///
1018 * 1007 /// If the used [http.Client] completes with an error when making a REST
1019 * If the used [http.Client] completes with an error when making a REST call, 1008 /// call, this method will complete with the same error.
1020 * this method will complete with the same error. 1009 async.Future<PublishResponse> publish(
1021 */ 1010 PublishRequest request, core.String topic) {
1022 async.Future<PublishResponse> publish(PublishRequest request, core.String topi c) {
1023 var _url = null; 1011 var _url = null;
1024 var _queryParams = new core.Map(); 1012 var _queryParams = new core.Map();
1025 var _uploadMedia = null; 1013 var _uploadMedia = null;
1026 var _uploadOptions = null; 1014 var _uploadOptions = null;
1027 var _downloadOptions = commons.DownloadOptions.Metadata; 1015 var _downloadOptions = commons.DownloadOptions.Metadata;
1028 var _body = null; 1016 var _body = null;
1029 1017
1030 if (request != null) { 1018 if (request != null) {
1031 _body = convert.JSON.encode((request).toJson()); 1019 _body = convert.JSON.encode((request).toJson());
1032 } 1020 }
1033 if (topic == null) { 1021 if (topic == null) {
1034 throw new core.ArgumentError("Parameter topic is required."); 1022 throw new core.ArgumentError("Parameter topic is required.");
1035 } 1023 }
1036 1024
1037 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$topic') + ':publish'; 1025 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$topic') + ':publish';
1038 1026
1039 var _response = _requester.request(_url, 1027 var _response = _requester.request(_url, "POST",
1040 "POST", 1028 body: _body,
1041 body: _body, 1029 queryParams: _queryParams,
1042 queryParams: _queryParams, 1030 uploadOptions: _uploadOptions,
1043 uploadOptions: _uploadOptions, 1031 uploadMedia: _uploadMedia,
1044 uploadMedia: _uploadMedia, 1032 downloadOptions: _downloadOptions);
1045 downloadOptions: _downloadOptions);
1046 return _response.then((data) => new PublishResponse.fromJson(data)); 1033 return _response.then((data) => new PublishResponse.fromJson(data));
1047 } 1034 }
1048 1035
1049 /** 1036 /// Sets the access control policy on the specified resource. Replaces any
1050 * Sets the access control policy on the specified resource. Replaces any 1037 /// existing policy.
1051 * existing policy. 1038 ///
1052 * 1039 /// [request] - The metadata request object.
1053 * [request] - The metadata request object. 1040 ///
1054 * 1041 /// Request parameters:
1055 * Request parameters: 1042 ///
1056 * 1043 /// [resource] - REQUIRED: The resource for which the policy is being
1057 * [resource] - REQUIRED: The resource for which the policy is being 1044 /// specified.
1058 * specified. 1045 /// See the operation documentation for the appropriate value for this field.
1059 * See the operation documentation for the appropriate value for this field. 1046 /// Value must have pattern "^projects/[^/]+/topics/[^/]+$".
1060 * Value must have pattern "^projects/[^/]+/topics/[^/]+$". 1047 ///
1061 * 1048 /// Completes with a [Policy].
1062 * Completes with a [Policy]. 1049 ///
1063 * 1050 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
1064 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 1051 /// an error.
1065 * error. 1052 ///
1066 * 1053 /// If the used [http.Client] completes with an error when making a REST
1067 * If the used [http.Client] completes with an error when making a REST call, 1054 /// call, this method will complete with the same error.
1068 * this method will complete with the same error. 1055 async.Future<Policy> setIamPolicy(
1069 */ 1056 SetIamPolicyRequest request, core.String resource) {
1070 async.Future<Policy> setIamPolicy(SetIamPolicyRequest request, core.String res ource) {
1071 var _url = null; 1057 var _url = null;
1072 var _queryParams = new core.Map(); 1058 var _queryParams = new core.Map();
1073 var _uploadMedia = null; 1059 var _uploadMedia = null;
1074 var _uploadOptions = null; 1060 var _uploadOptions = null;
1075 var _downloadOptions = commons.DownloadOptions.Metadata; 1061 var _downloadOptions = commons.DownloadOptions.Metadata;
1076 var _body = null; 1062 var _body = null;
1077 1063
1078 if (request != null) { 1064 if (request != null) {
1079 _body = convert.JSON.encode((request).toJson()); 1065 _body = convert.JSON.encode((request).toJson());
1080 } 1066 }
1081 if (resource == null) { 1067 if (resource == null) {
1082 throw new core.ArgumentError("Parameter resource is required."); 1068 throw new core.ArgumentError("Parameter resource is required.");
1083 } 1069 }
1084 1070
1085 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':setIam Policy'; 1071 _url = 'v1/' +
1072 commons.Escaper.ecapeVariableReserved('$resource') +
1073 ':setIamPolicy';
1086 1074
1087 var _response = _requester.request(_url, 1075 var _response = _requester.request(_url, "POST",
1088 "POST", 1076 body: _body,
1089 body: _body, 1077 queryParams: _queryParams,
1090 queryParams: _queryParams, 1078 uploadOptions: _uploadOptions,
1091 uploadOptions: _uploadOptions, 1079 uploadMedia: _uploadMedia,
1092 uploadMedia: _uploadMedia, 1080 downloadOptions: _downloadOptions);
1093 downloadOptions: _downloadOptions);
1094 return _response.then((data) => new Policy.fromJson(data)); 1081 return _response.then((data) => new Policy.fromJson(data));
1095 } 1082 }
1096 1083
1097 /** 1084 /// Returns permissions that a caller has on the specified resource.
1098 * Returns permissions that a caller has on the specified resource. 1085 /// If the resource does not exist, this will return an empty set of
1099 * If the resource does not exist, this will return an empty set of 1086 /// permissions, not a NOT_FOUND error.
1100 * permissions, not a NOT_FOUND error. 1087 ///
1101 * 1088 /// Note: This operation is designed to be used for building permission-aware
1102 * Note: This operation is designed to be used for building permission-aware 1089 /// UIs and command-line tools, not for authorization checking. This
1103 * UIs and command-line tools, not for authorization checking. This operation 1090 /// operation
1104 * may "fail open" without warning. 1091 /// may "fail open" without warning.
1105 * 1092 ///
1106 * [request] - The metadata request object. 1093 /// [request] - The metadata request object.
1107 * 1094 ///
1108 * Request parameters: 1095 /// Request parameters:
1109 * 1096 ///
1110 * [resource] - REQUIRED: The resource for which the policy detail is being 1097 /// [resource] - REQUIRED: The resource for which the policy detail is being
1111 * requested. 1098 /// requested.
1112 * See the operation documentation for the appropriate value for this field. 1099 /// See the operation documentation for the appropriate value for this field.
1113 * Value must have pattern "^projects/[^/]+/topics/[^/]+$". 1100 /// Value must have pattern "^projects/[^/]+/topics/[^/]+$".
1114 * 1101 ///
1115 * Completes with a [TestIamPermissionsResponse]. 1102 /// Completes with a [TestIamPermissionsResponse].
1116 * 1103 ///
1117 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 1104 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
1118 * error. 1105 /// an error.
1119 * 1106 ///
1120 * If the used [http.Client] completes with an error when making a REST call, 1107 /// If the used [http.Client] completes with an error when making a REST
1121 * this method will complete with the same error. 1108 /// call, this method will complete with the same error.
1122 */ 1109 async.Future<TestIamPermissionsResponse> testIamPermissions(
1123 async.Future<TestIamPermissionsResponse> testIamPermissions(TestIamPermissions Request request, core.String resource) { 1110 TestIamPermissionsRequest request, core.String resource) {
1124 var _url = null; 1111 var _url = null;
1125 var _queryParams = new core.Map(); 1112 var _queryParams = new core.Map();
1126 var _uploadMedia = null; 1113 var _uploadMedia = null;
1127 var _uploadOptions = null; 1114 var _uploadOptions = null;
1128 var _downloadOptions = commons.DownloadOptions.Metadata; 1115 var _downloadOptions = commons.DownloadOptions.Metadata;
1129 var _body = null; 1116 var _body = null;
1130 1117
1131 if (request != null) { 1118 if (request != null) {
1132 _body = convert.JSON.encode((request).toJson()); 1119 _body = convert.JSON.encode((request).toJson());
1133 } 1120 }
1134 if (resource == null) { 1121 if (resource == null) {
1135 throw new core.ArgumentError("Parameter resource is required."); 1122 throw new core.ArgumentError("Parameter resource is required.");
1136 } 1123 }
1137 1124
1138 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':testIa mPermissions'; 1125 _url = 'v1/' +
1126 commons.Escaper.ecapeVariableReserved('$resource') +
1127 ':testIamPermissions';
1139 1128
1140 var _response = _requester.request(_url, 1129 var _response = _requester.request(_url, "POST",
1141 "POST", 1130 body: _body,
1142 body: _body, 1131 queryParams: _queryParams,
1143 queryParams: _queryParams, 1132 uploadOptions: _uploadOptions,
1144 uploadOptions: _uploadOptions, 1133 uploadMedia: _uploadMedia,
1145 uploadMedia: _uploadMedia, 1134 downloadOptions: _downloadOptions);
1146 downloadOptions: _downloadOptions); 1135 return _response
1147 return _response.then((data) => new TestIamPermissionsResponse.fromJson(data )); 1136 .then((data) => new TestIamPermissionsResponse.fromJson(data));
1148 } 1137 }
1149
1150 } 1138 }
1151 1139
1152
1153 class ProjectsTopicsSubscriptionsResourceApi { 1140 class ProjectsTopicsSubscriptionsResourceApi {
1154 final commons.ApiRequester _requester; 1141 final commons.ApiRequester _requester;
1155 1142
1156 ProjectsTopicsSubscriptionsResourceApi(commons.ApiRequester client) : 1143 ProjectsTopicsSubscriptionsResourceApi(commons.ApiRequester client)
1157 _requester = client; 1144 : _requester = client;
1158 1145
1159 /** 1146 /// Lists the name of the subscriptions for this topic.
1160 * Lists the name of the subscriptions for this topic. 1147 ///
1161 * 1148 /// Request parameters:
1162 * Request parameters: 1149 ///
1163 * 1150 /// [topic] - The name of the topic that subscriptions are attached to.
1164 * [topic] - The name of the topic that subscriptions are attached to. 1151 /// Format is `projects/{project}/topics/{topic}`.
1165 * Format is `projects/{project}/topics/{topic}`. 1152 /// Value must have pattern "^projects/[^/]+/topics/[^/]+$".
1166 * Value must have pattern "^projects/[^/]+/topics/[^/]+$". 1153 ///
1167 * 1154 /// [pageToken] - The value returned by the last
1168 * [pageSize] - Maximum number of subscription names to return. 1155 /// `ListTopicSubscriptionsResponse`; indicates
1169 * 1156 /// that this is a continuation of a prior `ListTopicSubscriptions` call, and
1170 * [pageToken] - The value returned by the last 1157 /// that the system should return the next page of data.
1171 * `ListTopicSubscriptionsResponse`; indicates 1158 ///
1172 * that this is a continuation of a prior `ListTopicSubscriptions` call, and 1159 /// [pageSize] - Maximum number of subscription names to return.
1173 * that the system should return the next page of data. 1160 ///
1174 * 1161 /// Completes with a [ListTopicSubscriptionsResponse].
1175 * Completes with a [ListTopicSubscriptionsResponse]. 1162 ///
1176 * 1163 /// Completes with a [commons.ApiRequestError] if the API endpoint returned
1177 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 1164 /// an error.
1178 * error. 1165 ///
1179 * 1166 /// If the used [http.Client] completes with an error when making a REST
1180 * If the used [http.Client] completes with an error when making a REST call, 1167 /// call, this method will complete with the same error.
1181 * this method will complete with the same error. 1168 async.Future<ListTopicSubscriptionsResponse> list(core.String topic,
1182 */ 1169 {core.String pageToken, core.int pageSize}) {
1183 async.Future<ListTopicSubscriptionsResponse> list(core.String topic, {core.int pageSize, core.String pageToken}) {
1184 var _url = null; 1170 var _url = null;
1185 var _queryParams = new core.Map(); 1171 var _queryParams = new core.Map();
1186 var _uploadMedia = null; 1172 var _uploadMedia = null;
1187 var _uploadOptions = null; 1173 var _uploadOptions = null;
1188 var _downloadOptions = commons.DownloadOptions.Metadata; 1174 var _downloadOptions = commons.DownloadOptions.Metadata;
1189 var _body = null; 1175 var _body = null;
1190 1176
1191 if (topic == null) { 1177 if (topic == null) {
1192 throw new core.ArgumentError("Parameter topic is required."); 1178 throw new core.ArgumentError("Parameter topic is required.");
1193 } 1179 }
1180 if (pageToken != null) {
1181 _queryParams["pageToken"] = [pageToken];
1182 }
1194 if (pageSize != null) { 1183 if (pageSize != null) {
1195 _queryParams["pageSize"] = ["${pageSize}"]; 1184 _queryParams["pageSize"] = ["${pageSize}"];
1196 } 1185 }
1197 if (pageToken != null) {
1198 _queryParams["pageToken"] = [pageToken];
1199 }
1200 1186
1201 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$topic') + '/subscript ions'; 1187 _url = 'v1/' +
1188 commons.Escaper.ecapeVariableReserved('$topic') +
1189 '/subscriptions';
1202 1190
1203 var _response = _requester.request(_url, 1191 var _response = _requester.request(_url, "GET",
1204 "GET", 1192 body: _body,
1205 body: _body, 1193 queryParams: _queryParams,
1206 queryParams: _queryParams, 1194 uploadOptions: _uploadOptions,
1207 uploadOptions: _uploadOptions, 1195 uploadMedia: _uploadMedia,
1208 uploadMedia: _uploadMedia, 1196 downloadOptions: _downloadOptions);
1209 downloadOptions: _downloadOptions); 1197 return _response
1210 return _response.then((data) => new ListTopicSubscriptionsResponse.fromJson( data)); 1198 .then((data) => new ListTopicSubscriptionsResponse.fromJson(data));
1211 } 1199 }
1212
1213 } 1200 }
1214 1201
1215 1202 /// Request for the Acknowledge method.
1216
1217 /** Request for the Acknowledge method. */
1218 class AcknowledgeRequest { 1203 class AcknowledgeRequest {
1219 /** 1204 /// The acknowledgment ID for the messages being acknowledged that was
1220 * The acknowledgment ID for the messages being acknowledged that was returned 1205 /// returned
1221 * by the Pub/Sub system in the `Pull` response. Must not be empty. 1206 /// by the Pub/Sub system in the `Pull` response. Must not be empty.
1222 */
1223 core.List<core.String> ackIds; 1207 core.List<core.String> ackIds;
1224 1208
1225 AcknowledgeRequest(); 1209 AcknowledgeRequest();
1226 1210
1227 AcknowledgeRequest.fromJson(core.Map _json) { 1211 AcknowledgeRequest.fromJson(core.Map _json) {
1228 if (_json.containsKey("ackIds")) { 1212 if (_json.containsKey("ackIds")) {
1229 ackIds = _json["ackIds"]; 1213 ackIds = _json["ackIds"];
1230 } 1214 }
1231 } 1215 }
1232 1216
1233 core.Map<core.String, core.Object> toJson() { 1217 core.Map<core.String, core.Object> toJson() {
1234 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1218 final core.Map<core.String, core.Object> _json =
1219 new core.Map<core.String, core.Object>();
1235 if (ackIds != null) { 1220 if (ackIds != null) {
1236 _json["ackIds"] = ackIds; 1221 _json["ackIds"] = ackIds;
1237 } 1222 }
1238 return _json; 1223 return _json;
1239 } 1224 }
1240 } 1225 }
1241 1226
1242 /** Associates `members` with a `role`. */ 1227 /// Associates `members` with a `role`.
1243 class Binding { 1228 class Binding {
1244 /** 1229 /// Specifies the identities requesting access for a Cloud Platform resource.
1245 * Specifies the identities requesting access for a Cloud Platform resource. 1230 /// `members` can have the following values:
1246 * `members` can have the following values: 1231 ///
1247 * 1232 /// * `allUsers`: A special identifier that represents anyone who is
1248 * * `allUsers`: A special identifier that represents anyone who is 1233 /// on the internet; with or without a Google account.
1249 * on the internet; with or without a Google account. 1234 ///
1250 * 1235 /// * `allAuthenticatedUsers`: A special identifier that represents anyone
1251 * * `allAuthenticatedUsers`: A special identifier that represents anyone 1236 /// who is authenticated with a Google account or a service account.
1252 * who is authenticated with a Google account or a service account. 1237 ///
1253 * 1238 /// * `user:{emailid}`: An email address that represents a specific Google
1254 * * `user:{emailid}`: An email address that represents a specific Google 1239 /// account. For example, `alice@gmail.com` or `joe@example.com`.
1255 * account. For example, `alice@gmail.com` or `joe@example.com`. 1240 ///
1256 * 1241 ///
1257 * 1242 /// * `serviceAccount:{emailid}`: An email address that represents a service
1258 * * `serviceAccount:{emailid}`: An email address that represents a service 1243 /// account. For example, `my-other-app@appspot.gserviceaccount.com`.
1259 * account. For example, `my-other-app@appspot.gserviceaccount.com`. 1244 ///
1260 * 1245 /// * `group:{emailid}`: An email address that represents a Google group.
1261 * * `group:{emailid}`: An email address that represents a Google group. 1246 /// For example, `admins@example.com`.
1262 * For example, `admins@example.com`. 1247 ///
1263 * 1248 ///
1264 * 1249 /// * `domain:{domain}`: A Google Apps domain name that represents all the
1265 * * `domain:{domain}`: A Google Apps domain name that represents all the 1250 /// users of that domain. For example, `google.com` or `example.com`.
1266 * users of that domain. For example, `google.com` or `example.com`.
1267 */
1268 core.List<core.String> members; 1251 core.List<core.String> members;
1269 /** 1252
1270 * Role that is assigned to `members`. 1253 /// Role that is assigned to `members`.
1271 * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 1254 /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1272 * Required 1255 /// Required
1273 */
1274 core.String role; 1256 core.String role;
1275 1257
1276 Binding(); 1258 Binding();
1277 1259
1278 Binding.fromJson(core.Map _json) { 1260 Binding.fromJson(core.Map _json) {
1279 if (_json.containsKey("members")) { 1261 if (_json.containsKey("members")) {
1280 members = _json["members"]; 1262 members = _json["members"];
1281 } 1263 }
1282 if (_json.containsKey("role")) { 1264 if (_json.containsKey("role")) {
1283 role = _json["role"]; 1265 role = _json["role"];
1284 } 1266 }
1285 } 1267 }
1286 1268
1287 core.Map<core.String, core.Object> toJson() { 1269 core.Map<core.String, core.Object> toJson() {
1288 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1270 final core.Map<core.String, core.Object> _json =
1271 new core.Map<core.String, core.Object>();
1289 if (members != null) { 1272 if (members != null) {
1290 _json["members"] = members; 1273 _json["members"] = members;
1291 } 1274 }
1292 if (role != null) { 1275 if (role != null) {
1293 _json["role"] = role; 1276 _json["role"] = role;
1294 } 1277 }
1295 return _json; 1278 return _json;
1296 } 1279 }
1297 } 1280 }
1298 1281
1299 /** 1282 /// A generic empty message that you can re-use to avoid defining duplicated
1300 * A generic empty message that you can re-use to avoid defining duplicated 1283 /// empty messages in your APIs. A typical example is to use it as the request
1301 * empty messages in your APIs. A typical example is to use it as the request 1284 /// or the response type of an API method. For instance:
1302 * or the response type of an API method. For instance: 1285 ///
1303 * 1286 /// service Foo {
1304 * service Foo { 1287 /// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
1305 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 1288 /// }
1306 * } 1289 ///
1307 * 1290 /// The JSON representation for `Empty` is empty JSON object `{}`.
1308 * The JSON representation for `Empty` is empty JSON object `{}`.
1309 */
1310 class Empty { 1291 class Empty {
1311
1312 Empty(); 1292 Empty();
1313 1293
1314 Empty.fromJson(core.Map _json) { 1294 Empty.fromJson(core.Map _json) {}
1315 }
1316 1295
1317 core.Map<core.String, core.Object> toJson() { 1296 core.Map<core.String, core.Object> toJson() {
1318 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1297 final core.Map<core.String, core.Object> _json =
1298 new core.Map<core.String, core.Object>();
1319 return _json; 1299 return _json;
1320 } 1300 }
1321 } 1301 }
1322 1302
1323 /** Response for the `ListSubscriptions` method. */ 1303 /// Response for the `ListSubscriptions` method.
1324 class ListSubscriptionsResponse { 1304 class ListSubscriptionsResponse {
1325 /** 1305 /// If not empty, indicates that there may be more subscriptions that match
1326 * If not empty, indicates that there may be more subscriptions that match 1306 /// the request; this value should be passed in a new
1327 * the request; this value should be passed in a new 1307 /// `ListSubscriptionsRequest` to get more subscriptions.
1328 * `ListSubscriptionsRequest` to get more subscriptions.
1329 */
1330 core.String nextPageToken; 1308 core.String nextPageToken;
1331 /** The subscriptions that match the request. */ 1309
1310 /// The subscriptions that match the request.
1332 core.List<Subscription> subscriptions; 1311 core.List<Subscription> subscriptions;
1333 1312
1334 ListSubscriptionsResponse(); 1313 ListSubscriptionsResponse();
1335 1314
1336 ListSubscriptionsResponse.fromJson(core.Map _json) { 1315 ListSubscriptionsResponse.fromJson(core.Map _json) {
1337 if (_json.containsKey("nextPageToken")) { 1316 if (_json.containsKey("nextPageToken")) {
1338 nextPageToken = _json["nextPageToken"]; 1317 nextPageToken = _json["nextPageToken"];
1339 } 1318 }
1340 if (_json.containsKey("subscriptions")) { 1319 if (_json.containsKey("subscriptions")) {
1341 subscriptions = _json["subscriptions"].map((value) => new Subscription.fro mJson(value)).toList(); 1320 subscriptions = _json["subscriptions"]
1321 .map((value) => new Subscription.fromJson(value))
1322 .toList();
1342 } 1323 }
1343 } 1324 }
1344 1325
1345 core.Map<core.String, core.Object> toJson() { 1326 core.Map<core.String, core.Object> toJson() {
1346 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1327 final core.Map<core.String, core.Object> _json =
1328 new core.Map<core.String, core.Object>();
1347 if (nextPageToken != null) { 1329 if (nextPageToken != null) {
1348 _json["nextPageToken"] = nextPageToken; 1330 _json["nextPageToken"] = nextPageToken;
1349 } 1331 }
1350 if (subscriptions != null) { 1332 if (subscriptions != null) {
1351 _json["subscriptions"] = subscriptions.map((value) => (value).toJson()).to List(); 1333 _json["subscriptions"] =
1334 subscriptions.map((value) => (value).toJson()).toList();
1352 } 1335 }
1353 return _json; 1336 return _json;
1354 } 1337 }
1355 } 1338 }
1356 1339
1357 /** Response for the `ListTopicSubscriptions` method. */ 1340 /// Response for the `ListTopicSubscriptions` method.
1358 class ListTopicSubscriptionsResponse { 1341 class ListTopicSubscriptionsResponse {
1359 /** 1342 /// If not empty, indicates that there may be more subscriptions that match
1360 * If not empty, indicates that there may be more subscriptions that match 1343 /// the request; this value should be passed in a new
1361 * the request; this value should be passed in a new 1344 /// `ListTopicSubscriptionsRequest` to get more subscriptions.
1362 * `ListTopicSubscriptionsRequest` to get more subscriptions.
1363 */
1364 core.String nextPageToken; 1345 core.String nextPageToken;
1365 /** The names of the subscriptions that match the request. */ 1346
1347 /// The names of the subscriptions that match the request.
1366 core.List<core.String> subscriptions; 1348 core.List<core.String> subscriptions;
1367 1349
1368 ListTopicSubscriptionsResponse(); 1350 ListTopicSubscriptionsResponse();
1369 1351
1370 ListTopicSubscriptionsResponse.fromJson(core.Map _json) { 1352 ListTopicSubscriptionsResponse.fromJson(core.Map _json) {
1371 if (_json.containsKey("nextPageToken")) { 1353 if (_json.containsKey("nextPageToken")) {
1372 nextPageToken = _json["nextPageToken"]; 1354 nextPageToken = _json["nextPageToken"];
1373 } 1355 }
1374 if (_json.containsKey("subscriptions")) { 1356 if (_json.containsKey("subscriptions")) {
1375 subscriptions = _json["subscriptions"]; 1357 subscriptions = _json["subscriptions"];
1376 } 1358 }
1377 } 1359 }
1378 1360
1379 core.Map<core.String, core.Object> toJson() { 1361 core.Map<core.String, core.Object> toJson() {
1380 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1362 final core.Map<core.String, core.Object> _json =
1363 new core.Map<core.String, core.Object>();
1381 if (nextPageToken != null) { 1364 if (nextPageToken != null) {
1382 _json["nextPageToken"] = nextPageToken; 1365 _json["nextPageToken"] = nextPageToken;
1383 } 1366 }
1384 if (subscriptions != null) { 1367 if (subscriptions != null) {
1385 _json["subscriptions"] = subscriptions; 1368 _json["subscriptions"] = subscriptions;
1386 } 1369 }
1387 return _json; 1370 return _json;
1388 } 1371 }
1389 } 1372 }
1390 1373
1391 /** Response for the `ListTopics` method. */ 1374 /// Response for the `ListTopics` method.
1392 class ListTopicsResponse { 1375 class ListTopicsResponse {
1393 /** 1376 /// If not empty, indicates that there may be more topics that match the
1394 * If not empty, indicates that there may be more topics that match the 1377 /// request; this value should be passed in a new `ListTopicsRequest`.
1395 * request; this value should be passed in a new `ListTopicsRequest`.
1396 */
1397 core.String nextPageToken; 1378 core.String nextPageToken;
1398 /** The resulting topics. */ 1379
1380 /// The resulting topics.
1399 core.List<Topic> topics; 1381 core.List<Topic> topics;
1400 1382
1401 ListTopicsResponse(); 1383 ListTopicsResponse();
1402 1384
1403 ListTopicsResponse.fromJson(core.Map _json) { 1385 ListTopicsResponse.fromJson(core.Map _json) {
1404 if (_json.containsKey("nextPageToken")) { 1386 if (_json.containsKey("nextPageToken")) {
1405 nextPageToken = _json["nextPageToken"]; 1387 nextPageToken = _json["nextPageToken"];
1406 } 1388 }
1407 if (_json.containsKey("topics")) { 1389 if (_json.containsKey("topics")) {
1408 topics = _json["topics"].map((value) => new Topic.fromJson(value)).toList( ); 1390 topics =
1391 _json["topics"].map((value) => new Topic.fromJson(value)).toList();
1409 } 1392 }
1410 } 1393 }
1411 1394
1412 core.Map<core.String, core.Object> toJson() { 1395 core.Map<core.String, core.Object> toJson() {
1413 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1396 final core.Map<core.String, core.Object> _json =
1397 new core.Map<core.String, core.Object>();
1414 if (nextPageToken != null) { 1398 if (nextPageToken != null) {
1415 _json["nextPageToken"] = nextPageToken; 1399 _json["nextPageToken"] = nextPageToken;
1416 } 1400 }
1417 if (topics != null) { 1401 if (topics != null) {
1418 _json["topics"] = topics.map((value) => (value).toJson()).toList(); 1402 _json["topics"] = topics.map((value) => (value).toJson()).toList();
1419 } 1403 }
1420 return _json; 1404 return _json;
1421 } 1405 }
1422 } 1406 }
1423 1407
1424 /** Request for the ModifyAckDeadline method. */ 1408 /// Request for the ModifyAckDeadline method.
1425 class ModifyAckDeadlineRequest { 1409 class ModifyAckDeadlineRequest {
1426 /** 1410 /// The new ack deadline with respect to the time this request was sent to
1427 * The new ack deadline with respect to the time this request was sent to 1411 /// the Pub/Sub system. For example, if the value is 10, the new
1428 * the Pub/Sub system. For example, if the value is 10, the new 1412 /// ack deadline will expire 10 seconds after the `ModifyAckDeadline` call
1429 * ack deadline will expire 10 seconds after the `ModifyAckDeadline` call 1413 /// was made. Specifying zero may immediately make the message available for
1430 * was made. Specifying zero may immediately make the message available for 1414 /// another pull request.
1431 * another pull request. 1415 /// The minimum deadline you can specify is 0 seconds.
1432 * The minimum deadline you can specify is 0 seconds. 1416 /// The maximum deadline you can specify is 600 seconds (10 minutes).
1433 * The maximum deadline you can specify is 600 seconds (10 minutes).
1434 */
1435 core.int ackDeadlineSeconds; 1417 core.int ackDeadlineSeconds;
1436 /** List of acknowledgment IDs. */ 1418
1419 /// List of acknowledgment IDs.
1437 core.List<core.String> ackIds; 1420 core.List<core.String> ackIds;
1438 1421
1439 ModifyAckDeadlineRequest(); 1422 ModifyAckDeadlineRequest();
1440 1423
1441 ModifyAckDeadlineRequest.fromJson(core.Map _json) { 1424 ModifyAckDeadlineRequest.fromJson(core.Map _json) {
1442 if (_json.containsKey("ackDeadlineSeconds")) { 1425 if (_json.containsKey("ackDeadlineSeconds")) {
1443 ackDeadlineSeconds = _json["ackDeadlineSeconds"]; 1426 ackDeadlineSeconds = _json["ackDeadlineSeconds"];
1444 } 1427 }
1445 if (_json.containsKey("ackIds")) { 1428 if (_json.containsKey("ackIds")) {
1446 ackIds = _json["ackIds"]; 1429 ackIds = _json["ackIds"];
1447 } 1430 }
1448 } 1431 }
1449 1432
1450 core.Map<core.String, core.Object> toJson() { 1433 core.Map<core.String, core.Object> toJson() {
1451 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1434 final core.Map<core.String, core.Object> _json =
1435 new core.Map<core.String, core.Object>();
1452 if (ackDeadlineSeconds != null) { 1436 if (ackDeadlineSeconds != null) {
1453 _json["ackDeadlineSeconds"] = ackDeadlineSeconds; 1437 _json["ackDeadlineSeconds"] = ackDeadlineSeconds;
1454 } 1438 }
1455 if (ackIds != null) { 1439 if (ackIds != null) {
1456 _json["ackIds"] = ackIds; 1440 _json["ackIds"] = ackIds;
1457 } 1441 }
1458 return _json; 1442 return _json;
1459 } 1443 }
1460 } 1444 }
1461 1445
1462 /** Request for the ModifyPushConfig method. */ 1446 /// Request for the ModifyPushConfig method.
1463 class ModifyPushConfigRequest { 1447 class ModifyPushConfigRequest {
1464 /** 1448 /// The push configuration for future deliveries.
1465 * The push configuration for future deliveries. 1449 ///
1466 * 1450 /// An empty `pushConfig` indicates that the Pub/Sub system should
1467 * An empty `pushConfig` indicates that the Pub/Sub system should 1451 /// stop pushing messages from the given subscription and allow
1468 * stop pushing messages from the given subscription and allow 1452 /// messages to be pulled and acknowledged - effectively pausing
1469 * messages to be pulled and acknowledged - effectively pausing 1453 /// the subscription if `Pull` is not called.
1470 * the subscription if `Pull` is not called.
1471 */
1472 PushConfig pushConfig; 1454 PushConfig pushConfig;
1473 1455
1474 ModifyPushConfigRequest(); 1456 ModifyPushConfigRequest();
1475 1457
1476 ModifyPushConfigRequest.fromJson(core.Map _json) { 1458 ModifyPushConfigRequest.fromJson(core.Map _json) {
1477 if (_json.containsKey("pushConfig")) { 1459 if (_json.containsKey("pushConfig")) {
1478 pushConfig = new PushConfig.fromJson(_json["pushConfig"]); 1460 pushConfig = new PushConfig.fromJson(_json["pushConfig"]);
1479 } 1461 }
1480 } 1462 }
1481 1463
1482 core.Map<core.String, core.Object> toJson() { 1464 core.Map<core.String, core.Object> toJson() {
1483 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1465 final core.Map<core.String, core.Object> _json =
1466 new core.Map<core.String, core.Object>();
1484 if (pushConfig != null) { 1467 if (pushConfig != null) {
1485 _json["pushConfig"] = (pushConfig).toJson(); 1468 _json["pushConfig"] = (pushConfig).toJson();
1486 } 1469 }
1487 return _json; 1470 return _json;
1488 } 1471 }
1489 } 1472 }
1490 1473
1491 /** 1474 /// Defines an Identity and Access Management (IAM) policy. It is used to
1492 * Defines an Identity and Access Management (IAM) policy. It is used to 1475 /// specify access control policies for Cloud Platform resources.
1493 * specify access control policies for Cloud Platform resources. 1476 ///
1494 * 1477 ///
1495 * 1478 /// A `Policy` consists of a list of `bindings`. A `Binding` binds a list of
1496 * A `Policy` consists of a list of `bindings`. A `Binding` binds a list of 1479 /// `members` to a `role`, where the members can be user accounts, Google
1497 * `members` to a `role`, where the members can be user accounts, Google groups, 1480 /// groups,
1498 * Google domains, and service accounts. A `role` is a named list of permissions 1481 /// Google domains, and service accounts. A `role` is a named list of
1499 * defined by IAM. 1482 /// permissions
1500 * 1483 /// defined by IAM.
1501 * **Example** 1484 ///
1502 * 1485 /// **Example**
1503 * { 1486 ///
1504 * "bindings": [ 1487 /// {
1505 * { 1488 /// "bindings": [
1506 * "role": "roles/owner", 1489 /// {
1507 * "members": [ 1490 /// "role": "roles/owner",
1508 * "user:mike@example.com", 1491 /// "members": [
1509 * "group:admins@example.com", 1492 /// "user:mike@example.com",
1510 * "domain:google.com", 1493 /// "group:admins@example.com",
1511 * "serviceAccount:my-other-app@appspot.gserviceaccount.com", 1494 /// "domain:google.com",
1512 * ] 1495 /// "serviceAccount:my-other-app@appspot.gserviceaccount.com",
1513 * }, 1496 /// ]
1514 * { 1497 /// },
1515 * "role": "roles/viewer", 1498 /// {
1516 * "members": ["user:sean@example.com"] 1499 /// "role": "roles/viewer",
1517 * } 1500 /// "members": ["user:sean@example.com"]
1518 * ] 1501 /// }
1519 * } 1502 /// ]
1520 * 1503 /// }
1521 * For a description of IAM and its features, see the 1504 ///
1522 * [IAM developer's guide](https://cloud.google.com/iam). 1505 /// For a description of IAM and its features, see the
1523 */ 1506 /// [IAM developer's guide](https://cloud.google.com/iam).
1524 class Policy { 1507 class Policy {
1525 /** 1508 /// Associates a list of `members` to a `role`.
1526 * Associates a list of `members` to a `role`. 1509 /// `bindings` with no members will result in an error.
1527 * `bindings` with no members will result in an error.
1528 */
1529 core.List<Binding> bindings; 1510 core.List<Binding> bindings;
1530 /** 1511
1531 * `etag` is used for optimistic concurrency control as a way to help 1512 /// `etag` is used for optimistic concurrency control as a way to help
1532 * prevent simultaneous updates of a policy from overwriting each other. 1513 /// prevent simultaneous updates of a policy from overwriting each other.
1533 * It is strongly suggested that systems make use of the `etag` in the 1514 /// It is strongly suggested that systems make use of the `etag` in the
1534 * read-modify-write cycle to perform policy updates in order to avoid race 1515 /// read-modify-write cycle to perform policy updates in order to avoid race
1535 * conditions: An `etag` is returned in the response to `getIamPolicy`, and 1516 /// conditions: An `etag` is returned in the response to `getIamPolicy`, and
1536 * systems are expected to put that etag in the request to `setIamPolicy` to 1517 /// systems are expected to put that etag in the request to `setIamPolicy` to
1537 * ensure that their change will be applied to the same version of the policy. 1518 /// ensure that their change will be applied to the same version of the
1538 * 1519 /// policy.
1539 * If no `etag` is provided in the call to `setIamPolicy`, then the existing 1520 ///
1540 * policy is overwritten blindly. 1521 /// If no `etag` is provided in the call to `setIamPolicy`, then the existing
1541 */ 1522 /// policy is overwritten blindly.
1542 core.String etag; 1523 core.String etag;
1543 core.List<core.int> get etagAsBytes { 1524 core.List<core.int> get etagAsBytes {
1544 return convert.BASE64.decode(etag); 1525 return convert.BASE64.decode(etag);
1545 } 1526 }
1546 1527
1547 void set etagAsBytes(core.List<core.int> _bytes) { 1528 void set etagAsBytes(core.List<core.int> _bytes) {
1548 etag = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "- "); 1529 etag =
1530 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-");
1549 } 1531 }
1550 /** Version of the `Policy`. The default version is 0. */ 1532
1533 /// Version of the `Policy`. The default version is 0.
1551 core.int version; 1534 core.int version;
1552 1535
1553 Policy(); 1536 Policy();
1554 1537
1555 Policy.fromJson(core.Map _json) { 1538 Policy.fromJson(core.Map _json) {
1556 if (_json.containsKey("bindings")) { 1539 if (_json.containsKey("bindings")) {
1557 bindings = _json["bindings"].map((value) => new Binding.fromJson(value)).t oList(); 1540 bindings = _json["bindings"]
1541 .map((value) => new Binding.fromJson(value))
1542 .toList();
1558 } 1543 }
1559 if (_json.containsKey("etag")) { 1544 if (_json.containsKey("etag")) {
1560 etag = _json["etag"]; 1545 etag = _json["etag"];
1561 } 1546 }
1562 if (_json.containsKey("version")) { 1547 if (_json.containsKey("version")) {
1563 version = _json["version"]; 1548 version = _json["version"];
1564 } 1549 }
1565 } 1550 }
1566 1551
1567 core.Map<core.String, core.Object> toJson() { 1552 core.Map<core.String, core.Object> toJson() {
1568 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1553 final core.Map<core.String, core.Object> _json =
1554 new core.Map<core.String, core.Object>();
1569 if (bindings != null) { 1555 if (bindings != null) {
1570 _json["bindings"] = bindings.map((value) => (value).toJson()).toList(); 1556 _json["bindings"] = bindings.map((value) => (value).toJson()).toList();
1571 } 1557 }
1572 if (etag != null) { 1558 if (etag != null) {
1573 _json["etag"] = etag; 1559 _json["etag"] = etag;
1574 } 1560 }
1575 if (version != null) { 1561 if (version != null) {
1576 _json["version"] = version; 1562 _json["version"] = version;
1577 } 1563 }
1578 return _json; 1564 return _json;
1579 } 1565 }
1580 } 1566 }
1581 1567
1582 /** Request for the Publish method. */ 1568 /// Request for the Publish method.
1583 class PublishRequest { 1569 class PublishRequest {
1584 /** The messages to publish. */ 1570 /// The messages to publish.
1585 core.List<PubsubMessage> messages; 1571 core.List<PubsubMessage> messages;
1586 1572
1587 PublishRequest(); 1573 PublishRequest();
1588 1574
1589 PublishRequest.fromJson(core.Map _json) { 1575 PublishRequest.fromJson(core.Map _json) {
1590 if (_json.containsKey("messages")) { 1576 if (_json.containsKey("messages")) {
1591 messages = _json["messages"].map((value) => new PubsubMessage.fromJson(val ue)).toList(); 1577 messages = _json["messages"]
1578 .map((value) => new PubsubMessage.fromJson(value))
1579 .toList();
1592 } 1580 }
1593 } 1581 }
1594 1582
1595 core.Map<core.String, core.Object> toJson() { 1583 core.Map<core.String, core.Object> toJson() {
1596 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1584 final core.Map<core.String, core.Object> _json =
1585 new core.Map<core.String, core.Object>();
1597 if (messages != null) { 1586 if (messages != null) {
1598 _json["messages"] = messages.map((value) => (value).toJson()).toList(); 1587 _json["messages"] = messages.map((value) => (value).toJson()).toList();
1599 } 1588 }
1600 return _json; 1589 return _json;
1601 } 1590 }
1602 } 1591 }
1603 1592
1604 /** Response for the `Publish` method. */ 1593 /// Response for the `Publish` method.
1605 class PublishResponse { 1594 class PublishResponse {
1606 /** 1595 /// The server-assigned ID of each published message, in the same order as
1607 * The server-assigned ID of each published message, in the same order as 1596 /// the messages in the request. IDs are guaranteed to be unique within
1608 * the messages in the request. IDs are guaranteed to be unique within 1597 /// the topic.
1609 * the topic.
1610 */
1611 core.List<core.String> messageIds; 1598 core.List<core.String> messageIds;
1612 1599
1613 PublishResponse(); 1600 PublishResponse();
1614 1601
1615 PublishResponse.fromJson(core.Map _json) { 1602 PublishResponse.fromJson(core.Map _json) {
1616 if (_json.containsKey("messageIds")) { 1603 if (_json.containsKey("messageIds")) {
1617 messageIds = _json["messageIds"]; 1604 messageIds = _json["messageIds"];
1618 } 1605 }
1619 } 1606 }
1620 1607
1621 core.Map<core.String, core.Object> toJson() { 1608 core.Map<core.String, core.Object> toJson() {
1622 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1609 final core.Map<core.String, core.Object> _json =
1610 new core.Map<core.String, core.Object>();
1623 if (messageIds != null) { 1611 if (messageIds != null) {
1624 _json["messageIds"] = messageIds; 1612 _json["messageIds"] = messageIds;
1625 } 1613 }
1626 return _json; 1614 return _json;
1627 } 1615 }
1628 } 1616 }
1629 1617
1630 /** 1618 /// A message data and its attributes. The message payload must not be empty;
1631 * A message data and its attributes. The message payload must not be empty; 1619 /// it must contain either a non-empty data field, or at least one attribute.
1632 * it must contain either a non-empty data field, or at least one attribute.
1633 */
1634 class PubsubMessage { 1620 class PubsubMessage {
1635 /** Optional attributes for this message. */ 1621 /// Optional attributes for this message.
1636 core.Map<core.String, core.String> attributes; 1622 core.Map<core.String, core.String> attributes;
1637 /** The message payload. */ 1623
1624 /// The message payload.
1638 core.String data; 1625 core.String data;
1639 core.List<core.int> get dataAsBytes { 1626 core.List<core.int> get dataAsBytes {
1640 return convert.BASE64.decode(data); 1627 return convert.BASE64.decode(data);
1641 } 1628 }
1642 1629
1643 void set dataAsBytes(core.List<core.int> _bytes) { 1630 void set dataAsBytes(core.List<core.int> _bytes) {
1644 data = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "- "); 1631 data =
1632 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-");
1645 } 1633 }
1646 /** 1634
1647 * ID of this message, assigned by the server when the message is published. 1635 /// ID of this message, assigned by the server when the message is published.
1648 * Guaranteed to be unique within the topic. This value may be read by a 1636 /// Guaranteed to be unique within the topic. This value may be read by a
1649 * subscriber that receives a `PubsubMessage` via a `Pull` call or a push 1637 /// subscriber that receives a `PubsubMessage` via a `Pull` call or a push
1650 * delivery. It must not be populated by the publisher in a `Publish` call. 1638 /// delivery. It must not be populated by the publisher in a `Publish` call.
1651 */
1652 core.String messageId; 1639 core.String messageId;
1653 /** 1640
1654 * The time at which the message was published, populated by the server when 1641 /// The time at which the message was published, populated by the server when
1655 * it receives the `Publish` call. It must not be populated by the 1642 /// it receives the `Publish` call. It must not be populated by the
1656 * publisher in a `Publish` call. 1643 /// publisher in a `Publish` call.
1657 */
1658 core.String publishTime; 1644 core.String publishTime;
1659 1645
1660 PubsubMessage(); 1646 PubsubMessage();
1661 1647
1662 PubsubMessage.fromJson(core.Map _json) { 1648 PubsubMessage.fromJson(core.Map _json) {
1663 if (_json.containsKey("attributes")) { 1649 if (_json.containsKey("attributes")) {
1664 attributes = _json["attributes"]; 1650 attributes = _json["attributes"];
1665 } 1651 }
1666 if (_json.containsKey("data")) { 1652 if (_json.containsKey("data")) {
1667 data = _json["data"]; 1653 data = _json["data"];
1668 } 1654 }
1669 if (_json.containsKey("messageId")) { 1655 if (_json.containsKey("messageId")) {
1670 messageId = _json["messageId"]; 1656 messageId = _json["messageId"];
1671 } 1657 }
1672 if (_json.containsKey("publishTime")) { 1658 if (_json.containsKey("publishTime")) {
1673 publishTime = _json["publishTime"]; 1659 publishTime = _json["publishTime"];
1674 } 1660 }
1675 } 1661 }
1676 1662
1677 core.Map<core.String, core.Object> toJson() { 1663 core.Map<core.String, core.Object> toJson() {
1678 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1664 final core.Map<core.String, core.Object> _json =
1665 new core.Map<core.String, core.Object>();
1679 if (attributes != null) { 1666 if (attributes != null) {
1680 _json["attributes"] = attributes; 1667 _json["attributes"] = attributes;
1681 } 1668 }
1682 if (data != null) { 1669 if (data != null) {
1683 _json["data"] = data; 1670 _json["data"] = data;
1684 } 1671 }
1685 if (messageId != null) { 1672 if (messageId != null) {
1686 _json["messageId"] = messageId; 1673 _json["messageId"] = messageId;
1687 } 1674 }
1688 if (publishTime != null) { 1675 if (publishTime != null) {
1689 _json["publishTime"] = publishTime; 1676 _json["publishTime"] = publishTime;
1690 } 1677 }
1691 return _json; 1678 return _json;
1692 } 1679 }
1693 } 1680 }
1694 1681
1695 /** Request for the `Pull` method. */ 1682 /// Request for the `Pull` method.
1696 class PullRequest { 1683 class PullRequest {
1697 /** 1684 /// The maximum number of messages returned for this request. The Pub/Sub
1698 * The maximum number of messages returned for this request. The Pub/Sub 1685 /// system may return fewer than the number specified.
1699 * system may return fewer than the number specified.
1700 */
1701 core.int maxMessages; 1686 core.int maxMessages;
1702 /** 1687
1703 * If this field set to true, the system will respond immediately even if 1688 /// If this field set to true, the system will respond immediately even if
1704 * it there are no messages available to return in the `Pull` response. 1689 /// it there are no messages available to return in the `Pull` response.
1705 * Otherwise, the system may wait (for a bounded amount of time) until at 1690 /// Otherwise, the system may wait (for a bounded amount of time) until at
1706 * least one message is available, rather than returning no messages. The 1691 /// least one message is available, rather than returning no messages. The
1707 * client may cancel the request if it does not wish to wait any longer for 1692 /// client may cancel the request if it does not wish to wait any longer for
1708 * the response. 1693 /// the response.
1709 */
1710 core.bool returnImmediately; 1694 core.bool returnImmediately;
1711 1695
1712 PullRequest(); 1696 PullRequest();
1713 1697
1714 PullRequest.fromJson(core.Map _json) { 1698 PullRequest.fromJson(core.Map _json) {
1715 if (_json.containsKey("maxMessages")) { 1699 if (_json.containsKey("maxMessages")) {
1716 maxMessages = _json["maxMessages"]; 1700 maxMessages = _json["maxMessages"];
1717 } 1701 }
1718 if (_json.containsKey("returnImmediately")) { 1702 if (_json.containsKey("returnImmediately")) {
1719 returnImmediately = _json["returnImmediately"]; 1703 returnImmediately = _json["returnImmediately"];
1720 } 1704 }
1721 } 1705 }
1722 1706
1723 core.Map<core.String, core.Object> toJson() { 1707 core.Map<core.String, core.Object> toJson() {
1724 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1708 final core.Map<core.String, core.Object> _json =
1709 new core.Map<core.String, core.Object>();
1725 if (maxMessages != null) { 1710 if (maxMessages != null) {
1726 _json["maxMessages"] = maxMessages; 1711 _json["maxMessages"] = maxMessages;
1727 } 1712 }
1728 if (returnImmediately != null) { 1713 if (returnImmediately != null) {
1729 _json["returnImmediately"] = returnImmediately; 1714 _json["returnImmediately"] = returnImmediately;
1730 } 1715 }
1731 return _json; 1716 return _json;
1732 } 1717 }
1733 } 1718 }
1734 1719
1735 /** Response for the `Pull` method. */ 1720 /// Response for the `Pull` method.
1736 class PullResponse { 1721 class PullResponse {
1737 /** 1722 /// Received Pub/Sub messages. The Pub/Sub system will return zero messages
1738 * Received Pub/Sub messages. The Pub/Sub system will return zero messages if 1723 /// if
1739 * there are no more available in the backlog. The Pub/Sub system may return 1724 /// there are no more available in the backlog. The Pub/Sub system may return
1740 * fewer than the `maxMessages` requested even if there are more messages 1725 /// fewer than the `maxMessages` requested even if there are more messages
1741 * available in the backlog. 1726 /// available in the backlog.
1742 */
1743 core.List<ReceivedMessage> receivedMessages; 1727 core.List<ReceivedMessage> receivedMessages;
1744 1728
1745 PullResponse(); 1729 PullResponse();
1746 1730
1747 PullResponse.fromJson(core.Map _json) { 1731 PullResponse.fromJson(core.Map _json) {
1748 if (_json.containsKey("receivedMessages")) { 1732 if (_json.containsKey("receivedMessages")) {
1749 receivedMessages = _json["receivedMessages"].map((value) => new ReceivedMe ssage.fromJson(value)).toList(); 1733 receivedMessages = _json["receivedMessages"]
1734 .map((value) => new ReceivedMessage.fromJson(value))
1735 .toList();
1750 } 1736 }
1751 } 1737 }
1752 1738
1753 core.Map<core.String, core.Object> toJson() { 1739 core.Map<core.String, core.Object> toJson() {
1754 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1740 final core.Map<core.String, core.Object> _json =
1741 new core.Map<core.String, core.Object>();
1755 if (receivedMessages != null) { 1742 if (receivedMessages != null) {
1756 _json["receivedMessages"] = receivedMessages.map((value) => (value).toJson ()).toList(); 1743 _json["receivedMessages"] =
1744 receivedMessages.map((value) => (value).toJson()).toList();
1757 } 1745 }
1758 return _json; 1746 return _json;
1759 } 1747 }
1760 } 1748 }
1761 1749
1762 /** Configuration for a push delivery endpoint. */ 1750 /// Configuration for a push delivery endpoint.
1763 class PushConfig { 1751 class PushConfig {
1764 /** 1752 /// Endpoint configuration attributes.
1765 * Endpoint configuration attributes. 1753 ///
1766 * 1754 /// Every endpoint has a set of API supported attributes that can be used to
1767 * Every endpoint has a set of API supported attributes that can be used to 1755 /// control different aspects of the message delivery.
1768 * control different aspects of the message delivery. 1756 ///
1769 * 1757 /// The currently supported attribute is `x-goog-version`, which you can
1770 * The currently supported attribute is `x-goog-version`, which you can 1758 /// use to change the format of the pushed message. This attribute
1771 * use to change the format of the pushed message. This attribute 1759 /// indicates the version of the data expected by the endpoint. This
1772 * indicates the version of the data expected by the endpoint. This 1760 /// controls the shape of the pushed message (i.e., its fields and metadata).
1773 * controls the shape of the pushed message (i.e., its fields and metadata). 1761 /// The endpoint version is based on the version of the Pub/Sub API.
1774 * The endpoint version is based on the version of the Pub/Sub API. 1762 ///
1775 * 1763 /// If not present during the `CreateSubscription` call, it will default to
1776 * If not present during the `CreateSubscription` call, it will default to 1764 /// the version of the API used to make such call. If not present during a
1777 * the version of the API used to make such call. If not present during a 1765 /// `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
1778 * `ModifyPushConfig` call, its value will not be changed. `GetSubscription` 1766 /// calls will always return a valid version, even if the subscription was
1779 * calls will always return a valid version, even if the subscription was 1767 /// created without this attribute.
1780 * created without this attribute. 1768 ///
1781 * 1769 /// The possible values for this attribute are:
1782 * The possible values for this attribute are: 1770 ///
1783 * 1771 /// * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
1784 * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. 1772 /// * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
1785 * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
1786 */
1787 core.Map<core.String, core.String> attributes; 1773 core.Map<core.String, core.String> attributes;
1788 /** 1774
1789 * A URL locating the endpoint to which messages should be pushed. 1775 /// A URL locating the endpoint to which messages should be pushed.
1790 * For example, a Webhook endpoint might use "https://example.com/push". 1776 /// For example, a Webhook endpoint might use "https://example.com/push".
1791 */
1792 core.String pushEndpoint; 1777 core.String pushEndpoint;
1793 1778
1794 PushConfig(); 1779 PushConfig();
1795 1780
1796 PushConfig.fromJson(core.Map _json) { 1781 PushConfig.fromJson(core.Map _json) {
1797 if (_json.containsKey("attributes")) { 1782 if (_json.containsKey("attributes")) {
1798 attributes = _json["attributes"]; 1783 attributes = _json["attributes"];
1799 } 1784 }
1800 if (_json.containsKey("pushEndpoint")) { 1785 if (_json.containsKey("pushEndpoint")) {
1801 pushEndpoint = _json["pushEndpoint"]; 1786 pushEndpoint = _json["pushEndpoint"];
1802 } 1787 }
1803 } 1788 }
1804 1789
1805 core.Map<core.String, core.Object> toJson() { 1790 core.Map<core.String, core.Object> toJson() {
1806 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1791 final core.Map<core.String, core.Object> _json =
1792 new core.Map<core.String, core.Object>();
1807 if (attributes != null) { 1793 if (attributes != null) {
1808 _json["attributes"] = attributes; 1794 _json["attributes"] = attributes;
1809 } 1795 }
1810 if (pushEndpoint != null) { 1796 if (pushEndpoint != null) {
1811 _json["pushEndpoint"] = pushEndpoint; 1797 _json["pushEndpoint"] = pushEndpoint;
1812 } 1798 }
1813 return _json; 1799 return _json;
1814 } 1800 }
1815 } 1801 }
1816 1802
1817 /** A message and its corresponding acknowledgment ID. */ 1803 /// A message and its corresponding acknowledgment ID.
1818 class ReceivedMessage { 1804 class ReceivedMessage {
1819 /** This ID can be used to acknowledge the received message. */ 1805 /// This ID can be used to acknowledge the received message.
1820 core.String ackId; 1806 core.String ackId;
1821 /** The message. */ 1807
1808 /// The message.
1822 PubsubMessage message; 1809 PubsubMessage message;
1823 1810
1824 ReceivedMessage(); 1811 ReceivedMessage();
1825 1812
1826 ReceivedMessage.fromJson(core.Map _json) { 1813 ReceivedMessage.fromJson(core.Map _json) {
1827 if (_json.containsKey("ackId")) { 1814 if (_json.containsKey("ackId")) {
1828 ackId = _json["ackId"]; 1815 ackId = _json["ackId"];
1829 } 1816 }
1830 if (_json.containsKey("message")) { 1817 if (_json.containsKey("message")) {
1831 message = new PubsubMessage.fromJson(_json["message"]); 1818 message = new PubsubMessage.fromJson(_json["message"]);
1832 } 1819 }
1833 } 1820 }
1834 1821
1835 core.Map<core.String, core.Object> toJson() { 1822 core.Map<core.String, core.Object> toJson() {
1836 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1823 final core.Map<core.String, core.Object> _json =
1824 new core.Map<core.String, core.Object>();
1837 if (ackId != null) { 1825 if (ackId != null) {
1838 _json["ackId"] = ackId; 1826 _json["ackId"] = ackId;
1839 } 1827 }
1840 if (message != null) { 1828 if (message != null) {
1841 _json["message"] = (message).toJson(); 1829 _json["message"] = (message).toJson();
1842 } 1830 }
1843 return _json; 1831 return _json;
1844 } 1832 }
1845 } 1833 }
1846 1834
1847 /** Request message for `SetIamPolicy` method. */ 1835 /// Request message for `SetIamPolicy` method.
1848 class SetIamPolicyRequest { 1836 class SetIamPolicyRequest {
1849 /** 1837 /// REQUIRED: The complete policy to be applied to the `resource`. The size
1850 * REQUIRED: The complete policy to be applied to the `resource`. The size of 1838 /// of
1851 * the policy is limited to a few 10s of KB. An empty policy is a 1839 /// the policy is limited to a few 10s of KB. An empty policy is a
1852 * valid policy but certain Cloud Platform services (such as Projects) 1840 /// valid policy but certain Cloud Platform services (such as Projects)
1853 * might reject them. 1841 /// might reject them.
1854 */
1855 Policy policy; 1842 Policy policy;
1856 1843
1857 SetIamPolicyRequest(); 1844 SetIamPolicyRequest();
1858 1845
1859 SetIamPolicyRequest.fromJson(core.Map _json) { 1846 SetIamPolicyRequest.fromJson(core.Map _json) {
1860 if (_json.containsKey("policy")) { 1847 if (_json.containsKey("policy")) {
1861 policy = new Policy.fromJson(_json["policy"]); 1848 policy = new Policy.fromJson(_json["policy"]);
1862 } 1849 }
1863 } 1850 }
1864 1851
1865 core.Map<core.String, core.Object> toJson() { 1852 core.Map<core.String, core.Object> toJson() {
1866 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1853 final core.Map<core.String, core.Object> _json =
1854 new core.Map<core.String, core.Object>();
1867 if (policy != null) { 1855 if (policy != null) {
1868 _json["policy"] = (policy).toJson(); 1856 _json["policy"] = (policy).toJson();
1869 } 1857 }
1870 return _json; 1858 return _json;
1871 } 1859 }
1872 } 1860 }
1873 1861
1874 /** A subscription resource. */ 1862 /// A subscription resource.
1875 class Subscription { 1863 class Subscription {
1876 /** 1864 /// This value is the maximum time after a subscriber receives a message
1877 * This value is the maximum time after a subscriber receives a message 1865 /// before the subscriber should acknowledge the message. After message
1878 * before the subscriber should acknowledge the message. After message 1866 /// delivery but before the ack deadline expires and before the message is
1879 * delivery but before the ack deadline expires and before the message is 1867 /// acknowledged, it is an outstanding message and will not be delivered
1880 * acknowledged, it is an outstanding message and will not be delivered 1868 /// again during that time (on a best-effort basis).
1881 * again during that time (on a best-effort basis). 1869 ///
1882 * 1870 /// For pull subscriptions, this value is used as the initial value for the
1883 * For pull subscriptions, this value is used as the initial value for the ack 1871 /// ack
1884 * deadline. To override this value for a given message, call 1872 /// deadline. To override this value for a given message, call
1885 * `ModifyAckDeadline` with the corresponding `ack_id` if using 1873 /// `ModifyAckDeadline` with the corresponding `ack_id` if using
1886 * pull. 1874 /// pull.
1887 * The minimum custom deadline you can specify is 10 seconds. 1875 /// The minimum custom deadline you can specify is 10 seconds.
1888 * The maximum custom deadline you can specify is 600 seconds (10 minutes). 1876 /// The maximum custom deadline you can specify is 600 seconds (10 minutes).
1889 * If this parameter is 0, a default value of 10 seconds is used. 1877 /// If this parameter is 0, a default value of 10 seconds is used.
1890 * 1878 ///
1891 * For push delivery, this value is also used to set the request timeout for 1879 /// For push delivery, this value is also used to set the request timeout for
1892 * the call to the push endpoint. 1880 /// the call to the push endpoint.
1893 * 1881 ///
1894 * If the subscriber never acknowledges the message, the Pub/Sub 1882 /// If the subscriber never acknowledges the message, the Pub/Sub
1895 * system will eventually redeliver the message. 1883 /// system will eventually redeliver the message.
1896 */
1897 core.int ackDeadlineSeconds; 1884 core.int ackDeadlineSeconds;
1898 /** 1885
1899 * The name of the subscription. It must have the format 1886 /// The name of the subscription. It must have the format
1900 * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must 1887 /// `"projects/{project}/subscriptions/{subscription}"`. `{subscription}`
1901 * start with a letter, and contain only letters (`[A-Za-z]`), numbers 1888 /// must
1902 * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), 1889 /// start with a letter, and contain only letters (`[A-Za-z]`), numbers
1903 * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters 1890 /// (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
1904 * in length, and it must not start with `"goog"`. 1891 /// plus (`+`) or percent signs (`%`). It must be between 3 and 255
1905 */ 1892 /// characters
1893 /// in length, and it must not start with `"goog"`.
1906 core.String name; 1894 core.String name;
1907 /** 1895
1908 * If push delivery is used with this subscription, this field is 1896 /// If push delivery is used with this subscription, this field is
1909 * used to configure it. An empty `pushConfig` signifies that the subscriber 1897 /// used to configure it. An empty `pushConfig` signifies that the subscriber
1910 * will pull and ack messages using API methods. 1898 /// will pull and ack messages using API methods.
1911 */
1912 PushConfig pushConfig; 1899 PushConfig pushConfig;
1913 /** 1900
1914 * The name of the topic from which this subscription is receiving messages. 1901 /// The name of the topic from which this subscription is receiving messages.
1915 * Format is `projects/{project}/topics/{topic}`. 1902 /// Format is `projects/{project}/topics/{topic}`.
1916 * The value of this field will be `_deleted-topic_` if the topic has been 1903 /// The value of this field will be `_deleted-topic_` if the topic has been
1917 * deleted. 1904 /// deleted.
1918 */
1919 core.String topic; 1905 core.String topic;
1920 1906
1921 Subscription(); 1907 Subscription();
1922 1908
1923 Subscription.fromJson(core.Map _json) { 1909 Subscription.fromJson(core.Map _json) {
1924 if (_json.containsKey("ackDeadlineSeconds")) { 1910 if (_json.containsKey("ackDeadlineSeconds")) {
1925 ackDeadlineSeconds = _json["ackDeadlineSeconds"]; 1911 ackDeadlineSeconds = _json["ackDeadlineSeconds"];
1926 } 1912 }
1927 if (_json.containsKey("name")) { 1913 if (_json.containsKey("name")) {
1928 name = _json["name"]; 1914 name = _json["name"];
1929 } 1915 }
1930 if (_json.containsKey("pushConfig")) { 1916 if (_json.containsKey("pushConfig")) {
1931 pushConfig = new PushConfig.fromJson(_json["pushConfig"]); 1917 pushConfig = new PushConfig.fromJson(_json["pushConfig"]);
1932 } 1918 }
1933 if (_json.containsKey("topic")) { 1919 if (_json.containsKey("topic")) {
1934 topic = _json["topic"]; 1920 topic = _json["topic"];
1935 } 1921 }
1936 } 1922 }
1937 1923
1938 core.Map<core.String, core.Object> toJson() { 1924 core.Map<core.String, core.Object> toJson() {
1939 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1925 final core.Map<core.String, core.Object> _json =
1926 new core.Map<core.String, core.Object>();
1940 if (ackDeadlineSeconds != null) { 1927 if (ackDeadlineSeconds != null) {
1941 _json["ackDeadlineSeconds"] = ackDeadlineSeconds; 1928 _json["ackDeadlineSeconds"] = ackDeadlineSeconds;
1942 } 1929 }
1943 if (name != null) { 1930 if (name != null) {
1944 _json["name"] = name; 1931 _json["name"] = name;
1945 } 1932 }
1946 if (pushConfig != null) { 1933 if (pushConfig != null) {
1947 _json["pushConfig"] = (pushConfig).toJson(); 1934 _json["pushConfig"] = (pushConfig).toJson();
1948 } 1935 }
1949 if (topic != null) { 1936 if (topic != null) {
1950 _json["topic"] = topic; 1937 _json["topic"] = topic;
1951 } 1938 }
1952 return _json; 1939 return _json;
1953 } 1940 }
1954 } 1941 }
1955 1942
1956 /** Request message for `TestIamPermissions` method. */ 1943 /// Request message for `TestIamPermissions` method.
1957 class TestIamPermissionsRequest { 1944 class TestIamPermissionsRequest {
1958 /** 1945 /// The set of permissions to check for the `resource`. Permissions with
1959 * The set of permissions to check for the `resource`. Permissions with 1946 /// wildcards (such as '*' or 'storage.*') are not allowed. For more
1960 * wildcards (such as '*' or 'storage.*') are not allowed. For more 1947 /// information see
1961 * information see 1948 /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
1962 * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
1963 */
1964 core.List<core.String> permissions; 1949 core.List<core.String> permissions;
1965 1950
1966 TestIamPermissionsRequest(); 1951 TestIamPermissionsRequest();
1967 1952
1968 TestIamPermissionsRequest.fromJson(core.Map _json) { 1953 TestIamPermissionsRequest.fromJson(core.Map _json) {
1969 if (_json.containsKey("permissions")) { 1954 if (_json.containsKey("permissions")) {
1970 permissions = _json["permissions"]; 1955 permissions = _json["permissions"];
1971 } 1956 }
1972 } 1957 }
1973 1958
1974 core.Map<core.String, core.Object> toJson() { 1959 core.Map<core.String, core.Object> toJson() {
1975 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1960 final core.Map<core.String, core.Object> _json =
1961 new core.Map<core.String, core.Object>();
1976 if (permissions != null) { 1962 if (permissions != null) {
1977 _json["permissions"] = permissions; 1963 _json["permissions"] = permissions;
1978 } 1964 }
1979 return _json; 1965 return _json;
1980 } 1966 }
1981 } 1967 }
1982 1968
1983 /** Response message for `TestIamPermissions` method. */ 1969 /// Response message for `TestIamPermissions` method.
1984 class TestIamPermissionsResponse { 1970 class TestIamPermissionsResponse {
1985 /** 1971 /// A subset of `TestPermissionsRequest.permissions` that the caller is
1986 * A subset of `TestPermissionsRequest.permissions` that the caller is 1972 /// allowed.
1987 * allowed.
1988 */
1989 core.List<core.String> permissions; 1973 core.List<core.String> permissions;
1990 1974
1991 TestIamPermissionsResponse(); 1975 TestIamPermissionsResponse();
1992 1976
1993 TestIamPermissionsResponse.fromJson(core.Map _json) { 1977 TestIamPermissionsResponse.fromJson(core.Map _json) {
1994 if (_json.containsKey("permissions")) { 1978 if (_json.containsKey("permissions")) {
1995 permissions = _json["permissions"]; 1979 permissions = _json["permissions"];
1996 } 1980 }
1997 } 1981 }
1998 1982
1999 core.Map<core.String, core.Object> toJson() { 1983 core.Map<core.String, core.Object> toJson() {
2000 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 1984 final core.Map<core.String, core.Object> _json =
1985 new core.Map<core.String, core.Object>();
2001 if (permissions != null) { 1986 if (permissions != null) {
2002 _json["permissions"] = permissions; 1987 _json["permissions"] = permissions;
2003 } 1988 }
2004 return _json; 1989 return _json;
2005 } 1990 }
2006 } 1991 }
2007 1992
2008 /** A topic resource. */ 1993 /// A topic resource.
2009 class Topic { 1994 class Topic {
2010 /** 1995 /// The name of the topic. It must have the format
2011 * The name of the topic. It must have the format 1996 /// `"projects/{project}/topics/{topic}"`. `{topic}` must start with a
2012 * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, 1997 /// letter,
2013 * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), 1998 /// and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
2014 * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent 1999 /// underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
2015 * signs (`%`). It must be between 3 and 255 characters in length, and it 2000 /// signs (`%`). It must be between 3 and 255 characters in length, and it
2016 * must not start with `"goog"`. 2001 /// must not start with `"goog"`.
2017 */
2018 core.String name; 2002 core.String name;
2019 2003
2020 Topic(); 2004 Topic();
2021 2005
2022 Topic.fromJson(core.Map _json) { 2006 Topic.fromJson(core.Map _json) {
2023 if (_json.containsKey("name")) { 2007 if (_json.containsKey("name")) {
2024 name = _json["name"]; 2008 name = _json["name"];
2025 } 2009 }
2026 } 2010 }
2027 2011
2028 core.Map<core.String, core.Object> toJson() { 2012 core.Map<core.String, core.Object> toJson() {
2029 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>(); 2013 final core.Map<core.String, core.Object> _json =
2014 new core.Map<core.String, core.Object>();
2030 if (name != null) { 2015 if (name != null) {
2031 _json["name"] = name; 2016 _json["name"] = name;
2032 } 2017 }
2033 return _json; 2018 return _json;
2034 } 2019 }
2035 } 2020 }
OLDNEW
« no previous file with comments | « generated/googleapis/lib/prediction/v1_6.dart ('k') | generated/googleapis/lib/qpxexpress/v1.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698