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

Side by Side Diff: generated/googleapis/test/spanner/v1_test.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 library googleapis.spanner.v1.test; 1 library googleapis.spanner.v1.test;
2 2
3 import "dart:core" as core; 3 import "dart:core" as core;
4 import "dart:collection" as collection;
5 import "dart:async" as async; 4 import "dart:async" as async;
6 import "dart:convert" as convert; 5 import "dart:convert" as convert;
7 6
8 import 'package:http/http.dart' as http; 7 import 'package:http/http.dart' as http;
9 import 'package:http/testing.dart' as http_testing;
10 import 'package:test/test.dart' as unittest; 8 import 'package:test/test.dart' as unittest;
11 9
12 import 'package:googleapis/spanner/v1.dart' as api; 10 import 'package:googleapis/spanner/v1.dart' as api;
13 11
14 class HttpServerMock extends http.BaseClient { 12 class HttpServerMock extends http.BaseClient {
15 core.Function _callback; 13 core.Function _callback;
16 core.bool _expectJson; 14 core.bool _expectJson;
17 15
18 void register(core.Function callback, core.bool expectJson) { 16 void register(core.Function callback, core.bool expectJson) {
19 _callback = callback; 17 _callback = callback;
20 _expectJson = expectJson; 18 _expectJson = expectJson;
21 } 19 }
22 20
23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { 21 async.Future<http.StreamedResponse> send(http.BaseRequest request) {
24 if (_expectJson) { 22 if (_expectJson) {
25 return request.finalize() 23 return request
24 .finalize()
26 .transform(convert.UTF8.decoder) 25 .transform(convert.UTF8.decoder)
27 .join('') 26 .join('')
28 .then((core.String jsonString) { 27 .then((core.String jsonString) {
29 if (jsonString.isEmpty) { 28 if (jsonString.isEmpty) {
30 return _callback(request, null); 29 return _callback(request, null);
31 } else { 30 } else {
32 return _callback(request, convert.JSON.decode(jsonString)); 31 return _callback(request, convert.JSON.decode(jsonString));
33 } 32 }
34 }); 33 });
35 } else { 34 } else {
36 var stream = request.finalize(); 35 var stream = request.finalize();
37 if (stream == null) { 36 if (stream == null) {
38 return _callback(request, []); 37 return _callback(request, []);
39 } else { 38 } else {
40 return stream.toBytes().then((data) { 39 return stream.toBytes().then((data) {
41 return _callback(request, data); 40 return _callback(request, data);
42 }); 41 });
43 } 42 }
44 } 43 }
45 } 44 }
46 } 45 }
47 46
48 http.StreamedResponse stringResponse( 47 http.StreamedResponse stringResponse(core.int status,
49 core.int status, core.Map<core.String, core.String> headers, core.String bod y) { 48 core.Map<core.String, core.String> headers, core.String body) {
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); 49 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]);
51 return new http.StreamedResponse(stream, status, headers: headers); 50 return new http.StreamedResponse(stream, status, headers: headers);
52 } 51 }
53 52
54 buildUnnamed2105() {
55 var o = new core.List<api.AuditLogConfig>();
56 o.add(buildAuditLogConfig());
57 o.add(buildAuditLogConfig());
58 return o;
59 }
60
61 checkUnnamed2105(core.List<api.AuditLogConfig> o) {
62 unittest.expect(o, unittest.hasLength(2));
63 checkAuditLogConfig(o[0]);
64 checkAuditLogConfig(o[1]);
65 }
66
67 buildUnnamed2106() {
68 var o = new core.List<core.String>();
69 o.add("foo");
70 o.add("foo");
71 return o;
72 }
73
74 checkUnnamed2106(core.List<core.String> o) {
75 unittest.expect(o, unittest.hasLength(2));
76 unittest.expect(o[0], unittest.equals('foo'));
77 unittest.expect(o[1], unittest.equals('foo'));
78 }
79
80 core.int buildCounterAuditConfig = 0;
81 buildAuditConfig() {
82 var o = new api.AuditConfig();
83 buildCounterAuditConfig++;
84 if (buildCounterAuditConfig < 3) {
85 o.auditLogConfigs = buildUnnamed2105();
86 o.exemptedMembers = buildUnnamed2106();
87 o.service = "foo";
88 }
89 buildCounterAuditConfig--;
90 return o;
91 }
92
93 checkAuditConfig(api.AuditConfig o) {
94 buildCounterAuditConfig++;
95 if (buildCounterAuditConfig < 3) {
96 checkUnnamed2105(o.auditLogConfigs);
97 checkUnnamed2106(o.exemptedMembers);
98 unittest.expect(o.service, unittest.equals('foo'));
99 }
100 buildCounterAuditConfig--;
101 }
102
103 buildUnnamed2107() {
104 var o = new core.List<core.String>();
105 o.add("foo");
106 o.add("foo");
107 return o;
108 }
109
110 checkUnnamed2107(core.List<core.String> o) {
111 unittest.expect(o, unittest.hasLength(2));
112 unittest.expect(o[0], unittest.equals('foo'));
113 unittest.expect(o[1], unittest.equals('foo'));
114 }
115
116 core.int buildCounterAuditLogConfig = 0;
117 buildAuditLogConfig() {
118 var o = new api.AuditLogConfig();
119 buildCounterAuditLogConfig++;
120 if (buildCounterAuditLogConfig < 3) {
121 o.exemptedMembers = buildUnnamed2107();
122 o.logType = "foo";
123 }
124 buildCounterAuditLogConfig--;
125 return o;
126 }
127
128 checkAuditLogConfig(api.AuditLogConfig o) {
129 buildCounterAuditLogConfig++;
130 if (buildCounterAuditLogConfig < 3) {
131 checkUnnamed2107(o.exemptedMembers);
132 unittest.expect(o.logType, unittest.equals('foo'));
133 }
134 buildCounterAuditLogConfig--;
135 }
136
137 core.int buildCounterAuthorizationLoggingOptions = 0;
138 buildAuthorizationLoggingOptions() {
139 var o = new api.AuthorizationLoggingOptions();
140 buildCounterAuthorizationLoggingOptions++;
141 if (buildCounterAuthorizationLoggingOptions < 3) {
142 o.permissionType = "foo";
143 }
144 buildCounterAuthorizationLoggingOptions--;
145 return o;
146 }
147
148 checkAuthorizationLoggingOptions(api.AuthorizationLoggingOptions o) {
149 buildCounterAuthorizationLoggingOptions++;
150 if (buildCounterAuthorizationLoggingOptions < 3) {
151 unittest.expect(o.permissionType, unittest.equals('foo'));
152 }
153 buildCounterAuthorizationLoggingOptions--;
154 }
155
156 core.int buildCounterBeginTransactionRequest = 0; 53 core.int buildCounterBeginTransactionRequest = 0;
157 buildBeginTransactionRequest() { 54 buildBeginTransactionRequest() {
158 var o = new api.BeginTransactionRequest(); 55 var o = new api.BeginTransactionRequest();
159 buildCounterBeginTransactionRequest++; 56 buildCounterBeginTransactionRequest++;
160 if (buildCounterBeginTransactionRequest < 3) { 57 if (buildCounterBeginTransactionRequest < 3) {
161 o.options = buildTransactionOptions(); 58 o.options = buildTransactionOptions();
162 } 59 }
163 buildCounterBeginTransactionRequest--; 60 buildCounterBeginTransactionRequest--;
164 return o; 61 return o;
165 } 62 }
166 63
167 checkBeginTransactionRequest(api.BeginTransactionRequest o) { 64 checkBeginTransactionRequest(api.BeginTransactionRequest o) {
168 buildCounterBeginTransactionRequest++; 65 buildCounterBeginTransactionRequest++;
169 if (buildCounterBeginTransactionRequest < 3) { 66 if (buildCounterBeginTransactionRequest < 3) {
170 checkTransactionOptions(o.options); 67 checkTransactionOptions(o.options);
171 } 68 }
172 buildCounterBeginTransactionRequest--; 69 buildCounterBeginTransactionRequest--;
173 } 70 }
174 71
175 buildUnnamed2108() { 72 buildUnnamed2103() {
176 var o = new core.List<core.String>(); 73 var o = new core.List<core.String>();
177 o.add("foo"); 74 o.add("foo");
178 o.add("foo"); 75 o.add("foo");
179 return o; 76 return o;
180 } 77 }
181 78
182 checkUnnamed2108(core.List<core.String> o) { 79 checkUnnamed2103(core.List<core.String> o) {
183 unittest.expect(o, unittest.hasLength(2)); 80 unittest.expect(o, unittest.hasLength(2));
184 unittest.expect(o[0], unittest.equals('foo')); 81 unittest.expect(o[0], unittest.equals('foo'));
185 unittest.expect(o[1], unittest.equals('foo')); 82 unittest.expect(o[1], unittest.equals('foo'));
186 } 83 }
187 84
188 core.int buildCounterBinding = 0; 85 core.int buildCounterBinding = 0;
189 buildBinding() { 86 buildBinding() {
190 var o = new api.Binding(); 87 var o = new api.Binding();
191 buildCounterBinding++; 88 buildCounterBinding++;
192 if (buildCounterBinding < 3) { 89 if (buildCounterBinding < 3) {
193 o.condition = buildExpr(); 90 o.members = buildUnnamed2103();
194 o.members = buildUnnamed2108();
195 o.role = "foo"; 91 o.role = "foo";
196 } 92 }
197 buildCounterBinding--; 93 buildCounterBinding--;
198 return o; 94 return o;
199 } 95 }
200 96
201 checkBinding(api.Binding o) { 97 checkBinding(api.Binding o) {
202 buildCounterBinding++; 98 buildCounterBinding++;
203 if (buildCounterBinding < 3) { 99 if (buildCounterBinding < 3) {
204 checkExpr(o.condition); 100 checkUnnamed2103(o.members);
205 checkUnnamed2108(o.members);
206 unittest.expect(o.role, unittest.equals('foo')); 101 unittest.expect(o.role, unittest.equals('foo'));
207 } 102 }
208 buildCounterBinding--; 103 buildCounterBinding--;
209 } 104 }
210 105
211 core.int buildCounterChildLink = 0; 106 core.int buildCounterChildLink = 0;
212 buildChildLink() { 107 buildChildLink() {
213 var o = new api.ChildLink(); 108 var o = new api.ChildLink();
214 buildCounterChildLink++; 109 buildCounterChildLink++;
215 if (buildCounterChildLink < 3) { 110 if (buildCounterChildLink < 3) {
216 o.childIndex = 42; 111 o.childIndex = 42;
217 o.type = "foo"; 112 o.type = "foo";
218 o.variable = "foo"; 113 o.variable = "foo";
219 } 114 }
220 buildCounterChildLink--; 115 buildCounterChildLink--;
221 return o; 116 return o;
222 } 117 }
223 118
224 checkChildLink(api.ChildLink o) { 119 checkChildLink(api.ChildLink o) {
225 buildCounterChildLink++; 120 buildCounterChildLink++;
226 if (buildCounterChildLink < 3) { 121 if (buildCounterChildLink < 3) {
227 unittest.expect(o.childIndex, unittest.equals(42)); 122 unittest.expect(o.childIndex, unittest.equals(42));
228 unittest.expect(o.type, unittest.equals('foo')); 123 unittest.expect(o.type, unittest.equals('foo'));
229 unittest.expect(o.variable, unittest.equals('foo')); 124 unittest.expect(o.variable, unittest.equals('foo'));
230 } 125 }
231 buildCounterChildLink--; 126 buildCounterChildLink--;
232 } 127 }
233 128
234 core.int buildCounterCloudAuditOptions = 0; 129 buildUnnamed2104() {
235 buildCloudAuditOptions() {
236 var o = new api.CloudAuditOptions();
237 buildCounterCloudAuditOptions++;
238 if (buildCounterCloudAuditOptions < 3) {
239 o.authorizationLoggingOptions = buildAuthorizationLoggingOptions();
240 o.logName = "foo";
241 }
242 buildCounterCloudAuditOptions--;
243 return o;
244 }
245
246 checkCloudAuditOptions(api.CloudAuditOptions o) {
247 buildCounterCloudAuditOptions++;
248 if (buildCounterCloudAuditOptions < 3) {
249 checkAuthorizationLoggingOptions(o.authorizationLoggingOptions);
250 unittest.expect(o.logName, unittest.equals('foo'));
251 }
252 buildCounterCloudAuditOptions--;
253 }
254
255 buildUnnamed2109() {
256 var o = new core.List<api.Mutation>(); 130 var o = new core.List<api.Mutation>();
257 o.add(buildMutation()); 131 o.add(buildMutation());
258 o.add(buildMutation()); 132 o.add(buildMutation());
259 return o; 133 return o;
260 } 134 }
261 135
262 checkUnnamed2109(core.List<api.Mutation> o) { 136 checkUnnamed2104(core.List<api.Mutation> o) {
263 unittest.expect(o, unittest.hasLength(2)); 137 unittest.expect(o, unittest.hasLength(2));
264 checkMutation(o[0]); 138 checkMutation(o[0]);
265 checkMutation(o[1]); 139 checkMutation(o[1]);
266 } 140 }
267 141
268 core.int buildCounterCommitRequest = 0; 142 core.int buildCounterCommitRequest = 0;
269 buildCommitRequest() { 143 buildCommitRequest() {
270 var o = new api.CommitRequest(); 144 var o = new api.CommitRequest();
271 buildCounterCommitRequest++; 145 buildCounterCommitRequest++;
272 if (buildCounterCommitRequest < 3) { 146 if (buildCounterCommitRequest < 3) {
273 o.mutations = buildUnnamed2109(); 147 o.mutations = buildUnnamed2104();
274 o.singleUseTransaction = buildTransactionOptions(); 148 o.singleUseTransaction = buildTransactionOptions();
275 o.transactionId = "foo"; 149 o.transactionId = "foo";
276 } 150 }
277 buildCounterCommitRequest--; 151 buildCounterCommitRequest--;
278 return o; 152 return o;
279 } 153 }
280 154
281 checkCommitRequest(api.CommitRequest o) { 155 checkCommitRequest(api.CommitRequest o) {
282 buildCounterCommitRequest++; 156 buildCounterCommitRequest++;
283 if (buildCounterCommitRequest < 3) { 157 if (buildCounterCommitRequest < 3) {
284 checkUnnamed2109(o.mutations); 158 checkUnnamed2104(o.mutations);
285 checkTransactionOptions(o.singleUseTransaction); 159 checkTransactionOptions(o.singleUseTransaction);
286 unittest.expect(o.transactionId, unittest.equals('foo')); 160 unittest.expect(o.transactionId, unittest.equals('foo'));
287 } 161 }
288 buildCounterCommitRequest--; 162 buildCounterCommitRequest--;
289 } 163 }
290 164
291 core.int buildCounterCommitResponse = 0; 165 core.int buildCounterCommitResponse = 0;
292 buildCommitResponse() { 166 buildCommitResponse() {
293 var o = new api.CommitResponse(); 167 var o = new api.CommitResponse();
294 buildCounterCommitResponse++; 168 buildCounterCommitResponse++;
295 if (buildCounterCommitResponse < 3) { 169 if (buildCounterCommitResponse < 3) {
296 o.commitTimestamp = "foo"; 170 o.commitTimestamp = "foo";
297 } 171 }
298 buildCounterCommitResponse--; 172 buildCounterCommitResponse--;
299 return o; 173 return o;
300 } 174 }
301 175
302 checkCommitResponse(api.CommitResponse o) { 176 checkCommitResponse(api.CommitResponse o) {
303 buildCounterCommitResponse++; 177 buildCounterCommitResponse++;
304 if (buildCounterCommitResponse < 3) { 178 if (buildCounterCommitResponse < 3) {
305 unittest.expect(o.commitTimestamp, unittest.equals('foo')); 179 unittest.expect(o.commitTimestamp, unittest.equals('foo'));
306 } 180 }
307 buildCounterCommitResponse--; 181 buildCounterCommitResponse--;
308 } 182 }
309 183
310 buildUnnamed2110() {
311 var o = new core.List<core.String>();
312 o.add("foo");
313 o.add("foo");
314 return o;
315 }
316
317 checkUnnamed2110(core.List<core.String> o) {
318 unittest.expect(o, unittest.hasLength(2));
319 unittest.expect(o[0], unittest.equals('foo'));
320 unittest.expect(o[1], unittest.equals('foo'));
321 }
322
323 core.int buildCounterCondition = 0;
324 buildCondition() {
325 var o = new api.Condition();
326 buildCounterCondition++;
327 if (buildCounterCondition < 3) {
328 o.iam = "foo";
329 o.op = "foo";
330 o.svc = "foo";
331 o.sys = "foo";
332 o.value = "foo";
333 o.values = buildUnnamed2110();
334 }
335 buildCounterCondition--;
336 return o;
337 }
338
339 checkCondition(api.Condition o) {
340 buildCounterCondition++;
341 if (buildCounterCondition < 3) {
342 unittest.expect(o.iam, unittest.equals('foo'));
343 unittest.expect(o.op, unittest.equals('foo'));
344 unittest.expect(o.svc, unittest.equals('foo'));
345 unittest.expect(o.sys, unittest.equals('foo'));
346 unittest.expect(o.value, unittest.equals('foo'));
347 checkUnnamed2110(o.values);
348 }
349 buildCounterCondition--;
350 }
351
352 core.int buildCounterCounterOptions = 0;
353 buildCounterOptions() {
354 var o = new api.CounterOptions();
355 buildCounterCounterOptions++;
356 if (buildCounterCounterOptions < 3) {
357 o.field = "foo";
358 o.metric = "foo";
359 }
360 buildCounterCounterOptions--;
361 return o;
362 }
363
364 checkCounterOptions(api.CounterOptions o) {
365 buildCounterCounterOptions++;
366 if (buildCounterCounterOptions < 3) {
367 unittest.expect(o.field, unittest.equals('foo'));
368 unittest.expect(o.metric, unittest.equals('foo'));
369 }
370 buildCounterCounterOptions--;
371 }
372
373 core.int buildCounterCreateDatabaseMetadata = 0; 184 core.int buildCounterCreateDatabaseMetadata = 0;
374 buildCreateDatabaseMetadata() { 185 buildCreateDatabaseMetadata() {
375 var o = new api.CreateDatabaseMetadata(); 186 var o = new api.CreateDatabaseMetadata();
376 buildCounterCreateDatabaseMetadata++; 187 buildCounterCreateDatabaseMetadata++;
377 if (buildCounterCreateDatabaseMetadata < 3) { 188 if (buildCounterCreateDatabaseMetadata < 3) {
378 o.database = "foo"; 189 o.database = "foo";
379 } 190 }
380 buildCounterCreateDatabaseMetadata--; 191 buildCounterCreateDatabaseMetadata--;
381 return o; 192 return o;
382 } 193 }
383 194
384 checkCreateDatabaseMetadata(api.CreateDatabaseMetadata o) { 195 checkCreateDatabaseMetadata(api.CreateDatabaseMetadata o) {
385 buildCounterCreateDatabaseMetadata++; 196 buildCounterCreateDatabaseMetadata++;
386 if (buildCounterCreateDatabaseMetadata < 3) { 197 if (buildCounterCreateDatabaseMetadata < 3) {
387 unittest.expect(o.database, unittest.equals('foo')); 198 unittest.expect(o.database, unittest.equals('foo'));
388 } 199 }
389 buildCounterCreateDatabaseMetadata--; 200 buildCounterCreateDatabaseMetadata--;
390 } 201 }
391 202
392 buildUnnamed2111() { 203 buildUnnamed2105() {
393 var o = new core.List<core.String>(); 204 var o = new core.List<core.String>();
394 o.add("foo"); 205 o.add("foo");
395 o.add("foo"); 206 o.add("foo");
396 return o; 207 return o;
397 } 208 }
398 209
399 checkUnnamed2111(core.List<core.String> o) { 210 checkUnnamed2105(core.List<core.String> o) {
400 unittest.expect(o, unittest.hasLength(2)); 211 unittest.expect(o, unittest.hasLength(2));
401 unittest.expect(o[0], unittest.equals('foo')); 212 unittest.expect(o[0], unittest.equals('foo'));
402 unittest.expect(o[1], unittest.equals('foo')); 213 unittest.expect(o[1], unittest.equals('foo'));
403 } 214 }
404 215
405 core.int buildCounterCreateDatabaseRequest = 0; 216 core.int buildCounterCreateDatabaseRequest = 0;
406 buildCreateDatabaseRequest() { 217 buildCreateDatabaseRequest() {
407 var o = new api.CreateDatabaseRequest(); 218 var o = new api.CreateDatabaseRequest();
408 buildCounterCreateDatabaseRequest++; 219 buildCounterCreateDatabaseRequest++;
409 if (buildCounterCreateDatabaseRequest < 3) { 220 if (buildCounterCreateDatabaseRequest < 3) {
410 o.createStatement = "foo"; 221 o.createStatement = "foo";
411 o.extraStatements = buildUnnamed2111(); 222 o.extraStatements = buildUnnamed2105();
412 } 223 }
413 buildCounterCreateDatabaseRequest--; 224 buildCounterCreateDatabaseRequest--;
414 return o; 225 return o;
415 } 226 }
416 227
417 checkCreateDatabaseRequest(api.CreateDatabaseRequest o) { 228 checkCreateDatabaseRequest(api.CreateDatabaseRequest o) {
418 buildCounterCreateDatabaseRequest++; 229 buildCounterCreateDatabaseRequest++;
419 if (buildCounterCreateDatabaseRequest < 3) { 230 if (buildCounterCreateDatabaseRequest < 3) {
420 unittest.expect(o.createStatement, unittest.equals('foo')); 231 unittest.expect(o.createStatement, unittest.equals('foo'));
421 checkUnnamed2111(o.extraStatements); 232 checkUnnamed2105(o.extraStatements);
422 } 233 }
423 buildCounterCreateDatabaseRequest--; 234 buildCounterCreateDatabaseRequest--;
424 } 235 }
425 236
426 core.int buildCounterCreateInstanceMetadata = 0; 237 core.int buildCounterCreateInstanceMetadata = 0;
427 buildCreateInstanceMetadata() { 238 buildCreateInstanceMetadata() {
428 var o = new api.CreateInstanceMetadata(); 239 var o = new api.CreateInstanceMetadata();
429 buildCounterCreateInstanceMetadata++; 240 buildCounterCreateInstanceMetadata++;
430 if (buildCounterCreateInstanceMetadata < 3) { 241 if (buildCounterCreateInstanceMetadata < 3) {
431 o.cancelTime = "foo"; 242 o.cancelTime = "foo";
(...skipping 30 matching lines...) Expand all
462 273
463 checkCreateInstanceRequest(api.CreateInstanceRequest o) { 274 checkCreateInstanceRequest(api.CreateInstanceRequest o) {
464 buildCounterCreateInstanceRequest++; 275 buildCounterCreateInstanceRequest++;
465 if (buildCounterCreateInstanceRequest < 3) { 276 if (buildCounterCreateInstanceRequest < 3) {
466 checkInstance(o.instance); 277 checkInstance(o.instance);
467 unittest.expect(o.instanceId, unittest.equals('foo')); 278 unittest.expect(o.instanceId, unittest.equals('foo'));
468 } 279 }
469 buildCounterCreateInstanceRequest--; 280 buildCounterCreateInstanceRequest--;
470 } 281 }
471 282
472 core.int buildCounterDataAccessOptions = 0;
473 buildDataAccessOptions() {
474 var o = new api.DataAccessOptions();
475 buildCounterDataAccessOptions++;
476 if (buildCounterDataAccessOptions < 3) {
477 }
478 buildCounterDataAccessOptions--;
479 return o;
480 }
481
482 checkDataAccessOptions(api.DataAccessOptions o) {
483 buildCounterDataAccessOptions++;
484 if (buildCounterDataAccessOptions < 3) {
485 }
486 buildCounterDataAccessOptions--;
487 }
488
489 core.int buildCounterDatabase = 0; 283 core.int buildCounterDatabase = 0;
490 buildDatabase() { 284 buildDatabase() {
491 var o = new api.Database(); 285 var o = new api.Database();
492 buildCounterDatabase++; 286 buildCounterDatabase++;
493 if (buildCounterDatabase < 3) { 287 if (buildCounterDatabase < 3) {
494 o.name = "foo"; 288 o.name = "foo";
495 o.state = "foo"; 289 o.state = "foo";
496 } 290 }
497 buildCounterDatabase--; 291 buildCounterDatabase--;
498 return o; 292 return o;
(...skipping 26 matching lines...) Expand all
525 checkKeySet(o.keySet); 319 checkKeySet(o.keySet);
526 unittest.expect(o.table, unittest.equals('foo')); 320 unittest.expect(o.table, unittest.equals('foo'));
527 } 321 }
528 buildCounterDelete--; 322 buildCounterDelete--;
529 } 323 }
530 324
531 core.int buildCounterEmpty = 0; 325 core.int buildCounterEmpty = 0;
532 buildEmpty() { 326 buildEmpty() {
533 var o = new api.Empty(); 327 var o = new api.Empty();
534 buildCounterEmpty++; 328 buildCounterEmpty++;
535 if (buildCounterEmpty < 3) { 329 if (buildCounterEmpty < 3) {}
536 }
537 buildCounterEmpty--; 330 buildCounterEmpty--;
538 return o; 331 return o;
539 } 332 }
540 333
541 checkEmpty(api.Empty o) { 334 checkEmpty(api.Empty o) {
542 buildCounterEmpty++; 335 buildCounterEmpty++;
543 if (buildCounterEmpty < 3) { 336 if (buildCounterEmpty < 3) {}
544 }
545 buildCounterEmpty--; 337 buildCounterEmpty--;
546 } 338 }
547 339
548 buildUnnamed2112() { 340 buildUnnamed2106() {
549 var o = new core.Map<core.String, api.Type>(); 341 var o = new core.Map<core.String, api.Type>();
550 o["x"] = buildType(); 342 o["x"] = buildType();
551 o["y"] = buildType(); 343 o["y"] = buildType();
552 return o; 344 return o;
553 } 345 }
554 346
555 checkUnnamed2112(core.Map<core.String, api.Type> o) { 347 checkUnnamed2106(core.Map<core.String, api.Type> o) {
556 unittest.expect(o, unittest.hasLength(2)); 348 unittest.expect(o, unittest.hasLength(2));
557 checkType(o["x"]); 349 checkType(o["x"]);
558 checkType(o["y"]); 350 checkType(o["y"]);
559 } 351 }
560 352
561 buildUnnamed2113() { 353 buildUnnamed2107() {
562 var o = new core.Map<core.String, core.Object>(); 354 var o = new core.Map<core.String, core.Object>();
563 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 355 o["x"] = {
564 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 356 'list': [1, 2, 3],
357 'bool': true,
358 'string': 'foo'
359 };
360 o["y"] = {
361 'list': [1, 2, 3],
362 'bool': true,
363 'string': 'foo'
364 };
565 return o; 365 return o;
566 } 366 }
567 367
568 checkUnnamed2113(core.Map<core.String, core.Object> o) { 368 checkUnnamed2107(core.Map<core.String, core.Object> o) {
569 unittest.expect(o, unittest.hasLength(2)); 369 unittest.expect(o, unittest.hasLength(2));
570 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], unittest.equals('foo')); 370 var casted1 = (o["x"]) as core.Map;
571 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], unittest.equals('foo')); 371 unittest.expect(casted1, unittest.hasLength(3));
372 unittest.expect(casted1["list"], unittest.equals([1, 2, 3]));
373 unittest.expect(casted1["bool"], unittest.equals(true));
374 unittest.expect(casted1["string"], unittest.equals('foo'));
375 var casted2 = (o["y"]) as core.Map;
376 unittest.expect(casted2, unittest.hasLength(3));
377 unittest.expect(casted2["list"], unittest.equals([1, 2, 3]));
378 unittest.expect(casted2["bool"], unittest.equals(true));
379 unittest.expect(casted2["string"], unittest.equals('foo'));
572 } 380 }
573 381
574 core.int buildCounterExecuteSqlRequest = 0; 382 core.int buildCounterExecuteSqlRequest = 0;
575 buildExecuteSqlRequest() { 383 buildExecuteSqlRequest() {
576 var o = new api.ExecuteSqlRequest(); 384 var o = new api.ExecuteSqlRequest();
577 buildCounterExecuteSqlRequest++; 385 buildCounterExecuteSqlRequest++;
578 if (buildCounterExecuteSqlRequest < 3) { 386 if (buildCounterExecuteSqlRequest < 3) {
579 o.paramTypes = buildUnnamed2112(); 387 o.paramTypes = buildUnnamed2106();
580 o.params = buildUnnamed2113(); 388 o.params = buildUnnamed2107();
581 o.queryMode = "foo"; 389 o.queryMode = "foo";
582 o.resumeToken = "foo"; 390 o.resumeToken = "foo";
583 o.sql = "foo"; 391 o.sql = "foo";
584 o.transaction = buildTransactionSelector(); 392 o.transaction = buildTransactionSelector();
585 } 393 }
586 buildCounterExecuteSqlRequest--; 394 buildCounterExecuteSqlRequest--;
587 return o; 395 return o;
588 } 396 }
589 397
590 checkExecuteSqlRequest(api.ExecuteSqlRequest o) { 398 checkExecuteSqlRequest(api.ExecuteSqlRequest o) {
591 buildCounterExecuteSqlRequest++; 399 buildCounterExecuteSqlRequest++;
592 if (buildCounterExecuteSqlRequest < 3) { 400 if (buildCounterExecuteSqlRequest < 3) {
593 checkUnnamed2112(o.paramTypes); 401 checkUnnamed2106(o.paramTypes);
594 checkUnnamed2113(o.params); 402 checkUnnamed2107(o.params);
595 unittest.expect(o.queryMode, unittest.equals('foo')); 403 unittest.expect(o.queryMode, unittest.equals('foo'));
596 unittest.expect(o.resumeToken, unittest.equals('foo')); 404 unittest.expect(o.resumeToken, unittest.equals('foo'));
597 unittest.expect(o.sql, unittest.equals('foo')); 405 unittest.expect(o.sql, unittest.equals('foo'));
598 checkTransactionSelector(o.transaction); 406 checkTransactionSelector(o.transaction);
599 } 407 }
600 buildCounterExecuteSqlRequest--; 408 buildCounterExecuteSqlRequest--;
601 } 409 }
602 410
603 core.int buildCounterExpr = 0;
604 buildExpr() {
605 var o = new api.Expr();
606 buildCounterExpr++;
607 if (buildCounterExpr < 3) {
608 o.description = "foo";
609 o.expression = "foo";
610 o.location = "foo";
611 o.title = "foo";
612 }
613 buildCounterExpr--;
614 return o;
615 }
616
617 checkExpr(api.Expr o) {
618 buildCounterExpr++;
619 if (buildCounterExpr < 3) {
620 unittest.expect(o.description, unittest.equals('foo'));
621 unittest.expect(o.expression, unittest.equals('foo'));
622 unittest.expect(o.location, unittest.equals('foo'));
623 unittest.expect(o.title, unittest.equals('foo'));
624 }
625 buildCounterExpr--;
626 }
627
628 core.int buildCounterField = 0; 411 core.int buildCounterField = 0;
629 buildField() { 412 buildField() {
630 var o = new api.Field(); 413 var o = new api.Field();
631 buildCounterField++; 414 buildCounterField++;
632 if (buildCounterField < 3) { 415 if (buildCounterField < 3) {
633 o.name = "foo"; 416 o.name = "foo";
634 o.type = buildType(); 417 o.type = buildType();
635 } 418 }
636 buildCounterField--; 419 buildCounterField--;
637 return o; 420 return o;
638 } 421 }
639 422
640 checkField(api.Field o) { 423 checkField(api.Field o) {
641 buildCounterField++; 424 buildCounterField++;
642 if (buildCounterField < 3) { 425 if (buildCounterField < 3) {
643 unittest.expect(o.name, unittest.equals('foo')); 426 unittest.expect(o.name, unittest.equals('foo'));
644 checkType(o.type); 427 checkType(o.type);
645 } 428 }
646 buildCounterField--; 429 buildCounterField--;
647 } 430 }
648 431
649 buildUnnamed2114() { 432 buildUnnamed2108() {
650 var o = new core.List<core.String>(); 433 var o = new core.List<core.String>();
651 o.add("foo"); 434 o.add("foo");
652 o.add("foo"); 435 o.add("foo");
653 return o; 436 return o;
654 } 437 }
655 438
656 checkUnnamed2114(core.List<core.String> o) { 439 checkUnnamed2108(core.List<core.String> o) {
657 unittest.expect(o, unittest.hasLength(2)); 440 unittest.expect(o, unittest.hasLength(2));
658 unittest.expect(o[0], unittest.equals('foo')); 441 unittest.expect(o[0], unittest.equals('foo'));
659 unittest.expect(o[1], unittest.equals('foo')); 442 unittest.expect(o[1], unittest.equals('foo'));
660 } 443 }
661 444
662 core.int buildCounterGetDatabaseDdlResponse = 0; 445 core.int buildCounterGetDatabaseDdlResponse = 0;
663 buildGetDatabaseDdlResponse() { 446 buildGetDatabaseDdlResponse() {
664 var o = new api.GetDatabaseDdlResponse(); 447 var o = new api.GetDatabaseDdlResponse();
665 buildCounterGetDatabaseDdlResponse++; 448 buildCounterGetDatabaseDdlResponse++;
666 if (buildCounterGetDatabaseDdlResponse < 3) { 449 if (buildCounterGetDatabaseDdlResponse < 3) {
667 o.statements = buildUnnamed2114(); 450 o.statements = buildUnnamed2108();
668 } 451 }
669 buildCounterGetDatabaseDdlResponse--; 452 buildCounterGetDatabaseDdlResponse--;
670 return o; 453 return o;
671 } 454 }
672 455
673 checkGetDatabaseDdlResponse(api.GetDatabaseDdlResponse o) { 456 checkGetDatabaseDdlResponse(api.GetDatabaseDdlResponse o) {
674 buildCounterGetDatabaseDdlResponse++; 457 buildCounterGetDatabaseDdlResponse++;
675 if (buildCounterGetDatabaseDdlResponse < 3) { 458 if (buildCounterGetDatabaseDdlResponse < 3) {
676 checkUnnamed2114(o.statements); 459 checkUnnamed2108(o.statements);
677 } 460 }
678 buildCounterGetDatabaseDdlResponse--; 461 buildCounterGetDatabaseDdlResponse--;
679 } 462 }
680 463
681 core.int buildCounterGetIamPolicyRequest = 0; 464 core.int buildCounterGetIamPolicyRequest = 0;
682 buildGetIamPolicyRequest() { 465 buildGetIamPolicyRequest() {
683 var o = new api.GetIamPolicyRequest(); 466 var o = new api.GetIamPolicyRequest();
684 buildCounterGetIamPolicyRequest++; 467 buildCounterGetIamPolicyRequest++;
685 if (buildCounterGetIamPolicyRequest < 3) { 468 if (buildCounterGetIamPolicyRequest < 3) {}
686 }
687 buildCounterGetIamPolicyRequest--; 469 buildCounterGetIamPolicyRequest--;
688 return o; 470 return o;
689 } 471 }
690 472
691 checkGetIamPolicyRequest(api.GetIamPolicyRequest o) { 473 checkGetIamPolicyRequest(api.GetIamPolicyRequest o) {
692 buildCounterGetIamPolicyRequest++; 474 buildCounterGetIamPolicyRequest++;
693 if (buildCounterGetIamPolicyRequest < 3) { 475 if (buildCounterGetIamPolicyRequest < 3) {}
694 }
695 buildCounterGetIamPolicyRequest--; 476 buildCounterGetIamPolicyRequest--;
696 } 477 }
697 478
698 buildUnnamed2115() { 479 buildUnnamed2109() {
699 var o = new core.Map<core.String, core.String>(); 480 var o = new core.Map<core.String, core.String>();
700 o["x"] = "foo"; 481 o["x"] = "foo";
701 o["y"] = "foo"; 482 o["y"] = "foo";
702 return o; 483 return o;
703 } 484 }
704 485
705 checkUnnamed2115(core.Map<core.String, core.String> o) { 486 checkUnnamed2109(core.Map<core.String, core.String> o) {
706 unittest.expect(o, unittest.hasLength(2)); 487 unittest.expect(o, unittest.hasLength(2));
707 unittest.expect(o["x"], unittest.equals('foo')); 488 unittest.expect(o["x"], unittest.equals('foo'));
708 unittest.expect(o["y"], unittest.equals('foo')); 489 unittest.expect(o["y"], unittest.equals('foo'));
709 } 490 }
710 491
711 core.int buildCounterInstance = 0; 492 core.int buildCounterInstance = 0;
712 buildInstance() { 493 buildInstance() {
713 var o = new api.Instance(); 494 var o = new api.Instance();
714 buildCounterInstance++; 495 buildCounterInstance++;
715 if (buildCounterInstance < 3) { 496 if (buildCounterInstance < 3) {
716 o.config = "foo"; 497 o.config = "foo";
717 o.displayName = "foo"; 498 o.displayName = "foo";
718 o.labels = buildUnnamed2115(); 499 o.labels = buildUnnamed2109();
719 o.name = "foo"; 500 o.name = "foo";
720 o.nodeCount = 42; 501 o.nodeCount = 42;
721 o.state = "foo"; 502 o.state = "foo";
722 } 503 }
723 buildCounterInstance--; 504 buildCounterInstance--;
724 return o; 505 return o;
725 } 506 }
726 507
727 checkInstance(api.Instance o) { 508 checkInstance(api.Instance o) {
728 buildCounterInstance++; 509 buildCounterInstance++;
729 if (buildCounterInstance < 3) { 510 if (buildCounterInstance < 3) {
730 unittest.expect(o.config, unittest.equals('foo')); 511 unittest.expect(o.config, unittest.equals('foo'));
731 unittest.expect(o.displayName, unittest.equals('foo')); 512 unittest.expect(o.displayName, unittest.equals('foo'));
732 checkUnnamed2115(o.labels); 513 checkUnnamed2109(o.labels);
733 unittest.expect(o.name, unittest.equals('foo')); 514 unittest.expect(o.name, unittest.equals('foo'));
734 unittest.expect(o.nodeCount, unittest.equals(42)); 515 unittest.expect(o.nodeCount, unittest.equals(42));
735 unittest.expect(o.state, unittest.equals('foo')); 516 unittest.expect(o.state, unittest.equals('foo'));
736 } 517 }
737 buildCounterInstance--; 518 buildCounterInstance--;
738 } 519 }
739 520
740 core.int buildCounterInstanceConfig = 0; 521 core.int buildCounterInstanceConfig = 0;
741 buildInstanceConfig() { 522 buildInstanceConfig() {
742 var o = new api.InstanceConfig(); 523 var o = new api.InstanceConfig();
743 buildCounterInstanceConfig++; 524 buildCounterInstanceConfig++;
744 if (buildCounterInstanceConfig < 3) { 525 if (buildCounterInstanceConfig < 3) {
745 o.displayName = "foo"; 526 o.displayName = "foo";
746 o.name = "foo"; 527 o.name = "foo";
747 } 528 }
748 buildCounterInstanceConfig--; 529 buildCounterInstanceConfig--;
749 return o; 530 return o;
750 } 531 }
751 532
752 checkInstanceConfig(api.InstanceConfig o) { 533 checkInstanceConfig(api.InstanceConfig o) {
753 buildCounterInstanceConfig++; 534 buildCounterInstanceConfig++;
754 if (buildCounterInstanceConfig < 3) { 535 if (buildCounterInstanceConfig < 3) {
755 unittest.expect(o.displayName, unittest.equals('foo')); 536 unittest.expect(o.displayName, unittest.equals('foo'));
756 unittest.expect(o.name, unittest.equals('foo')); 537 unittest.expect(o.name, unittest.equals('foo'));
757 } 538 }
758 buildCounterInstanceConfig--; 539 buildCounterInstanceConfig--;
759 } 540 }
760 541
761 buildUnnamed2116() { 542 buildUnnamed2110() {
762 var o = new core.List<core.Object>(); 543 var o = new core.List<core.Object>();
763 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); 544 o.add({
764 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); 545 'list': [1, 2, 3],
546 'bool': true,
547 'string': 'foo'
548 });
549 o.add({
550 'list': [1, 2, 3],
551 'bool': true,
552 'string': 'foo'
553 });
765 return o; 554 return o;
766 } 555 }
767 556
768 checkUnnamed2116(core.List<core.Object> o) { 557 checkUnnamed2110(core.List<core.Object> o) {
769 unittest.expect(o, unittest.hasLength(2)); 558 unittest.expect(o, unittest.hasLength(2));
770 var casted3 = (o[0]) as core.Map; unittest.expect(casted3, unittest.hasLength( 3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.expe ct(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"], u nittest.equals('foo')); 559 var casted3 = (o[0]) as core.Map;
771 var casted4 = (o[1]) as core.Map; unittest.expect(casted4, unittest.hasLength( 3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.expe ct(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"], u nittest.equals('foo')); 560 unittest.expect(casted3, unittest.hasLength(3));
561 unittest.expect(casted3["list"], unittest.equals([1, 2, 3]));
562 unittest.expect(casted3["bool"], unittest.equals(true));
563 unittest.expect(casted3["string"], unittest.equals('foo'));
564 var casted4 = (o[1]) as core.Map;
565 unittest.expect(casted4, unittest.hasLength(3));
566 unittest.expect(casted4["list"], unittest.equals([1, 2, 3]));
567 unittest.expect(casted4["bool"], unittest.equals(true));
568 unittest.expect(casted4["string"], unittest.equals('foo'));
772 } 569 }
773 570
774 buildUnnamed2117() { 571 buildUnnamed2111() {
775 var o = new core.List<core.Object>(); 572 var o = new core.List<core.Object>();
776 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); 573 o.add({
777 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); 574 'list': [1, 2, 3],
575 'bool': true,
576 'string': 'foo'
577 });
578 o.add({
579 'list': [1, 2, 3],
580 'bool': true,
581 'string': 'foo'
582 });
778 return o; 583 return o;
779 } 584 }
780 585
781 checkUnnamed2117(core.List<core.Object> o) { 586 checkUnnamed2111(core.List<core.Object> o) {
782 unittest.expect(o, unittest.hasLength(2)); 587 unittest.expect(o, unittest.hasLength(2));
783 var casted5 = (o[0]) as core.Map; unittest.expect(casted5, unittest.hasLength( 3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.expe ct(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"], u nittest.equals('foo')); 588 var casted5 = (o[0]) as core.Map;
784 var casted6 = (o[1]) as core.Map; unittest.expect(casted6, unittest.hasLength( 3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.expe ct(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"], u nittest.equals('foo')); 589 unittest.expect(casted5, unittest.hasLength(3));
590 unittest.expect(casted5["list"], unittest.equals([1, 2, 3]));
591 unittest.expect(casted5["bool"], unittest.equals(true));
592 unittest.expect(casted5["string"], unittest.equals('foo'));
593 var casted6 = (o[1]) as core.Map;
594 unittest.expect(casted6, unittest.hasLength(3));
595 unittest.expect(casted6["list"], unittest.equals([1, 2, 3]));
596 unittest.expect(casted6["bool"], unittest.equals(true));
597 unittest.expect(casted6["string"], unittest.equals('foo'));
785 } 598 }
786 599
787 buildUnnamed2118() { 600 buildUnnamed2112() {
788 var o = new core.List<core.Object>(); 601 var o = new core.List<core.Object>();
789 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); 602 o.add({
790 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); 603 'list': [1, 2, 3],
604 'bool': true,
605 'string': 'foo'
606 });
607 o.add({
608 'list': [1, 2, 3],
609 'bool': true,
610 'string': 'foo'
611 });
791 return o; 612 return o;
792 } 613 }
793 614
794 checkUnnamed2118(core.List<core.Object> o) { 615 checkUnnamed2112(core.List<core.Object> o) {
795 unittest.expect(o, unittest.hasLength(2)); 616 unittest.expect(o, unittest.hasLength(2));
796 var casted7 = (o[0]) as core.Map; unittest.expect(casted7, unittest.hasLength( 3)); unittest.expect(casted7["list"], unittest.equals([1, 2, 3])); unittest.expe ct(casted7["bool"], unittest.equals(true)); unittest.expect(casted7["string"], u nittest.equals('foo')); 617 var casted7 = (o[0]) as core.Map;
797 var casted8 = (o[1]) as core.Map; unittest.expect(casted8, unittest.hasLength( 3)); unittest.expect(casted8["list"], unittest.equals([1, 2, 3])); unittest.expe ct(casted8["bool"], unittest.equals(true)); unittest.expect(casted8["string"], u nittest.equals('foo')); 618 unittest.expect(casted7, unittest.hasLength(3));
619 unittest.expect(casted7["list"], unittest.equals([1, 2, 3]));
620 unittest.expect(casted7["bool"], unittest.equals(true));
621 unittest.expect(casted7["string"], unittest.equals('foo'));
622 var casted8 = (o[1]) as core.Map;
623 unittest.expect(casted8, unittest.hasLength(3));
624 unittest.expect(casted8["list"], unittest.equals([1, 2, 3]));
625 unittest.expect(casted8["bool"], unittest.equals(true));
626 unittest.expect(casted8["string"], unittest.equals('foo'));
798 } 627 }
799 628
800 buildUnnamed2119() { 629 buildUnnamed2113() {
801 var o = new core.List<core.Object>(); 630 var o = new core.List<core.Object>();
802 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); 631 o.add({
803 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); 632 'list': [1, 2, 3],
633 'bool': true,
634 'string': 'foo'
635 });
636 o.add({
637 'list': [1, 2, 3],
638 'bool': true,
639 'string': 'foo'
640 });
804 return o; 641 return o;
805 } 642 }
806 643
807 checkUnnamed2119(core.List<core.Object> o) { 644 checkUnnamed2113(core.List<core.Object> o) {
808 unittest.expect(o, unittest.hasLength(2)); 645 unittest.expect(o, unittest.hasLength(2));
809 var casted9 = (o[0]) as core.Map; unittest.expect(casted9, unittest.hasLength( 3)); unittest.expect(casted9["list"], unittest.equals([1, 2, 3])); unittest.expe ct(casted9["bool"], unittest.equals(true)); unittest.expect(casted9["string"], u nittest.equals('foo')); 646 var casted9 = (o[0]) as core.Map;
810 var casted10 = (o[1]) as core.Map; unittest.expect(casted10, unittest.hasLengt h(3)); unittest.expect(casted10["list"], unittest.equals([1, 2, 3])); unittest.e xpect(casted10["bool"], unittest.equals(true)); unittest.expect(casted10["string "], unittest.equals('foo')); 647 unittest.expect(casted9, unittest.hasLength(3));
648 unittest.expect(casted9["list"], unittest.equals([1, 2, 3]));
649 unittest.expect(casted9["bool"], unittest.equals(true));
650 unittest.expect(casted9["string"], unittest.equals('foo'));
651 var casted10 = (o[1]) as core.Map;
652 unittest.expect(casted10, unittest.hasLength(3));
653 unittest.expect(casted10["list"], unittest.equals([1, 2, 3]));
654 unittest.expect(casted10["bool"], unittest.equals(true));
655 unittest.expect(casted10["string"], unittest.equals('foo'));
811 } 656 }
812 657
813 core.int buildCounterKeyRange = 0; 658 core.int buildCounterKeyRange = 0;
814 buildKeyRange() { 659 buildKeyRange() {
815 var o = new api.KeyRange(); 660 var o = new api.KeyRange();
816 buildCounterKeyRange++; 661 buildCounterKeyRange++;
817 if (buildCounterKeyRange < 3) { 662 if (buildCounterKeyRange < 3) {
818 o.endClosed = buildUnnamed2116(); 663 o.endClosed = buildUnnamed2110();
819 o.endOpen = buildUnnamed2117(); 664 o.endOpen = buildUnnamed2111();
820 o.startClosed = buildUnnamed2118(); 665 o.startClosed = buildUnnamed2112();
821 o.startOpen = buildUnnamed2119(); 666 o.startOpen = buildUnnamed2113();
822 } 667 }
823 buildCounterKeyRange--; 668 buildCounterKeyRange--;
824 return o; 669 return o;
825 } 670 }
826 671
827 checkKeyRange(api.KeyRange o) { 672 checkKeyRange(api.KeyRange o) {
828 buildCounterKeyRange++; 673 buildCounterKeyRange++;
829 if (buildCounterKeyRange < 3) { 674 if (buildCounterKeyRange < 3) {
830 checkUnnamed2116(o.endClosed); 675 checkUnnamed2110(o.endClosed);
831 checkUnnamed2117(o.endOpen); 676 checkUnnamed2111(o.endOpen);
832 checkUnnamed2118(o.startClosed); 677 checkUnnamed2112(o.startClosed);
833 checkUnnamed2119(o.startOpen); 678 checkUnnamed2113(o.startOpen);
834 } 679 }
835 buildCounterKeyRange--; 680 buildCounterKeyRange--;
836 } 681 }
837 682
838 buildUnnamed2120() { 683 buildUnnamed2114() {
839 var o = new core.List<core.Object>(); 684 var o = new core.List<core.Object>();
840 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); 685 o.add({
841 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); 686 'list': [1, 2, 3],
687 'bool': true,
688 'string': 'foo'
689 });
690 o.add({
691 'list': [1, 2, 3],
692 'bool': true,
693 'string': 'foo'
694 });
842 return o; 695 return o;
843 } 696 }
844 697
845 checkUnnamed2120(core.List<core.Object> o) { 698 checkUnnamed2114(core.List<core.Object> o) {
846 unittest.expect(o, unittest.hasLength(2)); 699 unittest.expect(o, unittest.hasLength(2));
847 var casted11 = (o[0]) as core.Map; unittest.expect(casted11, unittest.hasLengt h(3)); unittest.expect(casted11["list"], unittest.equals([1, 2, 3])); unittest.e xpect(casted11["bool"], unittest.equals(true)); unittest.expect(casted11["string "], unittest.equals('foo')); 700 var casted11 = (o[0]) as core.Map;
848 var casted12 = (o[1]) as core.Map; unittest.expect(casted12, unittest.hasLengt h(3)); unittest.expect(casted12["list"], unittest.equals([1, 2, 3])); unittest.e xpect(casted12["bool"], unittest.equals(true)); unittest.expect(casted12["string "], unittest.equals('foo')); 701 unittest.expect(casted11, unittest.hasLength(3));
702 unittest.expect(casted11["list"], unittest.equals([1, 2, 3]));
703 unittest.expect(casted11["bool"], unittest.equals(true));
704 unittest.expect(casted11["string"], unittest.equals('foo'));
705 var casted12 = (o[1]) as core.Map;
706 unittest.expect(casted12, unittest.hasLength(3));
707 unittest.expect(casted12["list"], unittest.equals([1, 2, 3]));
708 unittest.expect(casted12["bool"], unittest.equals(true));
709 unittest.expect(casted12["string"], unittest.equals('foo'));
849 } 710 }
850 711
851 buildUnnamed2121() { 712 buildUnnamed2115() {
852 var o = new core.List<core.List<core.Object>>(); 713 var o = new core.List<core.List<core.Object>>();
853 o.add(buildUnnamed2120()); 714 o.add(buildUnnamed2114());
854 o.add(buildUnnamed2120()); 715 o.add(buildUnnamed2114());
855 return o; 716 return o;
856 } 717 }
857 718
858 checkUnnamed2121(core.List<core.List<core.Object>> o) { 719 checkUnnamed2115(core.List<core.List<core.Object>> o) {
859 unittest.expect(o, unittest.hasLength(2)); 720 unittest.expect(o, unittest.hasLength(2));
860 checkUnnamed2120(o[0]); 721 checkUnnamed2114(o[0]);
861 checkUnnamed2120(o[1]); 722 checkUnnamed2114(o[1]);
862 } 723 }
863 724
864 buildUnnamed2122() { 725 buildUnnamed2116() {
865 var o = new core.List<api.KeyRange>(); 726 var o = new core.List<api.KeyRange>();
866 o.add(buildKeyRange()); 727 o.add(buildKeyRange());
867 o.add(buildKeyRange()); 728 o.add(buildKeyRange());
868 return o; 729 return o;
869 } 730 }
870 731
871 checkUnnamed2122(core.List<api.KeyRange> o) { 732 checkUnnamed2116(core.List<api.KeyRange> o) {
872 unittest.expect(o, unittest.hasLength(2)); 733 unittest.expect(o, unittest.hasLength(2));
873 checkKeyRange(o[0]); 734 checkKeyRange(o[0]);
874 checkKeyRange(o[1]); 735 checkKeyRange(o[1]);
875 } 736 }
876 737
877 core.int buildCounterKeySet = 0; 738 core.int buildCounterKeySet = 0;
878 buildKeySet() { 739 buildKeySet() {
879 var o = new api.KeySet(); 740 var o = new api.KeySet();
880 buildCounterKeySet++; 741 buildCounterKeySet++;
881 if (buildCounterKeySet < 3) { 742 if (buildCounterKeySet < 3) {
882 o.all = true; 743 o.all = true;
883 o.keys = buildUnnamed2121(); 744 o.keys = buildUnnamed2115();
884 o.ranges = buildUnnamed2122(); 745 o.ranges = buildUnnamed2116();
885 } 746 }
886 buildCounterKeySet--; 747 buildCounterKeySet--;
887 return o; 748 return o;
888 } 749 }
889 750
890 checkKeySet(api.KeySet o) { 751 checkKeySet(api.KeySet o) {
891 buildCounterKeySet++; 752 buildCounterKeySet++;
892 if (buildCounterKeySet < 3) { 753 if (buildCounterKeySet < 3) {
893 unittest.expect(o.all, unittest.isTrue); 754 unittest.expect(o.all, unittest.isTrue);
894 checkUnnamed2121(o.keys); 755 checkUnnamed2115(o.keys);
895 checkUnnamed2122(o.ranges); 756 checkUnnamed2116(o.ranges);
896 } 757 }
897 buildCounterKeySet--; 758 buildCounterKeySet--;
898 } 759 }
899 760
900 buildUnnamed2123() { 761 buildUnnamed2117() {
901 var o = new core.List<api.Database>(); 762 var o = new core.List<api.Database>();
902 o.add(buildDatabase()); 763 o.add(buildDatabase());
903 o.add(buildDatabase()); 764 o.add(buildDatabase());
904 return o; 765 return o;
905 } 766 }
906 767
907 checkUnnamed2123(core.List<api.Database> o) { 768 checkUnnamed2117(core.List<api.Database> o) {
908 unittest.expect(o, unittest.hasLength(2)); 769 unittest.expect(o, unittest.hasLength(2));
909 checkDatabase(o[0]); 770 checkDatabase(o[0]);
910 checkDatabase(o[1]); 771 checkDatabase(o[1]);
911 } 772 }
912 773
913 core.int buildCounterListDatabasesResponse = 0; 774 core.int buildCounterListDatabasesResponse = 0;
914 buildListDatabasesResponse() { 775 buildListDatabasesResponse() {
915 var o = new api.ListDatabasesResponse(); 776 var o = new api.ListDatabasesResponse();
916 buildCounterListDatabasesResponse++; 777 buildCounterListDatabasesResponse++;
917 if (buildCounterListDatabasesResponse < 3) { 778 if (buildCounterListDatabasesResponse < 3) {
918 o.databases = buildUnnamed2123(); 779 o.databases = buildUnnamed2117();
919 o.nextPageToken = "foo"; 780 o.nextPageToken = "foo";
920 } 781 }
921 buildCounterListDatabasesResponse--; 782 buildCounterListDatabasesResponse--;
922 return o; 783 return o;
923 } 784 }
924 785
925 checkListDatabasesResponse(api.ListDatabasesResponse o) { 786 checkListDatabasesResponse(api.ListDatabasesResponse o) {
926 buildCounterListDatabasesResponse++; 787 buildCounterListDatabasesResponse++;
927 if (buildCounterListDatabasesResponse < 3) { 788 if (buildCounterListDatabasesResponse < 3) {
928 checkUnnamed2123(o.databases); 789 checkUnnamed2117(o.databases);
929 unittest.expect(o.nextPageToken, unittest.equals('foo')); 790 unittest.expect(o.nextPageToken, unittest.equals('foo'));
930 } 791 }
931 buildCounterListDatabasesResponse--; 792 buildCounterListDatabasesResponse--;
932 } 793 }
933 794
934 buildUnnamed2124() { 795 buildUnnamed2118() {
935 var o = new core.List<api.InstanceConfig>(); 796 var o = new core.List<api.InstanceConfig>();
936 o.add(buildInstanceConfig()); 797 o.add(buildInstanceConfig());
937 o.add(buildInstanceConfig()); 798 o.add(buildInstanceConfig());
938 return o; 799 return o;
939 } 800 }
940 801
941 checkUnnamed2124(core.List<api.InstanceConfig> o) { 802 checkUnnamed2118(core.List<api.InstanceConfig> o) {
942 unittest.expect(o, unittest.hasLength(2)); 803 unittest.expect(o, unittest.hasLength(2));
943 checkInstanceConfig(o[0]); 804 checkInstanceConfig(o[0]);
944 checkInstanceConfig(o[1]); 805 checkInstanceConfig(o[1]);
945 } 806 }
946 807
947 core.int buildCounterListInstanceConfigsResponse = 0; 808 core.int buildCounterListInstanceConfigsResponse = 0;
948 buildListInstanceConfigsResponse() { 809 buildListInstanceConfigsResponse() {
949 var o = new api.ListInstanceConfigsResponse(); 810 var o = new api.ListInstanceConfigsResponse();
950 buildCounterListInstanceConfigsResponse++; 811 buildCounterListInstanceConfigsResponse++;
951 if (buildCounterListInstanceConfigsResponse < 3) { 812 if (buildCounterListInstanceConfigsResponse < 3) {
952 o.instanceConfigs = buildUnnamed2124(); 813 o.instanceConfigs = buildUnnamed2118();
953 o.nextPageToken = "foo"; 814 o.nextPageToken = "foo";
954 } 815 }
955 buildCounterListInstanceConfigsResponse--; 816 buildCounterListInstanceConfigsResponse--;
956 return o; 817 return o;
957 } 818 }
958 819
959 checkListInstanceConfigsResponse(api.ListInstanceConfigsResponse o) { 820 checkListInstanceConfigsResponse(api.ListInstanceConfigsResponse o) {
960 buildCounterListInstanceConfigsResponse++; 821 buildCounterListInstanceConfigsResponse++;
961 if (buildCounterListInstanceConfigsResponse < 3) { 822 if (buildCounterListInstanceConfigsResponse < 3) {
962 checkUnnamed2124(o.instanceConfigs); 823 checkUnnamed2118(o.instanceConfigs);
963 unittest.expect(o.nextPageToken, unittest.equals('foo')); 824 unittest.expect(o.nextPageToken, unittest.equals('foo'));
964 } 825 }
965 buildCounterListInstanceConfigsResponse--; 826 buildCounterListInstanceConfigsResponse--;
966 } 827 }
967 828
968 buildUnnamed2125() { 829 buildUnnamed2119() {
969 var o = new core.List<api.Instance>(); 830 var o = new core.List<api.Instance>();
970 o.add(buildInstance()); 831 o.add(buildInstance());
971 o.add(buildInstance()); 832 o.add(buildInstance());
972 return o; 833 return o;
973 } 834 }
974 835
975 checkUnnamed2125(core.List<api.Instance> o) { 836 checkUnnamed2119(core.List<api.Instance> o) {
976 unittest.expect(o, unittest.hasLength(2)); 837 unittest.expect(o, unittest.hasLength(2));
977 checkInstance(o[0]); 838 checkInstance(o[0]);
978 checkInstance(o[1]); 839 checkInstance(o[1]);
979 } 840 }
980 841
981 core.int buildCounterListInstancesResponse = 0; 842 core.int buildCounterListInstancesResponse = 0;
982 buildListInstancesResponse() { 843 buildListInstancesResponse() {
983 var o = new api.ListInstancesResponse(); 844 var o = new api.ListInstancesResponse();
984 buildCounterListInstancesResponse++; 845 buildCounterListInstancesResponse++;
985 if (buildCounterListInstancesResponse < 3) { 846 if (buildCounterListInstancesResponse < 3) {
986 o.instances = buildUnnamed2125(); 847 o.instances = buildUnnamed2119();
987 o.nextPageToken = "foo"; 848 o.nextPageToken = "foo";
988 } 849 }
989 buildCounterListInstancesResponse--; 850 buildCounterListInstancesResponse--;
990 return o; 851 return o;
991 } 852 }
992 853
993 checkListInstancesResponse(api.ListInstancesResponse o) { 854 checkListInstancesResponse(api.ListInstancesResponse o) {
994 buildCounterListInstancesResponse++; 855 buildCounterListInstancesResponse++;
995 if (buildCounterListInstancesResponse < 3) { 856 if (buildCounterListInstancesResponse < 3) {
996 checkUnnamed2125(o.instances); 857 checkUnnamed2119(o.instances);
997 unittest.expect(o.nextPageToken, unittest.equals('foo')); 858 unittest.expect(o.nextPageToken, unittest.equals('foo'));
998 } 859 }
999 buildCounterListInstancesResponse--; 860 buildCounterListInstancesResponse--;
1000 } 861 }
1001 862
1002 buildUnnamed2126() { 863 buildUnnamed2120() {
1003 var o = new core.List<api.Operation>(); 864 var o = new core.List<api.Operation>();
1004 o.add(buildOperation()); 865 o.add(buildOperation());
1005 o.add(buildOperation()); 866 o.add(buildOperation());
1006 return o; 867 return o;
1007 } 868 }
1008 869
1009 checkUnnamed2126(core.List<api.Operation> o) { 870 checkUnnamed2120(core.List<api.Operation> o) {
1010 unittest.expect(o, unittest.hasLength(2)); 871 unittest.expect(o, unittest.hasLength(2));
1011 checkOperation(o[0]); 872 checkOperation(o[0]);
1012 checkOperation(o[1]); 873 checkOperation(o[1]);
1013 } 874 }
1014 875
1015 core.int buildCounterListOperationsResponse = 0; 876 core.int buildCounterListOperationsResponse = 0;
1016 buildListOperationsResponse() { 877 buildListOperationsResponse() {
1017 var o = new api.ListOperationsResponse(); 878 var o = new api.ListOperationsResponse();
1018 buildCounterListOperationsResponse++; 879 buildCounterListOperationsResponse++;
1019 if (buildCounterListOperationsResponse < 3) { 880 if (buildCounterListOperationsResponse < 3) {
1020 o.nextPageToken = "foo"; 881 o.nextPageToken = "foo";
1021 o.operations = buildUnnamed2126(); 882 o.operations = buildUnnamed2120();
1022 } 883 }
1023 buildCounterListOperationsResponse--; 884 buildCounterListOperationsResponse--;
1024 return o; 885 return o;
1025 } 886 }
1026 887
1027 checkListOperationsResponse(api.ListOperationsResponse o) { 888 checkListOperationsResponse(api.ListOperationsResponse o) {
1028 buildCounterListOperationsResponse++; 889 buildCounterListOperationsResponse++;
1029 if (buildCounterListOperationsResponse < 3) { 890 if (buildCounterListOperationsResponse < 3) {
1030 unittest.expect(o.nextPageToken, unittest.equals('foo')); 891 unittest.expect(o.nextPageToken, unittest.equals('foo'));
1031 checkUnnamed2126(o.operations); 892 checkUnnamed2120(o.operations);
1032 } 893 }
1033 buildCounterListOperationsResponse--; 894 buildCounterListOperationsResponse--;
1034 } 895 }
1035 896
1036 core.int buildCounterLogConfig = 0;
1037 buildLogConfig() {
1038 var o = new api.LogConfig();
1039 buildCounterLogConfig++;
1040 if (buildCounterLogConfig < 3) {
1041 o.cloudAudit = buildCloudAuditOptions();
1042 o.counter = buildCounterOptions();
1043 o.dataAccess = buildDataAccessOptions();
1044 }
1045 buildCounterLogConfig--;
1046 return o;
1047 }
1048
1049 checkLogConfig(api.LogConfig o) {
1050 buildCounterLogConfig++;
1051 if (buildCounterLogConfig < 3) {
1052 checkCloudAuditOptions(o.cloudAudit);
1053 checkCounterOptions(o.counter);
1054 checkDataAccessOptions(o.dataAccess);
1055 }
1056 buildCounterLogConfig--;
1057 }
1058
1059 core.int buildCounterMutation = 0; 897 core.int buildCounterMutation = 0;
1060 buildMutation() { 898 buildMutation() {
1061 var o = new api.Mutation(); 899 var o = new api.Mutation();
1062 buildCounterMutation++; 900 buildCounterMutation++;
1063 if (buildCounterMutation < 3) { 901 if (buildCounterMutation < 3) {
1064 o.delete = buildDelete(); 902 o.delete = buildDelete();
1065 o.insert = buildWrite(); 903 o.insert = buildWrite();
1066 o.insertOrUpdate = buildWrite(); 904 o.insertOrUpdate = buildWrite();
1067 o.replace = buildWrite(); 905 o.replace = buildWrite();
1068 o.update = buildWrite(); 906 o.update = buildWrite();
1069 } 907 }
1070 buildCounterMutation--; 908 buildCounterMutation--;
1071 return o; 909 return o;
1072 } 910 }
1073 911
1074 checkMutation(api.Mutation o) { 912 checkMutation(api.Mutation o) {
1075 buildCounterMutation++; 913 buildCounterMutation++;
1076 if (buildCounterMutation < 3) { 914 if (buildCounterMutation < 3) {
1077 checkDelete(o.delete); 915 checkDelete(o.delete);
1078 checkWrite(o.insert); 916 checkWrite(o.insert);
1079 checkWrite(o.insertOrUpdate); 917 checkWrite(o.insertOrUpdate);
1080 checkWrite(o.replace); 918 checkWrite(o.replace);
1081 checkWrite(o.update); 919 checkWrite(o.update);
1082 } 920 }
1083 buildCounterMutation--; 921 buildCounterMutation--;
1084 } 922 }
1085 923
1086 buildUnnamed2127() { 924 buildUnnamed2121() {
1087 var o = new core.Map<core.String, core.Object>(); 925 var o = new core.Map<core.String, core.Object>();
1088 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 926 o["x"] = {
1089 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 927 'list': [1, 2, 3],
928 'bool': true,
929 'string': 'foo'
930 };
931 o["y"] = {
932 'list': [1, 2, 3],
933 'bool': true,
934 'string': 'foo'
935 };
1090 return o; 936 return o;
1091 } 937 }
1092 938
1093 checkUnnamed2127(core.Map<core.String, core.Object> o) { 939 checkUnnamed2121(core.Map<core.String, core.Object> o) {
1094 unittest.expect(o, unittest.hasLength(2)); 940 unittest.expect(o, unittest.hasLength(2));
1095 var casted13 = (o["x"]) as core.Map; unittest.expect(casted13, unittest.hasLen gth(3)); unittest.expect(casted13["list"], unittest.equals([1, 2, 3])); unittest .expect(casted13["bool"], unittest.equals(true)); unittest.expect(casted13["stri ng"], unittest.equals('foo')); 941 var casted13 = (o["x"]) as core.Map;
1096 var casted14 = (o["y"]) as core.Map; unittest.expect(casted14, unittest.hasLen gth(3)); unittest.expect(casted14["list"], unittest.equals([1, 2, 3])); unittest .expect(casted14["bool"], unittest.equals(true)); unittest.expect(casted14["stri ng"], unittest.equals('foo')); 942 unittest.expect(casted13, unittest.hasLength(3));
943 unittest.expect(casted13["list"], unittest.equals([1, 2, 3]));
944 unittest.expect(casted13["bool"], unittest.equals(true));
945 unittest.expect(casted13["string"], unittest.equals('foo'));
946 var casted14 = (o["y"]) as core.Map;
947 unittest.expect(casted14, unittest.hasLength(3));
948 unittest.expect(casted14["list"], unittest.equals([1, 2, 3]));
949 unittest.expect(casted14["bool"], unittest.equals(true));
950 unittest.expect(casted14["string"], unittest.equals('foo'));
1097 } 951 }
1098 952
1099 buildUnnamed2128() { 953 buildUnnamed2122() {
1100 var o = new core.Map<core.String, core.Object>(); 954 var o = new core.Map<core.String, core.Object>();
1101 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 955 o["x"] = {
1102 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 956 'list': [1, 2, 3],
957 'bool': true,
958 'string': 'foo'
959 };
960 o["y"] = {
961 'list': [1, 2, 3],
962 'bool': true,
963 'string': 'foo'
964 };
1103 return o; 965 return o;
1104 } 966 }
1105 967
1106 checkUnnamed2128(core.Map<core.String, core.Object> o) { 968 checkUnnamed2122(core.Map<core.String, core.Object> o) {
1107 unittest.expect(o, unittest.hasLength(2)); 969 unittest.expect(o, unittest.hasLength(2));
1108 var casted15 = (o["x"]) as core.Map; unittest.expect(casted15, unittest.hasLen gth(3)); unittest.expect(casted15["list"], unittest.equals([1, 2, 3])); unittest .expect(casted15["bool"], unittest.equals(true)); unittest.expect(casted15["stri ng"], unittest.equals('foo')); 970 var casted15 = (o["x"]) as core.Map;
1109 var casted16 = (o["y"]) as core.Map; unittest.expect(casted16, unittest.hasLen gth(3)); unittest.expect(casted16["list"], unittest.equals([1, 2, 3])); unittest .expect(casted16["bool"], unittest.equals(true)); unittest.expect(casted16["stri ng"], unittest.equals('foo')); 971 unittest.expect(casted15, unittest.hasLength(3));
972 unittest.expect(casted15["list"], unittest.equals([1, 2, 3]));
973 unittest.expect(casted15["bool"], unittest.equals(true));
974 unittest.expect(casted15["string"], unittest.equals('foo'));
975 var casted16 = (o["y"]) as core.Map;
976 unittest.expect(casted16, unittest.hasLength(3));
977 unittest.expect(casted16["list"], unittest.equals([1, 2, 3]));
978 unittest.expect(casted16["bool"], unittest.equals(true));
979 unittest.expect(casted16["string"], unittest.equals('foo'));
1110 } 980 }
1111 981
1112 core.int buildCounterOperation = 0; 982 core.int buildCounterOperation = 0;
1113 buildOperation() { 983 buildOperation() {
1114 var o = new api.Operation(); 984 var o = new api.Operation();
1115 buildCounterOperation++; 985 buildCounterOperation++;
1116 if (buildCounterOperation < 3) { 986 if (buildCounterOperation < 3) {
1117 o.done = true; 987 o.done = true;
1118 o.error = buildStatus(); 988 o.error = buildStatus();
1119 o.metadata = buildUnnamed2127(); 989 o.metadata = buildUnnamed2121();
1120 o.name = "foo"; 990 o.name = "foo";
1121 o.response = buildUnnamed2128(); 991 o.response = buildUnnamed2122();
1122 } 992 }
1123 buildCounterOperation--; 993 buildCounterOperation--;
1124 return o; 994 return o;
1125 } 995 }
1126 996
1127 checkOperation(api.Operation o) { 997 checkOperation(api.Operation o) {
1128 buildCounterOperation++; 998 buildCounterOperation++;
1129 if (buildCounterOperation < 3) { 999 if (buildCounterOperation < 3) {
1130 unittest.expect(o.done, unittest.isTrue); 1000 unittest.expect(o.done, unittest.isTrue);
1131 checkStatus(o.error); 1001 checkStatus(o.error);
1132 checkUnnamed2127(o.metadata); 1002 checkUnnamed2121(o.metadata);
1133 unittest.expect(o.name, unittest.equals('foo')); 1003 unittest.expect(o.name, unittest.equals('foo'));
1134 checkUnnamed2128(o.response); 1004 checkUnnamed2122(o.response);
1135 } 1005 }
1136 buildCounterOperation--; 1006 buildCounterOperation--;
1137 } 1007 }
1138 1008
1139 buildUnnamed2129() { 1009 buildUnnamed2123() {
1140 var o = new core.List<core.Object>(); 1010 var o = new core.List<core.Object>();
1141 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); 1011 o.add({
1142 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); 1012 'list': [1, 2, 3],
1013 'bool': true,
1014 'string': 'foo'
1015 });
1016 o.add({
1017 'list': [1, 2, 3],
1018 'bool': true,
1019 'string': 'foo'
1020 });
1143 return o; 1021 return o;
1144 } 1022 }
1145 1023
1146 checkUnnamed2129(core.List<core.Object> o) { 1024 checkUnnamed2123(core.List<core.Object> o) {
1147 unittest.expect(o, unittest.hasLength(2)); 1025 unittest.expect(o, unittest.hasLength(2));
1148 var casted17 = (o[0]) as core.Map; unittest.expect(casted17, unittest.hasLengt h(3)); unittest.expect(casted17["list"], unittest.equals([1, 2, 3])); unittest.e xpect(casted17["bool"], unittest.equals(true)); unittest.expect(casted17["string "], unittest.equals('foo')); 1026 var casted17 = (o[0]) as core.Map;
1149 var casted18 = (o[1]) as core.Map; unittest.expect(casted18, unittest.hasLengt h(3)); unittest.expect(casted18["list"], unittest.equals([1, 2, 3])); unittest.e xpect(casted18["bool"], unittest.equals(true)); unittest.expect(casted18["string "], unittest.equals('foo')); 1027 unittest.expect(casted17, unittest.hasLength(3));
1028 unittest.expect(casted17["list"], unittest.equals([1, 2, 3]));
1029 unittest.expect(casted17["bool"], unittest.equals(true));
1030 unittest.expect(casted17["string"], unittest.equals('foo'));
1031 var casted18 = (o[1]) as core.Map;
1032 unittest.expect(casted18, unittest.hasLength(3));
1033 unittest.expect(casted18["list"], unittest.equals([1, 2, 3]));
1034 unittest.expect(casted18["bool"], unittest.equals(true));
1035 unittest.expect(casted18["string"], unittest.equals('foo'));
1150 } 1036 }
1151 1037
1152 core.int buildCounterPartialResultSet = 0; 1038 core.int buildCounterPartialResultSet = 0;
1153 buildPartialResultSet() { 1039 buildPartialResultSet() {
1154 var o = new api.PartialResultSet(); 1040 var o = new api.PartialResultSet();
1155 buildCounterPartialResultSet++; 1041 buildCounterPartialResultSet++;
1156 if (buildCounterPartialResultSet < 3) { 1042 if (buildCounterPartialResultSet < 3) {
1157 o.chunkedValue = true; 1043 o.chunkedValue = true;
1158 o.metadata = buildResultSetMetadata(); 1044 o.metadata = buildResultSetMetadata();
1159 o.resumeToken = "foo"; 1045 o.resumeToken = "foo";
1160 o.stats = buildResultSetStats(); 1046 o.stats = buildResultSetStats();
1161 o.values = buildUnnamed2129(); 1047 o.values = buildUnnamed2123();
1162 } 1048 }
1163 buildCounterPartialResultSet--; 1049 buildCounterPartialResultSet--;
1164 return o; 1050 return o;
1165 } 1051 }
1166 1052
1167 checkPartialResultSet(api.PartialResultSet o) { 1053 checkPartialResultSet(api.PartialResultSet o) {
1168 buildCounterPartialResultSet++; 1054 buildCounterPartialResultSet++;
1169 if (buildCounterPartialResultSet < 3) { 1055 if (buildCounterPartialResultSet < 3) {
1170 unittest.expect(o.chunkedValue, unittest.isTrue); 1056 unittest.expect(o.chunkedValue, unittest.isTrue);
1171 checkResultSetMetadata(o.metadata); 1057 checkResultSetMetadata(o.metadata);
1172 unittest.expect(o.resumeToken, unittest.equals('foo')); 1058 unittest.expect(o.resumeToken, unittest.equals('foo'));
1173 checkResultSetStats(o.stats); 1059 checkResultSetStats(o.stats);
1174 checkUnnamed2129(o.values); 1060 checkUnnamed2123(o.values);
1175 } 1061 }
1176 buildCounterPartialResultSet--; 1062 buildCounterPartialResultSet--;
1177 } 1063 }
1178 1064
1179 buildUnnamed2130() { 1065 buildUnnamed2124() {
1180 var o = new core.List<api.ChildLink>(); 1066 var o = new core.List<api.ChildLink>();
1181 o.add(buildChildLink()); 1067 o.add(buildChildLink());
1182 o.add(buildChildLink()); 1068 o.add(buildChildLink());
1183 return o; 1069 return o;
1184 } 1070 }
1185 1071
1186 checkUnnamed2130(core.List<api.ChildLink> o) { 1072 checkUnnamed2124(core.List<api.ChildLink> o) {
1187 unittest.expect(o, unittest.hasLength(2)); 1073 unittest.expect(o, unittest.hasLength(2));
1188 checkChildLink(o[0]); 1074 checkChildLink(o[0]);
1189 checkChildLink(o[1]); 1075 checkChildLink(o[1]);
1190 } 1076 }
1191 1077
1192 buildUnnamed2131() { 1078 buildUnnamed2125() {
1193 var o = new core.Map<core.String, core.Object>(); 1079 var o = new core.Map<core.String, core.Object>();
1194 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 1080 o["x"] = {
1195 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 1081 'list': [1, 2, 3],
1082 'bool': true,
1083 'string': 'foo'
1084 };
1085 o["y"] = {
1086 'list': [1, 2, 3],
1087 'bool': true,
1088 'string': 'foo'
1089 };
1196 return o; 1090 return o;
1197 } 1091 }
1198 1092
1199 checkUnnamed2131(core.Map<core.String, core.Object> o) { 1093 checkUnnamed2125(core.Map<core.String, core.Object> o) {
1200 unittest.expect(o, unittest.hasLength(2)); 1094 unittest.expect(o, unittest.hasLength(2));
1201 var casted19 = (o["x"]) as core.Map; unittest.expect(casted19, unittest.hasLen gth(3)); unittest.expect(casted19["list"], unittest.equals([1, 2, 3])); unittest .expect(casted19["bool"], unittest.equals(true)); unittest.expect(casted19["stri ng"], unittest.equals('foo')); 1095 var casted19 = (o["x"]) as core.Map;
1202 var casted20 = (o["y"]) as core.Map; unittest.expect(casted20, unittest.hasLen gth(3)); unittest.expect(casted20["list"], unittest.equals([1, 2, 3])); unittest .expect(casted20["bool"], unittest.equals(true)); unittest.expect(casted20["stri ng"], unittest.equals('foo')); 1096 unittest.expect(casted19, unittest.hasLength(3));
1097 unittest.expect(casted19["list"], unittest.equals([1, 2, 3]));
1098 unittest.expect(casted19["bool"], unittest.equals(true));
1099 unittest.expect(casted19["string"], unittest.equals('foo'));
1100 var casted20 = (o["y"]) as core.Map;
1101 unittest.expect(casted20, unittest.hasLength(3));
1102 unittest.expect(casted20["list"], unittest.equals([1, 2, 3]));
1103 unittest.expect(casted20["bool"], unittest.equals(true));
1104 unittest.expect(casted20["string"], unittest.equals('foo'));
1203 } 1105 }
1204 1106
1205 buildUnnamed2132() { 1107 buildUnnamed2126() {
1206 var o = new core.Map<core.String, core.Object>(); 1108 var o = new core.Map<core.String, core.Object>();
1207 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 1109 o["x"] = {
1208 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 1110 'list': [1, 2, 3],
1111 'bool': true,
1112 'string': 'foo'
1113 };
1114 o["y"] = {
1115 'list': [1, 2, 3],
1116 'bool': true,
1117 'string': 'foo'
1118 };
1209 return o; 1119 return o;
1210 } 1120 }
1211 1121
1212 checkUnnamed2132(core.Map<core.String, core.Object> o) { 1122 checkUnnamed2126(core.Map<core.String, core.Object> o) {
1213 unittest.expect(o, unittest.hasLength(2)); 1123 unittest.expect(o, unittest.hasLength(2));
1214 var casted21 = (o["x"]) as core.Map; unittest.expect(casted21, unittest.hasLen gth(3)); unittest.expect(casted21["list"], unittest.equals([1, 2, 3])); unittest .expect(casted21["bool"], unittest.equals(true)); unittest.expect(casted21["stri ng"], unittest.equals('foo')); 1124 var casted21 = (o["x"]) as core.Map;
1215 var casted22 = (o["y"]) as core.Map; unittest.expect(casted22, unittest.hasLen gth(3)); unittest.expect(casted22["list"], unittest.equals([1, 2, 3])); unittest .expect(casted22["bool"], unittest.equals(true)); unittest.expect(casted22["stri ng"], unittest.equals('foo')); 1125 unittest.expect(casted21, unittest.hasLength(3));
1126 unittest.expect(casted21["list"], unittest.equals([1, 2, 3]));
1127 unittest.expect(casted21["bool"], unittest.equals(true));
1128 unittest.expect(casted21["string"], unittest.equals('foo'));
1129 var casted22 = (o["y"]) as core.Map;
1130 unittest.expect(casted22, unittest.hasLength(3));
1131 unittest.expect(casted22["list"], unittest.equals([1, 2, 3]));
1132 unittest.expect(casted22["bool"], unittest.equals(true));
1133 unittest.expect(casted22["string"], unittest.equals('foo'));
1216 } 1134 }
1217 1135
1218 core.int buildCounterPlanNode = 0; 1136 core.int buildCounterPlanNode = 0;
1219 buildPlanNode() { 1137 buildPlanNode() {
1220 var o = new api.PlanNode(); 1138 var o = new api.PlanNode();
1221 buildCounterPlanNode++; 1139 buildCounterPlanNode++;
1222 if (buildCounterPlanNode < 3) { 1140 if (buildCounterPlanNode < 3) {
1223 o.childLinks = buildUnnamed2130(); 1141 o.childLinks = buildUnnamed2124();
1224 o.displayName = "foo"; 1142 o.displayName = "foo";
1225 o.executionStats = buildUnnamed2131(); 1143 o.executionStats = buildUnnamed2125();
1226 o.index = 42; 1144 o.index = 42;
1227 o.kind = "foo"; 1145 o.kind = "foo";
1228 o.metadata = buildUnnamed2132(); 1146 o.metadata = buildUnnamed2126();
1229 o.shortRepresentation = buildShortRepresentation(); 1147 o.shortRepresentation = buildShortRepresentation();
1230 } 1148 }
1231 buildCounterPlanNode--; 1149 buildCounterPlanNode--;
1232 return o; 1150 return o;
1233 } 1151 }
1234 1152
1235 checkPlanNode(api.PlanNode o) { 1153 checkPlanNode(api.PlanNode o) {
1236 buildCounterPlanNode++; 1154 buildCounterPlanNode++;
1237 if (buildCounterPlanNode < 3) { 1155 if (buildCounterPlanNode < 3) {
1238 checkUnnamed2130(o.childLinks); 1156 checkUnnamed2124(o.childLinks);
1239 unittest.expect(o.displayName, unittest.equals('foo')); 1157 unittest.expect(o.displayName, unittest.equals('foo'));
1240 checkUnnamed2131(o.executionStats); 1158 checkUnnamed2125(o.executionStats);
1241 unittest.expect(o.index, unittest.equals(42)); 1159 unittest.expect(o.index, unittest.equals(42));
1242 unittest.expect(o.kind, unittest.equals('foo')); 1160 unittest.expect(o.kind, unittest.equals('foo'));
1243 checkUnnamed2132(o.metadata); 1161 checkUnnamed2126(o.metadata);
1244 checkShortRepresentation(o.shortRepresentation); 1162 checkShortRepresentation(o.shortRepresentation);
1245 } 1163 }
1246 buildCounterPlanNode--; 1164 buildCounterPlanNode--;
1247 } 1165 }
1248 1166
1249 buildUnnamed2133() { 1167 buildUnnamed2127() {
1250 var o = new core.List<api.AuditConfig>();
1251 o.add(buildAuditConfig());
1252 o.add(buildAuditConfig());
1253 return o;
1254 }
1255
1256 checkUnnamed2133(core.List<api.AuditConfig> o) {
1257 unittest.expect(o, unittest.hasLength(2));
1258 checkAuditConfig(o[0]);
1259 checkAuditConfig(o[1]);
1260 }
1261
1262 buildUnnamed2134() {
1263 var o = new core.List<api.Binding>(); 1168 var o = new core.List<api.Binding>();
1264 o.add(buildBinding()); 1169 o.add(buildBinding());
1265 o.add(buildBinding()); 1170 o.add(buildBinding());
1266 return o; 1171 return o;
1267 } 1172 }
1268 1173
1269 checkUnnamed2134(core.List<api.Binding> o) { 1174 checkUnnamed2127(core.List<api.Binding> o) {
1270 unittest.expect(o, unittest.hasLength(2)); 1175 unittest.expect(o, unittest.hasLength(2));
1271 checkBinding(o[0]); 1176 checkBinding(o[0]);
1272 checkBinding(o[1]); 1177 checkBinding(o[1]);
1273 } 1178 }
1274 1179
1275 buildUnnamed2135() {
1276 var o = new core.List<api.Rule>();
1277 o.add(buildRule());
1278 o.add(buildRule());
1279 return o;
1280 }
1281
1282 checkUnnamed2135(core.List<api.Rule> o) {
1283 unittest.expect(o, unittest.hasLength(2));
1284 checkRule(o[0]);
1285 checkRule(o[1]);
1286 }
1287
1288 core.int buildCounterPolicy = 0; 1180 core.int buildCounterPolicy = 0;
1289 buildPolicy() { 1181 buildPolicy() {
1290 var o = new api.Policy(); 1182 var o = new api.Policy();
1291 buildCounterPolicy++; 1183 buildCounterPolicy++;
1292 if (buildCounterPolicy < 3) { 1184 if (buildCounterPolicy < 3) {
1293 o.auditConfigs = buildUnnamed2133(); 1185 o.bindings = buildUnnamed2127();
1294 o.bindings = buildUnnamed2134();
1295 o.etag = "foo"; 1186 o.etag = "foo";
1296 o.iamOwned = true;
1297 o.rules = buildUnnamed2135();
1298 o.version = 42; 1187 o.version = 42;
1299 } 1188 }
1300 buildCounterPolicy--; 1189 buildCounterPolicy--;
1301 return o; 1190 return o;
1302 } 1191 }
1303 1192
1304 checkPolicy(api.Policy o) { 1193 checkPolicy(api.Policy o) {
1305 buildCounterPolicy++; 1194 buildCounterPolicy++;
1306 if (buildCounterPolicy < 3) { 1195 if (buildCounterPolicy < 3) {
1307 checkUnnamed2133(o.auditConfigs); 1196 checkUnnamed2127(o.bindings);
1308 checkUnnamed2134(o.bindings);
1309 unittest.expect(o.etag, unittest.equals('foo')); 1197 unittest.expect(o.etag, unittest.equals('foo'));
1310 unittest.expect(o.iamOwned, unittest.isTrue);
1311 checkUnnamed2135(o.rules);
1312 unittest.expect(o.version, unittest.equals(42)); 1198 unittest.expect(o.version, unittest.equals(42));
1313 } 1199 }
1314 buildCounterPolicy--; 1200 buildCounterPolicy--;
1315 } 1201 }
1316 1202
1317 buildUnnamed2136() { 1203 buildUnnamed2128() {
1318 var o = new core.List<api.PlanNode>(); 1204 var o = new core.List<api.PlanNode>();
1319 o.add(buildPlanNode()); 1205 o.add(buildPlanNode());
1320 o.add(buildPlanNode()); 1206 o.add(buildPlanNode());
1321 return o; 1207 return o;
1322 } 1208 }
1323 1209
1324 checkUnnamed2136(core.List<api.PlanNode> o) { 1210 checkUnnamed2128(core.List<api.PlanNode> o) {
1325 unittest.expect(o, unittest.hasLength(2)); 1211 unittest.expect(o, unittest.hasLength(2));
1326 checkPlanNode(o[0]); 1212 checkPlanNode(o[0]);
1327 checkPlanNode(o[1]); 1213 checkPlanNode(o[1]);
1328 } 1214 }
1329 1215
1330 core.int buildCounterQueryPlan = 0; 1216 core.int buildCounterQueryPlan = 0;
1331 buildQueryPlan() { 1217 buildQueryPlan() {
1332 var o = new api.QueryPlan(); 1218 var o = new api.QueryPlan();
1333 buildCounterQueryPlan++; 1219 buildCounterQueryPlan++;
1334 if (buildCounterQueryPlan < 3) { 1220 if (buildCounterQueryPlan < 3) {
1335 o.planNodes = buildUnnamed2136(); 1221 o.planNodes = buildUnnamed2128();
1336 } 1222 }
1337 buildCounterQueryPlan--; 1223 buildCounterQueryPlan--;
1338 return o; 1224 return o;
1339 } 1225 }
1340 1226
1341 checkQueryPlan(api.QueryPlan o) { 1227 checkQueryPlan(api.QueryPlan o) {
1342 buildCounterQueryPlan++; 1228 buildCounterQueryPlan++;
1343 if (buildCounterQueryPlan < 3) { 1229 if (buildCounterQueryPlan < 3) {
1344 checkUnnamed2136(o.planNodes); 1230 checkUnnamed2128(o.planNodes);
1345 } 1231 }
1346 buildCounterQueryPlan--; 1232 buildCounterQueryPlan--;
1347 } 1233 }
1348 1234
1349 core.int buildCounterReadOnly = 0; 1235 core.int buildCounterReadOnly = 0;
1350 buildReadOnly() { 1236 buildReadOnly() {
1351 var o = new api.ReadOnly(); 1237 var o = new api.ReadOnly();
1352 buildCounterReadOnly++; 1238 buildCounterReadOnly++;
1353 if (buildCounterReadOnly < 3) { 1239 if (buildCounterReadOnly < 3) {
1354 o.exactStaleness = "foo"; 1240 o.exactStaleness = "foo";
(...skipping 13 matching lines...) Expand all
1368 unittest.expect(o.exactStaleness, unittest.equals('foo')); 1254 unittest.expect(o.exactStaleness, unittest.equals('foo'));
1369 unittest.expect(o.maxStaleness, unittest.equals('foo')); 1255 unittest.expect(o.maxStaleness, unittest.equals('foo'));
1370 unittest.expect(o.minReadTimestamp, unittest.equals('foo')); 1256 unittest.expect(o.minReadTimestamp, unittest.equals('foo'));
1371 unittest.expect(o.readTimestamp, unittest.equals('foo')); 1257 unittest.expect(o.readTimestamp, unittest.equals('foo'));
1372 unittest.expect(o.returnReadTimestamp, unittest.isTrue); 1258 unittest.expect(o.returnReadTimestamp, unittest.isTrue);
1373 unittest.expect(o.strong, unittest.isTrue); 1259 unittest.expect(o.strong, unittest.isTrue);
1374 } 1260 }
1375 buildCounterReadOnly--; 1261 buildCounterReadOnly--;
1376 } 1262 }
1377 1263
1378 buildUnnamed2137() { 1264 buildUnnamed2129() {
1379 var o = new core.List<core.String>(); 1265 var o = new core.List<core.String>();
1380 o.add("foo"); 1266 o.add("foo");
1381 o.add("foo"); 1267 o.add("foo");
1382 return o; 1268 return o;
1383 } 1269 }
1384 1270
1385 checkUnnamed2137(core.List<core.String> o) { 1271 checkUnnamed2129(core.List<core.String> o) {
1386 unittest.expect(o, unittest.hasLength(2)); 1272 unittest.expect(o, unittest.hasLength(2));
1387 unittest.expect(o[0], unittest.equals('foo')); 1273 unittest.expect(o[0], unittest.equals('foo'));
1388 unittest.expect(o[1], unittest.equals('foo')); 1274 unittest.expect(o[1], unittest.equals('foo'));
1389 } 1275 }
1390 1276
1391 core.int buildCounterReadRequest = 0; 1277 core.int buildCounterReadRequest = 0;
1392 buildReadRequest() { 1278 buildReadRequest() {
1393 var o = new api.ReadRequest(); 1279 var o = new api.ReadRequest();
1394 buildCounterReadRequest++; 1280 buildCounterReadRequest++;
1395 if (buildCounterReadRequest < 3) { 1281 if (buildCounterReadRequest < 3) {
1396 o.columns = buildUnnamed2137(); 1282 o.columns = buildUnnamed2129();
1397 o.index = "foo"; 1283 o.index = "foo";
1398 o.keySet = buildKeySet(); 1284 o.keySet = buildKeySet();
1399 o.limit = "foo"; 1285 o.limit = "foo";
1400 o.resumeToken = "foo"; 1286 o.resumeToken = "foo";
1401 o.table = "foo"; 1287 o.table = "foo";
1402 o.transaction = buildTransactionSelector(); 1288 o.transaction = buildTransactionSelector();
1403 } 1289 }
1404 buildCounterReadRequest--; 1290 buildCounterReadRequest--;
1405 return o; 1291 return o;
1406 } 1292 }
1407 1293
1408 checkReadRequest(api.ReadRequest o) { 1294 checkReadRequest(api.ReadRequest o) {
1409 buildCounterReadRequest++; 1295 buildCounterReadRequest++;
1410 if (buildCounterReadRequest < 3) { 1296 if (buildCounterReadRequest < 3) {
1411 checkUnnamed2137(o.columns); 1297 checkUnnamed2129(o.columns);
1412 unittest.expect(o.index, unittest.equals('foo')); 1298 unittest.expect(o.index, unittest.equals('foo'));
1413 checkKeySet(o.keySet); 1299 checkKeySet(o.keySet);
1414 unittest.expect(o.limit, unittest.equals('foo')); 1300 unittest.expect(o.limit, unittest.equals('foo'));
1415 unittest.expect(o.resumeToken, unittest.equals('foo')); 1301 unittest.expect(o.resumeToken, unittest.equals('foo'));
1416 unittest.expect(o.table, unittest.equals('foo')); 1302 unittest.expect(o.table, unittest.equals('foo'));
1417 checkTransactionSelector(o.transaction); 1303 checkTransactionSelector(o.transaction);
1418 } 1304 }
1419 buildCounterReadRequest--; 1305 buildCounterReadRequest--;
1420 } 1306 }
1421 1307
1422 core.int buildCounterReadWrite = 0; 1308 core.int buildCounterReadWrite = 0;
1423 buildReadWrite() { 1309 buildReadWrite() {
1424 var o = new api.ReadWrite(); 1310 var o = new api.ReadWrite();
1425 buildCounterReadWrite++; 1311 buildCounterReadWrite++;
1426 if (buildCounterReadWrite < 3) { 1312 if (buildCounterReadWrite < 3) {}
1427 }
1428 buildCounterReadWrite--; 1313 buildCounterReadWrite--;
1429 return o; 1314 return o;
1430 } 1315 }
1431 1316
1432 checkReadWrite(api.ReadWrite o) { 1317 checkReadWrite(api.ReadWrite o) {
1433 buildCounterReadWrite++; 1318 buildCounterReadWrite++;
1434 if (buildCounterReadWrite < 3) { 1319 if (buildCounterReadWrite < 3) {}
1435 }
1436 buildCounterReadWrite--; 1320 buildCounterReadWrite--;
1437 } 1321 }
1438 1322
1439 buildUnnamed2138() { 1323 buildUnnamed2130() {
1440 var o = new core.List<core.Object>(); 1324 var o = new core.List<core.Object>();
1441 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); 1325 o.add({
1442 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); 1326 'list': [1, 2, 3],
1327 'bool': true,
1328 'string': 'foo'
1329 });
1330 o.add({
1331 'list': [1, 2, 3],
1332 'bool': true,
1333 'string': 'foo'
1334 });
1443 return o; 1335 return o;
1444 } 1336 }
1445 1337
1446 checkUnnamed2138(core.List<core.Object> o) { 1338 checkUnnamed2130(core.List<core.Object> o) {
1447 unittest.expect(o, unittest.hasLength(2)); 1339 unittest.expect(o, unittest.hasLength(2));
1448 var casted23 = (o[0]) as core.Map; unittest.expect(casted23, unittest.hasLengt h(3)); unittest.expect(casted23["list"], unittest.equals([1, 2, 3])); unittest.e xpect(casted23["bool"], unittest.equals(true)); unittest.expect(casted23["string "], unittest.equals('foo')); 1340 var casted23 = (o[0]) as core.Map;
1449 var casted24 = (o[1]) as core.Map; unittest.expect(casted24, unittest.hasLengt h(3)); unittest.expect(casted24["list"], unittest.equals([1, 2, 3])); unittest.e xpect(casted24["bool"], unittest.equals(true)); unittest.expect(casted24["string "], unittest.equals('foo')); 1341 unittest.expect(casted23, unittest.hasLength(3));
1342 unittest.expect(casted23["list"], unittest.equals([1, 2, 3]));
1343 unittest.expect(casted23["bool"], unittest.equals(true));
1344 unittest.expect(casted23["string"], unittest.equals('foo'));
1345 var casted24 = (o[1]) as core.Map;
1346 unittest.expect(casted24, unittest.hasLength(3));
1347 unittest.expect(casted24["list"], unittest.equals([1, 2, 3]));
1348 unittest.expect(casted24["bool"], unittest.equals(true));
1349 unittest.expect(casted24["string"], unittest.equals('foo'));
1450 } 1350 }
1451 1351
1452 buildUnnamed2139() { 1352 buildUnnamed2131() {
1453 var o = new core.List<core.List<core.Object>>(); 1353 var o = new core.List<core.List<core.Object>>();
1454 o.add(buildUnnamed2138()); 1354 o.add(buildUnnamed2130());
1455 o.add(buildUnnamed2138()); 1355 o.add(buildUnnamed2130());
1456 return o; 1356 return o;
1457 } 1357 }
1458 1358
1459 checkUnnamed2139(core.List<core.List<core.Object>> o) { 1359 checkUnnamed2131(core.List<core.List<core.Object>> o) {
1460 unittest.expect(o, unittest.hasLength(2)); 1360 unittest.expect(o, unittest.hasLength(2));
1461 checkUnnamed2138(o[0]); 1361 checkUnnamed2130(o[0]);
1462 checkUnnamed2138(o[1]); 1362 checkUnnamed2130(o[1]);
1463 } 1363 }
1464 1364
1465 core.int buildCounterResultSet = 0; 1365 core.int buildCounterResultSet = 0;
1466 buildResultSet() { 1366 buildResultSet() {
1467 var o = new api.ResultSet(); 1367 var o = new api.ResultSet();
1468 buildCounterResultSet++; 1368 buildCounterResultSet++;
1469 if (buildCounterResultSet < 3) { 1369 if (buildCounterResultSet < 3) {
1470 o.metadata = buildResultSetMetadata(); 1370 o.metadata = buildResultSetMetadata();
1471 o.rows = buildUnnamed2139(); 1371 o.rows = buildUnnamed2131();
1472 o.stats = buildResultSetStats(); 1372 o.stats = buildResultSetStats();
1473 } 1373 }
1474 buildCounterResultSet--; 1374 buildCounterResultSet--;
1475 return o; 1375 return o;
1476 } 1376 }
1477 1377
1478 checkResultSet(api.ResultSet o) { 1378 checkResultSet(api.ResultSet o) {
1479 buildCounterResultSet++; 1379 buildCounterResultSet++;
1480 if (buildCounterResultSet < 3) { 1380 if (buildCounterResultSet < 3) {
1481 checkResultSetMetadata(o.metadata); 1381 checkResultSetMetadata(o.metadata);
1482 checkUnnamed2139(o.rows); 1382 checkUnnamed2131(o.rows);
1483 checkResultSetStats(o.stats); 1383 checkResultSetStats(o.stats);
1484 } 1384 }
1485 buildCounterResultSet--; 1385 buildCounterResultSet--;
1486 } 1386 }
1487 1387
1488 core.int buildCounterResultSetMetadata = 0; 1388 core.int buildCounterResultSetMetadata = 0;
1489 buildResultSetMetadata() { 1389 buildResultSetMetadata() {
1490 var o = new api.ResultSetMetadata(); 1390 var o = new api.ResultSetMetadata();
1491 buildCounterResultSetMetadata++; 1391 buildCounterResultSetMetadata++;
1492 if (buildCounterResultSetMetadata < 3) { 1392 if (buildCounterResultSetMetadata < 3) {
1493 o.rowType = buildStructType(); 1393 o.rowType = buildStructType();
1494 o.transaction = buildTransaction(); 1394 o.transaction = buildTransaction();
1495 } 1395 }
1496 buildCounterResultSetMetadata--; 1396 buildCounterResultSetMetadata--;
1497 return o; 1397 return o;
1498 } 1398 }
1499 1399
1500 checkResultSetMetadata(api.ResultSetMetadata o) { 1400 checkResultSetMetadata(api.ResultSetMetadata o) {
1501 buildCounterResultSetMetadata++; 1401 buildCounterResultSetMetadata++;
1502 if (buildCounterResultSetMetadata < 3) { 1402 if (buildCounterResultSetMetadata < 3) {
1503 checkStructType(o.rowType); 1403 checkStructType(o.rowType);
1504 checkTransaction(o.transaction); 1404 checkTransaction(o.transaction);
1505 } 1405 }
1506 buildCounterResultSetMetadata--; 1406 buildCounterResultSetMetadata--;
1507 } 1407 }
1508 1408
1509 buildUnnamed2140() { 1409 buildUnnamed2132() {
1510 var o = new core.Map<core.String, core.Object>(); 1410 var o = new core.Map<core.String, core.Object>();
1511 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 1411 o["x"] = {
1512 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 1412 'list': [1, 2, 3],
1413 'bool': true,
1414 'string': 'foo'
1415 };
1416 o["y"] = {
1417 'list': [1, 2, 3],
1418 'bool': true,
1419 'string': 'foo'
1420 };
1513 return o; 1421 return o;
1514 } 1422 }
1515 1423
1516 checkUnnamed2140(core.Map<core.String, core.Object> o) { 1424 checkUnnamed2132(core.Map<core.String, core.Object> o) {
1517 unittest.expect(o, unittest.hasLength(2)); 1425 unittest.expect(o, unittest.hasLength(2));
1518 var casted25 = (o["x"]) as core.Map; unittest.expect(casted25, unittest.hasLen gth(3)); unittest.expect(casted25["list"], unittest.equals([1, 2, 3])); unittest .expect(casted25["bool"], unittest.equals(true)); unittest.expect(casted25["stri ng"], unittest.equals('foo')); 1426 var casted25 = (o["x"]) as core.Map;
1519 var casted26 = (o["y"]) as core.Map; unittest.expect(casted26, unittest.hasLen gth(3)); unittest.expect(casted26["list"], unittest.equals([1, 2, 3])); unittest .expect(casted26["bool"], unittest.equals(true)); unittest.expect(casted26["stri ng"], unittest.equals('foo')); 1427 unittest.expect(casted25, unittest.hasLength(3));
1428 unittest.expect(casted25["list"], unittest.equals([1, 2, 3]));
1429 unittest.expect(casted25["bool"], unittest.equals(true));
1430 unittest.expect(casted25["string"], unittest.equals('foo'));
1431 var casted26 = (o["y"]) as core.Map;
1432 unittest.expect(casted26, unittest.hasLength(3));
1433 unittest.expect(casted26["list"], unittest.equals([1, 2, 3]));
1434 unittest.expect(casted26["bool"], unittest.equals(true));
1435 unittest.expect(casted26["string"], unittest.equals('foo'));
1520 } 1436 }
1521 1437
1522 core.int buildCounterResultSetStats = 0; 1438 core.int buildCounterResultSetStats = 0;
1523 buildResultSetStats() { 1439 buildResultSetStats() {
1524 var o = new api.ResultSetStats(); 1440 var o = new api.ResultSetStats();
1525 buildCounterResultSetStats++; 1441 buildCounterResultSetStats++;
1526 if (buildCounterResultSetStats < 3) { 1442 if (buildCounterResultSetStats < 3) {
1527 o.queryPlan = buildQueryPlan(); 1443 o.queryPlan = buildQueryPlan();
1528 o.queryStats = buildUnnamed2140(); 1444 o.queryStats = buildUnnamed2132();
1529 } 1445 }
1530 buildCounterResultSetStats--; 1446 buildCounterResultSetStats--;
1531 return o; 1447 return o;
1532 } 1448 }
1533 1449
1534 checkResultSetStats(api.ResultSetStats o) { 1450 checkResultSetStats(api.ResultSetStats o) {
1535 buildCounterResultSetStats++; 1451 buildCounterResultSetStats++;
1536 if (buildCounterResultSetStats < 3) { 1452 if (buildCounterResultSetStats < 3) {
1537 checkQueryPlan(o.queryPlan); 1453 checkQueryPlan(o.queryPlan);
1538 checkUnnamed2140(o.queryStats); 1454 checkUnnamed2132(o.queryStats);
1539 } 1455 }
1540 buildCounterResultSetStats--; 1456 buildCounterResultSetStats--;
1541 } 1457 }
1542 1458
1543 core.int buildCounterRollbackRequest = 0; 1459 core.int buildCounterRollbackRequest = 0;
1544 buildRollbackRequest() { 1460 buildRollbackRequest() {
1545 var o = new api.RollbackRequest(); 1461 var o = new api.RollbackRequest();
1546 buildCounterRollbackRequest++; 1462 buildCounterRollbackRequest++;
1547 if (buildCounterRollbackRequest < 3) { 1463 if (buildCounterRollbackRequest < 3) {
1548 o.transactionId = "foo"; 1464 o.transactionId = "foo";
1549 } 1465 }
1550 buildCounterRollbackRequest--; 1466 buildCounterRollbackRequest--;
1551 return o; 1467 return o;
1552 } 1468 }
1553 1469
1554 checkRollbackRequest(api.RollbackRequest o) { 1470 checkRollbackRequest(api.RollbackRequest o) {
1555 buildCounterRollbackRequest++; 1471 buildCounterRollbackRequest++;
1556 if (buildCounterRollbackRequest < 3) { 1472 if (buildCounterRollbackRequest < 3) {
1557 unittest.expect(o.transactionId, unittest.equals('foo')); 1473 unittest.expect(o.transactionId, unittest.equals('foo'));
1558 } 1474 }
1559 buildCounterRollbackRequest--; 1475 buildCounterRollbackRequest--;
1560 } 1476 }
1561 1477
1562 buildUnnamed2141() {
1563 var o = new core.List<api.Condition>();
1564 o.add(buildCondition());
1565 o.add(buildCondition());
1566 return o;
1567 }
1568
1569 checkUnnamed2141(core.List<api.Condition> o) {
1570 unittest.expect(o, unittest.hasLength(2));
1571 checkCondition(o[0]);
1572 checkCondition(o[1]);
1573 }
1574
1575 buildUnnamed2142() {
1576 var o = new core.List<core.String>();
1577 o.add("foo");
1578 o.add("foo");
1579 return o;
1580 }
1581
1582 checkUnnamed2142(core.List<core.String> o) {
1583 unittest.expect(o, unittest.hasLength(2));
1584 unittest.expect(o[0], unittest.equals('foo'));
1585 unittest.expect(o[1], unittest.equals('foo'));
1586 }
1587
1588 buildUnnamed2143() {
1589 var o = new core.List<api.LogConfig>();
1590 o.add(buildLogConfig());
1591 o.add(buildLogConfig());
1592 return o;
1593 }
1594
1595 checkUnnamed2143(core.List<api.LogConfig> o) {
1596 unittest.expect(o, unittest.hasLength(2));
1597 checkLogConfig(o[0]);
1598 checkLogConfig(o[1]);
1599 }
1600
1601 buildUnnamed2144() {
1602 var o = new core.List<core.String>();
1603 o.add("foo");
1604 o.add("foo");
1605 return o;
1606 }
1607
1608 checkUnnamed2144(core.List<core.String> o) {
1609 unittest.expect(o, unittest.hasLength(2));
1610 unittest.expect(o[0], unittest.equals('foo'));
1611 unittest.expect(o[1], unittest.equals('foo'));
1612 }
1613
1614 buildUnnamed2145() {
1615 var o = new core.List<core.String>();
1616 o.add("foo");
1617 o.add("foo");
1618 return o;
1619 }
1620
1621 checkUnnamed2145(core.List<core.String> o) {
1622 unittest.expect(o, unittest.hasLength(2));
1623 unittest.expect(o[0], unittest.equals('foo'));
1624 unittest.expect(o[1], unittest.equals('foo'));
1625 }
1626
1627 core.int buildCounterRule = 0;
1628 buildRule() {
1629 var o = new api.Rule();
1630 buildCounterRule++;
1631 if (buildCounterRule < 3) {
1632 o.action = "foo";
1633 o.conditions = buildUnnamed2141();
1634 o.description = "foo";
1635 o.in_ = buildUnnamed2142();
1636 o.logConfig = buildUnnamed2143();
1637 o.notIn = buildUnnamed2144();
1638 o.permissions = buildUnnamed2145();
1639 }
1640 buildCounterRule--;
1641 return o;
1642 }
1643
1644 checkRule(api.Rule o) {
1645 buildCounterRule++;
1646 if (buildCounterRule < 3) {
1647 unittest.expect(o.action, unittest.equals('foo'));
1648 checkUnnamed2141(o.conditions);
1649 unittest.expect(o.description, unittest.equals('foo'));
1650 checkUnnamed2142(o.in_);
1651 checkUnnamed2143(o.logConfig);
1652 checkUnnamed2144(o.notIn);
1653 checkUnnamed2145(o.permissions);
1654 }
1655 buildCounterRule--;
1656 }
1657
1658 core.int buildCounterSession = 0; 1478 core.int buildCounterSession = 0;
1659 buildSession() { 1479 buildSession() {
1660 var o = new api.Session(); 1480 var o = new api.Session();
1661 buildCounterSession++; 1481 buildCounterSession++;
1662 if (buildCounterSession < 3) { 1482 if (buildCounterSession < 3) {
1663 o.name = "foo"; 1483 o.name = "foo";
1664 } 1484 }
1665 buildCounterSession--; 1485 buildCounterSession--;
1666 return o; 1486 return o;
1667 } 1487 }
1668 1488
1669 checkSession(api.Session o) { 1489 checkSession(api.Session o) {
1670 buildCounterSession++; 1490 buildCounterSession++;
1671 if (buildCounterSession < 3) { 1491 if (buildCounterSession < 3) {
1672 unittest.expect(o.name, unittest.equals('foo')); 1492 unittest.expect(o.name, unittest.equals('foo'));
1673 } 1493 }
1674 buildCounterSession--; 1494 buildCounterSession--;
1675 } 1495 }
1676 1496
1677 core.int buildCounterSetIamPolicyRequest = 0; 1497 core.int buildCounterSetIamPolicyRequest = 0;
1678 buildSetIamPolicyRequest() { 1498 buildSetIamPolicyRequest() {
1679 var o = new api.SetIamPolicyRequest(); 1499 var o = new api.SetIamPolicyRequest();
1680 buildCounterSetIamPolicyRequest++; 1500 buildCounterSetIamPolicyRequest++;
1681 if (buildCounterSetIamPolicyRequest < 3) { 1501 if (buildCounterSetIamPolicyRequest < 3) {
1682 o.policy = buildPolicy(); 1502 o.policy = buildPolicy();
1683 o.updateMask = "foo";
1684 } 1503 }
1685 buildCounterSetIamPolicyRequest--; 1504 buildCounterSetIamPolicyRequest--;
1686 return o; 1505 return o;
1687 } 1506 }
1688 1507
1689 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { 1508 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) {
1690 buildCounterSetIamPolicyRequest++; 1509 buildCounterSetIamPolicyRequest++;
1691 if (buildCounterSetIamPolicyRequest < 3) { 1510 if (buildCounterSetIamPolicyRequest < 3) {
1692 checkPolicy(o.policy); 1511 checkPolicy(o.policy);
1693 unittest.expect(o.updateMask, unittest.equals('foo'));
1694 } 1512 }
1695 buildCounterSetIamPolicyRequest--; 1513 buildCounterSetIamPolicyRequest--;
1696 } 1514 }
1697 1515
1698 buildUnnamed2146() { 1516 buildUnnamed2133() {
1699 var o = new core.Map<core.String, core.int>(); 1517 var o = new core.Map<core.String, core.int>();
1700 o["x"] = 42; 1518 o["x"] = 42;
1701 o["y"] = 42; 1519 o["y"] = 42;
1702 return o; 1520 return o;
1703 } 1521 }
1704 1522
1705 checkUnnamed2146(core.Map<core.String, core.int> o) { 1523 checkUnnamed2133(core.Map<core.String, core.int> o) {
1706 unittest.expect(o, unittest.hasLength(2)); 1524 unittest.expect(o, unittest.hasLength(2));
1707 unittest.expect(o["x"], unittest.equals(42)); 1525 unittest.expect(o["x"], unittest.equals(42));
1708 unittest.expect(o["y"], unittest.equals(42)); 1526 unittest.expect(o["y"], unittest.equals(42));
1709 } 1527 }
1710 1528
1711 core.int buildCounterShortRepresentation = 0; 1529 core.int buildCounterShortRepresentation = 0;
1712 buildShortRepresentation() { 1530 buildShortRepresentation() {
1713 var o = new api.ShortRepresentation(); 1531 var o = new api.ShortRepresentation();
1714 buildCounterShortRepresentation++; 1532 buildCounterShortRepresentation++;
1715 if (buildCounterShortRepresentation < 3) { 1533 if (buildCounterShortRepresentation < 3) {
1716 o.description = "foo"; 1534 o.description = "foo";
1717 o.subqueries = buildUnnamed2146(); 1535 o.subqueries = buildUnnamed2133();
1718 } 1536 }
1719 buildCounterShortRepresentation--; 1537 buildCounterShortRepresentation--;
1720 return o; 1538 return o;
1721 } 1539 }
1722 1540
1723 checkShortRepresentation(api.ShortRepresentation o) { 1541 checkShortRepresentation(api.ShortRepresentation o) {
1724 buildCounterShortRepresentation++; 1542 buildCounterShortRepresentation++;
1725 if (buildCounterShortRepresentation < 3) { 1543 if (buildCounterShortRepresentation < 3) {
1726 unittest.expect(o.description, unittest.equals('foo')); 1544 unittest.expect(o.description, unittest.equals('foo'));
1727 checkUnnamed2146(o.subqueries); 1545 checkUnnamed2133(o.subqueries);
1728 } 1546 }
1729 buildCounterShortRepresentation--; 1547 buildCounterShortRepresentation--;
1730 } 1548 }
1731 1549
1732 buildUnnamed2147() { 1550 buildUnnamed2134() {
1733 var o = new core.Map<core.String, core.Object>(); 1551 var o = new core.Map<core.String, core.Object>();
1734 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 1552 o["x"] = {
1735 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 1553 'list': [1, 2, 3],
1554 'bool': true,
1555 'string': 'foo'
1556 };
1557 o["y"] = {
1558 'list': [1, 2, 3],
1559 'bool': true,
1560 'string': 'foo'
1561 };
1736 return o; 1562 return o;
1737 } 1563 }
1738 1564
1739 checkUnnamed2147(core.Map<core.String, core.Object> o) { 1565 checkUnnamed2134(core.Map<core.String, core.Object> o) {
1740 unittest.expect(o, unittest.hasLength(2)); 1566 unittest.expect(o, unittest.hasLength(2));
1741 var casted27 = (o["x"]) as core.Map; unittest.expect(casted27, unittest.hasLen gth(3)); unittest.expect(casted27["list"], unittest.equals([1, 2, 3])); unittest .expect(casted27["bool"], unittest.equals(true)); unittest.expect(casted27["stri ng"], unittest.equals('foo')); 1567 var casted27 = (o["x"]) as core.Map;
1742 var casted28 = (o["y"]) as core.Map; unittest.expect(casted28, unittest.hasLen gth(3)); unittest.expect(casted28["list"], unittest.equals([1, 2, 3])); unittest .expect(casted28["bool"], unittest.equals(true)); unittest.expect(casted28["stri ng"], unittest.equals('foo')); 1568 unittest.expect(casted27, unittest.hasLength(3));
1569 unittest.expect(casted27["list"], unittest.equals([1, 2, 3]));
1570 unittest.expect(casted27["bool"], unittest.equals(true));
1571 unittest.expect(casted27["string"], unittest.equals('foo'));
1572 var casted28 = (o["y"]) as core.Map;
1573 unittest.expect(casted28, unittest.hasLength(3));
1574 unittest.expect(casted28["list"], unittest.equals([1, 2, 3]));
1575 unittest.expect(casted28["bool"], unittest.equals(true));
1576 unittest.expect(casted28["string"], unittest.equals('foo'));
1743 } 1577 }
1744 1578
1745 buildUnnamed2148() { 1579 buildUnnamed2135() {
1746 var o = new core.List<core.Map<core.String, core.Object>>(); 1580 var o = new core.List<core.Map<core.String, core.Object>>();
1747 o.add(buildUnnamed2147()); 1581 o.add(buildUnnamed2134());
1748 o.add(buildUnnamed2147()); 1582 o.add(buildUnnamed2134());
1749 return o; 1583 return o;
1750 } 1584 }
1751 1585
1752 checkUnnamed2148(core.List<core.Map<core.String, core.Object>> o) { 1586 checkUnnamed2135(core.List<core.Map<core.String, core.Object>> o) {
1753 unittest.expect(o, unittest.hasLength(2)); 1587 unittest.expect(o, unittest.hasLength(2));
1754 checkUnnamed2147(o[0]); 1588 checkUnnamed2134(o[0]);
1755 checkUnnamed2147(o[1]); 1589 checkUnnamed2134(o[1]);
1756 } 1590 }
1757 1591
1758 core.int buildCounterStatus = 0; 1592 core.int buildCounterStatus = 0;
1759 buildStatus() { 1593 buildStatus() {
1760 var o = new api.Status(); 1594 var o = new api.Status();
1761 buildCounterStatus++; 1595 buildCounterStatus++;
1762 if (buildCounterStatus < 3) { 1596 if (buildCounterStatus < 3) {
1763 o.code = 42; 1597 o.code = 42;
1764 o.details = buildUnnamed2148(); 1598 o.details = buildUnnamed2135();
1765 o.message = "foo"; 1599 o.message = "foo";
1766 } 1600 }
1767 buildCounterStatus--; 1601 buildCounterStatus--;
1768 return o; 1602 return o;
1769 } 1603 }
1770 1604
1771 checkStatus(api.Status o) { 1605 checkStatus(api.Status o) {
1772 buildCounterStatus++; 1606 buildCounterStatus++;
1773 if (buildCounterStatus < 3) { 1607 if (buildCounterStatus < 3) {
1774 unittest.expect(o.code, unittest.equals(42)); 1608 unittest.expect(o.code, unittest.equals(42));
1775 checkUnnamed2148(o.details); 1609 checkUnnamed2135(o.details);
1776 unittest.expect(o.message, unittest.equals('foo')); 1610 unittest.expect(o.message, unittest.equals('foo'));
1777 } 1611 }
1778 buildCounterStatus--; 1612 buildCounterStatus--;
1779 } 1613 }
1780 1614
1781 buildUnnamed2149() { 1615 buildUnnamed2136() {
1782 var o = new core.List<api.Field>(); 1616 var o = new core.List<api.Field>();
1783 o.add(buildField()); 1617 o.add(buildField());
1784 o.add(buildField()); 1618 o.add(buildField());
1785 return o; 1619 return o;
1786 } 1620 }
1787 1621
1788 checkUnnamed2149(core.List<api.Field> o) { 1622 checkUnnamed2136(core.List<api.Field> o) {
1789 unittest.expect(o, unittest.hasLength(2)); 1623 unittest.expect(o, unittest.hasLength(2));
1790 checkField(o[0]); 1624 checkField(o[0]);
1791 checkField(o[1]); 1625 checkField(o[1]);
1792 } 1626 }
1793 1627
1794 core.int buildCounterStructType = 0; 1628 core.int buildCounterStructType = 0;
1795 buildStructType() { 1629 buildStructType() {
1796 var o = new api.StructType(); 1630 var o = new api.StructType();
1797 buildCounterStructType++; 1631 buildCounterStructType++;
1798 if (buildCounterStructType < 3) { 1632 if (buildCounterStructType < 3) {
1799 o.fields = buildUnnamed2149(); 1633 o.fields = buildUnnamed2136();
1800 } 1634 }
1801 buildCounterStructType--; 1635 buildCounterStructType--;
1802 return o; 1636 return o;
1803 } 1637 }
1804 1638
1805 checkStructType(api.StructType o) { 1639 checkStructType(api.StructType o) {
1806 buildCounterStructType++; 1640 buildCounterStructType++;
1807 if (buildCounterStructType < 3) { 1641 if (buildCounterStructType < 3) {
1808 checkUnnamed2149(o.fields); 1642 checkUnnamed2136(o.fields);
1809 } 1643 }
1810 buildCounterStructType--; 1644 buildCounterStructType--;
1811 } 1645 }
1812 1646
1813 buildUnnamed2150() { 1647 buildUnnamed2137() {
1814 var o = new core.List<core.String>(); 1648 var o = new core.List<core.String>();
1815 o.add("foo"); 1649 o.add("foo");
1816 o.add("foo"); 1650 o.add("foo");
1817 return o; 1651 return o;
1818 } 1652 }
1819 1653
1820 checkUnnamed2150(core.List<core.String> o) { 1654 checkUnnamed2137(core.List<core.String> o) {
1821 unittest.expect(o, unittest.hasLength(2)); 1655 unittest.expect(o, unittest.hasLength(2));
1822 unittest.expect(o[0], unittest.equals('foo')); 1656 unittest.expect(o[0], unittest.equals('foo'));
1823 unittest.expect(o[1], unittest.equals('foo')); 1657 unittest.expect(o[1], unittest.equals('foo'));
1824 } 1658 }
1825 1659
1826 core.int buildCounterTestIamPermissionsRequest = 0; 1660 core.int buildCounterTestIamPermissionsRequest = 0;
1827 buildTestIamPermissionsRequest() { 1661 buildTestIamPermissionsRequest() {
1828 var o = new api.TestIamPermissionsRequest(); 1662 var o = new api.TestIamPermissionsRequest();
1829 buildCounterTestIamPermissionsRequest++; 1663 buildCounterTestIamPermissionsRequest++;
1830 if (buildCounterTestIamPermissionsRequest < 3) { 1664 if (buildCounterTestIamPermissionsRequest < 3) {
1831 o.permissions = buildUnnamed2150(); 1665 o.permissions = buildUnnamed2137();
1832 } 1666 }
1833 buildCounterTestIamPermissionsRequest--; 1667 buildCounterTestIamPermissionsRequest--;
1834 return o; 1668 return o;
1835 } 1669 }
1836 1670
1837 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { 1671 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) {
1838 buildCounterTestIamPermissionsRequest++; 1672 buildCounterTestIamPermissionsRequest++;
1839 if (buildCounterTestIamPermissionsRequest < 3) { 1673 if (buildCounterTestIamPermissionsRequest < 3) {
1840 checkUnnamed2150(o.permissions); 1674 checkUnnamed2137(o.permissions);
1841 } 1675 }
1842 buildCounterTestIamPermissionsRequest--; 1676 buildCounterTestIamPermissionsRequest--;
1843 } 1677 }
1844 1678
1845 buildUnnamed2151() { 1679 buildUnnamed2138() {
1846 var o = new core.List<core.String>(); 1680 var o = new core.List<core.String>();
1847 o.add("foo"); 1681 o.add("foo");
1848 o.add("foo"); 1682 o.add("foo");
1849 return o; 1683 return o;
1850 } 1684 }
1851 1685
1852 checkUnnamed2151(core.List<core.String> o) { 1686 checkUnnamed2138(core.List<core.String> o) {
1853 unittest.expect(o, unittest.hasLength(2)); 1687 unittest.expect(o, unittest.hasLength(2));
1854 unittest.expect(o[0], unittest.equals('foo')); 1688 unittest.expect(o[0], unittest.equals('foo'));
1855 unittest.expect(o[1], unittest.equals('foo')); 1689 unittest.expect(o[1], unittest.equals('foo'));
1856 } 1690 }
1857 1691
1858 core.int buildCounterTestIamPermissionsResponse = 0; 1692 core.int buildCounterTestIamPermissionsResponse = 0;
1859 buildTestIamPermissionsResponse() { 1693 buildTestIamPermissionsResponse() {
1860 var o = new api.TestIamPermissionsResponse(); 1694 var o = new api.TestIamPermissionsResponse();
1861 buildCounterTestIamPermissionsResponse++; 1695 buildCounterTestIamPermissionsResponse++;
1862 if (buildCounterTestIamPermissionsResponse < 3) { 1696 if (buildCounterTestIamPermissionsResponse < 3) {
1863 o.permissions = buildUnnamed2151(); 1697 o.permissions = buildUnnamed2138();
1864 } 1698 }
1865 buildCounterTestIamPermissionsResponse--; 1699 buildCounterTestIamPermissionsResponse--;
1866 return o; 1700 return o;
1867 } 1701 }
1868 1702
1869 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { 1703 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) {
1870 buildCounterTestIamPermissionsResponse++; 1704 buildCounterTestIamPermissionsResponse++;
1871 if (buildCounterTestIamPermissionsResponse < 3) { 1705 if (buildCounterTestIamPermissionsResponse < 3) {
1872 checkUnnamed2151(o.permissions); 1706 checkUnnamed2138(o.permissions);
1873 } 1707 }
1874 buildCounterTestIamPermissionsResponse--; 1708 buildCounterTestIamPermissionsResponse--;
1875 } 1709 }
1876 1710
1877 core.int buildCounterTransaction = 0; 1711 core.int buildCounterTransaction = 0;
1878 buildTransaction() { 1712 buildTransaction() {
1879 var o = new api.Transaction(); 1713 var o = new api.Transaction();
1880 buildCounterTransaction++; 1714 buildCounterTransaction++;
1881 if (buildCounterTransaction < 3) { 1715 if (buildCounterTransaction < 3) {
1882 o.id = "foo"; 1716 o.id = "foo";
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1955 checkType(api.Type o) { 1789 checkType(api.Type o) {
1956 buildCounterType++; 1790 buildCounterType++;
1957 if (buildCounterType < 3) { 1791 if (buildCounterType < 3) {
1958 checkType(o.arrayElementType); 1792 checkType(o.arrayElementType);
1959 unittest.expect(o.code, unittest.equals('foo')); 1793 unittest.expect(o.code, unittest.equals('foo'));
1960 checkStructType(o.structType); 1794 checkStructType(o.structType);
1961 } 1795 }
1962 buildCounterType--; 1796 buildCounterType--;
1963 } 1797 }
1964 1798
1965 buildUnnamed2152() { 1799 buildUnnamed2139() {
1966 var o = new core.List<core.String>(); 1800 var o = new core.List<core.String>();
1967 o.add("foo"); 1801 o.add("foo");
1968 o.add("foo"); 1802 o.add("foo");
1969 return o; 1803 return o;
1970 } 1804 }
1971 1805
1972 checkUnnamed2152(core.List<core.String> o) { 1806 checkUnnamed2139(core.List<core.String> o) {
1973 unittest.expect(o, unittest.hasLength(2)); 1807 unittest.expect(o, unittest.hasLength(2));
1974 unittest.expect(o[0], unittest.equals('foo')); 1808 unittest.expect(o[0], unittest.equals('foo'));
1975 unittest.expect(o[1], unittest.equals('foo')); 1809 unittest.expect(o[1], unittest.equals('foo'));
1976 } 1810 }
1977 1811
1978 buildUnnamed2153() { 1812 buildUnnamed2140() {
1979 var o = new core.List<core.String>(); 1813 var o = new core.List<core.String>();
1980 o.add("foo"); 1814 o.add("foo");
1981 o.add("foo"); 1815 o.add("foo");
1982 return o; 1816 return o;
1983 } 1817 }
1984 1818
1985 checkUnnamed2153(core.List<core.String> o) { 1819 checkUnnamed2140(core.List<core.String> o) {
1986 unittest.expect(o, unittest.hasLength(2)); 1820 unittest.expect(o, unittest.hasLength(2));
1987 unittest.expect(o[0], unittest.equals('foo')); 1821 unittest.expect(o[0], unittest.equals('foo'));
1988 unittest.expect(o[1], unittest.equals('foo')); 1822 unittest.expect(o[1], unittest.equals('foo'));
1989 } 1823 }
1990 1824
1991 core.int buildCounterUpdateDatabaseDdlMetadata = 0; 1825 core.int buildCounterUpdateDatabaseDdlMetadata = 0;
1992 buildUpdateDatabaseDdlMetadata() { 1826 buildUpdateDatabaseDdlMetadata() {
1993 var o = new api.UpdateDatabaseDdlMetadata(); 1827 var o = new api.UpdateDatabaseDdlMetadata();
1994 buildCounterUpdateDatabaseDdlMetadata++; 1828 buildCounterUpdateDatabaseDdlMetadata++;
1995 if (buildCounterUpdateDatabaseDdlMetadata < 3) { 1829 if (buildCounterUpdateDatabaseDdlMetadata < 3) {
1996 o.commitTimestamps = buildUnnamed2152(); 1830 o.commitTimestamps = buildUnnamed2139();
1997 o.database = "foo"; 1831 o.database = "foo";
1998 o.statements = buildUnnamed2153(); 1832 o.statements = buildUnnamed2140();
1999 } 1833 }
2000 buildCounterUpdateDatabaseDdlMetadata--; 1834 buildCounterUpdateDatabaseDdlMetadata--;
2001 return o; 1835 return o;
2002 } 1836 }
2003 1837
2004 checkUpdateDatabaseDdlMetadata(api.UpdateDatabaseDdlMetadata o) { 1838 checkUpdateDatabaseDdlMetadata(api.UpdateDatabaseDdlMetadata o) {
2005 buildCounterUpdateDatabaseDdlMetadata++; 1839 buildCounterUpdateDatabaseDdlMetadata++;
2006 if (buildCounterUpdateDatabaseDdlMetadata < 3) { 1840 if (buildCounterUpdateDatabaseDdlMetadata < 3) {
2007 checkUnnamed2152(o.commitTimestamps); 1841 checkUnnamed2139(o.commitTimestamps);
2008 unittest.expect(o.database, unittest.equals('foo')); 1842 unittest.expect(o.database, unittest.equals('foo'));
2009 checkUnnamed2153(o.statements); 1843 checkUnnamed2140(o.statements);
2010 } 1844 }
2011 buildCounterUpdateDatabaseDdlMetadata--; 1845 buildCounterUpdateDatabaseDdlMetadata--;
2012 } 1846 }
2013 1847
2014 buildUnnamed2154() { 1848 buildUnnamed2141() {
2015 var o = new core.List<core.String>(); 1849 var o = new core.List<core.String>();
2016 o.add("foo"); 1850 o.add("foo");
2017 o.add("foo"); 1851 o.add("foo");
2018 return o; 1852 return o;
2019 } 1853 }
2020 1854
2021 checkUnnamed2154(core.List<core.String> o) { 1855 checkUnnamed2141(core.List<core.String> o) {
2022 unittest.expect(o, unittest.hasLength(2)); 1856 unittest.expect(o, unittest.hasLength(2));
2023 unittest.expect(o[0], unittest.equals('foo')); 1857 unittest.expect(o[0], unittest.equals('foo'));
2024 unittest.expect(o[1], unittest.equals('foo')); 1858 unittest.expect(o[1], unittest.equals('foo'));
2025 } 1859 }
2026 1860
2027 core.int buildCounterUpdateDatabaseDdlRequest = 0; 1861 core.int buildCounterUpdateDatabaseDdlRequest = 0;
2028 buildUpdateDatabaseDdlRequest() { 1862 buildUpdateDatabaseDdlRequest() {
2029 var o = new api.UpdateDatabaseDdlRequest(); 1863 var o = new api.UpdateDatabaseDdlRequest();
2030 buildCounterUpdateDatabaseDdlRequest++; 1864 buildCounterUpdateDatabaseDdlRequest++;
2031 if (buildCounterUpdateDatabaseDdlRequest < 3) { 1865 if (buildCounterUpdateDatabaseDdlRequest < 3) {
2032 o.operationId = "foo"; 1866 o.operationId = "foo";
2033 o.statements = buildUnnamed2154(); 1867 o.statements = buildUnnamed2141();
2034 } 1868 }
2035 buildCounterUpdateDatabaseDdlRequest--; 1869 buildCounterUpdateDatabaseDdlRequest--;
2036 return o; 1870 return o;
2037 } 1871 }
2038 1872
2039 checkUpdateDatabaseDdlRequest(api.UpdateDatabaseDdlRequest o) { 1873 checkUpdateDatabaseDdlRequest(api.UpdateDatabaseDdlRequest o) {
2040 buildCounterUpdateDatabaseDdlRequest++; 1874 buildCounterUpdateDatabaseDdlRequest++;
2041 if (buildCounterUpdateDatabaseDdlRequest < 3) { 1875 if (buildCounterUpdateDatabaseDdlRequest < 3) {
2042 unittest.expect(o.operationId, unittest.equals('foo')); 1876 unittest.expect(o.operationId, unittest.equals('foo'));
2043 checkUnnamed2154(o.statements); 1877 checkUnnamed2141(o.statements);
2044 } 1878 }
2045 buildCounterUpdateDatabaseDdlRequest--; 1879 buildCounterUpdateDatabaseDdlRequest--;
2046 } 1880 }
2047 1881
2048 core.int buildCounterUpdateInstanceMetadata = 0; 1882 core.int buildCounterUpdateInstanceMetadata = 0;
2049 buildUpdateInstanceMetadata() { 1883 buildUpdateInstanceMetadata() {
2050 var o = new api.UpdateInstanceMetadata(); 1884 var o = new api.UpdateInstanceMetadata();
2051 buildCounterUpdateInstanceMetadata++; 1885 buildCounterUpdateInstanceMetadata++;
2052 if (buildCounterUpdateInstanceMetadata < 3) { 1886 if (buildCounterUpdateInstanceMetadata < 3) {
2053 o.cancelTime = "foo"; 1887 o.cancelTime = "foo";
(...skipping 30 matching lines...) Expand all
2084 1918
2085 checkUpdateInstanceRequest(api.UpdateInstanceRequest o) { 1919 checkUpdateInstanceRequest(api.UpdateInstanceRequest o) {
2086 buildCounterUpdateInstanceRequest++; 1920 buildCounterUpdateInstanceRequest++;
2087 if (buildCounterUpdateInstanceRequest < 3) { 1921 if (buildCounterUpdateInstanceRequest < 3) {
2088 unittest.expect(o.fieldMask, unittest.equals('foo')); 1922 unittest.expect(o.fieldMask, unittest.equals('foo'));
2089 checkInstance(o.instance); 1923 checkInstance(o.instance);
2090 } 1924 }
2091 buildCounterUpdateInstanceRequest--; 1925 buildCounterUpdateInstanceRequest--;
2092 } 1926 }
2093 1927
2094 buildUnnamed2155() { 1928 buildUnnamed2142() {
2095 var o = new core.List<core.String>(); 1929 var o = new core.List<core.String>();
2096 o.add("foo"); 1930 o.add("foo");
2097 o.add("foo"); 1931 o.add("foo");
2098 return o; 1932 return o;
2099 } 1933 }
2100 1934
2101 checkUnnamed2155(core.List<core.String> o) { 1935 checkUnnamed2142(core.List<core.String> o) {
2102 unittest.expect(o, unittest.hasLength(2)); 1936 unittest.expect(o, unittest.hasLength(2));
2103 unittest.expect(o[0], unittest.equals('foo')); 1937 unittest.expect(o[0], unittest.equals('foo'));
2104 unittest.expect(o[1], unittest.equals('foo')); 1938 unittest.expect(o[1], unittest.equals('foo'));
2105 } 1939 }
2106 1940
2107 buildUnnamed2156() { 1941 buildUnnamed2143() {
2108 var o = new core.List<core.Object>(); 1942 var o = new core.List<core.Object>();
2109 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); 1943 o.add({
2110 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); 1944 'list': [1, 2, 3],
1945 'bool': true,
1946 'string': 'foo'
1947 });
1948 o.add({
1949 'list': [1, 2, 3],
1950 'bool': true,
1951 'string': 'foo'
1952 });
2111 return o; 1953 return o;
2112 } 1954 }
2113 1955
2114 checkUnnamed2156(core.List<core.Object> o) { 1956 checkUnnamed2143(core.List<core.Object> o) {
2115 unittest.expect(o, unittest.hasLength(2)); 1957 unittest.expect(o, unittest.hasLength(2));
2116 var casted29 = (o[0]) as core.Map; unittest.expect(casted29, unittest.hasLengt h(3)); unittest.expect(casted29["list"], unittest.equals([1, 2, 3])); unittest.e xpect(casted29["bool"], unittest.equals(true)); unittest.expect(casted29["string "], unittest.equals('foo')); 1958 var casted29 = (o[0]) as core.Map;
2117 var casted30 = (o[1]) as core.Map; unittest.expect(casted30, unittest.hasLengt h(3)); unittest.expect(casted30["list"], unittest.equals([1, 2, 3])); unittest.e xpect(casted30["bool"], unittest.equals(true)); unittest.expect(casted30["string "], unittest.equals('foo')); 1959 unittest.expect(casted29, unittest.hasLength(3));
1960 unittest.expect(casted29["list"], unittest.equals([1, 2, 3]));
1961 unittest.expect(casted29["bool"], unittest.equals(true));
1962 unittest.expect(casted29["string"], unittest.equals('foo'));
1963 var casted30 = (o[1]) as core.Map;
1964 unittest.expect(casted30, unittest.hasLength(3));
1965 unittest.expect(casted30["list"], unittest.equals([1, 2, 3]));
1966 unittest.expect(casted30["bool"], unittest.equals(true));
1967 unittest.expect(casted30["string"], unittest.equals('foo'));
2118 } 1968 }
2119 1969
2120 buildUnnamed2157() { 1970 buildUnnamed2144() {
2121 var o = new core.List<core.List<core.Object>>(); 1971 var o = new core.List<core.List<core.Object>>();
2122 o.add(buildUnnamed2156()); 1972 o.add(buildUnnamed2143());
2123 o.add(buildUnnamed2156()); 1973 o.add(buildUnnamed2143());
2124 return o; 1974 return o;
2125 } 1975 }
2126 1976
2127 checkUnnamed2157(core.List<core.List<core.Object>> o) { 1977 checkUnnamed2144(core.List<core.List<core.Object>> o) {
2128 unittest.expect(o, unittest.hasLength(2)); 1978 unittest.expect(o, unittest.hasLength(2));
2129 checkUnnamed2156(o[0]); 1979 checkUnnamed2143(o[0]);
2130 checkUnnamed2156(o[1]); 1980 checkUnnamed2143(o[1]);
2131 } 1981 }
2132 1982
2133 core.int buildCounterWrite = 0; 1983 core.int buildCounterWrite = 0;
2134 buildWrite() { 1984 buildWrite() {
2135 var o = new api.Write(); 1985 var o = new api.Write();
2136 buildCounterWrite++; 1986 buildCounterWrite++;
2137 if (buildCounterWrite < 3) { 1987 if (buildCounterWrite < 3) {
2138 o.columns = buildUnnamed2155(); 1988 o.columns = buildUnnamed2142();
2139 o.table = "foo"; 1989 o.table = "foo";
2140 o.values = buildUnnamed2157(); 1990 o.values = buildUnnamed2144();
2141 } 1991 }
2142 buildCounterWrite--; 1992 buildCounterWrite--;
2143 return o; 1993 return o;
2144 } 1994 }
2145 1995
2146 checkWrite(api.Write o) { 1996 checkWrite(api.Write o) {
2147 buildCounterWrite++; 1997 buildCounterWrite++;
2148 if (buildCounterWrite < 3) { 1998 if (buildCounterWrite < 3) {
2149 checkUnnamed2155(o.columns); 1999 checkUnnamed2142(o.columns);
2150 unittest.expect(o.table, unittest.equals('foo')); 2000 unittest.expect(o.table, unittest.equals('foo'));
2151 checkUnnamed2157(o.values); 2001 checkUnnamed2144(o.values);
2152 } 2002 }
2153 buildCounterWrite--; 2003 buildCounterWrite--;
2154 } 2004 }
2155 2005
2156
2157 main() { 2006 main() {
2158 unittest.group("obj-schema-AuditConfig", () {
2159 unittest.test("to-json--from-json", () {
2160 var o = buildAuditConfig();
2161 var od = new api.AuditConfig.fromJson(o.toJson());
2162 checkAuditConfig(od);
2163 });
2164 });
2165
2166
2167 unittest.group("obj-schema-AuditLogConfig", () {
2168 unittest.test("to-json--from-json", () {
2169 var o = buildAuditLogConfig();
2170 var od = new api.AuditLogConfig.fromJson(o.toJson());
2171 checkAuditLogConfig(od);
2172 });
2173 });
2174
2175
2176 unittest.group("obj-schema-AuthorizationLoggingOptions", () {
2177 unittest.test("to-json--from-json", () {
2178 var o = buildAuthorizationLoggingOptions();
2179 var od = new api.AuthorizationLoggingOptions.fromJson(o.toJson());
2180 checkAuthorizationLoggingOptions(od);
2181 });
2182 });
2183
2184
2185 unittest.group("obj-schema-BeginTransactionRequest", () { 2007 unittest.group("obj-schema-BeginTransactionRequest", () {
2186 unittest.test("to-json--from-json", () { 2008 unittest.test("to-json--from-json", () {
2187 var o = buildBeginTransactionRequest(); 2009 var o = buildBeginTransactionRequest();
2188 var od = new api.BeginTransactionRequest.fromJson(o.toJson()); 2010 var od = new api.BeginTransactionRequest.fromJson(o.toJson());
2189 checkBeginTransactionRequest(od); 2011 checkBeginTransactionRequest(od);
2190 }); 2012 });
2191 }); 2013 });
2192 2014
2193
2194 unittest.group("obj-schema-Binding", () { 2015 unittest.group("obj-schema-Binding", () {
2195 unittest.test("to-json--from-json", () { 2016 unittest.test("to-json--from-json", () {
2196 var o = buildBinding(); 2017 var o = buildBinding();
2197 var od = new api.Binding.fromJson(o.toJson()); 2018 var od = new api.Binding.fromJson(o.toJson());
2198 checkBinding(od); 2019 checkBinding(od);
2199 }); 2020 });
2200 }); 2021 });
2201 2022
2202
2203 unittest.group("obj-schema-ChildLink", () { 2023 unittest.group("obj-schema-ChildLink", () {
2204 unittest.test("to-json--from-json", () { 2024 unittest.test("to-json--from-json", () {
2205 var o = buildChildLink(); 2025 var o = buildChildLink();
2206 var od = new api.ChildLink.fromJson(o.toJson()); 2026 var od = new api.ChildLink.fromJson(o.toJson());
2207 checkChildLink(od); 2027 checkChildLink(od);
2208 }); 2028 });
2209 }); 2029 });
2210 2030
2211
2212 unittest.group("obj-schema-CloudAuditOptions", () {
2213 unittest.test("to-json--from-json", () {
2214 var o = buildCloudAuditOptions();
2215 var od = new api.CloudAuditOptions.fromJson(o.toJson());
2216 checkCloudAuditOptions(od);
2217 });
2218 });
2219
2220
2221 unittest.group("obj-schema-CommitRequest", () { 2031 unittest.group("obj-schema-CommitRequest", () {
2222 unittest.test("to-json--from-json", () { 2032 unittest.test("to-json--from-json", () {
2223 var o = buildCommitRequest(); 2033 var o = buildCommitRequest();
2224 var od = new api.CommitRequest.fromJson(o.toJson()); 2034 var od = new api.CommitRequest.fromJson(o.toJson());
2225 checkCommitRequest(od); 2035 checkCommitRequest(od);
2226 }); 2036 });
2227 }); 2037 });
2228 2038
2229
2230 unittest.group("obj-schema-CommitResponse", () { 2039 unittest.group("obj-schema-CommitResponse", () {
2231 unittest.test("to-json--from-json", () { 2040 unittest.test("to-json--from-json", () {
2232 var o = buildCommitResponse(); 2041 var o = buildCommitResponse();
2233 var od = new api.CommitResponse.fromJson(o.toJson()); 2042 var od = new api.CommitResponse.fromJson(o.toJson());
2234 checkCommitResponse(od); 2043 checkCommitResponse(od);
2235 }); 2044 });
2236 }); 2045 });
2237 2046
2238
2239 unittest.group("obj-schema-Condition", () {
2240 unittest.test("to-json--from-json", () {
2241 var o = buildCondition();
2242 var od = new api.Condition.fromJson(o.toJson());
2243 checkCondition(od);
2244 });
2245 });
2246
2247
2248 unittest.group("obj-schema-CounterOptions", () {
2249 unittest.test("to-json--from-json", () {
2250 var o = buildCounterOptions();
2251 var od = new api.CounterOptions.fromJson(o.toJson());
2252 checkCounterOptions(od);
2253 });
2254 });
2255
2256
2257 unittest.group("obj-schema-CreateDatabaseMetadata", () { 2047 unittest.group("obj-schema-CreateDatabaseMetadata", () {
2258 unittest.test("to-json--from-json", () { 2048 unittest.test("to-json--from-json", () {
2259 var o = buildCreateDatabaseMetadata(); 2049 var o = buildCreateDatabaseMetadata();
2260 var od = new api.CreateDatabaseMetadata.fromJson(o.toJson()); 2050 var od = new api.CreateDatabaseMetadata.fromJson(o.toJson());
2261 checkCreateDatabaseMetadata(od); 2051 checkCreateDatabaseMetadata(od);
2262 }); 2052 });
2263 }); 2053 });
2264 2054
2265
2266 unittest.group("obj-schema-CreateDatabaseRequest", () { 2055 unittest.group("obj-schema-CreateDatabaseRequest", () {
2267 unittest.test("to-json--from-json", () { 2056 unittest.test("to-json--from-json", () {
2268 var o = buildCreateDatabaseRequest(); 2057 var o = buildCreateDatabaseRequest();
2269 var od = new api.CreateDatabaseRequest.fromJson(o.toJson()); 2058 var od = new api.CreateDatabaseRequest.fromJson(o.toJson());
2270 checkCreateDatabaseRequest(od); 2059 checkCreateDatabaseRequest(od);
2271 }); 2060 });
2272 }); 2061 });
2273 2062
2274
2275 unittest.group("obj-schema-CreateInstanceMetadata", () { 2063 unittest.group("obj-schema-CreateInstanceMetadata", () {
2276 unittest.test("to-json--from-json", () { 2064 unittest.test("to-json--from-json", () {
2277 var o = buildCreateInstanceMetadata(); 2065 var o = buildCreateInstanceMetadata();
2278 var od = new api.CreateInstanceMetadata.fromJson(o.toJson()); 2066 var od = new api.CreateInstanceMetadata.fromJson(o.toJson());
2279 checkCreateInstanceMetadata(od); 2067 checkCreateInstanceMetadata(od);
2280 }); 2068 });
2281 }); 2069 });
2282 2070
2283
2284 unittest.group("obj-schema-CreateInstanceRequest", () { 2071 unittest.group("obj-schema-CreateInstanceRequest", () {
2285 unittest.test("to-json--from-json", () { 2072 unittest.test("to-json--from-json", () {
2286 var o = buildCreateInstanceRequest(); 2073 var o = buildCreateInstanceRequest();
2287 var od = new api.CreateInstanceRequest.fromJson(o.toJson()); 2074 var od = new api.CreateInstanceRequest.fromJson(o.toJson());
2288 checkCreateInstanceRequest(od); 2075 checkCreateInstanceRequest(od);
2289 }); 2076 });
2290 }); 2077 });
2291 2078
2292
2293 unittest.group("obj-schema-DataAccessOptions", () {
2294 unittest.test("to-json--from-json", () {
2295 var o = buildDataAccessOptions();
2296 var od = new api.DataAccessOptions.fromJson(o.toJson());
2297 checkDataAccessOptions(od);
2298 });
2299 });
2300
2301
2302 unittest.group("obj-schema-Database", () { 2079 unittest.group("obj-schema-Database", () {
2303 unittest.test("to-json--from-json", () { 2080 unittest.test("to-json--from-json", () {
2304 var o = buildDatabase(); 2081 var o = buildDatabase();
2305 var od = new api.Database.fromJson(o.toJson()); 2082 var od = new api.Database.fromJson(o.toJson());
2306 checkDatabase(od); 2083 checkDatabase(od);
2307 }); 2084 });
2308 }); 2085 });
2309 2086
2310
2311 unittest.group("obj-schema-Delete", () { 2087 unittest.group("obj-schema-Delete", () {
2312 unittest.test("to-json--from-json", () { 2088 unittest.test("to-json--from-json", () {
2313 var o = buildDelete(); 2089 var o = buildDelete();
2314 var od = new api.Delete.fromJson(o.toJson()); 2090 var od = new api.Delete.fromJson(o.toJson());
2315 checkDelete(od); 2091 checkDelete(od);
2316 }); 2092 });
2317 }); 2093 });
2318 2094
2319
2320 unittest.group("obj-schema-Empty", () { 2095 unittest.group("obj-schema-Empty", () {
2321 unittest.test("to-json--from-json", () { 2096 unittest.test("to-json--from-json", () {
2322 var o = buildEmpty(); 2097 var o = buildEmpty();
2323 var od = new api.Empty.fromJson(o.toJson()); 2098 var od = new api.Empty.fromJson(o.toJson());
2324 checkEmpty(od); 2099 checkEmpty(od);
2325 }); 2100 });
2326 }); 2101 });
2327 2102
2328
2329 unittest.group("obj-schema-ExecuteSqlRequest", () { 2103 unittest.group("obj-schema-ExecuteSqlRequest", () {
2330 unittest.test("to-json--from-json", () { 2104 unittest.test("to-json--from-json", () {
2331 var o = buildExecuteSqlRequest(); 2105 var o = buildExecuteSqlRequest();
2332 var od = new api.ExecuteSqlRequest.fromJson(o.toJson()); 2106 var od = new api.ExecuteSqlRequest.fromJson(o.toJson());
2333 checkExecuteSqlRequest(od); 2107 checkExecuteSqlRequest(od);
2334 }); 2108 });
2335 }); 2109 });
2336 2110
2337
2338 unittest.group("obj-schema-Expr", () {
2339 unittest.test("to-json--from-json", () {
2340 var o = buildExpr();
2341 var od = new api.Expr.fromJson(o.toJson());
2342 checkExpr(od);
2343 });
2344 });
2345
2346
2347 unittest.group("obj-schema-Field", () { 2111 unittest.group("obj-schema-Field", () {
2348 unittest.test("to-json--from-json", () { 2112 unittest.test("to-json--from-json", () {
2349 var o = buildField(); 2113 var o = buildField();
2350 var od = new api.Field.fromJson(o.toJson()); 2114 var od = new api.Field.fromJson(o.toJson());
2351 checkField(od); 2115 checkField(od);
2352 }); 2116 });
2353 }); 2117 });
2354 2118
2355
2356 unittest.group("obj-schema-GetDatabaseDdlResponse", () { 2119 unittest.group("obj-schema-GetDatabaseDdlResponse", () {
2357 unittest.test("to-json--from-json", () { 2120 unittest.test("to-json--from-json", () {
2358 var o = buildGetDatabaseDdlResponse(); 2121 var o = buildGetDatabaseDdlResponse();
2359 var od = new api.GetDatabaseDdlResponse.fromJson(o.toJson()); 2122 var od = new api.GetDatabaseDdlResponse.fromJson(o.toJson());
2360 checkGetDatabaseDdlResponse(od); 2123 checkGetDatabaseDdlResponse(od);
2361 }); 2124 });
2362 }); 2125 });
2363 2126
2364
2365 unittest.group("obj-schema-GetIamPolicyRequest", () { 2127 unittest.group("obj-schema-GetIamPolicyRequest", () {
2366 unittest.test("to-json--from-json", () { 2128 unittest.test("to-json--from-json", () {
2367 var o = buildGetIamPolicyRequest(); 2129 var o = buildGetIamPolicyRequest();
2368 var od = new api.GetIamPolicyRequest.fromJson(o.toJson()); 2130 var od = new api.GetIamPolicyRequest.fromJson(o.toJson());
2369 checkGetIamPolicyRequest(od); 2131 checkGetIamPolicyRequest(od);
2370 }); 2132 });
2371 }); 2133 });
2372 2134
2373
2374 unittest.group("obj-schema-Instance", () { 2135 unittest.group("obj-schema-Instance", () {
2375 unittest.test("to-json--from-json", () { 2136 unittest.test("to-json--from-json", () {
2376 var o = buildInstance(); 2137 var o = buildInstance();
2377 var od = new api.Instance.fromJson(o.toJson()); 2138 var od = new api.Instance.fromJson(o.toJson());
2378 checkInstance(od); 2139 checkInstance(od);
2379 }); 2140 });
2380 }); 2141 });
2381 2142
2382
2383 unittest.group("obj-schema-InstanceConfig", () { 2143 unittest.group("obj-schema-InstanceConfig", () {
2384 unittest.test("to-json--from-json", () { 2144 unittest.test("to-json--from-json", () {
2385 var o = buildInstanceConfig(); 2145 var o = buildInstanceConfig();
2386 var od = new api.InstanceConfig.fromJson(o.toJson()); 2146 var od = new api.InstanceConfig.fromJson(o.toJson());
2387 checkInstanceConfig(od); 2147 checkInstanceConfig(od);
2388 }); 2148 });
2389 }); 2149 });
2390 2150
2391
2392 unittest.group("obj-schema-KeyRange", () { 2151 unittest.group("obj-schema-KeyRange", () {
2393 unittest.test("to-json--from-json", () { 2152 unittest.test("to-json--from-json", () {
2394 var o = buildKeyRange(); 2153 var o = buildKeyRange();
2395 var od = new api.KeyRange.fromJson(o.toJson()); 2154 var od = new api.KeyRange.fromJson(o.toJson());
2396 checkKeyRange(od); 2155 checkKeyRange(od);
2397 }); 2156 });
2398 }); 2157 });
2399 2158
2400
2401 unittest.group("obj-schema-KeySet", () { 2159 unittest.group("obj-schema-KeySet", () {
2402 unittest.test("to-json--from-json", () { 2160 unittest.test("to-json--from-json", () {
2403 var o = buildKeySet(); 2161 var o = buildKeySet();
2404 var od = new api.KeySet.fromJson(o.toJson()); 2162 var od = new api.KeySet.fromJson(o.toJson());
2405 checkKeySet(od); 2163 checkKeySet(od);
2406 }); 2164 });
2407 }); 2165 });
2408 2166
2409
2410 unittest.group("obj-schema-ListDatabasesResponse", () { 2167 unittest.group("obj-schema-ListDatabasesResponse", () {
2411 unittest.test("to-json--from-json", () { 2168 unittest.test("to-json--from-json", () {
2412 var o = buildListDatabasesResponse(); 2169 var o = buildListDatabasesResponse();
2413 var od = new api.ListDatabasesResponse.fromJson(o.toJson()); 2170 var od = new api.ListDatabasesResponse.fromJson(o.toJson());
2414 checkListDatabasesResponse(od); 2171 checkListDatabasesResponse(od);
2415 }); 2172 });
2416 }); 2173 });
2417 2174
2418
2419 unittest.group("obj-schema-ListInstanceConfigsResponse", () { 2175 unittest.group("obj-schema-ListInstanceConfigsResponse", () {
2420 unittest.test("to-json--from-json", () { 2176 unittest.test("to-json--from-json", () {
2421 var o = buildListInstanceConfigsResponse(); 2177 var o = buildListInstanceConfigsResponse();
2422 var od = new api.ListInstanceConfigsResponse.fromJson(o.toJson()); 2178 var od = new api.ListInstanceConfigsResponse.fromJson(o.toJson());
2423 checkListInstanceConfigsResponse(od); 2179 checkListInstanceConfigsResponse(od);
2424 }); 2180 });
2425 }); 2181 });
2426 2182
2427
2428 unittest.group("obj-schema-ListInstancesResponse", () { 2183 unittest.group("obj-schema-ListInstancesResponse", () {
2429 unittest.test("to-json--from-json", () { 2184 unittest.test("to-json--from-json", () {
2430 var o = buildListInstancesResponse(); 2185 var o = buildListInstancesResponse();
2431 var od = new api.ListInstancesResponse.fromJson(o.toJson()); 2186 var od = new api.ListInstancesResponse.fromJson(o.toJson());
2432 checkListInstancesResponse(od); 2187 checkListInstancesResponse(od);
2433 }); 2188 });
2434 }); 2189 });
2435 2190
2436
2437 unittest.group("obj-schema-ListOperationsResponse", () { 2191 unittest.group("obj-schema-ListOperationsResponse", () {
2438 unittest.test("to-json--from-json", () { 2192 unittest.test("to-json--from-json", () {
2439 var o = buildListOperationsResponse(); 2193 var o = buildListOperationsResponse();
2440 var od = new api.ListOperationsResponse.fromJson(o.toJson()); 2194 var od = new api.ListOperationsResponse.fromJson(o.toJson());
2441 checkListOperationsResponse(od); 2195 checkListOperationsResponse(od);
2442 }); 2196 });
2443 }); 2197 });
2444 2198
2445
2446 unittest.group("obj-schema-LogConfig", () {
2447 unittest.test("to-json--from-json", () {
2448 var o = buildLogConfig();
2449 var od = new api.LogConfig.fromJson(o.toJson());
2450 checkLogConfig(od);
2451 });
2452 });
2453
2454
2455 unittest.group("obj-schema-Mutation", () { 2199 unittest.group("obj-schema-Mutation", () {
2456 unittest.test("to-json--from-json", () { 2200 unittest.test("to-json--from-json", () {
2457 var o = buildMutation(); 2201 var o = buildMutation();
2458 var od = new api.Mutation.fromJson(o.toJson()); 2202 var od = new api.Mutation.fromJson(o.toJson());
2459 checkMutation(od); 2203 checkMutation(od);
2460 }); 2204 });
2461 }); 2205 });
2462 2206
2463
2464 unittest.group("obj-schema-Operation", () { 2207 unittest.group("obj-schema-Operation", () {
2465 unittest.test("to-json--from-json", () { 2208 unittest.test("to-json--from-json", () {
2466 var o = buildOperation(); 2209 var o = buildOperation();
2467 var od = new api.Operation.fromJson(o.toJson()); 2210 var od = new api.Operation.fromJson(o.toJson());
2468 checkOperation(od); 2211 checkOperation(od);
2469 }); 2212 });
2470 }); 2213 });
2471 2214
2472
2473 unittest.group("obj-schema-PartialResultSet", () { 2215 unittest.group("obj-schema-PartialResultSet", () {
2474 unittest.test("to-json--from-json", () { 2216 unittest.test("to-json--from-json", () {
2475 var o = buildPartialResultSet(); 2217 var o = buildPartialResultSet();
2476 var od = new api.PartialResultSet.fromJson(o.toJson()); 2218 var od = new api.PartialResultSet.fromJson(o.toJson());
2477 checkPartialResultSet(od); 2219 checkPartialResultSet(od);
2478 }); 2220 });
2479 }); 2221 });
2480 2222
2481
2482 unittest.group("obj-schema-PlanNode", () { 2223 unittest.group("obj-schema-PlanNode", () {
2483 unittest.test("to-json--from-json", () { 2224 unittest.test("to-json--from-json", () {
2484 var o = buildPlanNode(); 2225 var o = buildPlanNode();
2485 var od = new api.PlanNode.fromJson(o.toJson()); 2226 var od = new api.PlanNode.fromJson(o.toJson());
2486 checkPlanNode(od); 2227 checkPlanNode(od);
2487 }); 2228 });
2488 }); 2229 });
2489 2230
2490
2491 unittest.group("obj-schema-Policy", () { 2231 unittest.group("obj-schema-Policy", () {
2492 unittest.test("to-json--from-json", () { 2232 unittest.test("to-json--from-json", () {
2493 var o = buildPolicy(); 2233 var o = buildPolicy();
2494 var od = new api.Policy.fromJson(o.toJson()); 2234 var od = new api.Policy.fromJson(o.toJson());
2495 checkPolicy(od); 2235 checkPolicy(od);
2496 }); 2236 });
2497 }); 2237 });
2498 2238
2499
2500 unittest.group("obj-schema-QueryPlan", () { 2239 unittest.group("obj-schema-QueryPlan", () {
2501 unittest.test("to-json--from-json", () { 2240 unittest.test("to-json--from-json", () {
2502 var o = buildQueryPlan(); 2241 var o = buildQueryPlan();
2503 var od = new api.QueryPlan.fromJson(o.toJson()); 2242 var od = new api.QueryPlan.fromJson(o.toJson());
2504 checkQueryPlan(od); 2243 checkQueryPlan(od);
2505 }); 2244 });
2506 }); 2245 });
2507 2246
2508
2509 unittest.group("obj-schema-ReadOnly", () { 2247 unittest.group("obj-schema-ReadOnly", () {
2510 unittest.test("to-json--from-json", () { 2248 unittest.test("to-json--from-json", () {
2511 var o = buildReadOnly(); 2249 var o = buildReadOnly();
2512 var od = new api.ReadOnly.fromJson(o.toJson()); 2250 var od = new api.ReadOnly.fromJson(o.toJson());
2513 checkReadOnly(od); 2251 checkReadOnly(od);
2514 }); 2252 });
2515 }); 2253 });
2516 2254
2517
2518 unittest.group("obj-schema-ReadRequest", () { 2255 unittest.group("obj-schema-ReadRequest", () {
2519 unittest.test("to-json--from-json", () { 2256 unittest.test("to-json--from-json", () {
2520 var o = buildReadRequest(); 2257 var o = buildReadRequest();
2521 var od = new api.ReadRequest.fromJson(o.toJson()); 2258 var od = new api.ReadRequest.fromJson(o.toJson());
2522 checkReadRequest(od); 2259 checkReadRequest(od);
2523 }); 2260 });
2524 }); 2261 });
2525 2262
2526
2527 unittest.group("obj-schema-ReadWrite", () { 2263 unittest.group("obj-schema-ReadWrite", () {
2528 unittest.test("to-json--from-json", () { 2264 unittest.test("to-json--from-json", () {
2529 var o = buildReadWrite(); 2265 var o = buildReadWrite();
2530 var od = new api.ReadWrite.fromJson(o.toJson()); 2266 var od = new api.ReadWrite.fromJson(o.toJson());
2531 checkReadWrite(od); 2267 checkReadWrite(od);
2532 }); 2268 });
2533 }); 2269 });
2534 2270
2535
2536 unittest.group("obj-schema-ResultSet", () { 2271 unittest.group("obj-schema-ResultSet", () {
2537 unittest.test("to-json--from-json", () { 2272 unittest.test("to-json--from-json", () {
2538 var o = buildResultSet(); 2273 var o = buildResultSet();
2539 var od = new api.ResultSet.fromJson(o.toJson()); 2274 var od = new api.ResultSet.fromJson(o.toJson());
2540 checkResultSet(od); 2275 checkResultSet(od);
2541 }); 2276 });
2542 }); 2277 });
2543 2278
2544
2545 unittest.group("obj-schema-ResultSetMetadata", () { 2279 unittest.group("obj-schema-ResultSetMetadata", () {
2546 unittest.test("to-json--from-json", () { 2280 unittest.test("to-json--from-json", () {
2547 var o = buildResultSetMetadata(); 2281 var o = buildResultSetMetadata();
2548 var od = new api.ResultSetMetadata.fromJson(o.toJson()); 2282 var od = new api.ResultSetMetadata.fromJson(o.toJson());
2549 checkResultSetMetadata(od); 2283 checkResultSetMetadata(od);
2550 }); 2284 });
2551 }); 2285 });
2552 2286
2553
2554 unittest.group("obj-schema-ResultSetStats", () { 2287 unittest.group("obj-schema-ResultSetStats", () {
2555 unittest.test("to-json--from-json", () { 2288 unittest.test("to-json--from-json", () {
2556 var o = buildResultSetStats(); 2289 var o = buildResultSetStats();
2557 var od = new api.ResultSetStats.fromJson(o.toJson()); 2290 var od = new api.ResultSetStats.fromJson(o.toJson());
2558 checkResultSetStats(od); 2291 checkResultSetStats(od);
2559 }); 2292 });
2560 }); 2293 });
2561 2294
2562
2563 unittest.group("obj-schema-RollbackRequest", () { 2295 unittest.group("obj-schema-RollbackRequest", () {
2564 unittest.test("to-json--from-json", () { 2296 unittest.test("to-json--from-json", () {
2565 var o = buildRollbackRequest(); 2297 var o = buildRollbackRequest();
2566 var od = new api.RollbackRequest.fromJson(o.toJson()); 2298 var od = new api.RollbackRequest.fromJson(o.toJson());
2567 checkRollbackRequest(od); 2299 checkRollbackRequest(od);
2568 }); 2300 });
2569 }); 2301 });
2570 2302
2571
2572 unittest.group("obj-schema-Rule", () {
2573 unittest.test("to-json--from-json", () {
2574 var o = buildRule();
2575 var od = new api.Rule.fromJson(o.toJson());
2576 checkRule(od);
2577 });
2578 });
2579
2580
2581 unittest.group("obj-schema-Session", () { 2303 unittest.group("obj-schema-Session", () {
2582 unittest.test("to-json--from-json", () { 2304 unittest.test("to-json--from-json", () {
2583 var o = buildSession(); 2305 var o = buildSession();
2584 var od = new api.Session.fromJson(o.toJson()); 2306 var od = new api.Session.fromJson(o.toJson());
2585 checkSession(od); 2307 checkSession(od);
2586 }); 2308 });
2587 }); 2309 });
2588 2310
2589
2590 unittest.group("obj-schema-SetIamPolicyRequest", () { 2311 unittest.group("obj-schema-SetIamPolicyRequest", () {
2591 unittest.test("to-json--from-json", () { 2312 unittest.test("to-json--from-json", () {
2592 var o = buildSetIamPolicyRequest(); 2313 var o = buildSetIamPolicyRequest();
2593 var od = new api.SetIamPolicyRequest.fromJson(o.toJson()); 2314 var od = new api.SetIamPolicyRequest.fromJson(o.toJson());
2594 checkSetIamPolicyRequest(od); 2315 checkSetIamPolicyRequest(od);
2595 }); 2316 });
2596 }); 2317 });
2597 2318
2598
2599 unittest.group("obj-schema-ShortRepresentation", () { 2319 unittest.group("obj-schema-ShortRepresentation", () {
2600 unittest.test("to-json--from-json", () { 2320 unittest.test("to-json--from-json", () {
2601 var o = buildShortRepresentation(); 2321 var o = buildShortRepresentation();
2602 var od = new api.ShortRepresentation.fromJson(o.toJson()); 2322 var od = new api.ShortRepresentation.fromJson(o.toJson());
2603 checkShortRepresentation(od); 2323 checkShortRepresentation(od);
2604 }); 2324 });
2605 }); 2325 });
2606 2326
2607
2608 unittest.group("obj-schema-Status", () { 2327 unittest.group("obj-schema-Status", () {
2609 unittest.test("to-json--from-json", () { 2328 unittest.test("to-json--from-json", () {
2610 var o = buildStatus(); 2329 var o = buildStatus();
2611 var od = new api.Status.fromJson(o.toJson()); 2330 var od = new api.Status.fromJson(o.toJson());
2612 checkStatus(od); 2331 checkStatus(od);
2613 }); 2332 });
2614 }); 2333 });
2615 2334
2616
2617 unittest.group("obj-schema-StructType", () { 2335 unittest.group("obj-schema-StructType", () {
2618 unittest.test("to-json--from-json", () { 2336 unittest.test("to-json--from-json", () {
2619 var o = buildStructType(); 2337 var o = buildStructType();
2620 var od = new api.StructType.fromJson(o.toJson()); 2338 var od = new api.StructType.fromJson(o.toJson());
2621 checkStructType(od); 2339 checkStructType(od);
2622 }); 2340 });
2623 }); 2341 });
2624 2342
2625
2626 unittest.group("obj-schema-TestIamPermissionsRequest", () { 2343 unittest.group("obj-schema-TestIamPermissionsRequest", () {
2627 unittest.test("to-json--from-json", () { 2344 unittest.test("to-json--from-json", () {
2628 var o = buildTestIamPermissionsRequest(); 2345 var o = buildTestIamPermissionsRequest();
2629 var od = new api.TestIamPermissionsRequest.fromJson(o.toJson()); 2346 var od = new api.TestIamPermissionsRequest.fromJson(o.toJson());
2630 checkTestIamPermissionsRequest(od); 2347 checkTestIamPermissionsRequest(od);
2631 }); 2348 });
2632 }); 2349 });
2633 2350
2634
2635 unittest.group("obj-schema-TestIamPermissionsResponse", () { 2351 unittest.group("obj-schema-TestIamPermissionsResponse", () {
2636 unittest.test("to-json--from-json", () { 2352 unittest.test("to-json--from-json", () {
2637 var o = buildTestIamPermissionsResponse(); 2353 var o = buildTestIamPermissionsResponse();
2638 var od = new api.TestIamPermissionsResponse.fromJson(o.toJson()); 2354 var od = new api.TestIamPermissionsResponse.fromJson(o.toJson());
2639 checkTestIamPermissionsResponse(od); 2355 checkTestIamPermissionsResponse(od);
2640 }); 2356 });
2641 }); 2357 });
2642 2358
2643
2644 unittest.group("obj-schema-Transaction", () { 2359 unittest.group("obj-schema-Transaction", () {
2645 unittest.test("to-json--from-json", () { 2360 unittest.test("to-json--from-json", () {
2646 var o = buildTransaction(); 2361 var o = buildTransaction();
2647 var od = new api.Transaction.fromJson(o.toJson()); 2362 var od = new api.Transaction.fromJson(o.toJson());
2648 checkTransaction(od); 2363 checkTransaction(od);
2649 }); 2364 });
2650 }); 2365 });
2651 2366
2652
2653 unittest.group("obj-schema-TransactionOptions", () { 2367 unittest.group("obj-schema-TransactionOptions", () {
2654 unittest.test("to-json--from-json", () { 2368 unittest.test("to-json--from-json", () {
2655 var o = buildTransactionOptions(); 2369 var o = buildTransactionOptions();
2656 var od = new api.TransactionOptions.fromJson(o.toJson()); 2370 var od = new api.TransactionOptions.fromJson(o.toJson());
2657 checkTransactionOptions(od); 2371 checkTransactionOptions(od);
2658 }); 2372 });
2659 }); 2373 });
2660 2374
2661
2662 unittest.group("obj-schema-TransactionSelector", () { 2375 unittest.group("obj-schema-TransactionSelector", () {
2663 unittest.test("to-json--from-json", () { 2376 unittest.test("to-json--from-json", () {
2664 var o = buildTransactionSelector(); 2377 var o = buildTransactionSelector();
2665 var od = new api.TransactionSelector.fromJson(o.toJson()); 2378 var od = new api.TransactionSelector.fromJson(o.toJson());
2666 checkTransactionSelector(od); 2379 checkTransactionSelector(od);
2667 }); 2380 });
2668 }); 2381 });
2669 2382
2670
2671 unittest.group("obj-schema-Type", () { 2383 unittest.group("obj-schema-Type", () {
2672 unittest.test("to-json--from-json", () { 2384 unittest.test("to-json--from-json", () {
2673 var o = buildType(); 2385 var o = buildType();
2674 var od = new api.Type.fromJson(o.toJson()); 2386 var od = new api.Type.fromJson(o.toJson());
2675 checkType(od); 2387 checkType(od);
2676 }); 2388 });
2677 }); 2389 });
2678 2390
2679
2680 unittest.group("obj-schema-UpdateDatabaseDdlMetadata", () { 2391 unittest.group("obj-schema-UpdateDatabaseDdlMetadata", () {
2681 unittest.test("to-json--from-json", () { 2392 unittest.test("to-json--from-json", () {
2682 var o = buildUpdateDatabaseDdlMetadata(); 2393 var o = buildUpdateDatabaseDdlMetadata();
2683 var od = new api.UpdateDatabaseDdlMetadata.fromJson(o.toJson()); 2394 var od = new api.UpdateDatabaseDdlMetadata.fromJson(o.toJson());
2684 checkUpdateDatabaseDdlMetadata(od); 2395 checkUpdateDatabaseDdlMetadata(od);
2685 }); 2396 });
2686 }); 2397 });
2687 2398
2688
2689 unittest.group("obj-schema-UpdateDatabaseDdlRequest", () { 2399 unittest.group("obj-schema-UpdateDatabaseDdlRequest", () {
2690 unittest.test("to-json--from-json", () { 2400 unittest.test("to-json--from-json", () {
2691 var o = buildUpdateDatabaseDdlRequest(); 2401 var o = buildUpdateDatabaseDdlRequest();
2692 var od = new api.UpdateDatabaseDdlRequest.fromJson(o.toJson()); 2402 var od = new api.UpdateDatabaseDdlRequest.fromJson(o.toJson());
2693 checkUpdateDatabaseDdlRequest(od); 2403 checkUpdateDatabaseDdlRequest(od);
2694 }); 2404 });
2695 }); 2405 });
2696 2406
2697
2698 unittest.group("obj-schema-UpdateInstanceMetadata", () { 2407 unittest.group("obj-schema-UpdateInstanceMetadata", () {
2699 unittest.test("to-json--from-json", () { 2408 unittest.test("to-json--from-json", () {
2700 var o = buildUpdateInstanceMetadata(); 2409 var o = buildUpdateInstanceMetadata();
2701 var od = new api.UpdateInstanceMetadata.fromJson(o.toJson()); 2410 var od = new api.UpdateInstanceMetadata.fromJson(o.toJson());
2702 checkUpdateInstanceMetadata(od); 2411 checkUpdateInstanceMetadata(od);
2703 }); 2412 });
2704 }); 2413 });
2705 2414
2706
2707 unittest.group("obj-schema-UpdateInstanceRequest", () { 2415 unittest.group("obj-schema-UpdateInstanceRequest", () {
2708 unittest.test("to-json--from-json", () { 2416 unittest.test("to-json--from-json", () {
2709 var o = buildUpdateInstanceRequest(); 2417 var o = buildUpdateInstanceRequest();
2710 var od = new api.UpdateInstanceRequest.fromJson(o.toJson()); 2418 var od = new api.UpdateInstanceRequest.fromJson(o.toJson());
2711 checkUpdateInstanceRequest(od); 2419 checkUpdateInstanceRequest(od);
2712 }); 2420 });
2713 }); 2421 });
2714 2422
2715
2716 unittest.group("obj-schema-Write", () { 2423 unittest.group("obj-schema-Write", () {
2717 unittest.test("to-json--from-json", () { 2424 unittest.test("to-json--from-json", () {
2718 var o = buildWrite(); 2425 var o = buildWrite();
2719 var od = new api.Write.fromJson(o.toJson()); 2426 var od = new api.Write.fromJson(o.toJson());
2720 checkWrite(od); 2427 checkWrite(od);
2721 }); 2428 });
2722 }); 2429 });
2723 2430
2724
2725 unittest.group("resource-ProjectsInstanceConfigsResourceApi", () { 2431 unittest.group("resource-ProjectsInstanceConfigsResourceApi", () {
2726 unittest.test("method--get", () { 2432 unittest.test("method--get", () {
2727
2728 var mock = new HttpServerMock(); 2433 var mock = new HttpServerMock();
2729 api.ProjectsInstanceConfigsResourceApi res = new api.SpannerApi(mock).proj ects.instanceConfigs; 2434 api.ProjectsInstanceConfigsResourceApi res =
2435 new api.SpannerApi(mock).projects.instanceConfigs;
2730 var arg_name = "foo"; 2436 var arg_name = "foo";
2731 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2437 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2732 var path = (req.url).path; 2438 var path = (req.url).path;
2733 var pathOffset = 0; 2439 var pathOffset = 0;
2734 var index; 2440 var index;
2735 var subPart; 2441 var subPart;
2736 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2442 unittest.expect(
2443 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2737 pathOffset += 1; 2444 pathOffset += 1;
2738 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 2445 unittest.expect(
2446 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
2739 pathOffset += 3; 2447 pathOffset += 3;
2740 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 2448 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
2741 2449
2742 var query = (req.url).query; 2450 var query = (req.url).query;
2743 var queryOffset = 0; 2451 var queryOffset = 0;
2744 var queryMap = {}; 2452 var queryMap = {};
2745 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2453 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2746 parseBool(n) { 2454 parseBool(n) {
2747 if (n == "true") return true; 2455 if (n == "true") return true;
2748 if (n == "false") return false; 2456 if (n == "false") return false;
2749 if (n == null) return null; 2457 if (n == null) return null;
2750 throw new core.ArgumentError("Invalid boolean: $n"); 2458 throw new core.ArgumentError("Invalid boolean: $n");
2751 } 2459 }
2460
2752 if (query.length > 0) { 2461 if (query.length > 0) {
2753 for (var part in query.split("&")) { 2462 for (var part in query.split("&")) {
2754 var keyvalue = part.split("="); 2463 var keyvalue = part.split("=");
2755 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2464 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2465 core.Uri.decodeQueryComponent(keyvalue[1]));
2756 } 2466 }
2757 } 2467 }
2758 2468
2759
2760 var h = { 2469 var h = {
2761 "content-type" : "application/json; charset=utf-8", 2470 "content-type": "application/json; charset=utf-8",
2762 }; 2471 };
2763 var resp = convert.JSON.encode(buildInstanceConfig()); 2472 var resp = convert.JSON.encode(buildInstanceConfig());
2764 return new async.Future.value(stringResponse(200, h, resp)); 2473 return new async.Future.value(stringResponse(200, h, resp));
2765 }), true); 2474 }), true);
2766 res.get(arg_name).then(unittest.expectAsync1(((api.InstanceConfig response ) { 2475 res
2476 .get(arg_name)
2477 .then(unittest.expectAsync1(((api.InstanceConfig response) {
2767 checkInstanceConfig(response); 2478 checkInstanceConfig(response);
2768 }))); 2479 })));
2769 }); 2480 });
2770 2481
2771 unittest.test("method--list", () { 2482 unittest.test("method--list", () {
2772
2773 var mock = new HttpServerMock(); 2483 var mock = new HttpServerMock();
2774 api.ProjectsInstanceConfigsResourceApi res = new api.SpannerApi(mock).proj ects.instanceConfigs; 2484 api.ProjectsInstanceConfigsResourceApi res =
2485 new api.SpannerApi(mock).projects.instanceConfigs;
2775 var arg_parent = "foo"; 2486 var arg_parent = "foo";
2776 var arg_pageToken = "foo"; 2487 var arg_pageToken = "foo";
2777 var arg_pageSize = 42; 2488 var arg_pageSize = 42;
2778 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2489 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2779 var path = (req.url).path; 2490 var path = (req.url).path;
2780 var pathOffset = 0; 2491 var pathOffset = 0;
2781 var index; 2492 var index;
2782 var subPart; 2493 var subPart;
2783 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2494 unittest.expect(
2495 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2784 pathOffset += 1; 2496 pathOffset += 1;
2785 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 2497 unittest.expect(
2498 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
2786 pathOffset += 3; 2499 pathOffset += 3;
2787 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 2500 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
2788 2501
2789 var query = (req.url).query; 2502 var query = (req.url).query;
2790 var queryOffset = 0; 2503 var queryOffset = 0;
2791 var queryMap = {}; 2504 var queryMap = {};
2792 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2505 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2793 parseBool(n) { 2506 parseBool(n) {
2794 if (n == "true") return true; 2507 if (n == "true") return true;
2795 if (n == "false") return false; 2508 if (n == "false") return false;
2796 if (n == null) return null; 2509 if (n == null) return null;
2797 throw new core.ArgumentError("Invalid boolean: $n"); 2510 throw new core.ArgumentError("Invalid boolean: $n");
2798 } 2511 }
2512
2799 if (query.length > 0) { 2513 if (query.length > 0) {
2800 for (var part in query.split("&")) { 2514 for (var part in query.split("&")) {
2801 var keyvalue = part.split("="); 2515 var keyvalue = part.split("=");
2802 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2516 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2517 core.Uri.decodeQueryComponent(keyvalue[1]));
2803 } 2518 }
2804 } 2519 }
2805 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 2520 unittest.expect(
2806 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize)); 2521 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
2807 2522 unittest.expect(core.int.parse(queryMap["pageSize"].first),
2523 unittest.equals(arg_pageSize));
2808 2524
2809 var h = { 2525 var h = {
2810 "content-type" : "application/json; charset=utf-8", 2526 "content-type": "application/json; charset=utf-8",
2811 }; 2527 };
2812 var resp = convert.JSON.encode(buildListInstanceConfigsResponse()); 2528 var resp = convert.JSON.encode(buildListInstanceConfigsResponse());
2813 return new async.Future.value(stringResponse(200, h, resp)); 2529 return new async.Future.value(stringResponse(200, h, resp));
2814 }), true); 2530 }), true);
2815 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the n(unittest.expectAsync1(((api.ListInstanceConfigsResponse response) { 2531 res
2532 .list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize)
2533 .then(unittest
2534 .expectAsync1(((api.ListInstanceConfigsResponse response) {
2816 checkListInstanceConfigsResponse(response); 2535 checkListInstanceConfigsResponse(response);
2817 }))); 2536 })));
2818 }); 2537 });
2819
2820 }); 2538 });
2821 2539
2822
2823 unittest.group("resource-ProjectsInstancesResourceApi", () { 2540 unittest.group("resource-ProjectsInstancesResourceApi", () {
2824 unittest.test("method--create", () { 2541 unittest.test("method--create", () {
2825
2826 var mock = new HttpServerMock(); 2542 var mock = new HttpServerMock();
2827 api.ProjectsInstancesResourceApi res = new api.SpannerApi(mock).projects.i nstances; 2543 api.ProjectsInstancesResourceApi res =
2544 new api.SpannerApi(mock).projects.instances;
2828 var arg_request = buildCreateInstanceRequest(); 2545 var arg_request = buildCreateInstanceRequest();
2829 var arg_parent = "foo"; 2546 var arg_parent = "foo";
2830 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2547 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2831 var obj = new api.CreateInstanceRequest.fromJson(json); 2548 var obj = new api.CreateInstanceRequest.fromJson(json);
2832 checkCreateInstanceRequest(obj); 2549 checkCreateInstanceRequest(obj);
2833 2550
2834 var path = (req.url).path; 2551 var path = (req.url).path;
2835 var pathOffset = 0; 2552 var pathOffset = 0;
2836 var index; 2553 var index;
2837 var subPart; 2554 var subPart;
2838 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2555 unittest.expect(
2556 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2839 pathOffset += 1; 2557 pathOffset += 1;
2840 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 2558 unittest.expect(
2559 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
2841 pathOffset += 3; 2560 pathOffset += 3;
2842 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 2561 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
2843 2562
2844 var query = (req.url).query; 2563 var query = (req.url).query;
2845 var queryOffset = 0; 2564 var queryOffset = 0;
2846 var queryMap = {}; 2565 var queryMap = {};
2847 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2566 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2848 parseBool(n) { 2567 parseBool(n) {
2849 if (n == "true") return true; 2568 if (n == "true") return true;
2850 if (n == "false") return false; 2569 if (n == "false") return false;
2851 if (n == null) return null; 2570 if (n == null) return null;
2852 throw new core.ArgumentError("Invalid boolean: $n"); 2571 throw new core.ArgumentError("Invalid boolean: $n");
2853 } 2572 }
2573
2854 if (query.length > 0) { 2574 if (query.length > 0) {
2855 for (var part in query.split("&")) { 2575 for (var part in query.split("&")) {
2856 var keyvalue = part.split("="); 2576 var keyvalue = part.split("=");
2857 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2577 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2578 core.Uri.decodeQueryComponent(keyvalue[1]));
2858 } 2579 }
2859 } 2580 }
2860 2581
2861
2862 var h = { 2582 var h = {
2863 "content-type" : "application/json; charset=utf-8", 2583 "content-type": "application/json; charset=utf-8",
2864 }; 2584 };
2865 var resp = convert.JSON.encode(buildOperation()); 2585 var resp = convert.JSON.encode(buildOperation());
2866 return new async.Future.value(stringResponse(200, h, resp)); 2586 return new async.Future.value(stringResponse(200, h, resp));
2867 }), true); 2587 }), true);
2868 res.create(arg_request, arg_parent).then(unittest.expectAsync1(((api.Opera tion response) { 2588 res
2589 .create(arg_request, arg_parent)
2590 .then(unittest.expectAsync1(((api.Operation response) {
2869 checkOperation(response); 2591 checkOperation(response);
2870 }))); 2592 })));
2871 }); 2593 });
2872 2594
2873 unittest.test("method--delete", () { 2595 unittest.test("method--delete", () {
2874
2875 var mock = new HttpServerMock(); 2596 var mock = new HttpServerMock();
2876 api.ProjectsInstancesResourceApi res = new api.SpannerApi(mock).projects.i nstances; 2597 api.ProjectsInstancesResourceApi res =
2598 new api.SpannerApi(mock).projects.instances;
2877 var arg_name = "foo"; 2599 var arg_name = "foo";
2878 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2600 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2879 var path = (req.url).path; 2601 var path = (req.url).path;
2880 var pathOffset = 0; 2602 var pathOffset = 0;
2881 var index; 2603 var index;
2882 var subPart; 2604 var subPart;
2883 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2605 unittest.expect(
2606 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2884 pathOffset += 1; 2607 pathOffset += 1;
2885 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 2608 unittest.expect(
2609 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
2886 pathOffset += 3; 2610 pathOffset += 3;
2887 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 2611 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
2888 2612
2889 var query = (req.url).query; 2613 var query = (req.url).query;
2890 var queryOffset = 0; 2614 var queryOffset = 0;
2891 var queryMap = {}; 2615 var queryMap = {};
2892 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2616 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2893 parseBool(n) { 2617 parseBool(n) {
2894 if (n == "true") return true; 2618 if (n == "true") return true;
2895 if (n == "false") return false; 2619 if (n == "false") return false;
2896 if (n == null) return null; 2620 if (n == null) return null;
2897 throw new core.ArgumentError("Invalid boolean: $n"); 2621 throw new core.ArgumentError("Invalid boolean: $n");
2898 } 2622 }
2623
2899 if (query.length > 0) { 2624 if (query.length > 0) {
2900 for (var part in query.split("&")) { 2625 for (var part in query.split("&")) {
2901 var keyvalue = part.split("="); 2626 var keyvalue = part.split("=");
2902 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2627 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2628 core.Uri.decodeQueryComponent(keyvalue[1]));
2903 } 2629 }
2904 } 2630 }
2905 2631
2906
2907 var h = { 2632 var h = {
2908 "content-type" : "application/json; charset=utf-8", 2633 "content-type": "application/json; charset=utf-8",
2909 }; 2634 };
2910 var resp = convert.JSON.encode(buildEmpty()); 2635 var resp = convert.JSON.encode(buildEmpty());
2911 return new async.Future.value(stringResponse(200, h, resp)); 2636 return new async.Future.value(stringResponse(200, h, resp));
2912 }), true); 2637 }), true);
2913 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) { 2638 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) {
2914 checkEmpty(response); 2639 checkEmpty(response);
2915 }))); 2640 })));
2916 }); 2641 });
2917 2642
2918 unittest.test("method--get", () { 2643 unittest.test("method--get", () {
2919
2920 var mock = new HttpServerMock(); 2644 var mock = new HttpServerMock();
2921 api.ProjectsInstancesResourceApi res = new api.SpannerApi(mock).projects.i nstances; 2645 api.ProjectsInstancesResourceApi res =
2646 new api.SpannerApi(mock).projects.instances;
2922 var arg_name = "foo"; 2647 var arg_name = "foo";
2923 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2648 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2924 var path = (req.url).path; 2649 var path = (req.url).path;
2925 var pathOffset = 0; 2650 var pathOffset = 0;
2926 var index; 2651 var index;
2927 var subPart; 2652 var subPart;
2928 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2653 unittest.expect(
2654 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2929 pathOffset += 1; 2655 pathOffset += 1;
2930 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 2656 unittest.expect(
2657 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
2931 pathOffset += 3; 2658 pathOffset += 3;
2932 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 2659 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
2933 2660
2934 var query = (req.url).query; 2661 var query = (req.url).query;
2935 var queryOffset = 0; 2662 var queryOffset = 0;
2936 var queryMap = {}; 2663 var queryMap = {};
2937 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2664 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2938 parseBool(n) { 2665 parseBool(n) {
2939 if (n == "true") return true; 2666 if (n == "true") return true;
2940 if (n == "false") return false; 2667 if (n == "false") return false;
2941 if (n == null) return null; 2668 if (n == null) return null;
2942 throw new core.ArgumentError("Invalid boolean: $n"); 2669 throw new core.ArgumentError("Invalid boolean: $n");
2943 } 2670 }
2671
2944 if (query.length > 0) { 2672 if (query.length > 0) {
2945 for (var part in query.split("&")) { 2673 for (var part in query.split("&")) {
2946 var keyvalue = part.split("="); 2674 var keyvalue = part.split("=");
2947 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2675 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2676 core.Uri.decodeQueryComponent(keyvalue[1]));
2948 } 2677 }
2949 } 2678 }
2950 2679
2951
2952 var h = { 2680 var h = {
2953 "content-type" : "application/json; charset=utf-8", 2681 "content-type": "application/json; charset=utf-8",
2954 }; 2682 };
2955 var resp = convert.JSON.encode(buildInstance()); 2683 var resp = convert.JSON.encode(buildInstance());
2956 return new async.Future.value(stringResponse(200, h, resp)); 2684 return new async.Future.value(stringResponse(200, h, resp));
2957 }), true); 2685 }), true);
2958 res.get(arg_name).then(unittest.expectAsync1(((api.Instance response) { 2686 res.get(arg_name).then(unittest.expectAsync1(((api.Instance response) {
2959 checkInstance(response); 2687 checkInstance(response);
2960 }))); 2688 })));
2961 }); 2689 });
2962 2690
2963 unittest.test("method--getIamPolicy", () { 2691 unittest.test("method--getIamPolicy", () {
2964
2965 var mock = new HttpServerMock(); 2692 var mock = new HttpServerMock();
2966 api.ProjectsInstancesResourceApi res = new api.SpannerApi(mock).projects.i nstances; 2693 api.ProjectsInstancesResourceApi res =
2694 new api.SpannerApi(mock).projects.instances;
2967 var arg_request = buildGetIamPolicyRequest(); 2695 var arg_request = buildGetIamPolicyRequest();
2968 var arg_resource = "foo"; 2696 var arg_resource = "foo";
2969 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2697 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2970 var obj = new api.GetIamPolicyRequest.fromJson(json); 2698 var obj = new api.GetIamPolicyRequest.fromJson(json);
2971 checkGetIamPolicyRequest(obj); 2699 checkGetIamPolicyRequest(obj);
2972 2700
2973 var path = (req.url).path; 2701 var path = (req.url).path;
2974 var pathOffset = 0; 2702 var pathOffset = 0;
2975 var index; 2703 var index;
2976 var subPart; 2704 var subPart;
2977 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2705 unittest.expect(
2706 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2978 pathOffset += 1; 2707 pathOffset += 1;
2979 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 2708 unittest.expect(
2709 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
2980 pathOffset += 3; 2710 pathOffset += 3;
2981 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 2711 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
2982 2712
2983 var query = (req.url).query; 2713 var query = (req.url).query;
2984 var queryOffset = 0; 2714 var queryOffset = 0;
2985 var queryMap = {}; 2715 var queryMap = {};
2986 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2716 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2987 parseBool(n) { 2717 parseBool(n) {
2988 if (n == "true") return true; 2718 if (n == "true") return true;
2989 if (n == "false") return false; 2719 if (n == "false") return false;
2990 if (n == null) return null; 2720 if (n == null) return null;
2991 throw new core.ArgumentError("Invalid boolean: $n"); 2721 throw new core.ArgumentError("Invalid boolean: $n");
2992 } 2722 }
2723
2993 if (query.length > 0) { 2724 if (query.length > 0) {
2994 for (var part in query.split("&")) { 2725 for (var part in query.split("&")) {
2995 var keyvalue = part.split("="); 2726 var keyvalue = part.split("=");
2996 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2727 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2728 core.Uri.decodeQueryComponent(keyvalue[1]));
2997 } 2729 }
2998 } 2730 }
2999 2731
3000
3001 var h = { 2732 var h = {
3002 "content-type" : "application/json; charset=utf-8", 2733 "content-type": "application/json; charset=utf-8",
3003 }; 2734 };
3004 var resp = convert.JSON.encode(buildPolicy()); 2735 var resp = convert.JSON.encode(buildPolicy());
3005 return new async.Future.value(stringResponse(200, h, resp)); 2736 return new async.Future.value(stringResponse(200, h, resp));
3006 }), true); 2737 }), true);
3007 res.getIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a pi.Policy response) { 2738 res
2739 .getIamPolicy(arg_request, arg_resource)
2740 .then(unittest.expectAsync1(((api.Policy response) {
3008 checkPolicy(response); 2741 checkPolicy(response);
3009 }))); 2742 })));
3010 }); 2743 });
3011 2744
3012 unittest.test("method--list", () { 2745 unittest.test("method--list", () {
3013
3014 var mock = new HttpServerMock(); 2746 var mock = new HttpServerMock();
3015 api.ProjectsInstancesResourceApi res = new api.SpannerApi(mock).projects.i nstances; 2747 api.ProjectsInstancesResourceApi res =
2748 new api.SpannerApi(mock).projects.instances;
3016 var arg_parent = "foo"; 2749 var arg_parent = "foo";
3017 var arg_pageToken = "foo"; 2750 var arg_pageToken = "foo";
3018 var arg_pageSize = 42; 2751 var arg_pageSize = 42;
3019 var arg_filter = "foo"; 2752 var arg_filter = "foo";
3020 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2753 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3021 var path = (req.url).path; 2754 var path = (req.url).path;
3022 var pathOffset = 0; 2755 var pathOffset = 0;
3023 var index; 2756 var index;
3024 var subPart; 2757 var subPart;
3025 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2758 unittest.expect(
2759 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3026 pathOffset += 1; 2760 pathOffset += 1;
3027 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 2761 unittest.expect(
2762 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3028 pathOffset += 3; 2763 pathOffset += 3;
3029 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 2764 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3030 2765
3031 var query = (req.url).query; 2766 var query = (req.url).query;
3032 var queryOffset = 0; 2767 var queryOffset = 0;
3033 var queryMap = {}; 2768 var queryMap = {};
3034 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2769 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3035 parseBool(n) { 2770 parseBool(n) {
3036 if (n == "true") return true; 2771 if (n == "true") return true;
3037 if (n == "false") return false; 2772 if (n == "false") return false;
3038 if (n == null) return null; 2773 if (n == null) return null;
3039 throw new core.ArgumentError("Invalid boolean: $n"); 2774 throw new core.ArgumentError("Invalid boolean: $n");
3040 } 2775 }
2776
3041 if (query.length > 0) { 2777 if (query.length > 0) {
3042 for (var part in query.split("&")) { 2778 for (var part in query.split("&")) {
3043 var keyvalue = part.split("="); 2779 var keyvalue = part.split("=");
3044 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2780 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2781 core.Uri.decodeQueryComponent(keyvalue[1]));
3045 } 2782 }
3046 } 2783 }
3047 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 2784 unittest.expect(
3048 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize)); 2785 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
2786 unittest.expect(core.int.parse(queryMap["pageSize"].first),
2787 unittest.equals(arg_pageSize));
3049 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); 2788 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter));
3050 2789
3051
3052 var h = { 2790 var h = {
3053 "content-type" : "application/json; charset=utf-8", 2791 "content-type": "application/json; charset=utf-8",
3054 }; 2792 };
3055 var resp = convert.JSON.encode(buildListInstancesResponse()); 2793 var resp = convert.JSON.encode(buildListInstancesResponse());
3056 return new async.Future.value(stringResponse(200, h, resp)); 2794 return new async.Future.value(stringResponse(200, h, resp));
3057 }), true); 2795 }), true);
3058 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize, fil ter: arg_filter).then(unittest.expectAsync1(((api.ListInstancesResponse response ) { 2796 res
2797 .list(arg_parent,
2798 pageToken: arg_pageToken,
2799 pageSize: arg_pageSize,
2800 filter: arg_filter)
2801 .then(unittest.expectAsync1(((api.ListInstancesResponse response) {
3059 checkListInstancesResponse(response); 2802 checkListInstancesResponse(response);
3060 }))); 2803 })));
3061 }); 2804 });
3062 2805
3063 unittest.test("method--patch", () { 2806 unittest.test("method--patch", () {
3064
3065 var mock = new HttpServerMock(); 2807 var mock = new HttpServerMock();
3066 api.ProjectsInstancesResourceApi res = new api.SpannerApi(mock).projects.i nstances; 2808 api.ProjectsInstancesResourceApi res =
2809 new api.SpannerApi(mock).projects.instances;
3067 var arg_request = buildUpdateInstanceRequest(); 2810 var arg_request = buildUpdateInstanceRequest();
3068 var arg_name = "foo"; 2811 var arg_name = "foo";
3069 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2812 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3070 var obj = new api.UpdateInstanceRequest.fromJson(json); 2813 var obj = new api.UpdateInstanceRequest.fromJson(json);
3071 checkUpdateInstanceRequest(obj); 2814 checkUpdateInstanceRequest(obj);
3072 2815
3073 var path = (req.url).path; 2816 var path = (req.url).path;
3074 var pathOffset = 0; 2817 var pathOffset = 0;
3075 var index; 2818 var index;
3076 var subPart; 2819 var subPart;
3077 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2820 unittest.expect(
2821 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3078 pathOffset += 1; 2822 pathOffset += 1;
3079 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 2823 unittest.expect(
2824 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3080 pathOffset += 3; 2825 pathOffset += 3;
3081 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 2826 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3082 2827
3083 var query = (req.url).query; 2828 var query = (req.url).query;
3084 var queryOffset = 0; 2829 var queryOffset = 0;
3085 var queryMap = {}; 2830 var queryMap = {};
3086 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2831 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3087 parseBool(n) { 2832 parseBool(n) {
3088 if (n == "true") return true; 2833 if (n == "true") return true;
3089 if (n == "false") return false; 2834 if (n == "false") return false;
3090 if (n == null) return null; 2835 if (n == null) return null;
3091 throw new core.ArgumentError("Invalid boolean: $n"); 2836 throw new core.ArgumentError("Invalid boolean: $n");
3092 } 2837 }
2838
3093 if (query.length > 0) { 2839 if (query.length > 0) {
3094 for (var part in query.split("&")) { 2840 for (var part in query.split("&")) {
3095 var keyvalue = part.split("="); 2841 var keyvalue = part.split("=");
3096 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2842 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2843 core.Uri.decodeQueryComponent(keyvalue[1]));
3097 } 2844 }
3098 } 2845 }
3099 2846
3100
3101 var h = { 2847 var h = {
3102 "content-type" : "application/json; charset=utf-8", 2848 "content-type": "application/json; charset=utf-8",
3103 }; 2849 };
3104 var resp = convert.JSON.encode(buildOperation()); 2850 var resp = convert.JSON.encode(buildOperation());
3105 return new async.Future.value(stringResponse(200, h, resp)); 2851 return new async.Future.value(stringResponse(200, h, resp));
3106 }), true); 2852 }), true);
3107 res.patch(arg_request, arg_name).then(unittest.expectAsync1(((api.Operatio n response) { 2853 res
2854 .patch(arg_request, arg_name)
2855 .then(unittest.expectAsync1(((api.Operation response) {
3108 checkOperation(response); 2856 checkOperation(response);
3109 }))); 2857 })));
3110 }); 2858 });
3111 2859
3112 unittest.test("method--setIamPolicy", () { 2860 unittest.test("method--setIamPolicy", () {
3113
3114 var mock = new HttpServerMock(); 2861 var mock = new HttpServerMock();
3115 api.ProjectsInstancesResourceApi res = new api.SpannerApi(mock).projects.i nstances; 2862 api.ProjectsInstancesResourceApi res =
2863 new api.SpannerApi(mock).projects.instances;
3116 var arg_request = buildSetIamPolicyRequest(); 2864 var arg_request = buildSetIamPolicyRequest();
3117 var arg_resource = "foo"; 2865 var arg_resource = "foo";
3118 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2866 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3119 var obj = new api.SetIamPolicyRequest.fromJson(json); 2867 var obj = new api.SetIamPolicyRequest.fromJson(json);
3120 checkSetIamPolicyRequest(obj); 2868 checkSetIamPolicyRequest(obj);
3121 2869
3122 var path = (req.url).path; 2870 var path = (req.url).path;
3123 var pathOffset = 0; 2871 var pathOffset = 0;
3124 var index; 2872 var index;
3125 var subPart; 2873 var subPart;
3126 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2874 unittest.expect(
2875 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3127 pathOffset += 1; 2876 pathOffset += 1;
3128 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 2877 unittest.expect(
2878 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3129 pathOffset += 3; 2879 pathOffset += 3;
3130 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 2880 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3131 2881
3132 var query = (req.url).query; 2882 var query = (req.url).query;
3133 var queryOffset = 0; 2883 var queryOffset = 0;
3134 var queryMap = {}; 2884 var queryMap = {};
3135 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2885 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3136 parseBool(n) { 2886 parseBool(n) {
3137 if (n == "true") return true; 2887 if (n == "true") return true;
3138 if (n == "false") return false; 2888 if (n == "false") return false;
3139 if (n == null) return null; 2889 if (n == null) return null;
3140 throw new core.ArgumentError("Invalid boolean: $n"); 2890 throw new core.ArgumentError("Invalid boolean: $n");
3141 } 2891 }
2892
3142 if (query.length > 0) { 2893 if (query.length > 0) {
3143 for (var part in query.split("&")) { 2894 for (var part in query.split("&")) {
3144 var keyvalue = part.split("="); 2895 var keyvalue = part.split("=");
3145 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2896 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2897 core.Uri.decodeQueryComponent(keyvalue[1]));
3146 } 2898 }
3147 } 2899 }
3148 2900
3149
3150 var h = { 2901 var h = {
3151 "content-type" : "application/json; charset=utf-8", 2902 "content-type": "application/json; charset=utf-8",
3152 }; 2903 };
3153 var resp = convert.JSON.encode(buildPolicy()); 2904 var resp = convert.JSON.encode(buildPolicy());
3154 return new async.Future.value(stringResponse(200, h, resp)); 2905 return new async.Future.value(stringResponse(200, h, resp));
3155 }), true); 2906 }), true);
3156 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a pi.Policy response) { 2907 res
2908 .setIamPolicy(arg_request, arg_resource)
2909 .then(unittest.expectAsync1(((api.Policy response) {
3157 checkPolicy(response); 2910 checkPolicy(response);
3158 }))); 2911 })));
3159 }); 2912 });
3160 2913
3161 unittest.test("method--testIamPermissions", () { 2914 unittest.test("method--testIamPermissions", () {
3162
3163 var mock = new HttpServerMock(); 2915 var mock = new HttpServerMock();
3164 api.ProjectsInstancesResourceApi res = new api.SpannerApi(mock).projects.i nstances; 2916 api.ProjectsInstancesResourceApi res =
2917 new api.SpannerApi(mock).projects.instances;
3165 var arg_request = buildTestIamPermissionsRequest(); 2918 var arg_request = buildTestIamPermissionsRequest();
3166 var arg_resource = "foo"; 2919 var arg_resource = "foo";
3167 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2920 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3168 var obj = new api.TestIamPermissionsRequest.fromJson(json); 2921 var obj = new api.TestIamPermissionsRequest.fromJson(json);
3169 checkTestIamPermissionsRequest(obj); 2922 checkTestIamPermissionsRequest(obj);
3170 2923
3171 var path = (req.url).path; 2924 var path = (req.url).path;
3172 var pathOffset = 0; 2925 var pathOffset = 0;
3173 var index; 2926 var index;
3174 var subPart; 2927 var subPart;
3175 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2928 unittest.expect(
2929 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3176 pathOffset += 1; 2930 pathOffset += 1;
3177 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 2931 unittest.expect(
2932 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3178 pathOffset += 3; 2933 pathOffset += 3;
3179 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 2934 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3180 2935
3181 var query = (req.url).query; 2936 var query = (req.url).query;
3182 var queryOffset = 0; 2937 var queryOffset = 0;
3183 var queryMap = {}; 2938 var queryMap = {};
3184 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2939 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3185 parseBool(n) { 2940 parseBool(n) {
3186 if (n == "true") return true; 2941 if (n == "true") return true;
3187 if (n == "false") return false; 2942 if (n == "false") return false;
3188 if (n == null) return null; 2943 if (n == null) return null;
3189 throw new core.ArgumentError("Invalid boolean: $n"); 2944 throw new core.ArgumentError("Invalid boolean: $n");
3190 } 2945 }
2946
3191 if (query.length > 0) { 2947 if (query.length > 0) {
3192 for (var part in query.split("&")) { 2948 for (var part in query.split("&")) {
3193 var keyvalue = part.split("="); 2949 var keyvalue = part.split("=");
3194 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2950 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2951 core.Uri.decodeQueryComponent(keyvalue[1]));
3195 } 2952 }
3196 } 2953 }
3197 2954
3198
3199 var h = { 2955 var h = {
3200 "content-type" : "application/json; charset=utf-8", 2956 "content-type": "application/json; charset=utf-8",
3201 }; 2957 };
3202 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); 2958 var resp = convert.JSON.encode(buildTestIamPermissionsResponse());
3203 return new async.Future.value(stringResponse(200, h, resp)); 2959 return new async.Future.value(stringResponse(200, h, resp));
3204 }), true); 2960 }), true);
3205 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn c1(((api.TestIamPermissionsResponse response) { 2961 res.testIamPermissions(arg_request, arg_resource).then(
2962 unittest.expectAsync1(((api.TestIamPermissionsResponse response) {
3206 checkTestIamPermissionsResponse(response); 2963 checkTestIamPermissionsResponse(response);
3207 }))); 2964 })));
3208 }); 2965 });
3209
3210 }); 2966 });
3211 2967
3212
3213 unittest.group("resource-ProjectsInstancesDatabasesResourceApi", () { 2968 unittest.group("resource-ProjectsInstancesDatabasesResourceApi", () {
3214 unittest.test("method--create", () { 2969 unittest.test("method--create", () {
3215
3216 var mock = new HttpServerMock(); 2970 var mock = new HttpServerMock();
3217 api.ProjectsInstancesDatabasesResourceApi res = new api.SpannerApi(mock).p rojects.instances.databases; 2971 api.ProjectsInstancesDatabasesResourceApi res =
2972 new api.SpannerApi(mock).projects.instances.databases;
3218 var arg_request = buildCreateDatabaseRequest(); 2973 var arg_request = buildCreateDatabaseRequest();
3219 var arg_parent = "foo"; 2974 var arg_parent = "foo";
3220 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2975 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3221 var obj = new api.CreateDatabaseRequest.fromJson(json); 2976 var obj = new api.CreateDatabaseRequest.fromJson(json);
3222 checkCreateDatabaseRequest(obj); 2977 checkCreateDatabaseRequest(obj);
3223 2978
3224 var path = (req.url).path; 2979 var path = (req.url).path;
3225 var pathOffset = 0; 2980 var pathOffset = 0;
3226 var index; 2981 var index;
3227 var subPart; 2982 var subPart;
3228 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2983 unittest.expect(
2984 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3229 pathOffset += 1; 2985 pathOffset += 1;
3230 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 2986 unittest.expect(
2987 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3231 pathOffset += 3; 2988 pathOffset += 3;
3232 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 2989 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3233 2990
3234 var query = (req.url).query; 2991 var query = (req.url).query;
3235 var queryOffset = 0; 2992 var queryOffset = 0;
3236 var queryMap = {}; 2993 var queryMap = {};
3237 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2994 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3238 parseBool(n) { 2995 parseBool(n) {
3239 if (n == "true") return true; 2996 if (n == "true") return true;
3240 if (n == "false") return false; 2997 if (n == "false") return false;
3241 if (n == null) return null; 2998 if (n == null) return null;
3242 throw new core.ArgumentError("Invalid boolean: $n"); 2999 throw new core.ArgumentError("Invalid boolean: $n");
3243 } 3000 }
3001
3244 if (query.length > 0) { 3002 if (query.length > 0) {
3245 for (var part in query.split("&")) { 3003 for (var part in query.split("&")) {
3246 var keyvalue = part.split("="); 3004 var keyvalue = part.split("=");
3247 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3005 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3006 core.Uri.decodeQueryComponent(keyvalue[1]));
3248 } 3007 }
3249 } 3008 }
3250 3009
3251
3252 var h = { 3010 var h = {
3253 "content-type" : "application/json; charset=utf-8", 3011 "content-type": "application/json; charset=utf-8",
3254 }; 3012 };
3255 var resp = convert.JSON.encode(buildOperation()); 3013 var resp = convert.JSON.encode(buildOperation());
3256 return new async.Future.value(stringResponse(200, h, resp)); 3014 return new async.Future.value(stringResponse(200, h, resp));
3257 }), true); 3015 }), true);
3258 res.create(arg_request, arg_parent).then(unittest.expectAsync1(((api.Opera tion response) { 3016 res
3017 .create(arg_request, arg_parent)
3018 .then(unittest.expectAsync1(((api.Operation response) {
3259 checkOperation(response); 3019 checkOperation(response);
3260 }))); 3020 })));
3261 }); 3021 });
3262 3022
3263 unittest.test("method--dropDatabase", () { 3023 unittest.test("method--dropDatabase", () {
3264
3265 var mock = new HttpServerMock(); 3024 var mock = new HttpServerMock();
3266 api.ProjectsInstancesDatabasesResourceApi res = new api.SpannerApi(mock).p rojects.instances.databases; 3025 api.ProjectsInstancesDatabasesResourceApi res =
3026 new api.SpannerApi(mock).projects.instances.databases;
3267 var arg_database = "foo"; 3027 var arg_database = "foo";
3268 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3028 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3269 var path = (req.url).path; 3029 var path = (req.url).path;
3270 var pathOffset = 0; 3030 var pathOffset = 0;
3271 var index; 3031 var index;
3272 var subPart; 3032 var subPart;
3273 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3033 unittest.expect(
3034 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3274 pathOffset += 1; 3035 pathOffset += 1;
3275 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3036 unittest.expect(
3037 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3276 pathOffset += 3; 3038 pathOffset += 3;
3277 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3039 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3278 3040
3279 var query = (req.url).query; 3041 var query = (req.url).query;
3280 var queryOffset = 0; 3042 var queryOffset = 0;
3281 var queryMap = {}; 3043 var queryMap = {};
3282 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3044 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3283 parseBool(n) { 3045 parseBool(n) {
3284 if (n == "true") return true; 3046 if (n == "true") return true;
3285 if (n == "false") return false; 3047 if (n == "false") return false;
3286 if (n == null) return null; 3048 if (n == null) return null;
3287 throw new core.ArgumentError("Invalid boolean: $n"); 3049 throw new core.ArgumentError("Invalid boolean: $n");
3288 } 3050 }
3051
3289 if (query.length > 0) { 3052 if (query.length > 0) {
3290 for (var part in query.split("&")) { 3053 for (var part in query.split("&")) {
3291 var keyvalue = part.split("="); 3054 var keyvalue = part.split("=");
3292 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3055 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3056 core.Uri.decodeQueryComponent(keyvalue[1]));
3293 } 3057 }
3294 } 3058 }
3295 3059
3296
3297 var h = { 3060 var h = {
3298 "content-type" : "application/json; charset=utf-8", 3061 "content-type": "application/json; charset=utf-8",
3299 }; 3062 };
3300 var resp = convert.JSON.encode(buildEmpty()); 3063 var resp = convert.JSON.encode(buildEmpty());
3301 return new async.Future.value(stringResponse(200, h, resp)); 3064 return new async.Future.value(stringResponse(200, h, resp));
3302 }), true); 3065 }), true);
3303 res.dropDatabase(arg_database).then(unittest.expectAsync1(((api.Empty resp onse) { 3066 res
3067 .dropDatabase(arg_database)
3068 .then(unittest.expectAsync1(((api.Empty response) {
3304 checkEmpty(response); 3069 checkEmpty(response);
3305 }))); 3070 })));
3306 }); 3071 });
3307 3072
3308 unittest.test("method--get", () { 3073 unittest.test("method--get", () {
3309
3310 var mock = new HttpServerMock(); 3074 var mock = new HttpServerMock();
3311 api.ProjectsInstancesDatabasesResourceApi res = new api.SpannerApi(mock).p rojects.instances.databases; 3075 api.ProjectsInstancesDatabasesResourceApi res =
3076 new api.SpannerApi(mock).projects.instances.databases;
3312 var arg_name = "foo"; 3077 var arg_name = "foo";
3313 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3078 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3314 var path = (req.url).path; 3079 var path = (req.url).path;
3315 var pathOffset = 0; 3080 var pathOffset = 0;
3316 var index; 3081 var index;
3317 var subPart; 3082 var subPart;
3318 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3083 unittest.expect(
3084 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3319 pathOffset += 1; 3085 pathOffset += 1;
3320 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3086 unittest.expect(
3087 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3321 pathOffset += 3; 3088 pathOffset += 3;
3322 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3089 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3323 3090
3324 var query = (req.url).query; 3091 var query = (req.url).query;
3325 var queryOffset = 0; 3092 var queryOffset = 0;
3326 var queryMap = {}; 3093 var queryMap = {};
3327 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3094 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3328 parseBool(n) { 3095 parseBool(n) {
3329 if (n == "true") return true; 3096 if (n == "true") return true;
3330 if (n == "false") return false; 3097 if (n == "false") return false;
3331 if (n == null) return null; 3098 if (n == null) return null;
3332 throw new core.ArgumentError("Invalid boolean: $n"); 3099 throw new core.ArgumentError("Invalid boolean: $n");
3333 } 3100 }
3101
3334 if (query.length > 0) { 3102 if (query.length > 0) {
3335 for (var part in query.split("&")) { 3103 for (var part in query.split("&")) {
3336 var keyvalue = part.split("="); 3104 var keyvalue = part.split("=");
3337 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3105 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3106 core.Uri.decodeQueryComponent(keyvalue[1]));
3338 } 3107 }
3339 } 3108 }
3340 3109
3341
3342 var h = { 3110 var h = {
3343 "content-type" : "application/json; charset=utf-8", 3111 "content-type": "application/json; charset=utf-8",
3344 }; 3112 };
3345 var resp = convert.JSON.encode(buildDatabase()); 3113 var resp = convert.JSON.encode(buildDatabase());
3346 return new async.Future.value(stringResponse(200, h, resp)); 3114 return new async.Future.value(stringResponse(200, h, resp));
3347 }), true); 3115 }), true);
3348 res.get(arg_name).then(unittest.expectAsync1(((api.Database response) { 3116 res.get(arg_name).then(unittest.expectAsync1(((api.Database response) {
3349 checkDatabase(response); 3117 checkDatabase(response);
3350 }))); 3118 })));
3351 }); 3119 });
3352 3120
3353 unittest.test("method--getDdl", () { 3121 unittest.test("method--getDdl", () {
3354
3355 var mock = new HttpServerMock(); 3122 var mock = new HttpServerMock();
3356 api.ProjectsInstancesDatabasesResourceApi res = new api.SpannerApi(mock).p rojects.instances.databases; 3123 api.ProjectsInstancesDatabasesResourceApi res =
3124 new api.SpannerApi(mock).projects.instances.databases;
3357 var arg_database = "foo"; 3125 var arg_database = "foo";
3358 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3126 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3359 var path = (req.url).path; 3127 var path = (req.url).path;
3360 var pathOffset = 0; 3128 var pathOffset = 0;
3361 var index; 3129 var index;
3362 var subPart; 3130 var subPart;
3363 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3131 unittest.expect(
3132 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3364 pathOffset += 1; 3133 pathOffset += 1;
3365 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3134 unittest.expect(
3135 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3366 pathOffset += 3; 3136 pathOffset += 3;
3367 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3137 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3368 3138
3369 var query = (req.url).query; 3139 var query = (req.url).query;
3370 var queryOffset = 0; 3140 var queryOffset = 0;
3371 var queryMap = {}; 3141 var queryMap = {};
3372 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3142 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3373 parseBool(n) { 3143 parseBool(n) {
3374 if (n == "true") return true; 3144 if (n == "true") return true;
3375 if (n == "false") return false; 3145 if (n == "false") return false;
3376 if (n == null) return null; 3146 if (n == null) return null;
3377 throw new core.ArgumentError("Invalid boolean: $n"); 3147 throw new core.ArgumentError("Invalid boolean: $n");
3378 } 3148 }
3149
3379 if (query.length > 0) { 3150 if (query.length > 0) {
3380 for (var part in query.split("&")) { 3151 for (var part in query.split("&")) {
3381 var keyvalue = part.split("="); 3152 var keyvalue = part.split("=");
3382 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3153 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3154 core.Uri.decodeQueryComponent(keyvalue[1]));
3383 } 3155 }
3384 } 3156 }
3385 3157
3386
3387 var h = { 3158 var h = {
3388 "content-type" : "application/json; charset=utf-8", 3159 "content-type": "application/json; charset=utf-8",
3389 }; 3160 };
3390 var resp = convert.JSON.encode(buildGetDatabaseDdlResponse()); 3161 var resp = convert.JSON.encode(buildGetDatabaseDdlResponse());
3391 return new async.Future.value(stringResponse(200, h, resp)); 3162 return new async.Future.value(stringResponse(200, h, resp));
3392 }), true); 3163 }), true);
3393 res.getDdl(arg_database).then(unittest.expectAsync1(((api.GetDatabaseDdlRe sponse response) { 3164 res
3165 .getDdl(arg_database)
3166 .then(unittest.expectAsync1(((api.GetDatabaseDdlResponse response) {
3394 checkGetDatabaseDdlResponse(response); 3167 checkGetDatabaseDdlResponse(response);
3395 }))); 3168 })));
3396 }); 3169 });
3397 3170
3398 unittest.test("method--getIamPolicy", () { 3171 unittest.test("method--getIamPolicy", () {
3399
3400 var mock = new HttpServerMock(); 3172 var mock = new HttpServerMock();
3401 api.ProjectsInstancesDatabasesResourceApi res = new api.SpannerApi(mock).p rojects.instances.databases; 3173 api.ProjectsInstancesDatabasesResourceApi res =
3174 new api.SpannerApi(mock).projects.instances.databases;
3402 var arg_request = buildGetIamPolicyRequest(); 3175 var arg_request = buildGetIamPolicyRequest();
3403 var arg_resource = "foo"; 3176 var arg_resource = "foo";
3404 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3177 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3405 var obj = new api.GetIamPolicyRequest.fromJson(json); 3178 var obj = new api.GetIamPolicyRequest.fromJson(json);
3406 checkGetIamPolicyRequest(obj); 3179 checkGetIamPolicyRequest(obj);
3407 3180
3408 var path = (req.url).path; 3181 var path = (req.url).path;
3409 var pathOffset = 0; 3182 var pathOffset = 0;
3410 var index; 3183 var index;
3411 var subPart; 3184 var subPart;
3412 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3185 unittest.expect(
3186 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3413 pathOffset += 1; 3187 pathOffset += 1;
3414 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3188 unittest.expect(
3189 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3415 pathOffset += 3; 3190 pathOffset += 3;
3416 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3191 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3417 3192
3418 var query = (req.url).query; 3193 var query = (req.url).query;
3419 var queryOffset = 0; 3194 var queryOffset = 0;
3420 var queryMap = {}; 3195 var queryMap = {};
3421 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3196 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3422 parseBool(n) { 3197 parseBool(n) {
3423 if (n == "true") return true; 3198 if (n == "true") return true;
3424 if (n == "false") return false; 3199 if (n == "false") return false;
3425 if (n == null) return null; 3200 if (n == null) return null;
3426 throw new core.ArgumentError("Invalid boolean: $n"); 3201 throw new core.ArgumentError("Invalid boolean: $n");
3427 } 3202 }
3203
3428 if (query.length > 0) { 3204 if (query.length > 0) {
3429 for (var part in query.split("&")) { 3205 for (var part in query.split("&")) {
3430 var keyvalue = part.split("="); 3206 var keyvalue = part.split("=");
3431 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3207 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3208 core.Uri.decodeQueryComponent(keyvalue[1]));
3432 } 3209 }
3433 } 3210 }
3434 3211
3435
3436 var h = { 3212 var h = {
3437 "content-type" : "application/json; charset=utf-8", 3213 "content-type": "application/json; charset=utf-8",
3438 }; 3214 };
3439 var resp = convert.JSON.encode(buildPolicy()); 3215 var resp = convert.JSON.encode(buildPolicy());
3440 return new async.Future.value(stringResponse(200, h, resp)); 3216 return new async.Future.value(stringResponse(200, h, resp));
3441 }), true); 3217 }), true);
3442 res.getIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a pi.Policy response) { 3218 res
3219 .getIamPolicy(arg_request, arg_resource)
3220 .then(unittest.expectAsync1(((api.Policy response) {
3443 checkPolicy(response); 3221 checkPolicy(response);
3444 }))); 3222 })));
3445 }); 3223 });
3446 3224
3447 unittest.test("method--list", () { 3225 unittest.test("method--list", () {
3448
3449 var mock = new HttpServerMock(); 3226 var mock = new HttpServerMock();
3450 api.ProjectsInstancesDatabasesResourceApi res = new api.SpannerApi(mock).p rojects.instances.databases; 3227 api.ProjectsInstancesDatabasesResourceApi res =
3228 new api.SpannerApi(mock).projects.instances.databases;
3451 var arg_parent = "foo"; 3229 var arg_parent = "foo";
3452 var arg_pageToken = "foo"; 3230 var arg_pageToken = "foo";
3453 var arg_pageSize = 42; 3231 var arg_pageSize = 42;
3454 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3232 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3455 var path = (req.url).path; 3233 var path = (req.url).path;
3456 var pathOffset = 0; 3234 var pathOffset = 0;
3457 var index; 3235 var index;
3458 var subPart; 3236 var subPart;
3459 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3237 unittest.expect(
3238 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3460 pathOffset += 1; 3239 pathOffset += 1;
3461 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3240 unittest.expect(
3241 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3462 pathOffset += 3; 3242 pathOffset += 3;
3463 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3243 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3464 3244
3465 var query = (req.url).query; 3245 var query = (req.url).query;
3466 var queryOffset = 0; 3246 var queryOffset = 0;
3467 var queryMap = {}; 3247 var queryMap = {};
3468 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3248 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3469 parseBool(n) { 3249 parseBool(n) {
3470 if (n == "true") return true; 3250 if (n == "true") return true;
3471 if (n == "false") return false; 3251 if (n == "false") return false;
3472 if (n == null) return null; 3252 if (n == null) return null;
3473 throw new core.ArgumentError("Invalid boolean: $n"); 3253 throw new core.ArgumentError("Invalid boolean: $n");
3474 } 3254 }
3255
3475 if (query.length > 0) { 3256 if (query.length > 0) {
3476 for (var part in query.split("&")) { 3257 for (var part in query.split("&")) {
3477 var keyvalue = part.split("="); 3258 var keyvalue = part.split("=");
3478 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3259 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3260 core.Uri.decodeQueryComponent(keyvalue[1]));
3479 } 3261 }
3480 } 3262 }
3481 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 3263 unittest.expect(
3482 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize)); 3264 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
3483 3265 unittest.expect(core.int.parse(queryMap["pageSize"].first),
3266 unittest.equals(arg_pageSize));
3484 3267
3485 var h = { 3268 var h = {
3486 "content-type" : "application/json; charset=utf-8", 3269 "content-type": "application/json; charset=utf-8",
3487 }; 3270 };
3488 var resp = convert.JSON.encode(buildListDatabasesResponse()); 3271 var resp = convert.JSON.encode(buildListDatabasesResponse());
3489 return new async.Future.value(stringResponse(200, h, resp)); 3272 return new async.Future.value(stringResponse(200, h, resp));
3490 }), true); 3273 }), true);
3491 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the n(unittest.expectAsync1(((api.ListDatabasesResponse response) { 3274 res
3275 .list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize)
3276 .then(unittest.expectAsync1(((api.ListDatabasesResponse response) {
3492 checkListDatabasesResponse(response); 3277 checkListDatabasesResponse(response);
3493 }))); 3278 })));
3494 }); 3279 });
3495 3280
3496 unittest.test("method--setIamPolicy", () { 3281 unittest.test("method--setIamPolicy", () {
3497
3498 var mock = new HttpServerMock(); 3282 var mock = new HttpServerMock();
3499 api.ProjectsInstancesDatabasesResourceApi res = new api.SpannerApi(mock).p rojects.instances.databases; 3283 api.ProjectsInstancesDatabasesResourceApi res =
3284 new api.SpannerApi(mock).projects.instances.databases;
3500 var arg_request = buildSetIamPolicyRequest(); 3285 var arg_request = buildSetIamPolicyRequest();
3501 var arg_resource = "foo"; 3286 var arg_resource = "foo";
3502 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3287 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3503 var obj = new api.SetIamPolicyRequest.fromJson(json); 3288 var obj = new api.SetIamPolicyRequest.fromJson(json);
3504 checkSetIamPolicyRequest(obj); 3289 checkSetIamPolicyRequest(obj);
3505 3290
3506 var path = (req.url).path; 3291 var path = (req.url).path;
3507 var pathOffset = 0; 3292 var pathOffset = 0;
3508 var index; 3293 var index;
3509 var subPart; 3294 var subPart;
3510 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3295 unittest.expect(
3296 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3511 pathOffset += 1; 3297 pathOffset += 1;
3512 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3298 unittest.expect(
3299 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3513 pathOffset += 3; 3300 pathOffset += 3;
3514 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3301 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3515 3302
3516 var query = (req.url).query; 3303 var query = (req.url).query;
3517 var queryOffset = 0; 3304 var queryOffset = 0;
3518 var queryMap = {}; 3305 var queryMap = {};
3519 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3306 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3520 parseBool(n) { 3307 parseBool(n) {
3521 if (n == "true") return true; 3308 if (n == "true") return true;
3522 if (n == "false") return false; 3309 if (n == "false") return false;
3523 if (n == null) return null; 3310 if (n == null) return null;
3524 throw new core.ArgumentError("Invalid boolean: $n"); 3311 throw new core.ArgumentError("Invalid boolean: $n");
3525 } 3312 }
3313
3526 if (query.length > 0) { 3314 if (query.length > 0) {
3527 for (var part in query.split("&")) { 3315 for (var part in query.split("&")) {
3528 var keyvalue = part.split("="); 3316 var keyvalue = part.split("=");
3529 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3317 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3318 core.Uri.decodeQueryComponent(keyvalue[1]));
3530 } 3319 }
3531 } 3320 }
3532 3321
3533
3534 var h = { 3322 var h = {
3535 "content-type" : "application/json; charset=utf-8", 3323 "content-type": "application/json; charset=utf-8",
3536 }; 3324 };
3537 var resp = convert.JSON.encode(buildPolicy()); 3325 var resp = convert.JSON.encode(buildPolicy());
3538 return new async.Future.value(stringResponse(200, h, resp)); 3326 return new async.Future.value(stringResponse(200, h, resp));
3539 }), true); 3327 }), true);
3540 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a pi.Policy response) { 3328 res
3329 .setIamPolicy(arg_request, arg_resource)
3330 .then(unittest.expectAsync1(((api.Policy response) {
3541 checkPolicy(response); 3331 checkPolicy(response);
3542 }))); 3332 })));
3543 }); 3333 });
3544 3334
3545 unittest.test("method--testIamPermissions", () { 3335 unittest.test("method--testIamPermissions", () {
3546
3547 var mock = new HttpServerMock(); 3336 var mock = new HttpServerMock();
3548 api.ProjectsInstancesDatabasesResourceApi res = new api.SpannerApi(mock).p rojects.instances.databases; 3337 api.ProjectsInstancesDatabasesResourceApi res =
3338 new api.SpannerApi(mock).projects.instances.databases;
3549 var arg_request = buildTestIamPermissionsRequest(); 3339 var arg_request = buildTestIamPermissionsRequest();
3550 var arg_resource = "foo"; 3340 var arg_resource = "foo";
3551 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3341 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3552 var obj = new api.TestIamPermissionsRequest.fromJson(json); 3342 var obj = new api.TestIamPermissionsRequest.fromJson(json);
3553 checkTestIamPermissionsRequest(obj); 3343 checkTestIamPermissionsRequest(obj);
3554 3344
3555 var path = (req.url).path; 3345 var path = (req.url).path;
3556 var pathOffset = 0; 3346 var pathOffset = 0;
3557 var index; 3347 var index;
3558 var subPart; 3348 var subPart;
3559 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3349 unittest.expect(
3350 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3560 pathOffset += 1; 3351 pathOffset += 1;
3561 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3352 unittest.expect(
3353 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3562 pathOffset += 3; 3354 pathOffset += 3;
3563 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3355 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3564 3356
3565 var query = (req.url).query; 3357 var query = (req.url).query;
3566 var queryOffset = 0; 3358 var queryOffset = 0;
3567 var queryMap = {}; 3359 var queryMap = {};
3568 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3360 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3569 parseBool(n) { 3361 parseBool(n) {
3570 if (n == "true") return true; 3362 if (n == "true") return true;
3571 if (n == "false") return false; 3363 if (n == "false") return false;
3572 if (n == null) return null; 3364 if (n == null) return null;
3573 throw new core.ArgumentError("Invalid boolean: $n"); 3365 throw new core.ArgumentError("Invalid boolean: $n");
3574 } 3366 }
3367
3575 if (query.length > 0) { 3368 if (query.length > 0) {
3576 for (var part in query.split("&")) { 3369 for (var part in query.split("&")) {
3577 var keyvalue = part.split("="); 3370 var keyvalue = part.split("=");
3578 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3371 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3372 core.Uri.decodeQueryComponent(keyvalue[1]));
3579 } 3373 }
3580 } 3374 }
3581 3375
3582
3583 var h = { 3376 var h = {
3584 "content-type" : "application/json; charset=utf-8", 3377 "content-type": "application/json; charset=utf-8",
3585 }; 3378 };
3586 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); 3379 var resp = convert.JSON.encode(buildTestIamPermissionsResponse());
3587 return new async.Future.value(stringResponse(200, h, resp)); 3380 return new async.Future.value(stringResponse(200, h, resp));
3588 }), true); 3381 }), true);
3589 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn c1(((api.TestIamPermissionsResponse response) { 3382 res.testIamPermissions(arg_request, arg_resource).then(
3383 unittest.expectAsync1(((api.TestIamPermissionsResponse response) {
3590 checkTestIamPermissionsResponse(response); 3384 checkTestIamPermissionsResponse(response);
3591 }))); 3385 })));
3592 }); 3386 });
3593 3387
3594 unittest.test("method--updateDdl", () { 3388 unittest.test("method--updateDdl", () {
3595
3596 var mock = new HttpServerMock(); 3389 var mock = new HttpServerMock();
3597 api.ProjectsInstancesDatabasesResourceApi res = new api.SpannerApi(mock).p rojects.instances.databases; 3390 api.ProjectsInstancesDatabasesResourceApi res =
3391 new api.SpannerApi(mock).projects.instances.databases;
3598 var arg_request = buildUpdateDatabaseDdlRequest(); 3392 var arg_request = buildUpdateDatabaseDdlRequest();
3599 var arg_database = "foo"; 3393 var arg_database = "foo";
3600 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3394 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3601 var obj = new api.UpdateDatabaseDdlRequest.fromJson(json); 3395 var obj = new api.UpdateDatabaseDdlRequest.fromJson(json);
3602 checkUpdateDatabaseDdlRequest(obj); 3396 checkUpdateDatabaseDdlRequest(obj);
3603 3397
3604 var path = (req.url).path; 3398 var path = (req.url).path;
3605 var pathOffset = 0; 3399 var pathOffset = 0;
3606 var index; 3400 var index;
3607 var subPart; 3401 var subPart;
3608 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3402 unittest.expect(
3403 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3609 pathOffset += 1; 3404 pathOffset += 1;
3610 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3405 unittest.expect(
3406 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3611 pathOffset += 3; 3407 pathOffset += 3;
3612 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3408 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3613 3409
3614 var query = (req.url).query; 3410 var query = (req.url).query;
3615 var queryOffset = 0; 3411 var queryOffset = 0;
3616 var queryMap = {}; 3412 var queryMap = {};
3617 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3413 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3618 parseBool(n) { 3414 parseBool(n) {
3619 if (n == "true") return true; 3415 if (n == "true") return true;
3620 if (n == "false") return false; 3416 if (n == "false") return false;
3621 if (n == null) return null; 3417 if (n == null) return null;
3622 throw new core.ArgumentError("Invalid boolean: $n"); 3418 throw new core.ArgumentError("Invalid boolean: $n");
3623 } 3419 }
3420
3624 if (query.length > 0) { 3421 if (query.length > 0) {
3625 for (var part in query.split("&")) { 3422 for (var part in query.split("&")) {
3626 var keyvalue = part.split("="); 3423 var keyvalue = part.split("=");
3627 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3424 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3425 core.Uri.decodeQueryComponent(keyvalue[1]));
3628 } 3426 }
3629 } 3427 }
3630 3428
3631
3632 var h = { 3429 var h = {
3633 "content-type" : "application/json; charset=utf-8", 3430 "content-type": "application/json; charset=utf-8",
3634 }; 3431 };
3635 var resp = convert.JSON.encode(buildOperation()); 3432 var resp = convert.JSON.encode(buildOperation());
3636 return new async.Future.value(stringResponse(200, h, resp)); 3433 return new async.Future.value(stringResponse(200, h, resp));
3637 }), true); 3434 }), true);
3638 res.updateDdl(arg_request, arg_database).then(unittest.expectAsync1(((api. Operation response) { 3435 res
3436 .updateDdl(arg_request, arg_database)
3437 .then(unittest.expectAsync1(((api.Operation response) {
3639 checkOperation(response); 3438 checkOperation(response);
3640 }))); 3439 })));
3641 }); 3440 });
3642
3643 }); 3441 });
3644 3442
3645 3443 unittest.group("resource-ProjectsInstancesDatabasesOperationsResourceApi",
3646 unittest.group("resource-ProjectsInstancesDatabasesOperationsResourceApi", () { 3444 () {
3647 unittest.test("method--cancel", () { 3445 unittest.test("method--cancel", () {
3648
3649 var mock = new HttpServerMock(); 3446 var mock = new HttpServerMock();
3650 api.ProjectsInstancesDatabasesOperationsResourceApi res = new api.SpannerA pi(mock).projects.instances.databases.operations; 3447 api.ProjectsInstancesDatabasesOperationsResourceApi res =
3448 new api.SpannerApi(mock).projects.instances.databases.operations;
3651 var arg_name = "foo"; 3449 var arg_name = "foo";
3652 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3450 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3653 var path = (req.url).path; 3451 var path = (req.url).path;
3654 var pathOffset = 0; 3452 var pathOffset = 0;
3655 var index; 3453 var index;
3656 var subPart; 3454 var subPart;
3657 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3455 unittest.expect(
3456 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3658 pathOffset += 1; 3457 pathOffset += 1;
3659 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3458 unittest.expect(
3459 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3660 pathOffset += 3; 3460 pathOffset += 3;
3661 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3461 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3662 3462
3663 var query = (req.url).query; 3463 var query = (req.url).query;
3664 var queryOffset = 0; 3464 var queryOffset = 0;
3665 var queryMap = {}; 3465 var queryMap = {};
3666 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3466 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3667 parseBool(n) { 3467 parseBool(n) {
3668 if (n == "true") return true; 3468 if (n == "true") return true;
3669 if (n == "false") return false; 3469 if (n == "false") return false;
3670 if (n == null) return null; 3470 if (n == null) return null;
3671 throw new core.ArgumentError("Invalid boolean: $n"); 3471 throw new core.ArgumentError("Invalid boolean: $n");
3672 } 3472 }
3473
3673 if (query.length > 0) { 3474 if (query.length > 0) {
3674 for (var part in query.split("&")) { 3475 for (var part in query.split("&")) {
3675 var keyvalue = part.split("="); 3476 var keyvalue = part.split("=");
3676 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3477 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3478 core.Uri.decodeQueryComponent(keyvalue[1]));
3677 } 3479 }
3678 } 3480 }
3679 3481
3680
3681 var h = { 3482 var h = {
3682 "content-type" : "application/json; charset=utf-8", 3483 "content-type": "application/json; charset=utf-8",
3683 }; 3484 };
3684 var resp = convert.JSON.encode(buildEmpty()); 3485 var resp = convert.JSON.encode(buildEmpty());
3685 return new async.Future.value(stringResponse(200, h, resp)); 3486 return new async.Future.value(stringResponse(200, h, resp));
3686 }), true); 3487 }), true);
3687 res.cancel(arg_name).then(unittest.expectAsync1(((api.Empty response) { 3488 res.cancel(arg_name).then(unittest.expectAsync1(((api.Empty response) {
3688 checkEmpty(response); 3489 checkEmpty(response);
3689 }))); 3490 })));
3690 }); 3491 });
3691 3492
3692 unittest.test("method--delete", () { 3493 unittest.test("method--delete", () {
3693
3694 var mock = new HttpServerMock(); 3494 var mock = new HttpServerMock();
3695 api.ProjectsInstancesDatabasesOperationsResourceApi res = new api.SpannerA pi(mock).projects.instances.databases.operations; 3495 api.ProjectsInstancesDatabasesOperationsResourceApi res =
3496 new api.SpannerApi(mock).projects.instances.databases.operations;
3696 var arg_name = "foo"; 3497 var arg_name = "foo";
3697 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3498 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3698 var path = (req.url).path; 3499 var path = (req.url).path;
3699 var pathOffset = 0; 3500 var pathOffset = 0;
3700 var index; 3501 var index;
3701 var subPart; 3502 var subPart;
3702 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3503 unittest.expect(
3504 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3703 pathOffset += 1; 3505 pathOffset += 1;
3704 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3506 unittest.expect(
3507 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3705 pathOffset += 3; 3508 pathOffset += 3;
3706 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3509 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3707 3510
3708 var query = (req.url).query; 3511 var query = (req.url).query;
3709 var queryOffset = 0; 3512 var queryOffset = 0;
3710 var queryMap = {}; 3513 var queryMap = {};
3711 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3514 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3712 parseBool(n) { 3515 parseBool(n) {
3713 if (n == "true") return true; 3516 if (n == "true") return true;
3714 if (n == "false") return false; 3517 if (n == "false") return false;
3715 if (n == null) return null; 3518 if (n == null) return null;
3716 throw new core.ArgumentError("Invalid boolean: $n"); 3519 throw new core.ArgumentError("Invalid boolean: $n");
3717 } 3520 }
3521
3718 if (query.length > 0) { 3522 if (query.length > 0) {
3719 for (var part in query.split("&")) { 3523 for (var part in query.split("&")) {
3720 var keyvalue = part.split("="); 3524 var keyvalue = part.split("=");
3721 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3525 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3526 core.Uri.decodeQueryComponent(keyvalue[1]));
3722 } 3527 }
3723 } 3528 }
3724 3529
3725
3726 var h = { 3530 var h = {
3727 "content-type" : "application/json; charset=utf-8", 3531 "content-type": "application/json; charset=utf-8",
3728 }; 3532 };
3729 var resp = convert.JSON.encode(buildEmpty()); 3533 var resp = convert.JSON.encode(buildEmpty());
3730 return new async.Future.value(stringResponse(200, h, resp)); 3534 return new async.Future.value(stringResponse(200, h, resp));
3731 }), true); 3535 }), true);
3732 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) { 3536 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) {
3733 checkEmpty(response); 3537 checkEmpty(response);
3734 }))); 3538 })));
3735 }); 3539 });
3736 3540
3737 unittest.test("method--get", () { 3541 unittest.test("method--get", () {
3738
3739 var mock = new HttpServerMock(); 3542 var mock = new HttpServerMock();
3740 api.ProjectsInstancesDatabasesOperationsResourceApi res = new api.SpannerA pi(mock).projects.instances.databases.operations; 3543 api.ProjectsInstancesDatabasesOperationsResourceApi res =
3544 new api.SpannerApi(mock).projects.instances.databases.operations;
3741 var arg_name = "foo"; 3545 var arg_name = "foo";
3742 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3546 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3743 var path = (req.url).path; 3547 var path = (req.url).path;
3744 var pathOffset = 0; 3548 var pathOffset = 0;
3745 var index; 3549 var index;
3746 var subPart; 3550 var subPart;
3747 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3551 unittest.expect(
3552 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3748 pathOffset += 1; 3553 pathOffset += 1;
3749 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3554 unittest.expect(
3555 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3750 pathOffset += 3; 3556 pathOffset += 3;
3751 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3557 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3752 3558
3753 var query = (req.url).query; 3559 var query = (req.url).query;
3754 var queryOffset = 0; 3560 var queryOffset = 0;
3755 var queryMap = {}; 3561 var queryMap = {};
3756 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3562 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3757 parseBool(n) { 3563 parseBool(n) {
3758 if (n == "true") return true; 3564 if (n == "true") return true;
3759 if (n == "false") return false; 3565 if (n == "false") return false;
3760 if (n == null) return null; 3566 if (n == null) return null;
3761 throw new core.ArgumentError("Invalid boolean: $n"); 3567 throw new core.ArgumentError("Invalid boolean: $n");
3762 } 3568 }
3569
3763 if (query.length > 0) { 3570 if (query.length > 0) {
3764 for (var part in query.split("&")) { 3571 for (var part in query.split("&")) {
3765 var keyvalue = part.split("="); 3572 var keyvalue = part.split("=");
3766 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3573 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3574 core.Uri.decodeQueryComponent(keyvalue[1]));
3767 } 3575 }
3768 } 3576 }
3769 3577
3770
3771 var h = { 3578 var h = {
3772 "content-type" : "application/json; charset=utf-8", 3579 "content-type": "application/json; charset=utf-8",
3773 }; 3580 };
3774 var resp = convert.JSON.encode(buildOperation()); 3581 var resp = convert.JSON.encode(buildOperation());
3775 return new async.Future.value(stringResponse(200, h, resp)); 3582 return new async.Future.value(stringResponse(200, h, resp));
3776 }), true); 3583 }), true);
3777 res.get(arg_name).then(unittest.expectAsync1(((api.Operation response) { 3584 res.get(arg_name).then(unittest.expectAsync1(((api.Operation response) {
3778 checkOperation(response); 3585 checkOperation(response);
3779 }))); 3586 })));
3780 }); 3587 });
3781 3588
3782 unittest.test("method--list", () { 3589 unittest.test("method--list", () {
3783
3784 var mock = new HttpServerMock(); 3590 var mock = new HttpServerMock();
3785 api.ProjectsInstancesDatabasesOperationsResourceApi res = new api.SpannerA pi(mock).projects.instances.databases.operations; 3591 api.ProjectsInstancesDatabasesOperationsResourceApi res =
3592 new api.SpannerApi(mock).projects.instances.databases.operations;
3786 var arg_name = "foo"; 3593 var arg_name = "foo";
3594 var arg_filter = "foo";
3787 var arg_pageToken = "foo"; 3595 var arg_pageToken = "foo";
3788 var arg_pageSize = 42; 3596 var arg_pageSize = 42;
3789 var arg_filter = "foo";
3790 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3597 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3791 var path = (req.url).path; 3598 var path = (req.url).path;
3792 var pathOffset = 0; 3599 var pathOffset = 0;
3793 var index; 3600 var index;
3794 var subPart; 3601 var subPart;
3795 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3602 unittest.expect(
3603 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3796 pathOffset += 1; 3604 pathOffset += 1;
3797 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3605 unittest.expect(
3606 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3798 pathOffset += 3; 3607 pathOffset += 3;
3799 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3608 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3800 3609
3801 var query = (req.url).query; 3610 var query = (req.url).query;
3802 var queryOffset = 0; 3611 var queryOffset = 0;
3803 var queryMap = {}; 3612 var queryMap = {};
3804 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3613 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3805 parseBool(n) { 3614 parseBool(n) {
3806 if (n == "true") return true; 3615 if (n == "true") return true;
3807 if (n == "false") return false; 3616 if (n == "false") return false;
3808 if (n == null) return null; 3617 if (n == null) return null;
3809 throw new core.ArgumentError("Invalid boolean: $n"); 3618 throw new core.ArgumentError("Invalid boolean: $n");
3810 } 3619 }
3620
3811 if (query.length > 0) { 3621 if (query.length > 0) {
3812 for (var part in query.split("&")) { 3622 for (var part in query.split("&")) {
3813 var keyvalue = part.split("="); 3623 var keyvalue = part.split("=");
3814 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3624 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3625 core.Uri.decodeQueryComponent(keyvalue[1]));
3815 } 3626 }
3816 } 3627 }
3817 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
3818 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize));
3819 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); 3628 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter));
3820 3629 unittest.expect(
3630 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
3631 unittest.expect(core.int.parse(queryMap["pageSize"].first),
3632 unittest.equals(arg_pageSize));
3821 3633
3822 var h = { 3634 var h = {
3823 "content-type" : "application/json; charset=utf-8", 3635 "content-type": "application/json; charset=utf-8",
3824 }; 3636 };
3825 var resp = convert.JSON.encode(buildListOperationsResponse()); 3637 var resp = convert.JSON.encode(buildListOperationsResponse());
3826 return new async.Future.value(stringResponse(200, h, resp)); 3638 return new async.Future.value(stringResponse(200, h, resp));
3827 }), true); 3639 }), true);
3828 res.list(arg_name, pageToken: arg_pageToken, pageSize: arg_pageSize, filte r: arg_filter).then(unittest.expectAsync1(((api.ListOperationsResponse response) { 3640 res
3641 .list(arg_name,
3642 filter: arg_filter,
3643 pageToken: arg_pageToken,
3644 pageSize: arg_pageSize)
3645 .then(unittest.expectAsync1(((api.ListOperationsResponse response) {
3829 checkListOperationsResponse(response); 3646 checkListOperationsResponse(response);
3830 }))); 3647 })));
3831 }); 3648 });
3832
3833 }); 3649 });
3834 3650
3835
3836 unittest.group("resource-ProjectsInstancesDatabasesSessionsResourceApi", () { 3651 unittest.group("resource-ProjectsInstancesDatabasesSessionsResourceApi", () {
3837 unittest.test("method--beginTransaction", () { 3652 unittest.test("method--beginTransaction", () {
3838
3839 var mock = new HttpServerMock(); 3653 var mock = new HttpServerMock();
3840 api.ProjectsInstancesDatabasesSessionsResourceApi res = new api.SpannerApi (mock).projects.instances.databases.sessions; 3654 api.ProjectsInstancesDatabasesSessionsResourceApi res =
3655 new api.SpannerApi(mock).projects.instances.databases.sessions;
3841 var arg_request = buildBeginTransactionRequest(); 3656 var arg_request = buildBeginTransactionRequest();
3842 var arg_session = "foo"; 3657 var arg_session = "foo";
3843 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3658 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3844 var obj = new api.BeginTransactionRequest.fromJson(json); 3659 var obj = new api.BeginTransactionRequest.fromJson(json);
3845 checkBeginTransactionRequest(obj); 3660 checkBeginTransactionRequest(obj);
3846 3661
3847 var path = (req.url).path; 3662 var path = (req.url).path;
3848 var pathOffset = 0; 3663 var pathOffset = 0;
3849 var index; 3664 var index;
3850 var subPart; 3665 var subPart;
3851 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3666 unittest.expect(
3667 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3852 pathOffset += 1; 3668 pathOffset += 1;
3853 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3669 unittest.expect(
3670 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3854 pathOffset += 3; 3671 pathOffset += 3;
3855 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3672 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3856 3673
3857 var query = (req.url).query; 3674 var query = (req.url).query;
3858 var queryOffset = 0; 3675 var queryOffset = 0;
3859 var queryMap = {}; 3676 var queryMap = {};
3860 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3677 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3861 parseBool(n) { 3678 parseBool(n) {
3862 if (n == "true") return true; 3679 if (n == "true") return true;
3863 if (n == "false") return false; 3680 if (n == "false") return false;
3864 if (n == null) return null; 3681 if (n == null) return null;
3865 throw new core.ArgumentError("Invalid boolean: $n"); 3682 throw new core.ArgumentError("Invalid boolean: $n");
3866 } 3683 }
3684
3867 if (query.length > 0) { 3685 if (query.length > 0) {
3868 for (var part in query.split("&")) { 3686 for (var part in query.split("&")) {
3869 var keyvalue = part.split("="); 3687 var keyvalue = part.split("=");
3870 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3688 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3689 core.Uri.decodeQueryComponent(keyvalue[1]));
3871 } 3690 }
3872 } 3691 }
3873 3692
3874
3875 var h = { 3693 var h = {
3876 "content-type" : "application/json; charset=utf-8", 3694 "content-type": "application/json; charset=utf-8",
3877 }; 3695 };
3878 var resp = convert.JSON.encode(buildTransaction()); 3696 var resp = convert.JSON.encode(buildTransaction());
3879 return new async.Future.value(stringResponse(200, h, resp)); 3697 return new async.Future.value(stringResponse(200, h, resp));
3880 }), true); 3698 }), true);
3881 res.beginTransaction(arg_request, arg_session).then(unittest.expectAsync1( ((api.Transaction response) { 3699 res
3700 .beginTransaction(arg_request, arg_session)
3701 .then(unittest.expectAsync1(((api.Transaction response) {
3882 checkTransaction(response); 3702 checkTransaction(response);
3883 }))); 3703 })));
3884 }); 3704 });
3885 3705
3886 unittest.test("method--commit", () { 3706 unittest.test("method--commit", () {
3887
3888 var mock = new HttpServerMock(); 3707 var mock = new HttpServerMock();
3889 api.ProjectsInstancesDatabasesSessionsResourceApi res = new api.SpannerApi (mock).projects.instances.databases.sessions; 3708 api.ProjectsInstancesDatabasesSessionsResourceApi res =
3709 new api.SpannerApi(mock).projects.instances.databases.sessions;
3890 var arg_request = buildCommitRequest(); 3710 var arg_request = buildCommitRequest();
3891 var arg_session = "foo"; 3711 var arg_session = "foo";
3892 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3712 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3893 var obj = new api.CommitRequest.fromJson(json); 3713 var obj = new api.CommitRequest.fromJson(json);
3894 checkCommitRequest(obj); 3714 checkCommitRequest(obj);
3895 3715
3896 var path = (req.url).path; 3716 var path = (req.url).path;
3897 var pathOffset = 0; 3717 var pathOffset = 0;
3898 var index; 3718 var index;
3899 var subPart; 3719 var subPart;
3900 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3720 unittest.expect(
3721 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3901 pathOffset += 1; 3722 pathOffset += 1;
3902 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3723 unittest.expect(
3724 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3903 pathOffset += 3; 3725 pathOffset += 3;
3904 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3726 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3905 3727
3906 var query = (req.url).query; 3728 var query = (req.url).query;
3907 var queryOffset = 0; 3729 var queryOffset = 0;
3908 var queryMap = {}; 3730 var queryMap = {};
3909 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3731 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3910 parseBool(n) { 3732 parseBool(n) {
3911 if (n == "true") return true; 3733 if (n == "true") return true;
3912 if (n == "false") return false; 3734 if (n == "false") return false;
3913 if (n == null) return null; 3735 if (n == null) return null;
3914 throw new core.ArgumentError("Invalid boolean: $n"); 3736 throw new core.ArgumentError("Invalid boolean: $n");
3915 } 3737 }
3738
3916 if (query.length > 0) { 3739 if (query.length > 0) {
3917 for (var part in query.split("&")) { 3740 for (var part in query.split("&")) {
3918 var keyvalue = part.split("="); 3741 var keyvalue = part.split("=");
3919 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3742 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3743 core.Uri.decodeQueryComponent(keyvalue[1]));
3920 } 3744 }
3921 } 3745 }
3922 3746
3923
3924 var h = { 3747 var h = {
3925 "content-type" : "application/json; charset=utf-8", 3748 "content-type": "application/json; charset=utf-8",
3926 }; 3749 };
3927 var resp = convert.JSON.encode(buildCommitResponse()); 3750 var resp = convert.JSON.encode(buildCommitResponse());
3928 return new async.Future.value(stringResponse(200, h, resp)); 3751 return new async.Future.value(stringResponse(200, h, resp));
3929 }), true); 3752 }), true);
3930 res.commit(arg_request, arg_session).then(unittest.expectAsync1(((api.Comm itResponse response) { 3753 res
3754 .commit(arg_request, arg_session)
3755 .then(unittest.expectAsync1(((api.CommitResponse response) {
3931 checkCommitResponse(response); 3756 checkCommitResponse(response);
3932 }))); 3757 })));
3933 }); 3758 });
3934 3759
3935 unittest.test("method--create", () { 3760 unittest.test("method--create", () {
3936
3937 var mock = new HttpServerMock(); 3761 var mock = new HttpServerMock();
3938 api.ProjectsInstancesDatabasesSessionsResourceApi res = new api.SpannerApi (mock).projects.instances.databases.sessions; 3762 api.ProjectsInstancesDatabasesSessionsResourceApi res =
3763 new api.SpannerApi(mock).projects.instances.databases.sessions;
3939 var arg_database = "foo"; 3764 var arg_database = "foo";
3940 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3765 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3941 var path = (req.url).path; 3766 var path = (req.url).path;
3942 var pathOffset = 0; 3767 var pathOffset = 0;
3943 var index; 3768 var index;
3944 var subPart; 3769 var subPart;
3945 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3770 unittest.expect(
3771 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3946 pathOffset += 1; 3772 pathOffset += 1;
3947 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3773 unittest.expect(
3774 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3948 pathOffset += 3; 3775 pathOffset += 3;
3949 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3776 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3950 3777
3951 var query = (req.url).query; 3778 var query = (req.url).query;
3952 var queryOffset = 0; 3779 var queryOffset = 0;
3953 var queryMap = {}; 3780 var queryMap = {};
3954 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3781 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3955 parseBool(n) { 3782 parseBool(n) {
3956 if (n == "true") return true; 3783 if (n == "true") return true;
3957 if (n == "false") return false; 3784 if (n == "false") return false;
3958 if (n == null) return null; 3785 if (n == null) return null;
3959 throw new core.ArgumentError("Invalid boolean: $n"); 3786 throw new core.ArgumentError("Invalid boolean: $n");
3960 } 3787 }
3788
3961 if (query.length > 0) { 3789 if (query.length > 0) {
3962 for (var part in query.split("&")) { 3790 for (var part in query.split("&")) {
3963 var keyvalue = part.split("="); 3791 var keyvalue = part.split("=");
3964 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3792 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3793 core.Uri.decodeQueryComponent(keyvalue[1]));
3965 } 3794 }
3966 } 3795 }
3967 3796
3968
3969 var h = { 3797 var h = {
3970 "content-type" : "application/json; charset=utf-8", 3798 "content-type": "application/json; charset=utf-8",
3971 }; 3799 };
3972 var resp = convert.JSON.encode(buildSession()); 3800 var resp = convert.JSON.encode(buildSession());
3973 return new async.Future.value(stringResponse(200, h, resp)); 3801 return new async.Future.value(stringResponse(200, h, resp));
3974 }), true); 3802 }), true);
3975 res.create(arg_database).then(unittest.expectAsync1(((api.Session response ) { 3803 res
3804 .create(arg_database)
3805 .then(unittest.expectAsync1(((api.Session response) {
3976 checkSession(response); 3806 checkSession(response);
3977 }))); 3807 })));
3978 }); 3808 });
3979 3809
3980 unittest.test("method--delete", () { 3810 unittest.test("method--delete", () {
3981
3982 var mock = new HttpServerMock(); 3811 var mock = new HttpServerMock();
3983 api.ProjectsInstancesDatabasesSessionsResourceApi res = new api.SpannerApi (mock).projects.instances.databases.sessions; 3812 api.ProjectsInstancesDatabasesSessionsResourceApi res =
3813 new api.SpannerApi(mock).projects.instances.databases.sessions;
3984 var arg_name = "foo"; 3814 var arg_name = "foo";
3985 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3815 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3986 var path = (req.url).path; 3816 var path = (req.url).path;
3987 var pathOffset = 0; 3817 var pathOffset = 0;
3988 var index; 3818 var index;
3989 var subPart; 3819 var subPart;
3990 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3820 unittest.expect(
3821 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3991 pathOffset += 1; 3822 pathOffset += 1;
3992 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3823 unittest.expect(
3824 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
3993 pathOffset += 3; 3825 pathOffset += 3;
3994 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3826 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3995 3827
3996 var query = (req.url).query; 3828 var query = (req.url).query;
3997 var queryOffset = 0; 3829 var queryOffset = 0;
3998 var queryMap = {}; 3830 var queryMap = {};
3999 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3831 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4000 parseBool(n) { 3832 parseBool(n) {
4001 if (n == "true") return true; 3833 if (n == "true") return true;
4002 if (n == "false") return false; 3834 if (n == "false") return false;
4003 if (n == null) return null; 3835 if (n == null) return null;
4004 throw new core.ArgumentError("Invalid boolean: $n"); 3836 throw new core.ArgumentError("Invalid boolean: $n");
4005 } 3837 }
3838
4006 if (query.length > 0) { 3839 if (query.length > 0) {
4007 for (var part in query.split("&")) { 3840 for (var part in query.split("&")) {
4008 var keyvalue = part.split("="); 3841 var keyvalue = part.split("=");
4009 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3842 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3843 core.Uri.decodeQueryComponent(keyvalue[1]));
4010 } 3844 }
4011 } 3845 }
4012 3846
4013
4014 var h = { 3847 var h = {
4015 "content-type" : "application/json; charset=utf-8", 3848 "content-type": "application/json; charset=utf-8",
4016 }; 3849 };
4017 var resp = convert.JSON.encode(buildEmpty()); 3850 var resp = convert.JSON.encode(buildEmpty());
4018 return new async.Future.value(stringResponse(200, h, resp)); 3851 return new async.Future.value(stringResponse(200, h, resp));
4019 }), true); 3852 }), true);
4020 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) { 3853 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) {
4021 checkEmpty(response); 3854 checkEmpty(response);
4022 }))); 3855 })));
4023 }); 3856 });
4024 3857
4025 unittest.test("method--executeSql", () { 3858 unittest.test("method--executeSql", () {
4026
4027 var mock = new HttpServerMock(); 3859 var mock = new HttpServerMock();
4028 api.ProjectsInstancesDatabasesSessionsResourceApi res = new api.SpannerApi (mock).projects.instances.databases.sessions; 3860 api.ProjectsInstancesDatabasesSessionsResourceApi res =
3861 new api.SpannerApi(mock).projects.instances.databases.sessions;
4029 var arg_request = buildExecuteSqlRequest(); 3862 var arg_request = buildExecuteSqlRequest();
4030 var arg_session = "foo"; 3863 var arg_session = "foo";
4031 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3864 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
4032 var obj = new api.ExecuteSqlRequest.fromJson(json); 3865 var obj = new api.ExecuteSqlRequest.fromJson(json);
4033 checkExecuteSqlRequest(obj); 3866 checkExecuteSqlRequest(obj);
4034 3867
4035 var path = (req.url).path; 3868 var path = (req.url).path;
4036 var pathOffset = 0; 3869 var pathOffset = 0;
4037 var index; 3870 var index;
4038 var subPart; 3871 var subPart;
4039 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3872 unittest.expect(
3873 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
4040 pathOffset += 1; 3874 pathOffset += 1;
4041 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3875 unittest.expect(
3876 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
4042 pathOffset += 3; 3877 pathOffset += 3;
4043 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3878 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
4044 3879
4045 var query = (req.url).query; 3880 var query = (req.url).query;
4046 var queryOffset = 0; 3881 var queryOffset = 0;
4047 var queryMap = {}; 3882 var queryMap = {};
4048 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3883 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4049 parseBool(n) { 3884 parseBool(n) {
4050 if (n == "true") return true; 3885 if (n == "true") return true;
4051 if (n == "false") return false; 3886 if (n == "false") return false;
4052 if (n == null) return null; 3887 if (n == null) return null;
4053 throw new core.ArgumentError("Invalid boolean: $n"); 3888 throw new core.ArgumentError("Invalid boolean: $n");
4054 } 3889 }
3890
4055 if (query.length > 0) { 3891 if (query.length > 0) {
4056 for (var part in query.split("&")) { 3892 for (var part in query.split("&")) {
4057 var keyvalue = part.split("="); 3893 var keyvalue = part.split("=");
4058 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3894 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3895 core.Uri.decodeQueryComponent(keyvalue[1]));
4059 } 3896 }
4060 } 3897 }
4061 3898
4062
4063 var h = { 3899 var h = {
4064 "content-type" : "application/json; charset=utf-8", 3900 "content-type": "application/json; charset=utf-8",
4065 }; 3901 };
4066 var resp = convert.JSON.encode(buildResultSet()); 3902 var resp = convert.JSON.encode(buildResultSet());
4067 return new async.Future.value(stringResponse(200, h, resp)); 3903 return new async.Future.value(stringResponse(200, h, resp));
4068 }), true); 3904 }), true);
4069 res.executeSql(arg_request, arg_session).then(unittest.expectAsync1(((api. ResultSet response) { 3905 res
3906 .executeSql(arg_request, arg_session)
3907 .then(unittest.expectAsync1(((api.ResultSet response) {
4070 checkResultSet(response); 3908 checkResultSet(response);
4071 }))); 3909 })));
4072 }); 3910 });
4073 3911
4074 unittest.test("method--executeStreamingSql", () { 3912 unittest.test("method--executeStreamingSql", () {
4075
4076 var mock = new HttpServerMock(); 3913 var mock = new HttpServerMock();
4077 api.ProjectsInstancesDatabasesSessionsResourceApi res = new api.SpannerApi (mock).projects.instances.databases.sessions; 3914 api.ProjectsInstancesDatabasesSessionsResourceApi res =
3915 new api.SpannerApi(mock).projects.instances.databases.sessions;
4078 var arg_request = buildExecuteSqlRequest(); 3916 var arg_request = buildExecuteSqlRequest();
4079 var arg_session = "foo"; 3917 var arg_session = "foo";
4080 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3918 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
4081 var obj = new api.ExecuteSqlRequest.fromJson(json); 3919 var obj = new api.ExecuteSqlRequest.fromJson(json);
4082 checkExecuteSqlRequest(obj); 3920 checkExecuteSqlRequest(obj);
4083 3921
4084 var path = (req.url).path; 3922 var path = (req.url).path;
4085 var pathOffset = 0; 3923 var pathOffset = 0;
4086 var index; 3924 var index;
4087 var subPart; 3925 var subPart;
4088 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3926 unittest.expect(
3927 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
4089 pathOffset += 1; 3928 pathOffset += 1;
4090 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3929 unittest.expect(
3930 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
4091 pathOffset += 3; 3931 pathOffset += 3;
4092 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3932 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
4093 3933
4094 var query = (req.url).query; 3934 var query = (req.url).query;
4095 var queryOffset = 0; 3935 var queryOffset = 0;
4096 var queryMap = {}; 3936 var queryMap = {};
4097 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3937 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4098 parseBool(n) { 3938 parseBool(n) {
4099 if (n == "true") return true; 3939 if (n == "true") return true;
4100 if (n == "false") return false; 3940 if (n == "false") return false;
4101 if (n == null) return null; 3941 if (n == null) return null;
4102 throw new core.ArgumentError("Invalid boolean: $n"); 3942 throw new core.ArgumentError("Invalid boolean: $n");
4103 } 3943 }
3944
4104 if (query.length > 0) { 3945 if (query.length > 0) {
4105 for (var part in query.split("&")) { 3946 for (var part in query.split("&")) {
4106 var keyvalue = part.split("="); 3947 var keyvalue = part.split("=");
4107 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3948 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3949 core.Uri.decodeQueryComponent(keyvalue[1]));
4108 } 3950 }
4109 } 3951 }
4110 3952
4111
4112 var h = { 3953 var h = {
4113 "content-type" : "application/json; charset=utf-8", 3954 "content-type": "application/json; charset=utf-8",
4114 }; 3955 };
4115 var resp = convert.JSON.encode(buildPartialResultSet()); 3956 var resp = convert.JSON.encode(buildPartialResultSet());
4116 return new async.Future.value(stringResponse(200, h, resp)); 3957 return new async.Future.value(stringResponse(200, h, resp));
4117 }), true); 3958 }), true);
4118 res.executeStreamingSql(arg_request, arg_session).then(unittest.expectAsyn c1(((api.PartialResultSet response) { 3959 res
3960 .executeStreamingSql(arg_request, arg_session)
3961 .then(unittest.expectAsync1(((api.PartialResultSet response) {
4119 checkPartialResultSet(response); 3962 checkPartialResultSet(response);
4120 }))); 3963 })));
4121 }); 3964 });
4122 3965
4123 unittest.test("method--get", () { 3966 unittest.test("method--get", () {
4124
4125 var mock = new HttpServerMock(); 3967 var mock = new HttpServerMock();
4126 api.ProjectsInstancesDatabasesSessionsResourceApi res = new api.SpannerApi (mock).projects.instances.databases.sessions; 3968 api.ProjectsInstancesDatabasesSessionsResourceApi res =
3969 new api.SpannerApi(mock).projects.instances.databases.sessions;
4127 var arg_name = "foo"; 3970 var arg_name = "foo";
4128 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3971 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
4129 var path = (req.url).path; 3972 var path = (req.url).path;
4130 var pathOffset = 0; 3973 var pathOffset = 0;
4131 var index; 3974 var index;
4132 var subPart; 3975 var subPart;
4133 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3976 unittest.expect(
3977 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
4134 pathOffset += 1; 3978 pathOffset += 1;
4135 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 3979 unittest.expect(
3980 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
4136 pathOffset += 3; 3981 pathOffset += 3;
4137 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 3982 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
4138 3983
4139 var query = (req.url).query; 3984 var query = (req.url).query;
4140 var queryOffset = 0; 3985 var queryOffset = 0;
4141 var queryMap = {}; 3986 var queryMap = {};
4142 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3987 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4143 parseBool(n) { 3988 parseBool(n) {
4144 if (n == "true") return true; 3989 if (n == "true") return true;
4145 if (n == "false") return false; 3990 if (n == "false") return false;
4146 if (n == null) return null; 3991 if (n == null) return null;
4147 throw new core.ArgumentError("Invalid boolean: $n"); 3992 throw new core.ArgumentError("Invalid boolean: $n");
4148 } 3993 }
3994
4149 if (query.length > 0) { 3995 if (query.length > 0) {
4150 for (var part in query.split("&")) { 3996 for (var part in query.split("&")) {
4151 var keyvalue = part.split("="); 3997 var keyvalue = part.split("=");
4152 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3998 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3999 core.Uri.decodeQueryComponent(keyvalue[1]));
4153 } 4000 }
4154 } 4001 }
4155 4002
4156
4157 var h = { 4003 var h = {
4158 "content-type" : "application/json; charset=utf-8", 4004 "content-type": "application/json; charset=utf-8",
4159 }; 4005 };
4160 var resp = convert.JSON.encode(buildSession()); 4006 var resp = convert.JSON.encode(buildSession());
4161 return new async.Future.value(stringResponse(200, h, resp)); 4007 return new async.Future.value(stringResponse(200, h, resp));
4162 }), true); 4008 }), true);
4163 res.get(arg_name).then(unittest.expectAsync1(((api.Session response) { 4009 res.get(arg_name).then(unittest.expectAsync1(((api.Session response) {
4164 checkSession(response); 4010 checkSession(response);
4165 }))); 4011 })));
4166 }); 4012 });
4167 4013
4168 unittest.test("method--read", () { 4014 unittest.test("method--read", () {
4169
4170 var mock = new HttpServerMock(); 4015 var mock = new HttpServerMock();
4171 api.ProjectsInstancesDatabasesSessionsResourceApi res = new api.SpannerApi (mock).projects.instances.databases.sessions; 4016 api.ProjectsInstancesDatabasesSessionsResourceApi res =
4017 new api.SpannerApi(mock).projects.instances.databases.sessions;
4172 var arg_request = buildReadRequest(); 4018 var arg_request = buildReadRequest();
4173 var arg_session = "foo"; 4019 var arg_session = "foo";
4174 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 4020 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
4175 var obj = new api.ReadRequest.fromJson(json); 4021 var obj = new api.ReadRequest.fromJson(json);
4176 checkReadRequest(obj); 4022 checkReadRequest(obj);
4177 4023
4178 var path = (req.url).path; 4024 var path = (req.url).path;
4179 var pathOffset = 0; 4025 var pathOffset = 0;
4180 var index; 4026 var index;
4181 var subPart; 4027 var subPart;
4182 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 4028 unittest.expect(
4029 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
4183 pathOffset += 1; 4030 pathOffset += 1;
4184 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 4031 unittest.expect(
4032 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
4185 pathOffset += 3; 4033 pathOffset += 3;
4186 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 4034 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
4187 4035
4188 var query = (req.url).query; 4036 var query = (req.url).query;
4189 var queryOffset = 0; 4037 var queryOffset = 0;
4190 var queryMap = {}; 4038 var queryMap = {};
4191 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 4039 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4192 parseBool(n) { 4040 parseBool(n) {
4193 if (n == "true") return true; 4041 if (n == "true") return true;
4194 if (n == "false") return false; 4042 if (n == "false") return false;
4195 if (n == null) return null; 4043 if (n == null) return null;
4196 throw new core.ArgumentError("Invalid boolean: $n"); 4044 throw new core.ArgumentError("Invalid boolean: $n");
4197 } 4045 }
4046
4198 if (query.length > 0) { 4047 if (query.length > 0) {
4199 for (var part in query.split("&")) { 4048 for (var part in query.split("&")) {
4200 var keyvalue = part.split("="); 4049 var keyvalue = part.split("=");
4201 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 4050 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
4051 core.Uri.decodeQueryComponent(keyvalue[1]));
4202 } 4052 }
4203 } 4053 }
4204 4054
4205
4206 var h = { 4055 var h = {
4207 "content-type" : "application/json; charset=utf-8", 4056 "content-type": "application/json; charset=utf-8",
4208 }; 4057 };
4209 var resp = convert.JSON.encode(buildResultSet()); 4058 var resp = convert.JSON.encode(buildResultSet());
4210 return new async.Future.value(stringResponse(200, h, resp)); 4059 return new async.Future.value(stringResponse(200, h, resp));
4211 }), true); 4060 }), true);
4212 res.read(arg_request, arg_session).then(unittest.expectAsync1(((api.Result Set response) { 4061 res
4062 .read(arg_request, arg_session)
4063 .then(unittest.expectAsync1(((api.ResultSet response) {
4213 checkResultSet(response); 4064 checkResultSet(response);
4214 }))); 4065 })));
4215 }); 4066 });
4216 4067
4217 unittest.test("method--rollback", () { 4068 unittest.test("method--rollback", () {
4218
4219 var mock = new HttpServerMock(); 4069 var mock = new HttpServerMock();
4220 api.ProjectsInstancesDatabasesSessionsResourceApi res = new api.SpannerApi (mock).projects.instances.databases.sessions; 4070 api.ProjectsInstancesDatabasesSessionsResourceApi res =
4071 new api.SpannerApi(mock).projects.instances.databases.sessions;
4221 var arg_request = buildRollbackRequest(); 4072 var arg_request = buildRollbackRequest();
4222 var arg_session = "foo"; 4073 var arg_session = "foo";
4223 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 4074 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
4224 var obj = new api.RollbackRequest.fromJson(json); 4075 var obj = new api.RollbackRequest.fromJson(json);
4225 checkRollbackRequest(obj); 4076 checkRollbackRequest(obj);
4226 4077
4227 var path = (req.url).path; 4078 var path = (req.url).path;
4228 var pathOffset = 0; 4079 var pathOffset = 0;
4229 var index; 4080 var index;
4230 var subPart; 4081 var subPart;
4231 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 4082 unittest.expect(
4083 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
4232 pathOffset += 1; 4084 pathOffset += 1;
4233 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 4085 unittest.expect(
4086 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
4234 pathOffset += 3; 4087 pathOffset += 3;
4235 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 4088 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
4236 4089
4237 var query = (req.url).query; 4090 var query = (req.url).query;
4238 var queryOffset = 0; 4091 var queryOffset = 0;
4239 var queryMap = {}; 4092 var queryMap = {};
4240 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 4093 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4241 parseBool(n) { 4094 parseBool(n) {
4242 if (n == "true") return true; 4095 if (n == "true") return true;
4243 if (n == "false") return false; 4096 if (n == "false") return false;
4244 if (n == null) return null; 4097 if (n == null) return null;
4245 throw new core.ArgumentError("Invalid boolean: $n"); 4098 throw new core.ArgumentError("Invalid boolean: $n");
4246 } 4099 }
4100
4247 if (query.length > 0) { 4101 if (query.length > 0) {
4248 for (var part in query.split("&")) { 4102 for (var part in query.split("&")) {
4249 var keyvalue = part.split("="); 4103 var keyvalue = part.split("=");
4250 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 4104 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
4105 core.Uri.decodeQueryComponent(keyvalue[1]));
4251 } 4106 }
4252 } 4107 }
4253 4108
4254
4255 var h = { 4109 var h = {
4256 "content-type" : "application/json; charset=utf-8", 4110 "content-type": "application/json; charset=utf-8",
4257 }; 4111 };
4258 var resp = convert.JSON.encode(buildEmpty()); 4112 var resp = convert.JSON.encode(buildEmpty());
4259 return new async.Future.value(stringResponse(200, h, resp)); 4113 return new async.Future.value(stringResponse(200, h, resp));
4260 }), true); 4114 }), true);
4261 res.rollback(arg_request, arg_session).then(unittest.expectAsync1(((api.Em pty response) { 4115 res
4116 .rollback(arg_request, arg_session)
4117 .then(unittest.expectAsync1(((api.Empty response) {
4262 checkEmpty(response); 4118 checkEmpty(response);
4263 }))); 4119 })));
4264 }); 4120 });
4265 4121
4266 unittest.test("method--streamingRead", () { 4122 unittest.test("method--streamingRead", () {
4267
4268 var mock = new HttpServerMock(); 4123 var mock = new HttpServerMock();
4269 api.ProjectsInstancesDatabasesSessionsResourceApi res = new api.SpannerApi (mock).projects.instances.databases.sessions; 4124 api.ProjectsInstancesDatabasesSessionsResourceApi res =
4125 new api.SpannerApi(mock).projects.instances.databases.sessions;
4270 var arg_request = buildReadRequest(); 4126 var arg_request = buildReadRequest();
4271 var arg_session = "foo"; 4127 var arg_session = "foo";
4272 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 4128 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
4273 var obj = new api.ReadRequest.fromJson(json); 4129 var obj = new api.ReadRequest.fromJson(json);
4274 checkReadRequest(obj); 4130 checkReadRequest(obj);
4275 4131
4276 var path = (req.url).path; 4132 var path = (req.url).path;
4277 var pathOffset = 0; 4133 var pathOffset = 0;
4278 var index; 4134 var index;
4279 var subPart; 4135 var subPart;
4280 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 4136 unittest.expect(
4137 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
4281 pathOffset += 1; 4138 pathOffset += 1;
4282 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 4139 unittest.expect(
4140 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
4283 pathOffset += 3; 4141 pathOffset += 3;
4284 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 4142 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
4285 4143
4286 var query = (req.url).query; 4144 var query = (req.url).query;
4287 var queryOffset = 0; 4145 var queryOffset = 0;
4288 var queryMap = {}; 4146 var queryMap = {};
4289 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 4147 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4290 parseBool(n) { 4148 parseBool(n) {
4291 if (n == "true") return true; 4149 if (n == "true") return true;
4292 if (n == "false") return false; 4150 if (n == "false") return false;
4293 if (n == null) return null; 4151 if (n == null) return null;
4294 throw new core.ArgumentError("Invalid boolean: $n"); 4152 throw new core.ArgumentError("Invalid boolean: $n");
4295 } 4153 }
4154
4296 if (query.length > 0) { 4155 if (query.length > 0) {
4297 for (var part in query.split("&")) { 4156 for (var part in query.split("&")) {
4298 var keyvalue = part.split("="); 4157 var keyvalue = part.split("=");
4299 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 4158 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
4159 core.Uri.decodeQueryComponent(keyvalue[1]));
4300 } 4160 }
4301 } 4161 }
4302 4162
4303
4304 var h = { 4163 var h = {
4305 "content-type" : "application/json; charset=utf-8", 4164 "content-type": "application/json; charset=utf-8",
4306 }; 4165 };
4307 var resp = convert.JSON.encode(buildPartialResultSet()); 4166 var resp = convert.JSON.encode(buildPartialResultSet());
4308 return new async.Future.value(stringResponse(200, h, resp)); 4167 return new async.Future.value(stringResponse(200, h, resp));
4309 }), true); 4168 }), true);
4310 res.streamingRead(arg_request, arg_session).then(unittest.expectAsync1(((a pi.PartialResultSet response) { 4169 res
4170 .streamingRead(arg_request, arg_session)
4171 .then(unittest.expectAsync1(((api.PartialResultSet response) {
4311 checkPartialResultSet(response); 4172 checkPartialResultSet(response);
4312 }))); 4173 })));
4313 }); 4174 });
4314
4315 }); 4175 });
4316 4176
4317
4318 unittest.group("resource-ProjectsInstancesOperationsResourceApi", () { 4177 unittest.group("resource-ProjectsInstancesOperationsResourceApi", () {
4319 unittest.test("method--cancel", () { 4178 unittest.test("method--cancel", () {
4320
4321 var mock = new HttpServerMock(); 4179 var mock = new HttpServerMock();
4322 api.ProjectsInstancesOperationsResourceApi res = new api.SpannerApi(mock). projects.instances.operations; 4180 api.ProjectsInstancesOperationsResourceApi res =
4181 new api.SpannerApi(mock).projects.instances.operations;
4323 var arg_name = "foo"; 4182 var arg_name = "foo";
4324 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 4183 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
4325 var path = (req.url).path; 4184 var path = (req.url).path;
4326 var pathOffset = 0; 4185 var pathOffset = 0;
4327 var index; 4186 var index;
4328 var subPart; 4187 var subPart;
4329 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 4188 unittest.expect(
4189 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
4330 pathOffset += 1; 4190 pathOffset += 1;
4331 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 4191 unittest.expect(
4192 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
4332 pathOffset += 3; 4193 pathOffset += 3;
4333 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 4194 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
4334 4195
4335 var query = (req.url).query; 4196 var query = (req.url).query;
4336 var queryOffset = 0; 4197 var queryOffset = 0;
4337 var queryMap = {}; 4198 var queryMap = {};
4338 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 4199 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4339 parseBool(n) { 4200 parseBool(n) {
4340 if (n == "true") return true; 4201 if (n == "true") return true;
4341 if (n == "false") return false; 4202 if (n == "false") return false;
4342 if (n == null) return null; 4203 if (n == null) return null;
4343 throw new core.ArgumentError("Invalid boolean: $n"); 4204 throw new core.ArgumentError("Invalid boolean: $n");
4344 } 4205 }
4206
4345 if (query.length > 0) { 4207 if (query.length > 0) {
4346 for (var part in query.split("&")) { 4208 for (var part in query.split("&")) {
4347 var keyvalue = part.split("="); 4209 var keyvalue = part.split("=");
4348 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 4210 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
4211 core.Uri.decodeQueryComponent(keyvalue[1]));
4349 } 4212 }
4350 } 4213 }
4351 4214
4352
4353 var h = { 4215 var h = {
4354 "content-type" : "application/json; charset=utf-8", 4216 "content-type": "application/json; charset=utf-8",
4355 }; 4217 };
4356 var resp = convert.JSON.encode(buildEmpty()); 4218 var resp = convert.JSON.encode(buildEmpty());
4357 return new async.Future.value(stringResponse(200, h, resp)); 4219 return new async.Future.value(stringResponse(200, h, resp));
4358 }), true); 4220 }), true);
4359 res.cancel(arg_name).then(unittest.expectAsync1(((api.Empty response) { 4221 res.cancel(arg_name).then(unittest.expectAsync1(((api.Empty response) {
4360 checkEmpty(response); 4222 checkEmpty(response);
4361 }))); 4223 })));
4362 }); 4224 });
4363 4225
4364 unittest.test("method--delete", () { 4226 unittest.test("method--delete", () {
4365
4366 var mock = new HttpServerMock(); 4227 var mock = new HttpServerMock();
4367 api.ProjectsInstancesOperationsResourceApi res = new api.SpannerApi(mock). projects.instances.operations; 4228 api.ProjectsInstancesOperationsResourceApi res =
4229 new api.SpannerApi(mock).projects.instances.operations;
4368 var arg_name = "foo"; 4230 var arg_name = "foo";
4369 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 4231 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
4370 var path = (req.url).path; 4232 var path = (req.url).path;
4371 var pathOffset = 0; 4233 var pathOffset = 0;
4372 var index; 4234 var index;
4373 var subPart; 4235 var subPart;
4374 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 4236 unittest.expect(
4237 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
4375 pathOffset += 1; 4238 pathOffset += 1;
4376 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 4239 unittest.expect(
4240 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
4377 pathOffset += 3; 4241 pathOffset += 3;
4378 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 4242 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
4379 4243
4380 var query = (req.url).query; 4244 var query = (req.url).query;
4381 var queryOffset = 0; 4245 var queryOffset = 0;
4382 var queryMap = {}; 4246 var queryMap = {};
4383 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 4247 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4384 parseBool(n) { 4248 parseBool(n) {
4385 if (n == "true") return true; 4249 if (n == "true") return true;
4386 if (n == "false") return false; 4250 if (n == "false") return false;
4387 if (n == null) return null; 4251 if (n == null) return null;
4388 throw new core.ArgumentError("Invalid boolean: $n"); 4252 throw new core.ArgumentError("Invalid boolean: $n");
4389 } 4253 }
4254
4390 if (query.length > 0) { 4255 if (query.length > 0) {
4391 for (var part in query.split("&")) { 4256 for (var part in query.split("&")) {
4392 var keyvalue = part.split("="); 4257 var keyvalue = part.split("=");
4393 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 4258 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
4259 core.Uri.decodeQueryComponent(keyvalue[1]));
4394 } 4260 }
4395 } 4261 }
4396 4262
4397
4398 var h = { 4263 var h = {
4399 "content-type" : "application/json; charset=utf-8", 4264 "content-type": "application/json; charset=utf-8",
4400 }; 4265 };
4401 var resp = convert.JSON.encode(buildEmpty()); 4266 var resp = convert.JSON.encode(buildEmpty());
4402 return new async.Future.value(stringResponse(200, h, resp)); 4267 return new async.Future.value(stringResponse(200, h, resp));
4403 }), true); 4268 }), true);
4404 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) { 4269 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) {
4405 checkEmpty(response); 4270 checkEmpty(response);
4406 }))); 4271 })));
4407 }); 4272 });
4408 4273
4409 unittest.test("method--get", () { 4274 unittest.test("method--get", () {
4410
4411 var mock = new HttpServerMock(); 4275 var mock = new HttpServerMock();
4412 api.ProjectsInstancesOperationsResourceApi res = new api.SpannerApi(mock). projects.instances.operations; 4276 api.ProjectsInstancesOperationsResourceApi res =
4277 new api.SpannerApi(mock).projects.instances.operations;
4413 var arg_name = "foo"; 4278 var arg_name = "foo";
4414 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 4279 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
4415 var path = (req.url).path; 4280 var path = (req.url).path;
4416 var pathOffset = 0; 4281 var pathOffset = 0;
4417 var index; 4282 var index;
4418 var subPart; 4283 var subPart;
4419 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 4284 unittest.expect(
4285 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
4420 pathOffset += 1; 4286 pathOffset += 1;
4421 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 4287 unittest.expect(
4288 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
4422 pathOffset += 3; 4289 pathOffset += 3;
4423 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 4290 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
4424 4291
4425 var query = (req.url).query; 4292 var query = (req.url).query;
4426 var queryOffset = 0; 4293 var queryOffset = 0;
4427 var queryMap = {}; 4294 var queryMap = {};
4428 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 4295 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4429 parseBool(n) { 4296 parseBool(n) {
4430 if (n == "true") return true; 4297 if (n == "true") return true;
4431 if (n == "false") return false; 4298 if (n == "false") return false;
4432 if (n == null) return null; 4299 if (n == null) return null;
4433 throw new core.ArgumentError("Invalid boolean: $n"); 4300 throw new core.ArgumentError("Invalid boolean: $n");
4434 } 4301 }
4302
4435 if (query.length > 0) { 4303 if (query.length > 0) {
4436 for (var part in query.split("&")) { 4304 for (var part in query.split("&")) {
4437 var keyvalue = part.split("="); 4305 var keyvalue = part.split("=");
4438 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 4306 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
4307 core.Uri.decodeQueryComponent(keyvalue[1]));
4439 } 4308 }
4440 } 4309 }
4441 4310
4442
4443 var h = { 4311 var h = {
4444 "content-type" : "application/json; charset=utf-8", 4312 "content-type": "application/json; charset=utf-8",
4445 }; 4313 };
4446 var resp = convert.JSON.encode(buildOperation()); 4314 var resp = convert.JSON.encode(buildOperation());
4447 return new async.Future.value(stringResponse(200, h, resp)); 4315 return new async.Future.value(stringResponse(200, h, resp));
4448 }), true); 4316 }), true);
4449 res.get(arg_name).then(unittest.expectAsync1(((api.Operation response) { 4317 res.get(arg_name).then(unittest.expectAsync1(((api.Operation response) {
4450 checkOperation(response); 4318 checkOperation(response);
4451 }))); 4319 })));
4452 }); 4320 });
4453 4321
4454 unittest.test("method--list", () { 4322 unittest.test("method--list", () {
4455
4456 var mock = new HttpServerMock(); 4323 var mock = new HttpServerMock();
4457 api.ProjectsInstancesOperationsResourceApi res = new api.SpannerApi(mock). projects.instances.operations; 4324 api.ProjectsInstancesOperationsResourceApi res =
4325 new api.SpannerApi(mock).projects.instances.operations;
4458 var arg_name = "foo"; 4326 var arg_name = "foo";
4459 var arg_filter = "foo"; 4327 var arg_filter = "foo";
4460 var arg_pageToken = "foo"; 4328 var arg_pageToken = "foo";
4461 var arg_pageSize = 42; 4329 var arg_pageSize = 42;
4462 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 4330 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
4463 var path = (req.url).path; 4331 var path = (req.url).path;
4464 var pathOffset = 0; 4332 var pathOffset = 0;
4465 var index; 4333 var index;
4466 var subPart; 4334 var subPart;
4467 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 4335 unittest.expect(
4336 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
4468 pathOffset += 1; 4337 pathOffset += 1;
4469 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 4338 unittest.expect(
4339 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
4470 pathOffset += 3; 4340 pathOffset += 3;
4471 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 4341 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
4472 4342
4473 var query = (req.url).query; 4343 var query = (req.url).query;
4474 var queryOffset = 0; 4344 var queryOffset = 0;
4475 var queryMap = {}; 4345 var queryMap = {};
4476 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 4346 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4477 parseBool(n) { 4347 parseBool(n) {
4478 if (n == "true") return true; 4348 if (n == "true") return true;
4479 if (n == "false") return false; 4349 if (n == "false") return false;
4480 if (n == null) return null; 4350 if (n == null) return null;
4481 throw new core.ArgumentError("Invalid boolean: $n"); 4351 throw new core.ArgumentError("Invalid boolean: $n");
4482 } 4352 }
4353
4483 if (query.length > 0) { 4354 if (query.length > 0) {
4484 for (var part in query.split("&")) { 4355 for (var part in query.split("&")) {
4485 var keyvalue = part.split("="); 4356 var keyvalue = part.split("=");
4486 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 4357 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
4358 core.Uri.decodeQueryComponent(keyvalue[1]));
4487 } 4359 }
4488 } 4360 }
4489 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); 4361 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter));
4490 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 4362 unittest.expect(
4491 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize)); 4363 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
4492 4364 unittest.expect(core.int.parse(queryMap["pageSize"].first),
4365 unittest.equals(arg_pageSize));
4493 4366
4494 var h = { 4367 var h = {
4495 "content-type" : "application/json; charset=utf-8", 4368 "content-type": "application/json; charset=utf-8",
4496 }; 4369 };
4497 var resp = convert.JSON.encode(buildListOperationsResponse()); 4370 var resp = convert.JSON.encode(buildListOperationsResponse());
4498 return new async.Future.value(stringResponse(200, h, resp)); 4371 return new async.Future.value(stringResponse(200, h, resp));
4499 }), true); 4372 }), true);
4500 res.list(arg_name, filter: arg_filter, pageToken: arg_pageToken, pageSize: arg_pageSize).then(unittest.expectAsync1(((api.ListOperationsResponse response) { 4373 res
4374 .list(arg_name,
4375 filter: arg_filter,
4376 pageToken: arg_pageToken,
4377 pageSize: arg_pageSize)
4378 .then(unittest.expectAsync1(((api.ListOperationsResponse response) {
4501 checkListOperationsResponse(response); 4379 checkListOperationsResponse(response);
4502 }))); 4380 })));
4503 }); 4381 });
4504
4505 }); 4382 });
4506
4507
4508 } 4383 }
4509
OLDNEW
« no previous file with comments | « generated/googleapis/test/sourcerepo/v1_test.dart ('k') | generated/googleapis/test/speech/v1_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698