OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis.customsearch.v1; | 3 library googleapis.customsearch.v1; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
11 | 11 |
12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
13 ApiRequestError, DetailedApiRequestError; | 13 ApiRequestError, DetailedApiRequestError; |
14 | 14 |
15 const core.String USER_AGENT = 'dart-api-client customsearch/v1'; | 15 const core.String USER_AGENT = 'dart-api-client customsearch/v1'; |
16 | 16 |
17 /** Lets you search over a website or collection of websites */ | 17 /** Searches over a website or collection of websites */ |
18 class CustomsearchApi { | 18 class CustomsearchApi { |
19 | 19 |
20 final commons.ApiRequester _requester; | 20 final commons.ApiRequester _requester; |
21 | 21 |
22 CseResourceApi get cse => new CseResourceApi(_requester); | 22 CseResourceApi get cse => new CseResourceApi(_requester); |
23 | 23 |
24 CustomsearchApi(http.Client client, {core.String rootUrl: "https://www.googlea
pis.com/", core.String servicePath: "customsearch/"}) : | 24 CustomsearchApi(http.Client client, {core.String rootUrl: "https://www.googlea
pis.com/", core.String servicePath: "customsearch/"}) : |
25 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 25 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
26 } | 26 } |
27 | 27 |
28 | 28 |
29 class CseResourceApi { | 29 class CseResourceApi { |
30 final commons.ApiRequester _requester; | 30 final commons.ApiRequester _requester; |
31 | 31 |
32 CseResourceApi(commons.ApiRequester client) : | 32 CseResourceApi(commons.ApiRequester client) : |
33 _requester = client; | 33 _requester = client; |
34 | 34 |
35 /** | 35 /** |
36 * Returns metadata about the search performed, metadata about the custom | 36 * Returns metadata about the search performed, metadata about the custom |
37 * search engine used for the search, and the search results. | 37 * search engine used for the search, and the search results. |
38 * | 38 * |
39 * Request parameters: | 39 * Request parameters: |
40 * | 40 * |
41 * [q] - Query | 41 * [q] - Query |
42 * | 42 * |
43 * [c2coff] - Turns off the translation between zh-CN and zh-TW. | 43 * [c2coff] - Turns off the translation between zh-CN and zh-TW. |
44 * | 44 * |
45 * [cr] - Country restrict(s). | 45 * [cr] - Country restrict(s). |
46 * | 46 * |
47 * [cref] - The URL of a linked custom search engine | |
48 * | |
49 * [cx] - The custom search engine ID to scope this search query | 47 * [cx] - The custom search engine ID to scope this search query |
50 * | 48 * |
51 * [dateRestrict] - Specifies all search results are from a time period | 49 * [dateRestrict] - Specifies all search results are from a time period |
52 * | 50 * |
53 * [exactTerms] - Identifies a phrase that all documents in the search results | 51 * [exactTerms] - Identifies a phrase that all documents in the search results |
54 * must contain | 52 * must contain |
55 * | 53 * |
56 * [excludeTerms] - Identifies a word or phrase that should not appear in any | 54 * [excludeTerms] - Identifies a word or phrase that should not appear in any |
57 * documents in the search results | 55 * documents in the search results |
58 * | 56 * |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 * [start] - The index of the first result to return | 195 * [start] - The index of the first result to return |
198 * | 196 * |
199 * Completes with a [Search]. | 197 * Completes with a [Search]. |
200 * | 198 * |
201 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 199 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
202 * error. | 200 * error. |
203 * | 201 * |
204 * If the used [http.Client] completes with an error when making a REST call, | 202 * If the used [http.Client] completes with an error when making a REST call, |
205 * this method will complete with the same error. | 203 * this method will complete with the same error. |
206 */ | 204 */ |
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}) { | 205 async.Future<Search> list(core.String q, {core.String c2coff, core.String cr,
core.String cx, core.String dateRestrict, core.String exactTerms, core.String ex
cludeTerms, core.String fileType, core.String filter, core.String gl, core.Strin
g googlehost, core.String highRange, core.String hl, core.String hq, core.String
imgColorType, core.String imgDominantColor, core.String imgSize, core.String im
gType, core.String linkSite, core.String lowRange, core.String lr, core.int num,
core.String orTerms, core.String relatedSite, core.String rights, core.String s
afe, core.String searchType, core.String siteSearch, core.String siteSearchFilte
r, core.String sort, core.int start}) { |
208 var _url = null; | 206 var _url = null; |
209 var _queryParams = new core.Map(); | 207 var _queryParams = new core.Map(); |
210 var _uploadMedia = null; | 208 var _uploadMedia = null; |
211 var _uploadOptions = null; | 209 var _uploadOptions = null; |
212 var _downloadOptions = commons.DownloadOptions.Metadata; | 210 var _downloadOptions = commons.DownloadOptions.Metadata; |
213 var _body = null; | 211 var _body = null; |
214 | 212 |
215 if (q == null) { | 213 if (q == null) { |
216 throw new core.ArgumentError("Parameter q is required."); | 214 throw new core.ArgumentError("Parameter q is required."); |
217 } | 215 } |
218 _queryParams["q"] = [q]; | 216 _queryParams["q"] = [q]; |
219 if (c2coff != null) { | 217 if (c2coff != null) { |
220 _queryParams["c2coff"] = [c2coff]; | 218 _queryParams["c2coff"] = [c2coff]; |
221 } | 219 } |
222 if (cr != null) { | 220 if (cr != null) { |
223 _queryParams["cr"] = [cr]; | 221 _queryParams["cr"] = [cr]; |
224 } | 222 } |
225 if (cref != null) { | |
226 _queryParams["cref"] = [cref]; | |
227 } | |
228 if (cx != null) { | 223 if (cx != null) { |
229 _queryParams["cx"] = [cx]; | 224 _queryParams["cx"] = [cx]; |
230 } | 225 } |
231 if (dateRestrict != null) { | 226 if (dateRestrict != null) { |
232 _queryParams["dateRestrict"] = [dateRestrict]; | 227 _queryParams["dateRestrict"] = [dateRestrict]; |
233 } | 228 } |
234 if (exactTerms != null) { | 229 if (exactTerms != null) { |
235 _queryParams["exactTerms"] = [exactTerms]; | 230 _queryParams["exactTerms"] = [exactTerms]; |
236 } | 231 } |
237 if (excludeTerms != null) { | 232 if (excludeTerms != null) { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 anchor = _json["anchor"]; | 333 anchor = _json["anchor"]; |
339 } | 334 } |
340 if (_json.containsKey("label")) { | 335 if (_json.containsKey("label")) { |
341 label = _json["label"]; | 336 label = _json["label"]; |
342 } | 337 } |
343 if (_json.containsKey("label_with_op")) { | 338 if (_json.containsKey("label_with_op")) { |
344 labelWithOp = _json["label_with_op"]; | 339 labelWithOp = _json["label_with_op"]; |
345 } | 340 } |
346 } | 341 } |
347 | 342 |
348 core.Map toJson() { | 343 core.Map<core.String, core.Object> toJson() { |
349 var _json = new core.Map(); | 344 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
350 if (anchor != null) { | 345 if (anchor != null) { |
351 _json["anchor"] = anchor; | 346 _json["anchor"] = anchor; |
352 } | 347 } |
353 if (label != null) { | 348 if (label != null) { |
354 _json["label"] = label; | 349 _json["label"] = label; |
355 } | 350 } |
356 if (labelWithOp != null) { | 351 if (labelWithOp != null) { |
357 _json["label_with_op"] = labelWithOp; | 352 _json["label_with_op"] = labelWithOp; |
358 } | 353 } |
359 return _json; | 354 return _json; |
360 } | 355 } |
361 } | 356 } |
362 | 357 |
363 class Context { | 358 class Context { |
364 core.List<core.List<ContextFacets>> facets; | 359 core.List<core.List<ContextFacets>> facets; |
365 core.String title; | 360 core.String title; |
366 | 361 |
367 Context(); | 362 Context(); |
368 | 363 |
369 Context.fromJson(core.Map _json) { | 364 Context.fromJson(core.Map _json) { |
370 if (_json.containsKey("facets")) { | 365 if (_json.containsKey("facets")) { |
371 facets = _json["facets"].map((value) => value.map((value) => new ContextFa
cets.fromJson(value)).toList()).toList(); | 366 facets = _json["facets"].map((value) => value.map((value) => new ContextFa
cets.fromJson(value)).toList()).toList(); |
372 } | 367 } |
373 if (_json.containsKey("title")) { | 368 if (_json.containsKey("title")) { |
374 title = _json["title"]; | 369 title = _json["title"]; |
375 } | 370 } |
376 } | 371 } |
377 | 372 |
378 core.Map toJson() { | 373 core.Map<core.String, core.Object> toJson() { |
379 var _json = new core.Map(); | 374 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
380 if (facets != null) { | 375 if (facets != null) { |
381 _json["facets"] = facets.map((value) => value.map((value) => (value).toJso
n()).toList()).toList(); | 376 _json["facets"] = facets.map((value) => value.map((value) => (value).toJso
n()).toList()).toList(); |
382 } | 377 } |
383 if (title != null) { | 378 if (title != null) { |
384 _json["title"] = title; | 379 _json["title"] = title; |
385 } | 380 } |
386 return _json; | 381 return _json; |
387 } | 382 } |
388 } | 383 } |
389 | 384 |
(...skipping 13 matching lines...) Expand all Loading... |
403 link = _json["link"]; | 398 link = _json["link"]; |
404 } | 399 } |
405 if (_json.containsKey("title")) { | 400 if (_json.containsKey("title")) { |
406 title = _json["title"]; | 401 title = _json["title"]; |
407 } | 402 } |
408 if (_json.containsKey("url")) { | 403 if (_json.containsKey("url")) { |
409 url = _json["url"]; | 404 url = _json["url"]; |
410 } | 405 } |
411 } | 406 } |
412 | 407 |
413 core.Map toJson() { | 408 core.Map<core.String, core.Object> toJson() { |
414 var _json = new core.Map(); | 409 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
415 if (htmlTitle != null) { | 410 if (htmlTitle != null) { |
416 _json["htmlTitle"] = htmlTitle; | 411 _json["htmlTitle"] = htmlTitle; |
417 } | 412 } |
418 if (link != null) { | 413 if (link != null) { |
419 _json["link"] = link; | 414 _json["link"] = link; |
420 } | 415 } |
421 if (title != null) { | 416 if (title != null) { |
422 _json["title"] = title; | 417 _json["title"] = title; |
423 } | 418 } |
424 if (url != null) { | 419 if (url != null) { |
(...skipping 15 matching lines...) Expand all Loading... |
440 height = _json["height"]; | 435 height = _json["height"]; |
441 } | 436 } |
442 if (_json.containsKey("source")) { | 437 if (_json.containsKey("source")) { |
443 source = _json["source"]; | 438 source = _json["source"]; |
444 } | 439 } |
445 if (_json.containsKey("width")) { | 440 if (_json.containsKey("width")) { |
446 width = _json["width"]; | 441 width = _json["width"]; |
447 } | 442 } |
448 } | 443 } |
449 | 444 |
450 core.Map toJson() { | 445 core.Map<core.String, core.Object> toJson() { |
451 var _json = new core.Map(); | 446 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
452 if (height != null) { | 447 if (height != null) { |
453 _json["height"] = height; | 448 _json["height"] = height; |
454 } | 449 } |
455 if (source != null) { | 450 if (source != null) { |
456 _json["source"] = source; | 451 _json["source"] = source; |
457 } | 452 } |
458 if (width != null) { | 453 if (width != null) { |
459 _json["width"] = width; | 454 _json["width"] = width; |
460 } | 455 } |
461 return _json; | 456 return _json; |
(...skipping 24 matching lines...) Expand all Loading... |
486 image = new PromotionImage.fromJson(_json["image"]); | 481 image = new PromotionImage.fromJson(_json["image"]); |
487 } | 482 } |
488 if (_json.containsKey("link")) { | 483 if (_json.containsKey("link")) { |
489 link = _json["link"]; | 484 link = _json["link"]; |
490 } | 485 } |
491 if (_json.containsKey("title")) { | 486 if (_json.containsKey("title")) { |
492 title = _json["title"]; | 487 title = _json["title"]; |
493 } | 488 } |
494 } | 489 } |
495 | 490 |
496 core.Map toJson() { | 491 core.Map<core.String, core.Object> toJson() { |
497 var _json = new core.Map(); | 492 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
498 if (bodyLines != null) { | 493 if (bodyLines != null) { |
499 _json["bodyLines"] = bodyLines.map((value) => (value).toJson()).toList(); | 494 _json["bodyLines"] = bodyLines.map((value) => (value).toJson()).toList(); |
500 } | 495 } |
501 if (displayLink != null) { | 496 if (displayLink != null) { |
502 _json["displayLink"] = displayLink; | 497 _json["displayLink"] = displayLink; |
503 } | 498 } |
504 if (htmlTitle != null) { | 499 if (htmlTitle != null) { |
505 _json["htmlTitle"] = htmlTitle; | 500 _json["htmlTitle"] = htmlTitle; |
506 } | 501 } |
507 if (image != null) { | 502 if (image != null) { |
508 _json["image"] = (image).toJson(); | 503 _json["image"] = (image).toJson(); |
509 } | 504 } |
510 if (link != null) { | 505 if (link != null) { |
511 _json["link"] = link; | 506 _json["link"] = link; |
512 } | 507 } |
513 if (title != null) { | 508 if (title != null) { |
514 _json["title"] = title; | 509 _json["title"] = title; |
515 } | 510 } |
516 return _json; | 511 return _json; |
517 } | 512 } |
518 } | 513 } |
519 | 514 |
520 class Query { | 515 class Query { |
521 core.int count; | 516 core.int count; |
522 core.String cr; | 517 core.String cr; |
523 core.String cref; | |
524 core.String cx; | 518 core.String cx; |
525 core.String dateRestrict; | 519 core.String dateRestrict; |
526 core.String disableCnTwTranslation; | 520 core.String disableCnTwTranslation; |
527 core.String exactTerms; | 521 core.String exactTerms; |
528 core.String excludeTerms; | 522 core.String excludeTerms; |
529 core.String fileType; | 523 core.String fileType; |
530 core.String filter; | 524 core.String filter; |
531 core.String gl; | 525 core.String gl; |
532 core.String googleHost; | 526 core.String googleHost; |
533 core.String highRange; | 527 core.String highRange; |
(...skipping 24 matching lines...) Expand all Loading... |
558 | 552 |
559 Query(); | 553 Query(); |
560 | 554 |
561 Query.fromJson(core.Map _json) { | 555 Query.fromJson(core.Map _json) { |
562 if (_json.containsKey("count")) { | 556 if (_json.containsKey("count")) { |
563 count = _json["count"]; | 557 count = _json["count"]; |
564 } | 558 } |
565 if (_json.containsKey("cr")) { | 559 if (_json.containsKey("cr")) { |
566 cr = _json["cr"]; | 560 cr = _json["cr"]; |
567 } | 561 } |
568 if (_json.containsKey("cref")) { | |
569 cref = _json["cref"]; | |
570 } | |
571 if (_json.containsKey("cx")) { | 562 if (_json.containsKey("cx")) { |
572 cx = _json["cx"]; | 563 cx = _json["cx"]; |
573 } | 564 } |
574 if (_json.containsKey("dateRestrict")) { | 565 if (_json.containsKey("dateRestrict")) { |
575 dateRestrict = _json["dateRestrict"]; | 566 dateRestrict = _json["dateRestrict"]; |
576 } | 567 } |
577 if (_json.containsKey("disableCnTwTranslation")) { | 568 if (_json.containsKey("disableCnTwTranslation")) { |
578 disableCnTwTranslation = _json["disableCnTwTranslation"]; | 569 disableCnTwTranslation = _json["disableCnTwTranslation"]; |
579 } | 570 } |
580 if (_json.containsKey("exactTerms")) { | 571 if (_json.containsKey("exactTerms")) { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 startPage = _json["startPage"]; | 656 startPage = _json["startPage"]; |
666 } | 657 } |
667 if (_json.containsKey("title")) { | 658 if (_json.containsKey("title")) { |
668 title = _json["title"]; | 659 title = _json["title"]; |
669 } | 660 } |
670 if (_json.containsKey("totalResults")) { | 661 if (_json.containsKey("totalResults")) { |
671 totalResults = _json["totalResults"]; | 662 totalResults = _json["totalResults"]; |
672 } | 663 } |
673 } | 664 } |
674 | 665 |
675 core.Map toJson() { | 666 core.Map<core.String, core.Object> toJson() { |
676 var _json = new core.Map(); | 667 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
677 if (count != null) { | 668 if (count != null) { |
678 _json["count"] = count; | 669 _json["count"] = count; |
679 } | 670 } |
680 if (cr != null) { | 671 if (cr != null) { |
681 _json["cr"] = cr; | 672 _json["cr"] = cr; |
682 } | 673 } |
683 if (cref != null) { | |
684 _json["cref"] = cref; | |
685 } | |
686 if (cx != null) { | 674 if (cx != null) { |
687 _json["cx"] = cx; | 675 _json["cx"] = cx; |
688 } | 676 } |
689 if (dateRestrict != null) { | 677 if (dateRestrict != null) { |
690 _json["dateRestrict"] = dateRestrict; | 678 _json["dateRestrict"] = dateRestrict; |
691 } | 679 } |
692 if (disableCnTwTranslation != null) { | 680 if (disableCnTwTranslation != null) { |
693 _json["disableCnTwTranslation"] = disableCnTwTranslation; | 681 _json["disableCnTwTranslation"] = disableCnTwTranslation; |
694 } | 682 } |
695 if (exactTerms != null) { | 683 if (exactTerms != null) { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 thumbnailLink = _json["thumbnailLink"]; | 805 thumbnailLink = _json["thumbnailLink"]; |
818 } | 806 } |
819 if (_json.containsKey("thumbnailWidth")) { | 807 if (_json.containsKey("thumbnailWidth")) { |
820 thumbnailWidth = _json["thumbnailWidth"]; | 808 thumbnailWidth = _json["thumbnailWidth"]; |
821 } | 809 } |
822 if (_json.containsKey("width")) { | 810 if (_json.containsKey("width")) { |
823 width = _json["width"]; | 811 width = _json["width"]; |
824 } | 812 } |
825 } | 813 } |
826 | 814 |
827 core.Map toJson() { | 815 core.Map<core.String, core.Object> toJson() { |
828 var _json = new core.Map(); | 816 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
829 if (byteSize != null) { | 817 if (byteSize != null) { |
830 _json["byteSize"] = byteSize; | 818 _json["byteSize"] = byteSize; |
831 } | 819 } |
832 if (contextLink != null) { | 820 if (contextLink != null) { |
833 _json["contextLink"] = contextLink; | 821 _json["contextLink"] = contextLink; |
834 } | 822 } |
835 if (height != null) { | 823 if (height != null) { |
836 _json["height"] = height; | 824 _json["height"] = height; |
837 } | 825 } |
838 if (thumbnailHeight != null) { | 826 if (thumbnailHeight != null) { |
(...skipping 24 matching lines...) Expand all Loading... |
863 displayName = _json["displayName"]; | 851 displayName = _json["displayName"]; |
864 } | 852 } |
865 if (_json.containsKey("label_with_op")) { | 853 if (_json.containsKey("label_with_op")) { |
866 labelWithOp = _json["label_with_op"]; | 854 labelWithOp = _json["label_with_op"]; |
867 } | 855 } |
868 if (_json.containsKey("name")) { | 856 if (_json.containsKey("name")) { |
869 name = _json["name"]; | 857 name = _json["name"]; |
870 } | 858 } |
871 } | 859 } |
872 | 860 |
873 core.Map toJson() { | 861 core.Map<core.String, core.Object> toJson() { |
874 var _json = new core.Map(); | 862 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
875 if (displayName != null) { | 863 if (displayName != null) { |
876 _json["displayName"] = displayName; | 864 _json["displayName"] = displayName; |
877 } | 865 } |
878 if (labelWithOp != null) { | 866 if (labelWithOp != null) { |
879 _json["label_with_op"] = labelWithOp; | 867 _json["label_with_op"] = labelWithOp; |
880 } | 868 } |
881 if (name != null) { | 869 if (name != null) { |
882 _json["name"] = name; | 870 _json["name"] = name; |
883 } | 871 } |
884 return _json; | 872 return _json; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 pagemap = _json["pagemap"]; | 939 pagemap = _json["pagemap"]; |
952 } | 940 } |
953 if (_json.containsKey("snippet")) { | 941 if (_json.containsKey("snippet")) { |
954 snippet = _json["snippet"]; | 942 snippet = _json["snippet"]; |
955 } | 943 } |
956 if (_json.containsKey("title")) { | 944 if (_json.containsKey("title")) { |
957 title = _json["title"]; | 945 title = _json["title"]; |
958 } | 946 } |
959 } | 947 } |
960 | 948 |
961 core.Map toJson() { | 949 core.Map<core.String, core.Object> toJson() { |
962 var _json = new core.Map(); | 950 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
963 if (cacheId != null) { | 951 if (cacheId != null) { |
964 _json["cacheId"] = cacheId; | 952 _json["cacheId"] = cacheId; |
965 } | 953 } |
966 if (displayLink != null) { | 954 if (displayLink != null) { |
967 _json["displayLink"] = displayLink; | 955 _json["displayLink"] = displayLink; |
968 } | 956 } |
969 if (fileFormat != null) { | 957 if (fileFormat != null) { |
970 _json["fileFormat"] = fileFormat; | 958 _json["fileFormat"] = fileFormat; |
971 } | 959 } |
972 if (formattedUrl != null) { | 960 if (formattedUrl != null) { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 formattedTotalResults = _json["formattedTotalResults"]; | 1013 formattedTotalResults = _json["formattedTotalResults"]; |
1026 } | 1014 } |
1027 if (_json.containsKey("searchTime")) { | 1015 if (_json.containsKey("searchTime")) { |
1028 searchTime = _json["searchTime"]; | 1016 searchTime = _json["searchTime"]; |
1029 } | 1017 } |
1030 if (_json.containsKey("totalResults")) { | 1018 if (_json.containsKey("totalResults")) { |
1031 totalResults = _json["totalResults"]; | 1019 totalResults = _json["totalResults"]; |
1032 } | 1020 } |
1033 } | 1021 } |
1034 | 1022 |
1035 core.Map toJson() { | 1023 core.Map<core.String, core.Object> toJson() { |
1036 var _json = new core.Map(); | 1024 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
1037 if (formattedSearchTime != null) { | 1025 if (formattedSearchTime != null) { |
1038 _json["formattedSearchTime"] = formattedSearchTime; | 1026 _json["formattedSearchTime"] = formattedSearchTime; |
1039 } | 1027 } |
1040 if (formattedTotalResults != null) { | 1028 if (formattedTotalResults != null) { |
1041 _json["formattedTotalResults"] = formattedTotalResults; | 1029 _json["formattedTotalResults"] = formattedTotalResults; |
1042 } | 1030 } |
1043 if (searchTime != null) { | 1031 if (searchTime != null) { |
1044 _json["searchTime"] = searchTime; | 1032 _json["searchTime"] = searchTime; |
1045 } | 1033 } |
1046 if (totalResults != null) { | 1034 if (totalResults != null) { |
(...skipping 11 matching lines...) Expand all Loading... |
1058 | 1046 |
1059 SearchSpelling.fromJson(core.Map _json) { | 1047 SearchSpelling.fromJson(core.Map _json) { |
1060 if (_json.containsKey("correctedQuery")) { | 1048 if (_json.containsKey("correctedQuery")) { |
1061 correctedQuery = _json["correctedQuery"]; | 1049 correctedQuery = _json["correctedQuery"]; |
1062 } | 1050 } |
1063 if (_json.containsKey("htmlCorrectedQuery")) { | 1051 if (_json.containsKey("htmlCorrectedQuery")) { |
1064 htmlCorrectedQuery = _json["htmlCorrectedQuery"]; | 1052 htmlCorrectedQuery = _json["htmlCorrectedQuery"]; |
1065 } | 1053 } |
1066 } | 1054 } |
1067 | 1055 |
1068 core.Map toJson() { | 1056 core.Map<core.String, core.Object> toJson() { |
1069 var _json = new core.Map(); | 1057 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
1070 if (correctedQuery != null) { | 1058 if (correctedQuery != null) { |
1071 _json["correctedQuery"] = correctedQuery; | 1059 _json["correctedQuery"] = correctedQuery; |
1072 } | 1060 } |
1073 if (htmlCorrectedQuery != null) { | 1061 if (htmlCorrectedQuery != null) { |
1074 _json["htmlCorrectedQuery"] = htmlCorrectedQuery; | 1062 _json["htmlCorrectedQuery"] = htmlCorrectedQuery; |
1075 } | 1063 } |
1076 return _json; | 1064 return _json; |
1077 } | 1065 } |
1078 } | 1066 } |
1079 | 1067 |
1080 class SearchUrl { | 1068 class SearchUrl { |
1081 core.String template; | 1069 core.String template; |
1082 core.String type; | 1070 core.String type; |
1083 | 1071 |
1084 SearchUrl(); | 1072 SearchUrl(); |
1085 | 1073 |
1086 SearchUrl.fromJson(core.Map _json) { | 1074 SearchUrl.fromJson(core.Map _json) { |
1087 if (_json.containsKey("template")) { | 1075 if (_json.containsKey("template")) { |
1088 template = _json["template"]; | 1076 template = _json["template"]; |
1089 } | 1077 } |
1090 if (_json.containsKey("type")) { | 1078 if (_json.containsKey("type")) { |
1091 type = _json["type"]; | 1079 type = _json["type"]; |
1092 } | 1080 } |
1093 } | 1081 } |
1094 | 1082 |
1095 core.Map toJson() { | 1083 core.Map<core.String, core.Object> toJson() { |
1096 var _json = new core.Map(); | 1084 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
1097 if (template != null) { | 1085 if (template != null) { |
1098 _json["template"] = template; | 1086 _json["template"] = template; |
1099 } | 1087 } |
1100 if (type != null) { | 1088 if (type != null) { |
1101 _json["type"] = type; | 1089 _json["type"] = type; |
1102 } | 1090 } |
1103 return _json; | 1091 return _json; |
1104 } | 1092 } |
1105 } | 1093 } |
1106 | 1094 |
(...skipping 16 matching lines...) Expand all Loading... |
1123 if (_json.containsKey("items")) { | 1111 if (_json.containsKey("items")) { |
1124 items = _json["items"].map((value) => new Result.fromJson(value)).toList()
; | 1112 items = _json["items"].map((value) => new Result.fromJson(value)).toList()
; |
1125 } | 1113 } |
1126 if (_json.containsKey("kind")) { | 1114 if (_json.containsKey("kind")) { |
1127 kind = _json["kind"]; | 1115 kind = _json["kind"]; |
1128 } | 1116 } |
1129 if (_json.containsKey("promotions")) { | 1117 if (_json.containsKey("promotions")) { |
1130 promotions = _json["promotions"].map((value) => new Promotion.fromJson(val
ue)).toList(); | 1118 promotions = _json["promotions"].map((value) => new Promotion.fromJson(val
ue)).toList(); |
1131 } | 1119 } |
1132 if (_json.containsKey("queries")) { | 1120 if (_json.containsKey("queries")) { |
1133 queries = commons.mapMap(_json["queries"], (item) => item.map((value) => n
ew Query.fromJson(value)).toList()); | 1121 queries = commons.mapMap<core.List<core.Map<core.String, core.Object>>, co
re.List<Query>>(_json["queries"], (core.List<core.Map<core.String, core.Object>>
item) => item.map((value) => new Query.fromJson(value)).toList()); |
1134 } | 1122 } |
1135 if (_json.containsKey("searchInformation")) { | 1123 if (_json.containsKey("searchInformation")) { |
1136 searchInformation = new SearchSearchInformation.fromJson(_json["searchInfo
rmation"]); | 1124 searchInformation = new SearchSearchInformation.fromJson(_json["searchInfo
rmation"]); |
1137 } | 1125 } |
1138 if (_json.containsKey("spelling")) { | 1126 if (_json.containsKey("spelling")) { |
1139 spelling = new SearchSpelling.fromJson(_json["spelling"]); | 1127 spelling = new SearchSpelling.fromJson(_json["spelling"]); |
1140 } | 1128 } |
1141 if (_json.containsKey("url")) { | 1129 if (_json.containsKey("url")) { |
1142 url = new SearchUrl.fromJson(_json["url"]); | 1130 url = new SearchUrl.fromJson(_json["url"]); |
1143 } | 1131 } |
1144 } | 1132 } |
1145 | 1133 |
1146 core.Map toJson() { | 1134 core.Map<core.String, core.Object> toJson() { |
1147 var _json = new core.Map(); | 1135 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
1148 if (context != null) { | 1136 if (context != null) { |
1149 _json["context"] = (context).toJson(); | 1137 _json["context"] = (context).toJson(); |
1150 } | 1138 } |
1151 if (items != null) { | 1139 if (items != null) { |
1152 _json["items"] = items.map((value) => (value).toJson()).toList(); | 1140 _json["items"] = items.map((value) => (value).toJson()).toList(); |
1153 } | 1141 } |
1154 if (kind != null) { | 1142 if (kind != null) { |
1155 _json["kind"] = kind; | 1143 _json["kind"] = kind; |
1156 } | 1144 } |
1157 if (promotions != null) { | 1145 if (promotions != null) { |
1158 _json["promotions"] = promotions.map((value) => (value).toJson()).toList()
; | 1146 _json["promotions"] = promotions.map((value) => (value).toJson()).toList()
; |
1159 } | 1147 } |
1160 if (queries != null) { | 1148 if (queries != null) { |
1161 _json["queries"] = commons.mapMap(queries, (item) => item.map((value) => (
value).toJson()).toList()); | 1149 _json["queries"] = commons.mapMap<core.List<Query>, core.List<core.Map<cor
e.String, core.Object>>>(queries, (core.List<Query> item) => item.map((value) =>
(value).toJson()).toList()); |
1162 } | 1150 } |
1163 if (searchInformation != null) { | 1151 if (searchInformation != null) { |
1164 _json["searchInformation"] = (searchInformation).toJson(); | 1152 _json["searchInformation"] = (searchInformation).toJson(); |
1165 } | 1153 } |
1166 if (spelling != null) { | 1154 if (spelling != null) { |
1167 _json["spelling"] = (spelling).toJson(); | 1155 _json["spelling"] = (spelling).toJson(); |
1168 } | 1156 } |
1169 if (url != null) { | 1157 if (url != null) { |
1170 _json["url"] = (url).toJson(); | 1158 _json["url"] = (url).toJson(); |
1171 } | 1159 } |
1172 return _json; | 1160 return _json; |
1173 } | 1161 } |
1174 } | 1162 } |
OLD | NEW |