OLD | NEW |
(Empty) | |
| 1 library googleapis.customsearch.v1; |
| 2 |
| 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; |
| 7 |
| 8 import "package:crypto/crypto.dart" as crypto; |
| 9 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 export '../common/common.dart' show ApiRequestError; |
| 14 export '../common/common.dart' show DetailedApiRequestError; |
| 15 |
| 16 /** Lets you search over a website or collection of websites */ |
| 17 class CustomsearchApi { |
| 18 |
| 19 final common_internal.ApiRequester _requester; |
| 20 |
| 21 CseResourceApi get cse => new CseResourceApi(_requester); |
| 22 |
| 23 CustomsearchApi(http.Client client) : |
| 24 _requester = new common_internal.ApiRequester(client, "https://www.googlea
pis.com/", "/customsearch/"); |
| 25 } |
| 26 |
| 27 |
| 28 /** Not documented yet. */ |
| 29 class CseResourceApi { |
| 30 final common_internal.ApiRequester _requester; |
| 31 |
| 32 CseResourceApi(common_internal.ApiRequester client) : |
| 33 _requester = client; |
| 34 |
| 35 /** |
| 36 * Returns metadata about the search performed, metadata about the custom |
| 37 * search engine used for the search, and the search results. |
| 38 * |
| 39 * Request parameters: |
| 40 * |
| 41 * [q] - Query |
| 42 * |
| 43 * [c2coff] - Turns off the translation between zh-CN and zh-TW. |
| 44 * |
| 45 * [cr] - Country restrict(s). |
| 46 * |
| 47 * [cref] - The URL of a linked custom search engine |
| 48 * |
| 49 * [cx] - The custom search engine ID to scope this search query |
| 50 * |
| 51 * [dateRestrict] - Specifies all search results are from a time period |
| 52 * |
| 53 * [exactTerms] - Identifies a phrase that all documents in the search results |
| 54 * must contain |
| 55 * |
| 56 * [excludeTerms] - Identifies a word or phrase that should not appear in any |
| 57 * documents in the search results |
| 58 * |
| 59 * [fileType] - Returns images of a specified type. Some of the allowed values |
| 60 * are: bmp, gif, png, jpg, svg, pdf, ... |
| 61 * |
| 62 * [filter] - Controls turning on or off the duplicate content filter. |
| 63 * Possible string values are: |
| 64 * - "0" : Turns off duplicate content filter. |
| 65 * - "1" : Turns on duplicate content filter. |
| 66 * |
| 67 * [gl] - Geolocation of end user. |
| 68 * |
| 69 * [googlehost] - The local Google domain to use to perform the search. |
| 70 * |
| 71 * [highRange] - Creates a range in form as_nlo value..as_nhi value and |
| 72 * attempts to append it to query |
| 73 * |
| 74 * [hl] - Sets the user interface language. |
| 75 * |
| 76 * [hq] - Appends the extra query terms to the query. |
| 77 * |
| 78 * [imgColorType] - Returns black and white, grayscale, or color images: mono, |
| 79 * gray, and color. |
| 80 * Possible string values are: |
| 81 * - "color" : color |
| 82 * - "gray" : gray |
| 83 * - "mono" : mono |
| 84 * |
| 85 * [imgDominantColor] - Returns images of a specific dominant color: yellow, |
| 86 * green, teal, blue, purple, pink, white, gray, black and brown. |
| 87 * Possible string values are: |
| 88 * - "black" : black |
| 89 * - "blue" : blue |
| 90 * - "brown" : brown |
| 91 * - "gray" : gray |
| 92 * - "green" : green |
| 93 * - "pink" : pink |
| 94 * - "purple" : purple |
| 95 * - "teal" : teal |
| 96 * - "white" : white |
| 97 * - "yellow" : yellow |
| 98 * |
| 99 * [imgSize] - Returns images of a specified size, where size can be one of: |
| 100 * icon, small, medium, large, xlarge, xxlarge, and huge. |
| 101 * Possible string values are: |
| 102 * - "huge" : huge |
| 103 * - "icon" : icon |
| 104 * - "large" : large |
| 105 * - "medium" : medium |
| 106 * - "small" : small |
| 107 * - "xlarge" : xlarge |
| 108 * - "xxlarge" : xxlarge |
| 109 * |
| 110 * [imgType] - Returns images of a type, which can be one of: clipart, face, |
| 111 * lineart, news, and photo. |
| 112 * Possible string values are: |
| 113 * - "clipart" : clipart |
| 114 * - "face" : face |
| 115 * - "lineart" : lineart |
| 116 * - "news" : news |
| 117 * - "photo" : photo |
| 118 * |
| 119 * [linkSite] - Specifies that all search results should contain a link to a |
| 120 * particular URL |
| 121 * |
| 122 * [lowRange] - Creates a range in form as_nlo value..as_nhi value and |
| 123 * attempts to append it to query |
| 124 * |
| 125 * [lr] - The language restriction for the search results |
| 126 * Possible string values are: |
| 127 * - "lang_ar" : Arabic |
| 128 * - "lang_bg" : Bulgarian |
| 129 * - "lang_ca" : Catalan |
| 130 * - "lang_cs" : Czech |
| 131 * - "lang_da" : Danish |
| 132 * - "lang_de" : German |
| 133 * - "lang_el" : Greek |
| 134 * - "lang_en" : English |
| 135 * - "lang_es" : Spanish |
| 136 * - "lang_et" : Estonian |
| 137 * - "lang_fi" : Finnish |
| 138 * - "lang_fr" : French |
| 139 * - "lang_hr" : Croatian |
| 140 * - "lang_hu" : Hungarian |
| 141 * - "lang_id" : Indonesian |
| 142 * - "lang_is" : Icelandic |
| 143 * - "lang_it" : Italian |
| 144 * - "lang_iw" : Hebrew |
| 145 * - "lang_ja" : Japanese |
| 146 * - "lang_ko" : Korean |
| 147 * - "lang_lt" : Lithuanian |
| 148 * - "lang_lv" : Latvian |
| 149 * - "lang_nl" : Dutch |
| 150 * - "lang_no" : Norwegian |
| 151 * - "lang_pl" : Polish |
| 152 * - "lang_pt" : Portuguese |
| 153 * - "lang_ro" : Romanian |
| 154 * - "lang_ru" : Russian |
| 155 * - "lang_sk" : Slovak |
| 156 * - "lang_sl" : Slovenian |
| 157 * - "lang_sr" : Serbian |
| 158 * - "lang_sv" : Swedish |
| 159 * - "lang_tr" : Turkish |
| 160 * - "lang_zh-CN" : Chinese (Simplified) |
| 161 * - "lang_zh-TW" : Chinese (Traditional) |
| 162 * |
| 163 * [num] - Number of search results to return |
| 164 * |
| 165 * [orTerms] - Provides additional search terms to check for in a document, |
| 166 * where each document in the search results must contain at least one of the |
| 167 * additional search terms |
| 168 * |
| 169 * [relatedSite] - Specifies that all search results should be pages that are |
| 170 * related to the specified URL |
| 171 * |
| 172 * [rights] - Filters based on licensing. Supported values include: |
| 173 * cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, |
| 174 * cc_nonderived and combinations of these. |
| 175 * |
| 176 * [safe] - Search safety level |
| 177 * Possible string values are: |
| 178 * - "high" : Enables highest level of safe search filtering. |
| 179 * - "medium" : Enables moderate safe search filtering. |
| 180 * - "off" : Disables safe search filtering. |
| 181 * |
| 182 * [searchType] - Specifies the search type: image. |
| 183 * Possible string values are: |
| 184 * - "image" : custom image search |
| 185 * |
| 186 * [siteSearch] - Specifies all search results should be pages from a given |
| 187 * site |
| 188 * |
| 189 * [siteSearchFilter] - Controls whether to include or exclude results from |
| 190 * the site named in the as_sitesearch parameter |
| 191 * Possible string values are: |
| 192 * - "e" : exclude |
| 193 * - "i" : include |
| 194 * |
| 195 * [sort] - The sort expression to apply to the results |
| 196 * |
| 197 * [start] - The index of the first result to return |
| 198 * |
| 199 * Completes with a [Search]. |
| 200 * |
| 201 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 202 * error. |
| 203 * |
| 204 * If the used [http.Client] completes with an error when making a REST call, |
| 205 * this method will complete with the same error. |
| 206 */ |
| 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}) { |
| 208 var _url = null; |
| 209 var _queryParams = new core.Map(); |
| 210 var _uploadMedia = null; |
| 211 var _uploadOptions = null; |
| 212 var _downloadOptions = common.DownloadOptions.Metadata; |
| 213 var _body = null; |
| 214 |
| 215 if (q == null) { |
| 216 throw new core.ArgumentError("Parameter q is required."); |
| 217 } |
| 218 _queryParams["q"] = [q]; |
| 219 if (c2coff != null) { |
| 220 _queryParams["c2coff"] = [c2coff]; |
| 221 } |
| 222 if (cr != null) { |
| 223 _queryParams["cr"] = [cr]; |
| 224 } |
| 225 if (cref != null) { |
| 226 _queryParams["cref"] = [cref]; |
| 227 } |
| 228 if (cx != null) { |
| 229 _queryParams["cx"] = [cx]; |
| 230 } |
| 231 if (dateRestrict != null) { |
| 232 _queryParams["dateRestrict"] = [dateRestrict]; |
| 233 } |
| 234 if (exactTerms != null) { |
| 235 _queryParams["exactTerms"] = [exactTerms]; |
| 236 } |
| 237 if (excludeTerms != null) { |
| 238 _queryParams["excludeTerms"] = [excludeTerms]; |
| 239 } |
| 240 if (fileType != null) { |
| 241 _queryParams["fileType"] = [fileType]; |
| 242 } |
| 243 if (filter != null) { |
| 244 _queryParams["filter"] = [filter]; |
| 245 } |
| 246 if (gl != null) { |
| 247 _queryParams["gl"] = [gl]; |
| 248 } |
| 249 if (googlehost != null) { |
| 250 _queryParams["googlehost"] = [googlehost]; |
| 251 } |
| 252 if (highRange != null) { |
| 253 _queryParams["highRange"] = [highRange]; |
| 254 } |
| 255 if (hl != null) { |
| 256 _queryParams["hl"] = [hl]; |
| 257 } |
| 258 if (hq != null) { |
| 259 _queryParams["hq"] = [hq]; |
| 260 } |
| 261 if (imgColorType != null) { |
| 262 _queryParams["imgColorType"] = [imgColorType]; |
| 263 } |
| 264 if (imgDominantColor != null) { |
| 265 _queryParams["imgDominantColor"] = [imgDominantColor]; |
| 266 } |
| 267 if (imgSize != null) { |
| 268 _queryParams["imgSize"] = [imgSize]; |
| 269 } |
| 270 if (imgType != null) { |
| 271 _queryParams["imgType"] = [imgType]; |
| 272 } |
| 273 if (linkSite != null) { |
| 274 _queryParams["linkSite"] = [linkSite]; |
| 275 } |
| 276 if (lowRange != null) { |
| 277 _queryParams["lowRange"] = [lowRange]; |
| 278 } |
| 279 if (lr != null) { |
| 280 _queryParams["lr"] = [lr]; |
| 281 } |
| 282 if (num != null) { |
| 283 _queryParams["num"] = ["${num}"]; |
| 284 } |
| 285 if (orTerms != null) { |
| 286 _queryParams["orTerms"] = [orTerms]; |
| 287 } |
| 288 if (relatedSite != null) { |
| 289 _queryParams["relatedSite"] = [relatedSite]; |
| 290 } |
| 291 if (rights != null) { |
| 292 _queryParams["rights"] = [rights]; |
| 293 } |
| 294 if (safe != null) { |
| 295 _queryParams["safe"] = [safe]; |
| 296 } |
| 297 if (searchType != null) { |
| 298 _queryParams["searchType"] = [searchType]; |
| 299 } |
| 300 if (siteSearch != null) { |
| 301 _queryParams["siteSearch"] = [siteSearch]; |
| 302 } |
| 303 if (siteSearchFilter != null) { |
| 304 _queryParams["siteSearchFilter"] = [siteSearchFilter]; |
| 305 } |
| 306 if (sort != null) { |
| 307 _queryParams["sort"] = [sort]; |
| 308 } |
| 309 if (start != null) { |
| 310 _queryParams["start"] = ["${start}"]; |
| 311 } |
| 312 |
| 313 |
| 314 _url = 'v1'; |
| 315 |
| 316 var _response = _requester.request(_url, |
| 317 "GET", |
| 318 body: _body, |
| 319 queryParams: _queryParams, |
| 320 uploadOptions: _uploadOptions, |
| 321 uploadMedia: _uploadMedia, |
| 322 downloadOptions: _downloadOptions); |
| 323 return _response.then((data) => new Search.fromJson(data)); |
| 324 } |
| 325 |
| 326 } |
| 327 |
| 328 |
| 329 |
| 330 /** Not documented yet. */ |
| 331 class ContextFacets { |
| 332 /** Not documented yet. */ |
| 333 core.String anchor; |
| 334 |
| 335 /** Not documented yet. */ |
| 336 core.String label; |
| 337 |
| 338 /** Not documented yet. */ |
| 339 core.String labelWithOp; |
| 340 |
| 341 |
| 342 ContextFacets(); |
| 343 |
| 344 ContextFacets.fromJson(core.Map _json) { |
| 345 if (_json.containsKey("anchor")) { |
| 346 anchor = _json["anchor"]; |
| 347 } |
| 348 if (_json.containsKey("label")) { |
| 349 label = _json["label"]; |
| 350 } |
| 351 if (_json.containsKey("label_with_op")) { |
| 352 labelWithOp = _json["label_with_op"]; |
| 353 } |
| 354 } |
| 355 |
| 356 core.Map toJson() { |
| 357 var _json = new core.Map(); |
| 358 if (anchor != null) { |
| 359 _json["anchor"] = anchor; |
| 360 } |
| 361 if (label != null) { |
| 362 _json["label"] = label; |
| 363 } |
| 364 if (labelWithOp != null) { |
| 365 _json["label_with_op"] = labelWithOp; |
| 366 } |
| 367 return _json; |
| 368 } |
| 369 } |
| 370 |
| 371 |
| 372 /** Not documented yet. */ |
| 373 class Context { |
| 374 /** Not documented yet. */ |
| 375 core.List<core.List<ContextFacets>> facets; |
| 376 |
| 377 /** Not documented yet. */ |
| 378 core.String title; |
| 379 |
| 380 |
| 381 Context(); |
| 382 |
| 383 Context.fromJson(core.Map _json) { |
| 384 if (_json.containsKey("facets")) { |
| 385 facets = _json["facets"].map((value) => value.map((value) => new ContextFa
cets.fromJson(value)).toList()).toList(); |
| 386 } |
| 387 if (_json.containsKey("title")) { |
| 388 title = _json["title"]; |
| 389 } |
| 390 } |
| 391 |
| 392 core.Map toJson() { |
| 393 var _json = new core.Map(); |
| 394 if (facets != null) { |
| 395 _json["facets"] = facets.map((value) => value.map((value) => (value).toJso
n()).toList()).toList(); |
| 396 } |
| 397 if (title != null) { |
| 398 _json["title"] = title; |
| 399 } |
| 400 return _json; |
| 401 } |
| 402 } |
| 403 |
| 404 |
| 405 /** Not documented yet. */ |
| 406 class PromotionBodyLines { |
| 407 /** Not documented yet. */ |
| 408 core.String htmlTitle; |
| 409 |
| 410 /** Not documented yet. */ |
| 411 core.String link; |
| 412 |
| 413 /** Not documented yet. */ |
| 414 core.String title; |
| 415 |
| 416 /** Not documented yet. */ |
| 417 core.String url; |
| 418 |
| 419 |
| 420 PromotionBodyLines(); |
| 421 |
| 422 PromotionBodyLines.fromJson(core.Map _json) { |
| 423 if (_json.containsKey("htmlTitle")) { |
| 424 htmlTitle = _json["htmlTitle"]; |
| 425 } |
| 426 if (_json.containsKey("link")) { |
| 427 link = _json["link"]; |
| 428 } |
| 429 if (_json.containsKey("title")) { |
| 430 title = _json["title"]; |
| 431 } |
| 432 if (_json.containsKey("url")) { |
| 433 url = _json["url"]; |
| 434 } |
| 435 } |
| 436 |
| 437 core.Map toJson() { |
| 438 var _json = new core.Map(); |
| 439 if (htmlTitle != null) { |
| 440 _json["htmlTitle"] = htmlTitle; |
| 441 } |
| 442 if (link != null) { |
| 443 _json["link"] = link; |
| 444 } |
| 445 if (title != null) { |
| 446 _json["title"] = title; |
| 447 } |
| 448 if (url != null) { |
| 449 _json["url"] = url; |
| 450 } |
| 451 return _json; |
| 452 } |
| 453 } |
| 454 |
| 455 |
| 456 /** Not documented yet. */ |
| 457 class PromotionImage { |
| 458 /** Not documented yet. */ |
| 459 core.int height; |
| 460 |
| 461 /** Not documented yet. */ |
| 462 core.String source; |
| 463 |
| 464 /** Not documented yet. */ |
| 465 core.int width; |
| 466 |
| 467 |
| 468 PromotionImage(); |
| 469 |
| 470 PromotionImage.fromJson(core.Map _json) { |
| 471 if (_json.containsKey("height")) { |
| 472 height = _json["height"]; |
| 473 } |
| 474 if (_json.containsKey("source")) { |
| 475 source = _json["source"]; |
| 476 } |
| 477 if (_json.containsKey("width")) { |
| 478 width = _json["width"]; |
| 479 } |
| 480 } |
| 481 |
| 482 core.Map toJson() { |
| 483 var _json = new core.Map(); |
| 484 if (height != null) { |
| 485 _json["height"] = height; |
| 486 } |
| 487 if (source != null) { |
| 488 _json["source"] = source; |
| 489 } |
| 490 if (width != null) { |
| 491 _json["width"] = width; |
| 492 } |
| 493 return _json; |
| 494 } |
| 495 } |
| 496 |
| 497 |
| 498 /** Not documented yet. */ |
| 499 class Promotion { |
| 500 /** Not documented yet. */ |
| 501 core.List<PromotionBodyLines> bodyLines; |
| 502 |
| 503 /** Not documented yet. */ |
| 504 core.String displayLink; |
| 505 |
| 506 /** Not documented yet. */ |
| 507 core.String htmlTitle; |
| 508 |
| 509 /** Not documented yet. */ |
| 510 PromotionImage image; |
| 511 |
| 512 /** Not documented yet. */ |
| 513 core.String link; |
| 514 |
| 515 /** Not documented yet. */ |
| 516 core.String title; |
| 517 |
| 518 |
| 519 Promotion(); |
| 520 |
| 521 Promotion.fromJson(core.Map _json) { |
| 522 if (_json.containsKey("bodyLines")) { |
| 523 bodyLines = _json["bodyLines"].map((value) => new PromotionBodyLines.fromJ
son(value)).toList(); |
| 524 } |
| 525 if (_json.containsKey("displayLink")) { |
| 526 displayLink = _json["displayLink"]; |
| 527 } |
| 528 if (_json.containsKey("htmlTitle")) { |
| 529 htmlTitle = _json["htmlTitle"]; |
| 530 } |
| 531 if (_json.containsKey("image")) { |
| 532 image = new PromotionImage.fromJson(_json["image"]); |
| 533 } |
| 534 if (_json.containsKey("link")) { |
| 535 link = _json["link"]; |
| 536 } |
| 537 if (_json.containsKey("title")) { |
| 538 title = _json["title"]; |
| 539 } |
| 540 } |
| 541 |
| 542 core.Map toJson() { |
| 543 var _json = new core.Map(); |
| 544 if (bodyLines != null) { |
| 545 _json["bodyLines"] = bodyLines.map((value) => (value).toJson()).toList(); |
| 546 } |
| 547 if (displayLink != null) { |
| 548 _json["displayLink"] = displayLink; |
| 549 } |
| 550 if (htmlTitle != null) { |
| 551 _json["htmlTitle"] = htmlTitle; |
| 552 } |
| 553 if (image != null) { |
| 554 _json["image"] = (image).toJson(); |
| 555 } |
| 556 if (link != null) { |
| 557 _json["link"] = link; |
| 558 } |
| 559 if (title != null) { |
| 560 _json["title"] = title; |
| 561 } |
| 562 return _json; |
| 563 } |
| 564 } |
| 565 |
| 566 |
| 567 /** Not documented yet. */ |
| 568 class Query { |
| 569 /** Not documented yet. */ |
| 570 core.int count; |
| 571 |
| 572 /** Not documented yet. */ |
| 573 core.String cr; |
| 574 |
| 575 /** Not documented yet. */ |
| 576 core.String cref; |
| 577 |
| 578 /** Not documented yet. */ |
| 579 core.String cx; |
| 580 |
| 581 /** Not documented yet. */ |
| 582 core.String dateRestrict; |
| 583 |
| 584 /** Not documented yet. */ |
| 585 core.String disableCnTwTranslation; |
| 586 |
| 587 /** Not documented yet. */ |
| 588 core.String exactTerms; |
| 589 |
| 590 /** Not documented yet. */ |
| 591 core.String excludeTerms; |
| 592 |
| 593 /** Not documented yet. */ |
| 594 core.String fileType; |
| 595 |
| 596 /** Not documented yet. */ |
| 597 core.String filter; |
| 598 |
| 599 /** Not documented yet. */ |
| 600 core.String gl; |
| 601 |
| 602 /** Not documented yet. */ |
| 603 core.String googleHost; |
| 604 |
| 605 /** Not documented yet. */ |
| 606 core.String highRange; |
| 607 |
| 608 /** Not documented yet. */ |
| 609 core.String hl; |
| 610 |
| 611 /** Not documented yet. */ |
| 612 core.String hq; |
| 613 |
| 614 /** Not documented yet. */ |
| 615 core.String imgColorType; |
| 616 |
| 617 /** Not documented yet. */ |
| 618 core.String imgDominantColor; |
| 619 |
| 620 /** Not documented yet. */ |
| 621 core.String imgSize; |
| 622 |
| 623 /** Not documented yet. */ |
| 624 core.String imgType; |
| 625 |
| 626 /** Not documented yet. */ |
| 627 core.String inputEncoding; |
| 628 |
| 629 /** Not documented yet. */ |
| 630 core.String language; |
| 631 |
| 632 /** Not documented yet. */ |
| 633 core.String linkSite; |
| 634 |
| 635 /** Not documented yet. */ |
| 636 core.String lowRange; |
| 637 |
| 638 /** Not documented yet. */ |
| 639 core.String orTerms; |
| 640 |
| 641 /** Not documented yet. */ |
| 642 core.String outputEncoding; |
| 643 |
| 644 /** Not documented yet. */ |
| 645 core.String relatedSite; |
| 646 |
| 647 /** Not documented yet. */ |
| 648 core.String rights; |
| 649 |
| 650 /** Not documented yet. */ |
| 651 core.String safe; |
| 652 |
| 653 /** Not documented yet. */ |
| 654 core.String searchTerms; |
| 655 |
| 656 /** Not documented yet. */ |
| 657 core.String searchType; |
| 658 |
| 659 /** Not documented yet. */ |
| 660 core.String siteSearch; |
| 661 |
| 662 /** Not documented yet. */ |
| 663 core.String siteSearchFilter; |
| 664 |
| 665 /** Not documented yet. */ |
| 666 core.String sort; |
| 667 |
| 668 /** Not documented yet. */ |
| 669 core.int startIndex; |
| 670 |
| 671 /** Not documented yet. */ |
| 672 core.int startPage; |
| 673 |
| 674 /** Not documented yet. */ |
| 675 core.String title; |
| 676 |
| 677 /** Not documented yet. */ |
| 678 core.String totalResults; |
| 679 |
| 680 |
| 681 Query(); |
| 682 |
| 683 Query.fromJson(core.Map _json) { |
| 684 if (_json.containsKey("count")) { |
| 685 count = _json["count"]; |
| 686 } |
| 687 if (_json.containsKey("cr")) { |
| 688 cr = _json["cr"]; |
| 689 } |
| 690 if (_json.containsKey("cref")) { |
| 691 cref = _json["cref"]; |
| 692 } |
| 693 if (_json.containsKey("cx")) { |
| 694 cx = _json["cx"]; |
| 695 } |
| 696 if (_json.containsKey("dateRestrict")) { |
| 697 dateRestrict = _json["dateRestrict"]; |
| 698 } |
| 699 if (_json.containsKey("disableCnTwTranslation")) { |
| 700 disableCnTwTranslation = _json["disableCnTwTranslation"]; |
| 701 } |
| 702 if (_json.containsKey("exactTerms")) { |
| 703 exactTerms = _json["exactTerms"]; |
| 704 } |
| 705 if (_json.containsKey("excludeTerms")) { |
| 706 excludeTerms = _json["excludeTerms"]; |
| 707 } |
| 708 if (_json.containsKey("fileType")) { |
| 709 fileType = _json["fileType"]; |
| 710 } |
| 711 if (_json.containsKey("filter")) { |
| 712 filter = _json["filter"]; |
| 713 } |
| 714 if (_json.containsKey("gl")) { |
| 715 gl = _json["gl"]; |
| 716 } |
| 717 if (_json.containsKey("googleHost")) { |
| 718 googleHost = _json["googleHost"]; |
| 719 } |
| 720 if (_json.containsKey("highRange")) { |
| 721 highRange = _json["highRange"]; |
| 722 } |
| 723 if (_json.containsKey("hl")) { |
| 724 hl = _json["hl"]; |
| 725 } |
| 726 if (_json.containsKey("hq")) { |
| 727 hq = _json["hq"]; |
| 728 } |
| 729 if (_json.containsKey("imgColorType")) { |
| 730 imgColorType = _json["imgColorType"]; |
| 731 } |
| 732 if (_json.containsKey("imgDominantColor")) { |
| 733 imgDominantColor = _json["imgDominantColor"]; |
| 734 } |
| 735 if (_json.containsKey("imgSize")) { |
| 736 imgSize = _json["imgSize"]; |
| 737 } |
| 738 if (_json.containsKey("imgType")) { |
| 739 imgType = _json["imgType"]; |
| 740 } |
| 741 if (_json.containsKey("inputEncoding")) { |
| 742 inputEncoding = _json["inputEncoding"]; |
| 743 } |
| 744 if (_json.containsKey("language")) { |
| 745 language = _json["language"]; |
| 746 } |
| 747 if (_json.containsKey("linkSite")) { |
| 748 linkSite = _json["linkSite"]; |
| 749 } |
| 750 if (_json.containsKey("lowRange")) { |
| 751 lowRange = _json["lowRange"]; |
| 752 } |
| 753 if (_json.containsKey("orTerms")) { |
| 754 orTerms = _json["orTerms"]; |
| 755 } |
| 756 if (_json.containsKey("outputEncoding")) { |
| 757 outputEncoding = _json["outputEncoding"]; |
| 758 } |
| 759 if (_json.containsKey("relatedSite")) { |
| 760 relatedSite = _json["relatedSite"]; |
| 761 } |
| 762 if (_json.containsKey("rights")) { |
| 763 rights = _json["rights"]; |
| 764 } |
| 765 if (_json.containsKey("safe")) { |
| 766 safe = _json["safe"]; |
| 767 } |
| 768 if (_json.containsKey("searchTerms")) { |
| 769 searchTerms = _json["searchTerms"]; |
| 770 } |
| 771 if (_json.containsKey("searchType")) { |
| 772 searchType = _json["searchType"]; |
| 773 } |
| 774 if (_json.containsKey("siteSearch")) { |
| 775 siteSearch = _json["siteSearch"]; |
| 776 } |
| 777 if (_json.containsKey("siteSearchFilter")) { |
| 778 siteSearchFilter = _json["siteSearchFilter"]; |
| 779 } |
| 780 if (_json.containsKey("sort")) { |
| 781 sort = _json["sort"]; |
| 782 } |
| 783 if (_json.containsKey("startIndex")) { |
| 784 startIndex = _json["startIndex"]; |
| 785 } |
| 786 if (_json.containsKey("startPage")) { |
| 787 startPage = _json["startPage"]; |
| 788 } |
| 789 if (_json.containsKey("title")) { |
| 790 title = _json["title"]; |
| 791 } |
| 792 if (_json.containsKey("totalResults")) { |
| 793 totalResults = _json["totalResults"]; |
| 794 } |
| 795 } |
| 796 |
| 797 core.Map toJson() { |
| 798 var _json = new core.Map(); |
| 799 if (count != null) { |
| 800 _json["count"] = count; |
| 801 } |
| 802 if (cr != null) { |
| 803 _json["cr"] = cr; |
| 804 } |
| 805 if (cref != null) { |
| 806 _json["cref"] = cref; |
| 807 } |
| 808 if (cx != null) { |
| 809 _json["cx"] = cx; |
| 810 } |
| 811 if (dateRestrict != null) { |
| 812 _json["dateRestrict"] = dateRestrict; |
| 813 } |
| 814 if (disableCnTwTranslation != null) { |
| 815 _json["disableCnTwTranslation"] = disableCnTwTranslation; |
| 816 } |
| 817 if (exactTerms != null) { |
| 818 _json["exactTerms"] = exactTerms; |
| 819 } |
| 820 if (excludeTerms != null) { |
| 821 _json["excludeTerms"] = excludeTerms; |
| 822 } |
| 823 if (fileType != null) { |
| 824 _json["fileType"] = fileType; |
| 825 } |
| 826 if (filter != null) { |
| 827 _json["filter"] = filter; |
| 828 } |
| 829 if (gl != null) { |
| 830 _json["gl"] = gl; |
| 831 } |
| 832 if (googleHost != null) { |
| 833 _json["googleHost"] = googleHost; |
| 834 } |
| 835 if (highRange != null) { |
| 836 _json["highRange"] = highRange; |
| 837 } |
| 838 if (hl != null) { |
| 839 _json["hl"] = hl; |
| 840 } |
| 841 if (hq != null) { |
| 842 _json["hq"] = hq; |
| 843 } |
| 844 if (imgColorType != null) { |
| 845 _json["imgColorType"] = imgColorType; |
| 846 } |
| 847 if (imgDominantColor != null) { |
| 848 _json["imgDominantColor"] = imgDominantColor; |
| 849 } |
| 850 if (imgSize != null) { |
| 851 _json["imgSize"] = imgSize; |
| 852 } |
| 853 if (imgType != null) { |
| 854 _json["imgType"] = imgType; |
| 855 } |
| 856 if (inputEncoding != null) { |
| 857 _json["inputEncoding"] = inputEncoding; |
| 858 } |
| 859 if (language != null) { |
| 860 _json["language"] = language; |
| 861 } |
| 862 if (linkSite != null) { |
| 863 _json["linkSite"] = linkSite; |
| 864 } |
| 865 if (lowRange != null) { |
| 866 _json["lowRange"] = lowRange; |
| 867 } |
| 868 if (orTerms != null) { |
| 869 _json["orTerms"] = orTerms; |
| 870 } |
| 871 if (outputEncoding != null) { |
| 872 _json["outputEncoding"] = outputEncoding; |
| 873 } |
| 874 if (relatedSite != null) { |
| 875 _json["relatedSite"] = relatedSite; |
| 876 } |
| 877 if (rights != null) { |
| 878 _json["rights"] = rights; |
| 879 } |
| 880 if (safe != null) { |
| 881 _json["safe"] = safe; |
| 882 } |
| 883 if (searchTerms != null) { |
| 884 _json["searchTerms"] = searchTerms; |
| 885 } |
| 886 if (searchType != null) { |
| 887 _json["searchType"] = searchType; |
| 888 } |
| 889 if (siteSearch != null) { |
| 890 _json["siteSearch"] = siteSearch; |
| 891 } |
| 892 if (siteSearchFilter != null) { |
| 893 _json["siteSearchFilter"] = siteSearchFilter; |
| 894 } |
| 895 if (sort != null) { |
| 896 _json["sort"] = sort; |
| 897 } |
| 898 if (startIndex != null) { |
| 899 _json["startIndex"] = startIndex; |
| 900 } |
| 901 if (startPage != null) { |
| 902 _json["startPage"] = startPage; |
| 903 } |
| 904 if (title != null) { |
| 905 _json["title"] = title; |
| 906 } |
| 907 if (totalResults != null) { |
| 908 _json["totalResults"] = totalResults; |
| 909 } |
| 910 return _json; |
| 911 } |
| 912 } |
| 913 |
| 914 |
| 915 /** Not documented yet. */ |
| 916 class ResultImage { |
| 917 /** Not documented yet. */ |
| 918 core.int byteSize; |
| 919 |
| 920 /** Not documented yet. */ |
| 921 core.String contextLink; |
| 922 |
| 923 /** Not documented yet. */ |
| 924 core.int height; |
| 925 |
| 926 /** Not documented yet. */ |
| 927 core.int thumbnailHeight; |
| 928 |
| 929 /** Not documented yet. */ |
| 930 core.String thumbnailLink; |
| 931 |
| 932 /** Not documented yet. */ |
| 933 core.int thumbnailWidth; |
| 934 |
| 935 /** Not documented yet. */ |
| 936 core.int width; |
| 937 |
| 938 |
| 939 ResultImage(); |
| 940 |
| 941 ResultImage.fromJson(core.Map _json) { |
| 942 if (_json.containsKey("byteSize")) { |
| 943 byteSize = _json["byteSize"]; |
| 944 } |
| 945 if (_json.containsKey("contextLink")) { |
| 946 contextLink = _json["contextLink"]; |
| 947 } |
| 948 if (_json.containsKey("height")) { |
| 949 height = _json["height"]; |
| 950 } |
| 951 if (_json.containsKey("thumbnailHeight")) { |
| 952 thumbnailHeight = _json["thumbnailHeight"]; |
| 953 } |
| 954 if (_json.containsKey("thumbnailLink")) { |
| 955 thumbnailLink = _json["thumbnailLink"]; |
| 956 } |
| 957 if (_json.containsKey("thumbnailWidth")) { |
| 958 thumbnailWidth = _json["thumbnailWidth"]; |
| 959 } |
| 960 if (_json.containsKey("width")) { |
| 961 width = _json["width"]; |
| 962 } |
| 963 } |
| 964 |
| 965 core.Map toJson() { |
| 966 var _json = new core.Map(); |
| 967 if (byteSize != null) { |
| 968 _json["byteSize"] = byteSize; |
| 969 } |
| 970 if (contextLink != null) { |
| 971 _json["contextLink"] = contextLink; |
| 972 } |
| 973 if (height != null) { |
| 974 _json["height"] = height; |
| 975 } |
| 976 if (thumbnailHeight != null) { |
| 977 _json["thumbnailHeight"] = thumbnailHeight; |
| 978 } |
| 979 if (thumbnailLink != null) { |
| 980 _json["thumbnailLink"] = thumbnailLink; |
| 981 } |
| 982 if (thumbnailWidth != null) { |
| 983 _json["thumbnailWidth"] = thumbnailWidth; |
| 984 } |
| 985 if (width != null) { |
| 986 _json["width"] = width; |
| 987 } |
| 988 return _json; |
| 989 } |
| 990 } |
| 991 |
| 992 |
| 993 /** Not documented yet. */ |
| 994 class ResultLabels { |
| 995 /** Not documented yet. */ |
| 996 core.String displayName; |
| 997 |
| 998 /** Not documented yet. */ |
| 999 core.String labelWithOp; |
| 1000 |
| 1001 /** Not documented yet. */ |
| 1002 core.String name; |
| 1003 |
| 1004 |
| 1005 ResultLabels(); |
| 1006 |
| 1007 ResultLabels.fromJson(core.Map _json) { |
| 1008 if (_json.containsKey("displayName")) { |
| 1009 displayName = _json["displayName"]; |
| 1010 } |
| 1011 if (_json.containsKey("label_with_op")) { |
| 1012 labelWithOp = _json["label_with_op"]; |
| 1013 } |
| 1014 if (_json.containsKey("name")) { |
| 1015 name = _json["name"]; |
| 1016 } |
| 1017 } |
| 1018 |
| 1019 core.Map toJson() { |
| 1020 var _json = new core.Map(); |
| 1021 if (displayName != null) { |
| 1022 _json["displayName"] = displayName; |
| 1023 } |
| 1024 if (labelWithOp != null) { |
| 1025 _json["label_with_op"] = labelWithOp; |
| 1026 } |
| 1027 if (name != null) { |
| 1028 _json["name"] = name; |
| 1029 } |
| 1030 return _json; |
| 1031 } |
| 1032 } |
| 1033 |
| 1034 |
| 1035 /** Not documented yet. */ |
| 1036 class Result { |
| 1037 /** Not documented yet. */ |
| 1038 core.String cacheId; |
| 1039 |
| 1040 /** Not documented yet. */ |
| 1041 core.String displayLink; |
| 1042 |
| 1043 /** Not documented yet. */ |
| 1044 core.String fileFormat; |
| 1045 |
| 1046 /** Not documented yet. */ |
| 1047 core.String formattedUrl; |
| 1048 |
| 1049 /** Not documented yet. */ |
| 1050 core.String htmlFormattedUrl; |
| 1051 |
| 1052 /** Not documented yet. */ |
| 1053 core.String htmlSnippet; |
| 1054 |
| 1055 /** Not documented yet. */ |
| 1056 core.String htmlTitle; |
| 1057 |
| 1058 /** Not documented yet. */ |
| 1059 ResultImage image; |
| 1060 |
| 1061 /** Not documented yet. */ |
| 1062 core.String kind; |
| 1063 |
| 1064 /** Not documented yet. */ |
| 1065 core.List<ResultLabels> labels; |
| 1066 |
| 1067 /** Not documented yet. */ |
| 1068 core.String link; |
| 1069 |
| 1070 /** Not documented yet. */ |
| 1071 core.String mime; |
| 1072 |
| 1073 /** |
| 1074 * Not documented yet. |
| 1075 * |
| 1076 * 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. |
| 1078 */ |
| 1079 core.Map<core.String, core.List<core.Map<core.String, core.Object>>> pagemap; |
| 1080 |
| 1081 /** Not documented yet. */ |
| 1082 core.String snippet; |
| 1083 |
| 1084 /** Not documented yet. */ |
| 1085 core.String title; |
| 1086 |
| 1087 |
| 1088 Result(); |
| 1089 |
| 1090 Result.fromJson(core.Map _json) { |
| 1091 if (_json.containsKey("cacheId")) { |
| 1092 cacheId = _json["cacheId"]; |
| 1093 } |
| 1094 if (_json.containsKey("displayLink")) { |
| 1095 displayLink = _json["displayLink"]; |
| 1096 } |
| 1097 if (_json.containsKey("fileFormat")) { |
| 1098 fileFormat = _json["fileFormat"]; |
| 1099 } |
| 1100 if (_json.containsKey("formattedUrl")) { |
| 1101 formattedUrl = _json["formattedUrl"]; |
| 1102 } |
| 1103 if (_json.containsKey("htmlFormattedUrl")) { |
| 1104 htmlFormattedUrl = _json["htmlFormattedUrl"]; |
| 1105 } |
| 1106 if (_json.containsKey("htmlSnippet")) { |
| 1107 htmlSnippet = _json["htmlSnippet"]; |
| 1108 } |
| 1109 if (_json.containsKey("htmlTitle")) { |
| 1110 htmlTitle = _json["htmlTitle"]; |
| 1111 } |
| 1112 if (_json.containsKey("image")) { |
| 1113 image = new ResultImage.fromJson(_json["image"]); |
| 1114 } |
| 1115 if (_json.containsKey("kind")) { |
| 1116 kind = _json["kind"]; |
| 1117 } |
| 1118 if (_json.containsKey("labels")) { |
| 1119 labels = _json["labels"].map((value) => new ResultLabels.fromJson(value)).
toList(); |
| 1120 } |
| 1121 if (_json.containsKey("link")) { |
| 1122 link = _json["link"]; |
| 1123 } |
| 1124 if (_json.containsKey("mime")) { |
| 1125 mime = _json["mime"]; |
| 1126 } |
| 1127 if (_json.containsKey("pagemap")) { |
| 1128 pagemap = _json["pagemap"]; |
| 1129 } |
| 1130 if (_json.containsKey("snippet")) { |
| 1131 snippet = _json["snippet"]; |
| 1132 } |
| 1133 if (_json.containsKey("title")) { |
| 1134 title = _json["title"]; |
| 1135 } |
| 1136 } |
| 1137 |
| 1138 core.Map toJson() { |
| 1139 var _json = new core.Map(); |
| 1140 if (cacheId != null) { |
| 1141 _json["cacheId"] = cacheId; |
| 1142 } |
| 1143 if (displayLink != null) { |
| 1144 _json["displayLink"] = displayLink; |
| 1145 } |
| 1146 if (fileFormat != null) { |
| 1147 _json["fileFormat"] = fileFormat; |
| 1148 } |
| 1149 if (formattedUrl != null) { |
| 1150 _json["formattedUrl"] = formattedUrl; |
| 1151 } |
| 1152 if (htmlFormattedUrl != null) { |
| 1153 _json["htmlFormattedUrl"] = htmlFormattedUrl; |
| 1154 } |
| 1155 if (htmlSnippet != null) { |
| 1156 _json["htmlSnippet"] = htmlSnippet; |
| 1157 } |
| 1158 if (htmlTitle != null) { |
| 1159 _json["htmlTitle"] = htmlTitle; |
| 1160 } |
| 1161 if (image != null) { |
| 1162 _json["image"] = (image).toJson(); |
| 1163 } |
| 1164 if (kind != null) { |
| 1165 _json["kind"] = kind; |
| 1166 } |
| 1167 if (labels != null) { |
| 1168 _json["labels"] = labels.map((value) => (value).toJson()).toList(); |
| 1169 } |
| 1170 if (link != null) { |
| 1171 _json["link"] = link; |
| 1172 } |
| 1173 if (mime != null) { |
| 1174 _json["mime"] = mime; |
| 1175 } |
| 1176 if (pagemap != null) { |
| 1177 _json["pagemap"] = pagemap; |
| 1178 } |
| 1179 if (snippet != null) { |
| 1180 _json["snippet"] = snippet; |
| 1181 } |
| 1182 if (title != null) { |
| 1183 _json["title"] = title; |
| 1184 } |
| 1185 return _json; |
| 1186 } |
| 1187 } |
| 1188 |
| 1189 |
| 1190 /** Not documented yet. */ |
| 1191 class SearchSearchInformation { |
| 1192 /** Not documented yet. */ |
| 1193 core.String formattedSearchTime; |
| 1194 |
| 1195 /** Not documented yet. */ |
| 1196 core.String formattedTotalResults; |
| 1197 |
| 1198 /** Not documented yet. */ |
| 1199 core.double searchTime; |
| 1200 |
| 1201 /** Not documented yet. */ |
| 1202 core.String totalResults; |
| 1203 |
| 1204 |
| 1205 SearchSearchInformation(); |
| 1206 |
| 1207 SearchSearchInformation.fromJson(core.Map _json) { |
| 1208 if (_json.containsKey("formattedSearchTime")) { |
| 1209 formattedSearchTime = _json["formattedSearchTime"]; |
| 1210 } |
| 1211 if (_json.containsKey("formattedTotalResults")) { |
| 1212 formattedTotalResults = _json["formattedTotalResults"]; |
| 1213 } |
| 1214 if (_json.containsKey("searchTime")) { |
| 1215 searchTime = _json["searchTime"]; |
| 1216 } |
| 1217 if (_json.containsKey("totalResults")) { |
| 1218 totalResults = _json["totalResults"]; |
| 1219 } |
| 1220 } |
| 1221 |
| 1222 core.Map toJson() { |
| 1223 var _json = new core.Map(); |
| 1224 if (formattedSearchTime != null) { |
| 1225 _json["formattedSearchTime"] = formattedSearchTime; |
| 1226 } |
| 1227 if (formattedTotalResults != null) { |
| 1228 _json["formattedTotalResults"] = formattedTotalResults; |
| 1229 } |
| 1230 if (searchTime != null) { |
| 1231 _json["searchTime"] = searchTime; |
| 1232 } |
| 1233 if (totalResults != null) { |
| 1234 _json["totalResults"] = totalResults; |
| 1235 } |
| 1236 return _json; |
| 1237 } |
| 1238 } |
| 1239 |
| 1240 |
| 1241 /** Not documented yet. */ |
| 1242 class SearchSpelling { |
| 1243 /** Not documented yet. */ |
| 1244 core.String correctedQuery; |
| 1245 |
| 1246 /** Not documented yet. */ |
| 1247 core.String htmlCorrectedQuery; |
| 1248 |
| 1249 |
| 1250 SearchSpelling(); |
| 1251 |
| 1252 SearchSpelling.fromJson(core.Map _json) { |
| 1253 if (_json.containsKey("correctedQuery")) { |
| 1254 correctedQuery = _json["correctedQuery"]; |
| 1255 } |
| 1256 if (_json.containsKey("htmlCorrectedQuery")) { |
| 1257 htmlCorrectedQuery = _json["htmlCorrectedQuery"]; |
| 1258 } |
| 1259 } |
| 1260 |
| 1261 core.Map toJson() { |
| 1262 var _json = new core.Map(); |
| 1263 if (correctedQuery != null) { |
| 1264 _json["correctedQuery"] = correctedQuery; |
| 1265 } |
| 1266 if (htmlCorrectedQuery != null) { |
| 1267 _json["htmlCorrectedQuery"] = htmlCorrectedQuery; |
| 1268 } |
| 1269 return _json; |
| 1270 } |
| 1271 } |
| 1272 |
| 1273 |
| 1274 /** Not documented yet. */ |
| 1275 class SearchUrl { |
| 1276 /** Not documented yet. */ |
| 1277 core.String template; |
| 1278 |
| 1279 /** Not documented yet. */ |
| 1280 core.String type; |
| 1281 |
| 1282 |
| 1283 SearchUrl(); |
| 1284 |
| 1285 SearchUrl.fromJson(core.Map _json) { |
| 1286 if (_json.containsKey("template")) { |
| 1287 template = _json["template"]; |
| 1288 } |
| 1289 if (_json.containsKey("type")) { |
| 1290 type = _json["type"]; |
| 1291 } |
| 1292 } |
| 1293 |
| 1294 core.Map toJson() { |
| 1295 var _json = new core.Map(); |
| 1296 if (template != null) { |
| 1297 _json["template"] = template; |
| 1298 } |
| 1299 if (type != null) { |
| 1300 _json["type"] = type; |
| 1301 } |
| 1302 return _json; |
| 1303 } |
| 1304 } |
| 1305 |
| 1306 |
| 1307 /** Not documented yet. */ |
| 1308 class Search { |
| 1309 /** Not documented yet. */ |
| 1310 Context context; |
| 1311 |
| 1312 /** Not documented yet. */ |
| 1313 core.List<Result> items; |
| 1314 |
| 1315 /** Not documented yet. */ |
| 1316 core.String kind; |
| 1317 |
| 1318 /** Not documented yet. */ |
| 1319 core.List<Promotion> promotions; |
| 1320 |
| 1321 /** Not documented yet. */ |
| 1322 core.Map<core.String, core.List<Query>> queries; |
| 1323 |
| 1324 /** Not documented yet. */ |
| 1325 SearchSearchInformation searchInformation; |
| 1326 |
| 1327 /** Not documented yet. */ |
| 1328 SearchSpelling spelling; |
| 1329 |
| 1330 /** Not documented yet. */ |
| 1331 SearchUrl url; |
| 1332 |
| 1333 |
| 1334 Search(); |
| 1335 |
| 1336 Search.fromJson(core.Map _json) { |
| 1337 if (_json.containsKey("context")) { |
| 1338 context = new Context.fromJson(_json["context"]); |
| 1339 } |
| 1340 if (_json.containsKey("items")) { |
| 1341 items = _json["items"].map((value) => new Result.fromJson(value)).toList()
; |
| 1342 } |
| 1343 if (_json.containsKey("kind")) { |
| 1344 kind = _json["kind"]; |
| 1345 } |
| 1346 if (_json.containsKey("promotions")) { |
| 1347 promotions = _json["promotions"].map((value) => new Promotion.fromJson(val
ue)).toList(); |
| 1348 } |
| 1349 if (_json.containsKey("queries")) { |
| 1350 queries = common_internal.mapMap(_json["queries"], (item) => item.map((val
ue) => new Query.fromJson(value)).toList()); |
| 1351 } |
| 1352 if (_json.containsKey("searchInformation")) { |
| 1353 searchInformation = new SearchSearchInformation.fromJson(_json["searchInfo
rmation"]); |
| 1354 } |
| 1355 if (_json.containsKey("spelling")) { |
| 1356 spelling = new SearchSpelling.fromJson(_json["spelling"]); |
| 1357 } |
| 1358 if (_json.containsKey("url")) { |
| 1359 url = new SearchUrl.fromJson(_json["url"]); |
| 1360 } |
| 1361 } |
| 1362 |
| 1363 core.Map toJson() { |
| 1364 var _json = new core.Map(); |
| 1365 if (context != null) { |
| 1366 _json["context"] = (context).toJson(); |
| 1367 } |
| 1368 if (items != null) { |
| 1369 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 1370 } |
| 1371 if (kind != null) { |
| 1372 _json["kind"] = kind; |
| 1373 } |
| 1374 if (promotions != null) { |
| 1375 _json["promotions"] = promotions.map((value) => (value).toJson()).toList()
; |
| 1376 } |
| 1377 if (queries != null) { |
| 1378 _json["queries"] = common_internal.mapMap(queries, (item) => item.map((val
ue) => (value).toJson()).toList()); |
| 1379 } |
| 1380 if (searchInformation != null) { |
| 1381 _json["searchInformation"] = (searchInformation).toJson(); |
| 1382 } |
| 1383 if (spelling != null) { |
| 1384 _json["spelling"] = (spelling).toJson(); |
| 1385 } |
| 1386 if (url != null) { |
| 1387 _json["url"] = (url).toJson(); |
| 1388 } |
| 1389 return _json; |
| 1390 } |
| 1391 } |
| 1392 |
| 1393 |
OLD | NEW |