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

Side by Side Diff: generated/googleapis/test/spanner/v1_test.dart

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

Powered by Google App Engine
This is Rietveld 408576698