OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
1 library googleapis.customsearch.v1; | 3 library googleapis.customsearch.v1; |
2 | 4 |
3 import "dart:core" as core; | 5 import 'dart:core' as core; |
4 import "dart:collection" as collection; | 6 import 'dart:collection' as collection; |
5 import "dart:async" as async; | 7 import 'dart:async' as async; |
6 import "dart:convert" as convert; | 8 import 'dart:convert' as convert; |
7 | 9 |
8 import "package:crypto/crypto.dart" as crypto; | 10 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 11 import 'package:crypto/crypto.dart' as crypto; |
9 import 'package:http/http.dart' as http; | 12 import 'package:http/http.dart' as http; |
10 import '../src/common_internal.dart' as common_internal; | |
11 import '../common/common.dart' as common; | |
12 | 13 |
13 export '../common/common.dart' show ApiRequestError; | 14 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
14 export '../common/common.dart' show DetailedApiRequestError; | 15 ApiRequestError, DetailedApiRequestError; |
| 16 |
| 17 const core.String USER_AGENT = 'dart-api-client customsearch/v1'; |
15 | 18 |
16 /** Lets you search over a website or collection of websites */ | 19 /** Lets you search over a website or collection of websites */ |
17 class CustomsearchApi { | 20 class CustomsearchApi { |
18 | 21 |
19 final common_internal.ApiRequester _requester; | 22 final commons.ApiRequester _requester; |
20 | 23 |
21 CseResourceApi get cse => new CseResourceApi(_requester); | 24 CseResourceApi get cse => new CseResourceApi(_requester); |
22 | 25 |
23 CustomsearchApi(http.Client client, {core.String rootUrl: "https://www.googlea
pis.com/", core.String servicePath: "customsearch/"}) : | 26 CustomsearchApi(http.Client client, {core.String rootUrl: "https://www.googlea
pis.com/", core.String servicePath: "customsearch/"}) : |
24 _requester = new common_internal.ApiRequester(client, rootUrl, servicePath
); | 27 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
25 } | 28 } |
26 | 29 |
27 | 30 |
28 /** Not documented yet. */ | |
29 class CseResourceApi { | 31 class CseResourceApi { |
30 final common_internal.ApiRequester _requester; | 32 final commons.ApiRequester _requester; |
31 | 33 |
32 CseResourceApi(common_internal.ApiRequester client) : | 34 CseResourceApi(commons.ApiRequester client) : |
33 _requester = client; | 35 _requester = client; |
34 | 36 |
35 /** | 37 /** |
36 * Returns metadata about the search performed, metadata about the custom | 38 * Returns metadata about the search performed, metadata about the custom |
37 * search engine used for the search, and the search results. | 39 * search engine used for the search, and the search results. |
38 * | 40 * |
39 * Request parameters: | 41 * Request parameters: |
40 * | 42 * |
41 * [q] - Query | 43 * [q] - Query |
42 * | 44 * |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 * Possible string values are: | 193 * Possible string values are: |
192 * - "e" : exclude | 194 * - "e" : exclude |
193 * - "i" : include | 195 * - "i" : include |
194 * | 196 * |
195 * [sort] - The sort expression to apply to the results | 197 * [sort] - The sort expression to apply to the results |
196 * | 198 * |
197 * [start] - The index of the first result to return | 199 * [start] - The index of the first result to return |
198 * | 200 * |
199 * Completes with a [Search]. | 201 * Completes with a [Search]. |
200 * | 202 * |
201 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 203 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
202 * error. | 204 * error. |
203 * | 205 * |
204 * If the used [http.Client] completes with an error when making a REST call, | 206 * If the used [http.Client] completes with an error when making a REST call, |
205 * this method will complete with the same error. | 207 * this method will complete with the same error. |
206 */ | 208 */ |
207 async.Future<Search> list(core.String q, {core.String c2coff, core.String cr,
core.String cref, core.String cx, core.String dateRestrict, core.String exactTer
ms, core.String excludeTerms, core.String fileType, core.String filter, core.Str
ing gl, core.String googlehost, core.String highRange, core.String hl, core.Stri
ng hq, core.String imgColorType, core.String imgDominantColor, core.String imgSi
ze, core.String imgType, core.String linkSite, core.String lowRange, core.String
lr, core.int num, core.String orTerms, core.String relatedSite, core.String rig
hts, core.String safe, core.String searchType, core.String siteSearch, core.Stri
ng siteSearchFilter, core.String sort, core.int start}) { | 209 async.Future<Search> list(core.String q, {core.String c2coff, core.String cr,
core.String cref, core.String cx, core.String dateRestrict, core.String exactTer
ms, core.String excludeTerms, core.String fileType, core.String filter, core.Str
ing gl, core.String googlehost, core.String highRange, core.String hl, core.Stri
ng hq, core.String imgColorType, core.String imgDominantColor, core.String imgSi
ze, core.String imgType, core.String linkSite, core.String lowRange, core.String
lr, core.int num, core.String orTerms, core.String relatedSite, core.String rig
hts, core.String safe, core.String searchType, core.String siteSearch, core.Stri
ng siteSearchFilter, core.String sort, core.int start}) { |
208 var _url = null; | 210 var _url = null; |
209 var _queryParams = new core.Map(); | 211 var _queryParams = new core.Map(); |
210 var _uploadMedia = null; | 212 var _uploadMedia = null; |
211 var _uploadOptions = null; | 213 var _uploadOptions = null; |
212 var _downloadOptions = common.DownloadOptions.Metadata; | 214 var _downloadOptions = commons.DownloadOptions.Metadata; |
213 var _body = null; | 215 var _body = null; |
214 | 216 |
215 if (q == null) { | 217 if (q == null) { |
216 throw new core.ArgumentError("Parameter q is required."); | 218 throw new core.ArgumentError("Parameter q is required."); |
217 } | 219 } |
218 _queryParams["q"] = [q]; | 220 _queryParams["q"] = [q]; |
219 if (c2coff != null) { | 221 if (c2coff != null) { |
220 _queryParams["c2coff"] = [c2coff]; | 222 _queryParams["c2coff"] = [c2coff]; |
221 } | 223 } |
222 if (cr != null) { | 224 if (cr != null) { |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 uploadOptions: _uploadOptions, | 322 uploadOptions: _uploadOptions, |
321 uploadMedia: _uploadMedia, | 323 uploadMedia: _uploadMedia, |
322 downloadOptions: _downloadOptions); | 324 downloadOptions: _downloadOptions); |
323 return _response.then((data) => new Search.fromJson(data)); | 325 return _response.then((data) => new Search.fromJson(data)); |
324 } | 326 } |
325 | 327 |
326 } | 328 } |
327 | 329 |
328 | 330 |
329 | 331 |
330 /** Not documented yet. */ | |
331 class ContextFacets { | 332 class ContextFacets { |
332 /** Not documented yet. */ | |
333 core.String anchor; | 333 core.String anchor; |
334 | 334 |
335 /** Not documented yet. */ | |
336 core.String label; | 335 core.String label; |
337 | 336 |
338 /** Not documented yet. */ | |
339 core.String labelWithOp; | 337 core.String labelWithOp; |
340 | 338 |
341 | 339 |
342 ContextFacets(); | 340 ContextFacets(); |
343 | 341 |
344 ContextFacets.fromJson(core.Map _json) { | 342 ContextFacets.fromJson(core.Map _json) { |
345 if (_json.containsKey("anchor")) { | 343 if (_json.containsKey("anchor")) { |
346 anchor = _json["anchor"]; | 344 anchor = _json["anchor"]; |
347 } | 345 } |
348 if (_json.containsKey("label")) { | 346 if (_json.containsKey("label")) { |
(...skipping 13 matching lines...) Expand all Loading... |
362 _json["label"] = label; | 360 _json["label"] = label; |
363 } | 361 } |
364 if (labelWithOp != null) { | 362 if (labelWithOp != null) { |
365 _json["label_with_op"] = labelWithOp; | 363 _json["label_with_op"] = labelWithOp; |
366 } | 364 } |
367 return _json; | 365 return _json; |
368 } | 366 } |
369 } | 367 } |
370 | 368 |
371 | 369 |
372 /** Not documented yet. */ | |
373 class Context { | 370 class Context { |
374 /** Not documented yet. */ | |
375 core.List<core.List<ContextFacets>> facets; | 371 core.List<core.List<ContextFacets>> facets; |
376 | 372 |
377 /** Not documented yet. */ | |
378 core.String title; | 373 core.String title; |
379 | 374 |
380 | 375 |
381 Context(); | 376 Context(); |
382 | 377 |
383 Context.fromJson(core.Map _json) { | 378 Context.fromJson(core.Map _json) { |
384 if (_json.containsKey("facets")) { | 379 if (_json.containsKey("facets")) { |
385 facets = _json["facets"].map((value) => value.map((value) => new ContextFa
cets.fromJson(value)).toList()).toList(); | 380 facets = _json["facets"].map((value) => value.map((value) => new ContextFa
cets.fromJson(value)).toList()).toList(); |
386 } | 381 } |
387 if (_json.containsKey("title")) { | 382 if (_json.containsKey("title")) { |
388 title = _json["title"]; | 383 title = _json["title"]; |
389 } | 384 } |
390 } | 385 } |
391 | 386 |
392 core.Map toJson() { | 387 core.Map toJson() { |
393 var _json = new core.Map(); | 388 var _json = new core.Map(); |
394 if (facets != null) { | 389 if (facets != null) { |
395 _json["facets"] = facets.map((value) => value.map((value) => (value).toJso
n()).toList()).toList(); | 390 _json["facets"] = facets.map((value) => value.map((value) => (value).toJso
n()).toList()).toList(); |
396 } | 391 } |
397 if (title != null) { | 392 if (title != null) { |
398 _json["title"] = title; | 393 _json["title"] = title; |
399 } | 394 } |
400 return _json; | 395 return _json; |
401 } | 396 } |
402 } | 397 } |
403 | 398 |
404 | 399 |
405 /** Not documented yet. */ | |
406 class PromotionBodyLines { | 400 class PromotionBodyLines { |
407 /** Not documented yet. */ | |
408 core.String htmlTitle; | 401 core.String htmlTitle; |
409 | 402 |
410 /** Not documented yet. */ | |
411 core.String link; | 403 core.String link; |
412 | 404 |
413 /** Not documented yet. */ | |
414 core.String title; | 405 core.String title; |
415 | 406 |
416 /** Not documented yet. */ | |
417 core.String url; | 407 core.String url; |
418 | 408 |
419 | 409 |
420 PromotionBodyLines(); | 410 PromotionBodyLines(); |
421 | 411 |
422 PromotionBodyLines.fromJson(core.Map _json) { | 412 PromotionBodyLines.fromJson(core.Map _json) { |
423 if (_json.containsKey("htmlTitle")) { | 413 if (_json.containsKey("htmlTitle")) { |
424 htmlTitle = _json["htmlTitle"]; | 414 htmlTitle = _json["htmlTitle"]; |
425 } | 415 } |
426 if (_json.containsKey("link")) { | 416 if (_json.containsKey("link")) { |
(...skipping 19 matching lines...) Expand all Loading... |
446 _json["title"] = title; | 436 _json["title"] = title; |
447 } | 437 } |
448 if (url != null) { | 438 if (url != null) { |
449 _json["url"] = url; | 439 _json["url"] = url; |
450 } | 440 } |
451 return _json; | 441 return _json; |
452 } | 442 } |
453 } | 443 } |
454 | 444 |
455 | 445 |
456 /** Not documented yet. */ | |
457 class PromotionImage { | 446 class PromotionImage { |
458 /** Not documented yet. */ | |
459 core.int height; | 447 core.int height; |
460 | 448 |
461 /** Not documented yet. */ | |
462 core.String source; | 449 core.String source; |
463 | 450 |
464 /** Not documented yet. */ | |
465 core.int width; | 451 core.int width; |
466 | 452 |
467 | 453 |
468 PromotionImage(); | 454 PromotionImage(); |
469 | 455 |
470 PromotionImage.fromJson(core.Map _json) { | 456 PromotionImage.fromJson(core.Map _json) { |
471 if (_json.containsKey("height")) { | 457 if (_json.containsKey("height")) { |
472 height = _json["height"]; | 458 height = _json["height"]; |
473 } | 459 } |
474 if (_json.containsKey("source")) { | 460 if (_json.containsKey("source")) { |
(...skipping 13 matching lines...) Expand all Loading... |
488 _json["source"] = source; | 474 _json["source"] = source; |
489 } | 475 } |
490 if (width != null) { | 476 if (width != null) { |
491 _json["width"] = width; | 477 _json["width"] = width; |
492 } | 478 } |
493 return _json; | 479 return _json; |
494 } | 480 } |
495 } | 481 } |
496 | 482 |
497 | 483 |
498 /** Not documented yet. */ | |
499 class Promotion { | 484 class Promotion { |
500 /** Not documented yet. */ | |
501 core.List<PromotionBodyLines> bodyLines; | 485 core.List<PromotionBodyLines> bodyLines; |
502 | 486 |
503 /** Not documented yet. */ | |
504 core.String displayLink; | 487 core.String displayLink; |
505 | 488 |
506 /** Not documented yet. */ | |
507 core.String htmlTitle; | 489 core.String htmlTitle; |
508 | 490 |
509 /** Not documented yet. */ | |
510 PromotionImage image; | 491 PromotionImage image; |
511 | 492 |
512 /** Not documented yet. */ | |
513 core.String link; | 493 core.String link; |
514 | 494 |
515 /** Not documented yet. */ | |
516 core.String title; | 495 core.String title; |
517 | 496 |
518 | 497 |
519 Promotion(); | 498 Promotion(); |
520 | 499 |
521 Promotion.fromJson(core.Map _json) { | 500 Promotion.fromJson(core.Map _json) { |
522 if (_json.containsKey("bodyLines")) { | 501 if (_json.containsKey("bodyLines")) { |
523 bodyLines = _json["bodyLines"].map((value) => new PromotionBodyLines.fromJ
son(value)).toList(); | 502 bodyLines = _json["bodyLines"].map((value) => new PromotionBodyLines.fromJ
son(value)).toList(); |
524 } | 503 } |
525 if (_json.containsKey("displayLink")) { | 504 if (_json.containsKey("displayLink")) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 _json["link"] = link; | 536 _json["link"] = link; |
558 } | 537 } |
559 if (title != null) { | 538 if (title != null) { |
560 _json["title"] = title; | 539 _json["title"] = title; |
561 } | 540 } |
562 return _json; | 541 return _json; |
563 } | 542 } |
564 } | 543 } |
565 | 544 |
566 | 545 |
567 /** Not documented yet. */ | |
568 class Query { | 546 class Query { |
569 /** Not documented yet. */ | |
570 core.int count; | 547 core.int count; |
571 | 548 |
572 /** Not documented yet. */ | |
573 core.String cr; | 549 core.String cr; |
574 | 550 |
575 /** Not documented yet. */ | |
576 core.String cref; | 551 core.String cref; |
577 | 552 |
578 /** Not documented yet. */ | |
579 core.String cx; | 553 core.String cx; |
580 | 554 |
581 /** Not documented yet. */ | |
582 core.String dateRestrict; | 555 core.String dateRestrict; |
583 | 556 |
584 /** Not documented yet. */ | |
585 core.String disableCnTwTranslation; | 557 core.String disableCnTwTranslation; |
586 | 558 |
587 /** Not documented yet. */ | |
588 core.String exactTerms; | 559 core.String exactTerms; |
589 | 560 |
590 /** Not documented yet. */ | |
591 core.String excludeTerms; | 561 core.String excludeTerms; |
592 | 562 |
593 /** Not documented yet. */ | |
594 core.String fileType; | 563 core.String fileType; |
595 | 564 |
596 /** Not documented yet. */ | |
597 core.String filter; | 565 core.String filter; |
598 | 566 |
599 /** Not documented yet. */ | |
600 core.String gl; | 567 core.String gl; |
601 | 568 |
602 /** Not documented yet. */ | |
603 core.String googleHost; | 569 core.String googleHost; |
604 | 570 |
605 /** Not documented yet. */ | |
606 core.String highRange; | 571 core.String highRange; |
607 | 572 |
608 /** Not documented yet. */ | |
609 core.String hl; | 573 core.String hl; |
610 | 574 |
611 /** Not documented yet. */ | |
612 core.String hq; | 575 core.String hq; |
613 | 576 |
614 /** Not documented yet. */ | |
615 core.String imgColorType; | 577 core.String imgColorType; |
616 | 578 |
617 /** Not documented yet. */ | |
618 core.String imgDominantColor; | 579 core.String imgDominantColor; |
619 | 580 |
620 /** Not documented yet. */ | |
621 core.String imgSize; | 581 core.String imgSize; |
622 | 582 |
623 /** Not documented yet. */ | |
624 core.String imgType; | 583 core.String imgType; |
625 | 584 |
626 /** Not documented yet. */ | |
627 core.String inputEncoding; | 585 core.String inputEncoding; |
628 | 586 |
629 /** Not documented yet. */ | |
630 core.String language; | 587 core.String language; |
631 | 588 |
632 /** Not documented yet. */ | |
633 core.String linkSite; | 589 core.String linkSite; |
634 | 590 |
635 /** Not documented yet. */ | |
636 core.String lowRange; | 591 core.String lowRange; |
637 | 592 |
638 /** Not documented yet. */ | |
639 core.String orTerms; | 593 core.String orTerms; |
640 | 594 |
641 /** Not documented yet. */ | |
642 core.String outputEncoding; | 595 core.String outputEncoding; |
643 | 596 |
644 /** Not documented yet. */ | |
645 core.String relatedSite; | 597 core.String relatedSite; |
646 | 598 |
647 /** Not documented yet. */ | |
648 core.String rights; | 599 core.String rights; |
649 | 600 |
650 /** Not documented yet. */ | |
651 core.String safe; | 601 core.String safe; |
652 | 602 |
653 /** Not documented yet. */ | |
654 core.String searchTerms; | 603 core.String searchTerms; |
655 | 604 |
656 /** Not documented yet. */ | |
657 core.String searchType; | 605 core.String searchType; |
658 | 606 |
659 /** Not documented yet. */ | |
660 core.String siteSearch; | 607 core.String siteSearch; |
661 | 608 |
662 /** Not documented yet. */ | |
663 core.String siteSearchFilter; | 609 core.String siteSearchFilter; |
664 | 610 |
665 /** Not documented yet. */ | |
666 core.String sort; | 611 core.String sort; |
667 | 612 |
668 /** Not documented yet. */ | |
669 core.int startIndex; | 613 core.int startIndex; |
670 | 614 |
671 /** Not documented yet. */ | |
672 core.int startPage; | 615 core.int startPage; |
673 | 616 |
674 /** Not documented yet. */ | |
675 core.String title; | 617 core.String title; |
676 | 618 |
677 /** Not documented yet. */ | |
678 core.String totalResults; | 619 core.String totalResults; |
679 | 620 |
680 | 621 |
681 Query(); | 622 Query(); |
682 | 623 |
683 Query.fromJson(core.Map _json) { | 624 Query.fromJson(core.Map _json) { |
684 if (_json.containsKey("count")) { | 625 if (_json.containsKey("count")) { |
685 count = _json["count"]; | 626 count = _json["count"]; |
686 } | 627 } |
687 if (_json.containsKey("cr")) { | 628 if (_json.containsKey("cr")) { |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 _json["title"] = title; | 846 _json["title"] = title; |
906 } | 847 } |
907 if (totalResults != null) { | 848 if (totalResults != null) { |
908 _json["totalResults"] = totalResults; | 849 _json["totalResults"] = totalResults; |
909 } | 850 } |
910 return _json; | 851 return _json; |
911 } | 852 } |
912 } | 853 } |
913 | 854 |
914 | 855 |
915 /** Not documented yet. */ | |
916 class ResultImage { | 856 class ResultImage { |
917 /** Not documented yet. */ | |
918 core.int byteSize; | 857 core.int byteSize; |
919 | 858 |
920 /** Not documented yet. */ | |
921 core.String contextLink; | 859 core.String contextLink; |
922 | 860 |
923 /** Not documented yet. */ | |
924 core.int height; | 861 core.int height; |
925 | 862 |
926 /** Not documented yet. */ | |
927 core.int thumbnailHeight; | 863 core.int thumbnailHeight; |
928 | 864 |
929 /** Not documented yet. */ | |
930 core.String thumbnailLink; | 865 core.String thumbnailLink; |
931 | 866 |
932 /** Not documented yet. */ | |
933 core.int thumbnailWidth; | 867 core.int thumbnailWidth; |
934 | 868 |
935 /** Not documented yet. */ | |
936 core.int width; | 869 core.int width; |
937 | 870 |
938 | 871 |
939 ResultImage(); | 872 ResultImage(); |
940 | 873 |
941 ResultImage.fromJson(core.Map _json) { | 874 ResultImage.fromJson(core.Map _json) { |
942 if (_json.containsKey("byteSize")) { | 875 if (_json.containsKey("byteSize")) { |
943 byteSize = _json["byteSize"]; | 876 byteSize = _json["byteSize"]; |
944 } | 877 } |
945 if (_json.containsKey("contextLink")) { | 878 if (_json.containsKey("contextLink")) { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 _json["thumbnailWidth"] = thumbnailWidth; | 916 _json["thumbnailWidth"] = thumbnailWidth; |
984 } | 917 } |
985 if (width != null) { | 918 if (width != null) { |
986 _json["width"] = width; | 919 _json["width"] = width; |
987 } | 920 } |
988 return _json; | 921 return _json; |
989 } | 922 } |
990 } | 923 } |
991 | 924 |
992 | 925 |
993 /** Not documented yet. */ | |
994 class ResultLabels { | 926 class ResultLabels { |
995 /** Not documented yet. */ | |
996 core.String displayName; | 927 core.String displayName; |
997 | 928 |
998 /** Not documented yet. */ | |
999 core.String labelWithOp; | 929 core.String labelWithOp; |
1000 | 930 |
1001 /** Not documented yet. */ | |
1002 core.String name; | 931 core.String name; |
1003 | 932 |
1004 | 933 |
1005 ResultLabels(); | 934 ResultLabels(); |
1006 | 935 |
1007 ResultLabels.fromJson(core.Map _json) { | 936 ResultLabels.fromJson(core.Map _json) { |
1008 if (_json.containsKey("displayName")) { | 937 if (_json.containsKey("displayName")) { |
1009 displayName = _json["displayName"]; | 938 displayName = _json["displayName"]; |
1010 } | 939 } |
1011 if (_json.containsKey("label_with_op")) { | 940 if (_json.containsKey("label_with_op")) { |
(...skipping 13 matching lines...) Expand all Loading... |
1025 _json["label_with_op"] = labelWithOp; | 954 _json["label_with_op"] = labelWithOp; |
1026 } | 955 } |
1027 if (name != null) { | 956 if (name != null) { |
1028 _json["name"] = name; | 957 _json["name"] = name; |
1029 } | 958 } |
1030 return _json; | 959 return _json; |
1031 } | 960 } |
1032 } | 961 } |
1033 | 962 |
1034 | 963 |
1035 /** Not documented yet. */ | |
1036 class Result { | 964 class Result { |
1037 /** Not documented yet. */ | |
1038 core.String cacheId; | 965 core.String cacheId; |
1039 | 966 |
1040 /** Not documented yet. */ | |
1041 core.String displayLink; | 967 core.String displayLink; |
1042 | 968 |
1043 /** Not documented yet. */ | |
1044 core.String fileFormat; | 969 core.String fileFormat; |
1045 | 970 |
1046 /** Not documented yet. */ | |
1047 core.String formattedUrl; | 971 core.String formattedUrl; |
1048 | 972 |
1049 /** Not documented yet. */ | |
1050 core.String htmlFormattedUrl; | 973 core.String htmlFormattedUrl; |
1051 | 974 |
1052 /** Not documented yet. */ | |
1053 core.String htmlSnippet; | 975 core.String htmlSnippet; |
1054 | 976 |
1055 /** Not documented yet. */ | |
1056 core.String htmlTitle; | 977 core.String htmlTitle; |
1057 | 978 |
1058 /** Not documented yet. */ | |
1059 ResultImage image; | 979 ResultImage image; |
1060 | 980 |
1061 /** Not documented yet. */ | |
1062 core.String kind; | 981 core.String kind; |
1063 | 982 |
1064 /** Not documented yet. */ | |
1065 core.List<ResultLabels> labels; | 983 core.List<ResultLabels> labels; |
1066 | 984 |
1067 /** Not documented yet. */ | |
1068 core.String link; | 985 core.String link; |
1069 | 986 |
1070 /** Not documented yet. */ | |
1071 core.String mime; | 987 core.String mime; |
1072 | 988 |
1073 /** | 989 /** |
1074 * Not documented yet. | 990 * |
1075 * | 991 * |
1076 * The values for Object must be JSON objects. It can consist of `num`, | 992 * The values for Object must be JSON objects. It can consist of `num`, |
1077 * `String`, `bool` and `null` as well as `Map` and `List` values. | 993 * `String`, `bool` and `null` as well as `Map` and `List` values. |
1078 */ | 994 */ |
1079 core.Map<core.String, core.List<core.Map<core.String, core.Object>>> pagemap; | 995 core.Map<core.String, core.List<core.Map<core.String, core.Object>>> pagemap; |
1080 | 996 |
1081 /** Not documented yet. */ | |
1082 core.String snippet; | 997 core.String snippet; |
1083 | 998 |
1084 /** Not documented yet. */ | |
1085 core.String title; | 999 core.String title; |
1086 | 1000 |
1087 | 1001 |
1088 Result(); | 1002 Result(); |
1089 | 1003 |
1090 Result.fromJson(core.Map _json) { | 1004 Result.fromJson(core.Map _json) { |
1091 if (_json.containsKey("cacheId")) { | 1005 if (_json.containsKey("cacheId")) { |
1092 cacheId = _json["cacheId"]; | 1006 cacheId = _json["cacheId"]; |
1093 } | 1007 } |
1094 if (_json.containsKey("displayLink")) { | 1008 if (_json.containsKey("displayLink")) { |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 _json["snippet"] = snippet; | 1094 _json["snippet"] = snippet; |
1181 } | 1095 } |
1182 if (title != null) { | 1096 if (title != null) { |
1183 _json["title"] = title; | 1097 _json["title"] = title; |
1184 } | 1098 } |
1185 return _json; | 1099 return _json; |
1186 } | 1100 } |
1187 } | 1101 } |
1188 | 1102 |
1189 | 1103 |
1190 /** Not documented yet. */ | |
1191 class SearchSearchInformation { | 1104 class SearchSearchInformation { |
1192 /** Not documented yet. */ | |
1193 core.String formattedSearchTime; | 1105 core.String formattedSearchTime; |
1194 | 1106 |
1195 /** Not documented yet. */ | |
1196 core.String formattedTotalResults; | 1107 core.String formattedTotalResults; |
1197 | 1108 |
1198 /** Not documented yet. */ | |
1199 core.double searchTime; | 1109 core.double searchTime; |
1200 | 1110 |
1201 /** Not documented yet. */ | |
1202 core.String totalResults; | 1111 core.String totalResults; |
1203 | 1112 |
1204 | 1113 |
1205 SearchSearchInformation(); | 1114 SearchSearchInformation(); |
1206 | 1115 |
1207 SearchSearchInformation.fromJson(core.Map _json) { | 1116 SearchSearchInformation.fromJson(core.Map _json) { |
1208 if (_json.containsKey("formattedSearchTime")) { | 1117 if (_json.containsKey("formattedSearchTime")) { |
1209 formattedSearchTime = _json["formattedSearchTime"]; | 1118 formattedSearchTime = _json["formattedSearchTime"]; |
1210 } | 1119 } |
1211 if (_json.containsKey("formattedTotalResults")) { | 1120 if (_json.containsKey("formattedTotalResults")) { |
(...skipping 19 matching lines...) Expand all Loading... |
1231 _json["searchTime"] = searchTime; | 1140 _json["searchTime"] = searchTime; |
1232 } | 1141 } |
1233 if (totalResults != null) { | 1142 if (totalResults != null) { |
1234 _json["totalResults"] = totalResults; | 1143 _json["totalResults"] = totalResults; |
1235 } | 1144 } |
1236 return _json; | 1145 return _json; |
1237 } | 1146 } |
1238 } | 1147 } |
1239 | 1148 |
1240 | 1149 |
1241 /** Not documented yet. */ | |
1242 class SearchSpelling { | 1150 class SearchSpelling { |
1243 /** Not documented yet. */ | |
1244 core.String correctedQuery; | 1151 core.String correctedQuery; |
1245 | 1152 |
1246 /** Not documented yet. */ | |
1247 core.String htmlCorrectedQuery; | 1153 core.String htmlCorrectedQuery; |
1248 | 1154 |
1249 | 1155 |
1250 SearchSpelling(); | 1156 SearchSpelling(); |
1251 | 1157 |
1252 SearchSpelling.fromJson(core.Map _json) { | 1158 SearchSpelling.fromJson(core.Map _json) { |
1253 if (_json.containsKey("correctedQuery")) { | 1159 if (_json.containsKey("correctedQuery")) { |
1254 correctedQuery = _json["correctedQuery"]; | 1160 correctedQuery = _json["correctedQuery"]; |
1255 } | 1161 } |
1256 if (_json.containsKey("htmlCorrectedQuery")) { | 1162 if (_json.containsKey("htmlCorrectedQuery")) { |
1257 htmlCorrectedQuery = _json["htmlCorrectedQuery"]; | 1163 htmlCorrectedQuery = _json["htmlCorrectedQuery"]; |
1258 } | 1164 } |
1259 } | 1165 } |
1260 | 1166 |
1261 core.Map toJson() { | 1167 core.Map toJson() { |
1262 var _json = new core.Map(); | 1168 var _json = new core.Map(); |
1263 if (correctedQuery != null) { | 1169 if (correctedQuery != null) { |
1264 _json["correctedQuery"] = correctedQuery; | 1170 _json["correctedQuery"] = correctedQuery; |
1265 } | 1171 } |
1266 if (htmlCorrectedQuery != null) { | 1172 if (htmlCorrectedQuery != null) { |
1267 _json["htmlCorrectedQuery"] = htmlCorrectedQuery; | 1173 _json["htmlCorrectedQuery"] = htmlCorrectedQuery; |
1268 } | 1174 } |
1269 return _json; | 1175 return _json; |
1270 } | 1176 } |
1271 } | 1177 } |
1272 | 1178 |
1273 | 1179 |
1274 /** Not documented yet. */ | |
1275 class SearchUrl { | 1180 class SearchUrl { |
1276 /** Not documented yet. */ | |
1277 core.String template; | 1181 core.String template; |
1278 | 1182 |
1279 /** Not documented yet. */ | |
1280 core.String type; | 1183 core.String type; |
1281 | 1184 |
1282 | 1185 |
1283 SearchUrl(); | 1186 SearchUrl(); |
1284 | 1187 |
1285 SearchUrl.fromJson(core.Map _json) { | 1188 SearchUrl.fromJson(core.Map _json) { |
1286 if (_json.containsKey("template")) { | 1189 if (_json.containsKey("template")) { |
1287 template = _json["template"]; | 1190 template = _json["template"]; |
1288 } | 1191 } |
1289 if (_json.containsKey("type")) { | 1192 if (_json.containsKey("type")) { |
1290 type = _json["type"]; | 1193 type = _json["type"]; |
1291 } | 1194 } |
1292 } | 1195 } |
1293 | 1196 |
1294 core.Map toJson() { | 1197 core.Map toJson() { |
1295 var _json = new core.Map(); | 1198 var _json = new core.Map(); |
1296 if (template != null) { | 1199 if (template != null) { |
1297 _json["template"] = template; | 1200 _json["template"] = template; |
1298 } | 1201 } |
1299 if (type != null) { | 1202 if (type != null) { |
1300 _json["type"] = type; | 1203 _json["type"] = type; |
1301 } | 1204 } |
1302 return _json; | 1205 return _json; |
1303 } | 1206 } |
1304 } | 1207 } |
1305 | 1208 |
1306 | 1209 |
1307 /** Not documented yet. */ | |
1308 class Search { | 1210 class Search { |
1309 /** Not documented yet. */ | |
1310 Context context; | 1211 Context context; |
1311 | 1212 |
1312 /** Not documented yet. */ | |
1313 core.List<Result> items; | 1213 core.List<Result> items; |
1314 | 1214 |
1315 /** Not documented yet. */ | |
1316 core.String kind; | 1215 core.String kind; |
1317 | 1216 |
1318 /** Not documented yet. */ | |
1319 core.List<Promotion> promotions; | 1217 core.List<Promotion> promotions; |
1320 | 1218 |
1321 /** Not documented yet. */ | |
1322 core.Map<core.String, core.List<Query>> queries; | 1219 core.Map<core.String, core.List<Query>> queries; |
1323 | 1220 |
1324 /** Not documented yet. */ | |
1325 SearchSearchInformation searchInformation; | 1221 SearchSearchInformation searchInformation; |
1326 | 1222 |
1327 /** Not documented yet. */ | |
1328 SearchSpelling spelling; | 1223 SearchSpelling spelling; |
1329 | 1224 |
1330 /** Not documented yet. */ | |
1331 SearchUrl url; | 1225 SearchUrl url; |
1332 | 1226 |
1333 | 1227 |
1334 Search(); | 1228 Search(); |
1335 | 1229 |
1336 Search.fromJson(core.Map _json) { | 1230 Search.fromJson(core.Map _json) { |
1337 if (_json.containsKey("context")) { | 1231 if (_json.containsKey("context")) { |
1338 context = new Context.fromJson(_json["context"]); | 1232 context = new Context.fromJson(_json["context"]); |
1339 } | 1233 } |
1340 if (_json.containsKey("items")) { | 1234 if (_json.containsKey("items")) { |
1341 items = _json["items"].map((value) => new Result.fromJson(value)).toList()
; | 1235 items = _json["items"].map((value) => new Result.fromJson(value)).toList()
; |
1342 } | 1236 } |
1343 if (_json.containsKey("kind")) { | 1237 if (_json.containsKey("kind")) { |
1344 kind = _json["kind"]; | 1238 kind = _json["kind"]; |
1345 } | 1239 } |
1346 if (_json.containsKey("promotions")) { | 1240 if (_json.containsKey("promotions")) { |
1347 promotions = _json["promotions"].map((value) => new Promotion.fromJson(val
ue)).toList(); | 1241 promotions = _json["promotions"].map((value) => new Promotion.fromJson(val
ue)).toList(); |
1348 } | 1242 } |
1349 if (_json.containsKey("queries")) { | 1243 if (_json.containsKey("queries")) { |
1350 queries = common_internal.mapMap(_json["queries"], (item) => item.map((val
ue) => new Query.fromJson(value)).toList()); | 1244 queries = commons.mapMap(_json["queries"], (item) => item.map((value) => n
ew Query.fromJson(value)).toList()); |
1351 } | 1245 } |
1352 if (_json.containsKey("searchInformation")) { | 1246 if (_json.containsKey("searchInformation")) { |
1353 searchInformation = new SearchSearchInformation.fromJson(_json["searchInfo
rmation"]); | 1247 searchInformation = new SearchSearchInformation.fromJson(_json["searchInfo
rmation"]); |
1354 } | 1248 } |
1355 if (_json.containsKey("spelling")) { | 1249 if (_json.containsKey("spelling")) { |
1356 spelling = new SearchSpelling.fromJson(_json["spelling"]); | 1250 spelling = new SearchSpelling.fromJson(_json["spelling"]); |
1357 } | 1251 } |
1358 if (_json.containsKey("url")) { | 1252 if (_json.containsKey("url")) { |
1359 url = new SearchUrl.fromJson(_json["url"]); | 1253 url = new SearchUrl.fromJson(_json["url"]); |
1360 } | 1254 } |
1361 } | 1255 } |
1362 | 1256 |
1363 core.Map toJson() { | 1257 core.Map toJson() { |
1364 var _json = new core.Map(); | 1258 var _json = new core.Map(); |
1365 if (context != null) { | 1259 if (context != null) { |
1366 _json["context"] = (context).toJson(); | 1260 _json["context"] = (context).toJson(); |
1367 } | 1261 } |
1368 if (items != null) { | 1262 if (items != null) { |
1369 _json["items"] = items.map((value) => (value).toJson()).toList(); | 1263 _json["items"] = items.map((value) => (value).toJson()).toList(); |
1370 } | 1264 } |
1371 if (kind != null) { | 1265 if (kind != null) { |
1372 _json["kind"] = kind; | 1266 _json["kind"] = kind; |
1373 } | 1267 } |
1374 if (promotions != null) { | 1268 if (promotions != null) { |
1375 _json["promotions"] = promotions.map((value) => (value).toJson()).toList()
; | 1269 _json["promotions"] = promotions.map((value) => (value).toJson()).toList()
; |
1376 } | 1270 } |
1377 if (queries != null) { | 1271 if (queries != null) { |
1378 _json["queries"] = common_internal.mapMap(queries, (item) => item.map((val
ue) => (value).toJson()).toList()); | 1272 _json["queries"] = commons.mapMap(queries, (item) => item.map((value) => (
value).toJson()).toList()); |
1379 } | 1273 } |
1380 if (searchInformation != null) { | 1274 if (searchInformation != null) { |
1381 _json["searchInformation"] = (searchInformation).toJson(); | 1275 _json["searchInformation"] = (searchInformation).toJson(); |
1382 } | 1276 } |
1383 if (spelling != null) { | 1277 if (spelling != null) { |
1384 _json["spelling"] = (spelling).toJson(); | 1278 _json["spelling"] = (spelling).toJson(); |
1385 } | 1279 } |
1386 if (url != null) { | 1280 if (url != null) { |
1387 _json["url"] = (url).toJson(); | 1281 _json["url"] = (url).toJson(); |
1388 } | 1282 } |
1389 return _json; | 1283 return _json; |
1390 } | 1284 } |
1391 } | 1285 } |
1392 | |
1393 | |
OLD | NEW |