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

Side by Side Diff: generated/googleapis_beta/test/appengine/v1beta4_test.dart

Issue 3006323002: Api-Roll 54: 2017-09-11 (Closed)
Patch Set: use 2.0.0-dev.infinity sdk constraint in pubspecs Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 library googleapis_beta.appengine.v1beta4.test; 1 library googleapis_beta.appengine.v1beta4.test;
2 2
3 import "dart:core" as core; 3 import "dart:core" as core;
4 import "dart:collection" as collection;
5 import "dart:async" as async; 4 import "dart:async" as async;
6 import "dart:convert" as convert; 5 import "dart:convert" as convert;
7 6
8 import 'package:http/http.dart' as http; 7 import 'package:http/http.dart' as http;
9 import 'package:http/testing.dart' as http_testing;
10 import 'package:test/test.dart' as unittest; 8 import 'package:test/test.dart' as unittest;
11 9
12 import 'package:googleapis_beta/appengine/v1beta4.dart' as api; 10 import 'package:googleapis_beta/appengine/v1beta4.dart' as api;
13 11
14 class HttpServerMock extends http.BaseClient { 12 class HttpServerMock extends http.BaseClient {
15 core.Function _callback; 13 core.Function _callback;
16 core.bool _expectJson; 14 core.bool _expectJson;
17 15
18 void register(core.Function callback, core.bool expectJson) { 16 void register(core.Function callback, core.bool expectJson) {
19 _callback = callback; 17 _callback = callback;
20 _expectJson = expectJson; 18 _expectJson = expectJson;
21 } 19 }
22 20
23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { 21 async.Future<http.StreamedResponse> send(http.BaseRequest request) {
24 if (_expectJson) { 22 if (_expectJson) {
25 return request.finalize() 23 return request
24 .finalize()
26 .transform(convert.UTF8.decoder) 25 .transform(convert.UTF8.decoder)
27 .join('') 26 .join('')
28 .then((core.String jsonString) { 27 .then((core.String jsonString) {
29 if (jsonString.isEmpty) { 28 if (jsonString.isEmpty) {
30 return _callback(request, null); 29 return _callback(request, null);
31 } else { 30 } else {
32 return _callback(request, convert.JSON.decode(jsonString)); 31 return _callback(request, convert.JSON.decode(jsonString));
33 } 32 }
34 }); 33 });
35 } else { 34 } else {
36 var stream = request.finalize(); 35 var stream = request.finalize();
37 if (stream == null) { 36 if (stream == null) {
38 return _callback(request, []); 37 return _callback(request, []);
39 } else { 38 } else {
40 return stream.toBytes().then((data) { 39 return stream.toBytes().then((data) {
41 return _callback(request, data); 40 return _callback(request, data);
42 }); 41 });
43 } 42 }
44 } 43 }
45 } 44 }
46 } 45 }
47 46
48 http.StreamedResponse stringResponse( 47 http.StreamedResponse stringResponse(core.int status,
49 core.int status, core.Map<core.String, core.String> headers, core.String bod y) { 48 core.Map<core.String, core.String> headers, core.String body) {
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); 49 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]);
51 return new http.StreamedResponse(stream, status, headers: headers); 50 return new http.StreamedResponse(stream, status, headers: headers);
52 } 51 }
53 52
54 core.int buildCounterApiConfigHandler = 0; 53 core.int buildCounterApiConfigHandler = 0;
55 buildApiConfigHandler() { 54 buildApiConfigHandler() {
56 var o = new api.ApiConfigHandler(); 55 var o = new api.ApiConfigHandler();
57 buildCounterApiConfigHandler++; 56 buildCounterApiConfigHandler++;
58 if (buildCounterApiConfigHandler < 3) { 57 if (buildCounterApiConfigHandler < 3) {
59 o.authFailAction = "foo"; 58 o.authFailAction = "foo";
(...skipping 30 matching lines...) Expand all
90 } 89 }
91 90
92 checkApiEndpointHandler(api.ApiEndpointHandler o) { 91 checkApiEndpointHandler(api.ApiEndpointHandler o) {
93 buildCounterApiEndpointHandler++; 92 buildCounterApiEndpointHandler++;
94 if (buildCounterApiEndpointHandler < 3) { 93 if (buildCounterApiEndpointHandler < 3) {
95 unittest.expect(o.scriptPath, unittest.equals('foo')); 94 unittest.expect(o.scriptPath, unittest.equals('foo'));
96 } 95 }
97 buildCounterApiEndpointHandler--; 96 buildCounterApiEndpointHandler--;
98 } 97 }
99 98
100 buildUnnamed3525() { 99 buildUnnamed3533() {
101 var o = new core.List<api.UrlDispatchRule>(); 100 var o = new core.List<api.UrlDispatchRule>();
102 o.add(buildUrlDispatchRule()); 101 o.add(buildUrlDispatchRule());
103 o.add(buildUrlDispatchRule()); 102 o.add(buildUrlDispatchRule());
104 return o; 103 return o;
105 } 104 }
106 105
107 checkUnnamed3525(core.List<api.UrlDispatchRule> o) { 106 checkUnnamed3533(core.List<api.UrlDispatchRule> o) {
108 unittest.expect(o, unittest.hasLength(2)); 107 unittest.expect(o, unittest.hasLength(2));
109 checkUrlDispatchRule(o[0]); 108 checkUrlDispatchRule(o[0]);
110 checkUrlDispatchRule(o[1]); 109 checkUrlDispatchRule(o[1]);
111 } 110 }
112 111
113 core.int buildCounterApplication = 0; 112 core.int buildCounterApplication = 0;
114 buildApplication() { 113 buildApplication() {
115 var o = new api.Application(); 114 var o = new api.Application();
116 buildCounterApplication++; 115 buildCounterApplication++;
117 if (buildCounterApplication < 3) { 116 if (buildCounterApplication < 3) {
118 o.authDomain = "foo"; 117 o.authDomain = "foo";
119 o.codeBucket = "foo"; 118 o.codeBucket = "foo";
120 o.defaultBucket = "foo"; 119 o.defaultBucket = "foo";
121 o.defaultCookieExpiration = "foo"; 120 o.defaultCookieExpiration = "foo";
122 o.defaultHostname = "foo"; 121 o.defaultHostname = "foo";
123 o.dispatchRules = buildUnnamed3525(); 122 o.dispatchRules = buildUnnamed3533();
124 o.iap = buildIdentityAwareProxy(); 123 o.iap = buildIdentityAwareProxy();
125 o.id = "foo"; 124 o.id = "foo";
126 o.location = "foo"; 125 o.location = "foo";
127 o.name = "foo"; 126 o.name = "foo";
128 } 127 }
129 buildCounterApplication--; 128 buildCounterApplication--;
130 return o; 129 return o;
131 } 130 }
132 131
133 checkApplication(api.Application o) { 132 checkApplication(api.Application o) {
134 buildCounterApplication++; 133 buildCounterApplication++;
135 if (buildCounterApplication < 3) { 134 if (buildCounterApplication < 3) {
136 unittest.expect(o.authDomain, unittest.equals('foo')); 135 unittest.expect(o.authDomain, unittest.equals('foo'));
137 unittest.expect(o.codeBucket, unittest.equals('foo')); 136 unittest.expect(o.codeBucket, unittest.equals('foo'));
138 unittest.expect(o.defaultBucket, unittest.equals('foo')); 137 unittest.expect(o.defaultBucket, unittest.equals('foo'));
139 unittest.expect(o.defaultCookieExpiration, unittest.equals('foo')); 138 unittest.expect(o.defaultCookieExpiration, unittest.equals('foo'));
140 unittest.expect(o.defaultHostname, unittest.equals('foo')); 139 unittest.expect(o.defaultHostname, unittest.equals('foo'));
141 checkUnnamed3525(o.dispatchRules); 140 checkUnnamed3533(o.dispatchRules);
142 checkIdentityAwareProxy(o.iap); 141 checkIdentityAwareProxy(o.iap);
143 unittest.expect(o.id, unittest.equals('foo')); 142 unittest.expect(o.id, unittest.equals('foo'));
144 unittest.expect(o.location, unittest.equals('foo')); 143 unittest.expect(o.location, unittest.equals('foo'));
145 unittest.expect(o.name, unittest.equals('foo')); 144 unittest.expect(o.name, unittest.equals('foo'));
146 } 145 }
147 buildCounterApplication--; 146 buildCounterApplication--;
148 } 147 }
149 148
150 core.int buildCounterAutomaticScaling = 0; 149 core.int buildCounterAutomaticScaling = 0;
151 buildAutomaticScaling() { 150 buildAutomaticScaling() {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 } 260 }
262 261
263 checkDebugInstanceRequest(api.DebugInstanceRequest o) { 262 checkDebugInstanceRequest(api.DebugInstanceRequest o) {
264 buildCounterDebugInstanceRequest++; 263 buildCounterDebugInstanceRequest++;
265 if (buildCounterDebugInstanceRequest < 3) { 264 if (buildCounterDebugInstanceRequest < 3) {
266 unittest.expect(o.sshKey, unittest.equals('foo')); 265 unittest.expect(o.sshKey, unittest.equals('foo'));
267 } 266 }
268 buildCounterDebugInstanceRequest--; 267 buildCounterDebugInstanceRequest--;
269 } 268 }
270 269
271 buildUnnamed3526() { 270 buildUnnamed3534() {
272 var o = new core.Map<core.String, api.FileInfo>(); 271 var o = new core.Map<core.String, api.FileInfo>();
273 o["x"] = buildFileInfo(); 272 o["x"] = buildFileInfo();
274 o["y"] = buildFileInfo(); 273 o["y"] = buildFileInfo();
275 return o; 274 return o;
276 } 275 }
277 276
278 checkUnnamed3526(core.Map<core.String, api.FileInfo> o) { 277 checkUnnamed3534(core.Map<core.String, api.FileInfo> o) {
279 unittest.expect(o, unittest.hasLength(2)); 278 unittest.expect(o, unittest.hasLength(2));
280 checkFileInfo(o["x"]); 279 checkFileInfo(o["x"]);
281 checkFileInfo(o["y"]); 280 checkFileInfo(o["y"]);
282 } 281 }
283 282
284 buildUnnamed3527() { 283 buildUnnamed3535() {
285 var o = new core.List<api.SourceReference>(); 284 var o = new core.List<api.SourceReference>();
286 o.add(buildSourceReference()); 285 o.add(buildSourceReference());
287 o.add(buildSourceReference()); 286 o.add(buildSourceReference());
288 return o; 287 return o;
289 } 288 }
290 289
291 checkUnnamed3527(core.List<api.SourceReference> o) { 290 checkUnnamed3535(core.List<api.SourceReference> o) {
292 unittest.expect(o, unittest.hasLength(2)); 291 unittest.expect(o, unittest.hasLength(2));
293 checkSourceReference(o[0]); 292 checkSourceReference(o[0]);
294 checkSourceReference(o[1]); 293 checkSourceReference(o[1]);
295 } 294 }
296 295
297 core.int buildCounterDeployment = 0; 296 core.int buildCounterDeployment = 0;
298 buildDeployment() { 297 buildDeployment() {
299 var o = new api.Deployment(); 298 var o = new api.Deployment();
300 buildCounterDeployment++; 299 buildCounterDeployment++;
301 if (buildCounterDeployment < 3) { 300 if (buildCounterDeployment < 3) {
302 o.container = buildContainerInfo(); 301 o.container = buildContainerInfo();
303 o.files = buildUnnamed3526(); 302 o.files = buildUnnamed3534();
304 o.sourceReferences = buildUnnamed3527(); 303 o.sourceReferences = buildUnnamed3535();
305 } 304 }
306 buildCounterDeployment--; 305 buildCounterDeployment--;
307 return o; 306 return o;
308 } 307 }
309 308
310 checkDeployment(api.Deployment o) { 309 checkDeployment(api.Deployment o) {
311 buildCounterDeployment++; 310 buildCounterDeployment++;
312 if (buildCounterDeployment < 3) { 311 if (buildCounterDeployment < 3) {
313 checkContainerInfo(o.container); 312 checkContainerInfo(o.container);
314 checkUnnamed3526(o.files); 313 checkUnnamed3534(o.files);
315 checkUnnamed3527(o.sourceReferences); 314 checkUnnamed3535(o.sourceReferences);
316 } 315 }
317 buildCounterDeployment--; 316 buildCounterDeployment--;
318 } 317 }
319 318
320 core.int buildCounterDiskUtilization = 0; 319 core.int buildCounterDiskUtilization = 0;
321 buildDiskUtilization() { 320 buildDiskUtilization() {
322 var o = new api.DiskUtilization(); 321 var o = new api.DiskUtilization();
323 buildCounterDiskUtilization++; 322 buildCounterDiskUtilization++;
324 if (buildCounterDiskUtilization < 3) { 323 if (buildCounterDiskUtilization < 3) {
325 o.targetReadBytesPerSec = 42; 324 o.targetReadBytesPerSec = 42;
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 506
508 checkLibrary(api.Library o) { 507 checkLibrary(api.Library o) {
509 buildCounterLibrary++; 508 buildCounterLibrary++;
510 if (buildCounterLibrary < 3) { 509 if (buildCounterLibrary < 3) {
511 unittest.expect(o.name, unittest.equals('foo')); 510 unittest.expect(o.name, unittest.equals('foo'));
512 unittest.expect(o.version, unittest.equals('foo')); 511 unittest.expect(o.version, unittest.equals('foo'));
513 } 512 }
514 buildCounterLibrary--; 513 buildCounterLibrary--;
515 } 514 }
516 515
517 buildUnnamed3528() { 516 buildUnnamed3536() {
518 var o = new core.List<api.Instance>(); 517 var o = new core.List<api.Instance>();
519 o.add(buildInstance()); 518 o.add(buildInstance());
520 o.add(buildInstance()); 519 o.add(buildInstance());
521 return o; 520 return o;
522 } 521 }
523 522
524 checkUnnamed3528(core.List<api.Instance> o) { 523 checkUnnamed3536(core.List<api.Instance> o) {
525 unittest.expect(o, unittest.hasLength(2)); 524 unittest.expect(o, unittest.hasLength(2));
526 checkInstance(o[0]); 525 checkInstance(o[0]);
527 checkInstance(o[1]); 526 checkInstance(o[1]);
528 } 527 }
529 528
530 core.int buildCounterListInstancesResponse = 0; 529 core.int buildCounterListInstancesResponse = 0;
531 buildListInstancesResponse() { 530 buildListInstancesResponse() {
532 var o = new api.ListInstancesResponse(); 531 var o = new api.ListInstancesResponse();
533 buildCounterListInstancesResponse++; 532 buildCounterListInstancesResponse++;
534 if (buildCounterListInstancesResponse < 3) { 533 if (buildCounterListInstancesResponse < 3) {
535 o.instances = buildUnnamed3528(); 534 o.instances = buildUnnamed3536();
536 o.nextPageToken = "foo"; 535 o.nextPageToken = "foo";
537 } 536 }
538 buildCounterListInstancesResponse--; 537 buildCounterListInstancesResponse--;
539 return o; 538 return o;
540 } 539 }
541 540
542 checkListInstancesResponse(api.ListInstancesResponse o) { 541 checkListInstancesResponse(api.ListInstancesResponse o) {
543 buildCounterListInstancesResponse++; 542 buildCounterListInstancesResponse++;
544 if (buildCounterListInstancesResponse < 3) { 543 if (buildCounterListInstancesResponse < 3) {
545 checkUnnamed3528(o.instances); 544 checkUnnamed3536(o.instances);
546 unittest.expect(o.nextPageToken, unittest.equals('foo')); 545 unittest.expect(o.nextPageToken, unittest.equals('foo'));
547 } 546 }
548 buildCounterListInstancesResponse--; 547 buildCounterListInstancesResponse--;
549 } 548 }
550 549
551 buildUnnamed3529() { 550 buildUnnamed3537() {
552 var o = new core.List<api.Location>(); 551 var o = new core.List<api.Location>();
553 o.add(buildLocation()); 552 o.add(buildLocation());
554 o.add(buildLocation()); 553 o.add(buildLocation());
555 return o; 554 return o;
556 } 555 }
557 556
558 checkUnnamed3529(core.List<api.Location> o) { 557 checkUnnamed3537(core.List<api.Location> o) {
559 unittest.expect(o, unittest.hasLength(2)); 558 unittest.expect(o, unittest.hasLength(2));
560 checkLocation(o[0]); 559 checkLocation(o[0]);
561 checkLocation(o[1]); 560 checkLocation(o[1]);
562 } 561 }
563 562
564 core.int buildCounterListLocationsResponse = 0; 563 core.int buildCounterListLocationsResponse = 0;
565 buildListLocationsResponse() { 564 buildListLocationsResponse() {
566 var o = new api.ListLocationsResponse(); 565 var o = new api.ListLocationsResponse();
567 buildCounterListLocationsResponse++; 566 buildCounterListLocationsResponse++;
568 if (buildCounterListLocationsResponse < 3) { 567 if (buildCounterListLocationsResponse < 3) {
569 o.locations = buildUnnamed3529(); 568 o.locations = buildUnnamed3537();
570 o.nextPageToken = "foo"; 569 o.nextPageToken = "foo";
571 } 570 }
572 buildCounterListLocationsResponse--; 571 buildCounterListLocationsResponse--;
573 return o; 572 return o;
574 } 573 }
575 574
576 checkListLocationsResponse(api.ListLocationsResponse o) { 575 checkListLocationsResponse(api.ListLocationsResponse o) {
577 buildCounterListLocationsResponse++; 576 buildCounterListLocationsResponse++;
578 if (buildCounterListLocationsResponse < 3) { 577 if (buildCounterListLocationsResponse < 3) {
579 checkUnnamed3529(o.locations); 578 checkUnnamed3537(o.locations);
580 unittest.expect(o.nextPageToken, unittest.equals('foo')); 579 unittest.expect(o.nextPageToken, unittest.equals('foo'));
581 } 580 }
582 buildCounterListLocationsResponse--; 581 buildCounterListLocationsResponse--;
583 } 582 }
584 583
585 buildUnnamed3530() { 584 buildUnnamed3538() {
586 var o = new core.List<api.Module>(); 585 var o = new core.List<api.Module>();
587 o.add(buildModule()); 586 o.add(buildModule());
588 o.add(buildModule()); 587 o.add(buildModule());
589 return o; 588 return o;
590 } 589 }
591 590
592 checkUnnamed3530(core.List<api.Module> o) { 591 checkUnnamed3538(core.List<api.Module> o) {
593 unittest.expect(o, unittest.hasLength(2)); 592 unittest.expect(o, unittest.hasLength(2));
594 checkModule(o[0]); 593 checkModule(o[0]);
595 checkModule(o[1]); 594 checkModule(o[1]);
596 } 595 }
597 596
598 core.int buildCounterListModulesResponse = 0; 597 core.int buildCounterListModulesResponse = 0;
599 buildListModulesResponse() { 598 buildListModulesResponse() {
600 var o = new api.ListModulesResponse(); 599 var o = new api.ListModulesResponse();
601 buildCounterListModulesResponse++; 600 buildCounterListModulesResponse++;
602 if (buildCounterListModulesResponse < 3) { 601 if (buildCounterListModulesResponse < 3) {
603 o.modules = buildUnnamed3530(); 602 o.modules = buildUnnamed3538();
604 o.nextPageToken = "foo"; 603 o.nextPageToken = "foo";
605 } 604 }
606 buildCounterListModulesResponse--; 605 buildCounterListModulesResponse--;
607 return o; 606 return o;
608 } 607 }
609 608
610 checkListModulesResponse(api.ListModulesResponse o) { 609 checkListModulesResponse(api.ListModulesResponse o) {
611 buildCounterListModulesResponse++; 610 buildCounterListModulesResponse++;
612 if (buildCounterListModulesResponse < 3) { 611 if (buildCounterListModulesResponse < 3) {
613 checkUnnamed3530(o.modules); 612 checkUnnamed3538(o.modules);
614 unittest.expect(o.nextPageToken, unittest.equals('foo')); 613 unittest.expect(o.nextPageToken, unittest.equals('foo'));
615 } 614 }
616 buildCounterListModulesResponse--; 615 buildCounterListModulesResponse--;
617 } 616 }
618 617
619 buildUnnamed3531() { 618 buildUnnamed3539() {
620 var o = new core.List<api.Operation>(); 619 var o = new core.List<api.Operation>();
621 o.add(buildOperation()); 620 o.add(buildOperation());
622 o.add(buildOperation()); 621 o.add(buildOperation());
623 return o; 622 return o;
624 } 623 }
625 624
626 checkUnnamed3531(core.List<api.Operation> o) { 625 checkUnnamed3539(core.List<api.Operation> o) {
627 unittest.expect(o, unittest.hasLength(2)); 626 unittest.expect(o, unittest.hasLength(2));
628 checkOperation(o[0]); 627 checkOperation(o[0]);
629 checkOperation(o[1]); 628 checkOperation(o[1]);
630 } 629 }
631 630
632 core.int buildCounterListOperationsResponse = 0; 631 core.int buildCounterListOperationsResponse = 0;
633 buildListOperationsResponse() { 632 buildListOperationsResponse() {
634 var o = new api.ListOperationsResponse(); 633 var o = new api.ListOperationsResponse();
635 buildCounterListOperationsResponse++; 634 buildCounterListOperationsResponse++;
636 if (buildCounterListOperationsResponse < 3) { 635 if (buildCounterListOperationsResponse < 3) {
637 o.nextPageToken = "foo"; 636 o.nextPageToken = "foo";
638 o.operations = buildUnnamed3531(); 637 o.operations = buildUnnamed3539();
639 } 638 }
640 buildCounterListOperationsResponse--; 639 buildCounterListOperationsResponse--;
641 return o; 640 return o;
642 } 641 }
643 642
644 checkListOperationsResponse(api.ListOperationsResponse o) { 643 checkListOperationsResponse(api.ListOperationsResponse o) {
645 buildCounterListOperationsResponse++; 644 buildCounterListOperationsResponse++;
646 if (buildCounterListOperationsResponse < 3) { 645 if (buildCounterListOperationsResponse < 3) {
647 unittest.expect(o.nextPageToken, unittest.equals('foo')); 646 unittest.expect(o.nextPageToken, unittest.equals('foo'));
648 checkUnnamed3531(o.operations); 647 checkUnnamed3539(o.operations);
649 } 648 }
650 buildCounterListOperationsResponse--; 649 buildCounterListOperationsResponse--;
651 } 650 }
652 651
653 buildUnnamed3532() { 652 buildUnnamed3540() {
654 var o = new core.List<api.Version>(); 653 var o = new core.List<api.Version>();
655 o.add(buildVersion()); 654 o.add(buildVersion());
656 o.add(buildVersion()); 655 o.add(buildVersion());
657 return o; 656 return o;
658 } 657 }
659 658
660 checkUnnamed3532(core.List<api.Version> o) { 659 checkUnnamed3540(core.List<api.Version> o) {
661 unittest.expect(o, unittest.hasLength(2)); 660 unittest.expect(o, unittest.hasLength(2));
662 checkVersion(o[0]); 661 checkVersion(o[0]);
663 checkVersion(o[1]); 662 checkVersion(o[1]);
664 } 663 }
665 664
666 core.int buildCounterListVersionsResponse = 0; 665 core.int buildCounterListVersionsResponse = 0;
667 buildListVersionsResponse() { 666 buildListVersionsResponse() {
668 var o = new api.ListVersionsResponse(); 667 var o = new api.ListVersionsResponse();
669 buildCounterListVersionsResponse++; 668 buildCounterListVersionsResponse++;
670 if (buildCounterListVersionsResponse < 3) { 669 if (buildCounterListVersionsResponse < 3) {
671 o.nextPageToken = "foo"; 670 o.nextPageToken = "foo";
672 o.versions = buildUnnamed3532(); 671 o.versions = buildUnnamed3540();
673 } 672 }
674 buildCounterListVersionsResponse--; 673 buildCounterListVersionsResponse--;
675 return o; 674 return o;
676 } 675 }
677 676
678 checkListVersionsResponse(api.ListVersionsResponse o) { 677 checkListVersionsResponse(api.ListVersionsResponse o) {
679 buildCounterListVersionsResponse++; 678 buildCounterListVersionsResponse++;
680 if (buildCounterListVersionsResponse < 3) { 679 if (buildCounterListVersionsResponse < 3) {
681 unittest.expect(o.nextPageToken, unittest.equals('foo')); 680 unittest.expect(o.nextPageToken, unittest.equals('foo'));
682 checkUnnamed3532(o.versions); 681 checkUnnamed3540(o.versions);
683 } 682 }
684 buildCounterListVersionsResponse--; 683 buildCounterListVersionsResponse--;
685 } 684 }
686 685
687 buildUnnamed3533() { 686 buildUnnamed3541() {
688 var o = new core.Map<core.String, core.String>(); 687 var o = new core.Map<core.String, core.String>();
689 o["x"] = "foo"; 688 o["x"] = "foo";
690 o["y"] = "foo"; 689 o["y"] = "foo";
691 return o; 690 return o;
692 } 691 }
693 692
694 checkUnnamed3533(core.Map<core.String, core.String> o) { 693 checkUnnamed3541(core.Map<core.String, core.String> o) {
695 unittest.expect(o, unittest.hasLength(2)); 694 unittest.expect(o, unittest.hasLength(2));
696 unittest.expect(o["x"], unittest.equals('foo')); 695 unittest.expect(o["x"], unittest.equals('foo'));
697 unittest.expect(o["y"], unittest.equals('foo')); 696 unittest.expect(o["y"], unittest.equals('foo'));
698 } 697 }
699 698
700 buildUnnamed3534() { 699 buildUnnamed3542() {
701 var o = new core.Map<core.String, core.Object>(); 700 var o = new core.Map<core.String, core.Object>();
702 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 701 o["x"] = {
703 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 702 'list': [1, 2, 3],
703 'bool': true,
704 'string': 'foo'
705 };
706 o["y"] = {
707 'list': [1, 2, 3],
708 'bool': true,
709 'string': 'foo'
710 };
704 return o; 711 return o;
705 } 712 }
706 713
707 checkUnnamed3534(core.Map<core.String, core.Object> o) { 714 checkUnnamed3542(core.Map<core.String, core.Object> o) {
708 unittest.expect(o, unittest.hasLength(2)); 715 unittest.expect(o, unittest.hasLength(2));
709 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')); 716 var casted1 = (o["x"]) as core.Map;
710 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')); 717 unittest.expect(casted1, unittest.hasLength(3));
718 unittest.expect(casted1["list"], unittest.equals([1, 2, 3]));
719 unittest.expect(casted1["bool"], unittest.equals(true));
720 unittest.expect(casted1["string"], unittest.equals('foo'));
721 var casted2 = (o["y"]) as core.Map;
722 unittest.expect(casted2, unittest.hasLength(3));
723 unittest.expect(casted2["list"], unittest.equals([1, 2, 3]));
724 unittest.expect(casted2["bool"], unittest.equals(true));
725 unittest.expect(casted2["string"], unittest.equals('foo'));
711 } 726 }
712 727
713 core.int buildCounterLocation = 0; 728 core.int buildCounterLocation = 0;
714 buildLocation() { 729 buildLocation() {
715 var o = new api.Location(); 730 var o = new api.Location();
716 buildCounterLocation++; 731 buildCounterLocation++;
717 if (buildCounterLocation < 3) { 732 if (buildCounterLocation < 3) {
718 o.labels = buildUnnamed3533(); 733 o.labels = buildUnnamed3541();
719 o.locationId = "foo"; 734 o.locationId = "foo";
720 o.metadata = buildUnnamed3534(); 735 o.metadata = buildUnnamed3542();
721 o.name = "foo"; 736 o.name = "foo";
722 } 737 }
723 buildCounterLocation--; 738 buildCounterLocation--;
724 return o; 739 return o;
725 } 740 }
726 741
727 checkLocation(api.Location o) { 742 checkLocation(api.Location o) {
728 buildCounterLocation++; 743 buildCounterLocation++;
729 if (buildCounterLocation < 3) { 744 if (buildCounterLocation < 3) {
730 checkUnnamed3533(o.labels); 745 checkUnnamed3541(o.labels);
731 unittest.expect(o.locationId, unittest.equals('foo')); 746 unittest.expect(o.locationId, unittest.equals('foo'));
732 checkUnnamed3534(o.metadata); 747 checkUnnamed3542(o.metadata);
733 unittest.expect(o.name, unittest.equals('foo')); 748 unittest.expect(o.name, unittest.equals('foo'));
734 } 749 }
735 buildCounterLocation--; 750 buildCounterLocation--;
736 } 751 }
737 752
738 core.int buildCounterLocationMetadata = 0; 753 core.int buildCounterLocationMetadata = 0;
739 buildLocationMetadata() { 754 buildLocationMetadata() {
740 var o = new api.LocationMetadata(); 755 var o = new api.LocationMetadata();
741 buildCounterLocationMetadata++; 756 buildCounterLocationMetadata++;
742 if (buildCounterLocationMetadata < 3) { 757 if (buildCounterLocationMetadata < 3) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 checkModule(api.Module o) { 806 checkModule(api.Module o) {
792 buildCounterModule++; 807 buildCounterModule++;
793 if (buildCounterModule < 3) { 808 if (buildCounterModule < 3) {
794 unittest.expect(o.id, unittest.equals('foo')); 809 unittest.expect(o.id, unittest.equals('foo'));
795 unittest.expect(o.name, unittest.equals('foo')); 810 unittest.expect(o.name, unittest.equals('foo'));
796 checkTrafficSplit(o.split); 811 checkTrafficSplit(o.split);
797 } 812 }
798 buildCounterModule--; 813 buildCounterModule--;
799 } 814 }
800 815
801 buildUnnamed3535() { 816 buildUnnamed3543() {
802 var o = new core.List<core.String>(); 817 var o = new core.List<core.String>();
803 o.add("foo"); 818 o.add("foo");
804 o.add("foo"); 819 o.add("foo");
805 return o; 820 return o;
806 } 821 }
807 822
808 checkUnnamed3535(core.List<core.String> o) { 823 checkUnnamed3543(core.List<core.String> o) {
809 unittest.expect(o, unittest.hasLength(2)); 824 unittest.expect(o, unittest.hasLength(2));
810 unittest.expect(o[0], unittest.equals('foo')); 825 unittest.expect(o[0], unittest.equals('foo'));
811 unittest.expect(o[1], unittest.equals('foo')); 826 unittest.expect(o[1], unittest.equals('foo'));
812 } 827 }
813 828
814 core.int buildCounterNetwork = 0; 829 core.int buildCounterNetwork = 0;
815 buildNetwork() { 830 buildNetwork() {
816 var o = new api.Network(); 831 var o = new api.Network();
817 buildCounterNetwork++; 832 buildCounterNetwork++;
818 if (buildCounterNetwork < 3) { 833 if (buildCounterNetwork < 3) {
819 o.forwardedPorts = buildUnnamed3535(); 834 o.forwardedPorts = buildUnnamed3543();
820 o.instanceTag = "foo"; 835 o.instanceTag = "foo";
821 o.name = "foo"; 836 o.name = "foo";
822 } 837 }
823 buildCounterNetwork--; 838 buildCounterNetwork--;
824 return o; 839 return o;
825 } 840 }
826 841
827 checkNetwork(api.Network o) { 842 checkNetwork(api.Network o) {
828 buildCounterNetwork++; 843 buildCounterNetwork++;
829 if (buildCounterNetwork < 3) { 844 if (buildCounterNetwork < 3) {
830 checkUnnamed3535(o.forwardedPorts); 845 checkUnnamed3543(o.forwardedPorts);
831 unittest.expect(o.instanceTag, unittest.equals('foo')); 846 unittest.expect(o.instanceTag, unittest.equals('foo'));
832 unittest.expect(o.name, unittest.equals('foo')); 847 unittest.expect(o.name, unittest.equals('foo'));
833 } 848 }
834 buildCounterNetwork--; 849 buildCounterNetwork--;
835 } 850 }
836 851
837 core.int buildCounterNetworkUtilization = 0; 852 core.int buildCounterNetworkUtilization = 0;
838 buildNetworkUtilization() { 853 buildNetworkUtilization() {
839 var o = new api.NetworkUtilization(); 854 var o = new api.NetworkUtilization();
840 buildCounterNetworkUtilization++; 855 buildCounterNetworkUtilization++;
(...skipping 11 matching lines...) Expand all
852 buildCounterNetworkUtilization++; 867 buildCounterNetworkUtilization++;
853 if (buildCounterNetworkUtilization < 3) { 868 if (buildCounterNetworkUtilization < 3) {
854 unittest.expect(o.targetReceivedBytesPerSec, unittest.equals(42)); 869 unittest.expect(o.targetReceivedBytesPerSec, unittest.equals(42));
855 unittest.expect(o.targetReceivedPacketsPerSec, unittest.equals(42)); 870 unittest.expect(o.targetReceivedPacketsPerSec, unittest.equals(42));
856 unittest.expect(o.targetSentBytesPerSec, unittest.equals(42)); 871 unittest.expect(o.targetSentBytesPerSec, unittest.equals(42));
857 unittest.expect(o.targetSentPacketsPerSec, unittest.equals(42)); 872 unittest.expect(o.targetSentPacketsPerSec, unittest.equals(42));
858 } 873 }
859 buildCounterNetworkUtilization--; 874 buildCounterNetworkUtilization--;
860 } 875 }
861 876
862 buildUnnamed3536() { 877 buildUnnamed3544() {
863 var o = new core.Map<core.String, core.Object>(); 878 var o = new core.Map<core.String, core.Object>();
864 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 879 o["x"] = {
865 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 880 'list': [1, 2, 3],
881 'bool': true,
882 'string': 'foo'
883 };
884 o["y"] = {
885 'list': [1, 2, 3],
886 'bool': true,
887 'string': 'foo'
888 };
866 return o; 889 return o;
867 } 890 }
868 891
869 checkUnnamed3536(core.Map<core.String, core.Object> o) { 892 checkUnnamed3544(core.Map<core.String, core.Object> o) {
870 unittest.expect(o, unittest.hasLength(2)); 893 unittest.expect(o, unittest.hasLength(2));
871 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"], unittest.equals('foo')); 894 var casted3 = (o["x"]) as core.Map;
872 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"], unittest.equals('foo')); 895 unittest.expect(casted3, unittest.hasLength(3));
896 unittest.expect(casted3["list"], unittest.equals([1, 2, 3]));
897 unittest.expect(casted3["bool"], unittest.equals(true));
898 unittest.expect(casted3["string"], unittest.equals('foo'));
899 var casted4 = (o["y"]) as core.Map;
900 unittest.expect(casted4, unittest.hasLength(3));
901 unittest.expect(casted4["list"], unittest.equals([1, 2, 3]));
902 unittest.expect(casted4["bool"], unittest.equals(true));
903 unittest.expect(casted4["string"], unittest.equals('foo'));
873 } 904 }
874 905
875 buildUnnamed3537() { 906 buildUnnamed3545() {
876 var o = new core.Map<core.String, core.Object>(); 907 var o = new core.Map<core.String, core.Object>();
877 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 908 o["x"] = {
878 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 909 'list': [1, 2, 3],
910 'bool': true,
911 'string': 'foo'
912 };
913 o["y"] = {
914 'list': [1, 2, 3],
915 'bool': true,
916 'string': 'foo'
917 };
879 return o; 918 return o;
880 } 919 }
881 920
882 checkUnnamed3537(core.Map<core.String, core.Object> o) { 921 checkUnnamed3545(core.Map<core.String, core.Object> o) {
883 unittest.expect(o, unittest.hasLength(2)); 922 unittest.expect(o, unittest.hasLength(2));
884 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"], unittest.equals('foo')); 923 var casted5 = (o["x"]) as core.Map;
885 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"], unittest.equals('foo')); 924 unittest.expect(casted5, unittest.hasLength(3));
925 unittest.expect(casted5["list"], unittest.equals([1, 2, 3]));
926 unittest.expect(casted5["bool"], unittest.equals(true));
927 unittest.expect(casted5["string"], unittest.equals('foo'));
928 var casted6 = (o["y"]) as core.Map;
929 unittest.expect(casted6, unittest.hasLength(3));
930 unittest.expect(casted6["list"], unittest.equals([1, 2, 3]));
931 unittest.expect(casted6["bool"], unittest.equals(true));
932 unittest.expect(casted6["string"], unittest.equals('foo'));
886 } 933 }
887 934
888 core.int buildCounterOperation = 0; 935 core.int buildCounterOperation = 0;
889 buildOperation() { 936 buildOperation() {
890 var o = new api.Operation(); 937 var o = new api.Operation();
891 buildCounterOperation++; 938 buildCounterOperation++;
892 if (buildCounterOperation < 3) { 939 if (buildCounterOperation < 3) {
893 o.done = true; 940 o.done = true;
894 o.error = buildStatus(); 941 o.error = buildStatus();
895 o.metadata = buildUnnamed3536(); 942 o.metadata = buildUnnamed3544();
896 o.name = "foo"; 943 o.name = "foo";
897 o.response = buildUnnamed3537(); 944 o.response = buildUnnamed3545();
898 } 945 }
899 buildCounterOperation--; 946 buildCounterOperation--;
900 return o; 947 return o;
901 } 948 }
902 949
903 checkOperation(api.Operation o) { 950 checkOperation(api.Operation o) {
904 buildCounterOperation++; 951 buildCounterOperation++;
905 if (buildCounterOperation < 3) { 952 if (buildCounterOperation < 3) {
906 unittest.expect(o.done, unittest.isTrue); 953 unittest.expect(o.done, unittest.isTrue);
907 checkStatus(o.error); 954 checkStatus(o.error);
908 checkUnnamed3536(o.metadata); 955 checkUnnamed3544(o.metadata);
909 unittest.expect(o.name, unittest.equals('foo')); 956 unittest.expect(o.name, unittest.equals('foo'));
910 checkUnnamed3537(o.response); 957 checkUnnamed3545(o.response);
911 } 958 }
912 buildCounterOperation--; 959 buildCounterOperation--;
913 } 960 }
914 961
915 core.int buildCounterOperationMetadata = 0; 962 core.int buildCounterOperationMetadata = 0;
916 buildOperationMetadata() { 963 buildOperationMetadata() {
917 var o = new api.OperationMetadata(); 964 var o = new api.OperationMetadata();
918 buildCounterOperationMetadata++; 965 buildCounterOperationMetadata++;
919 if (buildCounterOperationMetadata < 3) { 966 if (buildCounterOperationMetadata < 3) {
920 o.endTime = "foo"; 967 o.endTime = "foo";
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 if (buildCounterOperationMetadataExperimental < 3) { 1008 if (buildCounterOperationMetadataExperimental < 3) {
962 unittest.expect(o.endTime, unittest.equals('foo')); 1009 unittest.expect(o.endTime, unittest.equals('foo'));
963 unittest.expect(o.insertTime, unittest.equals('foo')); 1010 unittest.expect(o.insertTime, unittest.equals('foo'));
964 unittest.expect(o.method, unittest.equals('foo')); 1011 unittest.expect(o.method, unittest.equals('foo'));
965 unittest.expect(o.target, unittest.equals('foo')); 1012 unittest.expect(o.target, unittest.equals('foo'));
966 unittest.expect(o.user, unittest.equals('foo')); 1013 unittest.expect(o.user, unittest.equals('foo'));
967 } 1014 }
968 buildCounterOperationMetadataExperimental--; 1015 buildCounterOperationMetadataExperimental--;
969 } 1016 }
970 1017
971 buildUnnamed3538() { 1018 buildUnnamed3546() {
972 var o = new core.List<core.String>(); 1019 var o = new core.List<core.String>();
973 o.add("foo"); 1020 o.add("foo");
974 o.add("foo"); 1021 o.add("foo");
975 return o; 1022 return o;
976 } 1023 }
977 1024
978 checkUnnamed3538(core.List<core.String> o) { 1025 checkUnnamed3546(core.List<core.String> o) {
979 unittest.expect(o, unittest.hasLength(2)); 1026 unittest.expect(o, unittest.hasLength(2));
980 unittest.expect(o[0], unittest.equals('foo')); 1027 unittest.expect(o[0], unittest.equals('foo'));
981 unittest.expect(o[1], unittest.equals('foo')); 1028 unittest.expect(o[1], unittest.equals('foo'));
982 } 1029 }
983 1030
984 core.int buildCounterOperationMetadataV1 = 0; 1031 core.int buildCounterOperationMetadataV1 = 0;
985 buildOperationMetadataV1() { 1032 buildOperationMetadataV1() {
986 var o = new api.OperationMetadataV1(); 1033 var o = new api.OperationMetadataV1();
987 buildCounterOperationMetadataV1++; 1034 buildCounterOperationMetadataV1++;
988 if (buildCounterOperationMetadataV1 < 3) { 1035 if (buildCounterOperationMetadataV1 < 3) {
989 o.endTime = "foo"; 1036 o.endTime = "foo";
990 o.ephemeralMessage = "foo"; 1037 o.ephemeralMessage = "foo";
991 o.insertTime = "foo"; 1038 o.insertTime = "foo";
992 o.method = "foo"; 1039 o.method = "foo";
993 o.target = "foo"; 1040 o.target = "foo";
994 o.user = "foo"; 1041 o.user = "foo";
995 o.warning = buildUnnamed3538(); 1042 o.warning = buildUnnamed3546();
996 } 1043 }
997 buildCounterOperationMetadataV1--; 1044 buildCounterOperationMetadataV1--;
998 return o; 1045 return o;
999 } 1046 }
1000 1047
1001 checkOperationMetadataV1(api.OperationMetadataV1 o) { 1048 checkOperationMetadataV1(api.OperationMetadataV1 o) {
1002 buildCounterOperationMetadataV1++; 1049 buildCounterOperationMetadataV1++;
1003 if (buildCounterOperationMetadataV1 < 3) { 1050 if (buildCounterOperationMetadataV1 < 3) {
1004 unittest.expect(o.endTime, unittest.equals('foo')); 1051 unittest.expect(o.endTime, unittest.equals('foo'));
1005 unittest.expect(o.ephemeralMessage, unittest.equals('foo')); 1052 unittest.expect(o.ephemeralMessage, unittest.equals('foo'));
1006 unittest.expect(o.insertTime, unittest.equals('foo')); 1053 unittest.expect(o.insertTime, unittest.equals('foo'));
1007 unittest.expect(o.method, unittest.equals('foo')); 1054 unittest.expect(o.method, unittest.equals('foo'));
1008 unittest.expect(o.target, unittest.equals('foo')); 1055 unittest.expect(o.target, unittest.equals('foo'));
1009 unittest.expect(o.user, unittest.equals('foo')); 1056 unittest.expect(o.user, unittest.equals('foo'));
1010 checkUnnamed3538(o.warning); 1057 checkUnnamed3546(o.warning);
1011 } 1058 }
1012 buildCounterOperationMetadataV1--; 1059 buildCounterOperationMetadataV1--;
1013 } 1060 }
1014 1061
1015 buildUnnamed3539() { 1062 buildUnnamed3547() {
1016 var o = new core.List<core.String>(); 1063 var o = new core.List<core.String>();
1017 o.add("foo"); 1064 o.add("foo");
1018 o.add("foo"); 1065 o.add("foo");
1019 return o; 1066 return o;
1020 } 1067 }
1021 1068
1022 checkUnnamed3539(core.List<core.String> o) { 1069 checkUnnamed3547(core.List<core.String> o) {
1023 unittest.expect(o, unittest.hasLength(2)); 1070 unittest.expect(o, unittest.hasLength(2));
1024 unittest.expect(o[0], unittest.equals('foo')); 1071 unittest.expect(o[0], unittest.equals('foo'));
1025 unittest.expect(o[1], unittest.equals('foo')); 1072 unittest.expect(o[1], unittest.equals('foo'));
1026 } 1073 }
1027 1074
1028 core.int buildCounterOperationMetadataV1Alpha = 0; 1075 core.int buildCounterOperationMetadataV1Alpha = 0;
1029 buildOperationMetadataV1Alpha() { 1076 buildOperationMetadataV1Alpha() {
1030 var o = new api.OperationMetadataV1Alpha(); 1077 var o = new api.OperationMetadataV1Alpha();
1031 buildCounterOperationMetadataV1Alpha++; 1078 buildCounterOperationMetadataV1Alpha++;
1032 if (buildCounterOperationMetadataV1Alpha < 3) { 1079 if (buildCounterOperationMetadataV1Alpha < 3) {
1033 o.endTime = "foo"; 1080 o.endTime = "foo";
1034 o.ephemeralMessage = "foo"; 1081 o.ephemeralMessage = "foo";
1035 o.insertTime = "foo"; 1082 o.insertTime = "foo";
1036 o.method = "foo"; 1083 o.method = "foo";
1037 o.target = "foo"; 1084 o.target = "foo";
1038 o.user = "foo"; 1085 o.user = "foo";
1039 o.warning = buildUnnamed3539(); 1086 o.warning = buildUnnamed3547();
1040 } 1087 }
1041 buildCounterOperationMetadataV1Alpha--; 1088 buildCounterOperationMetadataV1Alpha--;
1042 return o; 1089 return o;
1043 } 1090 }
1044 1091
1045 checkOperationMetadataV1Alpha(api.OperationMetadataV1Alpha o) { 1092 checkOperationMetadataV1Alpha(api.OperationMetadataV1Alpha o) {
1046 buildCounterOperationMetadataV1Alpha++; 1093 buildCounterOperationMetadataV1Alpha++;
1047 if (buildCounterOperationMetadataV1Alpha < 3) { 1094 if (buildCounterOperationMetadataV1Alpha < 3) {
1048 unittest.expect(o.endTime, unittest.equals('foo')); 1095 unittest.expect(o.endTime, unittest.equals('foo'));
1049 unittest.expect(o.ephemeralMessage, unittest.equals('foo')); 1096 unittest.expect(o.ephemeralMessage, unittest.equals('foo'));
1050 unittest.expect(o.insertTime, unittest.equals('foo')); 1097 unittest.expect(o.insertTime, unittest.equals('foo'));
1051 unittest.expect(o.method, unittest.equals('foo')); 1098 unittest.expect(o.method, unittest.equals('foo'));
1052 unittest.expect(o.target, unittest.equals('foo')); 1099 unittest.expect(o.target, unittest.equals('foo'));
1053 unittest.expect(o.user, unittest.equals('foo')); 1100 unittest.expect(o.user, unittest.equals('foo'));
1054 checkUnnamed3539(o.warning); 1101 checkUnnamed3547(o.warning);
1055 } 1102 }
1056 buildCounterOperationMetadataV1Alpha--; 1103 buildCounterOperationMetadataV1Alpha--;
1057 } 1104 }
1058 1105
1059 buildUnnamed3540() { 1106 buildUnnamed3548() {
1060 var o = new core.List<core.String>(); 1107 var o = new core.List<core.String>();
1061 o.add("foo"); 1108 o.add("foo");
1062 o.add("foo"); 1109 o.add("foo");
1063 return o; 1110 return o;
1064 } 1111 }
1065 1112
1066 checkUnnamed3540(core.List<core.String> o) { 1113 checkUnnamed3548(core.List<core.String> o) {
1067 unittest.expect(o, unittest.hasLength(2)); 1114 unittest.expect(o, unittest.hasLength(2));
1068 unittest.expect(o[0], unittest.equals('foo')); 1115 unittest.expect(o[0], unittest.equals('foo'));
1069 unittest.expect(o[1], unittest.equals('foo')); 1116 unittest.expect(o[1], unittest.equals('foo'));
1070 } 1117 }
1071 1118
1072 core.int buildCounterOperationMetadataV1Beta = 0; 1119 core.int buildCounterOperationMetadataV1Beta = 0;
1073 buildOperationMetadataV1Beta() { 1120 buildOperationMetadataV1Beta() {
1074 var o = new api.OperationMetadataV1Beta(); 1121 var o = new api.OperationMetadataV1Beta();
1075 buildCounterOperationMetadataV1Beta++; 1122 buildCounterOperationMetadataV1Beta++;
1076 if (buildCounterOperationMetadataV1Beta < 3) { 1123 if (buildCounterOperationMetadataV1Beta < 3) {
1077 o.endTime = "foo"; 1124 o.endTime = "foo";
1078 o.ephemeralMessage = "foo"; 1125 o.ephemeralMessage = "foo";
1079 o.insertTime = "foo"; 1126 o.insertTime = "foo";
1080 o.method = "foo"; 1127 o.method = "foo";
1081 o.target = "foo"; 1128 o.target = "foo";
1082 o.user = "foo"; 1129 o.user = "foo";
1083 o.warning = buildUnnamed3540(); 1130 o.warning = buildUnnamed3548();
1084 } 1131 }
1085 buildCounterOperationMetadataV1Beta--; 1132 buildCounterOperationMetadataV1Beta--;
1086 return o; 1133 return o;
1087 } 1134 }
1088 1135
1089 checkOperationMetadataV1Beta(api.OperationMetadataV1Beta o) { 1136 checkOperationMetadataV1Beta(api.OperationMetadataV1Beta o) {
1090 buildCounterOperationMetadataV1Beta++; 1137 buildCounterOperationMetadataV1Beta++;
1091 if (buildCounterOperationMetadataV1Beta < 3) { 1138 if (buildCounterOperationMetadataV1Beta < 3) {
1092 unittest.expect(o.endTime, unittest.equals('foo')); 1139 unittest.expect(o.endTime, unittest.equals('foo'));
1093 unittest.expect(o.ephemeralMessage, unittest.equals('foo')); 1140 unittest.expect(o.ephemeralMessage, unittest.equals('foo'));
1094 unittest.expect(o.insertTime, unittest.equals('foo')); 1141 unittest.expect(o.insertTime, unittest.equals('foo'));
1095 unittest.expect(o.method, unittest.equals('foo')); 1142 unittest.expect(o.method, unittest.equals('foo'));
1096 unittest.expect(o.target, unittest.equals('foo')); 1143 unittest.expect(o.target, unittest.equals('foo'));
1097 unittest.expect(o.user, unittest.equals('foo')); 1144 unittest.expect(o.user, unittest.equals('foo'));
1098 checkUnnamed3540(o.warning); 1145 checkUnnamed3548(o.warning);
1099 } 1146 }
1100 buildCounterOperationMetadataV1Beta--; 1147 buildCounterOperationMetadataV1Beta--;
1101 } 1148 }
1102 1149
1103 core.int buildCounterOperationMetadataV1Beta5 = 0; 1150 core.int buildCounterOperationMetadataV1Beta5 = 0;
1104 buildOperationMetadataV1Beta5() { 1151 buildOperationMetadataV1Beta5() {
1105 var o = new api.OperationMetadataV1Beta5(); 1152 var o = new api.OperationMetadataV1Beta5();
1106 buildCounterOperationMetadataV1Beta5++; 1153 buildCounterOperationMetadataV1Beta5++;
1107 if (buildCounterOperationMetadataV1Beta5 < 3) { 1154 if (buildCounterOperationMetadataV1Beta5 < 3) {
1108 o.endTime = "foo"; 1155 o.endTime = "foo";
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 1188
1142 checkRequestUtilization(api.RequestUtilization o) { 1189 checkRequestUtilization(api.RequestUtilization o) {
1143 buildCounterRequestUtilization++; 1190 buildCounterRequestUtilization++;
1144 if (buildCounterRequestUtilization < 3) { 1191 if (buildCounterRequestUtilization < 3) {
1145 unittest.expect(o.targetConcurrentRequests, unittest.equals(42)); 1192 unittest.expect(o.targetConcurrentRequests, unittest.equals(42));
1146 unittest.expect(o.targetRequestCountPerSec, unittest.equals(42)); 1193 unittest.expect(o.targetRequestCountPerSec, unittest.equals(42));
1147 } 1194 }
1148 buildCounterRequestUtilization--; 1195 buildCounterRequestUtilization--;
1149 } 1196 }
1150 1197
1151 buildUnnamed3541() { 1198 buildUnnamed3549() {
1152 var o = new core.List<api.Volume>(); 1199 var o = new core.List<api.Volume>();
1153 o.add(buildVolume()); 1200 o.add(buildVolume());
1154 o.add(buildVolume()); 1201 o.add(buildVolume());
1155 return o; 1202 return o;
1156 } 1203 }
1157 1204
1158 checkUnnamed3541(core.List<api.Volume> o) { 1205 checkUnnamed3549(core.List<api.Volume> o) {
1159 unittest.expect(o, unittest.hasLength(2)); 1206 unittest.expect(o, unittest.hasLength(2));
1160 checkVolume(o[0]); 1207 checkVolume(o[0]);
1161 checkVolume(o[1]); 1208 checkVolume(o[1]);
1162 } 1209 }
1163 1210
1164 core.int buildCounterResources = 0; 1211 core.int buildCounterResources = 0;
1165 buildResources() { 1212 buildResources() {
1166 var o = new api.Resources(); 1213 var o = new api.Resources();
1167 buildCounterResources++; 1214 buildCounterResources++;
1168 if (buildCounterResources < 3) { 1215 if (buildCounterResources < 3) {
1169 o.cpu = 42.0; 1216 o.cpu = 42.0;
1170 o.diskGb = 42.0; 1217 o.diskGb = 42.0;
1171 o.memoryGb = 42.0; 1218 o.memoryGb = 42.0;
1172 o.volumes = buildUnnamed3541(); 1219 o.volumes = buildUnnamed3549();
1173 } 1220 }
1174 buildCounterResources--; 1221 buildCounterResources--;
1175 return o; 1222 return o;
1176 } 1223 }
1177 1224
1178 checkResources(api.Resources o) { 1225 checkResources(api.Resources o) {
1179 buildCounterResources++; 1226 buildCounterResources++;
1180 if (buildCounterResources < 3) { 1227 if (buildCounterResources < 3) {
1181 unittest.expect(o.cpu, unittest.equals(42.0)); 1228 unittest.expect(o.cpu, unittest.equals(42.0));
1182 unittest.expect(o.diskGb, unittest.equals(42.0)); 1229 unittest.expect(o.diskGb, unittest.equals(42.0));
1183 unittest.expect(o.memoryGb, unittest.equals(42.0)); 1230 unittest.expect(o.memoryGb, unittest.equals(42.0));
1184 checkUnnamed3541(o.volumes); 1231 checkUnnamed3549(o.volumes);
1185 } 1232 }
1186 buildCounterResources--; 1233 buildCounterResources--;
1187 } 1234 }
1188 1235
1189 core.int buildCounterScriptHandler = 0; 1236 core.int buildCounterScriptHandler = 0;
1190 buildScriptHandler() { 1237 buildScriptHandler() {
1191 var o = new api.ScriptHandler(); 1238 var o = new api.ScriptHandler();
1192 buildCounterScriptHandler++; 1239 buildCounterScriptHandler++;
1193 if (buildCounterScriptHandler < 3) { 1240 if (buildCounterScriptHandler < 3) {
1194 o.scriptPath = "foo"; 1241 o.scriptPath = "foo";
(...skipping 24 matching lines...) Expand all
1219 1266
1220 checkSourceReference(api.SourceReference o) { 1267 checkSourceReference(api.SourceReference o) {
1221 buildCounterSourceReference++; 1268 buildCounterSourceReference++;
1222 if (buildCounterSourceReference < 3) { 1269 if (buildCounterSourceReference < 3) {
1223 unittest.expect(o.repository, unittest.equals('foo')); 1270 unittest.expect(o.repository, unittest.equals('foo'));
1224 unittest.expect(o.revisionId, unittest.equals('foo')); 1271 unittest.expect(o.revisionId, unittest.equals('foo'));
1225 } 1272 }
1226 buildCounterSourceReference--; 1273 buildCounterSourceReference--;
1227 } 1274 }
1228 1275
1229 buildUnnamed3542() { 1276 buildUnnamed3550() {
1230 var o = new core.Map<core.String, core.String>(); 1277 var o = new core.Map<core.String, core.String>();
1231 o["x"] = "foo"; 1278 o["x"] = "foo";
1232 o["y"] = "foo"; 1279 o["y"] = "foo";
1233 return o; 1280 return o;
1234 } 1281 }
1235 1282
1236 checkUnnamed3542(core.Map<core.String, core.String> o) { 1283 checkUnnamed3550(core.Map<core.String, core.String> o) {
1237 unittest.expect(o, unittest.hasLength(2)); 1284 unittest.expect(o, unittest.hasLength(2));
1238 unittest.expect(o["x"], unittest.equals('foo')); 1285 unittest.expect(o["x"], unittest.equals('foo'));
1239 unittest.expect(o["y"], unittest.equals('foo')); 1286 unittest.expect(o["y"], unittest.equals('foo'));
1240 } 1287 }
1241 1288
1242 core.int buildCounterStaticDirectoryHandler = 0; 1289 core.int buildCounterStaticDirectoryHandler = 0;
1243 buildStaticDirectoryHandler() { 1290 buildStaticDirectoryHandler() {
1244 var o = new api.StaticDirectoryHandler(); 1291 var o = new api.StaticDirectoryHandler();
1245 buildCounterStaticDirectoryHandler++; 1292 buildCounterStaticDirectoryHandler++;
1246 if (buildCounterStaticDirectoryHandler < 3) { 1293 if (buildCounterStaticDirectoryHandler < 3) {
1247 o.applicationReadable = true; 1294 o.applicationReadable = true;
1248 o.directory = "foo"; 1295 o.directory = "foo";
1249 o.expiration = "foo"; 1296 o.expiration = "foo";
1250 o.httpHeaders = buildUnnamed3542(); 1297 o.httpHeaders = buildUnnamed3550();
1251 o.mimeType = "foo"; 1298 o.mimeType = "foo";
1252 o.requireMatchingFile = true; 1299 o.requireMatchingFile = true;
1253 } 1300 }
1254 buildCounterStaticDirectoryHandler--; 1301 buildCounterStaticDirectoryHandler--;
1255 return o; 1302 return o;
1256 } 1303 }
1257 1304
1258 checkStaticDirectoryHandler(api.StaticDirectoryHandler o) { 1305 checkStaticDirectoryHandler(api.StaticDirectoryHandler o) {
1259 buildCounterStaticDirectoryHandler++; 1306 buildCounterStaticDirectoryHandler++;
1260 if (buildCounterStaticDirectoryHandler < 3) { 1307 if (buildCounterStaticDirectoryHandler < 3) {
1261 unittest.expect(o.applicationReadable, unittest.isTrue); 1308 unittest.expect(o.applicationReadable, unittest.isTrue);
1262 unittest.expect(o.directory, unittest.equals('foo')); 1309 unittest.expect(o.directory, unittest.equals('foo'));
1263 unittest.expect(o.expiration, unittest.equals('foo')); 1310 unittest.expect(o.expiration, unittest.equals('foo'));
1264 checkUnnamed3542(o.httpHeaders); 1311 checkUnnamed3550(o.httpHeaders);
1265 unittest.expect(o.mimeType, unittest.equals('foo')); 1312 unittest.expect(o.mimeType, unittest.equals('foo'));
1266 unittest.expect(o.requireMatchingFile, unittest.isTrue); 1313 unittest.expect(o.requireMatchingFile, unittest.isTrue);
1267 } 1314 }
1268 buildCounterStaticDirectoryHandler--; 1315 buildCounterStaticDirectoryHandler--;
1269 } 1316 }
1270 1317
1271 buildUnnamed3543() { 1318 buildUnnamed3551() {
1272 var o = new core.Map<core.String, core.String>(); 1319 var o = new core.Map<core.String, core.String>();
1273 o["x"] = "foo"; 1320 o["x"] = "foo";
1274 o["y"] = "foo"; 1321 o["y"] = "foo";
1275 return o; 1322 return o;
1276 } 1323 }
1277 1324
1278 checkUnnamed3543(core.Map<core.String, core.String> o) { 1325 checkUnnamed3551(core.Map<core.String, core.String> o) {
1279 unittest.expect(o, unittest.hasLength(2)); 1326 unittest.expect(o, unittest.hasLength(2));
1280 unittest.expect(o["x"], unittest.equals('foo')); 1327 unittest.expect(o["x"], unittest.equals('foo'));
1281 unittest.expect(o["y"], unittest.equals('foo')); 1328 unittest.expect(o["y"], unittest.equals('foo'));
1282 } 1329 }
1283 1330
1284 core.int buildCounterStaticFilesHandler = 0; 1331 core.int buildCounterStaticFilesHandler = 0;
1285 buildStaticFilesHandler() { 1332 buildStaticFilesHandler() {
1286 var o = new api.StaticFilesHandler(); 1333 var o = new api.StaticFilesHandler();
1287 buildCounterStaticFilesHandler++; 1334 buildCounterStaticFilesHandler++;
1288 if (buildCounterStaticFilesHandler < 3) { 1335 if (buildCounterStaticFilesHandler < 3) {
1289 o.applicationReadable = true; 1336 o.applicationReadable = true;
1290 o.expiration = "foo"; 1337 o.expiration = "foo";
1291 o.httpHeaders = buildUnnamed3543(); 1338 o.httpHeaders = buildUnnamed3551();
1292 o.mimeType = "foo"; 1339 o.mimeType = "foo";
1293 o.path = "foo"; 1340 o.path = "foo";
1294 o.requireMatchingFile = true; 1341 o.requireMatchingFile = true;
1295 o.uploadPathRegex = "foo"; 1342 o.uploadPathRegex = "foo";
1296 } 1343 }
1297 buildCounterStaticFilesHandler--; 1344 buildCounterStaticFilesHandler--;
1298 return o; 1345 return o;
1299 } 1346 }
1300 1347
1301 checkStaticFilesHandler(api.StaticFilesHandler o) { 1348 checkStaticFilesHandler(api.StaticFilesHandler o) {
1302 buildCounterStaticFilesHandler++; 1349 buildCounterStaticFilesHandler++;
1303 if (buildCounterStaticFilesHandler < 3) { 1350 if (buildCounterStaticFilesHandler < 3) {
1304 unittest.expect(o.applicationReadable, unittest.isTrue); 1351 unittest.expect(o.applicationReadable, unittest.isTrue);
1305 unittest.expect(o.expiration, unittest.equals('foo')); 1352 unittest.expect(o.expiration, unittest.equals('foo'));
1306 checkUnnamed3543(o.httpHeaders); 1353 checkUnnamed3551(o.httpHeaders);
1307 unittest.expect(o.mimeType, unittest.equals('foo')); 1354 unittest.expect(o.mimeType, unittest.equals('foo'));
1308 unittest.expect(o.path, unittest.equals('foo')); 1355 unittest.expect(o.path, unittest.equals('foo'));
1309 unittest.expect(o.requireMatchingFile, unittest.isTrue); 1356 unittest.expect(o.requireMatchingFile, unittest.isTrue);
1310 unittest.expect(o.uploadPathRegex, unittest.equals('foo')); 1357 unittest.expect(o.uploadPathRegex, unittest.equals('foo'));
1311 } 1358 }
1312 buildCounterStaticFilesHandler--; 1359 buildCounterStaticFilesHandler--;
1313 } 1360 }
1314 1361
1315 buildUnnamed3544() { 1362 buildUnnamed3552() {
1316 var o = new core.Map<core.String, core.Object>(); 1363 var o = new core.Map<core.String, core.Object>();
1317 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 1364 o["x"] = {
1318 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 1365 'list': [1, 2, 3],
1366 'bool': true,
1367 'string': 'foo'
1368 };
1369 o["y"] = {
1370 'list': [1, 2, 3],
1371 'bool': true,
1372 'string': 'foo'
1373 };
1319 return o; 1374 return o;
1320 } 1375 }
1321 1376
1322 checkUnnamed3544(core.Map<core.String, core.Object> o) { 1377 checkUnnamed3552(core.Map<core.String, core.Object> o) {
1323 unittest.expect(o, unittest.hasLength(2)); 1378 unittest.expect(o, unittest.hasLength(2));
1324 var casted7 = (o["x"]) as core.Map; unittest.expect(casted7, unittest.hasLengt h(3)); unittest.expect(casted7["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted7["bool"], unittest.equals(true)); unittest.expect(casted7["string"], unittest.equals('foo')); 1379 var casted7 = (o["x"]) as core.Map;
1325 var casted8 = (o["y"]) as core.Map; unittest.expect(casted8, unittest.hasLengt h(3)); unittest.expect(casted8["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted8["bool"], unittest.equals(true)); unittest.expect(casted8["string"], unittest.equals('foo')); 1380 unittest.expect(casted7, unittest.hasLength(3));
1381 unittest.expect(casted7["list"], unittest.equals([1, 2, 3]));
1382 unittest.expect(casted7["bool"], unittest.equals(true));
1383 unittest.expect(casted7["string"], unittest.equals('foo'));
1384 var casted8 = (o["y"]) as core.Map;
1385 unittest.expect(casted8, unittest.hasLength(3));
1386 unittest.expect(casted8["list"], unittest.equals([1, 2, 3]));
1387 unittest.expect(casted8["bool"], unittest.equals(true));
1388 unittest.expect(casted8["string"], unittest.equals('foo'));
1326 } 1389 }
1327 1390
1328 buildUnnamed3545() { 1391 buildUnnamed3553() {
1329 var o = new core.List<core.Map<core.String, core.Object>>(); 1392 var o = new core.List<core.Map<core.String, core.Object>>();
1330 o.add(buildUnnamed3544()); 1393 o.add(buildUnnamed3552());
1331 o.add(buildUnnamed3544()); 1394 o.add(buildUnnamed3552());
1332 return o; 1395 return o;
1333 } 1396 }
1334 1397
1335 checkUnnamed3545(core.List<core.Map<core.String, core.Object>> o) { 1398 checkUnnamed3553(core.List<core.Map<core.String, core.Object>> o) {
1336 unittest.expect(o, unittest.hasLength(2)); 1399 unittest.expect(o, unittest.hasLength(2));
1337 checkUnnamed3544(o[0]); 1400 checkUnnamed3552(o[0]);
1338 checkUnnamed3544(o[1]); 1401 checkUnnamed3552(o[1]);
1339 } 1402 }
1340 1403
1341 core.int buildCounterStatus = 0; 1404 core.int buildCounterStatus = 0;
1342 buildStatus() { 1405 buildStatus() {
1343 var o = new api.Status(); 1406 var o = new api.Status();
1344 buildCounterStatus++; 1407 buildCounterStatus++;
1345 if (buildCounterStatus < 3) { 1408 if (buildCounterStatus < 3) {
1346 o.code = 42; 1409 o.code = 42;
1347 o.details = buildUnnamed3545(); 1410 o.details = buildUnnamed3553();
1348 o.message = "foo"; 1411 o.message = "foo";
1349 } 1412 }
1350 buildCounterStatus--; 1413 buildCounterStatus--;
1351 return o; 1414 return o;
1352 } 1415 }
1353 1416
1354 checkStatus(api.Status o) { 1417 checkStatus(api.Status o) {
1355 buildCounterStatus++; 1418 buildCounterStatus++;
1356 if (buildCounterStatus < 3) { 1419 if (buildCounterStatus < 3) {
1357 unittest.expect(o.code, unittest.equals(42)); 1420 unittest.expect(o.code, unittest.equals(42));
1358 checkUnnamed3545(o.details); 1421 checkUnnamed3553(o.details);
1359 unittest.expect(o.message, unittest.equals('foo')); 1422 unittest.expect(o.message, unittest.equals('foo'));
1360 } 1423 }
1361 buildCounterStatus--; 1424 buildCounterStatus--;
1362 } 1425 }
1363 1426
1364 buildUnnamed3546() { 1427 buildUnnamed3554() {
1365 var o = new core.Map<core.String, core.double>(); 1428 var o = new core.Map<core.String, core.double>();
1366 o["x"] = 42.0; 1429 o["x"] = 42.0;
1367 o["y"] = 42.0; 1430 o["y"] = 42.0;
1368 return o; 1431 return o;
1369 } 1432 }
1370 1433
1371 checkUnnamed3546(core.Map<core.String, core.double> o) { 1434 checkUnnamed3554(core.Map<core.String, core.double> o) {
1372 unittest.expect(o, unittest.hasLength(2)); 1435 unittest.expect(o, unittest.hasLength(2));
1373 unittest.expect(o["x"], unittest.equals(42.0)); 1436 unittest.expect(o["x"], unittest.equals(42.0));
1374 unittest.expect(o["y"], unittest.equals(42.0)); 1437 unittest.expect(o["y"], unittest.equals(42.0));
1375 } 1438 }
1376 1439
1377 core.int buildCounterTrafficSplit = 0; 1440 core.int buildCounterTrafficSplit = 0;
1378 buildTrafficSplit() { 1441 buildTrafficSplit() {
1379 var o = new api.TrafficSplit(); 1442 var o = new api.TrafficSplit();
1380 buildCounterTrafficSplit++; 1443 buildCounterTrafficSplit++;
1381 if (buildCounterTrafficSplit < 3) { 1444 if (buildCounterTrafficSplit < 3) {
1382 o.allocations = buildUnnamed3546(); 1445 o.allocations = buildUnnamed3554();
1383 o.shardBy = "foo"; 1446 o.shardBy = "foo";
1384 } 1447 }
1385 buildCounterTrafficSplit--; 1448 buildCounterTrafficSplit--;
1386 return o; 1449 return o;
1387 } 1450 }
1388 1451
1389 checkTrafficSplit(api.TrafficSplit o) { 1452 checkTrafficSplit(api.TrafficSplit o) {
1390 buildCounterTrafficSplit++; 1453 buildCounterTrafficSplit++;
1391 if (buildCounterTrafficSplit < 3) { 1454 if (buildCounterTrafficSplit < 3) {
1392 checkUnnamed3546(o.allocations); 1455 checkUnnamed3554(o.allocations);
1393 unittest.expect(o.shardBy, unittest.equals('foo')); 1456 unittest.expect(o.shardBy, unittest.equals('foo'));
1394 } 1457 }
1395 buildCounterTrafficSplit--; 1458 buildCounterTrafficSplit--;
1396 } 1459 }
1397 1460
1398 core.int buildCounterUrlDispatchRule = 0; 1461 core.int buildCounterUrlDispatchRule = 0;
1399 buildUrlDispatchRule() { 1462 buildUrlDispatchRule() {
1400 var o = new api.UrlDispatchRule(); 1463 var o = new api.UrlDispatchRule();
1401 buildCounterUrlDispatchRule++; 1464 buildCounterUrlDispatchRule++;
1402 if (buildCounterUrlDispatchRule < 3) { 1465 if (buildCounterUrlDispatchRule < 3) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1446 unittest.expect(o.redirectHttpResponseCode, unittest.equals('foo')); 1509 unittest.expect(o.redirectHttpResponseCode, unittest.equals('foo'));
1447 checkScriptHandler(o.script); 1510 checkScriptHandler(o.script);
1448 unittest.expect(o.securityLevel, unittest.equals('foo')); 1511 unittest.expect(o.securityLevel, unittest.equals('foo'));
1449 checkStaticDirectoryHandler(o.staticDirectory); 1512 checkStaticDirectoryHandler(o.staticDirectory);
1450 checkStaticFilesHandler(o.staticFiles); 1513 checkStaticFilesHandler(o.staticFiles);
1451 unittest.expect(o.urlRegex, unittest.equals('foo')); 1514 unittest.expect(o.urlRegex, unittest.equals('foo'));
1452 } 1515 }
1453 buildCounterUrlMap--; 1516 buildCounterUrlMap--;
1454 } 1517 }
1455 1518
1456 buildUnnamed3547() { 1519 buildUnnamed3555() {
1457 var o = new core.Map<core.String, core.String>(); 1520 var o = new core.Map<core.String, core.String>();
1458 o["x"] = "foo"; 1521 o["x"] = "foo";
1459 o["y"] = "foo"; 1522 o["y"] = "foo";
1460 return o; 1523 return o;
1461 } 1524 }
1462 1525
1463 checkUnnamed3547(core.Map<core.String, core.String> o) { 1526 checkUnnamed3555(core.Map<core.String, core.String> o) {
1464 unittest.expect(o, unittest.hasLength(2)); 1527 unittest.expect(o, unittest.hasLength(2));
1465 unittest.expect(o["x"], unittest.equals('foo')); 1528 unittest.expect(o["x"], unittest.equals('foo'));
1466 unittest.expect(o["y"], unittest.equals('foo')); 1529 unittest.expect(o["y"], unittest.equals('foo'));
1467 } 1530 }
1468 1531
1469 buildUnnamed3548() { 1532 buildUnnamed3556() {
1470 var o = new core.Map<core.String, core.String>(); 1533 var o = new core.Map<core.String, core.String>();
1471 o["x"] = "foo"; 1534 o["x"] = "foo";
1472 o["y"] = "foo"; 1535 o["y"] = "foo";
1473 return o; 1536 return o;
1474 } 1537 }
1475 1538
1476 checkUnnamed3548(core.Map<core.String, core.String> o) { 1539 checkUnnamed3556(core.Map<core.String, core.String> o) {
1477 unittest.expect(o, unittest.hasLength(2)); 1540 unittest.expect(o, unittest.hasLength(2));
1478 unittest.expect(o["x"], unittest.equals('foo')); 1541 unittest.expect(o["x"], unittest.equals('foo'));
1479 unittest.expect(o["y"], unittest.equals('foo')); 1542 unittest.expect(o["y"], unittest.equals('foo'));
1480 } 1543 }
1481 1544
1482 buildUnnamed3549() { 1545 buildUnnamed3557() {
1483 var o = new core.List<api.ErrorHandler>(); 1546 var o = new core.List<api.ErrorHandler>();
1484 o.add(buildErrorHandler()); 1547 o.add(buildErrorHandler());
1485 o.add(buildErrorHandler()); 1548 o.add(buildErrorHandler());
1486 return o; 1549 return o;
1487 } 1550 }
1488 1551
1489 checkUnnamed3549(core.List<api.ErrorHandler> o) { 1552 checkUnnamed3557(core.List<api.ErrorHandler> o) {
1490 unittest.expect(o, unittest.hasLength(2)); 1553 unittest.expect(o, unittest.hasLength(2));
1491 checkErrorHandler(o[0]); 1554 checkErrorHandler(o[0]);
1492 checkErrorHandler(o[1]); 1555 checkErrorHandler(o[1]);
1493 } 1556 }
1494 1557
1495 buildUnnamed3550() { 1558 buildUnnamed3558() {
1496 var o = new core.List<api.UrlMap>(); 1559 var o = new core.List<api.UrlMap>();
1497 o.add(buildUrlMap()); 1560 o.add(buildUrlMap());
1498 o.add(buildUrlMap()); 1561 o.add(buildUrlMap());
1499 return o; 1562 return o;
1500 } 1563 }
1501 1564
1502 checkUnnamed3550(core.List<api.UrlMap> o) { 1565 checkUnnamed3558(core.List<api.UrlMap> o) {
1503 unittest.expect(o, unittest.hasLength(2)); 1566 unittest.expect(o, unittest.hasLength(2));
1504 checkUrlMap(o[0]); 1567 checkUrlMap(o[0]);
1505 checkUrlMap(o[1]); 1568 checkUrlMap(o[1]);
1506 } 1569 }
1507 1570
1508 buildUnnamed3551() { 1571 buildUnnamed3559() {
1509 var o = new core.List<core.String>(); 1572 var o = new core.List<core.String>();
1510 o.add("foo"); 1573 o.add("foo");
1511 o.add("foo"); 1574 o.add("foo");
1512 return o; 1575 return o;
1513 } 1576 }
1514 1577
1515 checkUnnamed3551(core.List<core.String> o) { 1578 checkUnnamed3559(core.List<core.String> o) {
1516 unittest.expect(o, unittest.hasLength(2)); 1579 unittest.expect(o, unittest.hasLength(2));
1517 unittest.expect(o[0], unittest.equals('foo')); 1580 unittest.expect(o[0], unittest.equals('foo'));
1518 unittest.expect(o[1], unittest.equals('foo')); 1581 unittest.expect(o[1], unittest.equals('foo'));
1519 } 1582 }
1520 1583
1521 buildUnnamed3552() { 1584 buildUnnamed3560() {
1522 var o = new core.List<api.Library>(); 1585 var o = new core.List<api.Library>();
1523 o.add(buildLibrary()); 1586 o.add(buildLibrary());
1524 o.add(buildLibrary()); 1587 o.add(buildLibrary());
1525 return o; 1588 return o;
1526 } 1589 }
1527 1590
1528 checkUnnamed3552(core.List<api.Library> o) { 1591 checkUnnamed3560(core.List<api.Library> o) {
1529 unittest.expect(o, unittest.hasLength(2)); 1592 unittest.expect(o, unittest.hasLength(2));
1530 checkLibrary(o[0]); 1593 checkLibrary(o[0]);
1531 checkLibrary(o[1]); 1594 checkLibrary(o[1]);
1532 } 1595 }
1533 1596
1534 core.int buildCounterVersion = 0; 1597 core.int buildCounterVersion = 0;
1535 buildVersion() { 1598 buildVersion() {
1536 var o = new api.Version(); 1599 var o = new api.Version();
1537 buildCounterVersion++; 1600 buildCounterVersion++;
1538 if (buildCounterVersion < 3) { 1601 if (buildCounterVersion < 3) {
1539 o.apiConfig = buildApiConfigHandler(); 1602 o.apiConfig = buildApiConfigHandler();
1540 o.automaticScaling = buildAutomaticScaling(); 1603 o.automaticScaling = buildAutomaticScaling();
1541 o.basicScaling = buildBasicScaling(); 1604 o.basicScaling = buildBasicScaling();
1542 o.betaSettings = buildUnnamed3547(); 1605 o.betaSettings = buildUnnamed3555();
1543 o.creationTime = "foo"; 1606 o.creationTime = "foo";
1544 o.defaultExpiration = "foo"; 1607 o.defaultExpiration = "foo";
1545 o.deployer = "foo"; 1608 o.deployer = "foo";
1546 o.deployment = buildDeployment(); 1609 o.deployment = buildDeployment();
1547 o.env = "foo"; 1610 o.env = "foo";
1548 o.envVariables = buildUnnamed3548(); 1611 o.envVariables = buildUnnamed3556();
1549 o.errorHandlers = buildUnnamed3549(); 1612 o.errorHandlers = buildUnnamed3557();
1550 o.handlers = buildUnnamed3550(); 1613 o.handlers = buildUnnamed3558();
1551 o.healthCheck = buildHealthCheck(); 1614 o.healthCheck = buildHealthCheck();
1552 o.id = "foo"; 1615 o.id = "foo";
1553 o.inboundServices = buildUnnamed3551(); 1616 o.inboundServices = buildUnnamed3559();
1554 o.instanceClass = "foo"; 1617 o.instanceClass = "foo";
1555 o.libraries = buildUnnamed3552(); 1618 o.libraries = buildUnnamed3560();
1556 o.manualScaling = buildManualScaling(); 1619 o.manualScaling = buildManualScaling();
1557 o.name = "foo"; 1620 o.name = "foo";
1558 o.network = buildNetwork(); 1621 o.network = buildNetwork();
1559 o.nobuildFilesRegex = "foo"; 1622 o.nobuildFilesRegex = "foo";
1560 o.resources = buildResources(); 1623 o.resources = buildResources();
1561 o.runtime = "foo"; 1624 o.runtime = "foo";
1562 o.runtimeApiVersion = "foo"; 1625 o.runtimeApiVersion = "foo";
1563 o.servingStatus = "foo"; 1626 o.servingStatus = "foo";
1564 o.threadsafe = true; 1627 o.threadsafe = true;
1565 o.vm = true; 1628 o.vm = true;
1566 } 1629 }
1567 buildCounterVersion--; 1630 buildCounterVersion--;
1568 return o; 1631 return o;
1569 } 1632 }
1570 1633
1571 checkVersion(api.Version o) { 1634 checkVersion(api.Version o) {
1572 buildCounterVersion++; 1635 buildCounterVersion++;
1573 if (buildCounterVersion < 3) { 1636 if (buildCounterVersion < 3) {
1574 checkApiConfigHandler(o.apiConfig); 1637 checkApiConfigHandler(o.apiConfig);
1575 checkAutomaticScaling(o.automaticScaling); 1638 checkAutomaticScaling(o.automaticScaling);
1576 checkBasicScaling(o.basicScaling); 1639 checkBasicScaling(o.basicScaling);
1577 checkUnnamed3547(o.betaSettings); 1640 checkUnnamed3555(o.betaSettings);
1578 unittest.expect(o.creationTime, unittest.equals('foo')); 1641 unittest.expect(o.creationTime, unittest.equals('foo'));
1579 unittest.expect(o.defaultExpiration, unittest.equals('foo')); 1642 unittest.expect(o.defaultExpiration, unittest.equals('foo'));
1580 unittest.expect(o.deployer, unittest.equals('foo')); 1643 unittest.expect(o.deployer, unittest.equals('foo'));
1581 checkDeployment(o.deployment); 1644 checkDeployment(o.deployment);
1582 unittest.expect(o.env, unittest.equals('foo')); 1645 unittest.expect(o.env, unittest.equals('foo'));
1583 checkUnnamed3548(o.envVariables); 1646 checkUnnamed3556(o.envVariables);
1584 checkUnnamed3549(o.errorHandlers); 1647 checkUnnamed3557(o.errorHandlers);
1585 checkUnnamed3550(o.handlers); 1648 checkUnnamed3558(o.handlers);
1586 checkHealthCheck(o.healthCheck); 1649 checkHealthCheck(o.healthCheck);
1587 unittest.expect(o.id, unittest.equals('foo')); 1650 unittest.expect(o.id, unittest.equals('foo'));
1588 checkUnnamed3551(o.inboundServices); 1651 checkUnnamed3559(o.inboundServices);
1589 unittest.expect(o.instanceClass, unittest.equals('foo')); 1652 unittest.expect(o.instanceClass, unittest.equals('foo'));
1590 checkUnnamed3552(o.libraries); 1653 checkUnnamed3560(o.libraries);
1591 checkManualScaling(o.manualScaling); 1654 checkManualScaling(o.manualScaling);
1592 unittest.expect(o.name, unittest.equals('foo')); 1655 unittest.expect(o.name, unittest.equals('foo'));
1593 checkNetwork(o.network); 1656 checkNetwork(o.network);
1594 unittest.expect(o.nobuildFilesRegex, unittest.equals('foo')); 1657 unittest.expect(o.nobuildFilesRegex, unittest.equals('foo'));
1595 checkResources(o.resources); 1658 checkResources(o.resources);
1596 unittest.expect(o.runtime, unittest.equals('foo')); 1659 unittest.expect(o.runtime, unittest.equals('foo'));
1597 unittest.expect(o.runtimeApiVersion, unittest.equals('foo')); 1660 unittest.expect(o.runtimeApiVersion, unittest.equals('foo'));
1598 unittest.expect(o.servingStatus, unittest.equals('foo')); 1661 unittest.expect(o.servingStatus, unittest.equals('foo'));
1599 unittest.expect(o.threadsafe, unittest.isTrue); 1662 unittest.expect(o.threadsafe, unittest.isTrue);
1600 unittest.expect(o.vm, unittest.isTrue); 1663 unittest.expect(o.vm, unittest.isTrue);
(...skipping 17 matching lines...) Expand all
1618 checkVolume(api.Volume o) { 1681 checkVolume(api.Volume o) {
1619 buildCounterVolume++; 1682 buildCounterVolume++;
1620 if (buildCounterVolume < 3) { 1683 if (buildCounterVolume < 3) {
1621 unittest.expect(o.name, unittest.equals('foo')); 1684 unittest.expect(o.name, unittest.equals('foo'));
1622 unittest.expect(o.sizeGb, unittest.equals(42.0)); 1685 unittest.expect(o.sizeGb, unittest.equals(42.0));
1623 unittest.expect(o.volumeType, unittest.equals('foo')); 1686 unittest.expect(o.volumeType, unittest.equals('foo'));
1624 } 1687 }
1625 buildCounterVolume--; 1688 buildCounterVolume--;
1626 } 1689 }
1627 1690
1628
1629 main() { 1691 main() {
1630 unittest.group("obj-schema-ApiConfigHandler", () { 1692 unittest.group("obj-schema-ApiConfigHandler", () {
1631 unittest.test("to-json--from-json", () { 1693 unittest.test("to-json--from-json", () {
1632 var o = buildApiConfigHandler(); 1694 var o = buildApiConfigHandler();
1633 var od = new api.ApiConfigHandler.fromJson(o.toJson()); 1695 var od = new api.ApiConfigHandler.fromJson(o.toJson());
1634 checkApiConfigHandler(od); 1696 checkApiConfigHandler(od);
1635 }); 1697 });
1636 }); 1698 });
1637 1699
1638
1639 unittest.group("obj-schema-ApiEndpointHandler", () { 1700 unittest.group("obj-schema-ApiEndpointHandler", () {
1640 unittest.test("to-json--from-json", () { 1701 unittest.test("to-json--from-json", () {
1641 var o = buildApiEndpointHandler(); 1702 var o = buildApiEndpointHandler();
1642 var od = new api.ApiEndpointHandler.fromJson(o.toJson()); 1703 var od = new api.ApiEndpointHandler.fromJson(o.toJson());
1643 checkApiEndpointHandler(od); 1704 checkApiEndpointHandler(od);
1644 }); 1705 });
1645 }); 1706 });
1646 1707
1647
1648 unittest.group("obj-schema-Application", () { 1708 unittest.group("obj-schema-Application", () {
1649 unittest.test("to-json--from-json", () { 1709 unittest.test("to-json--from-json", () {
1650 var o = buildApplication(); 1710 var o = buildApplication();
1651 var od = new api.Application.fromJson(o.toJson()); 1711 var od = new api.Application.fromJson(o.toJson());
1652 checkApplication(od); 1712 checkApplication(od);
1653 }); 1713 });
1654 }); 1714 });
1655 1715
1656
1657 unittest.group("obj-schema-AutomaticScaling", () { 1716 unittest.group("obj-schema-AutomaticScaling", () {
1658 unittest.test("to-json--from-json", () { 1717 unittest.test("to-json--from-json", () {
1659 var o = buildAutomaticScaling(); 1718 var o = buildAutomaticScaling();
1660 var od = new api.AutomaticScaling.fromJson(o.toJson()); 1719 var od = new api.AutomaticScaling.fromJson(o.toJson());
1661 checkAutomaticScaling(od); 1720 checkAutomaticScaling(od);
1662 }); 1721 });
1663 }); 1722 });
1664 1723
1665
1666 unittest.group("obj-schema-BasicScaling", () { 1724 unittest.group("obj-schema-BasicScaling", () {
1667 unittest.test("to-json--from-json", () { 1725 unittest.test("to-json--from-json", () {
1668 var o = buildBasicScaling(); 1726 var o = buildBasicScaling();
1669 var od = new api.BasicScaling.fromJson(o.toJson()); 1727 var od = new api.BasicScaling.fromJson(o.toJson());
1670 checkBasicScaling(od); 1728 checkBasicScaling(od);
1671 }); 1729 });
1672 }); 1730 });
1673 1731
1674
1675 unittest.group("obj-schema-ContainerInfo", () { 1732 unittest.group("obj-schema-ContainerInfo", () {
1676 unittest.test("to-json--from-json", () { 1733 unittest.test("to-json--from-json", () {
1677 var o = buildContainerInfo(); 1734 var o = buildContainerInfo();
1678 var od = new api.ContainerInfo.fromJson(o.toJson()); 1735 var od = new api.ContainerInfo.fromJson(o.toJson());
1679 checkContainerInfo(od); 1736 checkContainerInfo(od);
1680 }); 1737 });
1681 }); 1738 });
1682 1739
1683
1684 unittest.group("obj-schema-CpuUtilization", () { 1740 unittest.group("obj-schema-CpuUtilization", () {
1685 unittest.test("to-json--from-json", () { 1741 unittest.test("to-json--from-json", () {
1686 var o = buildCpuUtilization(); 1742 var o = buildCpuUtilization();
1687 var od = new api.CpuUtilization.fromJson(o.toJson()); 1743 var od = new api.CpuUtilization.fromJson(o.toJson());
1688 checkCpuUtilization(od); 1744 checkCpuUtilization(od);
1689 }); 1745 });
1690 }); 1746 });
1691 1747
1692
1693 unittest.group("obj-schema-DebugInstanceRequest", () { 1748 unittest.group("obj-schema-DebugInstanceRequest", () {
1694 unittest.test("to-json--from-json", () { 1749 unittest.test("to-json--from-json", () {
1695 var o = buildDebugInstanceRequest(); 1750 var o = buildDebugInstanceRequest();
1696 var od = new api.DebugInstanceRequest.fromJson(o.toJson()); 1751 var od = new api.DebugInstanceRequest.fromJson(o.toJson());
1697 checkDebugInstanceRequest(od); 1752 checkDebugInstanceRequest(od);
1698 }); 1753 });
1699 }); 1754 });
1700 1755
1701
1702 unittest.group("obj-schema-Deployment", () { 1756 unittest.group("obj-schema-Deployment", () {
1703 unittest.test("to-json--from-json", () { 1757 unittest.test("to-json--from-json", () {
1704 var o = buildDeployment(); 1758 var o = buildDeployment();
1705 var od = new api.Deployment.fromJson(o.toJson()); 1759 var od = new api.Deployment.fromJson(o.toJson());
1706 checkDeployment(od); 1760 checkDeployment(od);
1707 }); 1761 });
1708 }); 1762 });
1709 1763
1710
1711 unittest.group("obj-schema-DiskUtilization", () { 1764 unittest.group("obj-schema-DiskUtilization", () {
1712 unittest.test("to-json--from-json", () { 1765 unittest.test("to-json--from-json", () {
1713 var o = buildDiskUtilization(); 1766 var o = buildDiskUtilization();
1714 var od = new api.DiskUtilization.fromJson(o.toJson()); 1767 var od = new api.DiskUtilization.fromJson(o.toJson());
1715 checkDiskUtilization(od); 1768 checkDiskUtilization(od);
1716 }); 1769 });
1717 }); 1770 });
1718 1771
1719
1720 unittest.group("obj-schema-ErrorHandler", () { 1772 unittest.group("obj-schema-ErrorHandler", () {
1721 unittest.test("to-json--from-json", () { 1773 unittest.test("to-json--from-json", () {
1722 var o = buildErrorHandler(); 1774 var o = buildErrorHandler();
1723 var od = new api.ErrorHandler.fromJson(o.toJson()); 1775 var od = new api.ErrorHandler.fromJson(o.toJson());
1724 checkErrorHandler(od); 1776 checkErrorHandler(od);
1725 }); 1777 });
1726 }); 1778 });
1727 1779
1728
1729 unittest.group("obj-schema-FileInfo", () { 1780 unittest.group("obj-schema-FileInfo", () {
1730 unittest.test("to-json--from-json", () { 1781 unittest.test("to-json--from-json", () {
1731 var o = buildFileInfo(); 1782 var o = buildFileInfo();
1732 var od = new api.FileInfo.fromJson(o.toJson()); 1783 var od = new api.FileInfo.fromJson(o.toJson());
1733 checkFileInfo(od); 1784 checkFileInfo(od);
1734 }); 1785 });
1735 }); 1786 });
1736 1787
1737
1738 unittest.group("obj-schema-HealthCheck", () { 1788 unittest.group("obj-schema-HealthCheck", () {
1739 unittest.test("to-json--from-json", () { 1789 unittest.test("to-json--from-json", () {
1740 var o = buildHealthCheck(); 1790 var o = buildHealthCheck();
1741 var od = new api.HealthCheck.fromJson(o.toJson()); 1791 var od = new api.HealthCheck.fromJson(o.toJson());
1742 checkHealthCheck(od); 1792 checkHealthCheck(od);
1743 }); 1793 });
1744 }); 1794 });
1745 1795
1746
1747 unittest.group("obj-schema-IdentityAwareProxy", () { 1796 unittest.group("obj-schema-IdentityAwareProxy", () {
1748 unittest.test("to-json--from-json", () { 1797 unittest.test("to-json--from-json", () {
1749 var o = buildIdentityAwareProxy(); 1798 var o = buildIdentityAwareProxy();
1750 var od = new api.IdentityAwareProxy.fromJson(o.toJson()); 1799 var od = new api.IdentityAwareProxy.fromJson(o.toJson());
1751 checkIdentityAwareProxy(od); 1800 checkIdentityAwareProxy(od);
1752 }); 1801 });
1753 }); 1802 });
1754 1803
1755
1756 unittest.group("obj-schema-Instance", () { 1804 unittest.group("obj-schema-Instance", () {
1757 unittest.test("to-json--from-json", () { 1805 unittest.test("to-json--from-json", () {
1758 var o = buildInstance(); 1806 var o = buildInstance();
1759 var od = new api.Instance.fromJson(o.toJson()); 1807 var od = new api.Instance.fromJson(o.toJson());
1760 checkInstance(od); 1808 checkInstance(od);
1761 }); 1809 });
1762 }); 1810 });
1763 1811
1764
1765 unittest.group("obj-schema-Library", () { 1812 unittest.group("obj-schema-Library", () {
1766 unittest.test("to-json--from-json", () { 1813 unittest.test("to-json--from-json", () {
1767 var o = buildLibrary(); 1814 var o = buildLibrary();
1768 var od = new api.Library.fromJson(o.toJson()); 1815 var od = new api.Library.fromJson(o.toJson());
1769 checkLibrary(od); 1816 checkLibrary(od);
1770 }); 1817 });
1771 }); 1818 });
1772 1819
1773
1774 unittest.group("obj-schema-ListInstancesResponse", () { 1820 unittest.group("obj-schema-ListInstancesResponse", () {
1775 unittest.test("to-json--from-json", () { 1821 unittest.test("to-json--from-json", () {
1776 var o = buildListInstancesResponse(); 1822 var o = buildListInstancesResponse();
1777 var od = new api.ListInstancesResponse.fromJson(o.toJson()); 1823 var od = new api.ListInstancesResponse.fromJson(o.toJson());
1778 checkListInstancesResponse(od); 1824 checkListInstancesResponse(od);
1779 }); 1825 });
1780 }); 1826 });
1781 1827
1782
1783 unittest.group("obj-schema-ListLocationsResponse", () { 1828 unittest.group("obj-schema-ListLocationsResponse", () {
1784 unittest.test("to-json--from-json", () { 1829 unittest.test("to-json--from-json", () {
1785 var o = buildListLocationsResponse(); 1830 var o = buildListLocationsResponse();
1786 var od = new api.ListLocationsResponse.fromJson(o.toJson()); 1831 var od = new api.ListLocationsResponse.fromJson(o.toJson());
1787 checkListLocationsResponse(od); 1832 checkListLocationsResponse(od);
1788 }); 1833 });
1789 }); 1834 });
1790 1835
1791
1792 unittest.group("obj-schema-ListModulesResponse", () { 1836 unittest.group("obj-schema-ListModulesResponse", () {
1793 unittest.test("to-json--from-json", () { 1837 unittest.test("to-json--from-json", () {
1794 var o = buildListModulesResponse(); 1838 var o = buildListModulesResponse();
1795 var od = new api.ListModulesResponse.fromJson(o.toJson()); 1839 var od = new api.ListModulesResponse.fromJson(o.toJson());
1796 checkListModulesResponse(od); 1840 checkListModulesResponse(od);
1797 }); 1841 });
1798 }); 1842 });
1799 1843
1800
1801 unittest.group("obj-schema-ListOperationsResponse", () { 1844 unittest.group("obj-schema-ListOperationsResponse", () {
1802 unittest.test("to-json--from-json", () { 1845 unittest.test("to-json--from-json", () {
1803 var o = buildListOperationsResponse(); 1846 var o = buildListOperationsResponse();
1804 var od = new api.ListOperationsResponse.fromJson(o.toJson()); 1847 var od = new api.ListOperationsResponse.fromJson(o.toJson());
1805 checkListOperationsResponse(od); 1848 checkListOperationsResponse(od);
1806 }); 1849 });
1807 }); 1850 });
1808 1851
1809
1810 unittest.group("obj-schema-ListVersionsResponse", () { 1852 unittest.group("obj-schema-ListVersionsResponse", () {
1811 unittest.test("to-json--from-json", () { 1853 unittest.test("to-json--from-json", () {
1812 var o = buildListVersionsResponse(); 1854 var o = buildListVersionsResponse();
1813 var od = new api.ListVersionsResponse.fromJson(o.toJson()); 1855 var od = new api.ListVersionsResponse.fromJson(o.toJson());
1814 checkListVersionsResponse(od); 1856 checkListVersionsResponse(od);
1815 }); 1857 });
1816 }); 1858 });
1817 1859
1818
1819 unittest.group("obj-schema-Location", () { 1860 unittest.group("obj-schema-Location", () {
1820 unittest.test("to-json--from-json", () { 1861 unittest.test("to-json--from-json", () {
1821 var o = buildLocation(); 1862 var o = buildLocation();
1822 var od = new api.Location.fromJson(o.toJson()); 1863 var od = new api.Location.fromJson(o.toJson());
1823 checkLocation(od); 1864 checkLocation(od);
1824 }); 1865 });
1825 }); 1866 });
1826 1867
1827
1828 unittest.group("obj-schema-LocationMetadata", () { 1868 unittest.group("obj-schema-LocationMetadata", () {
1829 unittest.test("to-json--from-json", () { 1869 unittest.test("to-json--from-json", () {
1830 var o = buildLocationMetadata(); 1870 var o = buildLocationMetadata();
1831 var od = new api.LocationMetadata.fromJson(o.toJson()); 1871 var od = new api.LocationMetadata.fromJson(o.toJson());
1832 checkLocationMetadata(od); 1872 checkLocationMetadata(od);
1833 }); 1873 });
1834 }); 1874 });
1835 1875
1836
1837 unittest.group("obj-schema-ManualScaling", () { 1876 unittest.group("obj-schema-ManualScaling", () {
1838 unittest.test("to-json--from-json", () { 1877 unittest.test("to-json--from-json", () {
1839 var o = buildManualScaling(); 1878 var o = buildManualScaling();
1840 var od = new api.ManualScaling.fromJson(o.toJson()); 1879 var od = new api.ManualScaling.fromJson(o.toJson());
1841 checkManualScaling(od); 1880 checkManualScaling(od);
1842 }); 1881 });
1843 }); 1882 });
1844 1883
1845
1846 unittest.group("obj-schema-Module", () { 1884 unittest.group("obj-schema-Module", () {
1847 unittest.test("to-json--from-json", () { 1885 unittest.test("to-json--from-json", () {
1848 var o = buildModule(); 1886 var o = buildModule();
1849 var od = new api.Module.fromJson(o.toJson()); 1887 var od = new api.Module.fromJson(o.toJson());
1850 checkModule(od); 1888 checkModule(od);
1851 }); 1889 });
1852 }); 1890 });
1853 1891
1854
1855 unittest.group("obj-schema-Network", () { 1892 unittest.group("obj-schema-Network", () {
1856 unittest.test("to-json--from-json", () { 1893 unittest.test("to-json--from-json", () {
1857 var o = buildNetwork(); 1894 var o = buildNetwork();
1858 var od = new api.Network.fromJson(o.toJson()); 1895 var od = new api.Network.fromJson(o.toJson());
1859 checkNetwork(od); 1896 checkNetwork(od);
1860 }); 1897 });
1861 }); 1898 });
1862 1899
1863
1864 unittest.group("obj-schema-NetworkUtilization", () { 1900 unittest.group("obj-schema-NetworkUtilization", () {
1865 unittest.test("to-json--from-json", () { 1901 unittest.test("to-json--from-json", () {
1866 var o = buildNetworkUtilization(); 1902 var o = buildNetworkUtilization();
1867 var od = new api.NetworkUtilization.fromJson(o.toJson()); 1903 var od = new api.NetworkUtilization.fromJson(o.toJson());
1868 checkNetworkUtilization(od); 1904 checkNetworkUtilization(od);
1869 }); 1905 });
1870 }); 1906 });
1871 1907
1872
1873 unittest.group("obj-schema-Operation", () { 1908 unittest.group("obj-schema-Operation", () {
1874 unittest.test("to-json--from-json", () { 1909 unittest.test("to-json--from-json", () {
1875 var o = buildOperation(); 1910 var o = buildOperation();
1876 var od = new api.Operation.fromJson(o.toJson()); 1911 var od = new api.Operation.fromJson(o.toJson());
1877 checkOperation(od); 1912 checkOperation(od);
1878 }); 1913 });
1879 }); 1914 });
1880 1915
1881
1882 unittest.group("obj-schema-OperationMetadata", () { 1916 unittest.group("obj-schema-OperationMetadata", () {
1883 unittest.test("to-json--from-json", () { 1917 unittest.test("to-json--from-json", () {
1884 var o = buildOperationMetadata(); 1918 var o = buildOperationMetadata();
1885 var od = new api.OperationMetadata.fromJson(o.toJson()); 1919 var od = new api.OperationMetadata.fromJson(o.toJson());
1886 checkOperationMetadata(od); 1920 checkOperationMetadata(od);
1887 }); 1921 });
1888 }); 1922 });
1889 1923
1890
1891 unittest.group("obj-schema-OperationMetadataExperimental", () { 1924 unittest.group("obj-schema-OperationMetadataExperimental", () {
1892 unittest.test("to-json--from-json", () { 1925 unittest.test("to-json--from-json", () {
1893 var o = buildOperationMetadataExperimental(); 1926 var o = buildOperationMetadataExperimental();
1894 var od = new api.OperationMetadataExperimental.fromJson(o.toJson()); 1927 var od = new api.OperationMetadataExperimental.fromJson(o.toJson());
1895 checkOperationMetadataExperimental(od); 1928 checkOperationMetadataExperimental(od);
1896 }); 1929 });
1897 }); 1930 });
1898 1931
1899
1900 unittest.group("obj-schema-OperationMetadataV1", () { 1932 unittest.group("obj-schema-OperationMetadataV1", () {
1901 unittest.test("to-json--from-json", () { 1933 unittest.test("to-json--from-json", () {
1902 var o = buildOperationMetadataV1(); 1934 var o = buildOperationMetadataV1();
1903 var od = new api.OperationMetadataV1.fromJson(o.toJson()); 1935 var od = new api.OperationMetadataV1.fromJson(o.toJson());
1904 checkOperationMetadataV1(od); 1936 checkOperationMetadataV1(od);
1905 }); 1937 });
1906 }); 1938 });
1907 1939
1908
1909 unittest.group("obj-schema-OperationMetadataV1Alpha", () { 1940 unittest.group("obj-schema-OperationMetadataV1Alpha", () {
1910 unittest.test("to-json--from-json", () { 1941 unittest.test("to-json--from-json", () {
1911 var o = buildOperationMetadataV1Alpha(); 1942 var o = buildOperationMetadataV1Alpha();
1912 var od = new api.OperationMetadataV1Alpha.fromJson(o.toJson()); 1943 var od = new api.OperationMetadataV1Alpha.fromJson(o.toJson());
1913 checkOperationMetadataV1Alpha(od); 1944 checkOperationMetadataV1Alpha(od);
1914 }); 1945 });
1915 }); 1946 });
1916 1947
1917
1918 unittest.group("obj-schema-OperationMetadataV1Beta", () { 1948 unittest.group("obj-schema-OperationMetadataV1Beta", () {
1919 unittest.test("to-json--from-json", () { 1949 unittest.test("to-json--from-json", () {
1920 var o = buildOperationMetadataV1Beta(); 1950 var o = buildOperationMetadataV1Beta();
1921 var od = new api.OperationMetadataV1Beta.fromJson(o.toJson()); 1951 var od = new api.OperationMetadataV1Beta.fromJson(o.toJson());
1922 checkOperationMetadataV1Beta(od); 1952 checkOperationMetadataV1Beta(od);
1923 }); 1953 });
1924 }); 1954 });
1925 1955
1926
1927 unittest.group("obj-schema-OperationMetadataV1Beta5", () { 1956 unittest.group("obj-schema-OperationMetadataV1Beta5", () {
1928 unittest.test("to-json--from-json", () { 1957 unittest.test("to-json--from-json", () {
1929 var o = buildOperationMetadataV1Beta5(); 1958 var o = buildOperationMetadataV1Beta5();
1930 var od = new api.OperationMetadataV1Beta5.fromJson(o.toJson()); 1959 var od = new api.OperationMetadataV1Beta5.fromJson(o.toJson());
1931 checkOperationMetadataV1Beta5(od); 1960 checkOperationMetadataV1Beta5(od);
1932 }); 1961 });
1933 }); 1962 });
1934 1963
1935
1936 unittest.group("obj-schema-RequestUtilization", () { 1964 unittest.group("obj-schema-RequestUtilization", () {
1937 unittest.test("to-json--from-json", () { 1965 unittest.test("to-json--from-json", () {
1938 var o = buildRequestUtilization(); 1966 var o = buildRequestUtilization();
1939 var od = new api.RequestUtilization.fromJson(o.toJson()); 1967 var od = new api.RequestUtilization.fromJson(o.toJson());
1940 checkRequestUtilization(od); 1968 checkRequestUtilization(od);
1941 }); 1969 });
1942 }); 1970 });
1943 1971
1944
1945 unittest.group("obj-schema-Resources", () { 1972 unittest.group("obj-schema-Resources", () {
1946 unittest.test("to-json--from-json", () { 1973 unittest.test("to-json--from-json", () {
1947 var o = buildResources(); 1974 var o = buildResources();
1948 var od = new api.Resources.fromJson(o.toJson()); 1975 var od = new api.Resources.fromJson(o.toJson());
1949 checkResources(od); 1976 checkResources(od);
1950 }); 1977 });
1951 }); 1978 });
1952 1979
1953
1954 unittest.group("obj-schema-ScriptHandler", () { 1980 unittest.group("obj-schema-ScriptHandler", () {
1955 unittest.test("to-json--from-json", () { 1981 unittest.test("to-json--from-json", () {
1956 var o = buildScriptHandler(); 1982 var o = buildScriptHandler();
1957 var od = new api.ScriptHandler.fromJson(o.toJson()); 1983 var od = new api.ScriptHandler.fromJson(o.toJson());
1958 checkScriptHandler(od); 1984 checkScriptHandler(od);
1959 }); 1985 });
1960 }); 1986 });
1961 1987
1962
1963 unittest.group("obj-schema-SourceReference", () { 1988 unittest.group("obj-schema-SourceReference", () {
1964 unittest.test("to-json--from-json", () { 1989 unittest.test("to-json--from-json", () {
1965 var o = buildSourceReference(); 1990 var o = buildSourceReference();
1966 var od = new api.SourceReference.fromJson(o.toJson()); 1991 var od = new api.SourceReference.fromJson(o.toJson());
1967 checkSourceReference(od); 1992 checkSourceReference(od);
1968 }); 1993 });
1969 }); 1994 });
1970 1995
1971
1972 unittest.group("obj-schema-StaticDirectoryHandler", () { 1996 unittest.group("obj-schema-StaticDirectoryHandler", () {
1973 unittest.test("to-json--from-json", () { 1997 unittest.test("to-json--from-json", () {
1974 var o = buildStaticDirectoryHandler(); 1998 var o = buildStaticDirectoryHandler();
1975 var od = new api.StaticDirectoryHandler.fromJson(o.toJson()); 1999 var od = new api.StaticDirectoryHandler.fromJson(o.toJson());
1976 checkStaticDirectoryHandler(od); 2000 checkStaticDirectoryHandler(od);
1977 }); 2001 });
1978 }); 2002 });
1979 2003
1980
1981 unittest.group("obj-schema-StaticFilesHandler", () { 2004 unittest.group("obj-schema-StaticFilesHandler", () {
1982 unittest.test("to-json--from-json", () { 2005 unittest.test("to-json--from-json", () {
1983 var o = buildStaticFilesHandler(); 2006 var o = buildStaticFilesHandler();
1984 var od = new api.StaticFilesHandler.fromJson(o.toJson()); 2007 var od = new api.StaticFilesHandler.fromJson(o.toJson());
1985 checkStaticFilesHandler(od); 2008 checkStaticFilesHandler(od);
1986 }); 2009 });
1987 }); 2010 });
1988 2011
1989
1990 unittest.group("obj-schema-Status", () { 2012 unittest.group("obj-schema-Status", () {
1991 unittest.test("to-json--from-json", () { 2013 unittest.test("to-json--from-json", () {
1992 var o = buildStatus(); 2014 var o = buildStatus();
1993 var od = new api.Status.fromJson(o.toJson()); 2015 var od = new api.Status.fromJson(o.toJson());
1994 checkStatus(od); 2016 checkStatus(od);
1995 }); 2017 });
1996 }); 2018 });
1997 2019
1998
1999 unittest.group("obj-schema-TrafficSplit", () { 2020 unittest.group("obj-schema-TrafficSplit", () {
2000 unittest.test("to-json--from-json", () { 2021 unittest.test("to-json--from-json", () {
2001 var o = buildTrafficSplit(); 2022 var o = buildTrafficSplit();
2002 var od = new api.TrafficSplit.fromJson(o.toJson()); 2023 var od = new api.TrafficSplit.fromJson(o.toJson());
2003 checkTrafficSplit(od); 2024 checkTrafficSplit(od);
2004 }); 2025 });
2005 }); 2026 });
2006 2027
2007
2008 unittest.group("obj-schema-UrlDispatchRule", () { 2028 unittest.group("obj-schema-UrlDispatchRule", () {
2009 unittest.test("to-json--from-json", () { 2029 unittest.test("to-json--from-json", () {
2010 var o = buildUrlDispatchRule(); 2030 var o = buildUrlDispatchRule();
2011 var od = new api.UrlDispatchRule.fromJson(o.toJson()); 2031 var od = new api.UrlDispatchRule.fromJson(o.toJson());
2012 checkUrlDispatchRule(od); 2032 checkUrlDispatchRule(od);
2013 }); 2033 });
2014 }); 2034 });
2015 2035
2016
2017 unittest.group("obj-schema-UrlMap", () { 2036 unittest.group("obj-schema-UrlMap", () {
2018 unittest.test("to-json--from-json", () { 2037 unittest.test("to-json--from-json", () {
2019 var o = buildUrlMap(); 2038 var o = buildUrlMap();
2020 var od = new api.UrlMap.fromJson(o.toJson()); 2039 var od = new api.UrlMap.fromJson(o.toJson());
2021 checkUrlMap(od); 2040 checkUrlMap(od);
2022 }); 2041 });
2023 }); 2042 });
2024 2043
2025
2026 unittest.group("obj-schema-Version", () { 2044 unittest.group("obj-schema-Version", () {
2027 unittest.test("to-json--from-json", () { 2045 unittest.test("to-json--from-json", () {
2028 var o = buildVersion(); 2046 var o = buildVersion();
2029 var od = new api.Version.fromJson(o.toJson()); 2047 var od = new api.Version.fromJson(o.toJson());
2030 checkVersion(od); 2048 checkVersion(od);
2031 }); 2049 });
2032 }); 2050 });
2033 2051
2034
2035 unittest.group("obj-schema-Volume", () { 2052 unittest.group("obj-schema-Volume", () {
2036 unittest.test("to-json--from-json", () { 2053 unittest.test("to-json--from-json", () {
2037 var o = buildVolume(); 2054 var o = buildVolume();
2038 var od = new api.Volume.fromJson(o.toJson()); 2055 var od = new api.Volume.fromJson(o.toJson());
2039 checkVolume(od); 2056 checkVolume(od);
2040 }); 2057 });
2041 }); 2058 });
2042 2059
2043
2044 unittest.group("resource-AppsResourceApi", () { 2060 unittest.group("resource-AppsResourceApi", () {
2045 unittest.test("method--create", () { 2061 unittest.test("method--create", () {
2046
2047 var mock = new HttpServerMock(); 2062 var mock = new HttpServerMock();
2048 api.AppsResourceApi res = new api.AppengineApi(mock).apps; 2063 api.AppsResourceApi res = new api.AppengineApi(mock).apps;
2049 var arg_request = buildApplication(); 2064 var arg_request = buildApplication();
2050 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2065 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2051 var obj = new api.Application.fromJson(json); 2066 var obj = new api.Application.fromJson(json);
2052 checkApplication(obj); 2067 checkApplication(obj);
2053 2068
2054 var path = (req.url).path; 2069 var path = (req.url).path;
2055 var pathOffset = 0; 2070 var pathOffset = 0;
2056 var index; 2071 var index;
2057 var subPart; 2072 var subPart;
2058 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2073 unittest.expect(
2074 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2059 pathOffset += 1; 2075 pathOffset += 1;
2060 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("v1beta4/apps")); 2076 unittest.expect(path.substring(pathOffset, pathOffset + 12),
2077 unittest.equals("v1beta4/apps"));
2061 pathOffset += 12; 2078 pathOffset += 12;
2062 2079
2063 var query = (req.url).query; 2080 var query = (req.url).query;
2064 var queryOffset = 0; 2081 var queryOffset = 0;
2065 var queryMap = {}; 2082 var queryMap = {};
2066 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2083 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2067 parseBool(n) { 2084 parseBool(n) {
2068 if (n == "true") return true; 2085 if (n == "true") return true;
2069 if (n == "false") return false; 2086 if (n == "false") return false;
2070 if (n == null) return null; 2087 if (n == null) return null;
2071 throw new core.ArgumentError("Invalid boolean: $n"); 2088 throw new core.ArgumentError("Invalid boolean: $n");
2072 } 2089 }
2090
2073 if (query.length > 0) { 2091 if (query.length > 0) {
2074 for (var part in query.split("&")) { 2092 for (var part in query.split("&")) {
2075 var keyvalue = part.split("="); 2093 var keyvalue = part.split("=");
2076 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2094 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2095 core.Uri.decodeQueryComponent(keyvalue[1]));
2077 } 2096 }
2078 } 2097 }
2079 2098
2080
2081 var h = { 2099 var h = {
2082 "content-type" : "application/json; charset=utf-8", 2100 "content-type": "application/json; charset=utf-8",
2083 }; 2101 };
2084 var resp = convert.JSON.encode(buildOperation()); 2102 var resp = convert.JSON.encode(buildOperation());
2085 return new async.Future.value(stringResponse(200, h, resp)); 2103 return new async.Future.value(stringResponse(200, h, resp));
2086 }), true); 2104 }), true);
2087 res.create(arg_request).then(unittest.expectAsync1(((api.Operation respons e) { 2105 res
2106 .create(arg_request)
2107 .then(unittest.expectAsync1(((api.Operation response) {
2088 checkOperation(response); 2108 checkOperation(response);
2089 }))); 2109 })));
2090 }); 2110 });
2091 2111
2092 unittest.test("method--get", () { 2112 unittest.test("method--get", () {
2093
2094 var mock = new HttpServerMock(); 2113 var mock = new HttpServerMock();
2095 api.AppsResourceApi res = new api.AppengineApi(mock).apps; 2114 api.AppsResourceApi res = new api.AppengineApi(mock).apps;
2096 var arg_appsId = "foo"; 2115 var arg_appsId = "foo";
2097 var arg_ensureResourcesExist = true; 2116 var arg_ensureResourcesExist = true;
2098 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2117 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2099 var path = (req.url).path; 2118 var path = (req.url).path;
2100 var pathOffset = 0; 2119 var pathOffset = 0;
2101 var index; 2120 var index;
2102 var subPart; 2121 var subPart;
2103 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2122 unittest.expect(
2123 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2104 pathOffset += 1; 2124 pathOffset += 1;
2105 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 2125 unittest.expect(path.substring(pathOffset, pathOffset + 13),
2126 unittest.equals("v1beta4/apps/"));
2106 pathOffset += 13; 2127 pathOffset += 13;
2107 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); 2128 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2108 pathOffset = path.length; 2129 pathOffset = path.length;
2109 unittest.expect(subPart, unittest.equals("$arg_appsId")); 2130 unittest.expect(subPart, unittest.equals("$arg_appsId"));
2110 2131
2111 var query = (req.url).query; 2132 var query = (req.url).query;
2112 var queryOffset = 0; 2133 var queryOffset = 0;
2113 var queryMap = {}; 2134 var queryMap = {};
2114 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2135 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2115 parseBool(n) { 2136 parseBool(n) {
2116 if (n == "true") return true; 2137 if (n == "true") return true;
2117 if (n == "false") return false; 2138 if (n == "false") return false;
2118 if (n == null) return null; 2139 if (n == null) return null;
2119 throw new core.ArgumentError("Invalid boolean: $n"); 2140 throw new core.ArgumentError("Invalid boolean: $n");
2120 } 2141 }
2142
2121 if (query.length > 0) { 2143 if (query.length > 0) {
2122 for (var part in query.split("&")) { 2144 for (var part in query.split("&")) {
2123 var keyvalue = part.split("="); 2145 var keyvalue = part.split("=");
2124 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2146 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2147 core.Uri.decodeQueryComponent(keyvalue[1]));
2125 } 2148 }
2126 } 2149 }
2127 unittest.expect(queryMap["ensureResourcesExist"].first, unittest.equals( "$arg_ensureResourcesExist")); 2150 unittest.expect(queryMap["ensureResourcesExist"].first,
2128 2151 unittest.equals("$arg_ensureResourcesExist"));
2129 2152
2130 var h = { 2153 var h = {
2131 "content-type" : "application/json; charset=utf-8", 2154 "content-type": "application/json; charset=utf-8",
2132 }; 2155 };
2133 var resp = convert.JSON.encode(buildApplication()); 2156 var resp = convert.JSON.encode(buildApplication());
2134 return new async.Future.value(stringResponse(200, h, resp)); 2157 return new async.Future.value(stringResponse(200, h, resp));
2135 }), true); 2158 }), true);
2136 res.get(arg_appsId, ensureResourcesExist: arg_ensureResourcesExist).then(u nittest.expectAsync1(((api.Application response) { 2159 res
2160 .get(arg_appsId, ensureResourcesExist: arg_ensureResourcesExist)
2161 .then(unittest.expectAsync1(((api.Application response) {
2137 checkApplication(response); 2162 checkApplication(response);
2138 }))); 2163 })));
2139 }); 2164 });
2140 2165
2141 unittest.test("method--patch", () { 2166 unittest.test("method--patch", () {
2142
2143 var mock = new HttpServerMock(); 2167 var mock = new HttpServerMock();
2144 api.AppsResourceApi res = new api.AppengineApi(mock).apps; 2168 api.AppsResourceApi res = new api.AppengineApi(mock).apps;
2145 var arg_request = buildApplication(); 2169 var arg_request = buildApplication();
2146 var arg_appsId = "foo"; 2170 var arg_appsId = "foo";
2147 var arg_mask = "foo"; 2171 var arg_mask = "foo";
2148 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2172 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2149 var obj = new api.Application.fromJson(json); 2173 var obj = new api.Application.fromJson(json);
2150 checkApplication(obj); 2174 checkApplication(obj);
2151 2175
2152 var path = (req.url).path; 2176 var path = (req.url).path;
2153 var pathOffset = 0; 2177 var pathOffset = 0;
2154 var index; 2178 var index;
2155 var subPart; 2179 var subPart;
2156 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2180 unittest.expect(
2181 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2157 pathOffset += 1; 2182 pathOffset += 1;
2158 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 2183 unittest.expect(path.substring(pathOffset, pathOffset + 13),
2184 unittest.equals("v1beta4/apps/"));
2159 pathOffset += 13; 2185 pathOffset += 13;
2160 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); 2186 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2161 pathOffset = path.length; 2187 pathOffset = path.length;
2162 unittest.expect(subPart, unittest.equals("$arg_appsId")); 2188 unittest.expect(subPart, unittest.equals("$arg_appsId"));
2163 2189
2164 var query = (req.url).query; 2190 var query = (req.url).query;
2165 var queryOffset = 0; 2191 var queryOffset = 0;
2166 var queryMap = {}; 2192 var queryMap = {};
2167 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2193 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2168 parseBool(n) { 2194 parseBool(n) {
2169 if (n == "true") return true; 2195 if (n == "true") return true;
2170 if (n == "false") return false; 2196 if (n == "false") return false;
2171 if (n == null) return null; 2197 if (n == null) return null;
2172 throw new core.ArgumentError("Invalid boolean: $n"); 2198 throw new core.ArgumentError("Invalid boolean: $n");
2173 } 2199 }
2200
2174 if (query.length > 0) { 2201 if (query.length > 0) {
2175 for (var part in query.split("&")) { 2202 for (var part in query.split("&")) {
2176 var keyvalue = part.split("="); 2203 var keyvalue = part.split("=");
2177 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2204 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2205 core.Uri.decodeQueryComponent(keyvalue[1]));
2178 } 2206 }
2179 } 2207 }
2180 unittest.expect(queryMap["mask"].first, unittest.equals(arg_mask)); 2208 unittest.expect(queryMap["mask"].first, unittest.equals(arg_mask));
2181 2209
2182
2183 var h = { 2210 var h = {
2184 "content-type" : "application/json; charset=utf-8", 2211 "content-type": "application/json; charset=utf-8",
2185 }; 2212 };
2186 var resp = convert.JSON.encode(buildOperation()); 2213 var resp = convert.JSON.encode(buildOperation());
2187 return new async.Future.value(stringResponse(200, h, resp)); 2214 return new async.Future.value(stringResponse(200, h, resp));
2188 }), true); 2215 }), true);
2189 res.patch(arg_request, arg_appsId, mask: arg_mask).then(unittest.expectAsy nc1(((api.Operation response) { 2216 res
2217 .patch(arg_request, arg_appsId, mask: arg_mask)
2218 .then(unittest.expectAsync1(((api.Operation response) {
2190 checkOperation(response); 2219 checkOperation(response);
2191 }))); 2220 })));
2192 }); 2221 });
2193
2194 }); 2222 });
2195 2223
2196
2197 unittest.group("resource-AppsLocationsResourceApi", () { 2224 unittest.group("resource-AppsLocationsResourceApi", () {
2198 unittest.test("method--get", () { 2225 unittest.test("method--get", () {
2199
2200 var mock = new HttpServerMock(); 2226 var mock = new HttpServerMock();
2201 api.AppsLocationsResourceApi res = new api.AppengineApi(mock).apps.locatio ns; 2227 api.AppsLocationsResourceApi res =
2228 new api.AppengineApi(mock).apps.locations;
2202 var arg_appsId = "foo"; 2229 var arg_appsId = "foo";
2203 var arg_locationsId = "foo"; 2230 var arg_locationsId = "foo";
2204 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2231 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2205 var path = (req.url).path; 2232 var path = (req.url).path;
2206 var pathOffset = 0; 2233 var pathOffset = 0;
2207 var index; 2234 var index;
2208 var subPart; 2235 var subPart;
2209 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2236 unittest.expect(
2237 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2210 pathOffset += 1; 2238 pathOffset += 1;
2211 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 2239 unittest.expect(path.substring(pathOffset, pathOffset + 13),
2240 unittest.equals("v1beta4/apps/"));
2212 pathOffset += 13; 2241 pathOffset += 13;
2213 index = path.indexOf("/locations/", pathOffset); 2242 index = path.indexOf("/locations/", pathOffset);
2214 unittest.expect(index >= 0, unittest.isTrue); 2243 unittest.expect(index >= 0, unittest.isTrue);
2215 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 2244 subPart =
2245 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2216 pathOffset = index; 2246 pathOffset = index;
2217 unittest.expect(subPart, unittest.equals("$arg_appsId")); 2247 unittest.expect(subPart, unittest.equals("$arg_appsId"));
2218 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq uals("/locations/")); 2248 unittest.expect(path.substring(pathOffset, pathOffset + 11),
2249 unittest.equals("/locations/"));
2219 pathOffset += 11; 2250 pathOffset += 11;
2220 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); 2251 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2221 pathOffset = path.length; 2252 pathOffset = path.length;
2222 unittest.expect(subPart, unittest.equals("$arg_locationsId")); 2253 unittest.expect(subPart, unittest.equals("$arg_locationsId"));
2223 2254
2224 var query = (req.url).query; 2255 var query = (req.url).query;
2225 var queryOffset = 0; 2256 var queryOffset = 0;
2226 var queryMap = {}; 2257 var queryMap = {};
2227 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2258 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2228 parseBool(n) { 2259 parseBool(n) {
2229 if (n == "true") return true; 2260 if (n == "true") return true;
2230 if (n == "false") return false; 2261 if (n == "false") return false;
2231 if (n == null) return null; 2262 if (n == null) return null;
2232 throw new core.ArgumentError("Invalid boolean: $n"); 2263 throw new core.ArgumentError("Invalid boolean: $n");
2233 } 2264 }
2265
2234 if (query.length > 0) { 2266 if (query.length > 0) {
2235 for (var part in query.split("&")) { 2267 for (var part in query.split("&")) {
2236 var keyvalue = part.split("="); 2268 var keyvalue = part.split("=");
2237 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2269 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2270 core.Uri.decodeQueryComponent(keyvalue[1]));
2238 } 2271 }
2239 } 2272 }
2240 2273
2241
2242 var h = { 2274 var h = {
2243 "content-type" : "application/json; charset=utf-8", 2275 "content-type": "application/json; charset=utf-8",
2244 }; 2276 };
2245 var resp = convert.JSON.encode(buildLocation()); 2277 var resp = convert.JSON.encode(buildLocation());
2246 return new async.Future.value(stringResponse(200, h, resp)); 2278 return new async.Future.value(stringResponse(200, h, resp));
2247 }), true); 2279 }), true);
2248 res.get(arg_appsId, arg_locationsId).then(unittest.expectAsync1(((api.Loca tion response) { 2280 res
2281 .get(arg_appsId, arg_locationsId)
2282 .then(unittest.expectAsync1(((api.Location response) {
2249 checkLocation(response); 2283 checkLocation(response);
2250 }))); 2284 })));
2251 }); 2285 });
2252 2286
2253 unittest.test("method--list", () { 2287 unittest.test("method--list", () {
2254
2255 var mock = new HttpServerMock(); 2288 var mock = new HttpServerMock();
2256 api.AppsLocationsResourceApi res = new api.AppengineApi(mock).apps.locatio ns; 2289 api.AppsLocationsResourceApi res =
2290 new api.AppengineApi(mock).apps.locations;
2257 var arg_appsId = "foo"; 2291 var arg_appsId = "foo";
2258 var arg_filter = "foo";
2259 var arg_pageToken = "foo"; 2292 var arg_pageToken = "foo";
2260 var arg_pageSize = 42; 2293 var arg_pageSize = 42;
2294 var arg_filter = "foo";
2261 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2295 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2262 var path = (req.url).path; 2296 var path = (req.url).path;
2263 var pathOffset = 0; 2297 var pathOffset = 0;
2264 var index; 2298 var index;
2265 var subPart; 2299 var subPart;
2266 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2300 unittest.expect(
2301 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2267 pathOffset += 1; 2302 pathOffset += 1;
2268 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 2303 unittest.expect(path.substring(pathOffset, pathOffset + 13),
2304 unittest.equals("v1beta4/apps/"));
2269 pathOffset += 13; 2305 pathOffset += 13;
2270 index = path.indexOf("/locations", pathOffset); 2306 index = path.indexOf("/locations", pathOffset);
2271 unittest.expect(index >= 0, unittest.isTrue); 2307 unittest.expect(index >= 0, unittest.isTrue);
2272 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 2308 subPart =
2309 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2273 pathOffset = index; 2310 pathOffset = index;
2274 unittest.expect(subPart, unittest.equals("$arg_appsId")); 2311 unittest.expect(subPart, unittest.equals("$arg_appsId"));
2275 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/locations")); 2312 unittest.expect(path.substring(pathOffset, pathOffset + 10),
2313 unittest.equals("/locations"));
2276 pathOffset += 10; 2314 pathOffset += 10;
2277 2315
2278 var query = (req.url).query; 2316 var query = (req.url).query;
2279 var queryOffset = 0; 2317 var queryOffset = 0;
2280 var queryMap = {}; 2318 var queryMap = {};
2281 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2319 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2282 parseBool(n) { 2320 parseBool(n) {
2283 if (n == "true") return true; 2321 if (n == "true") return true;
2284 if (n == "false") return false; 2322 if (n == "false") return false;
2285 if (n == null) return null; 2323 if (n == null) return null;
2286 throw new core.ArgumentError("Invalid boolean: $n"); 2324 throw new core.ArgumentError("Invalid boolean: $n");
2287 } 2325 }
2326
2288 if (query.length > 0) { 2327 if (query.length > 0) {
2289 for (var part in query.split("&")) { 2328 for (var part in query.split("&")) {
2290 var keyvalue = part.split("="); 2329 var keyvalue = part.split("=");
2291 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2330 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2331 core.Uri.decodeQueryComponent(keyvalue[1]));
2292 } 2332 }
2293 } 2333 }
2334 unittest.expect(
2335 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
2336 unittest.expect(core.int.parse(queryMap["pageSize"].first),
2337 unittest.equals(arg_pageSize));
2294 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); 2338 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter));
2295 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
2296 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize));
2297
2298 2339
2299 var h = { 2340 var h = {
2300 "content-type" : "application/json; charset=utf-8", 2341 "content-type": "application/json; charset=utf-8",
2301 }; 2342 };
2302 var resp = convert.JSON.encode(buildListLocationsResponse()); 2343 var resp = convert.JSON.encode(buildListLocationsResponse());
2303 return new async.Future.value(stringResponse(200, h, resp)); 2344 return new async.Future.value(stringResponse(200, h, resp));
2304 }), true); 2345 }), true);
2305 res.list(arg_appsId, filter: arg_filter, pageToken: arg_pageToken, pageSiz e: arg_pageSize).then(unittest.expectAsync1(((api.ListLocationsResponse response ) { 2346 res
2347 .list(arg_appsId,
2348 pageToken: arg_pageToken,
2349 pageSize: arg_pageSize,
2350 filter: arg_filter)
2351 .then(unittest.expectAsync1(((api.ListLocationsResponse response) {
2306 checkListLocationsResponse(response); 2352 checkListLocationsResponse(response);
2307 }))); 2353 })));
2308 }); 2354 });
2309
2310 }); 2355 });
2311 2356
2312
2313 unittest.group("resource-AppsModulesResourceApi", () { 2357 unittest.group("resource-AppsModulesResourceApi", () {
2314 unittest.test("method--delete", () { 2358 unittest.test("method--delete", () {
2315
2316 var mock = new HttpServerMock(); 2359 var mock = new HttpServerMock();
2317 api.AppsModulesResourceApi res = new api.AppengineApi(mock).apps.modules; 2360 api.AppsModulesResourceApi res = new api.AppengineApi(mock).apps.modules;
2318 var arg_appsId = "foo"; 2361 var arg_appsId = "foo";
2319 var arg_modulesId = "foo"; 2362 var arg_modulesId = "foo";
2320 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2363 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2321 var path = (req.url).path; 2364 var path = (req.url).path;
2322 var pathOffset = 0; 2365 var pathOffset = 0;
2323 var index; 2366 var index;
2324 var subPart; 2367 var subPart;
2325 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2368 unittest.expect(
2369 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2326 pathOffset += 1; 2370 pathOffset += 1;
2327 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 2371 unittest.expect(path.substring(pathOffset, pathOffset + 13),
2372 unittest.equals("v1beta4/apps/"));
2328 pathOffset += 13; 2373 pathOffset += 13;
2329 index = path.indexOf("/modules/", pathOffset); 2374 index = path.indexOf("/modules/", pathOffset);
2330 unittest.expect(index >= 0, unittest.isTrue); 2375 unittest.expect(index >= 0, unittest.isTrue);
2331 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 2376 subPart =
2377 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2332 pathOffset = index; 2378 pathOffset = index;
2333 unittest.expect(subPart, unittest.equals("$arg_appsId")); 2379 unittest.expect(subPart, unittest.equals("$arg_appsId"));
2334 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/modules/")); 2380 unittest.expect(path.substring(pathOffset, pathOffset + 9),
2381 unittest.equals("/modules/"));
2335 pathOffset += 9; 2382 pathOffset += 9;
2336 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); 2383 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2337 pathOffset = path.length; 2384 pathOffset = path.length;
2338 unittest.expect(subPart, unittest.equals("$arg_modulesId")); 2385 unittest.expect(subPart, unittest.equals("$arg_modulesId"));
2339 2386
2340 var query = (req.url).query; 2387 var query = (req.url).query;
2341 var queryOffset = 0; 2388 var queryOffset = 0;
2342 var queryMap = {}; 2389 var queryMap = {};
2343 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2390 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2344 parseBool(n) { 2391 parseBool(n) {
2345 if (n == "true") return true; 2392 if (n == "true") return true;
2346 if (n == "false") return false; 2393 if (n == "false") return false;
2347 if (n == null) return null; 2394 if (n == null) return null;
2348 throw new core.ArgumentError("Invalid boolean: $n"); 2395 throw new core.ArgumentError("Invalid boolean: $n");
2349 } 2396 }
2397
2350 if (query.length > 0) { 2398 if (query.length > 0) {
2351 for (var part in query.split("&")) { 2399 for (var part in query.split("&")) {
2352 var keyvalue = part.split("="); 2400 var keyvalue = part.split("=");
2353 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2401 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2402 core.Uri.decodeQueryComponent(keyvalue[1]));
2354 } 2403 }
2355 } 2404 }
2356 2405
2357
2358 var h = { 2406 var h = {
2359 "content-type" : "application/json; charset=utf-8", 2407 "content-type": "application/json; charset=utf-8",
2360 }; 2408 };
2361 var resp = convert.JSON.encode(buildOperation()); 2409 var resp = convert.JSON.encode(buildOperation());
2362 return new async.Future.value(stringResponse(200, h, resp)); 2410 return new async.Future.value(stringResponse(200, h, resp));
2363 }), true); 2411 }), true);
2364 res.delete(arg_appsId, arg_modulesId).then(unittest.expectAsync1(((api.Ope ration response) { 2412 res
2413 .delete(arg_appsId, arg_modulesId)
2414 .then(unittest.expectAsync1(((api.Operation response) {
2365 checkOperation(response); 2415 checkOperation(response);
2366 }))); 2416 })));
2367 }); 2417 });
2368 2418
2369 unittest.test("method--get", () { 2419 unittest.test("method--get", () {
2370
2371 var mock = new HttpServerMock(); 2420 var mock = new HttpServerMock();
2372 api.AppsModulesResourceApi res = new api.AppengineApi(mock).apps.modules; 2421 api.AppsModulesResourceApi res = new api.AppengineApi(mock).apps.modules;
2373 var arg_appsId = "foo"; 2422 var arg_appsId = "foo";
2374 var arg_modulesId = "foo"; 2423 var arg_modulesId = "foo";
2375 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2424 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2376 var path = (req.url).path; 2425 var path = (req.url).path;
2377 var pathOffset = 0; 2426 var pathOffset = 0;
2378 var index; 2427 var index;
2379 var subPart; 2428 var subPart;
2380 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2429 unittest.expect(
2430 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2381 pathOffset += 1; 2431 pathOffset += 1;
2382 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 2432 unittest.expect(path.substring(pathOffset, pathOffset + 13),
2433 unittest.equals("v1beta4/apps/"));
2383 pathOffset += 13; 2434 pathOffset += 13;
2384 index = path.indexOf("/modules/", pathOffset); 2435 index = path.indexOf("/modules/", pathOffset);
2385 unittest.expect(index >= 0, unittest.isTrue); 2436 unittest.expect(index >= 0, unittest.isTrue);
2386 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 2437 subPart =
2438 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2387 pathOffset = index; 2439 pathOffset = index;
2388 unittest.expect(subPart, unittest.equals("$arg_appsId")); 2440 unittest.expect(subPart, unittest.equals("$arg_appsId"));
2389 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/modules/")); 2441 unittest.expect(path.substring(pathOffset, pathOffset + 9),
2442 unittest.equals("/modules/"));
2390 pathOffset += 9; 2443 pathOffset += 9;
2391 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); 2444 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2392 pathOffset = path.length; 2445 pathOffset = path.length;
2393 unittest.expect(subPart, unittest.equals("$arg_modulesId")); 2446 unittest.expect(subPart, unittest.equals("$arg_modulesId"));
2394 2447
2395 var query = (req.url).query; 2448 var query = (req.url).query;
2396 var queryOffset = 0; 2449 var queryOffset = 0;
2397 var queryMap = {}; 2450 var queryMap = {};
2398 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2451 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2399 parseBool(n) { 2452 parseBool(n) {
2400 if (n == "true") return true; 2453 if (n == "true") return true;
2401 if (n == "false") return false; 2454 if (n == "false") return false;
2402 if (n == null) return null; 2455 if (n == null) return null;
2403 throw new core.ArgumentError("Invalid boolean: $n"); 2456 throw new core.ArgumentError("Invalid boolean: $n");
2404 } 2457 }
2458
2405 if (query.length > 0) { 2459 if (query.length > 0) {
2406 for (var part in query.split("&")) { 2460 for (var part in query.split("&")) {
2407 var keyvalue = part.split("="); 2461 var keyvalue = part.split("=");
2408 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2462 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2463 core.Uri.decodeQueryComponent(keyvalue[1]));
2409 } 2464 }
2410 } 2465 }
2411 2466
2412
2413 var h = { 2467 var h = {
2414 "content-type" : "application/json; charset=utf-8", 2468 "content-type": "application/json; charset=utf-8",
2415 }; 2469 };
2416 var resp = convert.JSON.encode(buildModule()); 2470 var resp = convert.JSON.encode(buildModule());
2417 return new async.Future.value(stringResponse(200, h, resp)); 2471 return new async.Future.value(stringResponse(200, h, resp));
2418 }), true); 2472 }), true);
2419 res.get(arg_appsId, arg_modulesId).then(unittest.expectAsync1(((api.Module response) { 2473 res
2474 .get(arg_appsId, arg_modulesId)
2475 .then(unittest.expectAsync1(((api.Module response) {
2420 checkModule(response); 2476 checkModule(response);
2421 }))); 2477 })));
2422 }); 2478 });
2423 2479
2424 unittest.test("method--list", () { 2480 unittest.test("method--list", () {
2425
2426 var mock = new HttpServerMock(); 2481 var mock = new HttpServerMock();
2427 api.AppsModulesResourceApi res = new api.AppengineApi(mock).apps.modules; 2482 api.AppsModulesResourceApi res = new api.AppengineApi(mock).apps.modules;
2428 var arg_appsId = "foo"; 2483 var arg_appsId = "foo";
2484 var arg_pageToken = "foo";
2429 var arg_pageSize = 42; 2485 var arg_pageSize = 42;
2430 var arg_pageToken = "foo";
2431 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2486 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2432 var path = (req.url).path; 2487 var path = (req.url).path;
2433 var pathOffset = 0; 2488 var pathOffset = 0;
2434 var index; 2489 var index;
2435 var subPart; 2490 var subPart;
2436 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2491 unittest.expect(
2492 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2437 pathOffset += 1; 2493 pathOffset += 1;
2438 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 2494 unittest.expect(path.substring(pathOffset, pathOffset + 13),
2495 unittest.equals("v1beta4/apps/"));
2439 pathOffset += 13; 2496 pathOffset += 13;
2440 index = path.indexOf("/modules", pathOffset); 2497 index = path.indexOf("/modules", pathOffset);
2441 unittest.expect(index >= 0, unittest.isTrue); 2498 unittest.expect(index >= 0, unittest.isTrue);
2442 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 2499 subPart =
2500 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2443 pathOffset = index; 2501 pathOffset = index;
2444 unittest.expect(subPart, unittest.equals("$arg_appsId")); 2502 unittest.expect(subPart, unittest.equals("$arg_appsId"));
2445 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("/modules")); 2503 unittest.expect(path.substring(pathOffset, pathOffset + 8),
2504 unittest.equals("/modules"));
2446 pathOffset += 8; 2505 pathOffset += 8;
2447 2506
2448 var query = (req.url).query; 2507 var query = (req.url).query;
2449 var queryOffset = 0; 2508 var queryOffset = 0;
2450 var queryMap = {}; 2509 var queryMap = {};
2451 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2510 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2452 parseBool(n) { 2511 parseBool(n) {
2453 if (n == "true") return true; 2512 if (n == "true") return true;
2454 if (n == "false") return false; 2513 if (n == "false") return false;
2455 if (n == null) return null; 2514 if (n == null) return null;
2456 throw new core.ArgumentError("Invalid boolean: $n"); 2515 throw new core.ArgumentError("Invalid boolean: $n");
2457 } 2516 }
2517
2458 if (query.length > 0) { 2518 if (query.length > 0) {
2459 for (var part in query.split("&")) { 2519 for (var part in query.split("&")) {
2460 var keyvalue = part.split("="); 2520 var keyvalue = part.split("=");
2461 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2521 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2522 core.Uri.decodeQueryComponent(keyvalue[1]));
2462 } 2523 }
2463 } 2524 }
2464 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize)); 2525 unittest.expect(
2465 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 2526 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
2466 2527 unittest.expect(core.int.parse(queryMap["pageSize"].first),
2528 unittest.equals(arg_pageSize));
2467 2529
2468 var h = { 2530 var h = {
2469 "content-type" : "application/json; charset=utf-8", 2531 "content-type": "application/json; charset=utf-8",
2470 }; 2532 };
2471 var resp = convert.JSON.encode(buildListModulesResponse()); 2533 var resp = convert.JSON.encode(buildListModulesResponse());
2472 return new async.Future.value(stringResponse(200, h, resp)); 2534 return new async.Future.value(stringResponse(200, h, resp));
2473 }), true); 2535 }), true);
2474 res.list(arg_appsId, pageSize: arg_pageSize, pageToken: arg_pageToken).the n(unittest.expectAsync1(((api.ListModulesResponse response) { 2536 res
2537 .list(arg_appsId, pageToken: arg_pageToken, pageSize: arg_pageSize)
2538 .then(unittest.expectAsync1(((api.ListModulesResponse response) {
2475 checkListModulesResponse(response); 2539 checkListModulesResponse(response);
2476 }))); 2540 })));
2477 }); 2541 });
2478 2542
2479 unittest.test("method--patch", () { 2543 unittest.test("method--patch", () {
2480
2481 var mock = new HttpServerMock(); 2544 var mock = new HttpServerMock();
2482 api.AppsModulesResourceApi res = new api.AppengineApi(mock).apps.modules; 2545 api.AppsModulesResourceApi res = new api.AppengineApi(mock).apps.modules;
2483 var arg_request = buildModule(); 2546 var arg_request = buildModule();
2484 var arg_appsId = "foo"; 2547 var arg_appsId = "foo";
2485 var arg_modulesId = "foo"; 2548 var arg_modulesId = "foo";
2486 var arg_migrateTraffic = true; 2549 var arg_migrateTraffic = true;
2487 var arg_mask = "foo"; 2550 var arg_mask = "foo";
2488 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2551 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2489 var obj = new api.Module.fromJson(json); 2552 var obj = new api.Module.fromJson(json);
2490 checkModule(obj); 2553 checkModule(obj);
2491 2554
2492 var path = (req.url).path; 2555 var path = (req.url).path;
2493 var pathOffset = 0; 2556 var pathOffset = 0;
2494 var index; 2557 var index;
2495 var subPart; 2558 var subPart;
2496 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2559 unittest.expect(
2560 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2497 pathOffset += 1; 2561 pathOffset += 1;
2498 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 2562 unittest.expect(path.substring(pathOffset, pathOffset + 13),
2563 unittest.equals("v1beta4/apps/"));
2499 pathOffset += 13; 2564 pathOffset += 13;
2500 index = path.indexOf("/modules/", pathOffset); 2565 index = path.indexOf("/modules/", pathOffset);
2501 unittest.expect(index >= 0, unittest.isTrue); 2566 unittest.expect(index >= 0, unittest.isTrue);
2502 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 2567 subPart =
2568 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2503 pathOffset = index; 2569 pathOffset = index;
2504 unittest.expect(subPart, unittest.equals("$arg_appsId")); 2570 unittest.expect(subPart, unittest.equals("$arg_appsId"));
2505 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/modules/")); 2571 unittest.expect(path.substring(pathOffset, pathOffset + 9),
2572 unittest.equals("/modules/"));
2506 pathOffset += 9; 2573 pathOffset += 9;
2507 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); 2574 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2508 pathOffset = path.length; 2575 pathOffset = path.length;
2509 unittest.expect(subPart, unittest.equals("$arg_modulesId")); 2576 unittest.expect(subPart, unittest.equals("$arg_modulesId"));
2510 2577
2511 var query = (req.url).query; 2578 var query = (req.url).query;
2512 var queryOffset = 0; 2579 var queryOffset = 0;
2513 var queryMap = {}; 2580 var queryMap = {};
2514 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2581 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2515 parseBool(n) { 2582 parseBool(n) {
2516 if (n == "true") return true; 2583 if (n == "true") return true;
2517 if (n == "false") return false; 2584 if (n == "false") return false;
2518 if (n == null) return null; 2585 if (n == null) return null;
2519 throw new core.ArgumentError("Invalid boolean: $n"); 2586 throw new core.ArgumentError("Invalid boolean: $n");
2520 } 2587 }
2588
2521 if (query.length > 0) { 2589 if (query.length > 0) {
2522 for (var part in query.split("&")) { 2590 for (var part in query.split("&")) {
2523 var keyvalue = part.split("="); 2591 var keyvalue = part.split("=");
2524 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2592 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2593 core.Uri.decodeQueryComponent(keyvalue[1]));
2525 } 2594 }
2526 } 2595 }
2527 unittest.expect(queryMap["migrateTraffic"].first, unittest.equals("$arg_ migrateTraffic")); 2596 unittest.expect(queryMap["migrateTraffic"].first,
2597 unittest.equals("$arg_migrateTraffic"));
2528 unittest.expect(queryMap["mask"].first, unittest.equals(arg_mask)); 2598 unittest.expect(queryMap["mask"].first, unittest.equals(arg_mask));
2529 2599
2530
2531 var h = { 2600 var h = {
2532 "content-type" : "application/json; charset=utf-8", 2601 "content-type": "application/json; charset=utf-8",
2533 }; 2602 };
2534 var resp = convert.JSON.encode(buildOperation()); 2603 var resp = convert.JSON.encode(buildOperation());
2535 return new async.Future.value(stringResponse(200, h, resp)); 2604 return new async.Future.value(stringResponse(200, h, resp));
2536 }), true); 2605 }), true);
2537 res.patch(arg_request, arg_appsId, arg_modulesId, migrateTraffic: arg_migr ateTraffic, mask: arg_mask).then(unittest.expectAsync1(((api.Operation response) { 2606 res
2607 .patch(arg_request, arg_appsId, arg_modulesId,
2608 migrateTraffic: arg_migrateTraffic, mask: arg_mask)
2609 .then(unittest.expectAsync1(((api.Operation response) {
2538 checkOperation(response); 2610 checkOperation(response);
2539 }))); 2611 })));
2540 }); 2612 });
2541
2542 }); 2613 });
2543 2614
2544
2545 unittest.group("resource-AppsModulesVersionsResourceApi", () { 2615 unittest.group("resource-AppsModulesVersionsResourceApi", () {
2546 unittest.test("method--create", () { 2616 unittest.test("method--create", () {
2547
2548 var mock = new HttpServerMock(); 2617 var mock = new HttpServerMock();
2549 api.AppsModulesVersionsResourceApi res = new api.AppengineApi(mock).apps.m odules.versions; 2618 api.AppsModulesVersionsResourceApi res =
2619 new api.AppengineApi(mock).apps.modules.versions;
2550 var arg_request = buildVersion(); 2620 var arg_request = buildVersion();
2551 var arg_appsId = "foo"; 2621 var arg_appsId = "foo";
2552 var arg_modulesId = "foo"; 2622 var arg_modulesId = "foo";
2553 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2623 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2554 var obj = new api.Version.fromJson(json); 2624 var obj = new api.Version.fromJson(json);
2555 checkVersion(obj); 2625 checkVersion(obj);
2556 2626
2557 var path = (req.url).path; 2627 var path = (req.url).path;
2558 var pathOffset = 0; 2628 var pathOffset = 0;
2559 var index; 2629 var index;
2560 var subPart; 2630 var subPart;
2561 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2631 unittest.expect(
2632 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2562 pathOffset += 1; 2633 pathOffset += 1;
2563 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 2634 unittest.expect(path.substring(pathOffset, pathOffset + 13),
2635 unittest.equals("v1beta4/apps/"));
2564 pathOffset += 13; 2636 pathOffset += 13;
2565 index = path.indexOf("/modules/", pathOffset); 2637 index = path.indexOf("/modules/", pathOffset);
2566 unittest.expect(index >= 0, unittest.isTrue); 2638 unittest.expect(index >= 0, unittest.isTrue);
2567 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 2639 subPart =
2640 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2568 pathOffset = index; 2641 pathOffset = index;
2569 unittest.expect(subPart, unittest.equals("$arg_appsId")); 2642 unittest.expect(subPart, unittest.equals("$arg_appsId"));
2570 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/modules/")); 2643 unittest.expect(path.substring(pathOffset, pathOffset + 9),
2644 unittest.equals("/modules/"));
2571 pathOffset += 9; 2645 pathOffset += 9;
2572 index = path.indexOf("/versions", pathOffset); 2646 index = path.indexOf("/versions", pathOffset);
2573 unittest.expect(index >= 0, unittest.isTrue); 2647 unittest.expect(index >= 0, unittest.isTrue);
2574 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 2648 subPart =
2649 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2575 pathOffset = index; 2650 pathOffset = index;
2576 unittest.expect(subPart, unittest.equals("$arg_modulesId")); 2651 unittest.expect(subPart, unittest.equals("$arg_modulesId"));
2577 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/versions")); 2652 unittest.expect(path.substring(pathOffset, pathOffset + 9),
2653 unittest.equals("/versions"));
2578 pathOffset += 9; 2654 pathOffset += 9;
2579 2655
2580 var query = (req.url).query; 2656 var query = (req.url).query;
2581 var queryOffset = 0; 2657 var queryOffset = 0;
2582 var queryMap = {}; 2658 var queryMap = {};
2583 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2659 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2584 parseBool(n) { 2660 parseBool(n) {
2585 if (n == "true") return true; 2661 if (n == "true") return true;
2586 if (n == "false") return false; 2662 if (n == "false") return false;
2587 if (n == null) return null; 2663 if (n == null) return null;
2588 throw new core.ArgumentError("Invalid boolean: $n"); 2664 throw new core.ArgumentError("Invalid boolean: $n");
2589 } 2665 }
2666
2590 if (query.length > 0) { 2667 if (query.length > 0) {
2591 for (var part in query.split("&")) { 2668 for (var part in query.split("&")) {
2592 var keyvalue = part.split("="); 2669 var keyvalue = part.split("=");
2593 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2670 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2671 core.Uri.decodeQueryComponent(keyvalue[1]));
2594 } 2672 }
2595 } 2673 }
2596 2674
2597
2598 var h = { 2675 var h = {
2599 "content-type" : "application/json; charset=utf-8", 2676 "content-type": "application/json; charset=utf-8",
2600 }; 2677 };
2601 var resp = convert.JSON.encode(buildOperation()); 2678 var resp = convert.JSON.encode(buildOperation());
2602 return new async.Future.value(stringResponse(200, h, resp)); 2679 return new async.Future.value(stringResponse(200, h, resp));
2603 }), true); 2680 }), true);
2604 res.create(arg_request, arg_appsId, arg_modulesId).then(unittest.expectAsy nc1(((api.Operation response) { 2681 res
2682 .create(arg_request, arg_appsId, arg_modulesId)
2683 .then(unittest.expectAsync1(((api.Operation response) {
2605 checkOperation(response); 2684 checkOperation(response);
2606 }))); 2685 })));
2607 }); 2686 });
2608 2687
2609 unittest.test("method--delete", () { 2688 unittest.test("method--delete", () {
2610
2611 var mock = new HttpServerMock(); 2689 var mock = new HttpServerMock();
2612 api.AppsModulesVersionsResourceApi res = new api.AppengineApi(mock).apps.m odules.versions; 2690 api.AppsModulesVersionsResourceApi res =
2691 new api.AppengineApi(mock).apps.modules.versions;
2613 var arg_appsId = "foo"; 2692 var arg_appsId = "foo";
2614 var arg_modulesId = "foo"; 2693 var arg_modulesId = "foo";
2615 var arg_versionsId = "foo"; 2694 var arg_versionsId = "foo";
2616 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2695 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2617 var path = (req.url).path; 2696 var path = (req.url).path;
2618 var pathOffset = 0; 2697 var pathOffset = 0;
2619 var index; 2698 var index;
2620 var subPart; 2699 var subPart;
2621 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2700 unittest.expect(
2701 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2622 pathOffset += 1; 2702 pathOffset += 1;
2623 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 2703 unittest.expect(path.substring(pathOffset, pathOffset + 13),
2704 unittest.equals("v1beta4/apps/"));
2624 pathOffset += 13; 2705 pathOffset += 13;
2625 index = path.indexOf("/modules/", pathOffset); 2706 index = path.indexOf("/modules/", pathOffset);
2626 unittest.expect(index >= 0, unittest.isTrue); 2707 unittest.expect(index >= 0, unittest.isTrue);
2627 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 2708 subPart =
2709 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2628 pathOffset = index; 2710 pathOffset = index;
2629 unittest.expect(subPart, unittest.equals("$arg_appsId")); 2711 unittest.expect(subPart, unittest.equals("$arg_appsId"));
2630 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/modules/")); 2712 unittest.expect(path.substring(pathOffset, pathOffset + 9),
2713 unittest.equals("/modules/"));
2631 pathOffset += 9; 2714 pathOffset += 9;
2632 index = path.indexOf("/versions/", pathOffset); 2715 index = path.indexOf("/versions/", pathOffset);
2633 unittest.expect(index >= 0, unittest.isTrue); 2716 unittest.expect(index >= 0, unittest.isTrue);
2634 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 2717 subPart =
2718 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2635 pathOffset = index; 2719 pathOffset = index;
2636 unittest.expect(subPart, unittest.equals("$arg_modulesId")); 2720 unittest.expect(subPart, unittest.equals("$arg_modulesId"));
2637 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/versions/")); 2721 unittest.expect(path.substring(pathOffset, pathOffset + 10),
2722 unittest.equals("/versions/"));
2638 pathOffset += 10; 2723 pathOffset += 10;
2639 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); 2724 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2640 pathOffset = path.length; 2725 pathOffset = path.length;
2641 unittest.expect(subPart, unittest.equals("$arg_versionsId")); 2726 unittest.expect(subPart, unittest.equals("$arg_versionsId"));
2642 2727
2643 var query = (req.url).query; 2728 var query = (req.url).query;
2644 var queryOffset = 0; 2729 var queryOffset = 0;
2645 var queryMap = {}; 2730 var queryMap = {};
2646 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2731 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2647 parseBool(n) { 2732 parseBool(n) {
2648 if (n == "true") return true; 2733 if (n == "true") return true;
2649 if (n == "false") return false; 2734 if (n == "false") return false;
2650 if (n == null) return null; 2735 if (n == null) return null;
2651 throw new core.ArgumentError("Invalid boolean: $n"); 2736 throw new core.ArgumentError("Invalid boolean: $n");
2652 } 2737 }
2738
2653 if (query.length > 0) { 2739 if (query.length > 0) {
2654 for (var part in query.split("&")) { 2740 for (var part in query.split("&")) {
2655 var keyvalue = part.split("="); 2741 var keyvalue = part.split("=");
2656 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2742 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2743 core.Uri.decodeQueryComponent(keyvalue[1]));
2657 } 2744 }
2658 } 2745 }
2659 2746
2660
2661 var h = { 2747 var h = {
2662 "content-type" : "application/json; charset=utf-8", 2748 "content-type": "application/json; charset=utf-8",
2663 }; 2749 };
2664 var resp = convert.JSON.encode(buildOperation()); 2750 var resp = convert.JSON.encode(buildOperation());
2665 return new async.Future.value(stringResponse(200, h, resp)); 2751 return new async.Future.value(stringResponse(200, h, resp));
2666 }), true); 2752 }), true);
2667 res.delete(arg_appsId, arg_modulesId, arg_versionsId).then(unittest.expect Async1(((api.Operation response) { 2753 res
2754 .delete(arg_appsId, arg_modulesId, arg_versionsId)
2755 .then(unittest.expectAsync1(((api.Operation response) {
2668 checkOperation(response); 2756 checkOperation(response);
2669 }))); 2757 })));
2670 }); 2758 });
2671 2759
2672 unittest.test("method--get", () { 2760 unittest.test("method--get", () {
2673
2674 var mock = new HttpServerMock(); 2761 var mock = new HttpServerMock();
2675 api.AppsModulesVersionsResourceApi res = new api.AppengineApi(mock).apps.m odules.versions; 2762 api.AppsModulesVersionsResourceApi res =
2763 new api.AppengineApi(mock).apps.modules.versions;
2676 var arg_appsId = "foo"; 2764 var arg_appsId = "foo";
2677 var arg_modulesId = "foo"; 2765 var arg_modulesId = "foo";
2678 var arg_versionsId = "foo"; 2766 var arg_versionsId = "foo";
2679 var arg_view = "foo"; 2767 var arg_view = "foo";
2680 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2768 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2681 var path = (req.url).path; 2769 var path = (req.url).path;
2682 var pathOffset = 0; 2770 var pathOffset = 0;
2683 var index; 2771 var index;
2684 var subPart; 2772 var subPart;
2685 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2773 unittest.expect(
2774 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2686 pathOffset += 1; 2775 pathOffset += 1;
2687 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 2776 unittest.expect(path.substring(pathOffset, pathOffset + 13),
2777 unittest.equals("v1beta4/apps/"));
2688 pathOffset += 13; 2778 pathOffset += 13;
2689 index = path.indexOf("/modules/", pathOffset); 2779 index = path.indexOf("/modules/", pathOffset);
2690 unittest.expect(index >= 0, unittest.isTrue); 2780 unittest.expect(index >= 0, unittest.isTrue);
2691 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 2781 subPart =
2782 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2692 pathOffset = index; 2783 pathOffset = index;
2693 unittest.expect(subPart, unittest.equals("$arg_appsId")); 2784 unittest.expect(subPart, unittest.equals("$arg_appsId"));
2694 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/modules/")); 2785 unittest.expect(path.substring(pathOffset, pathOffset + 9),
2786 unittest.equals("/modules/"));
2695 pathOffset += 9; 2787 pathOffset += 9;
2696 index = path.indexOf("/versions/", pathOffset); 2788 index = path.indexOf("/versions/", pathOffset);
2697 unittest.expect(index >= 0, unittest.isTrue); 2789 unittest.expect(index >= 0, unittest.isTrue);
2698 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 2790 subPart =
2791 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2699 pathOffset = index; 2792 pathOffset = index;
2700 unittest.expect(subPart, unittest.equals("$arg_modulesId")); 2793 unittest.expect(subPart, unittest.equals("$arg_modulesId"));
2701 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/versions/")); 2794 unittest.expect(path.substring(pathOffset, pathOffset + 10),
2795 unittest.equals("/versions/"));
2702 pathOffset += 10; 2796 pathOffset += 10;
2703 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); 2797 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2704 pathOffset = path.length; 2798 pathOffset = path.length;
2705 unittest.expect(subPart, unittest.equals("$arg_versionsId")); 2799 unittest.expect(subPart, unittest.equals("$arg_versionsId"));
2706 2800
2707 var query = (req.url).query; 2801 var query = (req.url).query;
2708 var queryOffset = 0; 2802 var queryOffset = 0;
2709 var queryMap = {}; 2803 var queryMap = {};
2710 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2804 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2711 parseBool(n) { 2805 parseBool(n) {
2712 if (n == "true") return true; 2806 if (n == "true") return true;
2713 if (n == "false") return false; 2807 if (n == "false") return false;
2714 if (n == null) return null; 2808 if (n == null) return null;
2715 throw new core.ArgumentError("Invalid boolean: $n"); 2809 throw new core.ArgumentError("Invalid boolean: $n");
2716 } 2810 }
2811
2717 if (query.length > 0) { 2812 if (query.length > 0) {
2718 for (var part in query.split("&")) { 2813 for (var part in query.split("&")) {
2719 var keyvalue = part.split("="); 2814 var keyvalue = part.split("=");
2720 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2815 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2816 core.Uri.decodeQueryComponent(keyvalue[1]));
2721 } 2817 }
2722 } 2818 }
2723 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); 2819 unittest.expect(queryMap["view"].first, unittest.equals(arg_view));
2724 2820
2725
2726 var h = { 2821 var h = {
2727 "content-type" : "application/json; charset=utf-8", 2822 "content-type": "application/json; charset=utf-8",
2728 }; 2823 };
2729 var resp = convert.JSON.encode(buildVersion()); 2824 var resp = convert.JSON.encode(buildVersion());
2730 return new async.Future.value(stringResponse(200, h, resp)); 2825 return new async.Future.value(stringResponse(200, h, resp));
2731 }), true); 2826 }), true);
2732 res.get(arg_appsId, arg_modulesId, arg_versionsId, view: arg_view).then(un ittest.expectAsync1(((api.Version response) { 2827 res
2828 .get(arg_appsId, arg_modulesId, arg_versionsId, view: arg_view)
2829 .then(unittest.expectAsync1(((api.Version response) {
2733 checkVersion(response); 2830 checkVersion(response);
2734 }))); 2831 })));
2735 }); 2832 });
2736 2833
2737 unittest.test("method--list", () { 2834 unittest.test("method--list", () {
2738
2739 var mock = new HttpServerMock(); 2835 var mock = new HttpServerMock();
2740 api.AppsModulesVersionsResourceApi res = new api.AppengineApi(mock).apps.m odules.versions; 2836 api.AppsModulesVersionsResourceApi res =
2837 new api.AppengineApi(mock).apps.modules.versions;
2741 var arg_appsId = "foo"; 2838 var arg_appsId = "foo";
2742 var arg_modulesId = "foo"; 2839 var arg_modulesId = "foo";
2743 var arg_pageToken = "foo";
2744 var arg_pageSize = 42; 2840 var arg_pageSize = 42;
2745 var arg_view = "foo"; 2841 var arg_view = "foo";
2842 var arg_pageToken = "foo";
2746 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2843 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2747 var path = (req.url).path; 2844 var path = (req.url).path;
2748 var pathOffset = 0; 2845 var pathOffset = 0;
2749 var index; 2846 var index;
2750 var subPart; 2847 var subPart;
2751 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2848 unittest.expect(
2849 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2752 pathOffset += 1; 2850 pathOffset += 1;
2753 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 2851 unittest.expect(path.substring(pathOffset, pathOffset + 13),
2852 unittest.equals("v1beta4/apps/"));
2754 pathOffset += 13; 2853 pathOffset += 13;
2755 index = path.indexOf("/modules/", pathOffset); 2854 index = path.indexOf("/modules/", pathOffset);
2756 unittest.expect(index >= 0, unittest.isTrue); 2855 unittest.expect(index >= 0, unittest.isTrue);
2757 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 2856 subPart =
2857 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2758 pathOffset = index; 2858 pathOffset = index;
2759 unittest.expect(subPart, unittest.equals("$arg_appsId")); 2859 unittest.expect(subPart, unittest.equals("$arg_appsId"));
2760 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/modules/")); 2860 unittest.expect(path.substring(pathOffset, pathOffset + 9),
2861 unittest.equals("/modules/"));
2761 pathOffset += 9; 2862 pathOffset += 9;
2762 index = path.indexOf("/versions", pathOffset); 2863 index = path.indexOf("/versions", pathOffset);
2763 unittest.expect(index >= 0, unittest.isTrue); 2864 unittest.expect(index >= 0, unittest.isTrue);
2764 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 2865 subPart =
2866 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2765 pathOffset = index; 2867 pathOffset = index;
2766 unittest.expect(subPart, unittest.equals("$arg_modulesId")); 2868 unittest.expect(subPart, unittest.equals("$arg_modulesId"));
2767 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/versions")); 2869 unittest.expect(path.substring(pathOffset, pathOffset + 9),
2870 unittest.equals("/versions"));
2768 pathOffset += 9; 2871 pathOffset += 9;
2769 2872
2770 var query = (req.url).query; 2873 var query = (req.url).query;
2771 var queryOffset = 0; 2874 var queryOffset = 0;
2772 var queryMap = {}; 2875 var queryMap = {};
2773 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2876 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2774 parseBool(n) { 2877 parseBool(n) {
2775 if (n == "true") return true; 2878 if (n == "true") return true;
2776 if (n == "false") return false; 2879 if (n == "false") return false;
2777 if (n == null) return null; 2880 if (n == null) return null;
2778 throw new core.ArgumentError("Invalid boolean: $n"); 2881 throw new core.ArgumentError("Invalid boolean: $n");
2779 } 2882 }
2883
2780 if (query.length > 0) { 2884 if (query.length > 0) {
2781 for (var part in query.split("&")) { 2885 for (var part in query.split("&")) {
2782 var keyvalue = part.split("="); 2886 var keyvalue = part.split("=");
2783 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2887 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2888 core.Uri.decodeQueryComponent(keyvalue[1]));
2784 } 2889 }
2785 } 2890 }
2786 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 2891 unittest.expect(core.int.parse(queryMap["pageSize"].first),
2787 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize)); 2892 unittest.equals(arg_pageSize));
2788 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); 2893 unittest.expect(queryMap["view"].first, unittest.equals(arg_view));
2789 2894 unittest.expect(
2895 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
2790 2896
2791 var h = { 2897 var h = {
2792 "content-type" : "application/json; charset=utf-8", 2898 "content-type": "application/json; charset=utf-8",
2793 }; 2899 };
2794 var resp = convert.JSON.encode(buildListVersionsResponse()); 2900 var resp = convert.JSON.encode(buildListVersionsResponse());
2795 return new async.Future.value(stringResponse(200, h, resp)); 2901 return new async.Future.value(stringResponse(200, h, resp));
2796 }), true); 2902 }), true);
2797 res.list(arg_appsId, arg_modulesId, pageToken: arg_pageToken, pageSize: ar g_pageSize, view: arg_view).then(unittest.expectAsync1(((api.ListVersionsRespons e response) { 2903 res
2904 .list(arg_appsId, arg_modulesId,
2905 pageSize: arg_pageSize, view: arg_view, pageToken: arg_pageToken)
2906 .then(unittest.expectAsync1(((api.ListVersionsResponse response) {
2798 checkListVersionsResponse(response); 2907 checkListVersionsResponse(response);
2799 }))); 2908 })));
2800 }); 2909 });
2801 2910
2802 unittest.test("method--patch", () { 2911 unittest.test("method--patch", () {
2803
2804 var mock = new HttpServerMock(); 2912 var mock = new HttpServerMock();
2805 api.AppsModulesVersionsResourceApi res = new api.AppengineApi(mock).apps.m odules.versions; 2913 api.AppsModulesVersionsResourceApi res =
2914 new api.AppengineApi(mock).apps.modules.versions;
2806 var arg_request = buildVersion(); 2915 var arg_request = buildVersion();
2807 var arg_appsId = "foo"; 2916 var arg_appsId = "foo";
2808 var arg_modulesId = "foo"; 2917 var arg_modulesId = "foo";
2809 var arg_versionsId = "foo"; 2918 var arg_versionsId = "foo";
2810 var arg_mask = "foo"; 2919 var arg_mask = "foo";
2811 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2920 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2812 var obj = new api.Version.fromJson(json); 2921 var obj = new api.Version.fromJson(json);
2813 checkVersion(obj); 2922 checkVersion(obj);
2814 2923
2815 var path = (req.url).path; 2924 var path = (req.url).path;
2816 var pathOffset = 0; 2925 var pathOffset = 0;
2817 var index; 2926 var index;
2818 var subPart; 2927 var subPart;
2819 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2928 unittest.expect(
2929 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2820 pathOffset += 1; 2930 pathOffset += 1;
2821 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 2931 unittest.expect(path.substring(pathOffset, pathOffset + 13),
2932 unittest.equals("v1beta4/apps/"));
2822 pathOffset += 13; 2933 pathOffset += 13;
2823 index = path.indexOf("/modules/", pathOffset); 2934 index = path.indexOf("/modules/", pathOffset);
2824 unittest.expect(index >= 0, unittest.isTrue); 2935 unittest.expect(index >= 0, unittest.isTrue);
2825 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 2936 subPart =
2937 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2826 pathOffset = index; 2938 pathOffset = index;
2827 unittest.expect(subPart, unittest.equals("$arg_appsId")); 2939 unittest.expect(subPart, unittest.equals("$arg_appsId"));
2828 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/modules/")); 2940 unittest.expect(path.substring(pathOffset, pathOffset + 9),
2941 unittest.equals("/modules/"));
2829 pathOffset += 9; 2942 pathOffset += 9;
2830 index = path.indexOf("/versions/", pathOffset); 2943 index = path.indexOf("/versions/", pathOffset);
2831 unittest.expect(index >= 0, unittest.isTrue); 2944 unittest.expect(index >= 0, unittest.isTrue);
2832 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 2945 subPart =
2946 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2833 pathOffset = index; 2947 pathOffset = index;
2834 unittest.expect(subPart, unittest.equals("$arg_modulesId")); 2948 unittest.expect(subPart, unittest.equals("$arg_modulesId"));
2835 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/versions/")); 2949 unittest.expect(path.substring(pathOffset, pathOffset + 10),
2950 unittest.equals("/versions/"));
2836 pathOffset += 10; 2951 pathOffset += 10;
2837 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); 2952 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2838 pathOffset = path.length; 2953 pathOffset = path.length;
2839 unittest.expect(subPart, unittest.equals("$arg_versionsId")); 2954 unittest.expect(subPart, unittest.equals("$arg_versionsId"));
2840 2955
2841 var query = (req.url).query; 2956 var query = (req.url).query;
2842 var queryOffset = 0; 2957 var queryOffset = 0;
2843 var queryMap = {}; 2958 var queryMap = {};
2844 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2959 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2845 parseBool(n) { 2960 parseBool(n) {
2846 if (n == "true") return true; 2961 if (n == "true") return true;
2847 if (n == "false") return false; 2962 if (n == "false") return false;
2848 if (n == null) return null; 2963 if (n == null) return null;
2849 throw new core.ArgumentError("Invalid boolean: $n"); 2964 throw new core.ArgumentError("Invalid boolean: $n");
2850 } 2965 }
2966
2851 if (query.length > 0) { 2967 if (query.length > 0) {
2852 for (var part in query.split("&")) { 2968 for (var part in query.split("&")) {
2853 var keyvalue = part.split("="); 2969 var keyvalue = part.split("=");
2854 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2970 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2971 core.Uri.decodeQueryComponent(keyvalue[1]));
2855 } 2972 }
2856 } 2973 }
2857 unittest.expect(queryMap["mask"].first, unittest.equals(arg_mask)); 2974 unittest.expect(queryMap["mask"].first, unittest.equals(arg_mask));
2858 2975
2859
2860 var h = { 2976 var h = {
2861 "content-type" : "application/json; charset=utf-8", 2977 "content-type": "application/json; charset=utf-8",
2862 }; 2978 };
2863 var resp = convert.JSON.encode(buildOperation()); 2979 var resp = convert.JSON.encode(buildOperation());
2864 return new async.Future.value(stringResponse(200, h, resp)); 2980 return new async.Future.value(stringResponse(200, h, resp));
2865 }), true); 2981 }), true);
2866 res.patch(arg_request, arg_appsId, arg_modulesId, arg_versionsId, mask: ar g_mask).then(unittest.expectAsync1(((api.Operation response) { 2982 res
2983 .patch(arg_request, arg_appsId, arg_modulesId, arg_versionsId,
2984 mask: arg_mask)
2985 .then(unittest.expectAsync1(((api.Operation response) {
2867 checkOperation(response); 2986 checkOperation(response);
2868 }))); 2987 })));
2869 }); 2988 });
2870
2871 }); 2989 });
2872 2990
2873
2874 unittest.group("resource-AppsModulesVersionsInstancesResourceApi", () { 2991 unittest.group("resource-AppsModulesVersionsInstancesResourceApi", () {
2875 unittest.test("method--debug", () { 2992 unittest.test("method--debug", () {
2876
2877 var mock = new HttpServerMock(); 2993 var mock = new HttpServerMock();
2878 api.AppsModulesVersionsInstancesResourceApi res = new api.AppengineApi(moc k).apps.modules.versions.instances; 2994 api.AppsModulesVersionsInstancesResourceApi res =
2995 new api.AppengineApi(mock).apps.modules.versions.instances;
2879 var arg_request = buildDebugInstanceRequest(); 2996 var arg_request = buildDebugInstanceRequest();
2880 var arg_appsId = "foo"; 2997 var arg_appsId = "foo";
2881 var arg_modulesId = "foo"; 2998 var arg_modulesId = "foo";
2882 var arg_versionsId = "foo"; 2999 var arg_versionsId = "foo";
2883 var arg_instancesId = "foo"; 3000 var arg_instancesId = "foo";
2884 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3001 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2885 var obj = new api.DebugInstanceRequest.fromJson(json); 3002 var obj = new api.DebugInstanceRequest.fromJson(json);
2886 checkDebugInstanceRequest(obj); 3003 checkDebugInstanceRequest(obj);
2887 3004
2888 var path = (req.url).path; 3005 var path = (req.url).path;
2889 var pathOffset = 0; 3006 var pathOffset = 0;
2890 var index; 3007 var index;
2891 var subPart; 3008 var subPart;
2892 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3009 unittest.expect(
3010 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2893 pathOffset += 1; 3011 pathOffset += 1;
2894 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 3012 unittest.expect(path.substring(pathOffset, pathOffset + 13),
3013 unittest.equals("v1beta4/apps/"));
2895 pathOffset += 13; 3014 pathOffset += 13;
2896 index = path.indexOf("/modules/", pathOffset); 3015 index = path.indexOf("/modules/", pathOffset);
2897 unittest.expect(index >= 0, unittest.isTrue); 3016 unittest.expect(index >= 0, unittest.isTrue);
2898 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 3017 subPart =
3018 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2899 pathOffset = index; 3019 pathOffset = index;
2900 unittest.expect(subPart, unittest.equals("$arg_appsId")); 3020 unittest.expect(subPart, unittest.equals("$arg_appsId"));
2901 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/modules/")); 3021 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3022 unittest.equals("/modules/"));
2902 pathOffset += 9; 3023 pathOffset += 9;
2903 index = path.indexOf("/versions/", pathOffset); 3024 index = path.indexOf("/versions/", pathOffset);
2904 unittest.expect(index >= 0, unittest.isTrue); 3025 unittest.expect(index >= 0, unittest.isTrue);
2905 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 3026 subPart =
3027 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2906 pathOffset = index; 3028 pathOffset = index;
2907 unittest.expect(subPart, unittest.equals("$arg_modulesId")); 3029 unittest.expect(subPart, unittest.equals("$arg_modulesId"));
2908 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/versions/")); 3030 unittest.expect(path.substring(pathOffset, pathOffset + 10),
3031 unittest.equals("/versions/"));
2909 pathOffset += 10; 3032 pathOffset += 10;
2910 index = path.indexOf("/instances/", pathOffset); 3033 index = path.indexOf("/instances/", pathOffset);
2911 unittest.expect(index >= 0, unittest.isTrue); 3034 unittest.expect(index >= 0, unittest.isTrue);
2912 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 3035 subPart =
3036 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2913 pathOffset = index; 3037 pathOffset = index;
2914 unittest.expect(subPart, unittest.equals("$arg_versionsId")); 3038 unittest.expect(subPart, unittest.equals("$arg_versionsId"));
2915 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq uals("/instances/")); 3039 unittest.expect(path.substring(pathOffset, pathOffset + 11),
3040 unittest.equals("/instances/"));
2916 pathOffset += 11; 3041 pathOffset += 11;
2917 index = path.indexOf(":debug", pathOffset); 3042 index = path.indexOf(":debug", pathOffset);
2918 unittest.expect(index >= 0, unittest.isTrue); 3043 unittest.expect(index >= 0, unittest.isTrue);
2919 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 3044 subPart =
3045 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2920 pathOffset = index; 3046 pathOffset = index;
2921 unittest.expect(subPart, unittest.equals("$arg_instancesId")); 3047 unittest.expect(subPart, unittest.equals("$arg_instancesId"));
2922 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ als(":debug")); 3048 unittest.expect(path.substring(pathOffset, pathOffset + 6),
3049 unittest.equals(":debug"));
2923 pathOffset += 6; 3050 pathOffset += 6;
2924 3051
2925 var query = (req.url).query; 3052 var query = (req.url).query;
2926 var queryOffset = 0; 3053 var queryOffset = 0;
2927 var queryMap = {}; 3054 var queryMap = {};
2928 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3055 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2929 parseBool(n) { 3056 parseBool(n) {
2930 if (n == "true") return true; 3057 if (n == "true") return true;
2931 if (n == "false") return false; 3058 if (n == "false") return false;
2932 if (n == null) return null; 3059 if (n == null) return null;
2933 throw new core.ArgumentError("Invalid boolean: $n"); 3060 throw new core.ArgumentError("Invalid boolean: $n");
2934 } 3061 }
3062
2935 if (query.length > 0) { 3063 if (query.length > 0) {
2936 for (var part in query.split("&")) { 3064 for (var part in query.split("&")) {
2937 var keyvalue = part.split("="); 3065 var keyvalue = part.split("=");
2938 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3066 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3067 core.Uri.decodeQueryComponent(keyvalue[1]));
2939 } 3068 }
2940 } 3069 }
2941 3070
2942
2943 var h = { 3071 var h = {
2944 "content-type" : "application/json; charset=utf-8", 3072 "content-type": "application/json; charset=utf-8",
2945 }; 3073 };
2946 var resp = convert.JSON.encode(buildOperation()); 3074 var resp = convert.JSON.encode(buildOperation());
2947 return new async.Future.value(stringResponse(200, h, resp)); 3075 return new async.Future.value(stringResponse(200, h, resp));
2948 }), true); 3076 }), true);
2949 res.debug(arg_request, arg_appsId, arg_modulesId, arg_versionsId, arg_inst ancesId).then(unittest.expectAsync1(((api.Operation response) { 3077 res
3078 .debug(arg_request, arg_appsId, arg_modulesId, arg_versionsId,
3079 arg_instancesId)
3080 .then(unittest.expectAsync1(((api.Operation response) {
2950 checkOperation(response); 3081 checkOperation(response);
2951 }))); 3082 })));
2952 }); 3083 });
2953 3084
2954 unittest.test("method--delete", () { 3085 unittest.test("method--delete", () {
2955
2956 var mock = new HttpServerMock(); 3086 var mock = new HttpServerMock();
2957 api.AppsModulesVersionsInstancesResourceApi res = new api.AppengineApi(moc k).apps.modules.versions.instances; 3087 api.AppsModulesVersionsInstancesResourceApi res =
3088 new api.AppengineApi(mock).apps.modules.versions.instances;
2958 var arg_appsId = "foo"; 3089 var arg_appsId = "foo";
2959 var arg_modulesId = "foo"; 3090 var arg_modulesId = "foo";
2960 var arg_versionsId = "foo"; 3091 var arg_versionsId = "foo";
2961 var arg_instancesId = "foo"; 3092 var arg_instancesId = "foo";
2962 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3093 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2963 var path = (req.url).path; 3094 var path = (req.url).path;
2964 var pathOffset = 0; 3095 var pathOffset = 0;
2965 var index; 3096 var index;
2966 var subPart; 3097 var subPart;
2967 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3098 unittest.expect(
3099 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2968 pathOffset += 1; 3100 pathOffset += 1;
2969 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 3101 unittest.expect(path.substring(pathOffset, pathOffset + 13),
3102 unittest.equals("v1beta4/apps/"));
2970 pathOffset += 13; 3103 pathOffset += 13;
2971 index = path.indexOf("/modules/", pathOffset); 3104 index = path.indexOf("/modules/", pathOffset);
2972 unittest.expect(index >= 0, unittest.isTrue); 3105 unittest.expect(index >= 0, unittest.isTrue);
2973 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 3106 subPart =
3107 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2974 pathOffset = index; 3108 pathOffset = index;
2975 unittest.expect(subPart, unittest.equals("$arg_appsId")); 3109 unittest.expect(subPart, unittest.equals("$arg_appsId"));
2976 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/modules/")); 3110 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3111 unittest.equals("/modules/"));
2977 pathOffset += 9; 3112 pathOffset += 9;
2978 index = path.indexOf("/versions/", pathOffset); 3113 index = path.indexOf("/versions/", pathOffset);
2979 unittest.expect(index >= 0, unittest.isTrue); 3114 unittest.expect(index >= 0, unittest.isTrue);
2980 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 3115 subPart =
3116 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2981 pathOffset = index; 3117 pathOffset = index;
2982 unittest.expect(subPart, unittest.equals("$arg_modulesId")); 3118 unittest.expect(subPart, unittest.equals("$arg_modulesId"));
2983 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/versions/")); 3119 unittest.expect(path.substring(pathOffset, pathOffset + 10),
3120 unittest.equals("/versions/"));
2984 pathOffset += 10; 3121 pathOffset += 10;
2985 index = path.indexOf("/instances/", pathOffset); 3122 index = path.indexOf("/instances/", pathOffset);
2986 unittest.expect(index >= 0, unittest.isTrue); 3123 unittest.expect(index >= 0, unittest.isTrue);
2987 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 3124 subPart =
3125 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2988 pathOffset = index; 3126 pathOffset = index;
2989 unittest.expect(subPart, unittest.equals("$arg_versionsId")); 3127 unittest.expect(subPart, unittest.equals("$arg_versionsId"));
2990 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq uals("/instances/")); 3128 unittest.expect(path.substring(pathOffset, pathOffset + 11),
3129 unittest.equals("/instances/"));
2991 pathOffset += 11; 3130 pathOffset += 11;
2992 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); 3131 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2993 pathOffset = path.length; 3132 pathOffset = path.length;
2994 unittest.expect(subPart, unittest.equals("$arg_instancesId")); 3133 unittest.expect(subPart, unittest.equals("$arg_instancesId"));
2995 3134
2996 var query = (req.url).query; 3135 var query = (req.url).query;
2997 var queryOffset = 0; 3136 var queryOffset = 0;
2998 var queryMap = {}; 3137 var queryMap = {};
2999 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3138 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3000 parseBool(n) { 3139 parseBool(n) {
3001 if (n == "true") return true; 3140 if (n == "true") return true;
3002 if (n == "false") return false; 3141 if (n == "false") return false;
3003 if (n == null) return null; 3142 if (n == null) return null;
3004 throw new core.ArgumentError("Invalid boolean: $n"); 3143 throw new core.ArgumentError("Invalid boolean: $n");
3005 } 3144 }
3145
3006 if (query.length > 0) { 3146 if (query.length > 0) {
3007 for (var part in query.split("&")) { 3147 for (var part in query.split("&")) {
3008 var keyvalue = part.split("="); 3148 var keyvalue = part.split("=");
3009 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3149 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3150 core.Uri.decodeQueryComponent(keyvalue[1]));
3010 } 3151 }
3011 } 3152 }
3012 3153
3013
3014 var h = { 3154 var h = {
3015 "content-type" : "application/json; charset=utf-8", 3155 "content-type": "application/json; charset=utf-8",
3016 }; 3156 };
3017 var resp = convert.JSON.encode(buildOperation()); 3157 var resp = convert.JSON.encode(buildOperation());
3018 return new async.Future.value(stringResponse(200, h, resp)); 3158 return new async.Future.value(stringResponse(200, h, resp));
3019 }), true); 3159 }), true);
3020 res.delete(arg_appsId, arg_modulesId, arg_versionsId, arg_instancesId).the n(unittest.expectAsync1(((api.Operation response) { 3160 res
3161 .delete(arg_appsId, arg_modulesId, arg_versionsId, arg_instancesId)
3162 .then(unittest.expectAsync1(((api.Operation response) {
3021 checkOperation(response); 3163 checkOperation(response);
3022 }))); 3164 })));
3023 }); 3165 });
3024 3166
3025 unittest.test("method--get", () { 3167 unittest.test("method--get", () {
3026
3027 var mock = new HttpServerMock(); 3168 var mock = new HttpServerMock();
3028 api.AppsModulesVersionsInstancesResourceApi res = new api.AppengineApi(moc k).apps.modules.versions.instances; 3169 api.AppsModulesVersionsInstancesResourceApi res =
3170 new api.AppengineApi(mock).apps.modules.versions.instances;
3029 var arg_appsId = "foo"; 3171 var arg_appsId = "foo";
3030 var arg_modulesId = "foo"; 3172 var arg_modulesId = "foo";
3031 var arg_versionsId = "foo"; 3173 var arg_versionsId = "foo";
3032 var arg_instancesId = "foo"; 3174 var arg_instancesId = "foo";
3033 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3175 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3034 var path = (req.url).path; 3176 var path = (req.url).path;
3035 var pathOffset = 0; 3177 var pathOffset = 0;
3036 var index; 3178 var index;
3037 var subPart; 3179 var subPart;
3038 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3180 unittest.expect(
3181 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3039 pathOffset += 1; 3182 pathOffset += 1;
3040 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 3183 unittest.expect(path.substring(pathOffset, pathOffset + 13),
3184 unittest.equals("v1beta4/apps/"));
3041 pathOffset += 13; 3185 pathOffset += 13;
3042 index = path.indexOf("/modules/", pathOffset); 3186 index = path.indexOf("/modules/", pathOffset);
3043 unittest.expect(index >= 0, unittest.isTrue); 3187 unittest.expect(index >= 0, unittest.isTrue);
3044 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 3188 subPart =
3189 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3045 pathOffset = index; 3190 pathOffset = index;
3046 unittest.expect(subPart, unittest.equals("$arg_appsId")); 3191 unittest.expect(subPart, unittest.equals("$arg_appsId"));
3047 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/modules/")); 3192 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3193 unittest.equals("/modules/"));
3048 pathOffset += 9; 3194 pathOffset += 9;
3049 index = path.indexOf("/versions/", pathOffset); 3195 index = path.indexOf("/versions/", pathOffset);
3050 unittest.expect(index >= 0, unittest.isTrue); 3196 unittest.expect(index >= 0, unittest.isTrue);
3051 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 3197 subPart =
3198 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3052 pathOffset = index; 3199 pathOffset = index;
3053 unittest.expect(subPart, unittest.equals("$arg_modulesId")); 3200 unittest.expect(subPart, unittest.equals("$arg_modulesId"));
3054 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/versions/")); 3201 unittest.expect(path.substring(pathOffset, pathOffset + 10),
3202 unittest.equals("/versions/"));
3055 pathOffset += 10; 3203 pathOffset += 10;
3056 index = path.indexOf("/instances/", pathOffset); 3204 index = path.indexOf("/instances/", pathOffset);
3057 unittest.expect(index >= 0, unittest.isTrue); 3205 unittest.expect(index >= 0, unittest.isTrue);
3058 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 3206 subPart =
3207 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3059 pathOffset = index; 3208 pathOffset = index;
3060 unittest.expect(subPart, unittest.equals("$arg_versionsId")); 3209 unittest.expect(subPart, unittest.equals("$arg_versionsId"));
3061 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq uals("/instances/")); 3210 unittest.expect(path.substring(pathOffset, pathOffset + 11),
3211 unittest.equals("/instances/"));
3062 pathOffset += 11; 3212 pathOffset += 11;
3063 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); 3213 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
3064 pathOffset = path.length; 3214 pathOffset = path.length;
3065 unittest.expect(subPart, unittest.equals("$arg_instancesId")); 3215 unittest.expect(subPart, unittest.equals("$arg_instancesId"));
3066 3216
3067 var query = (req.url).query; 3217 var query = (req.url).query;
3068 var queryOffset = 0; 3218 var queryOffset = 0;
3069 var queryMap = {}; 3219 var queryMap = {};
3070 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3220 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3071 parseBool(n) { 3221 parseBool(n) {
3072 if (n == "true") return true; 3222 if (n == "true") return true;
3073 if (n == "false") return false; 3223 if (n == "false") return false;
3074 if (n == null) return null; 3224 if (n == null) return null;
3075 throw new core.ArgumentError("Invalid boolean: $n"); 3225 throw new core.ArgumentError("Invalid boolean: $n");
3076 } 3226 }
3227
3077 if (query.length > 0) { 3228 if (query.length > 0) {
3078 for (var part in query.split("&")) { 3229 for (var part in query.split("&")) {
3079 var keyvalue = part.split("="); 3230 var keyvalue = part.split("=");
3080 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3231 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3232 core.Uri.decodeQueryComponent(keyvalue[1]));
3081 } 3233 }
3082 } 3234 }
3083 3235
3084
3085 var h = { 3236 var h = {
3086 "content-type" : "application/json; charset=utf-8", 3237 "content-type": "application/json; charset=utf-8",
3087 }; 3238 };
3088 var resp = convert.JSON.encode(buildInstance()); 3239 var resp = convert.JSON.encode(buildInstance());
3089 return new async.Future.value(stringResponse(200, h, resp)); 3240 return new async.Future.value(stringResponse(200, h, resp));
3090 }), true); 3241 }), true);
3091 res.get(arg_appsId, arg_modulesId, arg_versionsId, arg_instancesId).then(u nittest.expectAsync1(((api.Instance response) { 3242 res
3243 .get(arg_appsId, arg_modulesId, arg_versionsId, arg_instancesId)
3244 .then(unittest.expectAsync1(((api.Instance response) {
3092 checkInstance(response); 3245 checkInstance(response);
3093 }))); 3246 })));
3094 }); 3247 });
3095 3248
3096 unittest.test("method--list", () { 3249 unittest.test("method--list", () {
3097
3098 var mock = new HttpServerMock(); 3250 var mock = new HttpServerMock();
3099 api.AppsModulesVersionsInstancesResourceApi res = new api.AppengineApi(moc k).apps.modules.versions.instances; 3251 api.AppsModulesVersionsInstancesResourceApi res =
3252 new api.AppengineApi(mock).apps.modules.versions.instances;
3100 var arg_appsId = "foo"; 3253 var arg_appsId = "foo";
3101 var arg_modulesId = "foo"; 3254 var arg_modulesId = "foo";
3102 var arg_versionsId = "foo"; 3255 var arg_versionsId = "foo";
3103 var arg_pageToken = "foo"; 3256 var arg_pageToken = "foo";
3104 var arg_pageSize = 42; 3257 var arg_pageSize = 42;
3105 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3258 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3106 var path = (req.url).path; 3259 var path = (req.url).path;
3107 var pathOffset = 0; 3260 var pathOffset = 0;
3108 var index; 3261 var index;
3109 var subPart; 3262 var subPart;
3110 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3263 unittest.expect(
3264 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3111 pathOffset += 1; 3265 pathOffset += 1;
3112 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 3266 unittest.expect(path.substring(pathOffset, pathOffset + 13),
3267 unittest.equals("v1beta4/apps/"));
3113 pathOffset += 13; 3268 pathOffset += 13;
3114 index = path.indexOf("/modules/", pathOffset); 3269 index = path.indexOf("/modules/", pathOffset);
3115 unittest.expect(index >= 0, unittest.isTrue); 3270 unittest.expect(index >= 0, unittest.isTrue);
3116 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 3271 subPart =
3272 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3117 pathOffset = index; 3273 pathOffset = index;
3118 unittest.expect(subPart, unittest.equals("$arg_appsId")); 3274 unittest.expect(subPart, unittest.equals("$arg_appsId"));
3119 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/modules/")); 3275 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3276 unittest.equals("/modules/"));
3120 pathOffset += 9; 3277 pathOffset += 9;
3121 index = path.indexOf("/versions/", pathOffset); 3278 index = path.indexOf("/versions/", pathOffset);
3122 unittest.expect(index >= 0, unittest.isTrue); 3279 unittest.expect(index >= 0, unittest.isTrue);
3123 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 3280 subPart =
3281 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3124 pathOffset = index; 3282 pathOffset = index;
3125 unittest.expect(subPart, unittest.equals("$arg_modulesId")); 3283 unittest.expect(subPart, unittest.equals("$arg_modulesId"));
3126 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/versions/")); 3284 unittest.expect(path.substring(pathOffset, pathOffset + 10),
3285 unittest.equals("/versions/"));
3127 pathOffset += 10; 3286 pathOffset += 10;
3128 index = path.indexOf("/instances", pathOffset); 3287 index = path.indexOf("/instances", pathOffset);
3129 unittest.expect(index >= 0, unittest.isTrue); 3288 unittest.expect(index >= 0, unittest.isTrue);
3130 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 3289 subPart =
3290 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3131 pathOffset = index; 3291 pathOffset = index;
3132 unittest.expect(subPart, unittest.equals("$arg_versionsId")); 3292 unittest.expect(subPart, unittest.equals("$arg_versionsId"));
3133 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/instances")); 3293 unittest.expect(path.substring(pathOffset, pathOffset + 10),
3294 unittest.equals("/instances"));
3134 pathOffset += 10; 3295 pathOffset += 10;
3135 3296
3136 var query = (req.url).query; 3297 var query = (req.url).query;
3137 var queryOffset = 0; 3298 var queryOffset = 0;
3138 var queryMap = {}; 3299 var queryMap = {};
3139 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3300 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3140 parseBool(n) { 3301 parseBool(n) {
3141 if (n == "true") return true; 3302 if (n == "true") return true;
3142 if (n == "false") return false; 3303 if (n == "false") return false;
3143 if (n == null) return null; 3304 if (n == null) return null;
3144 throw new core.ArgumentError("Invalid boolean: $n"); 3305 throw new core.ArgumentError("Invalid boolean: $n");
3145 } 3306 }
3307
3146 if (query.length > 0) { 3308 if (query.length > 0) {
3147 for (var part in query.split("&")) { 3309 for (var part in query.split("&")) {
3148 var keyvalue = part.split("="); 3310 var keyvalue = part.split("=");
3149 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3311 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3312 core.Uri.decodeQueryComponent(keyvalue[1]));
3150 } 3313 }
3151 } 3314 }
3152 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 3315 unittest.expect(
3153 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize)); 3316 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
3154 3317 unittest.expect(core.int.parse(queryMap["pageSize"].first),
3318 unittest.equals(arg_pageSize));
3155 3319
3156 var h = { 3320 var h = {
3157 "content-type" : "application/json; charset=utf-8", 3321 "content-type": "application/json; charset=utf-8",
3158 }; 3322 };
3159 var resp = convert.JSON.encode(buildListInstancesResponse()); 3323 var resp = convert.JSON.encode(buildListInstancesResponse());
3160 return new async.Future.value(stringResponse(200, h, resp)); 3324 return new async.Future.value(stringResponse(200, h, resp));
3161 }), true); 3325 }), true);
3162 res.list(arg_appsId, arg_modulesId, arg_versionsId, pageToken: arg_pageTok en, pageSize: arg_pageSize).then(unittest.expectAsync1(((api.ListInstancesRespon se response) { 3326 res
3327 .list(arg_appsId, arg_modulesId, arg_versionsId,
3328 pageToken: arg_pageToken, pageSize: arg_pageSize)
3329 .then(unittest.expectAsync1(((api.ListInstancesResponse response) {
3163 checkListInstancesResponse(response); 3330 checkListInstancesResponse(response);
3164 }))); 3331 })));
3165 }); 3332 });
3166
3167 }); 3333 });
3168 3334
3169
3170 unittest.group("resource-AppsOperationsResourceApi", () { 3335 unittest.group("resource-AppsOperationsResourceApi", () {
3171 unittest.test("method--get", () { 3336 unittest.test("method--get", () {
3172
3173 var mock = new HttpServerMock(); 3337 var mock = new HttpServerMock();
3174 api.AppsOperationsResourceApi res = new api.AppengineApi(mock).apps.operat ions; 3338 api.AppsOperationsResourceApi res =
3339 new api.AppengineApi(mock).apps.operations;
3175 var arg_appsId = "foo"; 3340 var arg_appsId = "foo";
3176 var arg_operationsId = "foo"; 3341 var arg_operationsId = "foo";
3177 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3342 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3178 var path = (req.url).path; 3343 var path = (req.url).path;
3179 var pathOffset = 0; 3344 var pathOffset = 0;
3180 var index; 3345 var index;
3181 var subPart; 3346 var subPart;
3182 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3347 unittest.expect(
3348 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3183 pathOffset += 1; 3349 pathOffset += 1;
3184 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 3350 unittest.expect(path.substring(pathOffset, pathOffset + 13),
3351 unittest.equals("v1beta4/apps/"));
3185 pathOffset += 13; 3352 pathOffset += 13;
3186 index = path.indexOf("/operations/", pathOffset); 3353 index = path.indexOf("/operations/", pathOffset);
3187 unittest.expect(index >= 0, unittest.isTrue); 3354 unittest.expect(index >= 0, unittest.isTrue);
3188 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 3355 subPart =
3356 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3189 pathOffset = index; 3357 pathOffset = index;
3190 unittest.expect(subPart, unittest.equals("$arg_appsId")); 3358 unittest.expect(subPart, unittest.equals("$arg_appsId"));
3191 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("/operations/")); 3359 unittest.expect(path.substring(pathOffset, pathOffset + 12),
3360 unittest.equals("/operations/"));
3192 pathOffset += 12; 3361 pathOffset += 12;
3193 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); 3362 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
3194 pathOffset = path.length; 3363 pathOffset = path.length;
3195 unittest.expect(subPart, unittest.equals("$arg_operationsId")); 3364 unittest.expect(subPart, unittest.equals("$arg_operationsId"));
3196 3365
3197 var query = (req.url).query; 3366 var query = (req.url).query;
3198 var queryOffset = 0; 3367 var queryOffset = 0;
3199 var queryMap = {}; 3368 var queryMap = {};
3200 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3369 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3201 parseBool(n) { 3370 parseBool(n) {
3202 if (n == "true") return true; 3371 if (n == "true") return true;
3203 if (n == "false") return false; 3372 if (n == "false") return false;
3204 if (n == null) return null; 3373 if (n == null) return null;
3205 throw new core.ArgumentError("Invalid boolean: $n"); 3374 throw new core.ArgumentError("Invalid boolean: $n");
3206 } 3375 }
3376
3207 if (query.length > 0) { 3377 if (query.length > 0) {
3208 for (var part in query.split("&")) { 3378 for (var part in query.split("&")) {
3209 var keyvalue = part.split("="); 3379 var keyvalue = part.split("=");
3210 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3380 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3381 core.Uri.decodeQueryComponent(keyvalue[1]));
3211 } 3382 }
3212 } 3383 }
3213 3384
3214
3215 var h = { 3385 var h = {
3216 "content-type" : "application/json; charset=utf-8", 3386 "content-type": "application/json; charset=utf-8",
3217 }; 3387 };
3218 var resp = convert.JSON.encode(buildOperation()); 3388 var resp = convert.JSON.encode(buildOperation());
3219 return new async.Future.value(stringResponse(200, h, resp)); 3389 return new async.Future.value(stringResponse(200, h, resp));
3220 }), true); 3390 }), true);
3221 res.get(arg_appsId, arg_operationsId).then(unittest.expectAsync1(((api.Ope ration response) { 3391 res
3392 .get(arg_appsId, arg_operationsId)
3393 .then(unittest.expectAsync1(((api.Operation response) {
3222 checkOperation(response); 3394 checkOperation(response);
3223 }))); 3395 })));
3224 }); 3396 });
3225 3397
3226 unittest.test("method--list", () { 3398 unittest.test("method--list", () {
3227
3228 var mock = new HttpServerMock(); 3399 var mock = new HttpServerMock();
3229 api.AppsOperationsResourceApi res = new api.AppengineApi(mock).apps.operat ions; 3400 api.AppsOperationsResourceApi res =
3401 new api.AppengineApi(mock).apps.operations;
3230 var arg_appsId = "foo"; 3402 var arg_appsId = "foo";
3231 var arg_filter = "foo"; 3403 var arg_filter = "foo";
3232 var arg_pageToken = "foo"; 3404 var arg_pageToken = "foo";
3233 var arg_pageSize = 42; 3405 var arg_pageSize = 42;
3234 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 3406 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3235 var path = (req.url).path; 3407 var path = (req.url).path;
3236 var pathOffset = 0; 3408 var pathOffset = 0;
3237 var index; 3409 var index;
3238 var subPart; 3410 var subPart;
3239 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 3411 unittest.expect(
3412 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3240 pathOffset += 1; 3413 pathOffset += 1;
3241 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta4/apps/")); 3414 unittest.expect(path.substring(pathOffset, pathOffset + 13),
3415 unittest.equals("v1beta4/apps/"));
3242 pathOffset += 13; 3416 pathOffset += 13;
3243 index = path.indexOf("/operations", pathOffset); 3417 index = path.indexOf("/operations", pathOffset);
3244 unittest.expect(index >= 0, unittest.isTrue); 3418 unittest.expect(index >= 0, unittest.isTrue);
3245 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index )); 3419 subPart =
3420 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3246 pathOffset = index; 3421 pathOffset = index;
3247 unittest.expect(subPart, unittest.equals("$arg_appsId")); 3422 unittest.expect(subPart, unittest.equals("$arg_appsId"));
3248 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq uals("/operations")); 3423 unittest.expect(path.substring(pathOffset, pathOffset + 11),
3424 unittest.equals("/operations"));
3249 pathOffset += 11; 3425 pathOffset += 11;
3250 3426
3251 var query = (req.url).query; 3427 var query = (req.url).query;
3252 var queryOffset = 0; 3428 var queryOffset = 0;
3253 var queryMap = {}; 3429 var queryMap = {};
3254 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 3430 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3255 parseBool(n) { 3431 parseBool(n) {
3256 if (n == "true") return true; 3432 if (n == "true") return true;
3257 if (n == "false") return false; 3433 if (n == "false") return false;
3258 if (n == null) return null; 3434 if (n == null) return null;
3259 throw new core.ArgumentError("Invalid boolean: $n"); 3435 throw new core.ArgumentError("Invalid boolean: $n");
3260 } 3436 }
3437
3261 if (query.length > 0) { 3438 if (query.length > 0) {
3262 for (var part in query.split("&")) { 3439 for (var part in query.split("&")) {
3263 var keyvalue = part.split("="); 3440 var keyvalue = part.split("=");
3264 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 3441 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3442 core.Uri.decodeQueryComponent(keyvalue[1]));
3265 } 3443 }
3266 } 3444 }
3267 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); 3445 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter));
3268 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 3446 unittest.expect(
3269 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize)); 3447 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
3270 3448 unittest.expect(core.int.parse(queryMap["pageSize"].first),
3449 unittest.equals(arg_pageSize));
3271 3450
3272 var h = { 3451 var h = {
3273 "content-type" : "application/json; charset=utf-8", 3452 "content-type": "application/json; charset=utf-8",
3274 }; 3453 };
3275 var resp = convert.JSON.encode(buildListOperationsResponse()); 3454 var resp = convert.JSON.encode(buildListOperationsResponse());
3276 return new async.Future.value(stringResponse(200, h, resp)); 3455 return new async.Future.value(stringResponse(200, h, resp));
3277 }), true); 3456 }), true);
3278 res.list(arg_appsId, filter: arg_filter, pageToken: arg_pageToken, pageSiz e: arg_pageSize).then(unittest.expectAsync1(((api.ListOperationsResponse respons e) { 3457 res
3458 .list(arg_appsId,
3459 filter: arg_filter,
3460 pageToken: arg_pageToken,
3461 pageSize: arg_pageSize)
3462 .then(unittest.expectAsync1(((api.ListOperationsResponse response) {
3279 checkListOperationsResponse(response); 3463 checkListOperationsResponse(response);
3280 }))); 3464 })));
3281 }); 3465 });
3282
3283 }); 3466 });
3284
3285
3286 } 3467 }
3287
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698