OLD | NEW |
1 library googleapis_beta.dlp.v2beta1.test; | 1 library googleapis_beta.dlp.v2beta1.test; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:test/test.dart' as unittest; |
11 | 11 |
12 import 'package:googleapis_beta/dlp/v2beta1.dart' as api; | 12 import 'package:googleapis_beta/dlp/v2beta1.dart' as api; |
13 | 13 |
14 class HttpServerMock extends http.BaseClient { | 14 class HttpServerMock extends http.BaseClient { |
15 core.Function _callback; | 15 core.Function _callback; |
16 core.bool _expectJson; | 16 core.bool _expectJson; |
17 | 17 |
18 void register(core.Function callback, core.bool expectJson) { | 18 void register(core.Function callback, core.bool expectJson) { |
19 _callback = callback; | 19 _callback = callback; |
20 _expectJson = expectJson; | 20 _expectJson = expectJson; |
(...skipping 18 matching lines...) Expand all Loading... |
39 } else { | 39 } else { |
40 return stream.toBytes().then((data) { | 40 return stream.toBytes().then((data) { |
41 return _callback(request, data); | 41 return _callback(request, data); |
42 }); | 42 }); |
43 } | 43 } |
44 } | 44 } |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
49 core.int status, core.Map headers, core.String body) { | 49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { |
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
52 } | 52 } |
53 | 53 |
54 core.int buildCounterCancelOperationRequest = 0; | 54 core.int buildCounterCancelOperationRequest = 0; |
55 buildCancelOperationRequest() { | 55 buildCancelOperationRequest() { |
56 var o = new api.CancelOperationRequest(); | 56 var o = new api.CancelOperationRequest(); |
57 buildCounterCancelOperationRequest++; | 57 buildCounterCancelOperationRequest++; |
58 if (buildCounterCancelOperationRequest < 3) { | 58 if (buildCounterCancelOperationRequest < 3) { |
59 } | 59 } |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 } | 206 } |
207 | 207 |
208 checkDatastoreKey(api.DatastoreKey o) { | 208 checkDatastoreKey(api.DatastoreKey o) { |
209 buildCounterDatastoreKey++; | 209 buildCounterDatastoreKey++; |
210 if (buildCounterDatastoreKey < 3) { | 210 if (buildCounterDatastoreKey < 3) { |
211 checkKey(o.entityKey); | 211 checkKey(o.entityKey); |
212 } | 212 } |
213 buildCounterDatastoreKey--; | 213 buildCounterDatastoreKey--; |
214 } | 214 } |
215 | 215 |
216 buildUnnamed3695() { | 216 buildUnnamed3169() { |
217 var o = new core.List<api.Projection>(); | 217 var o = new core.List<api.Projection>(); |
218 o.add(buildProjection()); | 218 o.add(buildProjection()); |
219 o.add(buildProjection()); | 219 o.add(buildProjection()); |
220 return o; | 220 return o; |
221 } | 221 } |
222 | 222 |
223 checkUnnamed3695(core.List<api.Projection> o) { | 223 checkUnnamed3169(core.List<api.Projection> o) { |
224 unittest.expect(o, unittest.hasLength(2)); | 224 unittest.expect(o, unittest.hasLength(2)); |
225 checkProjection(o[0]); | 225 checkProjection(o[0]); |
226 checkProjection(o[1]); | 226 checkProjection(o[1]); |
227 } | 227 } |
228 | 228 |
229 core.int buildCounterDatastoreOptions = 0; | 229 core.int buildCounterDatastoreOptions = 0; |
230 buildDatastoreOptions() { | 230 buildDatastoreOptions() { |
231 var o = new api.DatastoreOptions(); | 231 var o = new api.DatastoreOptions(); |
232 buildCounterDatastoreOptions++; | 232 buildCounterDatastoreOptions++; |
233 if (buildCounterDatastoreOptions < 3) { | 233 if (buildCounterDatastoreOptions < 3) { |
234 o.kind = buildKindExpression(); | 234 o.kind = buildKindExpression(); |
235 o.partitionId = buildPartitionId(); | 235 o.partitionId = buildPartitionId(); |
236 o.projection = buildUnnamed3695(); | 236 o.projection = buildUnnamed3169(); |
237 } | 237 } |
238 buildCounterDatastoreOptions--; | 238 buildCounterDatastoreOptions--; |
239 return o; | 239 return o; |
240 } | 240 } |
241 | 241 |
242 checkDatastoreOptions(api.DatastoreOptions o) { | 242 checkDatastoreOptions(api.DatastoreOptions o) { |
243 buildCounterDatastoreOptions++; | 243 buildCounterDatastoreOptions++; |
244 if (buildCounterDatastoreOptions < 3) { | 244 if (buildCounterDatastoreOptions < 3) { |
245 checkKindExpression(o.kind); | 245 checkKindExpression(o.kind); |
246 checkPartitionId(o.partitionId); | 246 checkPartitionId(o.partitionId); |
247 checkUnnamed3695(o.projection); | 247 checkUnnamed3169(o.projection); |
248 } | 248 } |
249 buildCounterDatastoreOptions--; | 249 buildCounterDatastoreOptions--; |
250 } | 250 } |
251 | 251 |
252 core.int buildCounterEmpty = 0; | 252 core.int buildCounterEmpty = 0; |
253 buildEmpty() { | 253 buildEmpty() { |
254 var o = new api.Empty(); | 254 var o = new api.Empty(); |
255 buildCounterEmpty++; | 255 buildCounterEmpty++; |
256 if (buildCounterEmpty < 3) { | 256 if (buildCounterEmpty < 3) { |
257 } | 257 } |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 } | 368 } |
369 | 369 |
370 checkInfoType(api.InfoType o) { | 370 checkInfoType(api.InfoType o) { |
371 buildCounterInfoType++; | 371 buildCounterInfoType++; |
372 if (buildCounterInfoType < 3) { | 372 if (buildCounterInfoType < 3) { |
373 unittest.expect(o.name, unittest.equals('foo')); | 373 unittest.expect(o.name, unittest.equals('foo')); |
374 } | 374 } |
375 buildCounterInfoType--; | 375 buildCounterInfoType--; |
376 } | 376 } |
377 | 377 |
378 buildUnnamed3696() { | 378 buildUnnamed3170() { |
379 var o = new core.List<api.CategoryDescription>(); | 379 var o = new core.List<api.CategoryDescription>(); |
380 o.add(buildCategoryDescription()); | 380 o.add(buildCategoryDescription()); |
381 o.add(buildCategoryDescription()); | 381 o.add(buildCategoryDescription()); |
382 return o; | 382 return o; |
383 } | 383 } |
384 | 384 |
385 checkUnnamed3696(core.List<api.CategoryDescription> o) { | 385 checkUnnamed3170(core.List<api.CategoryDescription> o) { |
386 unittest.expect(o, unittest.hasLength(2)); | 386 unittest.expect(o, unittest.hasLength(2)); |
387 checkCategoryDescription(o[0]); | 387 checkCategoryDescription(o[0]); |
388 checkCategoryDescription(o[1]); | 388 checkCategoryDescription(o[1]); |
389 } | 389 } |
390 | 390 |
391 core.int buildCounterInfoTypeDescription = 0; | 391 core.int buildCounterInfoTypeDescription = 0; |
392 buildInfoTypeDescription() { | 392 buildInfoTypeDescription() { |
393 var o = new api.InfoTypeDescription(); | 393 var o = new api.InfoTypeDescription(); |
394 buildCounterInfoTypeDescription++; | 394 buildCounterInfoTypeDescription++; |
395 if (buildCounterInfoTypeDescription < 3) { | 395 if (buildCounterInfoTypeDescription < 3) { |
396 o.categories = buildUnnamed3696(); | 396 o.categories = buildUnnamed3170(); |
397 o.displayName = "foo"; | 397 o.displayName = "foo"; |
398 o.name = "foo"; | 398 o.name = "foo"; |
399 } | 399 } |
400 buildCounterInfoTypeDescription--; | 400 buildCounterInfoTypeDescription--; |
401 return o; | 401 return o; |
402 } | 402 } |
403 | 403 |
404 checkInfoTypeDescription(api.InfoTypeDescription o) { | 404 checkInfoTypeDescription(api.InfoTypeDescription o) { |
405 buildCounterInfoTypeDescription++; | 405 buildCounterInfoTypeDescription++; |
406 if (buildCounterInfoTypeDescription < 3) { | 406 if (buildCounterInfoTypeDescription < 3) { |
407 checkUnnamed3696(o.categories); | 407 checkUnnamed3170(o.categories); |
408 unittest.expect(o.displayName, unittest.equals('foo')); | 408 unittest.expect(o.displayName, unittest.equals('foo')); |
409 unittest.expect(o.name, unittest.equals('foo')); | 409 unittest.expect(o.name, unittest.equals('foo')); |
410 } | 410 } |
411 buildCounterInfoTypeDescription--; | 411 buildCounterInfoTypeDescription--; |
412 } | 412 } |
413 | 413 |
414 buildUnnamed3697() { | 414 buildUnnamed3171() { |
415 var o = new core.List<api.InfoType>(); | 415 var o = new core.List<api.InfoType>(); |
416 o.add(buildInfoType()); | 416 o.add(buildInfoType()); |
417 o.add(buildInfoType()); | 417 o.add(buildInfoType()); |
418 return o; | 418 return o; |
419 } | 419 } |
420 | 420 |
421 checkUnnamed3697(core.List<api.InfoType> o) { | 421 checkUnnamed3171(core.List<api.InfoType> o) { |
422 unittest.expect(o, unittest.hasLength(2)); | 422 unittest.expect(o, unittest.hasLength(2)); |
423 checkInfoType(o[0]); | 423 checkInfoType(o[0]); |
424 checkInfoType(o[1]); | 424 checkInfoType(o[1]); |
425 } | 425 } |
426 | 426 |
427 core.int buildCounterInspectConfig = 0; | 427 core.int buildCounterInspectConfig = 0; |
428 buildInspectConfig() { | 428 buildInspectConfig() { |
429 var o = new api.InspectConfig(); | 429 var o = new api.InspectConfig(); |
430 buildCounterInspectConfig++; | 430 buildCounterInspectConfig++; |
431 if (buildCounterInspectConfig < 3) { | 431 if (buildCounterInspectConfig < 3) { |
432 o.excludeTypes = true; | 432 o.excludeTypes = true; |
433 o.includeQuote = true; | 433 o.includeQuote = true; |
434 o.infoTypes = buildUnnamed3697(); | 434 o.infoTypes = buildUnnamed3171(); |
435 o.maxFindings = 42; | 435 o.maxFindings = 42; |
436 o.minLikelihood = "foo"; | 436 o.minLikelihood = "foo"; |
437 } | 437 } |
438 buildCounterInspectConfig--; | 438 buildCounterInspectConfig--; |
439 return o; | 439 return o; |
440 } | 440 } |
441 | 441 |
442 checkInspectConfig(api.InspectConfig o) { | 442 checkInspectConfig(api.InspectConfig o) { |
443 buildCounterInspectConfig++; | 443 buildCounterInspectConfig++; |
444 if (buildCounterInspectConfig < 3) { | 444 if (buildCounterInspectConfig < 3) { |
445 unittest.expect(o.excludeTypes, unittest.isTrue); | 445 unittest.expect(o.excludeTypes, unittest.isTrue); |
446 unittest.expect(o.includeQuote, unittest.isTrue); | 446 unittest.expect(o.includeQuote, unittest.isTrue); |
447 checkUnnamed3697(o.infoTypes); | 447 checkUnnamed3171(o.infoTypes); |
448 unittest.expect(o.maxFindings, unittest.equals(42)); | 448 unittest.expect(o.maxFindings, unittest.equals(42)); |
449 unittest.expect(o.minLikelihood, unittest.equals('foo')); | 449 unittest.expect(o.minLikelihood, unittest.equals('foo')); |
450 } | 450 } |
451 buildCounterInspectConfig--; | 451 buildCounterInspectConfig--; |
452 } | 452 } |
453 | 453 |
454 buildUnnamed3698() { | 454 buildUnnamed3172() { |
455 var o = new core.List<api.ContentItem>(); | 455 var o = new core.List<api.ContentItem>(); |
456 o.add(buildContentItem()); | 456 o.add(buildContentItem()); |
457 o.add(buildContentItem()); | 457 o.add(buildContentItem()); |
458 return o; | 458 return o; |
459 } | 459 } |
460 | 460 |
461 checkUnnamed3698(core.List<api.ContentItem> o) { | 461 checkUnnamed3172(core.List<api.ContentItem> o) { |
462 unittest.expect(o, unittest.hasLength(2)); | 462 unittest.expect(o, unittest.hasLength(2)); |
463 checkContentItem(o[0]); | 463 checkContentItem(o[0]); |
464 checkContentItem(o[1]); | 464 checkContentItem(o[1]); |
465 } | 465 } |
466 | 466 |
467 core.int buildCounterInspectContentRequest = 0; | 467 core.int buildCounterInspectContentRequest = 0; |
468 buildInspectContentRequest() { | 468 buildInspectContentRequest() { |
469 var o = new api.InspectContentRequest(); | 469 var o = new api.InspectContentRequest(); |
470 buildCounterInspectContentRequest++; | 470 buildCounterInspectContentRequest++; |
471 if (buildCounterInspectContentRequest < 3) { | 471 if (buildCounterInspectContentRequest < 3) { |
472 o.inspectConfig = buildInspectConfig(); | 472 o.inspectConfig = buildInspectConfig(); |
473 o.items = buildUnnamed3698(); | 473 o.items = buildUnnamed3172(); |
474 } | 474 } |
475 buildCounterInspectContentRequest--; | 475 buildCounterInspectContentRequest--; |
476 return o; | 476 return o; |
477 } | 477 } |
478 | 478 |
479 checkInspectContentRequest(api.InspectContentRequest o) { | 479 checkInspectContentRequest(api.InspectContentRequest o) { |
480 buildCounterInspectContentRequest++; | 480 buildCounterInspectContentRequest++; |
481 if (buildCounterInspectContentRequest < 3) { | 481 if (buildCounterInspectContentRequest < 3) { |
482 checkInspectConfig(o.inspectConfig); | 482 checkInspectConfig(o.inspectConfig); |
483 checkUnnamed3698(o.items); | 483 checkUnnamed3172(o.items); |
484 } | 484 } |
485 buildCounterInspectContentRequest--; | 485 buildCounterInspectContentRequest--; |
486 } | 486 } |
487 | 487 |
488 buildUnnamed3699() { | 488 buildUnnamed3173() { |
489 var o = new core.List<api.InspectResult>(); | 489 var o = new core.List<api.InspectResult>(); |
490 o.add(buildInspectResult()); | 490 o.add(buildInspectResult()); |
491 o.add(buildInspectResult()); | 491 o.add(buildInspectResult()); |
492 return o; | 492 return o; |
493 } | 493 } |
494 | 494 |
495 checkUnnamed3699(core.List<api.InspectResult> o) { | 495 checkUnnamed3173(core.List<api.InspectResult> o) { |
496 unittest.expect(o, unittest.hasLength(2)); | 496 unittest.expect(o, unittest.hasLength(2)); |
497 checkInspectResult(o[0]); | 497 checkInspectResult(o[0]); |
498 checkInspectResult(o[1]); | 498 checkInspectResult(o[1]); |
499 } | 499 } |
500 | 500 |
501 core.int buildCounterInspectContentResponse = 0; | 501 core.int buildCounterInspectContentResponse = 0; |
502 buildInspectContentResponse() { | 502 buildInspectContentResponse() { |
503 var o = new api.InspectContentResponse(); | 503 var o = new api.InspectContentResponse(); |
504 buildCounterInspectContentResponse++; | 504 buildCounterInspectContentResponse++; |
505 if (buildCounterInspectContentResponse < 3) { | 505 if (buildCounterInspectContentResponse < 3) { |
506 o.results = buildUnnamed3699(); | 506 o.results = buildUnnamed3173(); |
507 } | 507 } |
508 buildCounterInspectContentResponse--; | 508 buildCounterInspectContentResponse--; |
509 return o; | 509 return o; |
510 } | 510 } |
511 | 511 |
512 checkInspectContentResponse(api.InspectContentResponse o) { | 512 checkInspectContentResponse(api.InspectContentResponse o) { |
513 buildCounterInspectContentResponse++; | 513 buildCounterInspectContentResponse++; |
514 if (buildCounterInspectContentResponse < 3) { | 514 if (buildCounterInspectContentResponse < 3) { |
515 checkUnnamed3699(o.results); | 515 checkUnnamed3173(o.results); |
516 } | 516 } |
517 buildCounterInspectContentResponse--; | 517 buildCounterInspectContentResponse--; |
518 } | 518 } |
519 | 519 |
520 buildUnnamed3700() { | 520 buildUnnamed3174() { |
521 var o = new core.List<api.Finding>(); | 521 var o = new core.List<api.Finding>(); |
522 o.add(buildFinding()); | 522 o.add(buildFinding()); |
523 o.add(buildFinding()); | 523 o.add(buildFinding()); |
524 return o; | 524 return o; |
525 } | 525 } |
526 | 526 |
527 checkUnnamed3700(core.List<api.Finding> o) { | 527 checkUnnamed3174(core.List<api.Finding> o) { |
528 unittest.expect(o, unittest.hasLength(2)); | 528 unittest.expect(o, unittest.hasLength(2)); |
529 checkFinding(o[0]); | 529 checkFinding(o[0]); |
530 checkFinding(o[1]); | 530 checkFinding(o[1]); |
531 } | 531 } |
532 | 532 |
533 core.int buildCounterInspectResult = 0; | 533 core.int buildCounterInspectResult = 0; |
534 buildInspectResult() { | 534 buildInspectResult() { |
535 var o = new api.InspectResult(); | 535 var o = new api.InspectResult(); |
536 buildCounterInspectResult++; | 536 buildCounterInspectResult++; |
537 if (buildCounterInspectResult < 3) { | 537 if (buildCounterInspectResult < 3) { |
538 o.findings = buildUnnamed3700(); | 538 o.findings = buildUnnamed3174(); |
539 o.findingsTruncated = true; | 539 o.findingsTruncated = true; |
540 } | 540 } |
541 buildCounterInspectResult--; | 541 buildCounterInspectResult--; |
542 return o; | 542 return o; |
543 } | 543 } |
544 | 544 |
545 checkInspectResult(api.InspectResult o) { | 545 checkInspectResult(api.InspectResult o) { |
546 buildCounterInspectResult++; | 546 buildCounterInspectResult++; |
547 if (buildCounterInspectResult < 3) { | 547 if (buildCounterInspectResult < 3) { |
548 checkUnnamed3700(o.findings); | 548 checkUnnamed3174(o.findings); |
549 unittest.expect(o.findingsTruncated, unittest.isTrue); | 549 unittest.expect(o.findingsTruncated, unittest.isTrue); |
550 } | 550 } |
551 buildCounterInspectResult--; | 551 buildCounterInspectResult--; |
552 } | 552 } |
553 | 553 |
554 buildUnnamed3701() { | 554 buildUnnamed3175() { |
555 var o = new core.List<api.PathElement>(); | 555 var o = new core.List<api.PathElement>(); |
556 o.add(buildPathElement()); | 556 o.add(buildPathElement()); |
557 o.add(buildPathElement()); | 557 o.add(buildPathElement()); |
558 return o; | 558 return o; |
559 } | 559 } |
560 | 560 |
561 checkUnnamed3701(core.List<api.PathElement> o) { | 561 checkUnnamed3175(core.List<api.PathElement> o) { |
562 unittest.expect(o, unittest.hasLength(2)); | 562 unittest.expect(o, unittest.hasLength(2)); |
563 checkPathElement(o[0]); | 563 checkPathElement(o[0]); |
564 checkPathElement(o[1]); | 564 checkPathElement(o[1]); |
565 } | 565 } |
566 | 566 |
567 core.int buildCounterKey = 0; | 567 core.int buildCounterKey = 0; |
568 buildKey() { | 568 buildKey() { |
569 var o = new api.Key(); | 569 var o = new api.Key(); |
570 buildCounterKey++; | 570 buildCounterKey++; |
571 if (buildCounterKey < 3) { | 571 if (buildCounterKey < 3) { |
572 o.partitionId = buildPartitionId(); | 572 o.partitionId = buildPartitionId(); |
573 o.path = buildUnnamed3701(); | 573 o.path = buildUnnamed3175(); |
574 } | 574 } |
575 buildCounterKey--; | 575 buildCounterKey--; |
576 return o; | 576 return o; |
577 } | 577 } |
578 | 578 |
579 checkKey(api.Key o) { | 579 checkKey(api.Key o) { |
580 buildCounterKey++; | 580 buildCounterKey++; |
581 if (buildCounterKey < 3) { | 581 if (buildCounterKey < 3) { |
582 checkPartitionId(o.partitionId); | 582 checkPartitionId(o.partitionId); |
583 checkUnnamed3701(o.path); | 583 checkUnnamed3175(o.path); |
584 } | 584 } |
585 buildCounterKey--; | 585 buildCounterKey--; |
586 } | 586 } |
587 | 587 |
588 core.int buildCounterKindExpression = 0; | 588 core.int buildCounterKindExpression = 0; |
589 buildKindExpression() { | 589 buildKindExpression() { |
590 var o = new api.KindExpression(); | 590 var o = new api.KindExpression(); |
591 buildCounterKindExpression++; | 591 buildCounterKindExpression++; |
592 if (buildCounterKindExpression < 3) { | 592 if (buildCounterKindExpression < 3) { |
593 o.name = "foo"; | 593 o.name = "foo"; |
594 } | 594 } |
595 buildCounterKindExpression--; | 595 buildCounterKindExpression--; |
596 return o; | 596 return o; |
597 } | 597 } |
598 | 598 |
599 checkKindExpression(api.KindExpression o) { | 599 checkKindExpression(api.KindExpression o) { |
600 buildCounterKindExpression++; | 600 buildCounterKindExpression++; |
601 if (buildCounterKindExpression < 3) { | 601 if (buildCounterKindExpression < 3) { |
602 unittest.expect(o.name, unittest.equals('foo')); | 602 unittest.expect(o.name, unittest.equals('foo')); |
603 } | 603 } |
604 buildCounterKindExpression--; | 604 buildCounterKindExpression--; |
605 } | 605 } |
606 | 606 |
607 buildUnnamed3702() { | 607 buildUnnamed3176() { |
608 var o = new core.List<api.InfoTypeDescription>(); | 608 var o = new core.List<api.InfoTypeDescription>(); |
609 o.add(buildInfoTypeDescription()); | 609 o.add(buildInfoTypeDescription()); |
610 o.add(buildInfoTypeDescription()); | 610 o.add(buildInfoTypeDescription()); |
611 return o; | 611 return o; |
612 } | 612 } |
613 | 613 |
614 checkUnnamed3702(core.List<api.InfoTypeDescription> o) { | 614 checkUnnamed3176(core.List<api.InfoTypeDescription> o) { |
615 unittest.expect(o, unittest.hasLength(2)); | 615 unittest.expect(o, unittest.hasLength(2)); |
616 checkInfoTypeDescription(o[0]); | 616 checkInfoTypeDescription(o[0]); |
617 checkInfoTypeDescription(o[1]); | 617 checkInfoTypeDescription(o[1]); |
618 } | 618 } |
619 | 619 |
620 core.int buildCounterListInfoTypesResponse = 0; | 620 core.int buildCounterListInfoTypesResponse = 0; |
621 buildListInfoTypesResponse() { | 621 buildListInfoTypesResponse() { |
622 var o = new api.ListInfoTypesResponse(); | 622 var o = new api.ListInfoTypesResponse(); |
623 buildCounterListInfoTypesResponse++; | 623 buildCounterListInfoTypesResponse++; |
624 if (buildCounterListInfoTypesResponse < 3) { | 624 if (buildCounterListInfoTypesResponse < 3) { |
625 o.infoTypes = buildUnnamed3702(); | 625 o.infoTypes = buildUnnamed3176(); |
626 } | 626 } |
627 buildCounterListInfoTypesResponse--; | 627 buildCounterListInfoTypesResponse--; |
628 return o; | 628 return o; |
629 } | 629 } |
630 | 630 |
631 checkListInfoTypesResponse(api.ListInfoTypesResponse o) { | 631 checkListInfoTypesResponse(api.ListInfoTypesResponse o) { |
632 buildCounterListInfoTypesResponse++; | 632 buildCounterListInfoTypesResponse++; |
633 if (buildCounterListInfoTypesResponse < 3) { | 633 if (buildCounterListInfoTypesResponse < 3) { |
634 checkUnnamed3702(o.infoTypes); | 634 checkUnnamed3176(o.infoTypes); |
635 } | 635 } |
636 buildCounterListInfoTypesResponse--; | 636 buildCounterListInfoTypesResponse--; |
637 } | 637 } |
638 | 638 |
639 core.int buildCounterListInspectFindingsResponse = 0; | 639 core.int buildCounterListInspectFindingsResponse = 0; |
640 buildListInspectFindingsResponse() { | 640 buildListInspectFindingsResponse() { |
641 var o = new api.ListInspectFindingsResponse(); | 641 var o = new api.ListInspectFindingsResponse(); |
642 buildCounterListInspectFindingsResponse++; | 642 buildCounterListInspectFindingsResponse++; |
643 if (buildCounterListInspectFindingsResponse < 3) { | 643 if (buildCounterListInspectFindingsResponse < 3) { |
644 o.nextPageToken = "foo"; | 644 o.nextPageToken = "foo"; |
645 o.result = buildInspectResult(); | 645 o.result = buildInspectResult(); |
646 } | 646 } |
647 buildCounterListInspectFindingsResponse--; | 647 buildCounterListInspectFindingsResponse--; |
648 return o; | 648 return o; |
649 } | 649 } |
650 | 650 |
651 checkListInspectFindingsResponse(api.ListInspectFindingsResponse o) { | 651 checkListInspectFindingsResponse(api.ListInspectFindingsResponse o) { |
652 buildCounterListInspectFindingsResponse++; | 652 buildCounterListInspectFindingsResponse++; |
653 if (buildCounterListInspectFindingsResponse < 3) { | 653 if (buildCounterListInspectFindingsResponse < 3) { |
654 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 654 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
655 checkInspectResult(o.result); | 655 checkInspectResult(o.result); |
656 } | 656 } |
657 buildCounterListInspectFindingsResponse--; | 657 buildCounterListInspectFindingsResponse--; |
658 } | 658 } |
659 | 659 |
660 buildUnnamed3703() { | 660 buildUnnamed3177() { |
661 var o = new core.List<api.Operation>(); | 661 var o = new core.List<api.Operation>(); |
662 o.add(buildOperation()); | 662 o.add(buildOperation()); |
663 o.add(buildOperation()); | 663 o.add(buildOperation()); |
664 return o; | 664 return o; |
665 } | 665 } |
666 | 666 |
667 checkUnnamed3703(core.List<api.Operation> o) { | 667 checkUnnamed3177(core.List<api.Operation> o) { |
668 unittest.expect(o, unittest.hasLength(2)); | 668 unittest.expect(o, unittest.hasLength(2)); |
669 checkOperation(o[0]); | 669 checkOperation(o[0]); |
670 checkOperation(o[1]); | 670 checkOperation(o[1]); |
671 } | 671 } |
672 | 672 |
673 core.int buildCounterListOperationsResponse = 0; | 673 core.int buildCounterListOperationsResponse = 0; |
674 buildListOperationsResponse() { | 674 buildListOperationsResponse() { |
675 var o = new api.ListOperationsResponse(); | 675 var o = new api.ListOperationsResponse(); |
676 buildCounterListOperationsResponse++; | 676 buildCounterListOperationsResponse++; |
677 if (buildCounterListOperationsResponse < 3) { | 677 if (buildCounterListOperationsResponse < 3) { |
678 o.nextPageToken = "foo"; | 678 o.nextPageToken = "foo"; |
679 o.operations = buildUnnamed3703(); | 679 o.operations = buildUnnamed3177(); |
680 } | 680 } |
681 buildCounterListOperationsResponse--; | 681 buildCounterListOperationsResponse--; |
682 return o; | 682 return o; |
683 } | 683 } |
684 | 684 |
685 checkListOperationsResponse(api.ListOperationsResponse o) { | 685 checkListOperationsResponse(api.ListOperationsResponse o) { |
686 buildCounterListOperationsResponse++; | 686 buildCounterListOperationsResponse++; |
687 if (buildCounterListOperationsResponse < 3) { | 687 if (buildCounterListOperationsResponse < 3) { |
688 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 688 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
689 checkUnnamed3703(o.operations); | 689 checkUnnamed3177(o.operations); |
690 } | 690 } |
691 buildCounterListOperationsResponse--; | 691 buildCounterListOperationsResponse--; |
692 } | 692 } |
693 | 693 |
694 buildUnnamed3704() { | 694 buildUnnamed3178() { |
695 var o = new core.List<api.CategoryDescription>(); | 695 var o = new core.List<api.CategoryDescription>(); |
696 o.add(buildCategoryDescription()); | 696 o.add(buildCategoryDescription()); |
697 o.add(buildCategoryDescription()); | 697 o.add(buildCategoryDescription()); |
698 return o; | 698 return o; |
699 } | 699 } |
700 | 700 |
701 checkUnnamed3704(core.List<api.CategoryDescription> o) { | 701 checkUnnamed3178(core.List<api.CategoryDescription> o) { |
702 unittest.expect(o, unittest.hasLength(2)); | 702 unittest.expect(o, unittest.hasLength(2)); |
703 checkCategoryDescription(o[0]); | 703 checkCategoryDescription(o[0]); |
704 checkCategoryDescription(o[1]); | 704 checkCategoryDescription(o[1]); |
705 } | 705 } |
706 | 706 |
707 core.int buildCounterListRootCategoriesResponse = 0; | 707 core.int buildCounterListRootCategoriesResponse = 0; |
708 buildListRootCategoriesResponse() { | 708 buildListRootCategoriesResponse() { |
709 var o = new api.ListRootCategoriesResponse(); | 709 var o = new api.ListRootCategoriesResponse(); |
710 buildCounterListRootCategoriesResponse++; | 710 buildCounterListRootCategoriesResponse++; |
711 if (buildCounterListRootCategoriesResponse < 3) { | 711 if (buildCounterListRootCategoriesResponse < 3) { |
712 o.categories = buildUnnamed3704(); | 712 o.categories = buildUnnamed3178(); |
713 } | 713 } |
714 buildCounterListRootCategoriesResponse--; | 714 buildCounterListRootCategoriesResponse--; |
715 return o; | 715 return o; |
716 } | 716 } |
717 | 717 |
718 checkListRootCategoriesResponse(api.ListRootCategoriesResponse o) { | 718 checkListRootCategoriesResponse(api.ListRootCategoriesResponse o) { |
719 buildCounterListRootCategoriesResponse++; | 719 buildCounterListRootCategoriesResponse++; |
720 if (buildCounterListRootCategoriesResponse < 3) { | 720 if (buildCounterListRootCategoriesResponse < 3) { |
721 checkUnnamed3704(o.categories); | 721 checkUnnamed3178(o.categories); |
722 } | 722 } |
723 buildCounterListRootCategoriesResponse--; | 723 buildCounterListRootCategoriesResponse--; |
724 } | 724 } |
725 | 725 |
726 buildUnnamed3705() { | 726 buildUnnamed3179() { |
727 var o = new core.List<api.ImageLocation>(); | 727 var o = new core.List<api.ImageLocation>(); |
728 o.add(buildImageLocation()); | 728 o.add(buildImageLocation()); |
729 o.add(buildImageLocation()); | 729 o.add(buildImageLocation()); |
730 return o; | 730 return o; |
731 } | 731 } |
732 | 732 |
733 checkUnnamed3705(core.List<api.ImageLocation> o) { | 733 checkUnnamed3179(core.List<api.ImageLocation> o) { |
734 unittest.expect(o, unittest.hasLength(2)); | 734 unittest.expect(o, unittest.hasLength(2)); |
735 checkImageLocation(o[0]); | 735 checkImageLocation(o[0]); |
736 checkImageLocation(o[1]); | 736 checkImageLocation(o[1]); |
737 } | 737 } |
738 | 738 |
739 core.int buildCounterLocation = 0; | 739 core.int buildCounterLocation = 0; |
740 buildLocation() { | 740 buildLocation() { |
741 var o = new api.Location(); | 741 var o = new api.Location(); |
742 buildCounterLocation++; | 742 buildCounterLocation++; |
743 if (buildCounterLocation < 3) { | 743 if (buildCounterLocation < 3) { |
744 o.byteRange = buildRange(); | 744 o.byteRange = buildRange(); |
745 o.codepointRange = buildRange(); | 745 o.codepointRange = buildRange(); |
746 o.fieldId = buildFieldId(); | 746 o.fieldId = buildFieldId(); |
747 o.imageBoxes = buildUnnamed3705(); | 747 o.imageBoxes = buildUnnamed3179(); |
748 o.recordKey = buildRecordKey(); | 748 o.recordKey = buildRecordKey(); |
749 } | 749 } |
750 buildCounterLocation--; | 750 buildCounterLocation--; |
751 return o; | 751 return o; |
752 } | 752 } |
753 | 753 |
754 checkLocation(api.Location o) { | 754 checkLocation(api.Location o) { |
755 buildCounterLocation++; | 755 buildCounterLocation++; |
756 if (buildCounterLocation < 3) { | 756 if (buildCounterLocation < 3) { |
757 checkRange(o.byteRange); | 757 checkRange(o.byteRange); |
758 checkRange(o.codepointRange); | 758 checkRange(o.codepointRange); |
759 checkFieldId(o.fieldId); | 759 checkFieldId(o.fieldId); |
760 checkUnnamed3705(o.imageBoxes); | 760 checkUnnamed3179(o.imageBoxes); |
761 checkRecordKey(o.recordKey); | 761 checkRecordKey(o.recordKey); |
762 } | 762 } |
763 buildCounterLocation--; | 763 buildCounterLocation--; |
764 } | 764 } |
765 | 765 |
766 buildUnnamed3706() { | 766 buildUnnamed3180() { |
767 var o = new core.Map<core.String, core.Object>(); | 767 var o = new core.Map<core.String, core.Object>(); |
768 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 768 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
769 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 769 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
770 return o; | 770 return o; |
771 } | 771 } |
772 | 772 |
773 checkUnnamed3706(core.Map<core.String, core.Object> o) { | 773 checkUnnamed3180(core.Map<core.String, core.Object> o) { |
774 unittest.expect(o, unittest.hasLength(2)); | 774 unittest.expect(o, unittest.hasLength(2)); |
775 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')); | 775 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')); |
776 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')); | 776 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')); |
777 } | 777 } |
778 | 778 |
779 buildUnnamed3707() { | 779 buildUnnamed3181() { |
780 var o = new core.Map<core.String, core.Object>(); | 780 var o = new core.Map<core.String, core.Object>(); |
781 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 781 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
782 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 782 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
783 return o; | 783 return o; |
784 } | 784 } |
785 | 785 |
786 checkUnnamed3707(core.Map<core.String, core.Object> o) { | 786 checkUnnamed3181(core.Map<core.String, core.Object> o) { |
787 unittest.expect(o, unittest.hasLength(2)); | 787 unittest.expect(o, unittest.hasLength(2)); |
788 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')); | 788 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')); |
789 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')); | 789 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')); |
790 } | 790 } |
791 | 791 |
792 core.int buildCounterOperation = 0; | 792 core.int buildCounterOperation = 0; |
793 buildOperation() { | 793 buildOperation() { |
794 var o = new api.Operation(); | 794 var o = new api.Operation(); |
795 buildCounterOperation++; | 795 buildCounterOperation++; |
796 if (buildCounterOperation < 3) { | 796 if (buildCounterOperation < 3) { |
797 o.done = true; | 797 o.done = true; |
798 o.error = buildStatus(); | 798 o.error = buildStatus(); |
799 o.metadata = buildUnnamed3706(); | 799 o.metadata = buildUnnamed3180(); |
800 o.name = "foo"; | 800 o.name = "foo"; |
801 o.response = buildUnnamed3707(); | 801 o.response = buildUnnamed3181(); |
802 } | 802 } |
803 buildCounterOperation--; | 803 buildCounterOperation--; |
804 return o; | 804 return o; |
805 } | 805 } |
806 | 806 |
807 checkOperation(api.Operation o) { | 807 checkOperation(api.Operation o) { |
808 buildCounterOperation++; | 808 buildCounterOperation++; |
809 if (buildCounterOperation < 3) { | 809 if (buildCounterOperation < 3) { |
810 unittest.expect(o.done, unittest.isTrue); | 810 unittest.expect(o.done, unittest.isTrue); |
811 checkStatus(o.error); | 811 checkStatus(o.error); |
812 checkUnnamed3706(o.metadata); | 812 checkUnnamed3180(o.metadata); |
813 unittest.expect(o.name, unittest.equals('foo')); | 813 unittest.expect(o.name, unittest.equals('foo')); |
814 checkUnnamed3707(o.response); | 814 checkUnnamed3181(o.response); |
815 } | 815 } |
816 buildCounterOperation--; | 816 buildCounterOperation--; |
817 } | 817 } |
818 | 818 |
819 core.int buildCounterOutputStorageConfig = 0; | 819 core.int buildCounterOutputStorageConfig = 0; |
820 buildOutputStorageConfig() { | 820 buildOutputStorageConfig() { |
821 var o = new api.OutputStorageConfig(); | 821 var o = new api.OutputStorageConfig(); |
822 buildCounterOutputStorageConfig++; | 822 buildCounterOutputStorageConfig++; |
823 if (buildCounterOutputStorageConfig < 3) { | 823 if (buildCounterOutputStorageConfig < 3) { |
824 o.storagePath = buildCloudStoragePath(); | 824 o.storagePath = buildCloudStoragePath(); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 | 952 |
953 checkRecordKey(api.RecordKey o) { | 953 checkRecordKey(api.RecordKey o) { |
954 buildCounterRecordKey++; | 954 buildCounterRecordKey++; |
955 if (buildCounterRecordKey < 3) { | 955 if (buildCounterRecordKey < 3) { |
956 checkCloudStorageKey(o.cloudStorageKey); | 956 checkCloudStorageKey(o.cloudStorageKey); |
957 checkDatastoreKey(o.datastoreKey); | 957 checkDatastoreKey(o.datastoreKey); |
958 } | 958 } |
959 buildCounterRecordKey--; | 959 buildCounterRecordKey--; |
960 } | 960 } |
961 | 961 |
962 buildUnnamed3708() { | 962 buildUnnamed3182() { |
963 var o = new core.List<api.ContentItem>(); | 963 var o = new core.List<api.ContentItem>(); |
964 o.add(buildContentItem()); | 964 o.add(buildContentItem()); |
965 o.add(buildContentItem()); | 965 o.add(buildContentItem()); |
966 return o; | 966 return o; |
967 } | 967 } |
968 | 968 |
969 checkUnnamed3708(core.List<api.ContentItem> o) { | 969 checkUnnamed3182(core.List<api.ContentItem> o) { |
970 unittest.expect(o, unittest.hasLength(2)); | 970 unittest.expect(o, unittest.hasLength(2)); |
971 checkContentItem(o[0]); | 971 checkContentItem(o[0]); |
972 checkContentItem(o[1]); | 972 checkContentItem(o[1]); |
973 } | 973 } |
974 | 974 |
975 buildUnnamed3709() { | 975 buildUnnamed3183() { |
976 var o = new core.List<api.ReplaceConfig>(); | 976 var o = new core.List<api.ReplaceConfig>(); |
977 o.add(buildReplaceConfig()); | 977 o.add(buildReplaceConfig()); |
978 o.add(buildReplaceConfig()); | 978 o.add(buildReplaceConfig()); |
979 return o; | 979 return o; |
980 } | 980 } |
981 | 981 |
982 checkUnnamed3709(core.List<api.ReplaceConfig> o) { | 982 checkUnnamed3183(core.List<api.ReplaceConfig> o) { |
983 unittest.expect(o, unittest.hasLength(2)); | 983 unittest.expect(o, unittest.hasLength(2)); |
984 checkReplaceConfig(o[0]); | 984 checkReplaceConfig(o[0]); |
985 checkReplaceConfig(o[1]); | 985 checkReplaceConfig(o[1]); |
986 } | 986 } |
987 | 987 |
988 core.int buildCounterRedactContentRequest = 0; | 988 core.int buildCounterRedactContentRequest = 0; |
989 buildRedactContentRequest() { | 989 buildRedactContentRequest() { |
990 var o = new api.RedactContentRequest(); | 990 var o = new api.RedactContentRequest(); |
991 buildCounterRedactContentRequest++; | 991 buildCounterRedactContentRequest++; |
992 if (buildCounterRedactContentRequest < 3) { | 992 if (buildCounterRedactContentRequest < 3) { |
993 o.inspectConfig = buildInspectConfig(); | 993 o.inspectConfig = buildInspectConfig(); |
994 o.items = buildUnnamed3708(); | 994 o.items = buildUnnamed3182(); |
995 o.replaceConfigs = buildUnnamed3709(); | 995 o.replaceConfigs = buildUnnamed3183(); |
996 } | 996 } |
997 buildCounterRedactContentRequest--; | 997 buildCounterRedactContentRequest--; |
998 return o; | 998 return o; |
999 } | 999 } |
1000 | 1000 |
1001 checkRedactContentRequest(api.RedactContentRequest o) { | 1001 checkRedactContentRequest(api.RedactContentRequest o) { |
1002 buildCounterRedactContentRequest++; | 1002 buildCounterRedactContentRequest++; |
1003 if (buildCounterRedactContentRequest < 3) { | 1003 if (buildCounterRedactContentRequest < 3) { |
1004 checkInspectConfig(o.inspectConfig); | 1004 checkInspectConfig(o.inspectConfig); |
1005 checkUnnamed3708(o.items); | 1005 checkUnnamed3182(o.items); |
1006 checkUnnamed3709(o.replaceConfigs); | 1006 checkUnnamed3183(o.replaceConfigs); |
1007 } | 1007 } |
1008 buildCounterRedactContentRequest--; | 1008 buildCounterRedactContentRequest--; |
1009 } | 1009 } |
1010 | 1010 |
1011 buildUnnamed3710() { | 1011 buildUnnamed3184() { |
1012 var o = new core.List<api.ContentItem>(); | 1012 var o = new core.List<api.ContentItem>(); |
1013 o.add(buildContentItem()); | 1013 o.add(buildContentItem()); |
1014 o.add(buildContentItem()); | 1014 o.add(buildContentItem()); |
1015 return o; | 1015 return o; |
1016 } | 1016 } |
1017 | 1017 |
1018 checkUnnamed3710(core.List<api.ContentItem> o) { | 1018 checkUnnamed3184(core.List<api.ContentItem> o) { |
1019 unittest.expect(o, unittest.hasLength(2)); | 1019 unittest.expect(o, unittest.hasLength(2)); |
1020 checkContentItem(o[0]); | 1020 checkContentItem(o[0]); |
1021 checkContentItem(o[1]); | 1021 checkContentItem(o[1]); |
1022 } | 1022 } |
1023 | 1023 |
1024 core.int buildCounterRedactContentResponse = 0; | 1024 core.int buildCounterRedactContentResponse = 0; |
1025 buildRedactContentResponse() { | 1025 buildRedactContentResponse() { |
1026 var o = new api.RedactContentResponse(); | 1026 var o = new api.RedactContentResponse(); |
1027 buildCounterRedactContentResponse++; | 1027 buildCounterRedactContentResponse++; |
1028 if (buildCounterRedactContentResponse < 3) { | 1028 if (buildCounterRedactContentResponse < 3) { |
1029 o.items = buildUnnamed3710(); | 1029 o.items = buildUnnamed3184(); |
1030 } | 1030 } |
1031 buildCounterRedactContentResponse--; | 1031 buildCounterRedactContentResponse--; |
1032 return o; | 1032 return o; |
1033 } | 1033 } |
1034 | 1034 |
1035 checkRedactContentResponse(api.RedactContentResponse o) { | 1035 checkRedactContentResponse(api.RedactContentResponse o) { |
1036 buildCounterRedactContentResponse++; | 1036 buildCounterRedactContentResponse++; |
1037 if (buildCounterRedactContentResponse < 3) { | 1037 if (buildCounterRedactContentResponse < 3) { |
1038 checkUnnamed3710(o.items); | 1038 checkUnnamed3184(o.items); |
1039 } | 1039 } |
1040 buildCounterRedactContentResponse--; | 1040 buildCounterRedactContentResponse--; |
1041 } | 1041 } |
1042 | 1042 |
1043 core.int buildCounterReplaceConfig = 0; | 1043 core.int buildCounterReplaceConfig = 0; |
1044 buildReplaceConfig() { | 1044 buildReplaceConfig() { |
1045 var o = new api.ReplaceConfig(); | 1045 var o = new api.ReplaceConfig(); |
1046 buildCounterReplaceConfig++; | 1046 buildCounterReplaceConfig++; |
1047 if (buildCounterReplaceConfig < 3) { | 1047 if (buildCounterReplaceConfig < 3) { |
1048 o.infoType = buildInfoType(); | 1048 o.infoType = buildInfoType(); |
1049 o.replaceWith = "foo"; | 1049 o.replaceWith = "foo"; |
1050 } | 1050 } |
1051 buildCounterReplaceConfig--; | 1051 buildCounterReplaceConfig--; |
1052 return o; | 1052 return o; |
1053 } | 1053 } |
1054 | 1054 |
1055 checkReplaceConfig(api.ReplaceConfig o) { | 1055 checkReplaceConfig(api.ReplaceConfig o) { |
1056 buildCounterReplaceConfig++; | 1056 buildCounterReplaceConfig++; |
1057 if (buildCounterReplaceConfig < 3) { | 1057 if (buildCounterReplaceConfig < 3) { |
1058 checkInfoType(o.infoType); | 1058 checkInfoType(o.infoType); |
1059 unittest.expect(o.replaceWith, unittest.equals('foo')); | 1059 unittest.expect(o.replaceWith, unittest.equals('foo')); |
1060 } | 1060 } |
1061 buildCounterReplaceConfig--; | 1061 buildCounterReplaceConfig--; |
1062 } | 1062 } |
1063 | 1063 |
1064 buildUnnamed3711() { | 1064 buildUnnamed3185() { |
1065 var o = new core.Map<core.String, core.Object>(); | 1065 var o = new core.Map<core.String, core.Object>(); |
1066 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 1066 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
1067 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 1067 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
1068 return o; | 1068 return o; |
1069 } | 1069 } |
1070 | 1070 |
1071 checkUnnamed3711(core.Map<core.String, core.Object> o) { | 1071 checkUnnamed3185(core.Map<core.String, core.Object> o) { |
1072 unittest.expect(o, unittest.hasLength(2)); | 1072 unittest.expect(o, unittest.hasLength(2)); |
1073 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')); | 1073 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')); |
1074 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')); | 1074 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')); |
1075 } | 1075 } |
1076 | 1076 |
1077 buildUnnamed3712() { | 1077 buildUnnamed3186() { |
1078 var o = new core.List<core.Map<core.String, core.Object>>(); | 1078 var o = new core.List<core.Map<core.String, core.Object>>(); |
1079 o.add(buildUnnamed3711()); | 1079 o.add(buildUnnamed3185()); |
1080 o.add(buildUnnamed3711()); | 1080 o.add(buildUnnamed3185()); |
1081 return o; | 1081 return o; |
1082 } | 1082 } |
1083 | 1083 |
1084 checkUnnamed3712(core.List<core.Map<core.String, core.Object>> o) { | 1084 checkUnnamed3186(core.List<core.Map<core.String, core.Object>> o) { |
1085 unittest.expect(o, unittest.hasLength(2)); | 1085 unittest.expect(o, unittest.hasLength(2)); |
1086 checkUnnamed3711(o[0]); | 1086 checkUnnamed3185(o[0]); |
1087 checkUnnamed3711(o[1]); | 1087 checkUnnamed3185(o[1]); |
1088 } | 1088 } |
1089 | 1089 |
1090 core.int buildCounterStatus = 0; | 1090 core.int buildCounterStatus = 0; |
1091 buildStatus() { | 1091 buildStatus() { |
1092 var o = new api.Status(); | 1092 var o = new api.Status(); |
1093 buildCounterStatus++; | 1093 buildCounterStatus++; |
1094 if (buildCounterStatus < 3) { | 1094 if (buildCounterStatus < 3) { |
1095 o.code = 42; | 1095 o.code = 42; |
1096 o.details = buildUnnamed3712(); | 1096 o.details = buildUnnamed3186(); |
1097 o.message = "foo"; | 1097 o.message = "foo"; |
1098 } | 1098 } |
1099 buildCounterStatus--; | 1099 buildCounterStatus--; |
1100 return o; | 1100 return o; |
1101 } | 1101 } |
1102 | 1102 |
1103 checkStatus(api.Status o) { | 1103 checkStatus(api.Status o) { |
1104 buildCounterStatus++; | 1104 buildCounterStatus++; |
1105 if (buildCounterStatus < 3) { | 1105 if (buildCounterStatus < 3) { |
1106 unittest.expect(o.code, unittest.equals(42)); | 1106 unittest.expect(o.code, unittest.equals(42)); |
1107 checkUnnamed3712(o.details); | 1107 checkUnnamed3186(o.details); |
1108 unittest.expect(o.message, unittest.equals('foo')); | 1108 unittest.expect(o.message, unittest.equals('foo')); |
1109 } | 1109 } |
1110 buildCounterStatus--; | 1110 buildCounterStatus--; |
1111 } | 1111 } |
1112 | 1112 |
1113 core.int buildCounterStorageConfig = 0; | 1113 core.int buildCounterStorageConfig = 0; |
1114 buildStorageConfig() { | 1114 buildStorageConfig() { |
1115 var o = new api.StorageConfig(); | 1115 var o = new api.StorageConfig(); |
1116 buildCounterStorageConfig++; | 1116 buildCounterStorageConfig++; |
1117 if (buildCounterStorageConfig < 3) { | 1117 if (buildCounterStorageConfig < 3) { |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1492 }); | 1492 }); |
1493 }); | 1493 }); |
1494 | 1494 |
1495 | 1495 |
1496 unittest.group("resource-ContentResourceApi", () { | 1496 unittest.group("resource-ContentResourceApi", () { |
1497 unittest.test("method--inspect", () { | 1497 unittest.test("method--inspect", () { |
1498 | 1498 |
1499 var mock = new HttpServerMock(); | 1499 var mock = new HttpServerMock(); |
1500 api.ContentResourceApi res = new api.DlpApi(mock).content; | 1500 api.ContentResourceApi res = new api.DlpApi(mock).content; |
1501 var arg_request = buildInspectContentRequest(); | 1501 var arg_request = buildInspectContentRequest(); |
1502 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1502 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1503 var obj = new api.InspectContentRequest.fromJson(json); | 1503 var obj = new api.InspectContentRequest.fromJson(json); |
1504 checkInspectContentRequest(obj); | 1504 checkInspectContentRequest(obj); |
1505 | 1505 |
1506 var path = (req.url).path; | 1506 var path = (req.url).path; |
1507 var pathOffset = 0; | 1507 var pathOffset = 0; |
1508 var index; | 1508 var index; |
1509 var subPart; | 1509 var subPart; |
1510 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1510 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1511 pathOffset += 1; | 1511 pathOffset += 1; |
1512 unittest.expect(path.substring(pathOffset, pathOffset + 23), unittest.eq
uals("v2beta1/content:inspect")); | 1512 unittest.expect(path.substring(pathOffset, pathOffset + 23), unittest.eq
uals("v2beta1/content:inspect")); |
(...skipping 16 matching lines...) Expand all Loading... |
1529 } | 1529 } |
1530 } | 1530 } |
1531 | 1531 |
1532 | 1532 |
1533 var h = { | 1533 var h = { |
1534 "content-type" : "application/json; charset=utf-8", | 1534 "content-type" : "application/json; charset=utf-8", |
1535 }; | 1535 }; |
1536 var resp = convert.JSON.encode(buildInspectContentResponse()); | 1536 var resp = convert.JSON.encode(buildInspectContentResponse()); |
1537 return new async.Future.value(stringResponse(200, h, resp)); | 1537 return new async.Future.value(stringResponse(200, h, resp)); |
1538 }), true); | 1538 }), true); |
1539 res.inspect(arg_request).then(unittest.expectAsync(((api.InspectContentRes
ponse response) { | 1539 res.inspect(arg_request).then(unittest.expectAsync1(((api.InspectContentRe
sponse response) { |
1540 checkInspectContentResponse(response); | 1540 checkInspectContentResponse(response); |
1541 }))); | 1541 }))); |
1542 }); | 1542 }); |
1543 | 1543 |
1544 unittest.test("method--redact", () { | 1544 unittest.test("method--redact", () { |
1545 | 1545 |
1546 var mock = new HttpServerMock(); | 1546 var mock = new HttpServerMock(); |
1547 api.ContentResourceApi res = new api.DlpApi(mock).content; | 1547 api.ContentResourceApi res = new api.DlpApi(mock).content; |
1548 var arg_request = buildRedactContentRequest(); | 1548 var arg_request = buildRedactContentRequest(); |
1549 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1549 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1550 var obj = new api.RedactContentRequest.fromJson(json); | 1550 var obj = new api.RedactContentRequest.fromJson(json); |
1551 checkRedactContentRequest(obj); | 1551 checkRedactContentRequest(obj); |
1552 | 1552 |
1553 var path = (req.url).path; | 1553 var path = (req.url).path; |
1554 var pathOffset = 0; | 1554 var pathOffset = 0; |
1555 var index; | 1555 var index; |
1556 var subPart; | 1556 var subPart; |
1557 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1557 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1558 pathOffset += 1; | 1558 pathOffset += 1; |
1559 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("v2beta1/content:redact")); | 1559 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("v2beta1/content:redact")); |
(...skipping 16 matching lines...) Expand all Loading... |
1576 } | 1576 } |
1577 } | 1577 } |
1578 | 1578 |
1579 | 1579 |
1580 var h = { | 1580 var h = { |
1581 "content-type" : "application/json; charset=utf-8", | 1581 "content-type" : "application/json; charset=utf-8", |
1582 }; | 1582 }; |
1583 var resp = convert.JSON.encode(buildRedactContentResponse()); | 1583 var resp = convert.JSON.encode(buildRedactContentResponse()); |
1584 return new async.Future.value(stringResponse(200, h, resp)); | 1584 return new async.Future.value(stringResponse(200, h, resp)); |
1585 }), true); | 1585 }), true); |
1586 res.redact(arg_request).then(unittest.expectAsync(((api.RedactContentRespo
nse response) { | 1586 res.redact(arg_request).then(unittest.expectAsync1(((api.RedactContentResp
onse response) { |
1587 checkRedactContentResponse(response); | 1587 checkRedactContentResponse(response); |
1588 }))); | 1588 }))); |
1589 }); | 1589 }); |
1590 | 1590 |
1591 }); | 1591 }); |
1592 | 1592 |
1593 | 1593 |
1594 unittest.group("resource-InspectOperationsResourceApi", () { | 1594 unittest.group("resource-InspectOperationsResourceApi", () { |
1595 unittest.test("method--cancel", () { | 1595 unittest.test("method--cancel", () { |
1596 | 1596 |
1597 var mock = new HttpServerMock(); | 1597 var mock = new HttpServerMock(); |
1598 api.InspectOperationsResourceApi res = new api.DlpApi(mock).inspect.operat
ions; | 1598 api.InspectOperationsResourceApi res = new api.DlpApi(mock).inspect.operat
ions; |
1599 var arg_request = buildCancelOperationRequest(); | 1599 var arg_request = buildCancelOperationRequest(); |
1600 var arg_name = "foo"; | 1600 var arg_name = "foo"; |
1601 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1601 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1602 var obj = new api.CancelOperationRequest.fromJson(json); | 1602 var obj = new api.CancelOperationRequest.fromJson(json); |
1603 checkCancelOperationRequest(obj); | 1603 checkCancelOperationRequest(obj); |
1604 | 1604 |
1605 var path = (req.url).path; | 1605 var path = (req.url).path; |
1606 var pathOffset = 0; | 1606 var pathOffset = 0; |
1607 var index; | 1607 var index; |
1608 var subPart; | 1608 var subPart; |
1609 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1609 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1610 pathOffset += 1; | 1610 pathOffset += 1; |
1611 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v2beta1/")); | 1611 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v2beta1/")); |
(...skipping 17 matching lines...) Expand all Loading... |
1629 } | 1629 } |
1630 } | 1630 } |
1631 | 1631 |
1632 | 1632 |
1633 var h = { | 1633 var h = { |
1634 "content-type" : "application/json; charset=utf-8", | 1634 "content-type" : "application/json; charset=utf-8", |
1635 }; | 1635 }; |
1636 var resp = convert.JSON.encode(buildEmpty()); | 1636 var resp = convert.JSON.encode(buildEmpty()); |
1637 return new async.Future.value(stringResponse(200, h, resp)); | 1637 return new async.Future.value(stringResponse(200, h, resp)); |
1638 }), true); | 1638 }), true); |
1639 res.cancel(arg_request, arg_name).then(unittest.expectAsync(((api.Empty re
sponse) { | 1639 res.cancel(arg_request, arg_name).then(unittest.expectAsync1(((api.Empty r
esponse) { |
1640 checkEmpty(response); | 1640 checkEmpty(response); |
1641 }))); | 1641 }))); |
1642 }); | 1642 }); |
1643 | 1643 |
1644 unittest.test("method--create", () { | 1644 unittest.test("method--create", () { |
1645 | 1645 |
1646 var mock = new HttpServerMock(); | 1646 var mock = new HttpServerMock(); |
1647 api.InspectOperationsResourceApi res = new api.DlpApi(mock).inspect.operat
ions; | 1647 api.InspectOperationsResourceApi res = new api.DlpApi(mock).inspect.operat
ions; |
1648 var arg_request = buildCreateInspectOperationRequest(); | 1648 var arg_request = buildCreateInspectOperationRequest(); |
1649 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1649 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1650 var obj = new api.CreateInspectOperationRequest.fromJson(json); | 1650 var obj = new api.CreateInspectOperationRequest.fromJson(json); |
1651 checkCreateInspectOperationRequest(obj); | 1651 checkCreateInspectOperationRequest(obj); |
1652 | 1652 |
1653 var path = (req.url).path; | 1653 var path = (req.url).path; |
1654 var pathOffset = 0; | 1654 var pathOffset = 0; |
1655 var index; | 1655 var index; |
1656 var subPart; | 1656 var subPart; |
1657 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1657 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1658 pathOffset += 1; | 1658 pathOffset += 1; |
1659 unittest.expect(path.substring(pathOffset, pathOffset + 26), unittest.eq
uals("v2beta1/inspect/operations")); | 1659 unittest.expect(path.substring(pathOffset, pathOffset + 26), unittest.eq
uals("v2beta1/inspect/operations")); |
(...skipping 16 matching lines...) Expand all Loading... |
1676 } | 1676 } |
1677 } | 1677 } |
1678 | 1678 |
1679 | 1679 |
1680 var h = { | 1680 var h = { |
1681 "content-type" : "application/json; charset=utf-8", | 1681 "content-type" : "application/json; charset=utf-8", |
1682 }; | 1682 }; |
1683 var resp = convert.JSON.encode(buildOperation()); | 1683 var resp = convert.JSON.encode(buildOperation()); |
1684 return new async.Future.value(stringResponse(200, h, resp)); | 1684 return new async.Future.value(stringResponse(200, h, resp)); |
1685 }), true); | 1685 }), true); |
1686 res.create(arg_request).then(unittest.expectAsync(((api.Operation response
) { | 1686 res.create(arg_request).then(unittest.expectAsync1(((api.Operation respons
e) { |
1687 checkOperation(response); | 1687 checkOperation(response); |
1688 }))); | 1688 }))); |
1689 }); | 1689 }); |
1690 | 1690 |
1691 unittest.test("method--delete", () { | 1691 unittest.test("method--delete", () { |
1692 | 1692 |
1693 var mock = new HttpServerMock(); | 1693 var mock = new HttpServerMock(); |
1694 api.InspectOperationsResourceApi res = new api.DlpApi(mock).inspect.operat
ions; | 1694 api.InspectOperationsResourceApi res = new api.DlpApi(mock).inspect.operat
ions; |
1695 var arg_name = "foo"; | 1695 var arg_name = "foo"; |
1696 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1696 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1697 var path = (req.url).path; | 1697 var path = (req.url).path; |
1698 var pathOffset = 0; | 1698 var pathOffset = 0; |
1699 var index; | 1699 var index; |
1700 var subPart; | 1700 var subPart; |
1701 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1701 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1702 pathOffset += 1; | 1702 pathOffset += 1; |
1703 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v2beta1/")); | 1703 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v2beta1/")); |
1704 pathOffset += 8; | 1704 pathOffset += 8; |
1705 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1705 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1706 | 1706 |
(...skipping 14 matching lines...) Expand all Loading... |
1721 } | 1721 } |
1722 } | 1722 } |
1723 | 1723 |
1724 | 1724 |
1725 var h = { | 1725 var h = { |
1726 "content-type" : "application/json; charset=utf-8", | 1726 "content-type" : "application/json; charset=utf-8", |
1727 }; | 1727 }; |
1728 var resp = convert.JSON.encode(buildEmpty()); | 1728 var resp = convert.JSON.encode(buildEmpty()); |
1729 return new async.Future.value(stringResponse(200, h, resp)); | 1729 return new async.Future.value(stringResponse(200, h, resp)); |
1730 }), true); | 1730 }), true); |
1731 res.delete(arg_name).then(unittest.expectAsync(((api.Empty response) { | 1731 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) { |
1732 checkEmpty(response); | 1732 checkEmpty(response); |
1733 }))); | 1733 }))); |
1734 }); | 1734 }); |
1735 | 1735 |
1736 unittest.test("method--get", () { | 1736 unittest.test("method--get", () { |
1737 | 1737 |
1738 var mock = new HttpServerMock(); | 1738 var mock = new HttpServerMock(); |
1739 api.InspectOperationsResourceApi res = new api.DlpApi(mock).inspect.operat
ions; | 1739 api.InspectOperationsResourceApi res = new api.DlpApi(mock).inspect.operat
ions; |
1740 var arg_name = "foo"; | 1740 var arg_name = "foo"; |
1741 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1741 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1742 var path = (req.url).path; | 1742 var path = (req.url).path; |
1743 var pathOffset = 0; | 1743 var pathOffset = 0; |
1744 var index; | 1744 var index; |
1745 var subPart; | 1745 var subPart; |
1746 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1746 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1747 pathOffset += 1; | 1747 pathOffset += 1; |
1748 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v2beta1/")); | 1748 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v2beta1/")); |
1749 pathOffset += 8; | 1749 pathOffset += 8; |
1750 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1750 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1751 | 1751 |
(...skipping 14 matching lines...) Expand all Loading... |
1766 } | 1766 } |
1767 } | 1767 } |
1768 | 1768 |
1769 | 1769 |
1770 var h = { | 1770 var h = { |
1771 "content-type" : "application/json; charset=utf-8", | 1771 "content-type" : "application/json; charset=utf-8", |
1772 }; | 1772 }; |
1773 var resp = convert.JSON.encode(buildOperation()); | 1773 var resp = convert.JSON.encode(buildOperation()); |
1774 return new async.Future.value(stringResponse(200, h, resp)); | 1774 return new async.Future.value(stringResponse(200, h, resp)); |
1775 }), true); | 1775 }), true); |
1776 res.get(arg_name).then(unittest.expectAsync(((api.Operation response) { | 1776 res.get(arg_name).then(unittest.expectAsync1(((api.Operation response) { |
1777 checkOperation(response); | 1777 checkOperation(response); |
1778 }))); | 1778 }))); |
1779 }); | 1779 }); |
1780 | 1780 |
1781 unittest.test("method--list", () { | 1781 unittest.test("method--list", () { |
1782 | 1782 |
1783 var mock = new HttpServerMock(); | 1783 var mock = new HttpServerMock(); |
1784 api.InspectOperationsResourceApi res = new api.DlpApi(mock).inspect.operat
ions; | 1784 api.InspectOperationsResourceApi res = new api.DlpApi(mock).inspect.operat
ions; |
1785 var arg_name = "foo"; | 1785 var arg_name = "foo"; |
| 1786 var arg_pageSize = 42; |
1786 var arg_filter = "foo"; | 1787 var arg_filter = "foo"; |
1787 var arg_pageToken = "foo"; | 1788 var arg_pageToken = "foo"; |
1788 var arg_pageSize = 42; | 1789 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1789 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
1790 var path = (req.url).path; | 1790 var path = (req.url).path; |
1791 var pathOffset = 0; | 1791 var pathOffset = 0; |
1792 var index; | 1792 var index; |
1793 var subPart; | 1793 var subPart; |
1794 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1794 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1795 pathOffset += 1; | 1795 pathOffset += 1; |
1796 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v2beta1/")); | 1796 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v2beta1/")); |
1797 pathOffset += 8; | 1797 pathOffset += 8; |
1798 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1798 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1799 | 1799 |
1800 var query = (req.url).query; | 1800 var query = (req.url).query; |
1801 var queryOffset = 0; | 1801 var queryOffset = 0; |
1802 var queryMap = {}; | 1802 var queryMap = {}; |
1803 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1803 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1804 parseBool(n) { | 1804 parseBool(n) { |
1805 if (n == "true") return true; | 1805 if (n == "true") return true; |
1806 if (n == "false") return false; | 1806 if (n == "false") return false; |
1807 if (n == null) return null; | 1807 if (n == null) return null; |
1808 throw new core.ArgumentError("Invalid boolean: $n"); | 1808 throw new core.ArgumentError("Invalid boolean: $n"); |
1809 } | 1809 } |
1810 if (query.length > 0) { | 1810 if (query.length > 0) { |
1811 for (var part in query.split("&")) { | 1811 for (var part in query.split("&")) { |
1812 var keyvalue = part.split("="); | 1812 var keyvalue = part.split("="); |
1813 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1813 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1814 } | 1814 } |
1815 } | 1815 } |
| 1816 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
1816 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 1817 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
1817 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1818 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1818 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
1819 | 1819 |
1820 | 1820 |
1821 var h = { | 1821 var h = { |
1822 "content-type" : "application/json; charset=utf-8", | 1822 "content-type" : "application/json; charset=utf-8", |
1823 }; | 1823 }; |
1824 var resp = convert.JSON.encode(buildListOperationsResponse()); | 1824 var resp = convert.JSON.encode(buildListOperationsResponse()); |
1825 return new async.Future.value(stringResponse(200, h, resp)); | 1825 return new async.Future.value(stringResponse(200, h, resp)); |
1826 }), true); | 1826 }), true); |
1827 res.list(arg_name, filter: arg_filter, pageToken: arg_pageToken, pageSize:
arg_pageSize).then(unittest.expectAsync(((api.ListOperationsResponse response)
{ | 1827 res.list(arg_name, pageSize: arg_pageSize, filter: arg_filter, pageToken:
arg_pageToken).then(unittest.expectAsync1(((api.ListOperationsResponse response)
{ |
1828 checkListOperationsResponse(response); | 1828 checkListOperationsResponse(response); |
1829 }))); | 1829 }))); |
1830 }); | 1830 }); |
1831 | 1831 |
1832 }); | 1832 }); |
1833 | 1833 |
1834 | 1834 |
1835 unittest.group("resource-InspectResultsFindingsResourceApi", () { | 1835 unittest.group("resource-InspectResultsFindingsResourceApi", () { |
1836 unittest.test("method--list", () { | 1836 unittest.test("method--list", () { |
1837 | 1837 |
1838 var mock = new HttpServerMock(); | 1838 var mock = new HttpServerMock(); |
1839 api.InspectResultsFindingsResourceApi res = new api.DlpApi(mock).inspect.r
esults.findings; | 1839 api.InspectResultsFindingsResourceApi res = new api.DlpApi(mock).inspect.r
esults.findings; |
1840 var arg_name = "foo"; | 1840 var arg_name = "foo"; |
1841 var arg_pageSize = 42; | 1841 var arg_pageSize = 42; |
1842 var arg_filter = "foo"; | 1842 var arg_filter = "foo"; |
1843 var arg_pageToken = "foo"; | 1843 var arg_pageToken = "foo"; |
1844 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1844 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1845 var path = (req.url).path; | 1845 var path = (req.url).path; |
1846 var pathOffset = 0; | 1846 var pathOffset = 0; |
1847 var index; | 1847 var index; |
1848 var subPart; | 1848 var subPart; |
1849 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1849 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1850 pathOffset += 1; | 1850 pathOffset += 1; |
1851 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v2beta1/")); | 1851 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v2beta1/")); |
1852 pathOffset += 8; | 1852 pathOffset += 8; |
1853 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1853 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1854 | 1854 |
(...skipping 17 matching lines...) Expand all Loading... |
1872 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 1872 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
1873 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1873 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1874 | 1874 |
1875 | 1875 |
1876 var h = { | 1876 var h = { |
1877 "content-type" : "application/json; charset=utf-8", | 1877 "content-type" : "application/json; charset=utf-8", |
1878 }; | 1878 }; |
1879 var resp = convert.JSON.encode(buildListInspectFindingsResponse()); | 1879 var resp = convert.JSON.encode(buildListInspectFindingsResponse()); |
1880 return new async.Future.value(stringResponse(200, h, resp)); | 1880 return new async.Future.value(stringResponse(200, h, resp)); |
1881 }), true); | 1881 }), true); |
1882 res.list(arg_name, pageSize: arg_pageSize, filter: arg_filter, pageToken:
arg_pageToken).then(unittest.expectAsync(((api.ListInspectFindingsResponse respo
nse) { | 1882 res.list(arg_name, pageSize: arg_pageSize, filter: arg_filter, pageToken:
arg_pageToken).then(unittest.expectAsync1(((api.ListInspectFindingsResponse resp
onse) { |
1883 checkListInspectFindingsResponse(response); | 1883 checkListInspectFindingsResponse(response); |
1884 }))); | 1884 }))); |
1885 }); | 1885 }); |
1886 | 1886 |
1887 }); | 1887 }); |
1888 | 1888 |
1889 | 1889 |
1890 unittest.group("resource-RootCategoriesResourceApi", () { | 1890 unittest.group("resource-RootCategoriesResourceApi", () { |
1891 unittest.test("method--list", () { | 1891 unittest.test("method--list", () { |
1892 | 1892 |
1893 var mock = new HttpServerMock(); | 1893 var mock = new HttpServerMock(); |
1894 api.RootCategoriesResourceApi res = new api.DlpApi(mock).rootCategories; | 1894 api.RootCategoriesResourceApi res = new api.DlpApi(mock).rootCategories; |
1895 var arg_languageCode = "foo"; | 1895 var arg_languageCode = "foo"; |
1896 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1896 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1897 var path = (req.url).path; | 1897 var path = (req.url).path; |
1898 var pathOffset = 0; | 1898 var pathOffset = 0; |
1899 var index; | 1899 var index; |
1900 var subPart; | 1900 var subPart; |
1901 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1901 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1902 pathOffset += 1; | 1902 pathOffset += 1; |
1903 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("v2beta1/rootCategories")); | 1903 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("v2beta1/rootCategories")); |
1904 pathOffset += 22; | 1904 pathOffset += 22; |
1905 | 1905 |
1906 var query = (req.url).query; | 1906 var query = (req.url).query; |
(...skipping 14 matching lines...) Expand all Loading... |
1921 } | 1921 } |
1922 unittest.expect(queryMap["languageCode"].first, unittest.equals(arg_lang
uageCode)); | 1922 unittest.expect(queryMap["languageCode"].first, unittest.equals(arg_lang
uageCode)); |
1923 | 1923 |
1924 | 1924 |
1925 var h = { | 1925 var h = { |
1926 "content-type" : "application/json; charset=utf-8", | 1926 "content-type" : "application/json; charset=utf-8", |
1927 }; | 1927 }; |
1928 var resp = convert.JSON.encode(buildListRootCategoriesResponse()); | 1928 var resp = convert.JSON.encode(buildListRootCategoriesResponse()); |
1929 return new async.Future.value(stringResponse(200, h, resp)); | 1929 return new async.Future.value(stringResponse(200, h, resp)); |
1930 }), true); | 1930 }), true); |
1931 res.list(languageCode: arg_languageCode).then(unittest.expectAsync(((api.L
istRootCategoriesResponse response) { | 1931 res.list(languageCode: arg_languageCode).then(unittest.expectAsync1(((api.
ListRootCategoriesResponse response) { |
1932 checkListRootCategoriesResponse(response); | 1932 checkListRootCategoriesResponse(response); |
1933 }))); | 1933 }))); |
1934 }); | 1934 }); |
1935 | 1935 |
1936 }); | 1936 }); |
1937 | 1937 |
1938 | 1938 |
1939 unittest.group("resource-RootCategoriesInfoTypesResourceApi", () { | 1939 unittest.group("resource-RootCategoriesInfoTypesResourceApi", () { |
1940 unittest.test("method--list", () { | 1940 unittest.test("method--list", () { |
1941 | 1941 |
1942 var mock = new HttpServerMock(); | 1942 var mock = new HttpServerMock(); |
1943 api.RootCategoriesInfoTypesResourceApi res = new api.DlpApi(mock).rootCate
gories.infoTypes; | 1943 api.RootCategoriesInfoTypesResourceApi res = new api.DlpApi(mock).rootCate
gories.infoTypes; |
1944 var arg_category = "foo"; | 1944 var arg_category = "foo"; |
1945 var arg_languageCode = "foo"; | 1945 var arg_languageCode = "foo"; |
1946 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1946 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1947 var path = (req.url).path; | 1947 var path = (req.url).path; |
1948 var pathOffset = 0; | 1948 var pathOffset = 0; |
1949 var index; | 1949 var index; |
1950 var subPart; | 1950 var subPart; |
1951 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1951 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1952 pathOffset += 1; | 1952 pathOffset += 1; |
1953 unittest.expect(path.substring(pathOffset, pathOffset + 23), unittest.eq
uals("v2beta1/rootCategories/")); | 1953 unittest.expect(path.substring(pathOffset, pathOffset + 23), unittest.eq
uals("v2beta1/rootCategories/")); |
1954 pathOffset += 23; | 1954 pathOffset += 23; |
1955 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1955 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1956 | 1956 |
(...skipping 15 matching lines...) Expand all Loading... |
1972 } | 1972 } |
1973 unittest.expect(queryMap["languageCode"].first, unittest.equals(arg_lang
uageCode)); | 1973 unittest.expect(queryMap["languageCode"].first, unittest.equals(arg_lang
uageCode)); |
1974 | 1974 |
1975 | 1975 |
1976 var h = { | 1976 var h = { |
1977 "content-type" : "application/json; charset=utf-8", | 1977 "content-type" : "application/json; charset=utf-8", |
1978 }; | 1978 }; |
1979 var resp = convert.JSON.encode(buildListInfoTypesResponse()); | 1979 var resp = convert.JSON.encode(buildListInfoTypesResponse()); |
1980 return new async.Future.value(stringResponse(200, h, resp)); | 1980 return new async.Future.value(stringResponse(200, h, resp)); |
1981 }), true); | 1981 }), true); |
1982 res.list(arg_category, languageCode: arg_languageCode).then(unittest.expec
tAsync(((api.ListInfoTypesResponse response) { | 1982 res.list(arg_category, languageCode: arg_languageCode).then(unittest.expec
tAsync1(((api.ListInfoTypesResponse response) { |
1983 checkListInfoTypesResponse(response); | 1983 checkListInfoTypesResponse(response); |
1984 }))); | 1984 }))); |
1985 }); | 1985 }); |
1986 | 1986 |
1987 }); | 1987 }); |
1988 | 1988 |
1989 | 1989 |
1990 } | 1990 } |
1991 | 1991 |
OLD | NEW |