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

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

Issue 1797933002: Api-roll 33: 2016-03-14 (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: Added resources/*/CHANGELOG.md, addresssed comments Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 library googleapis_beta.appengine.v1beta5.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_beta/appengine/v1beta5.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 buildCounterApiConfigHandler = 0;
55 buildApiConfigHandler() {
56 var o = new api.ApiConfigHandler();
57 buildCounterApiConfigHandler++;
58 if (buildCounterApiConfigHandler < 3) {
59 o.authFailAction = "foo";
60 o.login = "foo";
61 o.script = "foo";
62 o.securityLevel = "foo";
63 o.url = "foo";
64 }
65 buildCounterApiConfigHandler--;
66 return o;
67 }
68
69 checkApiConfigHandler(api.ApiConfigHandler o) {
70 buildCounterApiConfigHandler++;
71 if (buildCounterApiConfigHandler < 3) {
72 unittest.expect(o.authFailAction, unittest.equals('foo'));
73 unittest.expect(o.login, unittest.equals('foo'));
74 unittest.expect(o.script, unittest.equals('foo'));
75 unittest.expect(o.securityLevel, unittest.equals('foo'));
76 unittest.expect(o.url, unittest.equals('foo'));
77 }
78 buildCounterApiConfigHandler--;
79 }
80
81 core.int buildCounterApiEndpointHandler = 0;
82 buildApiEndpointHandler() {
83 var o = new api.ApiEndpointHandler();
84 buildCounterApiEndpointHandler++;
85 if (buildCounterApiEndpointHandler < 3) {
86 o.scriptPath = "foo";
87 }
88 buildCounterApiEndpointHandler--;
89 return o;
90 }
91
92 checkApiEndpointHandler(api.ApiEndpointHandler o) {
93 buildCounterApiEndpointHandler++;
94 if (buildCounterApiEndpointHandler < 3) {
95 unittest.expect(o.scriptPath, unittest.equals('foo'));
96 }
97 buildCounterApiEndpointHandler--;
98 }
99
100 buildUnnamed3459() {
101 var o = new core.List<api.UrlDispatchRule>();
102 o.add(buildUrlDispatchRule());
103 o.add(buildUrlDispatchRule());
104 return o;
105 }
106
107 checkUnnamed3459(core.List<api.UrlDispatchRule> o) {
108 unittest.expect(o, unittest.hasLength(2));
109 checkUrlDispatchRule(o[0]);
110 checkUrlDispatchRule(o[1]);
111 }
112
113 core.int buildCounterApplication = 0;
114 buildApplication() {
115 var o = new api.Application();
116 buildCounterApplication++;
117 if (buildCounterApplication < 3) {
118 o.authDomain = "foo";
119 o.codeBucket = "foo";
120 o.defaultBucket = "foo";
121 o.defaultCookieExpiration = "foo";
122 o.defaultHostname = "foo";
123 o.dispatchRules = buildUnnamed3459();
124 o.id = "foo";
125 o.location = "foo";
126 o.name = "foo";
127 }
128 buildCounterApplication--;
129 return o;
130 }
131
132 checkApplication(api.Application o) {
133 buildCounterApplication++;
134 if (buildCounterApplication < 3) {
135 unittest.expect(o.authDomain, unittest.equals('foo'));
136 unittest.expect(o.codeBucket, unittest.equals('foo'));
137 unittest.expect(o.defaultBucket, unittest.equals('foo'));
138 unittest.expect(o.defaultCookieExpiration, unittest.equals('foo'));
139 unittest.expect(o.defaultHostname, unittest.equals('foo'));
140 checkUnnamed3459(o.dispatchRules);
141 unittest.expect(o.id, unittest.equals('foo'));
142 unittest.expect(o.location, unittest.equals('foo'));
143 unittest.expect(o.name, unittest.equals('foo'));
144 }
145 buildCounterApplication--;
146 }
147
148 core.int buildCounterAutomaticScaling = 0;
149 buildAutomaticScaling() {
150 var o = new api.AutomaticScaling();
151 buildCounterAutomaticScaling++;
152 if (buildCounterAutomaticScaling < 3) {
153 o.coolDownPeriod = "foo";
154 o.cpuUtilization = buildCpuUtilization();
155 o.diskUtilization = buildDiskUtilization();
156 o.maxConcurrentRequests = 42;
157 o.maxIdleInstances = 42;
158 o.maxPendingLatency = "foo";
159 o.maxTotalInstances = 42;
160 o.minIdleInstances = 42;
161 o.minPendingLatency = "foo";
162 o.minTotalInstances = 42;
163 o.networkUtilization = buildNetworkUtilization();
164 o.requestUtilization = buildRequestUtilization();
165 }
166 buildCounterAutomaticScaling--;
167 return o;
168 }
169
170 checkAutomaticScaling(api.AutomaticScaling o) {
171 buildCounterAutomaticScaling++;
172 if (buildCounterAutomaticScaling < 3) {
173 unittest.expect(o.coolDownPeriod, unittest.equals('foo'));
174 checkCpuUtilization(o.cpuUtilization);
175 checkDiskUtilization(o.diskUtilization);
176 unittest.expect(o.maxConcurrentRequests, unittest.equals(42));
177 unittest.expect(o.maxIdleInstances, unittest.equals(42));
178 unittest.expect(o.maxPendingLatency, unittest.equals('foo'));
179 unittest.expect(o.maxTotalInstances, unittest.equals(42));
180 unittest.expect(o.minIdleInstances, unittest.equals(42));
181 unittest.expect(o.minPendingLatency, unittest.equals('foo'));
182 unittest.expect(o.minTotalInstances, unittest.equals(42));
183 checkNetworkUtilization(o.networkUtilization);
184 checkRequestUtilization(o.requestUtilization);
185 }
186 buildCounterAutomaticScaling--;
187 }
188
189 core.int buildCounterBasicScaling = 0;
190 buildBasicScaling() {
191 var o = new api.BasicScaling();
192 buildCounterBasicScaling++;
193 if (buildCounterBasicScaling < 3) {
194 o.idleTimeout = "foo";
195 o.maxInstances = 42;
196 }
197 buildCounterBasicScaling--;
198 return o;
199 }
200
201 checkBasicScaling(api.BasicScaling o) {
202 buildCounterBasicScaling++;
203 if (buildCounterBasicScaling < 3) {
204 unittest.expect(o.idleTimeout, unittest.equals('foo'));
205 unittest.expect(o.maxInstances, unittest.equals(42));
206 }
207 buildCounterBasicScaling--;
208 }
209
210 core.int buildCounterContainerInfo = 0;
211 buildContainerInfo() {
212 var o = new api.ContainerInfo();
213 buildCounterContainerInfo++;
214 if (buildCounterContainerInfo < 3) {
215 o.image = "foo";
216 }
217 buildCounterContainerInfo--;
218 return o;
219 }
220
221 checkContainerInfo(api.ContainerInfo o) {
222 buildCounterContainerInfo++;
223 if (buildCounterContainerInfo < 3) {
224 unittest.expect(o.image, unittest.equals('foo'));
225 }
226 buildCounterContainerInfo--;
227 }
228
229 core.int buildCounterCpuUtilization = 0;
230 buildCpuUtilization() {
231 var o = new api.CpuUtilization();
232 buildCounterCpuUtilization++;
233 if (buildCounterCpuUtilization < 3) {
234 o.aggregationWindowLength = "foo";
235 o.targetUtilization = 42.0;
236 }
237 buildCounterCpuUtilization--;
238 return o;
239 }
240
241 checkCpuUtilization(api.CpuUtilization o) {
242 buildCounterCpuUtilization++;
243 if (buildCounterCpuUtilization < 3) {
244 unittest.expect(o.aggregationWindowLength, unittest.equals('foo'));
245 unittest.expect(o.targetUtilization, unittest.equals(42.0));
246 }
247 buildCounterCpuUtilization--;
248 }
249
250 buildUnnamed3460() {
251 var o = new core.Map<core.String, api.FileInfo>();
252 o["x"] = buildFileInfo();
253 o["y"] = buildFileInfo();
254 return o;
255 }
256
257 checkUnnamed3460(core.Map<core.String, api.FileInfo> o) {
258 unittest.expect(o, unittest.hasLength(2));
259 checkFileInfo(o["x"]);
260 checkFileInfo(o["y"]);
261 }
262
263 buildUnnamed3461() {
264 var o = new core.List<api.SourceReference>();
265 o.add(buildSourceReference());
266 o.add(buildSourceReference());
267 return o;
268 }
269
270 checkUnnamed3461(core.List<api.SourceReference> o) {
271 unittest.expect(o, unittest.hasLength(2));
272 checkSourceReference(o[0]);
273 checkSourceReference(o[1]);
274 }
275
276 core.int buildCounterDeployment = 0;
277 buildDeployment() {
278 var o = new api.Deployment();
279 buildCounterDeployment++;
280 if (buildCounterDeployment < 3) {
281 o.container = buildContainerInfo();
282 o.files = buildUnnamed3460();
283 o.sourceReferences = buildUnnamed3461();
284 }
285 buildCounterDeployment--;
286 return o;
287 }
288
289 checkDeployment(api.Deployment o) {
290 buildCounterDeployment++;
291 if (buildCounterDeployment < 3) {
292 checkContainerInfo(o.container);
293 checkUnnamed3460(o.files);
294 checkUnnamed3461(o.sourceReferences);
295 }
296 buildCounterDeployment--;
297 }
298
299 core.int buildCounterDiskUtilization = 0;
300 buildDiskUtilization() {
301 var o = new api.DiskUtilization();
302 buildCounterDiskUtilization++;
303 if (buildCounterDiskUtilization < 3) {
304 o.targetReadBytesPerSec = 42;
305 o.targetReadOpsPerSec = 42;
306 o.targetWriteBytesPerSec = 42;
307 o.targetWriteOpsPerSec = 42;
308 }
309 buildCounterDiskUtilization--;
310 return o;
311 }
312
313 checkDiskUtilization(api.DiskUtilization o) {
314 buildCounterDiskUtilization++;
315 if (buildCounterDiskUtilization < 3) {
316 unittest.expect(o.targetReadBytesPerSec, unittest.equals(42));
317 unittest.expect(o.targetReadOpsPerSec, unittest.equals(42));
318 unittest.expect(o.targetWriteBytesPerSec, unittest.equals(42));
319 unittest.expect(o.targetWriteOpsPerSec, unittest.equals(42));
320 }
321 buildCounterDiskUtilization--;
322 }
323
324 core.int buildCounterErrorHandler = 0;
325 buildErrorHandler() {
326 var o = new api.ErrorHandler();
327 buildCounterErrorHandler++;
328 if (buildCounterErrorHandler < 3) {
329 o.errorCode = "foo";
330 o.mimeType = "foo";
331 o.staticFile = "foo";
332 }
333 buildCounterErrorHandler--;
334 return o;
335 }
336
337 checkErrorHandler(api.ErrorHandler o) {
338 buildCounterErrorHandler++;
339 if (buildCounterErrorHandler < 3) {
340 unittest.expect(o.errorCode, unittest.equals('foo'));
341 unittest.expect(o.mimeType, unittest.equals('foo'));
342 unittest.expect(o.staticFile, unittest.equals('foo'));
343 }
344 buildCounterErrorHandler--;
345 }
346
347 core.int buildCounterFileInfo = 0;
348 buildFileInfo() {
349 var o = new api.FileInfo();
350 buildCounterFileInfo++;
351 if (buildCounterFileInfo < 3) {
352 o.mimeType = "foo";
353 o.sha1Sum = "foo";
354 o.sourceUrl = "foo";
355 }
356 buildCounterFileInfo--;
357 return o;
358 }
359
360 checkFileInfo(api.FileInfo o) {
361 buildCounterFileInfo++;
362 if (buildCounterFileInfo < 3) {
363 unittest.expect(o.mimeType, unittest.equals('foo'));
364 unittest.expect(o.sha1Sum, unittest.equals('foo'));
365 unittest.expect(o.sourceUrl, unittest.equals('foo'));
366 }
367 buildCounterFileInfo--;
368 }
369
370 core.int buildCounterHealthCheck = 0;
371 buildHealthCheck() {
372 var o = new api.HealthCheck();
373 buildCounterHealthCheck++;
374 if (buildCounterHealthCheck < 3) {
375 o.checkInterval = "foo";
376 o.disableHealthCheck = true;
377 o.healthyThreshold = 42;
378 o.host = "foo";
379 o.restartThreshold = 42;
380 o.timeout = "foo";
381 o.unhealthyThreshold = 42;
382 }
383 buildCounterHealthCheck--;
384 return o;
385 }
386
387 checkHealthCheck(api.HealthCheck o) {
388 buildCounterHealthCheck++;
389 if (buildCounterHealthCheck < 3) {
390 unittest.expect(o.checkInterval, unittest.equals('foo'));
391 unittest.expect(o.disableHealthCheck, unittest.isTrue);
392 unittest.expect(o.healthyThreshold, unittest.equals(42));
393 unittest.expect(o.host, unittest.equals('foo'));
394 unittest.expect(o.restartThreshold, unittest.equals(42));
395 unittest.expect(o.timeout, unittest.equals('foo'));
396 unittest.expect(o.unhealthyThreshold, unittest.equals(42));
397 }
398 buildCounterHealthCheck--;
399 }
400
401 core.int buildCounterLibrary = 0;
402 buildLibrary() {
403 var o = new api.Library();
404 buildCounterLibrary++;
405 if (buildCounterLibrary < 3) {
406 o.name = "foo";
407 o.version = "foo";
408 }
409 buildCounterLibrary--;
410 return o;
411 }
412
413 checkLibrary(api.Library o) {
414 buildCounterLibrary++;
415 if (buildCounterLibrary < 3) {
416 unittest.expect(o.name, unittest.equals('foo'));
417 unittest.expect(o.version, unittest.equals('foo'));
418 }
419 buildCounterLibrary--;
420 }
421
422 buildUnnamed3462() {
423 var o = new core.List<api.Operation>();
424 o.add(buildOperation());
425 o.add(buildOperation());
426 return o;
427 }
428
429 checkUnnamed3462(core.List<api.Operation> o) {
430 unittest.expect(o, unittest.hasLength(2));
431 checkOperation(o[0]);
432 checkOperation(o[1]);
433 }
434
435 core.int buildCounterListOperationsResponse = 0;
436 buildListOperationsResponse() {
437 var o = new api.ListOperationsResponse();
438 buildCounterListOperationsResponse++;
439 if (buildCounterListOperationsResponse < 3) {
440 o.nextPageToken = "foo";
441 o.operations = buildUnnamed3462();
442 }
443 buildCounterListOperationsResponse--;
444 return o;
445 }
446
447 checkListOperationsResponse(api.ListOperationsResponse o) {
448 buildCounterListOperationsResponse++;
449 if (buildCounterListOperationsResponse < 3) {
450 unittest.expect(o.nextPageToken, unittest.equals('foo'));
451 checkUnnamed3462(o.operations);
452 }
453 buildCounterListOperationsResponse--;
454 }
455
456 buildUnnamed3463() {
457 var o = new core.List<api.Service>();
458 o.add(buildService());
459 o.add(buildService());
460 return o;
461 }
462
463 checkUnnamed3463(core.List<api.Service> o) {
464 unittest.expect(o, unittest.hasLength(2));
465 checkService(o[0]);
466 checkService(o[1]);
467 }
468
469 core.int buildCounterListServicesResponse = 0;
470 buildListServicesResponse() {
471 var o = new api.ListServicesResponse();
472 buildCounterListServicesResponse++;
473 if (buildCounterListServicesResponse < 3) {
474 o.nextPageToken = "foo";
475 o.services = buildUnnamed3463();
476 }
477 buildCounterListServicesResponse--;
478 return o;
479 }
480
481 checkListServicesResponse(api.ListServicesResponse o) {
482 buildCounterListServicesResponse++;
483 if (buildCounterListServicesResponse < 3) {
484 unittest.expect(o.nextPageToken, unittest.equals('foo'));
485 checkUnnamed3463(o.services);
486 }
487 buildCounterListServicesResponse--;
488 }
489
490 buildUnnamed3464() {
491 var o = new core.List<api.Version>();
492 o.add(buildVersion());
493 o.add(buildVersion());
494 return o;
495 }
496
497 checkUnnamed3464(core.List<api.Version> o) {
498 unittest.expect(o, unittest.hasLength(2));
499 checkVersion(o[0]);
500 checkVersion(o[1]);
501 }
502
503 core.int buildCounterListVersionsResponse = 0;
504 buildListVersionsResponse() {
505 var o = new api.ListVersionsResponse();
506 buildCounterListVersionsResponse++;
507 if (buildCounterListVersionsResponse < 3) {
508 o.nextPageToken = "foo";
509 o.versions = buildUnnamed3464();
510 }
511 buildCounterListVersionsResponse--;
512 return o;
513 }
514
515 checkListVersionsResponse(api.ListVersionsResponse o) {
516 buildCounterListVersionsResponse++;
517 if (buildCounterListVersionsResponse < 3) {
518 unittest.expect(o.nextPageToken, unittest.equals('foo'));
519 checkUnnamed3464(o.versions);
520 }
521 buildCounterListVersionsResponse--;
522 }
523
524 core.int buildCounterManualScaling = 0;
525 buildManualScaling() {
526 var o = new api.ManualScaling();
527 buildCounterManualScaling++;
528 if (buildCounterManualScaling < 3) {
529 o.instances = 42;
530 }
531 buildCounterManualScaling--;
532 return o;
533 }
534
535 checkManualScaling(api.ManualScaling o) {
536 buildCounterManualScaling++;
537 if (buildCounterManualScaling < 3) {
538 unittest.expect(o.instances, unittest.equals(42));
539 }
540 buildCounterManualScaling--;
541 }
542
543 buildUnnamed3465() {
544 var o = new core.List<core.String>();
545 o.add("foo");
546 o.add("foo");
547 return o;
548 }
549
550 checkUnnamed3465(core.List<core.String> o) {
551 unittest.expect(o, unittest.hasLength(2));
552 unittest.expect(o[0], unittest.equals('foo'));
553 unittest.expect(o[1], unittest.equals('foo'));
554 }
555
556 core.int buildCounterNetwork = 0;
557 buildNetwork() {
558 var o = new api.Network();
559 buildCounterNetwork++;
560 if (buildCounterNetwork < 3) {
561 o.forwardedPorts = buildUnnamed3465();
562 o.instanceTag = "foo";
563 o.name = "foo";
564 }
565 buildCounterNetwork--;
566 return o;
567 }
568
569 checkNetwork(api.Network o) {
570 buildCounterNetwork++;
571 if (buildCounterNetwork < 3) {
572 checkUnnamed3465(o.forwardedPorts);
573 unittest.expect(o.instanceTag, unittest.equals('foo'));
574 unittest.expect(o.name, unittest.equals('foo'));
575 }
576 buildCounterNetwork--;
577 }
578
579 core.int buildCounterNetworkUtilization = 0;
580 buildNetworkUtilization() {
581 var o = new api.NetworkUtilization();
582 buildCounterNetworkUtilization++;
583 if (buildCounterNetworkUtilization < 3) {
584 o.targetReceivedBytesPerSec = 42;
585 o.targetReceivedPacketsPerSec = 42;
586 o.targetSentBytesPerSec = 42;
587 o.targetSentPacketsPerSec = 42;
588 }
589 buildCounterNetworkUtilization--;
590 return o;
591 }
592
593 checkNetworkUtilization(api.NetworkUtilization o) {
594 buildCounterNetworkUtilization++;
595 if (buildCounterNetworkUtilization < 3) {
596 unittest.expect(o.targetReceivedBytesPerSec, unittest.equals(42));
597 unittest.expect(o.targetReceivedPacketsPerSec, unittest.equals(42));
598 unittest.expect(o.targetSentBytesPerSec, unittest.equals(42));
599 unittest.expect(o.targetSentPacketsPerSec, unittest.equals(42));
600 }
601 buildCounterNetworkUtilization--;
602 }
603
604 buildUnnamed3466() {
605 var o = new core.Map<core.String, core.Object>();
606 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
607 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
608 return o;
609 }
610
611 checkUnnamed3466(core.Map<core.String, core.Object> o) {
612 unittest.expect(o, unittest.hasLength(2));
613 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'));
614 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'));
615 }
616
617 buildUnnamed3467() {
618 var o = new core.Map<core.String, core.Object>();
619 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
620 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
621 return o;
622 }
623
624 checkUnnamed3467(core.Map<core.String, core.Object> o) {
625 unittest.expect(o, unittest.hasLength(2));
626 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'));
627 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'));
628 }
629
630 core.int buildCounterOperation = 0;
631 buildOperation() {
632 var o = new api.Operation();
633 buildCounterOperation++;
634 if (buildCounterOperation < 3) {
635 o.done = true;
636 o.error = buildStatus();
637 o.metadata = buildUnnamed3466();
638 o.name = "foo";
639 o.response = buildUnnamed3467();
640 }
641 buildCounterOperation--;
642 return o;
643 }
644
645 checkOperation(api.Operation o) {
646 buildCounterOperation++;
647 if (buildCounterOperation < 3) {
648 unittest.expect(o.done, unittest.isTrue);
649 checkStatus(o.error);
650 checkUnnamed3466(o.metadata);
651 unittest.expect(o.name, unittest.equals('foo'));
652 checkUnnamed3467(o.response);
653 }
654 buildCounterOperation--;
655 }
656
657 core.int buildCounterOperationMetadata = 0;
658 buildOperationMetadata() {
659 var o = new api.OperationMetadata();
660 buildCounterOperationMetadata++;
661 if (buildCounterOperationMetadata < 3) {
662 o.endTime = "foo";
663 o.insertTime = "foo";
664 o.method = "foo";
665 o.operationType = "foo";
666 o.target = "foo";
667 o.user = "foo";
668 }
669 buildCounterOperationMetadata--;
670 return o;
671 }
672
673 checkOperationMetadata(api.OperationMetadata o) {
674 buildCounterOperationMetadata++;
675 if (buildCounterOperationMetadata < 3) {
676 unittest.expect(o.endTime, unittest.equals('foo'));
677 unittest.expect(o.insertTime, unittest.equals('foo'));
678 unittest.expect(o.method, unittest.equals('foo'));
679 unittest.expect(o.operationType, unittest.equals('foo'));
680 unittest.expect(o.target, unittest.equals('foo'));
681 unittest.expect(o.user, unittest.equals('foo'));
682 }
683 buildCounterOperationMetadata--;
684 }
685
686 core.int buildCounterOperationMetadataV1Beta5 = 0;
687 buildOperationMetadataV1Beta5() {
688 var o = new api.OperationMetadataV1Beta5();
689 buildCounterOperationMetadataV1Beta5++;
690 if (buildCounterOperationMetadataV1Beta5 < 3) {
691 o.endTime = "foo";
692 o.insertTime = "foo";
693 o.method = "foo";
694 o.target = "foo";
695 o.user = "foo";
696 }
697 buildCounterOperationMetadataV1Beta5--;
698 return o;
699 }
700
701 checkOperationMetadataV1Beta5(api.OperationMetadataV1Beta5 o) {
702 buildCounterOperationMetadataV1Beta5++;
703 if (buildCounterOperationMetadataV1Beta5 < 3) {
704 unittest.expect(o.endTime, unittest.equals('foo'));
705 unittest.expect(o.insertTime, unittest.equals('foo'));
706 unittest.expect(o.method, unittest.equals('foo'));
707 unittest.expect(o.target, unittest.equals('foo'));
708 unittest.expect(o.user, unittest.equals('foo'));
709 }
710 buildCounterOperationMetadataV1Beta5--;
711 }
712
713 core.int buildCounterRequestUtilization = 0;
714 buildRequestUtilization() {
715 var o = new api.RequestUtilization();
716 buildCounterRequestUtilization++;
717 if (buildCounterRequestUtilization < 3) {
718 o.targetConcurrentRequests = 42;
719 o.targetRequestCountPerSec = 42;
720 }
721 buildCounterRequestUtilization--;
722 return o;
723 }
724
725 checkRequestUtilization(api.RequestUtilization o) {
726 buildCounterRequestUtilization++;
727 if (buildCounterRequestUtilization < 3) {
728 unittest.expect(o.targetConcurrentRequests, unittest.equals(42));
729 unittest.expect(o.targetRequestCountPerSec, unittest.equals(42));
730 }
731 buildCounterRequestUtilization--;
732 }
733
734 core.int buildCounterResources = 0;
735 buildResources() {
736 var o = new api.Resources();
737 buildCounterResources++;
738 if (buildCounterResources < 3) {
739 o.cpu = 42.0;
740 o.diskGb = 42.0;
741 o.memoryGb = 42.0;
742 }
743 buildCounterResources--;
744 return o;
745 }
746
747 checkResources(api.Resources o) {
748 buildCounterResources++;
749 if (buildCounterResources < 3) {
750 unittest.expect(o.cpu, unittest.equals(42.0));
751 unittest.expect(o.diskGb, unittest.equals(42.0));
752 unittest.expect(o.memoryGb, unittest.equals(42.0));
753 }
754 buildCounterResources--;
755 }
756
757 core.int buildCounterScriptHandler = 0;
758 buildScriptHandler() {
759 var o = new api.ScriptHandler();
760 buildCounterScriptHandler++;
761 if (buildCounterScriptHandler < 3) {
762 o.scriptPath = "foo";
763 }
764 buildCounterScriptHandler--;
765 return o;
766 }
767
768 checkScriptHandler(api.ScriptHandler o) {
769 buildCounterScriptHandler++;
770 if (buildCounterScriptHandler < 3) {
771 unittest.expect(o.scriptPath, unittest.equals('foo'));
772 }
773 buildCounterScriptHandler--;
774 }
775
776 core.int buildCounterService = 0;
777 buildService() {
778 var o = new api.Service();
779 buildCounterService++;
780 if (buildCounterService < 3) {
781 o.id = "foo";
782 o.name = "foo";
783 o.split = buildTrafficSplit();
784 }
785 buildCounterService--;
786 return o;
787 }
788
789 checkService(api.Service o) {
790 buildCounterService++;
791 if (buildCounterService < 3) {
792 unittest.expect(o.id, unittest.equals('foo'));
793 unittest.expect(o.name, unittest.equals('foo'));
794 checkTrafficSplit(o.split);
795 }
796 buildCounterService--;
797 }
798
799 core.int buildCounterSourceReference = 0;
800 buildSourceReference() {
801 var o = new api.SourceReference();
802 buildCounterSourceReference++;
803 if (buildCounterSourceReference < 3) {
804 o.repository = "foo";
805 o.revisionId = "foo";
806 }
807 buildCounterSourceReference--;
808 return o;
809 }
810
811 checkSourceReference(api.SourceReference o) {
812 buildCounterSourceReference++;
813 if (buildCounterSourceReference < 3) {
814 unittest.expect(o.repository, unittest.equals('foo'));
815 unittest.expect(o.revisionId, unittest.equals('foo'));
816 }
817 buildCounterSourceReference--;
818 }
819
820 buildUnnamed3468() {
821 var o = new core.Map<core.String, core.String>();
822 o["x"] = "foo";
823 o["y"] = "foo";
824 return o;
825 }
826
827 checkUnnamed3468(core.Map<core.String, core.String> o) {
828 unittest.expect(o, unittest.hasLength(2));
829 unittest.expect(o["x"], unittest.equals('foo'));
830 unittest.expect(o["y"], unittest.equals('foo'));
831 }
832
833 core.int buildCounterStaticFilesHandler = 0;
834 buildStaticFilesHandler() {
835 var o = new api.StaticFilesHandler();
836 buildCounterStaticFilesHandler++;
837 if (buildCounterStaticFilesHandler < 3) {
838 o.applicationReadable = true;
839 o.expiration = "foo";
840 o.httpHeaders = buildUnnamed3468();
841 o.mimeType = "foo";
842 o.path = "foo";
843 o.requireMatchingFile = true;
844 o.uploadPathRegex = "foo";
845 }
846 buildCounterStaticFilesHandler--;
847 return o;
848 }
849
850 checkStaticFilesHandler(api.StaticFilesHandler o) {
851 buildCounterStaticFilesHandler++;
852 if (buildCounterStaticFilesHandler < 3) {
853 unittest.expect(o.applicationReadable, unittest.isTrue);
854 unittest.expect(o.expiration, unittest.equals('foo'));
855 checkUnnamed3468(o.httpHeaders);
856 unittest.expect(o.mimeType, unittest.equals('foo'));
857 unittest.expect(o.path, unittest.equals('foo'));
858 unittest.expect(o.requireMatchingFile, unittest.isTrue);
859 unittest.expect(o.uploadPathRegex, unittest.equals('foo'));
860 }
861 buildCounterStaticFilesHandler--;
862 }
863
864 buildUnnamed3469() {
865 var o = new core.Map<core.String, core.Object>();
866 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
867 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
868 return o;
869 }
870
871 checkUnnamed3469(core.Map<core.String, core.Object> o) {
872 unittest.expect(o, unittest.hasLength(2));
873 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'));
874 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'));
875 }
876
877 buildUnnamed3470() {
878 var o = new core.List<core.Map<core.String, core.Object>>();
879 o.add(buildUnnamed3469());
880 o.add(buildUnnamed3469());
881 return o;
882 }
883
884 checkUnnamed3470(core.List<core.Map<core.String, core.Object>> o) {
885 unittest.expect(o, unittest.hasLength(2));
886 checkUnnamed3469(o[0]);
887 checkUnnamed3469(o[1]);
888 }
889
890 core.int buildCounterStatus = 0;
891 buildStatus() {
892 var o = new api.Status();
893 buildCounterStatus++;
894 if (buildCounterStatus < 3) {
895 o.code = 42;
896 o.details = buildUnnamed3470();
897 o.message = "foo";
898 }
899 buildCounterStatus--;
900 return o;
901 }
902
903 checkStatus(api.Status o) {
904 buildCounterStatus++;
905 if (buildCounterStatus < 3) {
906 unittest.expect(o.code, unittest.equals(42));
907 checkUnnamed3470(o.details);
908 unittest.expect(o.message, unittest.equals('foo'));
909 }
910 buildCounterStatus--;
911 }
912
913 buildUnnamed3471() {
914 var o = new core.Map<core.String, core.double>();
915 o["x"] = 42.0;
916 o["y"] = 42.0;
917 return o;
918 }
919
920 checkUnnamed3471(core.Map<core.String, core.double> o) {
921 unittest.expect(o, unittest.hasLength(2));
922 unittest.expect(o["x"], unittest.equals(42.0));
923 unittest.expect(o["y"], unittest.equals(42.0));
924 }
925
926 core.int buildCounterTrafficSplit = 0;
927 buildTrafficSplit() {
928 var o = new api.TrafficSplit();
929 buildCounterTrafficSplit++;
930 if (buildCounterTrafficSplit < 3) {
931 o.allocations = buildUnnamed3471();
932 o.shardBy = "foo";
933 }
934 buildCounterTrafficSplit--;
935 return o;
936 }
937
938 checkTrafficSplit(api.TrafficSplit o) {
939 buildCounterTrafficSplit++;
940 if (buildCounterTrafficSplit < 3) {
941 checkUnnamed3471(o.allocations);
942 unittest.expect(o.shardBy, unittest.equals('foo'));
943 }
944 buildCounterTrafficSplit--;
945 }
946
947 core.int buildCounterUrlDispatchRule = 0;
948 buildUrlDispatchRule() {
949 var o = new api.UrlDispatchRule();
950 buildCounterUrlDispatchRule++;
951 if (buildCounterUrlDispatchRule < 3) {
952 o.domain = "foo";
953 o.path = "foo";
954 o.service = "foo";
955 }
956 buildCounterUrlDispatchRule--;
957 return o;
958 }
959
960 checkUrlDispatchRule(api.UrlDispatchRule o) {
961 buildCounterUrlDispatchRule++;
962 if (buildCounterUrlDispatchRule < 3) {
963 unittest.expect(o.domain, unittest.equals('foo'));
964 unittest.expect(o.path, unittest.equals('foo'));
965 unittest.expect(o.service, unittest.equals('foo'));
966 }
967 buildCounterUrlDispatchRule--;
968 }
969
970 core.int buildCounterUrlMap = 0;
971 buildUrlMap() {
972 var o = new api.UrlMap();
973 buildCounterUrlMap++;
974 if (buildCounterUrlMap < 3) {
975 o.apiEndpoint = buildApiEndpointHandler();
976 o.authFailAction = "foo";
977 o.login = "foo";
978 o.redirectHttpResponseCode = "foo";
979 o.script = buildScriptHandler();
980 o.securityLevel = "foo";
981 o.staticFiles = buildStaticFilesHandler();
982 o.urlRegex = "foo";
983 }
984 buildCounterUrlMap--;
985 return o;
986 }
987
988 checkUrlMap(api.UrlMap o) {
989 buildCounterUrlMap++;
990 if (buildCounterUrlMap < 3) {
991 checkApiEndpointHandler(o.apiEndpoint);
992 unittest.expect(o.authFailAction, unittest.equals('foo'));
993 unittest.expect(o.login, unittest.equals('foo'));
994 unittest.expect(o.redirectHttpResponseCode, unittest.equals('foo'));
995 checkScriptHandler(o.script);
996 unittest.expect(o.securityLevel, unittest.equals('foo'));
997 checkStaticFilesHandler(o.staticFiles);
998 unittest.expect(o.urlRegex, unittest.equals('foo'));
999 }
1000 buildCounterUrlMap--;
1001 }
1002
1003 buildUnnamed3472() {
1004 var o = new core.Map<core.String, core.String>();
1005 o["x"] = "foo";
1006 o["y"] = "foo";
1007 return o;
1008 }
1009
1010 checkUnnamed3472(core.Map<core.String, core.String> o) {
1011 unittest.expect(o, unittest.hasLength(2));
1012 unittest.expect(o["x"], unittest.equals('foo'));
1013 unittest.expect(o["y"], unittest.equals('foo'));
1014 }
1015
1016 buildUnnamed3473() {
1017 var o = new core.Map<core.String, core.String>();
1018 o["x"] = "foo";
1019 o["y"] = "foo";
1020 return o;
1021 }
1022
1023 checkUnnamed3473(core.Map<core.String, core.String> o) {
1024 unittest.expect(o, unittest.hasLength(2));
1025 unittest.expect(o["x"], unittest.equals('foo'));
1026 unittest.expect(o["y"], unittest.equals('foo'));
1027 }
1028
1029 buildUnnamed3474() {
1030 var o = new core.List<api.ErrorHandler>();
1031 o.add(buildErrorHandler());
1032 o.add(buildErrorHandler());
1033 return o;
1034 }
1035
1036 checkUnnamed3474(core.List<api.ErrorHandler> o) {
1037 unittest.expect(o, unittest.hasLength(2));
1038 checkErrorHandler(o[0]);
1039 checkErrorHandler(o[1]);
1040 }
1041
1042 buildUnnamed3475() {
1043 var o = new core.List<api.UrlMap>();
1044 o.add(buildUrlMap());
1045 o.add(buildUrlMap());
1046 return o;
1047 }
1048
1049 checkUnnamed3475(core.List<api.UrlMap> o) {
1050 unittest.expect(o, unittest.hasLength(2));
1051 checkUrlMap(o[0]);
1052 checkUrlMap(o[1]);
1053 }
1054
1055 buildUnnamed3476() {
1056 var o = new core.List<core.String>();
1057 o.add("foo");
1058 o.add("foo");
1059 return o;
1060 }
1061
1062 checkUnnamed3476(core.List<core.String> o) {
1063 unittest.expect(o, unittest.hasLength(2));
1064 unittest.expect(o[0], unittest.equals('foo'));
1065 unittest.expect(o[1], unittest.equals('foo'));
1066 }
1067
1068 buildUnnamed3477() {
1069 var o = new core.List<api.Library>();
1070 o.add(buildLibrary());
1071 o.add(buildLibrary());
1072 return o;
1073 }
1074
1075 checkUnnamed3477(core.List<api.Library> o) {
1076 unittest.expect(o, unittest.hasLength(2));
1077 checkLibrary(o[0]);
1078 checkLibrary(o[1]);
1079 }
1080
1081 core.int buildCounterVersion = 0;
1082 buildVersion() {
1083 var o = new api.Version();
1084 buildCounterVersion++;
1085 if (buildCounterVersion < 3) {
1086 o.apiConfig = buildApiConfigHandler();
1087 o.automaticScaling = buildAutomaticScaling();
1088 o.basicScaling = buildBasicScaling();
1089 o.betaSettings = buildUnnamed3472();
1090 o.creationTime = "foo";
1091 o.defaultExpiration = "foo";
1092 o.deployer = "foo";
1093 o.deployment = buildDeployment();
1094 o.diskUsageBytes = "foo";
1095 o.env = "foo";
1096 o.envVariables = buildUnnamed3473();
1097 o.errorHandlers = buildUnnamed3474();
1098 o.handlers = buildUnnamed3475();
1099 o.healthCheck = buildHealthCheck();
1100 o.id = "foo";
1101 o.inboundServices = buildUnnamed3476();
1102 o.instanceClass = "foo";
1103 o.libraries = buildUnnamed3477();
1104 o.manualScaling = buildManualScaling();
1105 o.name = "foo";
1106 o.network = buildNetwork();
1107 o.nobuildFilesRegex = "foo";
1108 o.resources = buildResources();
1109 o.runtime = "foo";
1110 o.servingStatus = "foo";
1111 o.threadsafe = true;
1112 o.vm = true;
1113 }
1114 buildCounterVersion--;
1115 return o;
1116 }
1117
1118 checkVersion(api.Version o) {
1119 buildCounterVersion++;
1120 if (buildCounterVersion < 3) {
1121 checkApiConfigHandler(o.apiConfig);
1122 checkAutomaticScaling(o.automaticScaling);
1123 checkBasicScaling(o.basicScaling);
1124 checkUnnamed3472(o.betaSettings);
1125 unittest.expect(o.creationTime, unittest.equals('foo'));
1126 unittest.expect(o.defaultExpiration, unittest.equals('foo'));
1127 unittest.expect(o.deployer, unittest.equals('foo'));
1128 checkDeployment(o.deployment);
1129 unittest.expect(o.diskUsageBytes, unittest.equals('foo'));
1130 unittest.expect(o.env, unittest.equals('foo'));
1131 checkUnnamed3473(o.envVariables);
1132 checkUnnamed3474(o.errorHandlers);
1133 checkUnnamed3475(o.handlers);
1134 checkHealthCheck(o.healthCheck);
1135 unittest.expect(o.id, unittest.equals('foo'));
1136 checkUnnamed3476(o.inboundServices);
1137 unittest.expect(o.instanceClass, unittest.equals('foo'));
1138 checkUnnamed3477(o.libraries);
1139 checkManualScaling(o.manualScaling);
1140 unittest.expect(o.name, unittest.equals('foo'));
1141 checkNetwork(o.network);
1142 unittest.expect(o.nobuildFilesRegex, unittest.equals('foo'));
1143 checkResources(o.resources);
1144 unittest.expect(o.runtime, unittest.equals('foo'));
1145 unittest.expect(o.servingStatus, unittest.equals('foo'));
1146 unittest.expect(o.threadsafe, unittest.isTrue);
1147 unittest.expect(o.vm, unittest.isTrue);
1148 }
1149 buildCounterVersion--;
1150 }
1151
1152
1153 main() {
1154 unittest.group("obj-schema-ApiConfigHandler", () {
1155 unittest.test("to-json--from-json", () {
1156 var o = buildApiConfigHandler();
1157 var od = new api.ApiConfigHandler.fromJson(o.toJson());
1158 checkApiConfigHandler(od);
1159 });
1160 });
1161
1162
1163 unittest.group("obj-schema-ApiEndpointHandler", () {
1164 unittest.test("to-json--from-json", () {
1165 var o = buildApiEndpointHandler();
1166 var od = new api.ApiEndpointHandler.fromJson(o.toJson());
1167 checkApiEndpointHandler(od);
1168 });
1169 });
1170
1171
1172 unittest.group("obj-schema-Application", () {
1173 unittest.test("to-json--from-json", () {
1174 var o = buildApplication();
1175 var od = new api.Application.fromJson(o.toJson());
1176 checkApplication(od);
1177 });
1178 });
1179
1180
1181 unittest.group("obj-schema-AutomaticScaling", () {
1182 unittest.test("to-json--from-json", () {
1183 var o = buildAutomaticScaling();
1184 var od = new api.AutomaticScaling.fromJson(o.toJson());
1185 checkAutomaticScaling(od);
1186 });
1187 });
1188
1189
1190 unittest.group("obj-schema-BasicScaling", () {
1191 unittest.test("to-json--from-json", () {
1192 var o = buildBasicScaling();
1193 var od = new api.BasicScaling.fromJson(o.toJson());
1194 checkBasicScaling(od);
1195 });
1196 });
1197
1198
1199 unittest.group("obj-schema-ContainerInfo", () {
1200 unittest.test("to-json--from-json", () {
1201 var o = buildContainerInfo();
1202 var od = new api.ContainerInfo.fromJson(o.toJson());
1203 checkContainerInfo(od);
1204 });
1205 });
1206
1207
1208 unittest.group("obj-schema-CpuUtilization", () {
1209 unittest.test("to-json--from-json", () {
1210 var o = buildCpuUtilization();
1211 var od = new api.CpuUtilization.fromJson(o.toJson());
1212 checkCpuUtilization(od);
1213 });
1214 });
1215
1216
1217 unittest.group("obj-schema-Deployment", () {
1218 unittest.test("to-json--from-json", () {
1219 var o = buildDeployment();
1220 var od = new api.Deployment.fromJson(o.toJson());
1221 checkDeployment(od);
1222 });
1223 });
1224
1225
1226 unittest.group("obj-schema-DiskUtilization", () {
1227 unittest.test("to-json--from-json", () {
1228 var o = buildDiskUtilization();
1229 var od = new api.DiskUtilization.fromJson(o.toJson());
1230 checkDiskUtilization(od);
1231 });
1232 });
1233
1234
1235 unittest.group("obj-schema-ErrorHandler", () {
1236 unittest.test("to-json--from-json", () {
1237 var o = buildErrorHandler();
1238 var od = new api.ErrorHandler.fromJson(o.toJson());
1239 checkErrorHandler(od);
1240 });
1241 });
1242
1243
1244 unittest.group("obj-schema-FileInfo", () {
1245 unittest.test("to-json--from-json", () {
1246 var o = buildFileInfo();
1247 var od = new api.FileInfo.fromJson(o.toJson());
1248 checkFileInfo(od);
1249 });
1250 });
1251
1252
1253 unittest.group("obj-schema-HealthCheck", () {
1254 unittest.test("to-json--from-json", () {
1255 var o = buildHealthCheck();
1256 var od = new api.HealthCheck.fromJson(o.toJson());
1257 checkHealthCheck(od);
1258 });
1259 });
1260
1261
1262 unittest.group("obj-schema-Library", () {
1263 unittest.test("to-json--from-json", () {
1264 var o = buildLibrary();
1265 var od = new api.Library.fromJson(o.toJson());
1266 checkLibrary(od);
1267 });
1268 });
1269
1270
1271 unittest.group("obj-schema-ListOperationsResponse", () {
1272 unittest.test("to-json--from-json", () {
1273 var o = buildListOperationsResponse();
1274 var od = new api.ListOperationsResponse.fromJson(o.toJson());
1275 checkListOperationsResponse(od);
1276 });
1277 });
1278
1279
1280 unittest.group("obj-schema-ListServicesResponse", () {
1281 unittest.test("to-json--from-json", () {
1282 var o = buildListServicesResponse();
1283 var od = new api.ListServicesResponse.fromJson(o.toJson());
1284 checkListServicesResponse(od);
1285 });
1286 });
1287
1288
1289 unittest.group("obj-schema-ListVersionsResponse", () {
1290 unittest.test("to-json--from-json", () {
1291 var o = buildListVersionsResponse();
1292 var od = new api.ListVersionsResponse.fromJson(o.toJson());
1293 checkListVersionsResponse(od);
1294 });
1295 });
1296
1297
1298 unittest.group("obj-schema-ManualScaling", () {
1299 unittest.test("to-json--from-json", () {
1300 var o = buildManualScaling();
1301 var od = new api.ManualScaling.fromJson(o.toJson());
1302 checkManualScaling(od);
1303 });
1304 });
1305
1306
1307 unittest.group("obj-schema-Network", () {
1308 unittest.test("to-json--from-json", () {
1309 var o = buildNetwork();
1310 var od = new api.Network.fromJson(o.toJson());
1311 checkNetwork(od);
1312 });
1313 });
1314
1315
1316 unittest.group("obj-schema-NetworkUtilization", () {
1317 unittest.test("to-json--from-json", () {
1318 var o = buildNetworkUtilization();
1319 var od = new api.NetworkUtilization.fromJson(o.toJson());
1320 checkNetworkUtilization(od);
1321 });
1322 });
1323
1324
1325 unittest.group("obj-schema-Operation", () {
1326 unittest.test("to-json--from-json", () {
1327 var o = buildOperation();
1328 var od = new api.Operation.fromJson(o.toJson());
1329 checkOperation(od);
1330 });
1331 });
1332
1333
1334 unittest.group("obj-schema-OperationMetadata", () {
1335 unittest.test("to-json--from-json", () {
1336 var o = buildOperationMetadata();
1337 var od = new api.OperationMetadata.fromJson(o.toJson());
1338 checkOperationMetadata(od);
1339 });
1340 });
1341
1342
1343 unittest.group("obj-schema-OperationMetadataV1Beta5", () {
1344 unittest.test("to-json--from-json", () {
1345 var o = buildOperationMetadataV1Beta5();
1346 var od = new api.OperationMetadataV1Beta5.fromJson(o.toJson());
1347 checkOperationMetadataV1Beta5(od);
1348 });
1349 });
1350
1351
1352 unittest.group("obj-schema-RequestUtilization", () {
1353 unittest.test("to-json--from-json", () {
1354 var o = buildRequestUtilization();
1355 var od = new api.RequestUtilization.fromJson(o.toJson());
1356 checkRequestUtilization(od);
1357 });
1358 });
1359
1360
1361 unittest.group("obj-schema-Resources", () {
1362 unittest.test("to-json--from-json", () {
1363 var o = buildResources();
1364 var od = new api.Resources.fromJson(o.toJson());
1365 checkResources(od);
1366 });
1367 });
1368
1369
1370 unittest.group("obj-schema-ScriptHandler", () {
1371 unittest.test("to-json--from-json", () {
1372 var o = buildScriptHandler();
1373 var od = new api.ScriptHandler.fromJson(o.toJson());
1374 checkScriptHandler(od);
1375 });
1376 });
1377
1378
1379 unittest.group("obj-schema-Service", () {
1380 unittest.test("to-json--from-json", () {
1381 var o = buildService();
1382 var od = new api.Service.fromJson(o.toJson());
1383 checkService(od);
1384 });
1385 });
1386
1387
1388 unittest.group("obj-schema-SourceReference", () {
1389 unittest.test("to-json--from-json", () {
1390 var o = buildSourceReference();
1391 var od = new api.SourceReference.fromJson(o.toJson());
1392 checkSourceReference(od);
1393 });
1394 });
1395
1396
1397 unittest.group("obj-schema-StaticFilesHandler", () {
1398 unittest.test("to-json--from-json", () {
1399 var o = buildStaticFilesHandler();
1400 var od = new api.StaticFilesHandler.fromJson(o.toJson());
1401 checkStaticFilesHandler(od);
1402 });
1403 });
1404
1405
1406 unittest.group("obj-schema-Status", () {
1407 unittest.test("to-json--from-json", () {
1408 var o = buildStatus();
1409 var od = new api.Status.fromJson(o.toJson());
1410 checkStatus(od);
1411 });
1412 });
1413
1414
1415 unittest.group("obj-schema-TrafficSplit", () {
1416 unittest.test("to-json--from-json", () {
1417 var o = buildTrafficSplit();
1418 var od = new api.TrafficSplit.fromJson(o.toJson());
1419 checkTrafficSplit(od);
1420 });
1421 });
1422
1423
1424 unittest.group("obj-schema-UrlDispatchRule", () {
1425 unittest.test("to-json--from-json", () {
1426 var o = buildUrlDispatchRule();
1427 var od = new api.UrlDispatchRule.fromJson(o.toJson());
1428 checkUrlDispatchRule(od);
1429 });
1430 });
1431
1432
1433 unittest.group("obj-schema-UrlMap", () {
1434 unittest.test("to-json--from-json", () {
1435 var o = buildUrlMap();
1436 var od = new api.UrlMap.fromJson(o.toJson());
1437 checkUrlMap(od);
1438 });
1439 });
1440
1441
1442 unittest.group("obj-schema-Version", () {
1443 unittest.test("to-json--from-json", () {
1444 var o = buildVersion();
1445 var od = new api.Version.fromJson(o.toJson());
1446 checkVersion(od);
1447 });
1448 });
1449
1450
1451 unittest.group("resource-AppsResourceApi", () {
1452 unittest.test("method--get", () {
1453
1454 var mock = new HttpServerMock();
1455 api.AppsResourceApi res = new api.AppengineApi(mock).apps;
1456 var arg_appsId = "foo";
1457 var arg_ensureResourcesExist = true;
1458 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1459 var path = (req.url).path;
1460 var pathOffset = 0;
1461 var index;
1462 var subPart;
1463 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1464 pathOffset += 1;
1465 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta5/apps/"));
1466 pathOffset += 13;
1467 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
1468 pathOffset = path.length;
1469 unittest.expect(subPart, unittest.equals("$arg_appsId"));
1470
1471 var query = (req.url).query;
1472 var queryOffset = 0;
1473 var queryMap = {};
1474 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1475 parseBool(n) {
1476 if (n == "true") return true;
1477 if (n == "false") return false;
1478 if (n == null) return null;
1479 throw new core.ArgumentError("Invalid boolean: $n");
1480 }
1481 if (query.length > 0) {
1482 for (var part in query.split("&")) {
1483 var keyvalue = part.split("=");
1484 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1485 }
1486 }
1487 unittest.expect(queryMap["ensureResourcesExist"].first, unittest.equals( "$arg_ensureResourcesExist"));
1488
1489
1490 var h = {
1491 "content-type" : "application/json; charset=utf-8",
1492 };
1493 var resp = convert.JSON.encode(buildApplication());
1494 return new async.Future.value(stringResponse(200, h, resp));
1495 }), true);
1496 res.get(arg_appsId, ensureResourcesExist: arg_ensureResourcesExist).then(u nittest.expectAsync(((api.Application response) {
1497 checkApplication(response);
1498 })));
1499 });
1500
1501 });
1502
1503
1504 unittest.group("resource-AppsOperationsResourceApi", () {
1505 unittest.test("method--get", () {
1506
1507 var mock = new HttpServerMock();
1508 api.AppsOperationsResourceApi res = new api.AppengineApi(mock).apps.operat ions;
1509 var arg_appsId = "foo";
1510 var arg_operationsId = "foo";
1511 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1512 var path = (req.url).path;
1513 var pathOffset = 0;
1514 var index;
1515 var subPart;
1516 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1517 pathOffset += 1;
1518 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta5/apps/"));
1519 pathOffset += 13;
1520 index = path.indexOf("/operations/", pathOffset);
1521 unittest.expect(index >= 0, unittest.isTrue);
1522 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
1523 pathOffset = index;
1524 unittest.expect(subPart, unittest.equals("$arg_appsId"));
1525 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("/operations/"));
1526 pathOffset += 12;
1527 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
1528 pathOffset = path.length;
1529 unittest.expect(subPart, unittest.equals("$arg_operationsId"));
1530
1531 var query = (req.url).query;
1532 var queryOffset = 0;
1533 var queryMap = {};
1534 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1535 parseBool(n) {
1536 if (n == "true") return true;
1537 if (n == "false") return false;
1538 if (n == null) return null;
1539 throw new core.ArgumentError("Invalid boolean: $n");
1540 }
1541 if (query.length > 0) {
1542 for (var part in query.split("&")) {
1543 var keyvalue = part.split("=");
1544 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1545 }
1546 }
1547
1548
1549 var h = {
1550 "content-type" : "application/json; charset=utf-8",
1551 };
1552 var resp = convert.JSON.encode(buildOperation());
1553 return new async.Future.value(stringResponse(200, h, resp));
1554 }), true);
1555 res.get(arg_appsId, arg_operationsId).then(unittest.expectAsync(((api.Oper ation response) {
1556 checkOperation(response);
1557 })));
1558 });
1559
1560 unittest.test("method--list", () {
1561
1562 var mock = new HttpServerMock();
1563 api.AppsOperationsResourceApi res = new api.AppengineApi(mock).apps.operat ions;
1564 var arg_appsId = "foo";
1565 var arg_filter = "foo";
1566 var arg_pageSize = 42;
1567 var arg_pageToken = "foo";
1568 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1569 var path = (req.url).path;
1570 var pathOffset = 0;
1571 var index;
1572 var subPart;
1573 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1574 pathOffset += 1;
1575 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta5/apps/"));
1576 pathOffset += 13;
1577 index = path.indexOf("/operations", pathOffset);
1578 unittest.expect(index >= 0, unittest.isTrue);
1579 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
1580 pathOffset = index;
1581 unittest.expect(subPart, unittest.equals("$arg_appsId"));
1582 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq uals("/operations"));
1583 pathOffset += 11;
1584
1585 var query = (req.url).query;
1586 var queryOffset = 0;
1587 var queryMap = {};
1588 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1589 parseBool(n) {
1590 if (n == "true") return true;
1591 if (n == "false") return false;
1592 if (n == null) return null;
1593 throw new core.ArgumentError("Invalid boolean: $n");
1594 }
1595 if (query.length > 0) {
1596 for (var part in query.split("&")) {
1597 var keyvalue = part.split("=");
1598 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1599 }
1600 }
1601 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter));
1602 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize));
1603 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
1604
1605
1606 var h = {
1607 "content-type" : "application/json; charset=utf-8",
1608 };
1609 var resp = convert.JSON.encode(buildListOperationsResponse());
1610 return new async.Future.value(stringResponse(200, h, resp));
1611 }), true);
1612 res.list(arg_appsId, filter: arg_filter, pageSize: arg_pageSize, pageToken : arg_pageToken).then(unittest.expectAsync(((api.ListOperationsResponse response ) {
1613 checkListOperationsResponse(response);
1614 })));
1615 });
1616
1617 });
1618
1619
1620 unittest.group("resource-AppsServicesResourceApi", () {
1621 unittest.test("method--delete", () {
1622
1623 var mock = new HttpServerMock();
1624 api.AppsServicesResourceApi res = new api.AppengineApi(mock).apps.services ;
1625 var arg_appsId = "foo";
1626 var arg_servicesId = "foo";
1627 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1628 var path = (req.url).path;
1629 var pathOffset = 0;
1630 var index;
1631 var subPart;
1632 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1633 pathOffset += 1;
1634 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta5/apps/"));
1635 pathOffset += 13;
1636 index = path.indexOf("/services/", pathOffset);
1637 unittest.expect(index >= 0, unittest.isTrue);
1638 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
1639 pathOffset = index;
1640 unittest.expect(subPart, unittest.equals("$arg_appsId"));
1641 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/services/"));
1642 pathOffset += 10;
1643 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
1644 pathOffset = path.length;
1645 unittest.expect(subPart, unittest.equals("$arg_servicesId"));
1646
1647 var query = (req.url).query;
1648 var queryOffset = 0;
1649 var queryMap = {};
1650 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1651 parseBool(n) {
1652 if (n == "true") return true;
1653 if (n == "false") return false;
1654 if (n == null) return null;
1655 throw new core.ArgumentError("Invalid boolean: $n");
1656 }
1657 if (query.length > 0) {
1658 for (var part in query.split("&")) {
1659 var keyvalue = part.split("=");
1660 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1661 }
1662 }
1663
1664
1665 var h = {
1666 "content-type" : "application/json; charset=utf-8",
1667 };
1668 var resp = convert.JSON.encode(buildOperation());
1669 return new async.Future.value(stringResponse(200, h, resp));
1670 }), true);
1671 res.delete(arg_appsId, arg_servicesId).then(unittest.expectAsync(((api.Ope ration response) {
1672 checkOperation(response);
1673 })));
1674 });
1675
1676 unittest.test("method--get", () {
1677
1678 var mock = new HttpServerMock();
1679 api.AppsServicesResourceApi res = new api.AppengineApi(mock).apps.services ;
1680 var arg_appsId = "foo";
1681 var arg_servicesId = "foo";
1682 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1683 var path = (req.url).path;
1684 var pathOffset = 0;
1685 var index;
1686 var subPart;
1687 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1688 pathOffset += 1;
1689 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta5/apps/"));
1690 pathOffset += 13;
1691 index = path.indexOf("/services/", pathOffset);
1692 unittest.expect(index >= 0, unittest.isTrue);
1693 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
1694 pathOffset = index;
1695 unittest.expect(subPart, unittest.equals("$arg_appsId"));
1696 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/services/"));
1697 pathOffset += 10;
1698 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
1699 pathOffset = path.length;
1700 unittest.expect(subPart, unittest.equals("$arg_servicesId"));
1701
1702 var query = (req.url).query;
1703 var queryOffset = 0;
1704 var queryMap = {};
1705 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1706 parseBool(n) {
1707 if (n == "true") return true;
1708 if (n == "false") return false;
1709 if (n == null) return null;
1710 throw new core.ArgumentError("Invalid boolean: $n");
1711 }
1712 if (query.length > 0) {
1713 for (var part in query.split("&")) {
1714 var keyvalue = part.split("=");
1715 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1716 }
1717 }
1718
1719
1720 var h = {
1721 "content-type" : "application/json; charset=utf-8",
1722 };
1723 var resp = convert.JSON.encode(buildService());
1724 return new async.Future.value(stringResponse(200, h, resp));
1725 }), true);
1726 res.get(arg_appsId, arg_servicesId).then(unittest.expectAsync(((api.Servic e response) {
1727 checkService(response);
1728 })));
1729 });
1730
1731 unittest.test("method--list", () {
1732
1733 var mock = new HttpServerMock();
1734 api.AppsServicesResourceApi res = new api.AppengineApi(mock).apps.services ;
1735 var arg_appsId = "foo";
1736 var arg_pageSize = 42;
1737 var arg_pageToken = "foo";
1738 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1739 var path = (req.url).path;
1740 var pathOffset = 0;
1741 var index;
1742 var subPart;
1743 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1744 pathOffset += 1;
1745 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta5/apps/"));
1746 pathOffset += 13;
1747 index = path.indexOf("/services", pathOffset);
1748 unittest.expect(index >= 0, unittest.isTrue);
1749 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
1750 pathOffset = index;
1751 unittest.expect(subPart, unittest.equals("$arg_appsId"));
1752 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/services"));
1753 pathOffset += 9;
1754
1755 var query = (req.url).query;
1756 var queryOffset = 0;
1757 var queryMap = {};
1758 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1759 parseBool(n) {
1760 if (n == "true") return true;
1761 if (n == "false") return false;
1762 if (n == null) return null;
1763 throw new core.ArgumentError("Invalid boolean: $n");
1764 }
1765 if (query.length > 0) {
1766 for (var part in query.split("&")) {
1767 var keyvalue = part.split("=");
1768 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1769 }
1770 }
1771 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize));
1772 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
1773
1774
1775 var h = {
1776 "content-type" : "application/json; charset=utf-8",
1777 };
1778 var resp = convert.JSON.encode(buildListServicesResponse());
1779 return new async.Future.value(stringResponse(200, h, resp));
1780 }), true);
1781 res.list(arg_appsId, pageSize: arg_pageSize, pageToken: arg_pageToken).the n(unittest.expectAsync(((api.ListServicesResponse response) {
1782 checkListServicesResponse(response);
1783 })));
1784 });
1785
1786 unittest.test("method--patch", () {
1787
1788 var mock = new HttpServerMock();
1789 api.AppsServicesResourceApi res = new api.AppengineApi(mock).apps.services ;
1790 var arg_request = buildService();
1791 var arg_appsId = "foo";
1792 var arg_servicesId = "foo";
1793 var arg_mask = "foo";
1794 var arg_migrateTraffic = true;
1795 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1796 var obj = new api.Service.fromJson(json);
1797 checkService(obj);
1798
1799 var path = (req.url).path;
1800 var pathOffset = 0;
1801 var index;
1802 var subPart;
1803 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1804 pathOffset += 1;
1805 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta5/apps/"));
1806 pathOffset += 13;
1807 index = path.indexOf("/services/", pathOffset);
1808 unittest.expect(index >= 0, unittest.isTrue);
1809 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
1810 pathOffset = index;
1811 unittest.expect(subPart, unittest.equals("$arg_appsId"));
1812 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/services/"));
1813 pathOffset += 10;
1814 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
1815 pathOffset = path.length;
1816 unittest.expect(subPart, unittest.equals("$arg_servicesId"));
1817
1818 var query = (req.url).query;
1819 var queryOffset = 0;
1820 var queryMap = {};
1821 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1822 parseBool(n) {
1823 if (n == "true") return true;
1824 if (n == "false") return false;
1825 if (n == null) return null;
1826 throw new core.ArgumentError("Invalid boolean: $n");
1827 }
1828 if (query.length > 0) {
1829 for (var part in query.split("&")) {
1830 var keyvalue = part.split("=");
1831 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1832 }
1833 }
1834 unittest.expect(queryMap["mask"].first, unittest.equals(arg_mask));
1835 unittest.expect(queryMap["migrateTraffic"].first, unittest.equals("$arg_ migrateTraffic"));
1836
1837
1838 var h = {
1839 "content-type" : "application/json; charset=utf-8",
1840 };
1841 var resp = convert.JSON.encode(buildOperation());
1842 return new async.Future.value(stringResponse(200, h, resp));
1843 }), true);
1844 res.patch(arg_request, arg_appsId, arg_servicesId, mask: arg_mask, migrate Traffic: arg_migrateTraffic).then(unittest.expectAsync(((api.Operation response) {
1845 checkOperation(response);
1846 })));
1847 });
1848
1849 });
1850
1851
1852 unittest.group("resource-AppsServicesVersionsResourceApi", () {
1853 unittest.test("method--create", () {
1854
1855 var mock = new HttpServerMock();
1856 api.AppsServicesVersionsResourceApi res = new api.AppengineApi(mock).apps. services.versions;
1857 var arg_request = buildVersion();
1858 var arg_appsId = "foo";
1859 var arg_servicesId = "foo";
1860 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1861 var obj = new api.Version.fromJson(json);
1862 checkVersion(obj);
1863
1864 var path = (req.url).path;
1865 var pathOffset = 0;
1866 var index;
1867 var subPart;
1868 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1869 pathOffset += 1;
1870 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta5/apps/"));
1871 pathOffset += 13;
1872 index = path.indexOf("/services/", pathOffset);
1873 unittest.expect(index >= 0, unittest.isTrue);
1874 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
1875 pathOffset = index;
1876 unittest.expect(subPart, unittest.equals("$arg_appsId"));
1877 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/services/"));
1878 pathOffset += 10;
1879 index = path.indexOf("/versions", pathOffset);
1880 unittest.expect(index >= 0, unittest.isTrue);
1881 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
1882 pathOffset = index;
1883 unittest.expect(subPart, unittest.equals("$arg_servicesId"));
1884 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/versions"));
1885 pathOffset += 9;
1886
1887 var query = (req.url).query;
1888 var queryOffset = 0;
1889 var queryMap = {};
1890 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1891 parseBool(n) {
1892 if (n == "true") return true;
1893 if (n == "false") return false;
1894 if (n == null) return null;
1895 throw new core.ArgumentError("Invalid boolean: $n");
1896 }
1897 if (query.length > 0) {
1898 for (var part in query.split("&")) {
1899 var keyvalue = part.split("=");
1900 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1901 }
1902 }
1903
1904
1905 var h = {
1906 "content-type" : "application/json; charset=utf-8",
1907 };
1908 var resp = convert.JSON.encode(buildOperation());
1909 return new async.Future.value(stringResponse(200, h, resp));
1910 }), true);
1911 res.create(arg_request, arg_appsId, arg_servicesId).then(unittest.expectAs ync(((api.Operation response) {
1912 checkOperation(response);
1913 })));
1914 });
1915
1916 unittest.test("method--delete", () {
1917
1918 var mock = new HttpServerMock();
1919 api.AppsServicesVersionsResourceApi res = new api.AppengineApi(mock).apps. services.versions;
1920 var arg_appsId = "foo";
1921 var arg_servicesId = "foo";
1922 var arg_versionsId = "foo";
1923 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1924 var path = (req.url).path;
1925 var pathOffset = 0;
1926 var index;
1927 var subPart;
1928 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1929 pathOffset += 1;
1930 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta5/apps/"));
1931 pathOffset += 13;
1932 index = path.indexOf("/services/", pathOffset);
1933 unittest.expect(index >= 0, unittest.isTrue);
1934 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
1935 pathOffset = index;
1936 unittest.expect(subPart, unittest.equals("$arg_appsId"));
1937 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/services/"));
1938 pathOffset += 10;
1939 index = path.indexOf("/versions/", pathOffset);
1940 unittest.expect(index >= 0, unittest.isTrue);
1941 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
1942 pathOffset = index;
1943 unittest.expect(subPart, unittest.equals("$arg_servicesId"));
1944 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/versions/"));
1945 pathOffset += 10;
1946 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
1947 pathOffset = path.length;
1948 unittest.expect(subPart, unittest.equals("$arg_versionsId"));
1949
1950 var query = (req.url).query;
1951 var queryOffset = 0;
1952 var queryMap = {};
1953 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1954 parseBool(n) {
1955 if (n == "true") return true;
1956 if (n == "false") return false;
1957 if (n == null) return null;
1958 throw new core.ArgumentError("Invalid boolean: $n");
1959 }
1960 if (query.length > 0) {
1961 for (var part in query.split("&")) {
1962 var keyvalue = part.split("=");
1963 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1964 }
1965 }
1966
1967
1968 var h = {
1969 "content-type" : "application/json; charset=utf-8",
1970 };
1971 var resp = convert.JSON.encode(buildOperation());
1972 return new async.Future.value(stringResponse(200, h, resp));
1973 }), true);
1974 res.delete(arg_appsId, arg_servicesId, arg_versionsId).then(unittest.expec tAsync(((api.Operation response) {
1975 checkOperation(response);
1976 })));
1977 });
1978
1979 unittest.test("method--get", () {
1980
1981 var mock = new HttpServerMock();
1982 api.AppsServicesVersionsResourceApi res = new api.AppengineApi(mock).apps. services.versions;
1983 var arg_appsId = "foo";
1984 var arg_servicesId = "foo";
1985 var arg_versionsId = "foo";
1986 var arg_view = "foo";
1987 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1988 var path = (req.url).path;
1989 var pathOffset = 0;
1990 var index;
1991 var subPart;
1992 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1993 pathOffset += 1;
1994 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta5/apps/"));
1995 pathOffset += 13;
1996 index = path.indexOf("/services/", pathOffset);
1997 unittest.expect(index >= 0, unittest.isTrue);
1998 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
1999 pathOffset = index;
2000 unittest.expect(subPart, unittest.equals("$arg_appsId"));
2001 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/services/"));
2002 pathOffset += 10;
2003 index = path.indexOf("/versions/", pathOffset);
2004 unittest.expect(index >= 0, unittest.isTrue);
2005 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
2006 pathOffset = index;
2007 unittest.expect(subPart, unittest.equals("$arg_servicesId"));
2008 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/versions/"));
2009 pathOffset += 10;
2010 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2011 pathOffset = path.length;
2012 unittest.expect(subPart, unittest.equals("$arg_versionsId"));
2013
2014 var query = (req.url).query;
2015 var queryOffset = 0;
2016 var queryMap = {};
2017 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2018 parseBool(n) {
2019 if (n == "true") return true;
2020 if (n == "false") return false;
2021 if (n == null) return null;
2022 throw new core.ArgumentError("Invalid boolean: $n");
2023 }
2024 if (query.length > 0) {
2025 for (var part in query.split("&")) {
2026 var keyvalue = part.split("=");
2027 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2028 }
2029 }
2030 unittest.expect(queryMap["view"].first, unittest.equals(arg_view));
2031
2032
2033 var h = {
2034 "content-type" : "application/json; charset=utf-8",
2035 };
2036 var resp = convert.JSON.encode(buildVersion());
2037 return new async.Future.value(stringResponse(200, h, resp));
2038 }), true);
2039 res.get(arg_appsId, arg_servicesId, arg_versionsId, view: arg_view).then(u nittest.expectAsync(((api.Version response) {
2040 checkVersion(response);
2041 })));
2042 });
2043
2044 unittest.test("method--list", () {
2045
2046 var mock = new HttpServerMock();
2047 api.AppsServicesVersionsResourceApi res = new api.AppengineApi(mock).apps. services.versions;
2048 var arg_appsId = "foo";
2049 var arg_servicesId = "foo";
2050 var arg_view = "foo";
2051 var arg_pageSize = 42;
2052 var arg_pageToken = "foo";
2053 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2054 var path = (req.url).path;
2055 var pathOffset = 0;
2056 var index;
2057 var subPart;
2058 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
2059 pathOffset += 1;
2060 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta5/apps/"));
2061 pathOffset += 13;
2062 index = path.indexOf("/services/", pathOffset);
2063 unittest.expect(index >= 0, unittest.isTrue);
2064 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
2065 pathOffset = index;
2066 unittest.expect(subPart, unittest.equals("$arg_appsId"));
2067 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/services/"));
2068 pathOffset += 10;
2069 index = path.indexOf("/versions", pathOffset);
2070 unittest.expect(index >= 0, unittest.isTrue);
2071 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
2072 pathOffset = index;
2073 unittest.expect(subPart, unittest.equals("$arg_servicesId"));
2074 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/versions"));
2075 pathOffset += 9;
2076
2077 var query = (req.url).query;
2078 var queryOffset = 0;
2079 var queryMap = {};
2080 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2081 parseBool(n) {
2082 if (n == "true") return true;
2083 if (n == "false") return false;
2084 if (n == null) return null;
2085 throw new core.ArgumentError("Invalid boolean: $n");
2086 }
2087 if (query.length > 0) {
2088 for (var part in query.split("&")) {
2089 var keyvalue = part.split("=");
2090 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2091 }
2092 }
2093 unittest.expect(queryMap["view"].first, unittest.equals(arg_view));
2094 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize));
2095 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
2096
2097
2098 var h = {
2099 "content-type" : "application/json; charset=utf-8",
2100 };
2101 var resp = convert.JSON.encode(buildListVersionsResponse());
2102 return new async.Future.value(stringResponse(200, h, resp));
2103 }), true);
2104 res.list(arg_appsId, arg_servicesId, view: arg_view, pageSize: arg_pageSiz e, pageToken: arg_pageToken).then(unittest.expectAsync(((api.ListVersionsRespons e response) {
2105 checkListVersionsResponse(response);
2106 })));
2107 });
2108
2109 unittest.test("method--patch", () {
2110
2111 var mock = new HttpServerMock();
2112 api.AppsServicesVersionsResourceApi res = new api.AppengineApi(mock).apps. services.versions;
2113 var arg_request = buildVersion();
2114 var arg_appsId = "foo";
2115 var arg_servicesId = "foo";
2116 var arg_versionsId = "foo";
2117 var arg_mask = "foo";
2118 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2119 var obj = new api.Version.fromJson(json);
2120 checkVersion(obj);
2121
2122 var path = (req.url).path;
2123 var pathOffset = 0;
2124 var index;
2125 var subPart;
2126 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
2127 pathOffset += 1;
2128 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("v1beta5/apps/"));
2129 pathOffset += 13;
2130 index = path.indexOf("/services/", pathOffset);
2131 unittest.expect(index >= 0, unittest.isTrue);
2132 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
2133 pathOffset = index;
2134 unittest.expect(subPart, unittest.equals("$arg_appsId"));
2135 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/services/"));
2136 pathOffset += 10;
2137 index = path.indexOf("/versions/", pathOffset);
2138 unittest.expect(index >= 0, unittest.isTrue);
2139 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
2140 pathOffset = index;
2141 unittest.expect(subPart, unittest.equals("$arg_servicesId"));
2142 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("/versions/"));
2143 pathOffset += 10;
2144 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2145 pathOffset = path.length;
2146 unittest.expect(subPart, unittest.equals("$arg_versionsId"));
2147
2148 var query = (req.url).query;
2149 var queryOffset = 0;
2150 var queryMap = {};
2151 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2152 parseBool(n) {
2153 if (n == "true") return true;
2154 if (n == "false") return false;
2155 if (n == null) return null;
2156 throw new core.ArgumentError("Invalid boolean: $n");
2157 }
2158 if (query.length > 0) {
2159 for (var part in query.split("&")) {
2160 var keyvalue = part.split("=");
2161 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2162 }
2163 }
2164 unittest.expect(queryMap["mask"].first, unittest.equals(arg_mask));
2165
2166
2167 var h = {
2168 "content-type" : "application/json; charset=utf-8",
2169 };
2170 var resp = convert.JSON.encode(buildVersion());
2171 return new async.Future.value(stringResponse(200, h, resp));
2172 }), true);
2173 res.patch(arg_request, arg_appsId, arg_servicesId, arg_versionsId, mask: a rg_mask).then(unittest.expectAsync(((api.Version response) {
2174 checkVersion(response);
2175 })));
2176 });
2177
2178 });
2179
2180
2181 }
2182
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698