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

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

Issue 2226653002: Api-roll 40: 2016-08-08 (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: Addressed review comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 library googleapis.servicemanagement.v1.test;
2
3 import "dart:core" as core;
4 import "dart:collection" as collection;
5 import "dart:async" as async;
6 import "dart:convert" as convert;
7
8 import 'package:http/http.dart' as http;
9 import 'package:http/testing.dart' as http_testing;
10 import 'package:unittest/unittest.dart' as unittest;
11
12 import 'package:googleapis/servicemanagement/v1.dart' as api;
13
14 class HttpServerMock extends http.BaseClient {
15 core.Function _callback;
16 core.bool _expectJson;
17
18 void register(core.Function callback, core.bool expectJson) {
19 _callback = callback;
20 _expectJson = expectJson;
21 }
22
23 async.Future<http.StreamedResponse> send(http.BaseRequest request) {
24 if (_expectJson) {
25 return request.finalize()
26 .transform(convert.UTF8.decoder)
27 .join('')
28 .then((core.String jsonString) {
29 if (jsonString.isEmpty) {
30 return _callback(request, null);
31 } else {
32 return _callback(request, convert.JSON.decode(jsonString));
33 }
34 });
35 } else {
36 var stream = request.finalize();
37 if (stream == null) {
38 return _callback(request, []);
39 } else {
40 return stream.toBytes().then((data) {
41 return _callback(request, data);
42 });
43 }
44 }
45 }
46 }
47
48 http.StreamedResponse stringResponse(
49 core.int status, core.Map headers, core.String body) {
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]);
51 return new http.StreamedResponse(stream, status, headers: headers);
52 }
53
54 core.int buildCounterAdvice = 0;
55 buildAdvice() {
56 var o = new api.Advice();
57 buildCounterAdvice++;
58 if (buildCounterAdvice < 3) {
59 o.description = "foo";
60 }
61 buildCounterAdvice--;
62 return o;
63 }
64
65 checkAdvice(api.Advice o) {
66 buildCounterAdvice++;
67 if (buildCounterAdvice < 3) {
68 unittest.expect(o.description, unittest.equals('foo'));
69 }
70 buildCounterAdvice--;
71 }
72
73 buildUnnamed3077() {
74 var o = new core.List<api.Method>();
75 o.add(buildMethod());
76 o.add(buildMethod());
77 return o;
78 }
79
80 checkUnnamed3077(core.List<api.Method> o) {
81 unittest.expect(o, unittest.hasLength(2));
82 checkMethod(o[0]);
83 checkMethod(o[1]);
84 }
85
86 buildUnnamed3078() {
87 var o = new core.List<api.Mixin>();
88 o.add(buildMixin());
89 o.add(buildMixin());
90 return o;
91 }
92
93 checkUnnamed3078(core.List<api.Mixin> o) {
94 unittest.expect(o, unittest.hasLength(2));
95 checkMixin(o[0]);
96 checkMixin(o[1]);
97 }
98
99 buildUnnamed3079() {
100 var o = new core.List<api.Option>();
101 o.add(buildOption());
102 o.add(buildOption());
103 return o;
104 }
105
106 checkUnnamed3079(core.List<api.Option> o) {
107 unittest.expect(o, unittest.hasLength(2));
108 checkOption(o[0]);
109 checkOption(o[1]);
110 }
111
112 core.int buildCounterApi = 0;
113 buildApi() {
114 var o = new api.Api();
115 buildCounterApi++;
116 if (buildCounterApi < 3) {
117 o.methods = buildUnnamed3077();
118 o.mixins = buildUnnamed3078();
119 o.name = "foo";
120 o.options = buildUnnamed3079();
121 o.sourceContext = buildSourceContext();
122 o.syntax = "foo";
123 o.version = "foo";
124 }
125 buildCounterApi--;
126 return o;
127 }
128
129 checkApi(api.Api o) {
130 buildCounterApi++;
131 if (buildCounterApi < 3) {
132 checkUnnamed3077(o.methods);
133 checkUnnamed3078(o.mixins);
134 unittest.expect(o.name, unittest.equals('foo'));
135 checkUnnamed3079(o.options);
136 checkSourceContext(o.sourceContext);
137 unittest.expect(o.syntax, unittest.equals('foo'));
138 unittest.expect(o.version, unittest.equals('foo'));
139 }
140 buildCounterApi--;
141 }
142
143 buildUnnamed3080() {
144 var o = new core.List<core.String>();
145 o.add("foo");
146 o.add("foo");
147 return o;
148 }
149
150 checkUnnamed3080(core.List<core.String> o) {
151 unittest.expect(o, unittest.hasLength(2));
152 unittest.expect(o[0], unittest.equals('foo'));
153 unittest.expect(o[1], unittest.equals('foo'));
154 }
155
156 core.int buildCounterAuditConfig = 0;
157 buildAuditConfig() {
158 var o = new api.AuditConfig();
159 buildCounterAuditConfig++;
160 if (buildCounterAuditConfig < 3) {
161 o.exemptedMembers = buildUnnamed3080();
162 o.service = "foo";
163 }
164 buildCounterAuditConfig--;
165 return o;
166 }
167
168 checkAuditConfig(api.AuditConfig o) {
169 buildCounterAuditConfig++;
170 if (buildCounterAuditConfig < 3) {
171 checkUnnamed3080(o.exemptedMembers);
172 unittest.expect(o.service, unittest.equals('foo'));
173 }
174 buildCounterAuditConfig--;
175 }
176
177 core.int buildCounterAuthProvider = 0;
178 buildAuthProvider() {
179 var o = new api.AuthProvider();
180 buildCounterAuthProvider++;
181 if (buildCounterAuthProvider < 3) {
182 o.id = "foo";
183 o.issuer = "foo";
184 o.jwksUri = "foo";
185 }
186 buildCounterAuthProvider--;
187 return o;
188 }
189
190 checkAuthProvider(api.AuthProvider o) {
191 buildCounterAuthProvider++;
192 if (buildCounterAuthProvider < 3) {
193 unittest.expect(o.id, unittest.equals('foo'));
194 unittest.expect(o.issuer, unittest.equals('foo'));
195 unittest.expect(o.jwksUri, unittest.equals('foo'));
196 }
197 buildCounterAuthProvider--;
198 }
199
200 core.int buildCounterAuthRequirement = 0;
201 buildAuthRequirement() {
202 var o = new api.AuthRequirement();
203 buildCounterAuthRequirement++;
204 if (buildCounterAuthRequirement < 3) {
205 o.audiences = "foo";
206 o.providerId = "foo";
207 }
208 buildCounterAuthRequirement--;
209 return o;
210 }
211
212 checkAuthRequirement(api.AuthRequirement o) {
213 buildCounterAuthRequirement++;
214 if (buildCounterAuthRequirement < 3) {
215 unittest.expect(o.audiences, unittest.equals('foo'));
216 unittest.expect(o.providerId, unittest.equals('foo'));
217 }
218 buildCounterAuthRequirement--;
219 }
220
221 buildUnnamed3081() {
222 var o = new core.List<api.AuthProvider>();
223 o.add(buildAuthProvider());
224 o.add(buildAuthProvider());
225 return o;
226 }
227
228 checkUnnamed3081(core.List<api.AuthProvider> o) {
229 unittest.expect(o, unittest.hasLength(2));
230 checkAuthProvider(o[0]);
231 checkAuthProvider(o[1]);
232 }
233
234 buildUnnamed3082() {
235 var o = new core.List<api.AuthenticationRule>();
236 o.add(buildAuthenticationRule());
237 o.add(buildAuthenticationRule());
238 return o;
239 }
240
241 checkUnnamed3082(core.List<api.AuthenticationRule> o) {
242 unittest.expect(o, unittest.hasLength(2));
243 checkAuthenticationRule(o[0]);
244 checkAuthenticationRule(o[1]);
245 }
246
247 core.int buildCounterAuthentication = 0;
248 buildAuthentication() {
249 var o = new api.Authentication();
250 buildCounterAuthentication++;
251 if (buildCounterAuthentication < 3) {
252 o.providers = buildUnnamed3081();
253 o.rules = buildUnnamed3082();
254 }
255 buildCounterAuthentication--;
256 return o;
257 }
258
259 checkAuthentication(api.Authentication o) {
260 buildCounterAuthentication++;
261 if (buildCounterAuthentication < 3) {
262 checkUnnamed3081(o.providers);
263 checkUnnamed3082(o.rules);
264 }
265 buildCounterAuthentication--;
266 }
267
268 buildUnnamed3083() {
269 var o = new core.List<api.AuthRequirement>();
270 o.add(buildAuthRequirement());
271 o.add(buildAuthRequirement());
272 return o;
273 }
274
275 checkUnnamed3083(core.List<api.AuthRequirement> o) {
276 unittest.expect(o, unittest.hasLength(2));
277 checkAuthRequirement(o[0]);
278 checkAuthRequirement(o[1]);
279 }
280
281 core.int buildCounterAuthenticationRule = 0;
282 buildAuthenticationRule() {
283 var o = new api.AuthenticationRule();
284 buildCounterAuthenticationRule++;
285 if (buildCounterAuthenticationRule < 3) {
286 o.allowWithoutCredential = true;
287 o.oauth = buildOAuthRequirements();
288 o.requirements = buildUnnamed3083();
289 o.selector = "foo";
290 }
291 buildCounterAuthenticationRule--;
292 return o;
293 }
294
295 checkAuthenticationRule(api.AuthenticationRule o) {
296 buildCounterAuthenticationRule++;
297 if (buildCounterAuthenticationRule < 3) {
298 unittest.expect(o.allowWithoutCredential, unittest.isTrue);
299 checkOAuthRequirements(o.oauth);
300 checkUnnamed3083(o.requirements);
301 unittest.expect(o.selector, unittest.equals('foo'));
302 }
303 buildCounterAuthenticationRule--;
304 }
305
306 buildUnnamed3084() {
307 var o = new core.List<api.BackendRule>();
308 o.add(buildBackendRule());
309 o.add(buildBackendRule());
310 return o;
311 }
312
313 checkUnnamed3084(core.List<api.BackendRule> o) {
314 unittest.expect(o, unittest.hasLength(2));
315 checkBackendRule(o[0]);
316 checkBackendRule(o[1]);
317 }
318
319 core.int buildCounterBackend = 0;
320 buildBackend() {
321 var o = new api.Backend();
322 buildCounterBackend++;
323 if (buildCounterBackend < 3) {
324 o.rules = buildUnnamed3084();
325 }
326 buildCounterBackend--;
327 return o;
328 }
329
330 checkBackend(api.Backend o) {
331 buildCounterBackend++;
332 if (buildCounterBackend < 3) {
333 checkUnnamed3084(o.rules);
334 }
335 buildCounterBackend--;
336 }
337
338 core.int buildCounterBackendRule = 0;
339 buildBackendRule() {
340 var o = new api.BackendRule();
341 buildCounterBackendRule++;
342 if (buildCounterBackendRule < 3) {
343 o.address = "foo";
344 o.deadline = 42.0;
345 o.selector = "foo";
346 }
347 buildCounterBackendRule--;
348 return o;
349 }
350
351 checkBackendRule(api.BackendRule o) {
352 buildCounterBackendRule++;
353 if (buildCounterBackendRule < 3) {
354 unittest.expect(o.address, unittest.equals('foo'));
355 unittest.expect(o.deadline, unittest.equals(42.0));
356 unittest.expect(o.selector, unittest.equals('foo'));
357 }
358 buildCounterBackendRule--;
359 }
360
361 buildUnnamed3085() {
362 var o = new core.List<core.String>();
363 o.add("foo");
364 o.add("foo");
365 return o;
366 }
367
368 checkUnnamed3085(core.List<core.String> o) {
369 unittest.expect(o, unittest.hasLength(2));
370 unittest.expect(o[0], unittest.equals('foo'));
371 unittest.expect(o[1], unittest.equals('foo'));
372 }
373
374 core.int buildCounterBinding = 0;
375 buildBinding() {
376 var o = new api.Binding();
377 buildCounterBinding++;
378 if (buildCounterBinding < 3) {
379 o.members = buildUnnamed3085();
380 o.role = "foo";
381 }
382 buildCounterBinding--;
383 return o;
384 }
385
386 checkBinding(api.Binding o) {
387 buildCounterBinding++;
388 if (buildCounterBinding < 3) {
389 checkUnnamed3085(o.members);
390 unittest.expect(o.role, unittest.equals('foo'));
391 }
392 buildCounterBinding--;
393 }
394
395 buildUnnamed3086() {
396 var o = new core.List<api.ConfigChange>();
397 o.add(buildConfigChange());
398 o.add(buildConfigChange());
399 return o;
400 }
401
402 checkUnnamed3086(core.List<api.ConfigChange> o) {
403 unittest.expect(o, unittest.hasLength(2));
404 checkConfigChange(o[0]);
405 checkConfigChange(o[1]);
406 }
407
408 core.int buildCounterChangeReport = 0;
409 buildChangeReport() {
410 var o = new api.ChangeReport();
411 buildCounterChangeReport++;
412 if (buildCounterChangeReport < 3) {
413 o.configChanges = buildUnnamed3086();
414 }
415 buildCounterChangeReport--;
416 return o;
417 }
418
419 checkChangeReport(api.ChangeReport o) {
420 buildCounterChangeReport++;
421 if (buildCounterChangeReport < 3) {
422 checkUnnamed3086(o.configChanges);
423 }
424 buildCounterChangeReport--;
425 }
426
427 core.int buildCounterCloudAuditOptions = 0;
428 buildCloudAuditOptions() {
429 var o = new api.CloudAuditOptions();
430 buildCounterCloudAuditOptions++;
431 if (buildCounterCloudAuditOptions < 3) {
432 }
433 buildCounterCloudAuditOptions--;
434 return o;
435 }
436
437 checkCloudAuditOptions(api.CloudAuditOptions o) {
438 buildCounterCloudAuditOptions++;
439 if (buildCounterCloudAuditOptions < 3) {
440 }
441 buildCounterCloudAuditOptions--;
442 }
443
444 buildUnnamed3087() {
445 var o = new core.List<core.String>();
446 o.add("foo");
447 o.add("foo");
448 return o;
449 }
450
451 checkUnnamed3087(core.List<core.String> o) {
452 unittest.expect(o, unittest.hasLength(2));
453 unittest.expect(o[0], unittest.equals('foo'));
454 unittest.expect(o[1], unittest.equals('foo'));
455 }
456
457 core.int buildCounterCondition = 0;
458 buildCondition() {
459 var o = new api.Condition();
460 buildCounterCondition++;
461 if (buildCounterCondition < 3) {
462 o.iam = "foo";
463 o.op = "foo";
464 o.svc = "foo";
465 o.sys = "foo";
466 o.value = "foo";
467 o.values = buildUnnamed3087();
468 }
469 buildCounterCondition--;
470 return o;
471 }
472
473 checkCondition(api.Condition o) {
474 buildCounterCondition++;
475 if (buildCounterCondition < 3) {
476 unittest.expect(o.iam, unittest.equals('foo'));
477 unittest.expect(o.op, unittest.equals('foo'));
478 unittest.expect(o.svc, unittest.equals('foo'));
479 unittest.expect(o.sys, unittest.equals('foo'));
480 unittest.expect(o.value, unittest.equals('foo'));
481 checkUnnamed3087(o.values);
482 }
483 buildCounterCondition--;
484 }
485
486 buildUnnamed3088() {
487 var o = new core.List<api.Advice>();
488 o.add(buildAdvice());
489 o.add(buildAdvice());
490 return o;
491 }
492
493 checkUnnamed3088(core.List<api.Advice> o) {
494 unittest.expect(o, unittest.hasLength(2));
495 checkAdvice(o[0]);
496 checkAdvice(o[1]);
497 }
498
499 core.int buildCounterConfigChange = 0;
500 buildConfigChange() {
501 var o = new api.ConfigChange();
502 buildCounterConfigChange++;
503 if (buildCounterConfigChange < 3) {
504 o.advices = buildUnnamed3088();
505 o.changeType = "foo";
506 o.element = "foo";
507 o.newValue = "foo";
508 o.oldValue = "foo";
509 }
510 buildCounterConfigChange--;
511 return o;
512 }
513
514 checkConfigChange(api.ConfigChange o) {
515 buildCounterConfigChange++;
516 if (buildCounterConfigChange < 3) {
517 checkUnnamed3088(o.advices);
518 unittest.expect(o.changeType, unittest.equals('foo'));
519 unittest.expect(o.element, unittest.equals('foo'));
520 unittest.expect(o.newValue, unittest.equals('foo'));
521 unittest.expect(o.oldValue, unittest.equals('foo'));
522 }
523 buildCounterConfigChange--;
524 }
525
526 core.int buildCounterConfigFile = 0;
527 buildConfigFile() {
528 var o = new api.ConfigFile();
529 buildCounterConfigFile++;
530 if (buildCounterConfigFile < 3) {
531 o.fileContents = "foo";
532 o.filePath = "foo";
533 o.fileType = "foo";
534 }
535 buildCounterConfigFile--;
536 return o;
537 }
538
539 checkConfigFile(api.ConfigFile o) {
540 buildCounterConfigFile++;
541 if (buildCounterConfigFile < 3) {
542 unittest.expect(o.fileContents, unittest.equals('foo'));
543 unittest.expect(o.filePath, unittest.equals('foo'));
544 unittest.expect(o.fileType, unittest.equals('foo'));
545 }
546 buildCounterConfigFile--;
547 }
548
549 core.int buildCounterConfigOptions = 0;
550 buildConfigOptions() {
551 var o = new api.ConfigOptions();
552 buildCounterConfigOptions++;
553 if (buildCounterConfigOptions < 3) {
554 }
555 buildCounterConfigOptions--;
556 return o;
557 }
558
559 checkConfigOptions(api.ConfigOptions o) {
560 buildCounterConfigOptions++;
561 if (buildCounterConfigOptions < 3) {
562 }
563 buildCounterConfigOptions--;
564 }
565
566 core.int buildCounterConfigRef = 0;
567 buildConfigRef() {
568 var o = new api.ConfigRef();
569 buildCounterConfigRef++;
570 if (buildCounterConfigRef < 3) {
571 o.name = "foo";
572 }
573 buildCounterConfigRef--;
574 return o;
575 }
576
577 checkConfigRef(api.ConfigRef o) {
578 buildCounterConfigRef++;
579 if (buildCounterConfigRef < 3) {
580 unittest.expect(o.name, unittest.equals('foo'));
581 }
582 buildCounterConfigRef--;
583 }
584
585 buildUnnamed3089() {
586 var o = new core.List<api.ConfigFile>();
587 o.add(buildConfigFile());
588 o.add(buildConfigFile());
589 return o;
590 }
591
592 checkUnnamed3089(core.List<api.ConfigFile> o) {
593 unittest.expect(o, unittest.hasLength(2));
594 checkConfigFile(o[0]);
595 checkConfigFile(o[1]);
596 }
597
598 core.int buildCounterConfigSource = 0;
599 buildConfigSource() {
600 var o = new api.ConfigSource();
601 buildCounterConfigSource++;
602 if (buildCounterConfigSource < 3) {
603 o.files = buildUnnamed3089();
604 o.id = "foo";
605 o.options = buildConfigOptions();
606 }
607 buildCounterConfigSource--;
608 return o;
609 }
610
611 checkConfigSource(api.ConfigSource o) {
612 buildCounterConfigSource++;
613 if (buildCounterConfigSource < 3) {
614 checkUnnamed3089(o.files);
615 unittest.expect(o.id, unittest.equals('foo'));
616 checkConfigOptions(o.options);
617 }
618 buildCounterConfigSource--;
619 }
620
621 buildUnnamed3090() {
622 var o = new core.List<api.ContextRule>();
623 o.add(buildContextRule());
624 o.add(buildContextRule());
625 return o;
626 }
627
628 checkUnnamed3090(core.List<api.ContextRule> o) {
629 unittest.expect(o, unittest.hasLength(2));
630 checkContextRule(o[0]);
631 checkContextRule(o[1]);
632 }
633
634 core.int buildCounterContext = 0;
635 buildContext() {
636 var o = new api.Context();
637 buildCounterContext++;
638 if (buildCounterContext < 3) {
639 o.rules = buildUnnamed3090();
640 }
641 buildCounterContext--;
642 return o;
643 }
644
645 checkContext(api.Context o) {
646 buildCounterContext++;
647 if (buildCounterContext < 3) {
648 checkUnnamed3090(o.rules);
649 }
650 buildCounterContext--;
651 }
652
653 buildUnnamed3091() {
654 var o = new core.List<core.String>();
655 o.add("foo");
656 o.add("foo");
657 return o;
658 }
659
660 checkUnnamed3091(core.List<core.String> o) {
661 unittest.expect(o, unittest.hasLength(2));
662 unittest.expect(o[0], unittest.equals('foo'));
663 unittest.expect(o[1], unittest.equals('foo'));
664 }
665
666 buildUnnamed3092() {
667 var o = new core.List<core.String>();
668 o.add("foo");
669 o.add("foo");
670 return o;
671 }
672
673 checkUnnamed3092(core.List<core.String> o) {
674 unittest.expect(o, unittest.hasLength(2));
675 unittest.expect(o[0], unittest.equals('foo'));
676 unittest.expect(o[1], unittest.equals('foo'));
677 }
678
679 core.int buildCounterContextRule = 0;
680 buildContextRule() {
681 var o = new api.ContextRule();
682 buildCounterContextRule++;
683 if (buildCounterContextRule < 3) {
684 o.provided = buildUnnamed3091();
685 o.requested = buildUnnamed3092();
686 o.selector = "foo";
687 }
688 buildCounterContextRule--;
689 return o;
690 }
691
692 checkContextRule(api.ContextRule o) {
693 buildCounterContextRule++;
694 if (buildCounterContextRule < 3) {
695 checkUnnamed3091(o.provided);
696 checkUnnamed3092(o.requested);
697 unittest.expect(o.selector, unittest.equals('foo'));
698 }
699 buildCounterContextRule--;
700 }
701
702 core.int buildCounterControl = 0;
703 buildControl() {
704 var o = new api.Control();
705 buildCounterControl++;
706 if (buildCounterControl < 3) {
707 o.environment = "foo";
708 }
709 buildCounterControl--;
710 return o;
711 }
712
713 checkControl(api.Control o) {
714 buildCounterControl++;
715 if (buildCounterControl < 3) {
716 unittest.expect(o.environment, unittest.equals('foo'));
717 }
718 buildCounterControl--;
719 }
720
721 core.int buildCounterCounterOptions = 0;
722 buildCounterOptions() {
723 var o = new api.CounterOptions();
724 buildCounterCounterOptions++;
725 if (buildCounterCounterOptions < 3) {
726 o.field = "foo";
727 o.metric = "foo";
728 }
729 buildCounterCounterOptions--;
730 return o;
731 }
732
733 checkCounterOptions(api.CounterOptions o) {
734 buildCounterCounterOptions++;
735 if (buildCounterCounterOptions < 3) {
736 unittest.expect(o.field, unittest.equals('foo'));
737 unittest.expect(o.metric, unittest.equals('foo'));
738 }
739 buildCounterCounterOptions--;
740 }
741
742 buildUnnamed3093() {
743 var o = new core.List<api.CustomErrorRule>();
744 o.add(buildCustomErrorRule());
745 o.add(buildCustomErrorRule());
746 return o;
747 }
748
749 checkUnnamed3093(core.List<api.CustomErrorRule> o) {
750 unittest.expect(o, unittest.hasLength(2));
751 checkCustomErrorRule(o[0]);
752 checkCustomErrorRule(o[1]);
753 }
754
755 buildUnnamed3094() {
756 var o = new core.List<core.String>();
757 o.add("foo");
758 o.add("foo");
759 return o;
760 }
761
762 checkUnnamed3094(core.List<core.String> o) {
763 unittest.expect(o, unittest.hasLength(2));
764 unittest.expect(o[0], unittest.equals('foo'));
765 unittest.expect(o[1], unittest.equals('foo'));
766 }
767
768 core.int buildCounterCustomError = 0;
769 buildCustomError() {
770 var o = new api.CustomError();
771 buildCounterCustomError++;
772 if (buildCounterCustomError < 3) {
773 o.rules = buildUnnamed3093();
774 o.types = buildUnnamed3094();
775 }
776 buildCounterCustomError--;
777 return o;
778 }
779
780 checkCustomError(api.CustomError o) {
781 buildCounterCustomError++;
782 if (buildCounterCustomError < 3) {
783 checkUnnamed3093(o.rules);
784 checkUnnamed3094(o.types);
785 }
786 buildCounterCustomError--;
787 }
788
789 core.int buildCounterCustomErrorRule = 0;
790 buildCustomErrorRule() {
791 var o = new api.CustomErrorRule();
792 buildCounterCustomErrorRule++;
793 if (buildCounterCustomErrorRule < 3) {
794 o.isErrorType = true;
795 o.selector = "foo";
796 }
797 buildCounterCustomErrorRule--;
798 return o;
799 }
800
801 checkCustomErrorRule(api.CustomErrorRule o) {
802 buildCounterCustomErrorRule++;
803 if (buildCounterCustomErrorRule < 3) {
804 unittest.expect(o.isErrorType, unittest.isTrue);
805 unittest.expect(o.selector, unittest.equals('foo'));
806 }
807 buildCounterCustomErrorRule--;
808 }
809
810 core.int buildCounterCustomHttpPattern = 0;
811 buildCustomHttpPattern() {
812 var o = new api.CustomHttpPattern();
813 buildCounterCustomHttpPattern++;
814 if (buildCounterCustomHttpPattern < 3) {
815 o.kind = "foo";
816 o.path = "foo";
817 }
818 buildCounterCustomHttpPattern--;
819 return o;
820 }
821
822 checkCustomHttpPattern(api.CustomHttpPattern o) {
823 buildCounterCustomHttpPattern++;
824 if (buildCounterCustomHttpPattern < 3) {
825 unittest.expect(o.kind, unittest.equals('foo'));
826 unittest.expect(o.path, unittest.equals('foo'));
827 }
828 buildCounterCustomHttpPattern--;
829 }
830
831 core.int buildCounterDataAccessOptions = 0;
832 buildDataAccessOptions() {
833 var o = new api.DataAccessOptions();
834 buildCounterDataAccessOptions++;
835 if (buildCounterDataAccessOptions < 3) {
836 }
837 buildCounterDataAccessOptions--;
838 return o;
839 }
840
841 checkDataAccessOptions(api.DataAccessOptions o) {
842 buildCounterDataAccessOptions++;
843 if (buildCounterDataAccessOptions < 3) {
844 }
845 buildCounterDataAccessOptions--;
846 }
847
848 core.int buildCounterDeleteServiceStrategy = 0;
849 buildDeleteServiceStrategy() {
850 var o = new api.DeleteServiceStrategy();
851 buildCounterDeleteServiceStrategy++;
852 if (buildCounterDeleteServiceStrategy < 3) {
853 }
854 buildCounterDeleteServiceStrategy--;
855 return o;
856 }
857
858 checkDeleteServiceStrategy(api.DeleteServiceStrategy o) {
859 buildCounterDeleteServiceStrategy++;
860 if (buildCounterDeleteServiceStrategy < 3) {
861 }
862 buildCounterDeleteServiceStrategy--;
863 }
864
865 core.int buildCounterDiagnostic = 0;
866 buildDiagnostic() {
867 var o = new api.Diagnostic();
868 buildCounterDiagnostic++;
869 if (buildCounterDiagnostic < 3) {
870 o.kind = "foo";
871 o.location = "foo";
872 o.message = "foo";
873 }
874 buildCounterDiagnostic--;
875 return o;
876 }
877
878 checkDiagnostic(api.Diagnostic o) {
879 buildCounterDiagnostic++;
880 if (buildCounterDiagnostic < 3) {
881 unittest.expect(o.kind, unittest.equals('foo'));
882 unittest.expect(o.location, unittest.equals('foo'));
883 unittest.expect(o.message, unittest.equals('foo'));
884 }
885 buildCounterDiagnostic--;
886 }
887
888 core.int buildCounterDisableServiceRequest = 0;
889 buildDisableServiceRequest() {
890 var o = new api.DisableServiceRequest();
891 buildCounterDisableServiceRequest++;
892 if (buildCounterDisableServiceRequest < 3) {
893 o.consumerId = "foo";
894 }
895 buildCounterDisableServiceRequest--;
896 return o;
897 }
898
899 checkDisableServiceRequest(api.DisableServiceRequest o) {
900 buildCounterDisableServiceRequest++;
901 if (buildCounterDisableServiceRequest < 3) {
902 unittest.expect(o.consumerId, unittest.equals('foo'));
903 }
904 buildCounterDisableServiceRequest--;
905 }
906
907 buildUnnamed3095() {
908 var o = new core.List<api.Page>();
909 o.add(buildPage());
910 o.add(buildPage());
911 return o;
912 }
913
914 checkUnnamed3095(core.List<api.Page> o) {
915 unittest.expect(o, unittest.hasLength(2));
916 checkPage(o[0]);
917 checkPage(o[1]);
918 }
919
920 buildUnnamed3096() {
921 var o = new core.List<api.DocumentationRule>();
922 o.add(buildDocumentationRule());
923 o.add(buildDocumentationRule());
924 return o;
925 }
926
927 checkUnnamed3096(core.List<api.DocumentationRule> o) {
928 unittest.expect(o, unittest.hasLength(2));
929 checkDocumentationRule(o[0]);
930 checkDocumentationRule(o[1]);
931 }
932
933 core.int buildCounterDocumentation = 0;
934 buildDocumentation() {
935 var o = new api.Documentation();
936 buildCounterDocumentation++;
937 if (buildCounterDocumentation < 3) {
938 o.documentationRootUrl = "foo";
939 o.overview = "foo";
940 o.pages = buildUnnamed3095();
941 o.rules = buildUnnamed3096();
942 o.summary = "foo";
943 }
944 buildCounterDocumentation--;
945 return o;
946 }
947
948 checkDocumentation(api.Documentation o) {
949 buildCounterDocumentation++;
950 if (buildCounterDocumentation < 3) {
951 unittest.expect(o.documentationRootUrl, unittest.equals('foo'));
952 unittest.expect(o.overview, unittest.equals('foo'));
953 checkUnnamed3095(o.pages);
954 checkUnnamed3096(o.rules);
955 unittest.expect(o.summary, unittest.equals('foo'));
956 }
957 buildCounterDocumentation--;
958 }
959
960 core.int buildCounterDocumentationRule = 0;
961 buildDocumentationRule() {
962 var o = new api.DocumentationRule();
963 buildCounterDocumentationRule++;
964 if (buildCounterDocumentationRule < 3) {
965 o.deprecationDescription = "foo";
966 o.description = "foo";
967 o.selector = "foo";
968 }
969 buildCounterDocumentationRule--;
970 return o;
971 }
972
973 checkDocumentationRule(api.DocumentationRule o) {
974 buildCounterDocumentationRule++;
975 if (buildCounterDocumentationRule < 3) {
976 unittest.expect(o.deprecationDescription, unittest.equals('foo'));
977 unittest.expect(o.description, unittest.equals('foo'));
978 unittest.expect(o.selector, unittest.equals('foo'));
979 }
980 buildCounterDocumentationRule--;
981 }
982
983 core.int buildCounterEnableServiceRequest = 0;
984 buildEnableServiceRequest() {
985 var o = new api.EnableServiceRequest();
986 buildCounterEnableServiceRequest++;
987 if (buildCounterEnableServiceRequest < 3) {
988 o.consumerId = "foo";
989 }
990 buildCounterEnableServiceRequest--;
991 return o;
992 }
993
994 checkEnableServiceRequest(api.EnableServiceRequest o) {
995 buildCounterEnableServiceRequest++;
996 if (buildCounterEnableServiceRequest < 3) {
997 unittest.expect(o.consumerId, unittest.equals('foo'));
998 }
999 buildCounterEnableServiceRequest--;
1000 }
1001
1002 buildUnnamed3097() {
1003 var o = new core.List<api.EnumValue>();
1004 o.add(buildEnumValue());
1005 o.add(buildEnumValue());
1006 return o;
1007 }
1008
1009 checkUnnamed3097(core.List<api.EnumValue> o) {
1010 unittest.expect(o, unittest.hasLength(2));
1011 checkEnumValue(o[0]);
1012 checkEnumValue(o[1]);
1013 }
1014
1015 buildUnnamed3098() {
1016 var o = new core.List<api.Option>();
1017 o.add(buildOption());
1018 o.add(buildOption());
1019 return o;
1020 }
1021
1022 checkUnnamed3098(core.List<api.Option> o) {
1023 unittest.expect(o, unittest.hasLength(2));
1024 checkOption(o[0]);
1025 checkOption(o[1]);
1026 }
1027
1028 core.int buildCounterEnum = 0;
1029 buildEnum() {
1030 var o = new api.Enum();
1031 buildCounterEnum++;
1032 if (buildCounterEnum < 3) {
1033 o.enumvalue = buildUnnamed3097();
1034 o.name = "foo";
1035 o.options = buildUnnamed3098();
1036 o.sourceContext = buildSourceContext();
1037 o.syntax = "foo";
1038 }
1039 buildCounterEnum--;
1040 return o;
1041 }
1042
1043 checkEnum(api.Enum o) {
1044 buildCounterEnum++;
1045 if (buildCounterEnum < 3) {
1046 checkUnnamed3097(o.enumvalue);
1047 unittest.expect(o.name, unittest.equals('foo'));
1048 checkUnnamed3098(o.options);
1049 checkSourceContext(o.sourceContext);
1050 unittest.expect(o.syntax, unittest.equals('foo'));
1051 }
1052 buildCounterEnum--;
1053 }
1054
1055 buildUnnamed3099() {
1056 var o = new core.List<api.Option>();
1057 o.add(buildOption());
1058 o.add(buildOption());
1059 return o;
1060 }
1061
1062 checkUnnamed3099(core.List<api.Option> o) {
1063 unittest.expect(o, unittest.hasLength(2));
1064 checkOption(o[0]);
1065 checkOption(o[1]);
1066 }
1067
1068 core.int buildCounterEnumValue = 0;
1069 buildEnumValue() {
1070 var o = new api.EnumValue();
1071 buildCounterEnumValue++;
1072 if (buildCounterEnumValue < 3) {
1073 o.name = "foo";
1074 o.number = 42;
1075 o.options = buildUnnamed3099();
1076 }
1077 buildCounterEnumValue--;
1078 return o;
1079 }
1080
1081 checkEnumValue(api.EnumValue o) {
1082 buildCounterEnumValue++;
1083 if (buildCounterEnumValue < 3) {
1084 unittest.expect(o.name, unittest.equals('foo'));
1085 unittest.expect(o.number, unittest.equals(42));
1086 checkUnnamed3099(o.options);
1087 }
1088 buildCounterEnumValue--;
1089 }
1090
1091 buildUnnamed3100() {
1092 var o = new core.List<api.Option>();
1093 o.add(buildOption());
1094 o.add(buildOption());
1095 return o;
1096 }
1097
1098 checkUnnamed3100(core.List<api.Option> o) {
1099 unittest.expect(o, unittest.hasLength(2));
1100 checkOption(o[0]);
1101 checkOption(o[1]);
1102 }
1103
1104 core.int buildCounterField = 0;
1105 buildField() {
1106 var o = new api.Field();
1107 buildCounterField++;
1108 if (buildCounterField < 3) {
1109 o.cardinality = "foo";
1110 o.defaultValue = "foo";
1111 o.jsonName = "foo";
1112 o.kind = "foo";
1113 o.name = "foo";
1114 o.number = 42;
1115 o.oneofIndex = 42;
1116 o.options = buildUnnamed3100();
1117 o.packed = true;
1118 o.typeUrl = "foo";
1119 }
1120 buildCounterField--;
1121 return o;
1122 }
1123
1124 checkField(api.Field o) {
1125 buildCounterField++;
1126 if (buildCounterField < 3) {
1127 unittest.expect(o.cardinality, unittest.equals('foo'));
1128 unittest.expect(o.defaultValue, unittest.equals('foo'));
1129 unittest.expect(o.jsonName, unittest.equals('foo'));
1130 unittest.expect(o.kind, unittest.equals('foo'));
1131 unittest.expect(o.name, unittest.equals('foo'));
1132 unittest.expect(o.number, unittest.equals(42));
1133 unittest.expect(o.oneofIndex, unittest.equals(42));
1134 checkUnnamed3100(o.options);
1135 unittest.expect(o.packed, unittest.isTrue);
1136 unittest.expect(o.typeUrl, unittest.equals('foo'));
1137 }
1138 buildCounterField--;
1139 }
1140
1141 buildUnnamed3101() {
1142 var o = new core.Map<core.String, core.Object>();
1143 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
1144 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
1145 return o;
1146 }
1147
1148 checkUnnamed3101(core.Map<core.String, core.Object> o) {
1149 unittest.expect(o, unittest.hasLength(2));
1150 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'));
1151 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'));
1152 }
1153
1154 buildUnnamed3102() {
1155 var o = new core.Map<core.String, core.Object>();
1156 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
1157 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
1158 return o;
1159 }
1160
1161 checkUnnamed3102(core.Map<core.String, core.Object> o) {
1162 unittest.expect(o, unittest.hasLength(2));
1163 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'));
1164 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'));
1165 }
1166
1167 core.int buildCounterGenerateConfigReportRequest = 0;
1168 buildGenerateConfigReportRequest() {
1169 var o = new api.GenerateConfigReportRequest();
1170 buildCounterGenerateConfigReportRequest++;
1171 if (buildCounterGenerateConfigReportRequest < 3) {
1172 o.newConfig = buildUnnamed3101();
1173 o.oldConfig = buildUnnamed3102();
1174 }
1175 buildCounterGenerateConfigReportRequest--;
1176 return o;
1177 }
1178
1179 checkGenerateConfigReportRequest(api.GenerateConfigReportRequest o) {
1180 buildCounterGenerateConfigReportRequest++;
1181 if (buildCounterGenerateConfigReportRequest < 3) {
1182 checkUnnamed3101(o.newConfig);
1183 checkUnnamed3102(o.oldConfig);
1184 }
1185 buildCounterGenerateConfigReportRequest--;
1186 }
1187
1188 buildUnnamed3103() {
1189 var o = new core.List<api.ChangeReport>();
1190 o.add(buildChangeReport());
1191 o.add(buildChangeReport());
1192 return o;
1193 }
1194
1195 checkUnnamed3103(core.List<api.ChangeReport> o) {
1196 unittest.expect(o, unittest.hasLength(2));
1197 checkChangeReport(o[0]);
1198 checkChangeReport(o[1]);
1199 }
1200
1201 buildUnnamed3104() {
1202 var o = new core.List<api.Diagnostic>();
1203 o.add(buildDiagnostic());
1204 o.add(buildDiagnostic());
1205 return o;
1206 }
1207
1208 checkUnnamed3104(core.List<api.Diagnostic> o) {
1209 unittest.expect(o, unittest.hasLength(2));
1210 checkDiagnostic(o[0]);
1211 checkDiagnostic(o[1]);
1212 }
1213
1214 core.int buildCounterGenerateConfigReportResponse = 0;
1215 buildGenerateConfigReportResponse() {
1216 var o = new api.GenerateConfigReportResponse();
1217 buildCounterGenerateConfigReportResponse++;
1218 if (buildCounterGenerateConfigReportResponse < 3) {
1219 o.changeReports = buildUnnamed3103();
1220 o.diagnostics = buildUnnamed3104();
1221 o.id = "foo";
1222 o.serviceName = "foo";
1223 }
1224 buildCounterGenerateConfigReportResponse--;
1225 return o;
1226 }
1227
1228 checkGenerateConfigReportResponse(api.GenerateConfigReportResponse o) {
1229 buildCounterGenerateConfigReportResponse++;
1230 if (buildCounterGenerateConfigReportResponse < 3) {
1231 checkUnnamed3103(o.changeReports);
1232 checkUnnamed3104(o.diagnostics);
1233 unittest.expect(o.id, unittest.equals('foo'));
1234 unittest.expect(o.serviceName, unittest.equals('foo'));
1235 }
1236 buildCounterGenerateConfigReportResponse--;
1237 }
1238
1239 core.int buildCounterGetIamPolicyRequest = 0;
1240 buildGetIamPolicyRequest() {
1241 var o = new api.GetIamPolicyRequest();
1242 buildCounterGetIamPolicyRequest++;
1243 if (buildCounterGetIamPolicyRequest < 3) {
1244 }
1245 buildCounterGetIamPolicyRequest--;
1246 return o;
1247 }
1248
1249 checkGetIamPolicyRequest(api.GetIamPolicyRequest o) {
1250 buildCounterGetIamPolicyRequest++;
1251 if (buildCounterGetIamPolicyRequest < 3) {
1252 }
1253 buildCounterGetIamPolicyRequest--;
1254 }
1255
1256 buildUnnamed3105() {
1257 var o = new core.List<api.HttpRule>();
1258 o.add(buildHttpRule());
1259 o.add(buildHttpRule());
1260 return o;
1261 }
1262
1263 checkUnnamed3105(core.List<api.HttpRule> o) {
1264 unittest.expect(o, unittest.hasLength(2));
1265 checkHttpRule(o[0]);
1266 checkHttpRule(o[1]);
1267 }
1268
1269 core.int buildCounterHttp = 0;
1270 buildHttp() {
1271 var o = new api.Http();
1272 buildCounterHttp++;
1273 if (buildCounterHttp < 3) {
1274 o.rules = buildUnnamed3105();
1275 }
1276 buildCounterHttp--;
1277 return o;
1278 }
1279
1280 checkHttp(api.Http o) {
1281 buildCounterHttp++;
1282 if (buildCounterHttp < 3) {
1283 checkUnnamed3105(o.rules);
1284 }
1285 buildCounterHttp--;
1286 }
1287
1288 buildUnnamed3106() {
1289 var o = new core.List<api.HttpRule>();
1290 o.add(buildHttpRule());
1291 o.add(buildHttpRule());
1292 return o;
1293 }
1294
1295 checkUnnamed3106(core.List<api.HttpRule> o) {
1296 unittest.expect(o, unittest.hasLength(2));
1297 checkHttpRule(o[0]);
1298 checkHttpRule(o[1]);
1299 }
1300
1301 core.int buildCounterHttpRule = 0;
1302 buildHttpRule() {
1303 var o = new api.HttpRule();
1304 buildCounterHttpRule++;
1305 if (buildCounterHttpRule < 3) {
1306 o.additionalBindings = buildUnnamed3106();
1307 o.body = "foo";
1308 o.custom = buildCustomHttpPattern();
1309 o.delete = "foo";
1310 o.get = "foo";
1311 o.mediaDownload = buildMediaDownload();
1312 o.mediaUpload = buildMediaUpload();
1313 o.patch = "foo";
1314 o.post = "foo";
1315 o.put = "foo";
1316 o.responseBody = "foo";
1317 o.selector = "foo";
1318 }
1319 buildCounterHttpRule--;
1320 return o;
1321 }
1322
1323 checkHttpRule(api.HttpRule o) {
1324 buildCounterHttpRule++;
1325 if (buildCounterHttpRule < 3) {
1326 checkUnnamed3106(o.additionalBindings);
1327 unittest.expect(o.body, unittest.equals('foo'));
1328 checkCustomHttpPattern(o.custom);
1329 unittest.expect(o.delete, unittest.equals('foo'));
1330 unittest.expect(o.get, unittest.equals('foo'));
1331 checkMediaDownload(o.mediaDownload);
1332 checkMediaUpload(o.mediaUpload);
1333 unittest.expect(o.patch, unittest.equals('foo'));
1334 unittest.expect(o.post, unittest.equals('foo'));
1335 unittest.expect(o.put, unittest.equals('foo'));
1336 unittest.expect(o.responseBody, unittest.equals('foo'));
1337 unittest.expect(o.selector, unittest.equals('foo'));
1338 }
1339 buildCounterHttpRule--;
1340 }
1341
1342 core.int buildCounterLabelDescriptor = 0;
1343 buildLabelDescriptor() {
1344 var o = new api.LabelDescriptor();
1345 buildCounterLabelDescriptor++;
1346 if (buildCounterLabelDescriptor < 3) {
1347 o.description = "foo";
1348 o.key = "foo";
1349 o.valueType = "foo";
1350 }
1351 buildCounterLabelDescriptor--;
1352 return o;
1353 }
1354
1355 checkLabelDescriptor(api.LabelDescriptor o) {
1356 buildCounterLabelDescriptor++;
1357 if (buildCounterLabelDescriptor < 3) {
1358 unittest.expect(o.description, unittest.equals('foo'));
1359 unittest.expect(o.key, unittest.equals('foo'));
1360 unittest.expect(o.valueType, unittest.equals('foo'));
1361 }
1362 buildCounterLabelDescriptor--;
1363 }
1364
1365 buildUnnamed3107() {
1366 var o = new core.List<api.Service>();
1367 o.add(buildService());
1368 o.add(buildService());
1369 return o;
1370 }
1371
1372 checkUnnamed3107(core.List<api.Service> o) {
1373 unittest.expect(o, unittest.hasLength(2));
1374 checkService(o[0]);
1375 checkService(o[1]);
1376 }
1377
1378 core.int buildCounterListServiceConfigsResponse = 0;
1379 buildListServiceConfigsResponse() {
1380 var o = new api.ListServiceConfigsResponse();
1381 buildCounterListServiceConfigsResponse++;
1382 if (buildCounterListServiceConfigsResponse < 3) {
1383 o.nextPageToken = "foo";
1384 o.serviceConfigs = buildUnnamed3107();
1385 }
1386 buildCounterListServiceConfigsResponse--;
1387 return o;
1388 }
1389
1390 checkListServiceConfigsResponse(api.ListServiceConfigsResponse o) {
1391 buildCounterListServiceConfigsResponse++;
1392 if (buildCounterListServiceConfigsResponse < 3) {
1393 unittest.expect(o.nextPageToken, unittest.equals('foo'));
1394 checkUnnamed3107(o.serviceConfigs);
1395 }
1396 buildCounterListServiceConfigsResponse--;
1397 }
1398
1399 buildUnnamed3108() {
1400 var o = new core.List<api.Rollout>();
1401 o.add(buildRollout());
1402 o.add(buildRollout());
1403 return o;
1404 }
1405
1406 checkUnnamed3108(core.List<api.Rollout> o) {
1407 unittest.expect(o, unittest.hasLength(2));
1408 checkRollout(o[0]);
1409 checkRollout(o[1]);
1410 }
1411
1412 core.int buildCounterListServiceRolloutsResponse = 0;
1413 buildListServiceRolloutsResponse() {
1414 var o = new api.ListServiceRolloutsResponse();
1415 buildCounterListServiceRolloutsResponse++;
1416 if (buildCounterListServiceRolloutsResponse < 3) {
1417 o.nextPageToken = "foo";
1418 o.rollouts = buildUnnamed3108();
1419 }
1420 buildCounterListServiceRolloutsResponse--;
1421 return o;
1422 }
1423
1424 checkListServiceRolloutsResponse(api.ListServiceRolloutsResponse o) {
1425 buildCounterListServiceRolloutsResponse++;
1426 if (buildCounterListServiceRolloutsResponse < 3) {
1427 unittest.expect(o.nextPageToken, unittest.equals('foo'));
1428 checkUnnamed3108(o.rollouts);
1429 }
1430 buildCounterListServiceRolloutsResponse--;
1431 }
1432
1433 buildUnnamed3109() {
1434 var o = new core.List<api.ManagedService>();
1435 o.add(buildManagedService());
1436 o.add(buildManagedService());
1437 return o;
1438 }
1439
1440 checkUnnamed3109(core.List<api.ManagedService> o) {
1441 unittest.expect(o, unittest.hasLength(2));
1442 checkManagedService(o[0]);
1443 checkManagedService(o[1]);
1444 }
1445
1446 core.int buildCounterListServicesResponse = 0;
1447 buildListServicesResponse() {
1448 var o = new api.ListServicesResponse();
1449 buildCounterListServicesResponse++;
1450 if (buildCounterListServicesResponse < 3) {
1451 o.nextPageToken = "foo";
1452 o.services = buildUnnamed3109();
1453 }
1454 buildCounterListServicesResponse--;
1455 return o;
1456 }
1457
1458 checkListServicesResponse(api.ListServicesResponse o) {
1459 buildCounterListServicesResponse++;
1460 if (buildCounterListServicesResponse < 3) {
1461 unittest.expect(o.nextPageToken, unittest.equals('foo'));
1462 checkUnnamed3109(o.services);
1463 }
1464 buildCounterListServicesResponse--;
1465 }
1466
1467 core.int buildCounterLogConfig = 0;
1468 buildLogConfig() {
1469 var o = new api.LogConfig();
1470 buildCounterLogConfig++;
1471 if (buildCounterLogConfig < 3) {
1472 o.cloudAudit = buildCloudAuditOptions();
1473 o.counter = buildCounterOptions();
1474 o.dataAccess = buildDataAccessOptions();
1475 }
1476 buildCounterLogConfig--;
1477 return o;
1478 }
1479
1480 checkLogConfig(api.LogConfig o) {
1481 buildCounterLogConfig++;
1482 if (buildCounterLogConfig < 3) {
1483 checkCloudAuditOptions(o.cloudAudit);
1484 checkCounterOptions(o.counter);
1485 checkDataAccessOptions(o.dataAccess);
1486 }
1487 buildCounterLogConfig--;
1488 }
1489
1490 buildUnnamed3110() {
1491 var o = new core.List<api.LabelDescriptor>();
1492 o.add(buildLabelDescriptor());
1493 o.add(buildLabelDescriptor());
1494 return o;
1495 }
1496
1497 checkUnnamed3110(core.List<api.LabelDescriptor> o) {
1498 unittest.expect(o, unittest.hasLength(2));
1499 checkLabelDescriptor(o[0]);
1500 checkLabelDescriptor(o[1]);
1501 }
1502
1503 core.int buildCounterLogDescriptor = 0;
1504 buildLogDescriptor() {
1505 var o = new api.LogDescriptor();
1506 buildCounterLogDescriptor++;
1507 if (buildCounterLogDescriptor < 3) {
1508 o.description = "foo";
1509 o.displayName = "foo";
1510 o.labels = buildUnnamed3110();
1511 o.name = "foo";
1512 }
1513 buildCounterLogDescriptor--;
1514 return o;
1515 }
1516
1517 checkLogDescriptor(api.LogDescriptor o) {
1518 buildCounterLogDescriptor++;
1519 if (buildCounterLogDescriptor < 3) {
1520 unittest.expect(o.description, unittest.equals('foo'));
1521 unittest.expect(o.displayName, unittest.equals('foo'));
1522 checkUnnamed3110(o.labels);
1523 unittest.expect(o.name, unittest.equals('foo'));
1524 }
1525 buildCounterLogDescriptor--;
1526 }
1527
1528 buildUnnamed3111() {
1529 var o = new core.List<api.LoggingDestination>();
1530 o.add(buildLoggingDestination());
1531 o.add(buildLoggingDestination());
1532 return o;
1533 }
1534
1535 checkUnnamed3111(core.List<api.LoggingDestination> o) {
1536 unittest.expect(o, unittest.hasLength(2));
1537 checkLoggingDestination(o[0]);
1538 checkLoggingDestination(o[1]);
1539 }
1540
1541 buildUnnamed3112() {
1542 var o = new core.List<api.LoggingDestination>();
1543 o.add(buildLoggingDestination());
1544 o.add(buildLoggingDestination());
1545 return o;
1546 }
1547
1548 checkUnnamed3112(core.List<api.LoggingDestination> o) {
1549 unittest.expect(o, unittest.hasLength(2));
1550 checkLoggingDestination(o[0]);
1551 checkLoggingDestination(o[1]);
1552 }
1553
1554 core.int buildCounterLogging = 0;
1555 buildLogging() {
1556 var o = new api.Logging();
1557 buildCounterLogging++;
1558 if (buildCounterLogging < 3) {
1559 o.consumerDestinations = buildUnnamed3111();
1560 o.producerDestinations = buildUnnamed3112();
1561 }
1562 buildCounterLogging--;
1563 return o;
1564 }
1565
1566 checkLogging(api.Logging o) {
1567 buildCounterLogging++;
1568 if (buildCounterLogging < 3) {
1569 checkUnnamed3111(o.consumerDestinations);
1570 checkUnnamed3112(o.producerDestinations);
1571 }
1572 buildCounterLogging--;
1573 }
1574
1575 buildUnnamed3113() {
1576 var o = new core.List<core.String>();
1577 o.add("foo");
1578 o.add("foo");
1579 return o;
1580 }
1581
1582 checkUnnamed3113(core.List<core.String> o) {
1583 unittest.expect(o, unittest.hasLength(2));
1584 unittest.expect(o[0], unittest.equals('foo'));
1585 unittest.expect(o[1], unittest.equals('foo'));
1586 }
1587
1588 core.int buildCounterLoggingDestination = 0;
1589 buildLoggingDestination() {
1590 var o = new api.LoggingDestination();
1591 buildCounterLoggingDestination++;
1592 if (buildCounterLoggingDestination < 3) {
1593 o.logs = buildUnnamed3113();
1594 o.monitoredResource = "foo";
1595 }
1596 buildCounterLoggingDestination--;
1597 return o;
1598 }
1599
1600 checkLoggingDestination(api.LoggingDestination o) {
1601 buildCounterLoggingDestination++;
1602 if (buildCounterLoggingDestination < 3) {
1603 checkUnnamed3113(o.logs);
1604 unittest.expect(o.monitoredResource, unittest.equals('foo'));
1605 }
1606 buildCounterLoggingDestination--;
1607 }
1608
1609 core.int buildCounterManagedService = 0;
1610 buildManagedService() {
1611 var o = new api.ManagedService();
1612 buildCounterManagedService++;
1613 if (buildCounterManagedService < 3) {
1614 o.producerProjectId = "foo";
1615 o.serviceName = "foo";
1616 }
1617 buildCounterManagedService--;
1618 return o;
1619 }
1620
1621 checkManagedService(api.ManagedService o) {
1622 buildCounterManagedService++;
1623 if (buildCounterManagedService < 3) {
1624 unittest.expect(o.producerProjectId, unittest.equals('foo'));
1625 unittest.expect(o.serviceName, unittest.equals('foo'));
1626 }
1627 buildCounterManagedService--;
1628 }
1629
1630 core.int buildCounterMediaDownload = 0;
1631 buildMediaDownload() {
1632 var o = new api.MediaDownload();
1633 buildCounterMediaDownload++;
1634 if (buildCounterMediaDownload < 3) {
1635 o.enabled = true;
1636 }
1637 buildCounterMediaDownload--;
1638 return o;
1639 }
1640
1641 checkMediaDownload(api.MediaDownload o) {
1642 buildCounterMediaDownload++;
1643 if (buildCounterMediaDownload < 3) {
1644 unittest.expect(o.enabled, unittest.isTrue);
1645 }
1646 buildCounterMediaDownload--;
1647 }
1648
1649 core.int buildCounterMediaUpload = 0;
1650 buildMediaUpload() {
1651 var o = new api.MediaUpload();
1652 buildCounterMediaUpload++;
1653 if (buildCounterMediaUpload < 3) {
1654 o.enabled = true;
1655 }
1656 buildCounterMediaUpload--;
1657 return o;
1658 }
1659
1660 checkMediaUpload(api.MediaUpload o) {
1661 buildCounterMediaUpload++;
1662 if (buildCounterMediaUpload < 3) {
1663 unittest.expect(o.enabled, unittest.isTrue);
1664 }
1665 buildCounterMediaUpload--;
1666 }
1667
1668 buildUnnamed3114() {
1669 var o = new core.List<api.Option>();
1670 o.add(buildOption());
1671 o.add(buildOption());
1672 return o;
1673 }
1674
1675 checkUnnamed3114(core.List<api.Option> o) {
1676 unittest.expect(o, unittest.hasLength(2));
1677 checkOption(o[0]);
1678 checkOption(o[1]);
1679 }
1680
1681 core.int buildCounterMethod = 0;
1682 buildMethod() {
1683 var o = new api.Method();
1684 buildCounterMethod++;
1685 if (buildCounterMethod < 3) {
1686 o.name = "foo";
1687 o.options = buildUnnamed3114();
1688 o.requestStreaming = true;
1689 o.requestTypeUrl = "foo";
1690 o.responseStreaming = true;
1691 o.responseTypeUrl = "foo";
1692 o.syntax = "foo";
1693 }
1694 buildCounterMethod--;
1695 return o;
1696 }
1697
1698 checkMethod(api.Method o) {
1699 buildCounterMethod++;
1700 if (buildCounterMethod < 3) {
1701 unittest.expect(o.name, unittest.equals('foo'));
1702 checkUnnamed3114(o.options);
1703 unittest.expect(o.requestStreaming, unittest.isTrue);
1704 unittest.expect(o.requestTypeUrl, unittest.equals('foo'));
1705 unittest.expect(o.responseStreaming, unittest.isTrue);
1706 unittest.expect(o.responseTypeUrl, unittest.equals('foo'));
1707 unittest.expect(o.syntax, unittest.equals('foo'));
1708 }
1709 buildCounterMethod--;
1710 }
1711
1712 buildUnnamed3115() {
1713 var o = new core.List<api.LabelDescriptor>();
1714 o.add(buildLabelDescriptor());
1715 o.add(buildLabelDescriptor());
1716 return o;
1717 }
1718
1719 checkUnnamed3115(core.List<api.LabelDescriptor> o) {
1720 unittest.expect(o, unittest.hasLength(2));
1721 checkLabelDescriptor(o[0]);
1722 checkLabelDescriptor(o[1]);
1723 }
1724
1725 core.int buildCounterMetricDescriptor = 0;
1726 buildMetricDescriptor() {
1727 var o = new api.MetricDescriptor();
1728 buildCounterMetricDescriptor++;
1729 if (buildCounterMetricDescriptor < 3) {
1730 o.description = "foo";
1731 o.displayName = "foo";
1732 o.labels = buildUnnamed3115();
1733 o.metricKind = "foo";
1734 o.name = "foo";
1735 o.type = "foo";
1736 o.unit = "foo";
1737 o.valueType = "foo";
1738 }
1739 buildCounterMetricDescriptor--;
1740 return o;
1741 }
1742
1743 checkMetricDescriptor(api.MetricDescriptor o) {
1744 buildCounterMetricDescriptor++;
1745 if (buildCounterMetricDescriptor < 3) {
1746 unittest.expect(o.description, unittest.equals('foo'));
1747 unittest.expect(o.displayName, unittest.equals('foo'));
1748 checkUnnamed3115(o.labels);
1749 unittest.expect(o.metricKind, unittest.equals('foo'));
1750 unittest.expect(o.name, unittest.equals('foo'));
1751 unittest.expect(o.type, unittest.equals('foo'));
1752 unittest.expect(o.unit, unittest.equals('foo'));
1753 unittest.expect(o.valueType, unittest.equals('foo'));
1754 }
1755 buildCounterMetricDescriptor--;
1756 }
1757
1758 core.int buildCounterMixin = 0;
1759 buildMixin() {
1760 var o = new api.Mixin();
1761 buildCounterMixin++;
1762 if (buildCounterMixin < 3) {
1763 o.name = "foo";
1764 o.root = "foo";
1765 }
1766 buildCounterMixin--;
1767 return o;
1768 }
1769
1770 checkMixin(api.Mixin o) {
1771 buildCounterMixin++;
1772 if (buildCounterMixin < 3) {
1773 unittest.expect(o.name, unittest.equals('foo'));
1774 unittest.expect(o.root, unittest.equals('foo'));
1775 }
1776 buildCounterMixin--;
1777 }
1778
1779 buildUnnamed3116() {
1780 var o = new core.List<api.LabelDescriptor>();
1781 o.add(buildLabelDescriptor());
1782 o.add(buildLabelDescriptor());
1783 return o;
1784 }
1785
1786 checkUnnamed3116(core.List<api.LabelDescriptor> o) {
1787 unittest.expect(o, unittest.hasLength(2));
1788 checkLabelDescriptor(o[0]);
1789 checkLabelDescriptor(o[1]);
1790 }
1791
1792 core.int buildCounterMonitoredResourceDescriptor = 0;
1793 buildMonitoredResourceDescriptor() {
1794 var o = new api.MonitoredResourceDescriptor();
1795 buildCounterMonitoredResourceDescriptor++;
1796 if (buildCounterMonitoredResourceDescriptor < 3) {
1797 o.description = "foo";
1798 o.displayName = "foo";
1799 o.labels = buildUnnamed3116();
1800 o.name = "foo";
1801 o.type = "foo";
1802 }
1803 buildCounterMonitoredResourceDescriptor--;
1804 return o;
1805 }
1806
1807 checkMonitoredResourceDescriptor(api.MonitoredResourceDescriptor o) {
1808 buildCounterMonitoredResourceDescriptor++;
1809 if (buildCounterMonitoredResourceDescriptor < 3) {
1810 unittest.expect(o.description, unittest.equals('foo'));
1811 unittest.expect(o.displayName, unittest.equals('foo'));
1812 checkUnnamed3116(o.labels);
1813 unittest.expect(o.name, unittest.equals('foo'));
1814 unittest.expect(o.type, unittest.equals('foo'));
1815 }
1816 buildCounterMonitoredResourceDescriptor--;
1817 }
1818
1819 buildUnnamed3117() {
1820 var o = new core.List<api.MonitoringDestination>();
1821 o.add(buildMonitoringDestination());
1822 o.add(buildMonitoringDestination());
1823 return o;
1824 }
1825
1826 checkUnnamed3117(core.List<api.MonitoringDestination> o) {
1827 unittest.expect(o, unittest.hasLength(2));
1828 checkMonitoringDestination(o[0]);
1829 checkMonitoringDestination(o[1]);
1830 }
1831
1832 buildUnnamed3118() {
1833 var o = new core.List<api.MonitoringDestination>();
1834 o.add(buildMonitoringDestination());
1835 o.add(buildMonitoringDestination());
1836 return o;
1837 }
1838
1839 checkUnnamed3118(core.List<api.MonitoringDestination> o) {
1840 unittest.expect(o, unittest.hasLength(2));
1841 checkMonitoringDestination(o[0]);
1842 checkMonitoringDestination(o[1]);
1843 }
1844
1845 core.int buildCounterMonitoring = 0;
1846 buildMonitoring() {
1847 var o = new api.Monitoring();
1848 buildCounterMonitoring++;
1849 if (buildCounterMonitoring < 3) {
1850 o.consumerDestinations = buildUnnamed3117();
1851 o.producerDestinations = buildUnnamed3118();
1852 }
1853 buildCounterMonitoring--;
1854 return o;
1855 }
1856
1857 checkMonitoring(api.Monitoring o) {
1858 buildCounterMonitoring++;
1859 if (buildCounterMonitoring < 3) {
1860 checkUnnamed3117(o.consumerDestinations);
1861 checkUnnamed3118(o.producerDestinations);
1862 }
1863 buildCounterMonitoring--;
1864 }
1865
1866 buildUnnamed3119() {
1867 var o = new core.List<core.String>();
1868 o.add("foo");
1869 o.add("foo");
1870 return o;
1871 }
1872
1873 checkUnnamed3119(core.List<core.String> o) {
1874 unittest.expect(o, unittest.hasLength(2));
1875 unittest.expect(o[0], unittest.equals('foo'));
1876 unittest.expect(o[1], unittest.equals('foo'));
1877 }
1878
1879 core.int buildCounterMonitoringDestination = 0;
1880 buildMonitoringDestination() {
1881 var o = new api.MonitoringDestination();
1882 buildCounterMonitoringDestination++;
1883 if (buildCounterMonitoringDestination < 3) {
1884 o.metrics = buildUnnamed3119();
1885 o.monitoredResource = "foo";
1886 }
1887 buildCounterMonitoringDestination--;
1888 return o;
1889 }
1890
1891 checkMonitoringDestination(api.MonitoringDestination o) {
1892 buildCounterMonitoringDestination++;
1893 if (buildCounterMonitoringDestination < 3) {
1894 checkUnnamed3119(o.metrics);
1895 unittest.expect(o.monitoredResource, unittest.equals('foo'));
1896 }
1897 buildCounterMonitoringDestination--;
1898 }
1899
1900 core.int buildCounterOAuthRequirements = 0;
1901 buildOAuthRequirements() {
1902 var o = new api.OAuthRequirements();
1903 buildCounterOAuthRequirements++;
1904 if (buildCounterOAuthRequirements < 3) {
1905 o.canonicalScopes = "foo";
1906 }
1907 buildCounterOAuthRequirements--;
1908 return o;
1909 }
1910
1911 checkOAuthRequirements(api.OAuthRequirements o) {
1912 buildCounterOAuthRequirements++;
1913 if (buildCounterOAuthRequirements < 3) {
1914 unittest.expect(o.canonicalScopes, unittest.equals('foo'));
1915 }
1916 buildCounterOAuthRequirements--;
1917 }
1918
1919 buildUnnamed3120() {
1920 var o = new core.Map<core.String, core.Object>();
1921 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
1922 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
1923 return o;
1924 }
1925
1926 checkUnnamed3120(core.Map<core.String, core.Object> o) {
1927 unittest.expect(o, unittest.hasLength(2));
1928 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'));
1929 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'));
1930 }
1931
1932 buildUnnamed3121() {
1933 var o = new core.Map<core.String, core.Object>();
1934 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
1935 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
1936 return o;
1937 }
1938
1939 checkUnnamed3121(core.Map<core.String, core.Object> o) {
1940 unittest.expect(o, unittest.hasLength(2));
1941 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'));
1942 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'));
1943 }
1944
1945 core.int buildCounterOperation = 0;
1946 buildOperation() {
1947 var o = new api.Operation();
1948 buildCounterOperation++;
1949 if (buildCounterOperation < 3) {
1950 o.done = true;
1951 o.error = buildStatus();
1952 o.metadata = buildUnnamed3120();
1953 o.name = "foo";
1954 o.response = buildUnnamed3121();
1955 }
1956 buildCounterOperation--;
1957 return o;
1958 }
1959
1960 checkOperation(api.Operation o) {
1961 buildCounterOperation++;
1962 if (buildCounterOperation < 3) {
1963 unittest.expect(o.done, unittest.isTrue);
1964 checkStatus(o.error);
1965 checkUnnamed3120(o.metadata);
1966 unittest.expect(o.name, unittest.equals('foo'));
1967 checkUnnamed3121(o.response);
1968 }
1969 buildCounterOperation--;
1970 }
1971
1972 buildUnnamed3122() {
1973 var o = new core.List<core.String>();
1974 o.add("foo");
1975 o.add("foo");
1976 return o;
1977 }
1978
1979 checkUnnamed3122(core.List<core.String> o) {
1980 unittest.expect(o, unittest.hasLength(2));
1981 unittest.expect(o[0], unittest.equals('foo'));
1982 unittest.expect(o[1], unittest.equals('foo'));
1983 }
1984
1985 buildUnnamed3123() {
1986 var o = new core.List<api.Step>();
1987 o.add(buildStep());
1988 o.add(buildStep());
1989 return o;
1990 }
1991
1992 checkUnnamed3123(core.List<api.Step> o) {
1993 unittest.expect(o, unittest.hasLength(2));
1994 checkStep(o[0]);
1995 checkStep(o[1]);
1996 }
1997
1998 core.int buildCounterOperationMetadata = 0;
1999 buildOperationMetadata() {
2000 var o = new api.OperationMetadata();
2001 buildCounterOperationMetadata++;
2002 if (buildCounterOperationMetadata < 3) {
2003 o.progressPercentage = 42;
2004 o.resourceNames = buildUnnamed3122();
2005 o.startTime = "foo";
2006 o.steps = buildUnnamed3123();
2007 }
2008 buildCounterOperationMetadata--;
2009 return o;
2010 }
2011
2012 checkOperationMetadata(api.OperationMetadata o) {
2013 buildCounterOperationMetadata++;
2014 if (buildCounterOperationMetadata < 3) {
2015 unittest.expect(o.progressPercentage, unittest.equals(42));
2016 checkUnnamed3122(o.resourceNames);
2017 unittest.expect(o.startTime, unittest.equals('foo'));
2018 checkUnnamed3123(o.steps);
2019 }
2020 buildCounterOperationMetadata--;
2021 }
2022
2023 buildUnnamed3124() {
2024 var o = new core.Map<core.String, core.Object>();
2025 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
2026 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
2027 return o;
2028 }
2029
2030 checkUnnamed3124(core.Map<core.String, core.Object> o) {
2031 unittest.expect(o, unittest.hasLength(2));
2032 var casted9 = (o["x"]) as core.Map; unittest.expect(casted9, unittest.hasLengt h(3)); unittest.expect(casted9["list"], unittest.equals([1, 2, 3])); unittest.ex pect(casted9["bool"], unittest.equals(true)); unittest.expect(casted9["string"], unittest.equals('foo'));
2033 var casted10 = (o["y"]) as core.Map; unittest.expect(casted10, unittest.hasLen gth(3)); unittest.expect(casted10["list"], unittest.equals([1, 2, 3])); unittest .expect(casted10["bool"], unittest.equals(true)); unittest.expect(casted10["stri ng"], unittest.equals('foo'));
2034 }
2035
2036 core.int buildCounterOption = 0;
2037 buildOption() {
2038 var o = new api.Option();
2039 buildCounterOption++;
2040 if (buildCounterOption < 3) {
2041 o.name = "foo";
2042 o.value = buildUnnamed3124();
2043 }
2044 buildCounterOption--;
2045 return o;
2046 }
2047
2048 checkOption(api.Option o) {
2049 buildCounterOption++;
2050 if (buildCounterOption < 3) {
2051 unittest.expect(o.name, unittest.equals('foo'));
2052 checkUnnamed3124(o.value);
2053 }
2054 buildCounterOption--;
2055 }
2056
2057 buildUnnamed3125() {
2058 var o = new core.List<api.Page>();
2059 o.add(buildPage());
2060 o.add(buildPage());
2061 return o;
2062 }
2063
2064 checkUnnamed3125(core.List<api.Page> o) {
2065 unittest.expect(o, unittest.hasLength(2));
2066 checkPage(o[0]);
2067 checkPage(o[1]);
2068 }
2069
2070 core.int buildCounterPage = 0;
2071 buildPage() {
2072 var o = new api.Page();
2073 buildCounterPage++;
2074 if (buildCounterPage < 3) {
2075 o.content = "foo";
2076 o.name = "foo";
2077 o.subpages = buildUnnamed3125();
2078 }
2079 buildCounterPage--;
2080 return o;
2081 }
2082
2083 checkPage(api.Page o) {
2084 buildCounterPage++;
2085 if (buildCounterPage < 3) {
2086 unittest.expect(o.content, unittest.equals('foo'));
2087 unittest.expect(o.name, unittest.equals('foo'));
2088 checkUnnamed3125(o.subpages);
2089 }
2090 buildCounterPage--;
2091 }
2092
2093 buildUnnamed3126() {
2094 var o = new core.List<api.AuditConfig>();
2095 o.add(buildAuditConfig());
2096 o.add(buildAuditConfig());
2097 return o;
2098 }
2099
2100 checkUnnamed3126(core.List<api.AuditConfig> o) {
2101 unittest.expect(o, unittest.hasLength(2));
2102 checkAuditConfig(o[0]);
2103 checkAuditConfig(o[1]);
2104 }
2105
2106 buildUnnamed3127() {
2107 var o = new core.List<api.Binding>();
2108 o.add(buildBinding());
2109 o.add(buildBinding());
2110 return o;
2111 }
2112
2113 checkUnnamed3127(core.List<api.Binding> o) {
2114 unittest.expect(o, unittest.hasLength(2));
2115 checkBinding(o[0]);
2116 checkBinding(o[1]);
2117 }
2118
2119 buildUnnamed3128() {
2120 var o = new core.List<api.Rule>();
2121 o.add(buildRule());
2122 o.add(buildRule());
2123 return o;
2124 }
2125
2126 checkUnnamed3128(core.List<api.Rule> o) {
2127 unittest.expect(o, unittest.hasLength(2));
2128 checkRule(o[0]);
2129 checkRule(o[1]);
2130 }
2131
2132 core.int buildCounterPolicy = 0;
2133 buildPolicy() {
2134 var o = new api.Policy();
2135 buildCounterPolicy++;
2136 if (buildCounterPolicy < 3) {
2137 o.auditConfigs = buildUnnamed3126();
2138 o.bindings = buildUnnamed3127();
2139 o.etag = "foo";
2140 o.iamOwned = true;
2141 o.rules = buildUnnamed3128();
2142 o.version = 42;
2143 }
2144 buildCounterPolicy--;
2145 return o;
2146 }
2147
2148 checkPolicy(api.Policy o) {
2149 buildCounterPolicy++;
2150 if (buildCounterPolicy < 3) {
2151 checkUnnamed3126(o.auditConfigs);
2152 checkUnnamed3127(o.bindings);
2153 unittest.expect(o.etag, unittest.equals('foo'));
2154 unittest.expect(o.iamOwned, unittest.isTrue);
2155 checkUnnamed3128(o.rules);
2156 unittest.expect(o.version, unittest.equals(42));
2157 }
2158 buildCounterPolicy--;
2159 }
2160
2161 core.int buildCounterRollout = 0;
2162 buildRollout() {
2163 var o = new api.Rollout();
2164 buildCounterRollout++;
2165 if (buildCounterRollout < 3) {
2166 o.createTime = "foo";
2167 o.createdBy = "foo";
2168 o.deleteServiceStrategy = buildDeleteServiceStrategy();
2169 o.rolloutId = "foo";
2170 o.serviceName = "foo";
2171 o.status = "foo";
2172 o.trafficPercentStrategy = buildTrafficPercentStrategy();
2173 }
2174 buildCounterRollout--;
2175 return o;
2176 }
2177
2178 checkRollout(api.Rollout o) {
2179 buildCounterRollout++;
2180 if (buildCounterRollout < 3) {
2181 unittest.expect(o.createTime, unittest.equals('foo'));
2182 unittest.expect(o.createdBy, unittest.equals('foo'));
2183 checkDeleteServiceStrategy(o.deleteServiceStrategy);
2184 unittest.expect(o.rolloutId, unittest.equals('foo'));
2185 unittest.expect(o.serviceName, unittest.equals('foo'));
2186 unittest.expect(o.status, unittest.equals('foo'));
2187 checkTrafficPercentStrategy(o.trafficPercentStrategy);
2188 }
2189 buildCounterRollout--;
2190 }
2191
2192 buildUnnamed3129() {
2193 var o = new core.List<api.Condition>();
2194 o.add(buildCondition());
2195 o.add(buildCondition());
2196 return o;
2197 }
2198
2199 checkUnnamed3129(core.List<api.Condition> o) {
2200 unittest.expect(o, unittest.hasLength(2));
2201 checkCondition(o[0]);
2202 checkCondition(o[1]);
2203 }
2204
2205 buildUnnamed3130() {
2206 var o = new core.List<core.String>();
2207 o.add("foo");
2208 o.add("foo");
2209 return o;
2210 }
2211
2212 checkUnnamed3130(core.List<core.String> o) {
2213 unittest.expect(o, unittest.hasLength(2));
2214 unittest.expect(o[0], unittest.equals('foo'));
2215 unittest.expect(o[1], unittest.equals('foo'));
2216 }
2217
2218 buildUnnamed3131() {
2219 var o = new core.List<api.LogConfig>();
2220 o.add(buildLogConfig());
2221 o.add(buildLogConfig());
2222 return o;
2223 }
2224
2225 checkUnnamed3131(core.List<api.LogConfig> o) {
2226 unittest.expect(o, unittest.hasLength(2));
2227 checkLogConfig(o[0]);
2228 checkLogConfig(o[1]);
2229 }
2230
2231 buildUnnamed3132() {
2232 var o = new core.List<core.String>();
2233 o.add("foo");
2234 o.add("foo");
2235 return o;
2236 }
2237
2238 checkUnnamed3132(core.List<core.String> o) {
2239 unittest.expect(o, unittest.hasLength(2));
2240 unittest.expect(o[0], unittest.equals('foo'));
2241 unittest.expect(o[1], unittest.equals('foo'));
2242 }
2243
2244 buildUnnamed3133() {
2245 var o = new core.List<core.String>();
2246 o.add("foo");
2247 o.add("foo");
2248 return o;
2249 }
2250
2251 checkUnnamed3133(core.List<core.String> o) {
2252 unittest.expect(o, unittest.hasLength(2));
2253 unittest.expect(o[0], unittest.equals('foo'));
2254 unittest.expect(o[1], unittest.equals('foo'));
2255 }
2256
2257 core.int buildCounterRule = 0;
2258 buildRule() {
2259 var o = new api.Rule();
2260 buildCounterRule++;
2261 if (buildCounterRule < 3) {
2262 o.action = "foo";
2263 o.conditions = buildUnnamed3129();
2264 o.description = "foo";
2265 o.in_ = buildUnnamed3130();
2266 o.logConfig = buildUnnamed3131();
2267 o.notIn = buildUnnamed3132();
2268 o.permissions = buildUnnamed3133();
2269 }
2270 buildCounterRule--;
2271 return o;
2272 }
2273
2274 checkRule(api.Rule o) {
2275 buildCounterRule++;
2276 if (buildCounterRule < 3) {
2277 unittest.expect(o.action, unittest.equals('foo'));
2278 checkUnnamed3129(o.conditions);
2279 unittest.expect(o.description, unittest.equals('foo'));
2280 checkUnnamed3130(o.in_);
2281 checkUnnamed3131(o.logConfig);
2282 checkUnnamed3132(o.notIn);
2283 checkUnnamed3133(o.permissions);
2284 }
2285 buildCounterRule--;
2286 }
2287
2288 buildUnnamed3134() {
2289 var o = new core.List<api.Api>();
2290 o.add(buildApi());
2291 o.add(buildApi());
2292 return o;
2293 }
2294
2295 checkUnnamed3134(core.List<api.Api> o) {
2296 unittest.expect(o, unittest.hasLength(2));
2297 checkApi(o[0]);
2298 checkApi(o[1]);
2299 }
2300
2301 buildUnnamed3135() {
2302 var o = new core.List<api.Enum>();
2303 o.add(buildEnum());
2304 o.add(buildEnum());
2305 return o;
2306 }
2307
2308 checkUnnamed3135(core.List<api.Enum> o) {
2309 unittest.expect(o, unittest.hasLength(2));
2310 checkEnum(o[0]);
2311 checkEnum(o[1]);
2312 }
2313
2314 buildUnnamed3136() {
2315 var o = new core.List<api.LogDescriptor>();
2316 o.add(buildLogDescriptor());
2317 o.add(buildLogDescriptor());
2318 return o;
2319 }
2320
2321 checkUnnamed3136(core.List<api.LogDescriptor> o) {
2322 unittest.expect(o, unittest.hasLength(2));
2323 checkLogDescriptor(o[0]);
2324 checkLogDescriptor(o[1]);
2325 }
2326
2327 buildUnnamed3137() {
2328 var o = new core.List<api.MetricDescriptor>();
2329 o.add(buildMetricDescriptor());
2330 o.add(buildMetricDescriptor());
2331 return o;
2332 }
2333
2334 checkUnnamed3137(core.List<api.MetricDescriptor> o) {
2335 unittest.expect(o, unittest.hasLength(2));
2336 checkMetricDescriptor(o[0]);
2337 checkMetricDescriptor(o[1]);
2338 }
2339
2340 buildUnnamed3138() {
2341 var o = new core.List<api.MonitoredResourceDescriptor>();
2342 o.add(buildMonitoredResourceDescriptor());
2343 o.add(buildMonitoredResourceDescriptor());
2344 return o;
2345 }
2346
2347 checkUnnamed3138(core.List<api.MonitoredResourceDescriptor> o) {
2348 unittest.expect(o, unittest.hasLength(2));
2349 checkMonitoredResourceDescriptor(o[0]);
2350 checkMonitoredResourceDescriptor(o[1]);
2351 }
2352
2353 buildUnnamed3139() {
2354 var o = new core.List<api.Type>();
2355 o.add(buildType());
2356 o.add(buildType());
2357 return o;
2358 }
2359
2360 checkUnnamed3139(core.List<api.Type> o) {
2361 unittest.expect(o, unittest.hasLength(2));
2362 checkType(o[0]);
2363 checkType(o[1]);
2364 }
2365
2366 buildUnnamed3140() {
2367 var o = new core.List<api.Type>();
2368 o.add(buildType());
2369 o.add(buildType());
2370 return o;
2371 }
2372
2373 checkUnnamed3140(core.List<api.Type> o) {
2374 unittest.expect(o, unittest.hasLength(2));
2375 checkType(o[0]);
2376 checkType(o[1]);
2377 }
2378
2379 core.int buildCounterService = 0;
2380 buildService() {
2381 var o = new api.Service();
2382 buildCounterService++;
2383 if (buildCounterService < 3) {
2384 o.apis = buildUnnamed3134();
2385 o.authentication = buildAuthentication();
2386 o.backend = buildBackend();
2387 o.configVersion = 42;
2388 o.context = buildContext();
2389 o.control = buildControl();
2390 o.customError = buildCustomError();
2391 o.documentation = buildDocumentation();
2392 o.enums = buildUnnamed3135();
2393 o.http = buildHttp();
2394 o.id = "foo";
2395 o.logging = buildLogging();
2396 o.logs = buildUnnamed3136();
2397 o.metrics = buildUnnamed3137();
2398 o.monitoredResources = buildUnnamed3138();
2399 o.monitoring = buildMonitoring();
2400 o.name = "foo";
2401 o.producerProjectId = "foo";
2402 o.systemParameters = buildSystemParameters();
2403 o.systemTypes = buildUnnamed3139();
2404 o.title = "foo";
2405 o.types = buildUnnamed3140();
2406 o.usage = buildUsage();
2407 o.visibility = buildVisibility();
2408 }
2409 buildCounterService--;
2410 return o;
2411 }
2412
2413 checkService(api.Service o) {
2414 buildCounterService++;
2415 if (buildCounterService < 3) {
2416 checkUnnamed3134(o.apis);
2417 checkAuthentication(o.authentication);
2418 checkBackend(o.backend);
2419 unittest.expect(o.configVersion, unittest.equals(42));
2420 checkContext(o.context);
2421 checkControl(o.control);
2422 checkCustomError(o.customError);
2423 checkDocumentation(o.documentation);
2424 checkUnnamed3135(o.enums);
2425 checkHttp(o.http);
2426 unittest.expect(o.id, unittest.equals('foo'));
2427 checkLogging(o.logging);
2428 checkUnnamed3136(o.logs);
2429 checkUnnamed3137(o.metrics);
2430 checkUnnamed3138(o.monitoredResources);
2431 checkMonitoring(o.monitoring);
2432 unittest.expect(o.name, unittest.equals('foo'));
2433 unittest.expect(o.producerProjectId, unittest.equals('foo'));
2434 checkSystemParameters(o.systemParameters);
2435 checkUnnamed3139(o.systemTypes);
2436 unittest.expect(o.title, unittest.equals('foo'));
2437 checkUnnamed3140(o.types);
2438 checkUsage(o.usage);
2439 checkVisibility(o.visibility);
2440 }
2441 buildCounterService--;
2442 }
2443
2444 core.int buildCounterSetIamPolicyRequest = 0;
2445 buildSetIamPolicyRequest() {
2446 var o = new api.SetIamPolicyRequest();
2447 buildCounterSetIamPolicyRequest++;
2448 if (buildCounterSetIamPolicyRequest < 3) {
2449 o.policy = buildPolicy();
2450 }
2451 buildCounterSetIamPolicyRequest--;
2452 return o;
2453 }
2454
2455 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) {
2456 buildCounterSetIamPolicyRequest++;
2457 if (buildCounterSetIamPolicyRequest < 3) {
2458 checkPolicy(o.policy);
2459 }
2460 buildCounterSetIamPolicyRequest--;
2461 }
2462
2463 core.int buildCounterSourceContext = 0;
2464 buildSourceContext() {
2465 var o = new api.SourceContext();
2466 buildCounterSourceContext++;
2467 if (buildCounterSourceContext < 3) {
2468 o.fileName = "foo";
2469 }
2470 buildCounterSourceContext--;
2471 return o;
2472 }
2473
2474 checkSourceContext(api.SourceContext o) {
2475 buildCounterSourceContext++;
2476 if (buildCounterSourceContext < 3) {
2477 unittest.expect(o.fileName, unittest.equals('foo'));
2478 }
2479 buildCounterSourceContext--;
2480 }
2481
2482 buildUnnamed3141() {
2483 var o = new core.Map<core.String, core.Object>();
2484 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
2485 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
2486 return o;
2487 }
2488
2489 checkUnnamed3141(core.Map<core.String, core.Object> o) {
2490 unittest.expect(o, unittest.hasLength(2));
2491 var casted11 = (o["x"]) as core.Map; unittest.expect(casted11, unittest.hasLen gth(3)); unittest.expect(casted11["list"], unittest.equals([1, 2, 3])); unittest .expect(casted11["bool"], unittest.equals(true)); unittest.expect(casted11["stri ng"], unittest.equals('foo'));
2492 var casted12 = (o["y"]) as core.Map; unittest.expect(casted12, unittest.hasLen gth(3)); unittest.expect(casted12["list"], unittest.equals([1, 2, 3])); unittest .expect(casted12["bool"], unittest.equals(true)); unittest.expect(casted12["stri ng"], unittest.equals('foo'));
2493 }
2494
2495 buildUnnamed3142() {
2496 var o = new core.List<core.Map<core.String, core.Object>>();
2497 o.add(buildUnnamed3141());
2498 o.add(buildUnnamed3141());
2499 return o;
2500 }
2501
2502 checkUnnamed3142(core.List<core.Map<core.String, core.Object>> o) {
2503 unittest.expect(o, unittest.hasLength(2));
2504 checkUnnamed3141(o[0]);
2505 checkUnnamed3141(o[1]);
2506 }
2507
2508 core.int buildCounterStatus = 0;
2509 buildStatus() {
2510 var o = new api.Status();
2511 buildCounterStatus++;
2512 if (buildCounterStatus < 3) {
2513 o.code = 42;
2514 o.details = buildUnnamed3142();
2515 o.message = "foo";
2516 }
2517 buildCounterStatus--;
2518 return o;
2519 }
2520
2521 checkStatus(api.Status o) {
2522 buildCounterStatus++;
2523 if (buildCounterStatus < 3) {
2524 unittest.expect(o.code, unittest.equals(42));
2525 checkUnnamed3142(o.details);
2526 unittest.expect(o.message, unittest.equals('foo'));
2527 }
2528 buildCounterStatus--;
2529 }
2530
2531 core.int buildCounterStep = 0;
2532 buildStep() {
2533 var o = new api.Step();
2534 buildCounterStep++;
2535 if (buildCounterStep < 3) {
2536 o.description = "foo";
2537 o.status = "foo";
2538 }
2539 buildCounterStep--;
2540 return o;
2541 }
2542
2543 checkStep(api.Step o) {
2544 buildCounterStep++;
2545 if (buildCounterStep < 3) {
2546 unittest.expect(o.description, unittest.equals('foo'));
2547 unittest.expect(o.status, unittest.equals('foo'));
2548 }
2549 buildCounterStep--;
2550 }
2551
2552 core.int buildCounterSubmitConfigSourceRequest = 0;
2553 buildSubmitConfigSourceRequest() {
2554 var o = new api.SubmitConfigSourceRequest();
2555 buildCounterSubmitConfigSourceRequest++;
2556 if (buildCounterSubmitConfigSourceRequest < 3) {
2557 o.configSource = buildConfigSource();
2558 o.validateOnly = true;
2559 }
2560 buildCounterSubmitConfigSourceRequest--;
2561 return o;
2562 }
2563
2564 checkSubmitConfigSourceRequest(api.SubmitConfigSourceRequest o) {
2565 buildCounterSubmitConfigSourceRequest++;
2566 if (buildCounterSubmitConfigSourceRequest < 3) {
2567 checkConfigSource(o.configSource);
2568 unittest.expect(o.validateOnly, unittest.isTrue);
2569 }
2570 buildCounterSubmitConfigSourceRequest--;
2571 }
2572
2573 core.int buildCounterSubmitConfigSourceResponse = 0;
2574 buildSubmitConfigSourceResponse() {
2575 var o = new api.SubmitConfigSourceResponse();
2576 buildCounterSubmitConfigSourceResponse++;
2577 if (buildCounterSubmitConfigSourceResponse < 3) {
2578 o.serviceConfig = buildService();
2579 }
2580 buildCounterSubmitConfigSourceResponse--;
2581 return o;
2582 }
2583
2584 checkSubmitConfigSourceResponse(api.SubmitConfigSourceResponse o) {
2585 buildCounterSubmitConfigSourceResponse++;
2586 if (buildCounterSubmitConfigSourceResponse < 3) {
2587 checkService(o.serviceConfig);
2588 }
2589 buildCounterSubmitConfigSourceResponse--;
2590 }
2591
2592 core.int buildCounterSystemParameter = 0;
2593 buildSystemParameter() {
2594 var o = new api.SystemParameter();
2595 buildCounterSystemParameter++;
2596 if (buildCounterSystemParameter < 3) {
2597 o.httpHeader = "foo";
2598 o.name = "foo";
2599 o.urlQueryParameter = "foo";
2600 }
2601 buildCounterSystemParameter--;
2602 return o;
2603 }
2604
2605 checkSystemParameter(api.SystemParameter o) {
2606 buildCounterSystemParameter++;
2607 if (buildCounterSystemParameter < 3) {
2608 unittest.expect(o.httpHeader, unittest.equals('foo'));
2609 unittest.expect(o.name, unittest.equals('foo'));
2610 unittest.expect(o.urlQueryParameter, unittest.equals('foo'));
2611 }
2612 buildCounterSystemParameter--;
2613 }
2614
2615 buildUnnamed3143() {
2616 var o = new core.List<api.SystemParameter>();
2617 o.add(buildSystemParameter());
2618 o.add(buildSystemParameter());
2619 return o;
2620 }
2621
2622 checkUnnamed3143(core.List<api.SystemParameter> o) {
2623 unittest.expect(o, unittest.hasLength(2));
2624 checkSystemParameter(o[0]);
2625 checkSystemParameter(o[1]);
2626 }
2627
2628 core.int buildCounterSystemParameterRule = 0;
2629 buildSystemParameterRule() {
2630 var o = new api.SystemParameterRule();
2631 buildCounterSystemParameterRule++;
2632 if (buildCounterSystemParameterRule < 3) {
2633 o.parameters = buildUnnamed3143();
2634 o.selector = "foo";
2635 }
2636 buildCounterSystemParameterRule--;
2637 return o;
2638 }
2639
2640 checkSystemParameterRule(api.SystemParameterRule o) {
2641 buildCounterSystemParameterRule++;
2642 if (buildCounterSystemParameterRule < 3) {
2643 checkUnnamed3143(o.parameters);
2644 unittest.expect(o.selector, unittest.equals('foo'));
2645 }
2646 buildCounterSystemParameterRule--;
2647 }
2648
2649 buildUnnamed3144() {
2650 var o = new core.List<api.SystemParameterRule>();
2651 o.add(buildSystemParameterRule());
2652 o.add(buildSystemParameterRule());
2653 return o;
2654 }
2655
2656 checkUnnamed3144(core.List<api.SystemParameterRule> o) {
2657 unittest.expect(o, unittest.hasLength(2));
2658 checkSystemParameterRule(o[0]);
2659 checkSystemParameterRule(o[1]);
2660 }
2661
2662 core.int buildCounterSystemParameters = 0;
2663 buildSystemParameters() {
2664 var o = new api.SystemParameters();
2665 buildCounterSystemParameters++;
2666 if (buildCounterSystemParameters < 3) {
2667 o.rules = buildUnnamed3144();
2668 }
2669 buildCounterSystemParameters--;
2670 return o;
2671 }
2672
2673 checkSystemParameters(api.SystemParameters o) {
2674 buildCounterSystemParameters++;
2675 if (buildCounterSystemParameters < 3) {
2676 checkUnnamed3144(o.rules);
2677 }
2678 buildCounterSystemParameters--;
2679 }
2680
2681 buildUnnamed3145() {
2682 var o = new core.List<core.String>();
2683 o.add("foo");
2684 o.add("foo");
2685 return o;
2686 }
2687
2688 checkUnnamed3145(core.List<core.String> o) {
2689 unittest.expect(o, unittest.hasLength(2));
2690 unittest.expect(o[0], unittest.equals('foo'));
2691 unittest.expect(o[1], unittest.equals('foo'));
2692 }
2693
2694 core.int buildCounterTestIamPermissionsRequest = 0;
2695 buildTestIamPermissionsRequest() {
2696 var o = new api.TestIamPermissionsRequest();
2697 buildCounterTestIamPermissionsRequest++;
2698 if (buildCounterTestIamPermissionsRequest < 3) {
2699 o.permissions = buildUnnamed3145();
2700 }
2701 buildCounterTestIamPermissionsRequest--;
2702 return o;
2703 }
2704
2705 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) {
2706 buildCounterTestIamPermissionsRequest++;
2707 if (buildCounterTestIamPermissionsRequest < 3) {
2708 checkUnnamed3145(o.permissions);
2709 }
2710 buildCounterTestIamPermissionsRequest--;
2711 }
2712
2713 buildUnnamed3146() {
2714 var o = new core.List<core.String>();
2715 o.add("foo");
2716 o.add("foo");
2717 return o;
2718 }
2719
2720 checkUnnamed3146(core.List<core.String> o) {
2721 unittest.expect(o, unittest.hasLength(2));
2722 unittest.expect(o[0], unittest.equals('foo'));
2723 unittest.expect(o[1], unittest.equals('foo'));
2724 }
2725
2726 core.int buildCounterTestIamPermissionsResponse = 0;
2727 buildTestIamPermissionsResponse() {
2728 var o = new api.TestIamPermissionsResponse();
2729 buildCounterTestIamPermissionsResponse++;
2730 if (buildCounterTestIamPermissionsResponse < 3) {
2731 o.permissions = buildUnnamed3146();
2732 }
2733 buildCounterTestIamPermissionsResponse--;
2734 return o;
2735 }
2736
2737 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) {
2738 buildCounterTestIamPermissionsResponse++;
2739 if (buildCounterTestIamPermissionsResponse < 3) {
2740 checkUnnamed3146(o.permissions);
2741 }
2742 buildCounterTestIamPermissionsResponse--;
2743 }
2744
2745 buildUnnamed3147() {
2746 var o = new core.Map<core.String, core.double>();
2747 o["x"] = 42.0;
2748 o["y"] = 42.0;
2749 return o;
2750 }
2751
2752 checkUnnamed3147(core.Map<core.String, core.double> o) {
2753 unittest.expect(o, unittest.hasLength(2));
2754 unittest.expect(o["x"], unittest.equals(42.0));
2755 unittest.expect(o["y"], unittest.equals(42.0));
2756 }
2757
2758 core.int buildCounterTrafficPercentStrategy = 0;
2759 buildTrafficPercentStrategy() {
2760 var o = new api.TrafficPercentStrategy();
2761 buildCounterTrafficPercentStrategy++;
2762 if (buildCounterTrafficPercentStrategy < 3) {
2763 o.percentages = buildUnnamed3147();
2764 }
2765 buildCounterTrafficPercentStrategy--;
2766 return o;
2767 }
2768
2769 checkTrafficPercentStrategy(api.TrafficPercentStrategy o) {
2770 buildCounterTrafficPercentStrategy++;
2771 if (buildCounterTrafficPercentStrategy < 3) {
2772 checkUnnamed3147(o.percentages);
2773 }
2774 buildCounterTrafficPercentStrategy--;
2775 }
2776
2777 buildUnnamed3148() {
2778 var o = new core.List<api.Field>();
2779 o.add(buildField());
2780 o.add(buildField());
2781 return o;
2782 }
2783
2784 checkUnnamed3148(core.List<api.Field> o) {
2785 unittest.expect(o, unittest.hasLength(2));
2786 checkField(o[0]);
2787 checkField(o[1]);
2788 }
2789
2790 buildUnnamed3149() {
2791 var o = new core.List<core.String>();
2792 o.add("foo");
2793 o.add("foo");
2794 return o;
2795 }
2796
2797 checkUnnamed3149(core.List<core.String> o) {
2798 unittest.expect(o, unittest.hasLength(2));
2799 unittest.expect(o[0], unittest.equals('foo'));
2800 unittest.expect(o[1], unittest.equals('foo'));
2801 }
2802
2803 buildUnnamed3150() {
2804 var o = new core.List<api.Option>();
2805 o.add(buildOption());
2806 o.add(buildOption());
2807 return o;
2808 }
2809
2810 checkUnnamed3150(core.List<api.Option> o) {
2811 unittest.expect(o, unittest.hasLength(2));
2812 checkOption(o[0]);
2813 checkOption(o[1]);
2814 }
2815
2816 core.int buildCounterType = 0;
2817 buildType() {
2818 var o = new api.Type();
2819 buildCounterType++;
2820 if (buildCounterType < 3) {
2821 o.fields = buildUnnamed3148();
2822 o.name = "foo";
2823 o.oneofs = buildUnnamed3149();
2824 o.options = buildUnnamed3150();
2825 o.sourceContext = buildSourceContext();
2826 o.syntax = "foo";
2827 }
2828 buildCounterType--;
2829 return o;
2830 }
2831
2832 checkType(api.Type o) {
2833 buildCounterType++;
2834 if (buildCounterType < 3) {
2835 checkUnnamed3148(o.fields);
2836 unittest.expect(o.name, unittest.equals('foo'));
2837 checkUnnamed3149(o.oneofs);
2838 checkUnnamed3150(o.options);
2839 checkSourceContext(o.sourceContext);
2840 unittest.expect(o.syntax, unittest.equals('foo'));
2841 }
2842 buildCounterType--;
2843 }
2844
2845 core.int buildCounterUndeleteServiceResponse = 0;
2846 buildUndeleteServiceResponse() {
2847 var o = new api.UndeleteServiceResponse();
2848 buildCounterUndeleteServiceResponse++;
2849 if (buildCounterUndeleteServiceResponse < 3) {
2850 o.service = buildManagedService();
2851 }
2852 buildCounterUndeleteServiceResponse--;
2853 return o;
2854 }
2855
2856 checkUndeleteServiceResponse(api.UndeleteServiceResponse o) {
2857 buildCounterUndeleteServiceResponse++;
2858 if (buildCounterUndeleteServiceResponse < 3) {
2859 checkManagedService(o.service);
2860 }
2861 buildCounterUndeleteServiceResponse--;
2862 }
2863
2864 buildUnnamed3151() {
2865 var o = new core.List<core.String>();
2866 o.add("foo");
2867 o.add("foo");
2868 return o;
2869 }
2870
2871 checkUnnamed3151(core.List<core.String> o) {
2872 unittest.expect(o, unittest.hasLength(2));
2873 unittest.expect(o[0], unittest.equals('foo'));
2874 unittest.expect(o[1], unittest.equals('foo'));
2875 }
2876
2877 buildUnnamed3152() {
2878 var o = new core.List<api.UsageRule>();
2879 o.add(buildUsageRule());
2880 o.add(buildUsageRule());
2881 return o;
2882 }
2883
2884 checkUnnamed3152(core.List<api.UsageRule> o) {
2885 unittest.expect(o, unittest.hasLength(2));
2886 checkUsageRule(o[0]);
2887 checkUsageRule(o[1]);
2888 }
2889
2890 core.int buildCounterUsage = 0;
2891 buildUsage() {
2892 var o = new api.Usage();
2893 buildCounterUsage++;
2894 if (buildCounterUsage < 3) {
2895 o.requirements = buildUnnamed3151();
2896 o.rules = buildUnnamed3152();
2897 }
2898 buildCounterUsage--;
2899 return o;
2900 }
2901
2902 checkUsage(api.Usage o) {
2903 buildCounterUsage++;
2904 if (buildCounterUsage < 3) {
2905 checkUnnamed3151(o.requirements);
2906 checkUnnamed3152(o.rules);
2907 }
2908 buildCounterUsage--;
2909 }
2910
2911 core.int buildCounterUsageRule = 0;
2912 buildUsageRule() {
2913 var o = new api.UsageRule();
2914 buildCounterUsageRule++;
2915 if (buildCounterUsageRule < 3) {
2916 o.allowUnregisteredCalls = true;
2917 o.selector = "foo";
2918 }
2919 buildCounterUsageRule--;
2920 return o;
2921 }
2922
2923 checkUsageRule(api.UsageRule o) {
2924 buildCounterUsageRule++;
2925 if (buildCounterUsageRule < 3) {
2926 unittest.expect(o.allowUnregisteredCalls, unittest.isTrue);
2927 unittest.expect(o.selector, unittest.equals('foo'));
2928 }
2929 buildCounterUsageRule--;
2930 }
2931
2932 buildUnnamed3153() {
2933 var o = new core.List<api.VisibilityRule>();
2934 o.add(buildVisibilityRule());
2935 o.add(buildVisibilityRule());
2936 return o;
2937 }
2938
2939 checkUnnamed3153(core.List<api.VisibilityRule> o) {
2940 unittest.expect(o, unittest.hasLength(2));
2941 checkVisibilityRule(o[0]);
2942 checkVisibilityRule(o[1]);
2943 }
2944
2945 core.int buildCounterVisibility = 0;
2946 buildVisibility() {
2947 var o = new api.Visibility();
2948 buildCounterVisibility++;
2949 if (buildCounterVisibility < 3) {
2950 o.rules = buildUnnamed3153();
2951 }
2952 buildCounterVisibility--;
2953 return o;
2954 }
2955
2956 checkVisibility(api.Visibility o) {
2957 buildCounterVisibility++;
2958 if (buildCounterVisibility < 3) {
2959 checkUnnamed3153(o.rules);
2960 }
2961 buildCounterVisibility--;
2962 }
2963
2964 core.int buildCounterVisibilityRule = 0;
2965 buildVisibilityRule() {
2966 var o = new api.VisibilityRule();
2967 buildCounterVisibilityRule++;
2968 if (buildCounterVisibilityRule < 3) {
2969 o.restriction = "foo";
2970 o.selector = "foo";
2971 }
2972 buildCounterVisibilityRule--;
2973 return o;
2974 }
2975
2976 checkVisibilityRule(api.VisibilityRule o) {
2977 buildCounterVisibilityRule++;
2978 if (buildCounterVisibilityRule < 3) {
2979 unittest.expect(o.restriction, unittest.equals('foo'));
2980 unittest.expect(o.selector, unittest.equals('foo'));
2981 }
2982 buildCounterVisibilityRule--;
2983 }
2984
2985
2986 main() {
2987 unittest.group("obj-schema-Advice", () {
2988 unittest.test("to-json--from-json", () {
2989 var o = buildAdvice();
2990 var od = new api.Advice.fromJson(o.toJson());
2991 checkAdvice(od);
2992 });
2993 });
2994
2995
2996 unittest.group("obj-schema-Api", () {
2997 unittest.test("to-json--from-json", () {
2998 var o = buildApi();
2999 var od = new api.Api.fromJson(o.toJson());
3000 checkApi(od);
3001 });
3002 });
3003
3004
3005 unittest.group("obj-schema-AuditConfig", () {
3006 unittest.test("to-json--from-json", () {
3007 var o = buildAuditConfig();
3008 var od = new api.AuditConfig.fromJson(o.toJson());
3009 checkAuditConfig(od);
3010 });
3011 });
3012
3013
3014 unittest.group("obj-schema-AuthProvider", () {
3015 unittest.test("to-json--from-json", () {
3016 var o = buildAuthProvider();
3017 var od = new api.AuthProvider.fromJson(o.toJson());
3018 checkAuthProvider(od);
3019 });
3020 });
3021
3022
3023 unittest.group("obj-schema-AuthRequirement", () {
3024 unittest.test("to-json--from-json", () {
3025 var o = buildAuthRequirement();
3026 var od = new api.AuthRequirement.fromJson(o.toJson());
3027 checkAuthRequirement(od);
3028 });
3029 });
3030
3031
3032 unittest.group("obj-schema-Authentication", () {
3033 unittest.test("to-json--from-json", () {
3034 var o = buildAuthentication();
3035 var od = new api.Authentication.fromJson(o.toJson());
3036 checkAuthentication(od);
3037 });
3038 });
3039
3040
3041 unittest.group("obj-schema-AuthenticationRule", () {
3042 unittest.test("to-json--from-json", () {
3043 var o = buildAuthenticationRule();
3044 var od = new api.AuthenticationRule.fromJson(o.toJson());
3045 checkAuthenticationRule(od);
3046 });
3047 });
3048
3049
3050 unittest.group("obj-schema-Backend", () {
3051 unittest.test("to-json--from-json", () {
3052 var o = buildBackend();
3053 var od = new api.Backend.fromJson(o.toJson());
3054 checkBackend(od);
3055 });
3056 });
3057
3058
3059 unittest.group("obj-schema-BackendRule", () {
3060 unittest.test("to-json--from-json", () {
3061 var o = buildBackendRule();
3062 var od = new api.BackendRule.fromJson(o.toJson());
3063 checkBackendRule(od);
3064 });
3065 });
3066
3067
3068 unittest.group("obj-schema-Binding", () {
3069 unittest.test("to-json--from-json", () {
3070 var o = buildBinding();
3071 var od = new api.Binding.fromJson(o.toJson());
3072 checkBinding(od);
3073 });
3074 });
3075
3076
3077 unittest.group("obj-schema-ChangeReport", () {
3078 unittest.test("to-json--from-json", () {
3079 var o = buildChangeReport();
3080 var od = new api.ChangeReport.fromJson(o.toJson());
3081 checkChangeReport(od);
3082 });
3083 });
3084
3085
3086 unittest.group("obj-schema-CloudAuditOptions", () {
3087 unittest.test("to-json--from-json", () {
3088 var o = buildCloudAuditOptions();
3089 var od = new api.CloudAuditOptions.fromJson(o.toJson());
3090 checkCloudAuditOptions(od);
3091 });
3092 });
3093
3094
3095 unittest.group("obj-schema-Condition", () {
3096 unittest.test("to-json--from-json", () {
3097 var o = buildCondition();
3098 var od = new api.Condition.fromJson(o.toJson());
3099 checkCondition(od);
3100 });
3101 });
3102
3103
3104 unittest.group("obj-schema-ConfigChange", () {
3105 unittest.test("to-json--from-json", () {
3106 var o = buildConfigChange();
3107 var od = new api.ConfigChange.fromJson(o.toJson());
3108 checkConfigChange(od);
3109 });
3110 });
3111
3112
3113 unittest.group("obj-schema-ConfigFile", () {
3114 unittest.test("to-json--from-json", () {
3115 var o = buildConfigFile();
3116 var od = new api.ConfigFile.fromJson(o.toJson());
3117 checkConfigFile(od);
3118 });
3119 });
3120
3121
3122 unittest.group("obj-schema-ConfigOptions", () {
3123 unittest.test("to-json--from-json", () {
3124 var o = buildConfigOptions();
3125 var od = new api.ConfigOptions.fromJson(o.toJson());
3126 checkConfigOptions(od);
3127 });
3128 });
3129
3130
3131 unittest.group("obj-schema-ConfigRef", () {
3132 unittest.test("to-json--from-json", () {
3133 var o = buildConfigRef();
3134 var od = new api.ConfigRef.fromJson(o.toJson());
3135 checkConfigRef(od);
3136 });
3137 });
3138
3139
3140 unittest.group("obj-schema-ConfigSource", () {
3141 unittest.test("to-json--from-json", () {
3142 var o = buildConfigSource();
3143 var od = new api.ConfigSource.fromJson(o.toJson());
3144 checkConfigSource(od);
3145 });
3146 });
3147
3148
3149 unittest.group("obj-schema-Context", () {
3150 unittest.test("to-json--from-json", () {
3151 var o = buildContext();
3152 var od = new api.Context.fromJson(o.toJson());
3153 checkContext(od);
3154 });
3155 });
3156
3157
3158 unittest.group("obj-schema-ContextRule", () {
3159 unittest.test("to-json--from-json", () {
3160 var o = buildContextRule();
3161 var od = new api.ContextRule.fromJson(o.toJson());
3162 checkContextRule(od);
3163 });
3164 });
3165
3166
3167 unittest.group("obj-schema-Control", () {
3168 unittest.test("to-json--from-json", () {
3169 var o = buildControl();
3170 var od = new api.Control.fromJson(o.toJson());
3171 checkControl(od);
3172 });
3173 });
3174
3175
3176 unittest.group("obj-schema-CounterOptions", () {
3177 unittest.test("to-json--from-json", () {
3178 var o = buildCounterOptions();
3179 var od = new api.CounterOptions.fromJson(o.toJson());
3180 checkCounterOptions(od);
3181 });
3182 });
3183
3184
3185 unittest.group("obj-schema-CustomError", () {
3186 unittest.test("to-json--from-json", () {
3187 var o = buildCustomError();
3188 var od = new api.CustomError.fromJson(o.toJson());
3189 checkCustomError(od);
3190 });
3191 });
3192
3193
3194 unittest.group("obj-schema-CustomErrorRule", () {
3195 unittest.test("to-json--from-json", () {
3196 var o = buildCustomErrorRule();
3197 var od = new api.CustomErrorRule.fromJson(o.toJson());
3198 checkCustomErrorRule(od);
3199 });
3200 });
3201
3202
3203 unittest.group("obj-schema-CustomHttpPattern", () {
3204 unittest.test("to-json--from-json", () {
3205 var o = buildCustomHttpPattern();
3206 var od = new api.CustomHttpPattern.fromJson(o.toJson());
3207 checkCustomHttpPattern(od);
3208 });
3209 });
3210
3211
3212 unittest.group("obj-schema-DataAccessOptions", () {
3213 unittest.test("to-json--from-json", () {
3214 var o = buildDataAccessOptions();
3215 var od = new api.DataAccessOptions.fromJson(o.toJson());
3216 checkDataAccessOptions(od);
3217 });
3218 });
3219
3220
3221 unittest.group("obj-schema-DeleteServiceStrategy", () {
3222 unittest.test("to-json--from-json", () {
3223 var o = buildDeleteServiceStrategy();
3224 var od = new api.DeleteServiceStrategy.fromJson(o.toJson());
3225 checkDeleteServiceStrategy(od);
3226 });
3227 });
3228
3229
3230 unittest.group("obj-schema-Diagnostic", () {
3231 unittest.test("to-json--from-json", () {
3232 var o = buildDiagnostic();
3233 var od = new api.Diagnostic.fromJson(o.toJson());
3234 checkDiagnostic(od);
3235 });
3236 });
3237
3238
3239 unittest.group("obj-schema-DisableServiceRequest", () {
3240 unittest.test("to-json--from-json", () {
3241 var o = buildDisableServiceRequest();
3242 var od = new api.DisableServiceRequest.fromJson(o.toJson());
3243 checkDisableServiceRequest(od);
3244 });
3245 });
3246
3247
3248 unittest.group("obj-schema-Documentation", () {
3249 unittest.test("to-json--from-json", () {
3250 var o = buildDocumentation();
3251 var od = new api.Documentation.fromJson(o.toJson());
3252 checkDocumentation(od);
3253 });
3254 });
3255
3256
3257 unittest.group("obj-schema-DocumentationRule", () {
3258 unittest.test("to-json--from-json", () {
3259 var o = buildDocumentationRule();
3260 var od = new api.DocumentationRule.fromJson(o.toJson());
3261 checkDocumentationRule(od);
3262 });
3263 });
3264
3265
3266 unittest.group("obj-schema-EnableServiceRequest", () {
3267 unittest.test("to-json--from-json", () {
3268 var o = buildEnableServiceRequest();
3269 var od = new api.EnableServiceRequest.fromJson(o.toJson());
3270 checkEnableServiceRequest(od);
3271 });
3272 });
3273
3274
3275 unittest.group("obj-schema-Enum", () {
3276 unittest.test("to-json--from-json", () {
3277 var o = buildEnum();
3278 var od = new api.Enum.fromJson(o.toJson());
3279 checkEnum(od);
3280 });
3281 });
3282
3283
3284 unittest.group("obj-schema-EnumValue", () {
3285 unittest.test("to-json--from-json", () {
3286 var o = buildEnumValue();
3287 var od = new api.EnumValue.fromJson(o.toJson());
3288 checkEnumValue(od);
3289 });
3290 });
3291
3292
3293 unittest.group("obj-schema-Field", () {
3294 unittest.test("to-json--from-json", () {
3295 var o = buildField();
3296 var od = new api.Field.fromJson(o.toJson());
3297 checkField(od);
3298 });
3299 });
3300
3301
3302 unittest.group("obj-schema-GenerateConfigReportRequest", () {
3303 unittest.test("to-json--from-json", () {
3304 var o = buildGenerateConfigReportRequest();
3305 var od = new api.GenerateConfigReportRequest.fromJson(o.toJson());
3306 checkGenerateConfigReportRequest(od);
3307 });
3308 });
3309
3310
3311 unittest.group("obj-schema-GenerateConfigReportResponse", () {
3312 unittest.test("to-json--from-json", () {
3313 var o = buildGenerateConfigReportResponse();
3314 var od = new api.GenerateConfigReportResponse.fromJson(o.toJson());
3315 checkGenerateConfigReportResponse(od);
3316 });
3317 });
3318
3319
3320 unittest.group("obj-schema-GetIamPolicyRequest", () {
3321 unittest.test("to-json--from-json", () {
3322 var o = buildGetIamPolicyRequest();
3323 var od = new api.GetIamPolicyRequest.fromJson(o.toJson());
3324 checkGetIamPolicyRequest(od);
3325 });
3326 });
3327
3328
3329 unittest.group("obj-schema-Http", () {
3330 unittest.test("to-json--from-json", () {
3331 var o = buildHttp();
3332 var od = new api.Http.fromJson(o.toJson());
3333 checkHttp(od);
3334 });
3335 });
3336
3337
3338 unittest.group("obj-schema-HttpRule", () {
3339 unittest.test("to-json--from-json", () {
3340 var o = buildHttpRule();
3341 var od = new api.HttpRule.fromJson(o.toJson());
3342 checkHttpRule(od);
3343 });
3344 });
3345
3346
3347 unittest.group("obj-schema-LabelDescriptor", () {
3348 unittest.test("to-json--from-json", () {
3349 var o = buildLabelDescriptor();
3350 var od = new api.LabelDescriptor.fromJson(o.toJson());
3351 checkLabelDescriptor(od);
3352 });
3353 });
3354
3355
3356 unittest.group("obj-schema-ListServiceConfigsResponse", () {
3357 unittest.test("to-json--from-json", () {
3358 var o = buildListServiceConfigsResponse();
3359 var od = new api.ListServiceConfigsResponse.fromJson(o.toJson());
3360 checkListServiceConfigsResponse(od);
3361 });
3362 });
3363
3364
3365 unittest.group("obj-schema-ListServiceRolloutsResponse", () {
3366 unittest.test("to-json--from-json", () {
3367 var o = buildListServiceRolloutsResponse();
3368 var od = new api.ListServiceRolloutsResponse.fromJson(o.toJson());
3369 checkListServiceRolloutsResponse(od);
3370 });
3371 });
3372
3373
3374 unittest.group("obj-schema-ListServicesResponse", () {
3375 unittest.test("to-json--from-json", () {
3376 var o = buildListServicesResponse();
3377 var od = new api.ListServicesResponse.fromJson(o.toJson());
3378 checkListServicesResponse(od);
3379 });
3380 });
3381
3382
3383 unittest.group("obj-schema-LogConfig", () {
3384 unittest.test("to-json--from-json", () {
3385 var o = buildLogConfig();
3386 var od = new api.LogConfig.fromJson(o.toJson());
3387 checkLogConfig(od);
3388 });
3389 });
3390
3391
3392 unittest.group("obj-schema-LogDescriptor", () {
3393 unittest.test("to-json--from-json", () {
3394 var o = buildLogDescriptor();
3395 var od = new api.LogDescriptor.fromJson(o.toJson());
3396 checkLogDescriptor(od);
3397 });
3398 });
3399
3400
3401 unittest.group("obj-schema-Logging", () {
3402 unittest.test("to-json--from-json", () {
3403 var o = buildLogging();
3404 var od = new api.Logging.fromJson(o.toJson());
3405 checkLogging(od);
3406 });
3407 });
3408
3409
3410 unittest.group("obj-schema-LoggingDestination", () {
3411 unittest.test("to-json--from-json", () {
3412 var o = buildLoggingDestination();
3413 var od = new api.LoggingDestination.fromJson(o.toJson());
3414 checkLoggingDestination(od);
3415 });
3416 });
3417
3418
3419 unittest.group("obj-schema-ManagedService", () {
3420 unittest.test("to-json--from-json", () {
3421 var o = buildManagedService();
3422 var od = new api.ManagedService.fromJson(o.toJson());
3423 checkManagedService(od);
3424 });
3425 });
3426
3427
3428 unittest.group("obj-schema-MediaDownload", () {
3429 unittest.test("to-json--from-json", () {
3430 var o = buildMediaDownload();
3431 var od = new api.MediaDownload.fromJson(o.toJson());
3432 checkMediaDownload(od);
3433 });
3434 });
3435
3436
3437 unittest.group("obj-schema-MediaUpload", () {
3438 unittest.test("to-json--from-json", () {
3439 var o = buildMediaUpload();
3440 var od = new api.MediaUpload.fromJson(o.toJson());
3441 checkMediaUpload(od);
3442 });
3443 });
3444
3445
3446 unittest.group("obj-schema-Method", () {
3447 unittest.test("to-json--from-json", () {
3448 var o = buildMethod();
3449 var od = new api.Method.fromJson(o.toJson());
3450 checkMethod(od);
3451 });
3452 });
3453
3454
3455 unittest.group("obj-schema-MetricDescriptor", () {
3456 unittest.test("to-json--from-json", () {
3457 var o = buildMetricDescriptor();
3458 var od = new api.MetricDescriptor.fromJson(o.toJson());
3459 checkMetricDescriptor(od);
3460 });
3461 });
3462
3463
3464 unittest.group("obj-schema-Mixin", () {
3465 unittest.test("to-json--from-json", () {
3466 var o = buildMixin();
3467 var od = new api.Mixin.fromJson(o.toJson());
3468 checkMixin(od);
3469 });
3470 });
3471
3472
3473 unittest.group("obj-schema-MonitoredResourceDescriptor", () {
3474 unittest.test("to-json--from-json", () {
3475 var o = buildMonitoredResourceDescriptor();
3476 var od = new api.MonitoredResourceDescriptor.fromJson(o.toJson());
3477 checkMonitoredResourceDescriptor(od);
3478 });
3479 });
3480
3481
3482 unittest.group("obj-schema-Monitoring", () {
3483 unittest.test("to-json--from-json", () {
3484 var o = buildMonitoring();
3485 var od = new api.Monitoring.fromJson(o.toJson());
3486 checkMonitoring(od);
3487 });
3488 });
3489
3490
3491 unittest.group("obj-schema-MonitoringDestination", () {
3492 unittest.test("to-json--from-json", () {
3493 var o = buildMonitoringDestination();
3494 var od = new api.MonitoringDestination.fromJson(o.toJson());
3495 checkMonitoringDestination(od);
3496 });
3497 });
3498
3499
3500 unittest.group("obj-schema-OAuthRequirements", () {
3501 unittest.test("to-json--from-json", () {
3502 var o = buildOAuthRequirements();
3503 var od = new api.OAuthRequirements.fromJson(o.toJson());
3504 checkOAuthRequirements(od);
3505 });
3506 });
3507
3508
3509 unittest.group("obj-schema-Operation", () {
3510 unittest.test("to-json--from-json", () {
3511 var o = buildOperation();
3512 var od = new api.Operation.fromJson(o.toJson());
3513 checkOperation(od);
3514 });
3515 });
3516
3517
3518 unittest.group("obj-schema-OperationMetadata", () {
3519 unittest.test("to-json--from-json", () {
3520 var o = buildOperationMetadata();
3521 var od = new api.OperationMetadata.fromJson(o.toJson());
3522 checkOperationMetadata(od);
3523 });
3524 });
3525
3526
3527 unittest.group("obj-schema-Option", () {
3528 unittest.test("to-json--from-json", () {
3529 var o = buildOption();
3530 var od = new api.Option.fromJson(o.toJson());
3531 checkOption(od);
3532 });
3533 });
3534
3535
3536 unittest.group("obj-schema-Page", () {
3537 unittest.test("to-json--from-json", () {
3538 var o = buildPage();
3539 var od = new api.Page.fromJson(o.toJson());
3540 checkPage(od);
3541 });
3542 });
3543
3544
3545 unittest.group("obj-schema-Policy", () {
3546 unittest.test("to-json--from-json", () {
3547 var o = buildPolicy();
3548 var od = new api.Policy.fromJson(o.toJson());
3549 checkPolicy(od);
3550 });
3551 });
3552
3553
3554 unittest.group("obj-schema-Rollout", () {
3555 unittest.test("to-json--from-json", () {
3556 var o = buildRollout();
3557 var od = new api.Rollout.fromJson(o.toJson());
3558 checkRollout(od);
3559 });
3560 });
3561
3562
3563 unittest.group("obj-schema-Rule", () {
3564 unittest.test("to-json--from-json", () {
3565 var o = buildRule();
3566 var od = new api.Rule.fromJson(o.toJson());
3567 checkRule(od);
3568 });
3569 });
3570
3571
3572 unittest.group("obj-schema-Service", () {
3573 unittest.test("to-json--from-json", () {
3574 var o = buildService();
3575 var od = new api.Service.fromJson(o.toJson());
3576 checkService(od);
3577 });
3578 });
3579
3580
3581 unittest.group("obj-schema-SetIamPolicyRequest", () {
3582 unittest.test("to-json--from-json", () {
3583 var o = buildSetIamPolicyRequest();
3584 var od = new api.SetIamPolicyRequest.fromJson(o.toJson());
3585 checkSetIamPolicyRequest(od);
3586 });
3587 });
3588
3589
3590 unittest.group("obj-schema-SourceContext", () {
3591 unittest.test("to-json--from-json", () {
3592 var o = buildSourceContext();
3593 var od = new api.SourceContext.fromJson(o.toJson());
3594 checkSourceContext(od);
3595 });
3596 });
3597
3598
3599 unittest.group("obj-schema-Status", () {
3600 unittest.test("to-json--from-json", () {
3601 var o = buildStatus();
3602 var od = new api.Status.fromJson(o.toJson());
3603 checkStatus(od);
3604 });
3605 });
3606
3607
3608 unittest.group("obj-schema-Step", () {
3609 unittest.test("to-json--from-json", () {
3610 var o = buildStep();
3611 var od = new api.Step.fromJson(o.toJson());
3612 checkStep(od);
3613 });
3614 });
3615
3616
3617 unittest.group("obj-schema-SubmitConfigSourceRequest", () {
3618 unittest.test("to-json--from-json", () {
3619 var o = buildSubmitConfigSourceRequest();
3620 var od = new api.SubmitConfigSourceRequest.fromJson(o.toJson());
3621 checkSubmitConfigSourceRequest(od);
3622 });
3623 });
3624
3625
3626 unittest.group("obj-schema-SubmitConfigSourceResponse", () {
3627 unittest.test("to-json--from-json", () {
3628 var o = buildSubmitConfigSourceResponse();
3629 var od = new api.SubmitConfigSourceResponse.fromJson(o.toJson());
3630 checkSubmitConfigSourceResponse(od);
3631 });
3632 });
3633
3634
3635 unittest.group("obj-schema-SystemParameter", () {
3636 unittest.test("to-json--from-json", () {
3637 var o = buildSystemParameter();
3638 var od = new api.SystemParameter.fromJson(o.toJson());
3639 checkSystemParameter(od);
3640 });
3641 });
3642
3643
3644 unittest.group("obj-schema-SystemParameterRule", () {
3645 unittest.test("to-json--from-json", () {
3646 var o = buildSystemParameterRule();
3647 var od = new api.SystemParameterRule.fromJson(o.toJson());
3648 checkSystemParameterRule(od);
3649 });
3650 });
3651
3652
3653 unittest.group("obj-schema-SystemParameters", () {
3654 unittest.test("to-json--from-json", () {
3655 var o = buildSystemParameters();
3656 var od = new api.SystemParameters.fromJson(o.toJson());
3657 checkSystemParameters(od);
3658 });
3659 });
3660
3661
3662 unittest.group("obj-schema-TestIamPermissionsRequest", () {
3663 unittest.test("to-json--from-json", () {
3664 var o = buildTestIamPermissionsRequest();
3665 var od = new api.TestIamPermissionsRequest.fromJson(o.toJson());
3666 checkTestIamPermissionsRequest(od);
3667 });
3668 });
3669
3670
3671 unittest.group("obj-schema-TestIamPermissionsResponse", () {
3672 unittest.test("to-json--from-json", () {
3673 var o = buildTestIamPermissionsResponse();
3674 var od = new api.TestIamPermissionsResponse.fromJson(o.toJson());
3675 checkTestIamPermissionsResponse(od);
3676 });
3677 });
3678
3679
3680 unittest.group("obj-schema-TrafficPercentStrategy", () {
3681 unittest.test("to-json--from-json", () {
3682 var o = buildTrafficPercentStrategy();
3683 var od = new api.TrafficPercentStrategy.fromJson(o.toJson());
3684 checkTrafficPercentStrategy(od);
3685 });
3686 });
3687
3688
3689 unittest.group("obj-schema-Type", () {
3690 unittest.test("to-json--from-json", () {
3691 var o = buildType();
3692 var od = new api.Type.fromJson(o.toJson());
3693 checkType(od);
3694 });
3695 });
3696
3697
3698 unittest.group("obj-schema-UndeleteServiceResponse", () {
3699 unittest.test("to-json--from-json", () {
3700 var o = buildUndeleteServiceResponse();
3701 var od = new api.UndeleteServiceResponse.fromJson(o.toJson());
3702 checkUndeleteServiceResponse(od);
3703 });
3704 });
3705
3706
3707 unittest.group("obj-schema-Usage", () {
3708 unittest.test("to-json--from-json", () {
3709 var o = buildUsage();
3710 var od = new api.Usage.fromJson(o.toJson());
3711 checkUsage(od);
3712 });
3713 });
3714
3715
3716 unittest.group("obj-schema-UsageRule", () {
3717 unittest.test("to-json--from-json", () {
3718 var o = buildUsageRule();
3719 var od = new api.UsageRule.fromJson(o.toJson());
3720 checkUsageRule(od);
3721 });
3722 });
3723
3724
3725 unittest.group("obj-schema-Visibility", () {
3726 unittest.test("to-json--from-json", () {
3727 var o = buildVisibility();
3728 var od = new api.Visibility.fromJson(o.toJson());
3729 checkVisibility(od);
3730 });
3731 });
3732
3733
3734 unittest.group("obj-schema-VisibilityRule", () {
3735 unittest.test("to-json--from-json", () {
3736 var o = buildVisibilityRule();
3737 var od = new api.VisibilityRule.fromJson(o.toJson());
3738 checkVisibilityRule(od);
3739 });
3740 });
3741
3742
3743 unittest.group("resource-OperationsResourceApi", () {
3744 unittest.test("method--get", () {
3745
3746 var mock = new HttpServerMock();
3747 api.OperationsResourceApi res = new api.ServicemanagementApi(mock).operati ons;
3748 var arg_name = "foo";
3749 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
3750 var path = (req.url).path;
3751 var pathOffset = 0;
3752 var index;
3753 var subPart;
3754 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
3755 pathOffset += 1;
3756 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/"));
3757 pathOffset += 3;
3758 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
3759
3760 var query = (req.url).query;
3761 var queryOffset = 0;
3762 var queryMap = {};
3763 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3764 parseBool(n) {
3765 if (n == "true") return true;
3766 if (n == "false") return false;
3767 if (n == null) return null;
3768 throw new core.ArgumentError("Invalid boolean: $n");
3769 }
3770 if (query.length > 0) {
3771 for (var part in query.split("&")) {
3772 var keyvalue = part.split("=");
3773 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
3774 }
3775 }
3776
3777
3778 var h = {
3779 "content-type" : "application/json; charset=utf-8",
3780 };
3781 var resp = convert.JSON.encode(buildOperation());
3782 return new async.Future.value(stringResponse(200, h, resp));
3783 }), true);
3784 res.get(arg_name).then(unittest.expectAsync(((api.Operation response) {
3785 checkOperation(response);
3786 })));
3787 });
3788
3789 });
3790
3791
3792 unittest.group("resource-ServicesResourceApi", () {
3793 unittest.test("method--create", () {
3794
3795 var mock = new HttpServerMock();
3796 api.ServicesResourceApi res = new api.ServicemanagementApi(mock).services;
3797 var arg_request = buildManagedService();
3798 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
3799 var obj = new api.ManagedService.fromJson(json);
3800 checkManagedService(obj);
3801
3802 var path = (req.url).path;
3803 var pathOffset = 0;
3804 var index;
3805 var subPart;
3806 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
3807 pathOffset += 1;
3808 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq uals("v1/services"));
3809 pathOffset += 11;
3810
3811 var query = (req.url).query;
3812 var queryOffset = 0;
3813 var queryMap = {};
3814 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3815 parseBool(n) {
3816 if (n == "true") return true;
3817 if (n == "false") return false;
3818 if (n == null) return null;
3819 throw new core.ArgumentError("Invalid boolean: $n");
3820 }
3821 if (query.length > 0) {
3822 for (var part in query.split("&")) {
3823 var keyvalue = part.split("=");
3824 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
3825 }
3826 }
3827
3828
3829 var h = {
3830 "content-type" : "application/json; charset=utf-8",
3831 };
3832 var resp = convert.JSON.encode(buildOperation());
3833 return new async.Future.value(stringResponse(200, h, resp));
3834 }), true);
3835 res.create(arg_request).then(unittest.expectAsync(((api.Operation response ) {
3836 checkOperation(response);
3837 })));
3838 });
3839
3840 unittest.test("method--delete", () {
3841
3842 var mock = new HttpServerMock();
3843 api.ServicesResourceApi res = new api.ServicemanagementApi(mock).services;
3844 var arg_serviceName = "foo";
3845 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
3846 var path = (req.url).path;
3847 var pathOffset = 0;
3848 var index;
3849 var subPart;
3850 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
3851 pathOffset += 1;
3852 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("v1/services/"));
3853 pathOffset += 12;
3854 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
3855 pathOffset = path.length;
3856 unittest.expect(subPart, unittest.equals("$arg_serviceName"));
3857
3858 var query = (req.url).query;
3859 var queryOffset = 0;
3860 var queryMap = {};
3861 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3862 parseBool(n) {
3863 if (n == "true") return true;
3864 if (n == "false") return false;
3865 if (n == null) return null;
3866 throw new core.ArgumentError("Invalid boolean: $n");
3867 }
3868 if (query.length > 0) {
3869 for (var part in query.split("&")) {
3870 var keyvalue = part.split("=");
3871 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
3872 }
3873 }
3874
3875
3876 var h = {
3877 "content-type" : "application/json; charset=utf-8",
3878 };
3879 var resp = convert.JSON.encode(buildOperation());
3880 return new async.Future.value(stringResponse(200, h, resp));
3881 }), true);
3882 res.delete(arg_serviceName).then(unittest.expectAsync(((api.Operation resp onse) {
3883 checkOperation(response);
3884 })));
3885 });
3886
3887 unittest.test("method--disable", () {
3888
3889 var mock = new HttpServerMock();
3890 api.ServicesResourceApi res = new api.ServicemanagementApi(mock).services;
3891 var arg_request = buildDisableServiceRequest();
3892 var arg_serviceName = "foo";
3893 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
3894 var obj = new api.DisableServiceRequest.fromJson(json);
3895 checkDisableServiceRequest(obj);
3896
3897 var path = (req.url).path;
3898 var pathOffset = 0;
3899 var index;
3900 var subPart;
3901 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
3902 pathOffset += 1;
3903 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("v1/services/"));
3904 pathOffset += 12;
3905 index = path.indexOf(":disable", pathOffset);
3906 unittest.expect(index >= 0, unittest.isTrue);
3907 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
3908 pathOffset = index;
3909 unittest.expect(subPart, unittest.equals("$arg_serviceName"));
3910 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als(":disable"));
3911 pathOffset += 8;
3912
3913 var query = (req.url).query;
3914 var queryOffset = 0;
3915 var queryMap = {};
3916 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3917 parseBool(n) {
3918 if (n == "true") return true;
3919 if (n == "false") return false;
3920 if (n == null) return null;
3921 throw new core.ArgumentError("Invalid boolean: $n");
3922 }
3923 if (query.length > 0) {
3924 for (var part in query.split("&")) {
3925 var keyvalue = part.split("=");
3926 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
3927 }
3928 }
3929
3930
3931 var h = {
3932 "content-type" : "application/json; charset=utf-8",
3933 };
3934 var resp = convert.JSON.encode(buildOperation());
3935 return new async.Future.value(stringResponse(200, h, resp));
3936 }), true);
3937 res.disable(arg_request, arg_serviceName).then(unittest.expectAsync(((api. Operation response) {
3938 checkOperation(response);
3939 })));
3940 });
3941
3942 unittest.test("method--enable", () {
3943
3944 var mock = new HttpServerMock();
3945 api.ServicesResourceApi res = new api.ServicemanagementApi(mock).services;
3946 var arg_request = buildEnableServiceRequest();
3947 var arg_serviceName = "foo";
3948 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
3949 var obj = new api.EnableServiceRequest.fromJson(json);
3950 checkEnableServiceRequest(obj);
3951
3952 var path = (req.url).path;
3953 var pathOffset = 0;
3954 var index;
3955 var subPart;
3956 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
3957 pathOffset += 1;
3958 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("v1/services/"));
3959 pathOffset += 12;
3960 index = path.indexOf(":enable", pathOffset);
3961 unittest.expect(index >= 0, unittest.isTrue);
3962 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
3963 pathOffset = index;
3964 unittest.expect(subPart, unittest.equals("$arg_serviceName"));
3965 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ als(":enable"));
3966 pathOffset += 7;
3967
3968 var query = (req.url).query;
3969 var queryOffset = 0;
3970 var queryMap = {};
3971 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3972 parseBool(n) {
3973 if (n == "true") return true;
3974 if (n == "false") return false;
3975 if (n == null) return null;
3976 throw new core.ArgumentError("Invalid boolean: $n");
3977 }
3978 if (query.length > 0) {
3979 for (var part in query.split("&")) {
3980 var keyvalue = part.split("=");
3981 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
3982 }
3983 }
3984
3985
3986 var h = {
3987 "content-type" : "application/json; charset=utf-8",
3988 };
3989 var resp = convert.JSON.encode(buildOperation());
3990 return new async.Future.value(stringResponse(200, h, resp));
3991 }), true);
3992 res.enable(arg_request, arg_serviceName).then(unittest.expectAsync(((api.O peration response) {
3993 checkOperation(response);
3994 })));
3995 });
3996
3997 unittest.test("method--generateConfigReport", () {
3998
3999 var mock = new HttpServerMock();
4000 api.ServicesResourceApi res = new api.ServicemanagementApi(mock).services;
4001 var arg_request = buildGenerateConfigReportRequest();
4002 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
4003 var obj = new api.GenerateConfigReportRequest.fromJson(json);
4004 checkGenerateConfigReportRequest(obj);
4005
4006 var path = (req.url).path;
4007 var pathOffset = 0;
4008 var index;
4009 var subPart;
4010 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
4011 pathOffset += 1;
4012 unittest.expect(path.substring(pathOffset, pathOffset + 32), unittest.eq uals("v1/services:generateConfigReport"));
4013 pathOffset += 32;
4014
4015 var query = (req.url).query;
4016 var queryOffset = 0;
4017 var queryMap = {};
4018 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4019 parseBool(n) {
4020 if (n == "true") return true;
4021 if (n == "false") return false;
4022 if (n == null) return null;
4023 throw new core.ArgumentError("Invalid boolean: $n");
4024 }
4025 if (query.length > 0) {
4026 for (var part in query.split("&")) {
4027 var keyvalue = part.split("=");
4028 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
4029 }
4030 }
4031
4032
4033 var h = {
4034 "content-type" : "application/json; charset=utf-8",
4035 };
4036 var resp = convert.JSON.encode(buildGenerateConfigReportResponse());
4037 return new async.Future.value(stringResponse(200, h, resp));
4038 }), true);
4039 res.generateConfigReport(arg_request).then(unittest.expectAsync(((api.Gene rateConfigReportResponse response) {
4040 checkGenerateConfigReportResponse(response);
4041 })));
4042 });
4043
4044 unittest.test("method--get", () {
4045
4046 var mock = new HttpServerMock();
4047 api.ServicesResourceApi res = new api.ServicemanagementApi(mock).services;
4048 var arg_serviceName = "foo";
4049 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
4050 var path = (req.url).path;
4051 var pathOffset = 0;
4052 var index;
4053 var subPart;
4054 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
4055 pathOffset += 1;
4056 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("v1/services/"));
4057 pathOffset += 12;
4058 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
4059 pathOffset = path.length;
4060 unittest.expect(subPart, unittest.equals("$arg_serviceName"));
4061
4062 var query = (req.url).query;
4063 var queryOffset = 0;
4064 var queryMap = {};
4065 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4066 parseBool(n) {
4067 if (n == "true") return true;
4068 if (n == "false") return false;
4069 if (n == null) return null;
4070 throw new core.ArgumentError("Invalid boolean: $n");
4071 }
4072 if (query.length > 0) {
4073 for (var part in query.split("&")) {
4074 var keyvalue = part.split("=");
4075 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
4076 }
4077 }
4078
4079
4080 var h = {
4081 "content-type" : "application/json; charset=utf-8",
4082 };
4083 var resp = convert.JSON.encode(buildManagedService());
4084 return new async.Future.value(stringResponse(200, h, resp));
4085 }), true);
4086 res.get(arg_serviceName).then(unittest.expectAsync(((api.ManagedService re sponse) {
4087 checkManagedService(response);
4088 })));
4089 });
4090
4091 unittest.test("method--getConfig", () {
4092
4093 var mock = new HttpServerMock();
4094 api.ServicesResourceApi res = new api.ServicemanagementApi(mock).services;
4095 var arg_serviceName = "foo";
4096 var arg_configId = "foo";
4097 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
4098 var path = (req.url).path;
4099 var pathOffset = 0;
4100 var index;
4101 var subPart;
4102 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
4103 pathOffset += 1;
4104 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("v1/services/"));
4105 pathOffset += 12;
4106 index = path.indexOf("/config", pathOffset);
4107 unittest.expect(index >= 0, unittest.isTrue);
4108 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
4109 pathOffset = index;
4110 unittest.expect(subPart, unittest.equals("$arg_serviceName"));
4111 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ als("/config"));
4112 pathOffset += 7;
4113
4114 var query = (req.url).query;
4115 var queryOffset = 0;
4116 var queryMap = {};
4117 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4118 parseBool(n) {
4119 if (n == "true") return true;
4120 if (n == "false") return false;
4121 if (n == null) return null;
4122 throw new core.ArgumentError("Invalid boolean: $n");
4123 }
4124 if (query.length > 0) {
4125 for (var part in query.split("&")) {
4126 var keyvalue = part.split("=");
4127 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
4128 }
4129 }
4130 unittest.expect(queryMap["configId"].first, unittest.equals(arg_configId ));
4131
4132
4133 var h = {
4134 "content-type" : "application/json; charset=utf-8",
4135 };
4136 var resp = convert.JSON.encode(buildService());
4137 return new async.Future.value(stringResponse(200, h, resp));
4138 }), true);
4139 res.getConfig(arg_serviceName, configId: arg_configId).then(unittest.expec tAsync(((api.Service response) {
4140 checkService(response);
4141 })));
4142 });
4143
4144 unittest.test("method--getIamPolicy", () {
4145
4146 var mock = new HttpServerMock();
4147 api.ServicesResourceApi res = new api.ServicemanagementApi(mock).services;
4148 var arg_request = buildGetIamPolicyRequest();
4149 var arg_resource = "foo";
4150 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
4151 var obj = new api.GetIamPolicyRequest.fromJson(json);
4152 checkGetIamPolicyRequest(obj);
4153
4154 var path = (req.url).path;
4155 var pathOffset = 0;
4156 var index;
4157 var subPart;
4158 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
4159 pathOffset += 1;
4160 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/"));
4161 pathOffset += 3;
4162 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
4163
4164 var query = (req.url).query;
4165 var queryOffset = 0;
4166 var queryMap = {};
4167 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4168 parseBool(n) {
4169 if (n == "true") return true;
4170 if (n == "false") return false;
4171 if (n == null) return null;
4172 throw new core.ArgumentError("Invalid boolean: $n");
4173 }
4174 if (query.length > 0) {
4175 for (var part in query.split("&")) {
4176 var keyvalue = part.split("=");
4177 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
4178 }
4179 }
4180
4181
4182 var h = {
4183 "content-type" : "application/json; charset=utf-8",
4184 };
4185 var resp = convert.JSON.encode(buildPolicy());
4186 return new async.Future.value(stringResponse(200, h, resp));
4187 }), true);
4188 res.getIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap i.Policy response) {
4189 checkPolicy(response);
4190 })));
4191 });
4192
4193 unittest.test("method--list", () {
4194
4195 var mock = new HttpServerMock();
4196 api.ServicesResourceApi res = new api.ServicemanagementApi(mock).services;
4197 var arg_pageSize = 42;
4198 var arg_producerProjectId = "foo";
4199 var arg_pageToken = "foo";
4200 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
4201 var path = (req.url).path;
4202 var pathOffset = 0;
4203 var index;
4204 var subPart;
4205 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
4206 pathOffset += 1;
4207 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq uals("v1/services"));
4208 pathOffset += 11;
4209
4210 var query = (req.url).query;
4211 var queryOffset = 0;
4212 var queryMap = {};
4213 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4214 parseBool(n) {
4215 if (n == "true") return true;
4216 if (n == "false") return false;
4217 if (n == null) return null;
4218 throw new core.ArgumentError("Invalid boolean: $n");
4219 }
4220 if (query.length > 0) {
4221 for (var part in query.split("&")) {
4222 var keyvalue = part.split("=");
4223 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
4224 }
4225 }
4226 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize));
4227 unittest.expect(queryMap["producerProjectId"].first, unittest.equals(arg _producerProjectId));
4228 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
4229
4230
4231 var h = {
4232 "content-type" : "application/json; charset=utf-8",
4233 };
4234 var resp = convert.JSON.encode(buildListServicesResponse());
4235 return new async.Future.value(stringResponse(200, h, resp));
4236 }), true);
4237 res.list(pageSize: arg_pageSize, producerProjectId: arg_producerProjectId, pageToken: arg_pageToken).then(unittest.expectAsync(((api.ListServicesResponse response) {
4238 checkListServicesResponse(response);
4239 })));
4240 });
4241
4242 unittest.test("method--setIamPolicy", () {
4243
4244 var mock = new HttpServerMock();
4245 api.ServicesResourceApi res = new api.ServicemanagementApi(mock).services;
4246 var arg_request = buildSetIamPolicyRequest();
4247 var arg_resource = "foo";
4248 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
4249 var obj = new api.SetIamPolicyRequest.fromJson(json);
4250 checkSetIamPolicyRequest(obj);
4251
4252 var path = (req.url).path;
4253 var pathOffset = 0;
4254 var index;
4255 var subPart;
4256 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
4257 pathOffset += 1;
4258 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/"));
4259 pathOffset += 3;
4260 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
4261
4262 var query = (req.url).query;
4263 var queryOffset = 0;
4264 var queryMap = {};
4265 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4266 parseBool(n) {
4267 if (n == "true") return true;
4268 if (n == "false") return false;
4269 if (n == null) return null;
4270 throw new core.ArgumentError("Invalid boolean: $n");
4271 }
4272 if (query.length > 0) {
4273 for (var part in query.split("&")) {
4274 var keyvalue = part.split("=");
4275 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
4276 }
4277 }
4278
4279
4280 var h = {
4281 "content-type" : "application/json; charset=utf-8",
4282 };
4283 var resp = convert.JSON.encode(buildPolicy());
4284 return new async.Future.value(stringResponse(200, h, resp));
4285 }), true);
4286 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap i.Policy response) {
4287 checkPolicy(response);
4288 })));
4289 });
4290
4291 unittest.test("method--testIamPermissions", () {
4292
4293 var mock = new HttpServerMock();
4294 api.ServicesResourceApi res = new api.ServicemanagementApi(mock).services;
4295 var arg_request = buildTestIamPermissionsRequest();
4296 var arg_resource = "foo";
4297 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
4298 var obj = new api.TestIamPermissionsRequest.fromJson(json);
4299 checkTestIamPermissionsRequest(obj);
4300
4301 var path = (req.url).path;
4302 var pathOffset = 0;
4303 var index;
4304 var subPart;
4305 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
4306 pathOffset += 1;
4307 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/"));
4308 pathOffset += 3;
4309 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
4310
4311 var query = (req.url).query;
4312 var queryOffset = 0;
4313 var queryMap = {};
4314 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4315 parseBool(n) {
4316 if (n == "true") return true;
4317 if (n == "false") return false;
4318 if (n == null) return null;
4319 throw new core.ArgumentError("Invalid boolean: $n");
4320 }
4321 if (query.length > 0) {
4322 for (var part in query.split("&")) {
4323 var keyvalue = part.split("=");
4324 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
4325 }
4326 }
4327
4328
4329 var h = {
4330 "content-type" : "application/json; charset=utf-8",
4331 };
4332 var resp = convert.JSON.encode(buildTestIamPermissionsResponse());
4333 return new async.Future.value(stringResponse(200, h, resp));
4334 }), true);
4335 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn c(((api.TestIamPermissionsResponse response) {
4336 checkTestIamPermissionsResponse(response);
4337 })));
4338 });
4339
4340 unittest.test("method--undelete", () {
4341
4342 var mock = new HttpServerMock();
4343 api.ServicesResourceApi res = new api.ServicemanagementApi(mock).services;
4344 var arg_serviceName = "foo";
4345 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
4346 var path = (req.url).path;
4347 var pathOffset = 0;
4348 var index;
4349 var subPart;
4350 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
4351 pathOffset += 1;
4352 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("v1/services/"));
4353 pathOffset += 12;
4354 index = path.indexOf(":undelete", pathOffset);
4355 unittest.expect(index >= 0, unittest.isTrue);
4356 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
4357 pathOffset = index;
4358 unittest.expect(subPart, unittest.equals("$arg_serviceName"));
4359 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als(":undelete"));
4360 pathOffset += 9;
4361
4362 var query = (req.url).query;
4363 var queryOffset = 0;
4364 var queryMap = {};
4365 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4366 parseBool(n) {
4367 if (n == "true") return true;
4368 if (n == "false") return false;
4369 if (n == null) return null;
4370 throw new core.ArgumentError("Invalid boolean: $n");
4371 }
4372 if (query.length > 0) {
4373 for (var part in query.split("&")) {
4374 var keyvalue = part.split("=");
4375 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
4376 }
4377 }
4378
4379
4380 var h = {
4381 "content-type" : "application/json; charset=utf-8",
4382 };
4383 var resp = convert.JSON.encode(buildOperation());
4384 return new async.Future.value(stringResponse(200, h, resp));
4385 }), true);
4386 res.undelete(arg_serviceName).then(unittest.expectAsync(((api.Operation re sponse) {
4387 checkOperation(response);
4388 })));
4389 });
4390
4391 });
4392
4393
4394 unittest.group("resource-ServicesConfigsResourceApi", () {
4395 unittest.test("method--create", () {
4396
4397 var mock = new HttpServerMock();
4398 api.ServicesConfigsResourceApi res = new api.ServicemanagementApi(mock).se rvices.configs;
4399 var arg_request = buildService();
4400 var arg_serviceName = "foo";
4401 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
4402 var obj = new api.Service.fromJson(json);
4403 checkService(obj);
4404
4405 var path = (req.url).path;
4406 var pathOffset = 0;
4407 var index;
4408 var subPart;
4409 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
4410 pathOffset += 1;
4411 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("v1/services/"));
4412 pathOffset += 12;
4413 index = path.indexOf("/configs", pathOffset);
4414 unittest.expect(index >= 0, unittest.isTrue);
4415 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
4416 pathOffset = index;
4417 unittest.expect(subPart, unittest.equals("$arg_serviceName"));
4418 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("/configs"));
4419 pathOffset += 8;
4420
4421 var query = (req.url).query;
4422 var queryOffset = 0;
4423 var queryMap = {};
4424 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4425 parseBool(n) {
4426 if (n == "true") return true;
4427 if (n == "false") return false;
4428 if (n == null) return null;
4429 throw new core.ArgumentError("Invalid boolean: $n");
4430 }
4431 if (query.length > 0) {
4432 for (var part in query.split("&")) {
4433 var keyvalue = part.split("=");
4434 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
4435 }
4436 }
4437
4438
4439 var h = {
4440 "content-type" : "application/json; charset=utf-8",
4441 };
4442 var resp = convert.JSON.encode(buildService());
4443 return new async.Future.value(stringResponse(200, h, resp));
4444 }), true);
4445 res.create(arg_request, arg_serviceName).then(unittest.expectAsync(((api.S ervice response) {
4446 checkService(response);
4447 })));
4448 });
4449
4450 unittest.test("method--get", () {
4451
4452 var mock = new HttpServerMock();
4453 api.ServicesConfigsResourceApi res = new api.ServicemanagementApi(mock).se rvices.configs;
4454 var arg_serviceName = "foo";
4455 var arg_configId = "foo";
4456 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
4457 var path = (req.url).path;
4458 var pathOffset = 0;
4459 var index;
4460 var subPart;
4461 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
4462 pathOffset += 1;
4463 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("v1/services/"));
4464 pathOffset += 12;
4465 index = path.indexOf("/configs/", pathOffset);
4466 unittest.expect(index >= 0, unittest.isTrue);
4467 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
4468 pathOffset = index;
4469 unittest.expect(subPart, unittest.equals("$arg_serviceName"));
4470 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/configs/"));
4471 pathOffset += 9;
4472 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
4473 pathOffset = path.length;
4474 unittest.expect(subPart, unittest.equals("$arg_configId"));
4475
4476 var query = (req.url).query;
4477 var queryOffset = 0;
4478 var queryMap = {};
4479 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4480 parseBool(n) {
4481 if (n == "true") return true;
4482 if (n == "false") return false;
4483 if (n == null) return null;
4484 throw new core.ArgumentError("Invalid boolean: $n");
4485 }
4486 if (query.length > 0) {
4487 for (var part in query.split("&")) {
4488 var keyvalue = part.split("=");
4489 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
4490 }
4491 }
4492
4493
4494 var h = {
4495 "content-type" : "application/json; charset=utf-8",
4496 };
4497 var resp = convert.JSON.encode(buildService());
4498 return new async.Future.value(stringResponse(200, h, resp));
4499 }), true);
4500 res.get(arg_serviceName, arg_configId).then(unittest.expectAsync(((api.Ser vice response) {
4501 checkService(response);
4502 })));
4503 });
4504
4505 unittest.test("method--list", () {
4506
4507 var mock = new HttpServerMock();
4508 api.ServicesConfigsResourceApi res = new api.ServicemanagementApi(mock).se rvices.configs;
4509 var arg_serviceName = "foo";
4510 var arg_pageSize = 42;
4511 var arg_pageToken = "foo";
4512 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
4513 var path = (req.url).path;
4514 var pathOffset = 0;
4515 var index;
4516 var subPart;
4517 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
4518 pathOffset += 1;
4519 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("v1/services/"));
4520 pathOffset += 12;
4521 index = path.indexOf("/configs", pathOffset);
4522 unittest.expect(index >= 0, unittest.isTrue);
4523 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
4524 pathOffset = index;
4525 unittest.expect(subPart, unittest.equals("$arg_serviceName"));
4526 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("/configs"));
4527 pathOffset += 8;
4528
4529 var query = (req.url).query;
4530 var queryOffset = 0;
4531 var queryMap = {};
4532 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4533 parseBool(n) {
4534 if (n == "true") return true;
4535 if (n == "false") return false;
4536 if (n == null) return null;
4537 throw new core.ArgumentError("Invalid boolean: $n");
4538 }
4539 if (query.length > 0) {
4540 for (var part in query.split("&")) {
4541 var keyvalue = part.split("=");
4542 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
4543 }
4544 }
4545 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize));
4546 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
4547
4548
4549 var h = {
4550 "content-type" : "application/json; charset=utf-8",
4551 };
4552 var resp = convert.JSON.encode(buildListServiceConfigsResponse());
4553 return new async.Future.value(stringResponse(200, h, resp));
4554 }), true);
4555 res.list(arg_serviceName, pageSize: arg_pageSize, pageToken: arg_pageToken ).then(unittest.expectAsync(((api.ListServiceConfigsResponse response) {
4556 checkListServiceConfigsResponse(response);
4557 })));
4558 });
4559
4560 unittest.test("method--submit", () {
4561
4562 var mock = new HttpServerMock();
4563 api.ServicesConfigsResourceApi res = new api.ServicemanagementApi(mock).se rvices.configs;
4564 var arg_request = buildSubmitConfigSourceRequest();
4565 var arg_serviceName = "foo";
4566 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
4567 var obj = new api.SubmitConfigSourceRequest.fromJson(json);
4568 checkSubmitConfigSourceRequest(obj);
4569
4570 var path = (req.url).path;
4571 var pathOffset = 0;
4572 var index;
4573 var subPart;
4574 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
4575 pathOffset += 1;
4576 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("v1/services/"));
4577 pathOffset += 12;
4578 index = path.indexOf("/configs:submit", pathOffset);
4579 unittest.expect(index >= 0, unittest.isTrue);
4580 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
4581 pathOffset = index;
4582 unittest.expect(subPart, unittest.equals("$arg_serviceName"));
4583 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq uals("/configs:submit"));
4584 pathOffset += 15;
4585
4586 var query = (req.url).query;
4587 var queryOffset = 0;
4588 var queryMap = {};
4589 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4590 parseBool(n) {
4591 if (n == "true") return true;
4592 if (n == "false") return false;
4593 if (n == null) return null;
4594 throw new core.ArgumentError("Invalid boolean: $n");
4595 }
4596 if (query.length > 0) {
4597 for (var part in query.split("&")) {
4598 var keyvalue = part.split("=");
4599 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
4600 }
4601 }
4602
4603
4604 var h = {
4605 "content-type" : "application/json; charset=utf-8",
4606 };
4607 var resp = convert.JSON.encode(buildOperation());
4608 return new async.Future.value(stringResponse(200, h, resp));
4609 }), true);
4610 res.submit(arg_request, arg_serviceName).then(unittest.expectAsync(((api.O peration response) {
4611 checkOperation(response);
4612 })));
4613 });
4614
4615 });
4616
4617
4618 unittest.group("resource-ServicesRolloutsResourceApi", () {
4619 unittest.test("method--create", () {
4620
4621 var mock = new HttpServerMock();
4622 api.ServicesRolloutsResourceApi res = new api.ServicemanagementApi(mock).s ervices.rollouts;
4623 var arg_request = buildRollout();
4624 var arg_serviceName = "foo";
4625 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
4626 var obj = new api.Rollout.fromJson(json);
4627 checkRollout(obj);
4628
4629 var path = (req.url).path;
4630 var pathOffset = 0;
4631 var index;
4632 var subPart;
4633 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
4634 pathOffset += 1;
4635 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("v1/services/"));
4636 pathOffset += 12;
4637 index = path.indexOf("/rollouts", pathOffset);
4638 unittest.expect(index >= 0, unittest.isTrue);
4639 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
4640 pathOffset = index;
4641 unittest.expect(subPart, unittest.equals("$arg_serviceName"));
4642 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/rollouts"));
4643 pathOffset += 9;
4644
4645 var query = (req.url).query;
4646 var queryOffset = 0;
4647 var queryMap = {};
4648 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4649 parseBool(n) {
4650 if (n == "true") return true;
4651 if (n == "false") return false;
4652 if (n == null) return null;
4653 throw new core.ArgumentError("Invalid boolean: $n");
4654 }
4655 if (query.length > 0) {
4656 for (var part in query.split("&")) {
4657 var keyvalue = part.split("=");
4658 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
4659 }
4660 }
4661
4662
4663 var h = {
4664 "content-type" : "application/json; charset=utf-8",
4665 };
4666 var resp = convert.JSON.encode(buildOperation());
4667 return new async.Future.value(stringResponse(200, h, resp));
4668 }), true);
4669 res.create(arg_request, arg_serviceName).then(unittest.expectAsync(((api.O peration response) {
4670 checkOperation(response);
4671 })));
4672 });
4673
4674 unittest.test("method--get", () {
4675
4676 var mock = new HttpServerMock();
4677 api.ServicesRolloutsResourceApi res = new api.ServicemanagementApi(mock).s ervices.rollouts;
4678 var arg_serviceName = "foo";
4679 var arg_rolloutId = "foo";
4680 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
4681 var path = (req.url).path;
4682 var pathOffset = 0;
4683 var index;
4684 var subPart;
4685 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
4686 pathOffset += 1;
4687 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("v1/services/"));
4688 pathOffset += 12;
4689 index = path.indexOf("/rollouts/", pathOffset);
4690 unittest.expect(index >= 0, unittest.isTrue);
4691 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
4692 pathOffset = index;
4693 unittest.expect(subPart, unittest.equals("$arg_serviceName"));
4694 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/rollouts/"));
4695 pathOffset += 10;
4696 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
4697 pathOffset = path.length;
4698 unittest.expect(subPart, unittest.equals("$arg_rolloutId"));
4699
4700 var query = (req.url).query;
4701 var queryOffset = 0;
4702 var queryMap = {};
4703 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4704 parseBool(n) {
4705 if (n == "true") return true;
4706 if (n == "false") return false;
4707 if (n == null) return null;
4708 throw new core.ArgumentError("Invalid boolean: $n");
4709 }
4710 if (query.length > 0) {
4711 for (var part in query.split("&")) {
4712 var keyvalue = part.split("=");
4713 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
4714 }
4715 }
4716
4717
4718 var h = {
4719 "content-type" : "application/json; charset=utf-8",
4720 };
4721 var resp = convert.JSON.encode(buildRollout());
4722 return new async.Future.value(stringResponse(200, h, resp));
4723 }), true);
4724 res.get(arg_serviceName, arg_rolloutId).then(unittest.expectAsync(((api.Ro llout response) {
4725 checkRollout(response);
4726 })));
4727 });
4728
4729 unittest.test("method--list", () {
4730
4731 var mock = new HttpServerMock();
4732 api.ServicesRolloutsResourceApi res = new api.ServicemanagementApi(mock).s ervices.rollouts;
4733 var arg_serviceName = "foo";
4734 var arg_pageSize = 42;
4735 var arg_pageToken = "foo";
4736 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
4737 var path = (req.url).path;
4738 var pathOffset = 0;
4739 var index;
4740 var subPart;
4741 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
4742 pathOffset += 1;
4743 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("v1/services/"));
4744 pathOffset += 12;
4745 index = path.indexOf("/rollouts", pathOffset);
4746 unittest.expect(index >= 0, unittest.isTrue);
4747 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
4748 pathOffset = index;
4749 unittest.expect(subPart, unittest.equals("$arg_serviceName"));
4750 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/rollouts"));
4751 pathOffset += 9;
4752
4753 var query = (req.url).query;
4754 var queryOffset = 0;
4755 var queryMap = {};
4756 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4757 parseBool(n) {
4758 if (n == "true") return true;
4759 if (n == "false") return false;
4760 if (n == null) return null;
4761 throw new core.ArgumentError("Invalid boolean: $n");
4762 }
4763 if (query.length > 0) {
4764 for (var part in query.split("&")) {
4765 var keyvalue = part.split("=");
4766 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
4767 }
4768 }
4769 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize));
4770 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
4771
4772
4773 var h = {
4774 "content-type" : "application/json; charset=utf-8",
4775 };
4776 var resp = convert.JSON.encode(buildListServiceRolloutsResponse());
4777 return new async.Future.value(stringResponse(200, h, resp));
4778 }), true);
4779 res.list(arg_serviceName, pageSize: arg_pageSize, pageToken: arg_pageToken ).then(unittest.expectAsync(((api.ListServiceRolloutsResponse response) {
4780 checkListServiceRolloutsResponse(response);
4781 })));
4782 });
4783
4784 });
4785
4786
4787 }
4788
OLDNEW
« no previous file with comments | « generated/googleapis/test/servicecontrol/v1_test.dart ('k') | generated/googleapis/test/sheets/v4_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698