OLD | NEW |
(Empty) | |
| 1 library googleapis.qpxExpress.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 /** |
| 17 * Lets you find the least expensive flights between an origin and a |
| 18 * destination. |
| 19 */ |
| 20 class QpxExpressApi { |
| 21 |
| 22 final common_internal.ApiRequester _requester; |
| 23 |
| 24 TripsResourceApi get trips => new TripsResourceApi(_requester); |
| 25 |
| 26 QpxExpressApi(http.Client client) : |
| 27 _requester = new common_internal.ApiRequester(client, "https://www.googlea
pis.com/", "/qpxExpress/v1/trips/"); |
| 28 } |
| 29 |
| 30 |
| 31 /** Not documented yet. */ |
| 32 class TripsResourceApi { |
| 33 final common_internal.ApiRequester _requester; |
| 34 |
| 35 TripsResourceApi(common_internal.ApiRequester client) : |
| 36 _requester = client; |
| 37 |
| 38 /** |
| 39 * Returns a list of flights. |
| 40 * |
| 41 * [request] - The metadata request object. |
| 42 * |
| 43 * Request parameters: |
| 44 * |
| 45 * Completes with a [TripsSearchResponse]. |
| 46 * |
| 47 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 48 * error. |
| 49 * |
| 50 * If the used [http.Client] completes with an error when making a REST call, |
| 51 * this method will complete with the same error. |
| 52 */ |
| 53 async.Future<TripsSearchResponse> search(TripsSearchRequest request) { |
| 54 var _url = null; |
| 55 var _queryParams = new core.Map(); |
| 56 var _uploadMedia = null; |
| 57 var _uploadOptions = null; |
| 58 var _downloadOptions = common.DownloadOptions.Metadata; |
| 59 var _body = null; |
| 60 |
| 61 if (request != null) { |
| 62 _body = convert.JSON.encode((request).toJson()); |
| 63 } |
| 64 |
| 65 |
| 66 _url = 'search'; |
| 67 |
| 68 var _response = _requester.request(_url, |
| 69 "POST", |
| 70 body: _body, |
| 71 queryParams: _queryParams, |
| 72 uploadOptions: _uploadOptions, |
| 73 uploadMedia: _uploadMedia, |
| 74 downloadOptions: _downloadOptions); |
| 75 return _response.then((data) => new TripsSearchResponse.fromJson(data)); |
| 76 } |
| 77 |
| 78 } |
| 79 |
| 80 |
| 81 |
| 82 /** The make, model, and type of an aircraft. */ |
| 83 class AircraftData { |
| 84 /** |
| 85 * The aircraft code. For example, for a Boeing 777 the code would be 777. |
| 86 */ |
| 87 core.String code; |
| 88 |
| 89 /** |
| 90 * Identifies this as an aircraftData object. Value: the fixed string |
| 91 * qpxexpress#aircraftData |
| 92 */ |
| 93 core.String kind; |
| 94 |
| 95 /** The name of an aircraft, for example Boeing 777. */ |
| 96 core.String name; |
| 97 |
| 98 |
| 99 AircraftData(); |
| 100 |
| 101 AircraftData.fromJson(core.Map _json) { |
| 102 if (_json.containsKey("code")) { |
| 103 code = _json["code"]; |
| 104 } |
| 105 if (_json.containsKey("kind")) { |
| 106 kind = _json["kind"]; |
| 107 } |
| 108 if (_json.containsKey("name")) { |
| 109 name = _json["name"]; |
| 110 } |
| 111 } |
| 112 |
| 113 core.Map toJson() { |
| 114 var _json = new core.Map(); |
| 115 if (code != null) { |
| 116 _json["code"] = code; |
| 117 } |
| 118 if (kind != null) { |
| 119 _json["kind"] = kind; |
| 120 } |
| 121 if (name != null) { |
| 122 _json["name"] = name; |
| 123 } |
| 124 return _json; |
| 125 } |
| 126 } |
| 127 |
| 128 |
| 129 /** An airport. */ |
| 130 class AirportData { |
| 131 /** |
| 132 * The city code an airport is located in. For example, for JFK airport, this |
| 133 * is NYC. |
| 134 */ |
| 135 core.String city; |
| 136 |
| 137 /** An airport's code. For example, for Boston Logan airport, this is BOS. */ |
| 138 core.String code; |
| 139 |
| 140 /** |
| 141 * Identifies this as an airport object. Value: the fixed string |
| 142 * qpxexpress#airportData. |
| 143 */ |
| 144 core.String kind; |
| 145 |
| 146 /** |
| 147 * The name of an airport. For example, for airport BOS the name is "Boston |
| 148 * Logan International". |
| 149 */ |
| 150 core.String name; |
| 151 |
| 152 |
| 153 AirportData(); |
| 154 |
| 155 AirportData.fromJson(core.Map _json) { |
| 156 if (_json.containsKey("city")) { |
| 157 city = _json["city"]; |
| 158 } |
| 159 if (_json.containsKey("code")) { |
| 160 code = _json["code"]; |
| 161 } |
| 162 if (_json.containsKey("kind")) { |
| 163 kind = _json["kind"]; |
| 164 } |
| 165 if (_json.containsKey("name")) { |
| 166 name = _json["name"]; |
| 167 } |
| 168 } |
| 169 |
| 170 core.Map toJson() { |
| 171 var _json = new core.Map(); |
| 172 if (city != null) { |
| 173 _json["city"] = city; |
| 174 } |
| 175 if (code != null) { |
| 176 _json["code"] = code; |
| 177 } |
| 178 if (kind != null) { |
| 179 _json["kind"] = kind; |
| 180 } |
| 181 if (name != null) { |
| 182 _json["name"] = name; |
| 183 } |
| 184 return _json; |
| 185 } |
| 186 } |
| 187 |
| 188 |
| 189 /** Information about an item of baggage. */ |
| 190 class BagDescriptor { |
| 191 /** Provides the commercial name for an optional service. */ |
| 192 core.String commercialName; |
| 193 |
| 194 /** How many of this type of bag will be checked on this flight. */ |
| 195 core.int count; |
| 196 |
| 197 /** A description of the baggage. */ |
| 198 core.List<core.String> description; |
| 199 |
| 200 /** |
| 201 * Identifies this as a baggage object. Value: the fixed string |
| 202 * qpxexpress#bagDescriptor. |
| 203 */ |
| 204 core.String kind; |
| 205 |
| 206 /** The standard IATA subcode used to identify this optional service. */ |
| 207 core.String subcode; |
| 208 |
| 209 |
| 210 BagDescriptor(); |
| 211 |
| 212 BagDescriptor.fromJson(core.Map _json) { |
| 213 if (_json.containsKey("commercialName")) { |
| 214 commercialName = _json["commercialName"]; |
| 215 } |
| 216 if (_json.containsKey("count")) { |
| 217 count = _json["count"]; |
| 218 } |
| 219 if (_json.containsKey("description")) { |
| 220 description = _json["description"]; |
| 221 } |
| 222 if (_json.containsKey("kind")) { |
| 223 kind = _json["kind"]; |
| 224 } |
| 225 if (_json.containsKey("subcode")) { |
| 226 subcode = _json["subcode"]; |
| 227 } |
| 228 } |
| 229 |
| 230 core.Map toJson() { |
| 231 var _json = new core.Map(); |
| 232 if (commercialName != null) { |
| 233 _json["commercialName"] = commercialName; |
| 234 } |
| 235 if (count != null) { |
| 236 _json["count"] = count; |
| 237 } |
| 238 if (description != null) { |
| 239 _json["description"] = description; |
| 240 } |
| 241 if (kind != null) { |
| 242 _json["kind"] = kind; |
| 243 } |
| 244 if (subcode != null) { |
| 245 _json["subcode"] = subcode; |
| 246 } |
| 247 return _json; |
| 248 } |
| 249 } |
| 250 |
| 251 |
| 252 /** |
| 253 * Information about a carrier (ie. an airline, bus line, railroad, etc) that |
| 254 * might be useful to display to an end-user. |
| 255 */ |
| 256 class CarrierData { |
| 257 /** |
| 258 * The IATA designator of a carrier (airline, etc). For example, for American |
| 259 * Airlines, the code is AA. |
| 260 */ |
| 261 core.String code; |
| 262 |
| 263 /** |
| 264 * Identifies this as a kind of carrier (ie. an airline, bus line, railroad, |
| 265 * etc). Value: the fixed string qpxexpress#carrierData. |
| 266 */ |
| 267 core.String kind; |
| 268 |
| 269 /** The long, full name of a carrier. For example: American Airlines. */ |
| 270 core.String name; |
| 271 |
| 272 |
| 273 CarrierData(); |
| 274 |
| 275 CarrierData.fromJson(core.Map _json) { |
| 276 if (_json.containsKey("code")) { |
| 277 code = _json["code"]; |
| 278 } |
| 279 if (_json.containsKey("kind")) { |
| 280 kind = _json["kind"]; |
| 281 } |
| 282 if (_json.containsKey("name")) { |
| 283 name = _json["name"]; |
| 284 } |
| 285 } |
| 286 |
| 287 core.Map toJson() { |
| 288 var _json = new core.Map(); |
| 289 if (code != null) { |
| 290 _json["code"] = code; |
| 291 } |
| 292 if (kind != null) { |
| 293 _json["kind"] = kind; |
| 294 } |
| 295 if (name != null) { |
| 296 _json["name"] = name; |
| 297 } |
| 298 return _json; |
| 299 } |
| 300 } |
| 301 |
| 302 |
| 303 /** |
| 304 * Information about a city that might be useful to an end-user; typically the |
| 305 * city of an airport. |
| 306 */ |
| 307 class CityData { |
| 308 /** The IATA character ID of a city. For example, for Boston this is BOS. */ |
| 309 core.String code; |
| 310 |
| 311 /** |
| 312 * The two-character country code of the country the city is located in. For |
| 313 * example, US for the United States of America. |
| 314 */ |
| 315 core.String country; |
| 316 |
| 317 /** |
| 318 * Identifies this as a city, typically with one or more airports. Value: the |
| 319 * fixed string qpxexpress#cityData. |
| 320 */ |
| 321 core.String kind; |
| 322 |
| 323 /** The full name of a city. An example would be: New York. */ |
| 324 core.String name; |
| 325 |
| 326 |
| 327 CityData(); |
| 328 |
| 329 CityData.fromJson(core.Map _json) { |
| 330 if (_json.containsKey("code")) { |
| 331 code = _json["code"]; |
| 332 } |
| 333 if (_json.containsKey("country")) { |
| 334 country = _json["country"]; |
| 335 } |
| 336 if (_json.containsKey("kind")) { |
| 337 kind = _json["kind"]; |
| 338 } |
| 339 if (_json.containsKey("name")) { |
| 340 name = _json["name"]; |
| 341 } |
| 342 } |
| 343 |
| 344 core.Map toJson() { |
| 345 var _json = new core.Map(); |
| 346 if (code != null) { |
| 347 _json["code"] = code; |
| 348 } |
| 349 if (country != null) { |
| 350 _json["country"] = country; |
| 351 } |
| 352 if (kind != null) { |
| 353 _json["kind"] = kind; |
| 354 } |
| 355 if (name != null) { |
| 356 _json["name"] = name; |
| 357 } |
| 358 return _json; |
| 359 } |
| 360 } |
| 361 |
| 362 |
| 363 /** |
| 364 * Detailed information about components found in the solutions of this |
| 365 * response, including a trip's airport, city, taxes, airline, and aircraft. |
| 366 */ |
| 367 class Data { |
| 368 /** The aircraft that is flying between an origin and destination. */ |
| 369 core.List<AircraftData> aircraft; |
| 370 |
| 371 /** The airport of an origin or destination. */ |
| 372 core.List<AirportData> airport; |
| 373 |
| 374 /** |
| 375 * The airline carrier of the aircraft flying between an origin and |
| 376 * destination. Allowed values are IATA carrier codes. |
| 377 */ |
| 378 core.List<CarrierData> carrier; |
| 379 |
| 380 /** The city that is either the origin or destination of part of a trip. */ |
| 381 core.List<CityData> city; |
| 382 |
| 383 /** |
| 384 * Identifies this as QPX Express response resource, including a trip's |
| 385 * airport, city, taxes, airline, and aircraft. Value: the fixed string |
| 386 * qpxexpress#data. |
| 387 */ |
| 388 core.String kind; |
| 389 |
| 390 /** The taxes due for flying between an origin and a destination. */ |
| 391 core.List<TaxData> tax; |
| 392 |
| 393 |
| 394 Data(); |
| 395 |
| 396 Data.fromJson(core.Map _json) { |
| 397 if (_json.containsKey("aircraft")) { |
| 398 aircraft = _json["aircraft"].map((value) => new AircraftData.fromJson(valu
e)).toList(); |
| 399 } |
| 400 if (_json.containsKey("airport")) { |
| 401 airport = _json["airport"].map((value) => new AirportData.fromJson(value))
.toList(); |
| 402 } |
| 403 if (_json.containsKey("carrier")) { |
| 404 carrier = _json["carrier"].map((value) => new CarrierData.fromJson(value))
.toList(); |
| 405 } |
| 406 if (_json.containsKey("city")) { |
| 407 city = _json["city"].map((value) => new CityData.fromJson(value)).toList()
; |
| 408 } |
| 409 if (_json.containsKey("kind")) { |
| 410 kind = _json["kind"]; |
| 411 } |
| 412 if (_json.containsKey("tax")) { |
| 413 tax = _json["tax"].map((value) => new TaxData.fromJson(value)).toList(); |
| 414 } |
| 415 } |
| 416 |
| 417 core.Map toJson() { |
| 418 var _json = new core.Map(); |
| 419 if (aircraft != null) { |
| 420 _json["aircraft"] = aircraft.map((value) => (value).toJson()).toList(); |
| 421 } |
| 422 if (airport != null) { |
| 423 _json["airport"] = airport.map((value) => (value).toJson()).toList(); |
| 424 } |
| 425 if (carrier != null) { |
| 426 _json["carrier"] = carrier.map((value) => (value).toJson()).toList(); |
| 427 } |
| 428 if (city != null) { |
| 429 _json["city"] = city.map((value) => (value).toJson()).toList(); |
| 430 } |
| 431 if (kind != null) { |
| 432 _json["kind"] = kind; |
| 433 } |
| 434 if (tax != null) { |
| 435 _json["tax"] = tax.map((value) => (value).toJson()).toList(); |
| 436 } |
| 437 return _json; |
| 438 } |
| 439 } |
| 440 |
| 441 |
| 442 /** |
| 443 * Complete information about a fare used in the solution to a low-fare search |
| 444 * query. In the airline industry a fare is a price an airline charges for |
| 445 * one-way travel between two points. A fare typically contains a carrier code, |
| 446 * two city codes, a price, and a fare basis. (A fare basis is a one-to-eight |
| 447 * character alphanumeric code used to identify a fare.) |
| 448 */ |
| 449 class FareInfo { |
| 450 /** Not documented yet. */ |
| 451 core.String basisCode; |
| 452 |
| 453 /** |
| 454 * The carrier of the aircraft or other vehicle commuting between two points. |
| 455 */ |
| 456 core.String carrier; |
| 457 |
| 458 /** The city code of the city the trip ends at. */ |
| 459 core.String destination; |
| 460 |
| 461 /** A unique identifier of the fare. */ |
| 462 core.String id; |
| 463 |
| 464 /** |
| 465 * Identifies this as a fare object. Value: the fixed string |
| 466 * qpxexpress#fareInfo. |
| 467 */ |
| 468 core.String kind; |
| 469 |
| 470 /** The city code of the city the trip begins at. */ |
| 471 core.String origin; |
| 472 |
| 473 /** |
| 474 * Whether this is a private fare, for example one offered only to select |
| 475 * customers rather than the general public. |
| 476 */ |
| 477 core.bool private; |
| 478 |
| 479 |
| 480 FareInfo(); |
| 481 |
| 482 FareInfo.fromJson(core.Map _json) { |
| 483 if (_json.containsKey("basisCode")) { |
| 484 basisCode = _json["basisCode"]; |
| 485 } |
| 486 if (_json.containsKey("carrier")) { |
| 487 carrier = _json["carrier"]; |
| 488 } |
| 489 if (_json.containsKey("destination")) { |
| 490 destination = _json["destination"]; |
| 491 } |
| 492 if (_json.containsKey("id")) { |
| 493 id = _json["id"]; |
| 494 } |
| 495 if (_json.containsKey("kind")) { |
| 496 kind = _json["kind"]; |
| 497 } |
| 498 if (_json.containsKey("origin")) { |
| 499 origin = _json["origin"]; |
| 500 } |
| 501 if (_json.containsKey("private")) { |
| 502 private = _json["private"]; |
| 503 } |
| 504 } |
| 505 |
| 506 core.Map toJson() { |
| 507 var _json = new core.Map(); |
| 508 if (basisCode != null) { |
| 509 _json["basisCode"] = basisCode; |
| 510 } |
| 511 if (carrier != null) { |
| 512 _json["carrier"] = carrier; |
| 513 } |
| 514 if (destination != null) { |
| 515 _json["destination"] = destination; |
| 516 } |
| 517 if (id != null) { |
| 518 _json["id"] = id; |
| 519 } |
| 520 if (kind != null) { |
| 521 _json["kind"] = kind; |
| 522 } |
| 523 if (origin != null) { |
| 524 _json["origin"] = origin; |
| 525 } |
| 526 if (private != null) { |
| 527 _json["private"] = private; |
| 528 } |
| 529 return _json; |
| 530 } |
| 531 } |
| 532 |
| 533 |
| 534 /** |
| 535 * A flight is a sequence of legs with the same airline carrier and flight |
| 536 * number. (A leg is the smallest unit of travel, in the case of a flight a |
| 537 * takeoff immediately followed by a landing at two set points on a particular |
| 538 * carrier with a particular flight number.) The naive view is that a flight is |
| 539 * scheduled travel of an aircraft between two points, with possibly |
| 540 * intermediate stops, but carriers will frequently list flights that require a |
| 541 * change of aircraft between legs. |
| 542 */ |
| 543 class FlightInfo { |
| 544 /** Not documented yet. */ |
| 545 core.String carrier; |
| 546 |
| 547 /** The flight number. */ |
| 548 core.String number; |
| 549 |
| 550 |
| 551 FlightInfo(); |
| 552 |
| 553 FlightInfo.fromJson(core.Map _json) { |
| 554 if (_json.containsKey("carrier")) { |
| 555 carrier = _json["carrier"]; |
| 556 } |
| 557 if (_json.containsKey("number")) { |
| 558 number = _json["number"]; |
| 559 } |
| 560 } |
| 561 |
| 562 core.Map toJson() { |
| 563 var _json = new core.Map(); |
| 564 if (carrier != null) { |
| 565 _json["carrier"] = carrier; |
| 566 } |
| 567 if (number != null) { |
| 568 _json["number"] = number; |
| 569 } |
| 570 return _json; |
| 571 } |
| 572 } |
| 573 |
| 574 |
| 575 /** Information about free baggage allowed on one segment of a trip. */ |
| 576 class FreeBaggageAllowance { |
| 577 /** |
| 578 * A representation of a type of bag, such as an ATPCo subcode, Commercial |
| 579 * Name, or other description. |
| 580 */ |
| 581 core.List<BagDescriptor> bagDescriptor; |
| 582 |
| 583 /** The maximum number of kilos all the free baggage together may weigh. */ |
| 584 core.int kilos; |
| 585 |
| 586 /** The maximum number of kilos any one piece of baggage may weigh. */ |
| 587 core.int kilosPerPiece; |
| 588 |
| 589 /** |
| 590 * Identifies this as free baggage object, allowed on one segment of a trip. |
| 591 * Value: the fixed string qpxexpress#freeBaggageAllowance. |
| 592 */ |
| 593 core.String kind; |
| 594 |
| 595 /** The number of free pieces of baggage allowed. */ |
| 596 core.int pieces; |
| 597 |
| 598 /** The number of pounds of free baggage allowed. */ |
| 599 core.int pounds; |
| 600 |
| 601 |
| 602 FreeBaggageAllowance(); |
| 603 |
| 604 FreeBaggageAllowance.fromJson(core.Map _json) { |
| 605 if (_json.containsKey("bagDescriptor")) { |
| 606 bagDescriptor = _json["bagDescriptor"].map((value) => new BagDescriptor.fr
omJson(value)).toList(); |
| 607 } |
| 608 if (_json.containsKey("kilos")) { |
| 609 kilos = _json["kilos"]; |
| 610 } |
| 611 if (_json.containsKey("kilosPerPiece")) { |
| 612 kilosPerPiece = _json["kilosPerPiece"]; |
| 613 } |
| 614 if (_json.containsKey("kind")) { |
| 615 kind = _json["kind"]; |
| 616 } |
| 617 if (_json.containsKey("pieces")) { |
| 618 pieces = _json["pieces"]; |
| 619 } |
| 620 if (_json.containsKey("pounds")) { |
| 621 pounds = _json["pounds"]; |
| 622 } |
| 623 } |
| 624 |
| 625 core.Map toJson() { |
| 626 var _json = new core.Map(); |
| 627 if (bagDescriptor != null) { |
| 628 _json["bagDescriptor"] = bagDescriptor.map((value) => (value).toJson()).to
List(); |
| 629 } |
| 630 if (kilos != null) { |
| 631 _json["kilos"] = kilos; |
| 632 } |
| 633 if (kilosPerPiece != null) { |
| 634 _json["kilosPerPiece"] = kilosPerPiece; |
| 635 } |
| 636 if (kind != null) { |
| 637 _json["kind"] = kind; |
| 638 } |
| 639 if (pieces != null) { |
| 640 _json["pieces"] = pieces; |
| 641 } |
| 642 if (pounds != null) { |
| 643 _json["pounds"] = pounds; |
| 644 } |
| 645 return _json; |
| 646 } |
| 647 } |
| 648 |
| 649 |
| 650 /** |
| 651 * Information about a leg. (A leg is the smallest unit of travel, in the case |
| 652 * of a flight a takeoff immediately followed by a landing at two set points on |
| 653 * a particular carrier with a particular flight number.) |
| 654 */ |
| 655 class LegInfo { |
| 656 /** |
| 657 * The aircraft (or bus, ferry, railcar, etc) travelling between the two |
| 658 * points of this leg. |
| 659 */ |
| 660 core.String aircraft; |
| 661 |
| 662 /** |
| 663 * The scheduled time of arrival at the destination of the leg, local to the |
| 664 * point of arrival. |
| 665 */ |
| 666 core.String arrivalTime; |
| 667 |
| 668 /** |
| 669 * Whether you have to change planes following this leg. Only applies to the |
| 670 * next leg. |
| 671 */ |
| 672 core.bool changePlane; |
| 673 |
| 674 /** Duration of a connection following this leg, in minutes. */ |
| 675 core.int connectionDuration; |
| 676 |
| 677 /** |
| 678 * The scheduled departure time of the leg, local to the point of departure. |
| 679 */ |
| 680 core.String departureTime; |
| 681 |
| 682 /** The leg destination as a city and airport. */ |
| 683 core.String destination; |
| 684 |
| 685 /** The terminal the flight is scheduled to arrive at. */ |
| 686 core.String destinationTerminal; |
| 687 |
| 688 /** The scheduled travelling time from the origin to the destination. */ |
| 689 core.int duration; |
| 690 |
| 691 /** An identifier that uniquely identifies this leg in the solution. */ |
| 692 core.String id; |
| 693 |
| 694 /** |
| 695 * Identifies this as a leg object. A leg is the smallest unit of travel, in |
| 696 * the case of a flight a takeoff immediately followed by a landing at two set |
| 697 * points on a particular carrier with a particular flight number. Value: the |
| 698 * fixed string qpxexpress#legInfo. |
| 699 */ |
| 700 core.String kind; |
| 701 |
| 702 /** |
| 703 * A simple, general description of the meal(s) served on the flight, for |
| 704 * example: "Hot meal". |
| 705 */ |
| 706 core.String meal; |
| 707 |
| 708 /** The number of miles in this leg. */ |
| 709 core.int mileage; |
| 710 |
| 711 /** In percent, the published on time performance on this leg. */ |
| 712 core.int onTimePerformance; |
| 713 |
| 714 /** |
| 715 * Department of Transportation disclosure information on the actual operator |
| 716 * of a flight in a code share. (A code share refers to a marketing agreement |
| 717 * between two carriers, where one carrier will list in its schedules (and |
| 718 * take bookings for) flights that are actually operated by another carrier.) |
| 719 */ |
| 720 core.String operatingDisclosure; |
| 721 |
| 722 /** The leg origin as a city and airport. */ |
| 723 core.String origin; |
| 724 |
| 725 /** The terminal the flight is scheduled to depart from. */ |
| 726 core.String originTerminal; |
| 727 |
| 728 /** |
| 729 * Whether passenger information must be furnished to the United States |
| 730 * Transportation Security Administration (TSA) prior to departure. |
| 731 */ |
| 732 core.bool secure; |
| 733 |
| 734 |
| 735 LegInfo(); |
| 736 |
| 737 LegInfo.fromJson(core.Map _json) { |
| 738 if (_json.containsKey("aircraft")) { |
| 739 aircraft = _json["aircraft"]; |
| 740 } |
| 741 if (_json.containsKey("arrivalTime")) { |
| 742 arrivalTime = _json["arrivalTime"]; |
| 743 } |
| 744 if (_json.containsKey("changePlane")) { |
| 745 changePlane = _json["changePlane"]; |
| 746 } |
| 747 if (_json.containsKey("connectionDuration")) { |
| 748 connectionDuration = _json["connectionDuration"]; |
| 749 } |
| 750 if (_json.containsKey("departureTime")) { |
| 751 departureTime = _json["departureTime"]; |
| 752 } |
| 753 if (_json.containsKey("destination")) { |
| 754 destination = _json["destination"]; |
| 755 } |
| 756 if (_json.containsKey("destinationTerminal")) { |
| 757 destinationTerminal = _json["destinationTerminal"]; |
| 758 } |
| 759 if (_json.containsKey("duration")) { |
| 760 duration = _json["duration"]; |
| 761 } |
| 762 if (_json.containsKey("id")) { |
| 763 id = _json["id"]; |
| 764 } |
| 765 if (_json.containsKey("kind")) { |
| 766 kind = _json["kind"]; |
| 767 } |
| 768 if (_json.containsKey("meal")) { |
| 769 meal = _json["meal"]; |
| 770 } |
| 771 if (_json.containsKey("mileage")) { |
| 772 mileage = _json["mileage"]; |
| 773 } |
| 774 if (_json.containsKey("onTimePerformance")) { |
| 775 onTimePerformance = _json["onTimePerformance"]; |
| 776 } |
| 777 if (_json.containsKey("operatingDisclosure")) { |
| 778 operatingDisclosure = _json["operatingDisclosure"]; |
| 779 } |
| 780 if (_json.containsKey("origin")) { |
| 781 origin = _json["origin"]; |
| 782 } |
| 783 if (_json.containsKey("originTerminal")) { |
| 784 originTerminal = _json["originTerminal"]; |
| 785 } |
| 786 if (_json.containsKey("secure")) { |
| 787 secure = _json["secure"]; |
| 788 } |
| 789 } |
| 790 |
| 791 core.Map toJson() { |
| 792 var _json = new core.Map(); |
| 793 if (aircraft != null) { |
| 794 _json["aircraft"] = aircraft; |
| 795 } |
| 796 if (arrivalTime != null) { |
| 797 _json["arrivalTime"] = arrivalTime; |
| 798 } |
| 799 if (changePlane != null) { |
| 800 _json["changePlane"] = changePlane; |
| 801 } |
| 802 if (connectionDuration != null) { |
| 803 _json["connectionDuration"] = connectionDuration; |
| 804 } |
| 805 if (departureTime != null) { |
| 806 _json["departureTime"] = departureTime; |
| 807 } |
| 808 if (destination != null) { |
| 809 _json["destination"] = destination; |
| 810 } |
| 811 if (destinationTerminal != null) { |
| 812 _json["destinationTerminal"] = destinationTerminal; |
| 813 } |
| 814 if (duration != null) { |
| 815 _json["duration"] = duration; |
| 816 } |
| 817 if (id != null) { |
| 818 _json["id"] = id; |
| 819 } |
| 820 if (kind != null) { |
| 821 _json["kind"] = kind; |
| 822 } |
| 823 if (meal != null) { |
| 824 _json["meal"] = meal; |
| 825 } |
| 826 if (mileage != null) { |
| 827 _json["mileage"] = mileage; |
| 828 } |
| 829 if (onTimePerformance != null) { |
| 830 _json["onTimePerformance"] = onTimePerformance; |
| 831 } |
| 832 if (operatingDisclosure != null) { |
| 833 _json["operatingDisclosure"] = operatingDisclosure; |
| 834 } |
| 835 if (origin != null) { |
| 836 _json["origin"] = origin; |
| 837 } |
| 838 if (originTerminal != null) { |
| 839 _json["originTerminal"] = originTerminal; |
| 840 } |
| 841 if (secure != null) { |
| 842 _json["secure"] = secure; |
| 843 } |
| 844 return _json; |
| 845 } |
| 846 } |
| 847 |
| 848 |
| 849 /** |
| 850 * The number and type of passengers. Unfortunately the definition of an infant, |
| 851 * child, adult, and senior citizen varies across carriers and reservation |
| 852 * systems. |
| 853 */ |
| 854 class PassengerCounts { |
| 855 /** The number of passengers that are adults. */ |
| 856 core.int adultCount; |
| 857 |
| 858 /** The number of passengers that are children. */ |
| 859 core.int childCount; |
| 860 |
| 861 /** |
| 862 * The number of passengers that are infants travelling in the lap of an |
| 863 * adult. |
| 864 */ |
| 865 core.int infantInLapCount; |
| 866 |
| 867 /** The number of passengers that are infants each assigned a seat. */ |
| 868 core.int infantInSeatCount; |
| 869 |
| 870 /** |
| 871 * Identifies this as a passenger count object, representing the number of |
| 872 * passengers. Value: the fixed string qpxexpress#passengerCounts. |
| 873 */ |
| 874 core.String kind; |
| 875 |
| 876 /** The number of passengers that are senior citizens. */ |
| 877 core.int seniorCount; |
| 878 |
| 879 |
| 880 PassengerCounts(); |
| 881 |
| 882 PassengerCounts.fromJson(core.Map _json) { |
| 883 if (_json.containsKey("adultCount")) { |
| 884 adultCount = _json["adultCount"]; |
| 885 } |
| 886 if (_json.containsKey("childCount")) { |
| 887 childCount = _json["childCount"]; |
| 888 } |
| 889 if (_json.containsKey("infantInLapCount")) { |
| 890 infantInLapCount = _json["infantInLapCount"]; |
| 891 } |
| 892 if (_json.containsKey("infantInSeatCount")) { |
| 893 infantInSeatCount = _json["infantInSeatCount"]; |
| 894 } |
| 895 if (_json.containsKey("kind")) { |
| 896 kind = _json["kind"]; |
| 897 } |
| 898 if (_json.containsKey("seniorCount")) { |
| 899 seniorCount = _json["seniorCount"]; |
| 900 } |
| 901 } |
| 902 |
| 903 core.Map toJson() { |
| 904 var _json = new core.Map(); |
| 905 if (adultCount != null) { |
| 906 _json["adultCount"] = adultCount; |
| 907 } |
| 908 if (childCount != null) { |
| 909 _json["childCount"] = childCount; |
| 910 } |
| 911 if (infantInLapCount != null) { |
| 912 _json["infantInLapCount"] = infantInLapCount; |
| 913 } |
| 914 if (infantInSeatCount != null) { |
| 915 _json["infantInSeatCount"] = infantInSeatCount; |
| 916 } |
| 917 if (kind != null) { |
| 918 _json["kind"] = kind; |
| 919 } |
| 920 if (seniorCount != null) { |
| 921 _json["seniorCount"] = seniorCount; |
| 922 } |
| 923 return _json; |
| 924 } |
| 925 } |
| 926 |
| 927 |
| 928 /** |
| 929 * The price of one or more travel segments. The currency used to purchase |
| 930 * tickets is usually determined by the sale/ticketing city or the |
| 931 * sale/ticketing country, unless none are specified, in which case it defaults |
| 932 * to that of the journey origin country. |
| 933 */ |
| 934 class PricingInfo { |
| 935 /** |
| 936 * The total fare in the base fare currency (the currency of the country of |
| 937 * origin). This element is only present when the sales currency and the |
| 938 * currency of the country of commencement are different. |
| 939 */ |
| 940 core.String baseFareTotal; |
| 941 |
| 942 /** The fare used to price one or more segments. */ |
| 943 core.List<FareInfo> fare; |
| 944 |
| 945 /** |
| 946 * The horizontal fare calculation. This is a field on a ticket that displays |
| 947 * all of the relevant items that go into the calculation of the fare. |
| 948 */ |
| 949 core.String fareCalculation; |
| 950 |
| 951 /** |
| 952 * Identifies this as a pricing object, representing the price of one or more |
| 953 * travel segments. Value: the fixed string qpxexpress#pricingInfo. |
| 954 */ |
| 955 core.String kind; |
| 956 |
| 957 /** |
| 958 * The latest ticketing time for this pricing assuming the reservation occurs |
| 959 * at ticketing time and there is no change in fares/rules. The time is local |
| 960 * to the point of sale (POS). |
| 961 */ |
| 962 core.String latestTicketingTime; |
| 963 |
| 964 /** The number of passengers to which this price applies. */ |
| 965 PassengerCounts passengers; |
| 966 |
| 967 /** |
| 968 * The passenger type code for this pricing. An alphanumeric code used by a |
| 969 * carrier to restrict fares to certain categories of passenger. For instance, |
| 970 * a fare might be valid only for senior citizens. |
| 971 */ |
| 972 core.String ptc; |
| 973 |
| 974 /** Whether the fares on this pricing are refundable. */ |
| 975 core.bool refundable; |
| 976 |
| 977 /** The total fare in the sale or equivalent currency. */ |
| 978 core.String saleFareTotal; |
| 979 |
| 980 /** The taxes in the sale or equivalent currency. */ |
| 981 core.String saleTaxTotal; |
| 982 |
| 983 /** |
| 984 * Total per-passenger price (fare and tax) in the sale or equivalent |
| 985 * currency. |
| 986 */ |
| 987 core.String saleTotal; |
| 988 |
| 989 /** The per-segment price and baggage information. */ |
| 990 core.List<SegmentPricing> segmentPricing; |
| 991 |
| 992 /** The taxes used to calculate the tax total per ticket. */ |
| 993 core.List<TaxInfo> tax; |
| 994 |
| 995 |
| 996 PricingInfo(); |
| 997 |
| 998 PricingInfo.fromJson(core.Map _json) { |
| 999 if (_json.containsKey("baseFareTotal")) { |
| 1000 baseFareTotal = _json["baseFareTotal"]; |
| 1001 } |
| 1002 if (_json.containsKey("fare")) { |
| 1003 fare = _json["fare"].map((value) => new FareInfo.fromJson(value)).toList()
; |
| 1004 } |
| 1005 if (_json.containsKey("fareCalculation")) { |
| 1006 fareCalculation = _json["fareCalculation"]; |
| 1007 } |
| 1008 if (_json.containsKey("kind")) { |
| 1009 kind = _json["kind"]; |
| 1010 } |
| 1011 if (_json.containsKey("latestTicketingTime")) { |
| 1012 latestTicketingTime = _json["latestTicketingTime"]; |
| 1013 } |
| 1014 if (_json.containsKey("passengers")) { |
| 1015 passengers = new PassengerCounts.fromJson(_json["passengers"]); |
| 1016 } |
| 1017 if (_json.containsKey("ptc")) { |
| 1018 ptc = _json["ptc"]; |
| 1019 } |
| 1020 if (_json.containsKey("refundable")) { |
| 1021 refundable = _json["refundable"]; |
| 1022 } |
| 1023 if (_json.containsKey("saleFareTotal")) { |
| 1024 saleFareTotal = _json["saleFareTotal"]; |
| 1025 } |
| 1026 if (_json.containsKey("saleTaxTotal")) { |
| 1027 saleTaxTotal = _json["saleTaxTotal"]; |
| 1028 } |
| 1029 if (_json.containsKey("saleTotal")) { |
| 1030 saleTotal = _json["saleTotal"]; |
| 1031 } |
| 1032 if (_json.containsKey("segmentPricing")) { |
| 1033 segmentPricing = _json["segmentPricing"].map((value) => new SegmentPricing
.fromJson(value)).toList(); |
| 1034 } |
| 1035 if (_json.containsKey("tax")) { |
| 1036 tax = _json["tax"].map((value) => new TaxInfo.fromJson(value)).toList(); |
| 1037 } |
| 1038 } |
| 1039 |
| 1040 core.Map toJson() { |
| 1041 var _json = new core.Map(); |
| 1042 if (baseFareTotal != null) { |
| 1043 _json["baseFareTotal"] = baseFareTotal; |
| 1044 } |
| 1045 if (fare != null) { |
| 1046 _json["fare"] = fare.map((value) => (value).toJson()).toList(); |
| 1047 } |
| 1048 if (fareCalculation != null) { |
| 1049 _json["fareCalculation"] = fareCalculation; |
| 1050 } |
| 1051 if (kind != null) { |
| 1052 _json["kind"] = kind; |
| 1053 } |
| 1054 if (latestTicketingTime != null) { |
| 1055 _json["latestTicketingTime"] = latestTicketingTime; |
| 1056 } |
| 1057 if (passengers != null) { |
| 1058 _json["passengers"] = (passengers).toJson(); |
| 1059 } |
| 1060 if (ptc != null) { |
| 1061 _json["ptc"] = ptc; |
| 1062 } |
| 1063 if (refundable != null) { |
| 1064 _json["refundable"] = refundable; |
| 1065 } |
| 1066 if (saleFareTotal != null) { |
| 1067 _json["saleFareTotal"] = saleFareTotal; |
| 1068 } |
| 1069 if (saleTaxTotal != null) { |
| 1070 _json["saleTaxTotal"] = saleTaxTotal; |
| 1071 } |
| 1072 if (saleTotal != null) { |
| 1073 _json["saleTotal"] = saleTotal; |
| 1074 } |
| 1075 if (segmentPricing != null) { |
| 1076 _json["segmentPricing"] = segmentPricing.map((value) => (value).toJson()).
toList(); |
| 1077 } |
| 1078 if (tax != null) { |
| 1079 _json["tax"] = tax.map((value) => (value).toJson()).toList(); |
| 1080 } |
| 1081 return _json; |
| 1082 } |
| 1083 } |
| 1084 |
| 1085 |
| 1086 /** |
| 1087 * Details of a segment of a flight; a segment is one or more consecutive legs |
| 1088 * on the same flight. For example a hypothetical flight ZZ001, from DFW to OGG, |
| 1089 * would have one segment with two legs: DFW to HNL (leg 1), HNL to OGG (leg 2), |
| 1090 * and DFW to OGG (legs 1 and 2). |
| 1091 */ |
| 1092 class SegmentInfo { |
| 1093 /** The booking code or class for this segment. */ |
| 1094 core.String bookingCode; |
| 1095 |
| 1096 /** The number of seats available in this booking code on this segment. */ |
| 1097 core.int bookingCodeCount; |
| 1098 |
| 1099 /** The cabin booked for this segment. */ |
| 1100 core.String cabin; |
| 1101 |
| 1102 /** In minutes, the duration of the connection following this segment. */ |
| 1103 core.int connectionDuration; |
| 1104 |
| 1105 /** The duration of the flight segment in minutes. */ |
| 1106 core.int duration; |
| 1107 |
| 1108 /** The flight this is a segment of. */ |
| 1109 FlightInfo flight; |
| 1110 |
| 1111 /** An id uniquely identifying the segment in the solution. */ |
| 1112 core.String id; |
| 1113 |
| 1114 /** |
| 1115 * Identifies this as a segment object. A segment is one or more consecutive |
| 1116 * legs on the same flight. For example a hypothetical flight ZZ001, from DFW |
| 1117 * to OGG, could have one segment with two legs: DFW to HNL (leg 1), HNL to |
| 1118 * OGG (leg 2). Value: the fixed string qpxexpress#segmentInfo. |
| 1119 */ |
| 1120 core.String kind; |
| 1121 |
| 1122 /** The legs composing this segment. */ |
| 1123 core.List<LegInfo> leg; |
| 1124 |
| 1125 /** |
| 1126 * The solution-based index of a segment in a married segment group. Married |
| 1127 * segments can only be booked together. For example, an airline might report |
| 1128 * a certain booking code as sold out from Boston to Pittsburgh, but as |
| 1129 * available as part of two married segments Boston to Chicago connecting |
| 1130 * through Pittsburgh. For example content of this field, consider the |
| 1131 * round-trip flight ZZ1 PHX-PHL ZZ2 PHL-CLT ZZ3 CLT-PHX. This has three |
| 1132 * segments, with the two outbound ones (ZZ1 ZZ2) married. In this case, the |
| 1133 * two outbound segments belong to married segment group 0, and the return |
| 1134 * segment belongs to married segment group 1. |
| 1135 */ |
| 1136 core.String marriedSegmentGroup; |
| 1137 |
| 1138 /** |
| 1139 * Whether the operation of this segment remains subject to government |
| 1140 * approval. |
| 1141 */ |
| 1142 core.bool subjectToGovernmentApproval; |
| 1143 |
| 1144 |
| 1145 SegmentInfo(); |
| 1146 |
| 1147 SegmentInfo.fromJson(core.Map _json) { |
| 1148 if (_json.containsKey("bookingCode")) { |
| 1149 bookingCode = _json["bookingCode"]; |
| 1150 } |
| 1151 if (_json.containsKey("bookingCodeCount")) { |
| 1152 bookingCodeCount = _json["bookingCodeCount"]; |
| 1153 } |
| 1154 if (_json.containsKey("cabin")) { |
| 1155 cabin = _json["cabin"]; |
| 1156 } |
| 1157 if (_json.containsKey("connectionDuration")) { |
| 1158 connectionDuration = _json["connectionDuration"]; |
| 1159 } |
| 1160 if (_json.containsKey("duration")) { |
| 1161 duration = _json["duration"]; |
| 1162 } |
| 1163 if (_json.containsKey("flight")) { |
| 1164 flight = new FlightInfo.fromJson(_json["flight"]); |
| 1165 } |
| 1166 if (_json.containsKey("id")) { |
| 1167 id = _json["id"]; |
| 1168 } |
| 1169 if (_json.containsKey("kind")) { |
| 1170 kind = _json["kind"]; |
| 1171 } |
| 1172 if (_json.containsKey("leg")) { |
| 1173 leg = _json["leg"].map((value) => new LegInfo.fromJson(value)).toList(); |
| 1174 } |
| 1175 if (_json.containsKey("marriedSegmentGroup")) { |
| 1176 marriedSegmentGroup = _json["marriedSegmentGroup"]; |
| 1177 } |
| 1178 if (_json.containsKey("subjectToGovernmentApproval")) { |
| 1179 subjectToGovernmentApproval = _json["subjectToGovernmentApproval"]; |
| 1180 } |
| 1181 } |
| 1182 |
| 1183 core.Map toJson() { |
| 1184 var _json = new core.Map(); |
| 1185 if (bookingCode != null) { |
| 1186 _json["bookingCode"] = bookingCode; |
| 1187 } |
| 1188 if (bookingCodeCount != null) { |
| 1189 _json["bookingCodeCount"] = bookingCodeCount; |
| 1190 } |
| 1191 if (cabin != null) { |
| 1192 _json["cabin"] = cabin; |
| 1193 } |
| 1194 if (connectionDuration != null) { |
| 1195 _json["connectionDuration"] = connectionDuration; |
| 1196 } |
| 1197 if (duration != null) { |
| 1198 _json["duration"] = duration; |
| 1199 } |
| 1200 if (flight != null) { |
| 1201 _json["flight"] = (flight).toJson(); |
| 1202 } |
| 1203 if (id != null) { |
| 1204 _json["id"] = id; |
| 1205 } |
| 1206 if (kind != null) { |
| 1207 _json["kind"] = kind; |
| 1208 } |
| 1209 if (leg != null) { |
| 1210 _json["leg"] = leg.map((value) => (value).toJson()).toList(); |
| 1211 } |
| 1212 if (marriedSegmentGroup != null) { |
| 1213 _json["marriedSegmentGroup"] = marriedSegmentGroup; |
| 1214 } |
| 1215 if (subjectToGovernmentApproval != null) { |
| 1216 _json["subjectToGovernmentApproval"] = subjectToGovernmentApproval; |
| 1217 } |
| 1218 return _json; |
| 1219 } |
| 1220 } |
| 1221 |
| 1222 |
| 1223 /** The price of this segment. */ |
| 1224 class SegmentPricing { |
| 1225 /** |
| 1226 * A segment identifier unique within a single solution. It is used to refer |
| 1227 * to different parts of the same solution. |
| 1228 */ |
| 1229 core.String fareId; |
| 1230 |
| 1231 /** Details of the free baggage allowance on this segment. */ |
| 1232 core.List<FreeBaggageAllowance> freeBaggageOption; |
| 1233 |
| 1234 /** |
| 1235 * Identifies this as a segment pricing object, representing the price of this |
| 1236 * segment. Value: the fixed string qpxexpress#segmentPricing. |
| 1237 */ |
| 1238 core.String kind; |
| 1239 |
| 1240 /** Unique identifier in the response of this segment. */ |
| 1241 core.String segmentId; |
| 1242 |
| 1243 |
| 1244 SegmentPricing(); |
| 1245 |
| 1246 SegmentPricing.fromJson(core.Map _json) { |
| 1247 if (_json.containsKey("fareId")) { |
| 1248 fareId = _json["fareId"]; |
| 1249 } |
| 1250 if (_json.containsKey("freeBaggageOption")) { |
| 1251 freeBaggageOption = _json["freeBaggageOption"].map((value) => new FreeBagg
ageAllowance.fromJson(value)).toList(); |
| 1252 } |
| 1253 if (_json.containsKey("kind")) { |
| 1254 kind = _json["kind"]; |
| 1255 } |
| 1256 if (_json.containsKey("segmentId")) { |
| 1257 segmentId = _json["segmentId"]; |
| 1258 } |
| 1259 } |
| 1260 |
| 1261 core.Map toJson() { |
| 1262 var _json = new core.Map(); |
| 1263 if (fareId != null) { |
| 1264 _json["fareId"] = fareId; |
| 1265 } |
| 1266 if (freeBaggageOption != null) { |
| 1267 _json["freeBaggageOption"] = freeBaggageOption.map((value) => (value).toJs
on()).toList(); |
| 1268 } |
| 1269 if (kind != null) { |
| 1270 _json["kind"] = kind; |
| 1271 } |
| 1272 if (segmentId != null) { |
| 1273 _json["segmentId"] = segmentId; |
| 1274 } |
| 1275 return _json; |
| 1276 } |
| 1277 } |
| 1278 |
| 1279 |
| 1280 /** |
| 1281 * Information about a slice. A slice represents a traveller's intent, the |
| 1282 * portion of a low-fare search corresponding to a traveler's request to get |
| 1283 * between two points. One-way journeys are generally expressed using 1 slice, |
| 1284 * round-trips using 2. For example, if a traveler specifies the following trip |
| 1285 * in a user interface: |
| 1286 * | Origin | Destination | Departure Date | | BOS | LAX | March 10, 2007 | | |
| 1287 * LAX | SYD | March 17, 2007 | | SYD | BOS | March 22, 2007 | |
| 1288 * then this is a three slice trip. |
| 1289 */ |
| 1290 class SliceInfo { |
| 1291 /** The duration of the slice in minutes. */ |
| 1292 core.int duration; |
| 1293 |
| 1294 /** |
| 1295 * Identifies this as a slice object. A slice represents a traveller's intent, |
| 1296 * the portion of a low-fare search corresponding to a traveler's request to |
| 1297 * get between two points. One-way journeys are generally expressed using 1 |
| 1298 * slice, round-trips using 2. Value: the fixed string qpxexpress#sliceInfo. |
| 1299 */ |
| 1300 core.String kind; |
| 1301 |
| 1302 /** The segment(s) constituting the slice. */ |
| 1303 core.List<SegmentInfo> segment; |
| 1304 |
| 1305 |
| 1306 SliceInfo(); |
| 1307 |
| 1308 SliceInfo.fromJson(core.Map _json) { |
| 1309 if (_json.containsKey("duration")) { |
| 1310 duration = _json["duration"]; |
| 1311 } |
| 1312 if (_json.containsKey("kind")) { |
| 1313 kind = _json["kind"]; |
| 1314 } |
| 1315 if (_json.containsKey("segment")) { |
| 1316 segment = _json["segment"].map((value) => new SegmentInfo.fromJson(value))
.toList(); |
| 1317 } |
| 1318 } |
| 1319 |
| 1320 core.Map toJson() { |
| 1321 var _json = new core.Map(); |
| 1322 if (duration != null) { |
| 1323 _json["duration"] = duration; |
| 1324 } |
| 1325 if (kind != null) { |
| 1326 _json["kind"] = kind; |
| 1327 } |
| 1328 if (segment != null) { |
| 1329 _json["segment"] = segment.map((value) => (value).toJson()).toList(); |
| 1330 } |
| 1331 return _json; |
| 1332 } |
| 1333 } |
| 1334 |
| 1335 |
| 1336 /** Criteria a desired slice must satisfy. */ |
| 1337 class SliceInput { |
| 1338 /** |
| 1339 * Slices with only the carriers in this alliance should be returned; do not |
| 1340 * use this field with permittedCarrier. Allowed values are ONEWORLD, SKYTEAM, |
| 1341 * and STAR. |
| 1342 */ |
| 1343 core.String alliance; |
| 1344 |
| 1345 /** Departure date in YYYY-MM-DD format. */ |
| 1346 core.String date; |
| 1347 |
| 1348 /** Airport or city IATA designator of the destination. */ |
| 1349 core.String destination; |
| 1350 |
| 1351 /** |
| 1352 * Identifies this as a slice input object, representing the criteria a |
| 1353 * desired slice must satisfy. Value: the fixed string qpxexpress#sliceInput. |
| 1354 */ |
| 1355 core.String kind; |
| 1356 |
| 1357 /** |
| 1358 * The longest connection between two legs, in minutes, you are willing to |
| 1359 * accept. |
| 1360 */ |
| 1361 core.int maxConnectionDuration; |
| 1362 |
| 1363 /** The maximum number of stops you are willing to accept in this slice. */ |
| 1364 core.int maxStops; |
| 1365 |
| 1366 /** Airport or city IATA designator of the origin. */ |
| 1367 core.String origin; |
| 1368 |
| 1369 /** |
| 1370 * A list of 2-letter IATA airline designators. Slices with only these |
| 1371 * carriers should be returned. |
| 1372 */ |
| 1373 core.List<core.String> permittedCarrier; |
| 1374 |
| 1375 /** |
| 1376 * Slices must depart in this time of day range, local to the point of |
| 1377 * departure. |
| 1378 */ |
| 1379 TimeOfDayRange permittedDepartureTime; |
| 1380 |
| 1381 /** |
| 1382 * Prefer solutions that book in this cabin for this slice. Allowed values are |
| 1383 * COACH, PREMIUM_COACH, BUSINESS, and FIRST. |
| 1384 */ |
| 1385 core.String preferredCabin; |
| 1386 |
| 1387 /** |
| 1388 * A list of 2-letter IATA airline designators. Exclude slices that use these |
| 1389 * carriers. |
| 1390 */ |
| 1391 core.List<core.String> prohibitedCarrier; |
| 1392 |
| 1393 |
| 1394 SliceInput(); |
| 1395 |
| 1396 SliceInput.fromJson(core.Map _json) { |
| 1397 if (_json.containsKey("alliance")) { |
| 1398 alliance = _json["alliance"]; |
| 1399 } |
| 1400 if (_json.containsKey("date")) { |
| 1401 date = _json["date"]; |
| 1402 } |
| 1403 if (_json.containsKey("destination")) { |
| 1404 destination = _json["destination"]; |
| 1405 } |
| 1406 if (_json.containsKey("kind")) { |
| 1407 kind = _json["kind"]; |
| 1408 } |
| 1409 if (_json.containsKey("maxConnectionDuration")) { |
| 1410 maxConnectionDuration = _json["maxConnectionDuration"]; |
| 1411 } |
| 1412 if (_json.containsKey("maxStops")) { |
| 1413 maxStops = _json["maxStops"]; |
| 1414 } |
| 1415 if (_json.containsKey("origin")) { |
| 1416 origin = _json["origin"]; |
| 1417 } |
| 1418 if (_json.containsKey("permittedCarrier")) { |
| 1419 permittedCarrier = _json["permittedCarrier"]; |
| 1420 } |
| 1421 if (_json.containsKey("permittedDepartureTime")) { |
| 1422 permittedDepartureTime = new TimeOfDayRange.fromJson(_json["permittedDepar
tureTime"]); |
| 1423 } |
| 1424 if (_json.containsKey("preferredCabin")) { |
| 1425 preferredCabin = _json["preferredCabin"]; |
| 1426 } |
| 1427 if (_json.containsKey("prohibitedCarrier")) { |
| 1428 prohibitedCarrier = _json["prohibitedCarrier"]; |
| 1429 } |
| 1430 } |
| 1431 |
| 1432 core.Map toJson() { |
| 1433 var _json = new core.Map(); |
| 1434 if (alliance != null) { |
| 1435 _json["alliance"] = alliance; |
| 1436 } |
| 1437 if (date != null) { |
| 1438 _json["date"] = date; |
| 1439 } |
| 1440 if (destination != null) { |
| 1441 _json["destination"] = destination; |
| 1442 } |
| 1443 if (kind != null) { |
| 1444 _json["kind"] = kind; |
| 1445 } |
| 1446 if (maxConnectionDuration != null) { |
| 1447 _json["maxConnectionDuration"] = maxConnectionDuration; |
| 1448 } |
| 1449 if (maxStops != null) { |
| 1450 _json["maxStops"] = maxStops; |
| 1451 } |
| 1452 if (origin != null) { |
| 1453 _json["origin"] = origin; |
| 1454 } |
| 1455 if (permittedCarrier != null) { |
| 1456 _json["permittedCarrier"] = permittedCarrier; |
| 1457 } |
| 1458 if (permittedDepartureTime != null) { |
| 1459 _json["permittedDepartureTime"] = (permittedDepartureTime).toJson(); |
| 1460 } |
| 1461 if (preferredCabin != null) { |
| 1462 _json["preferredCabin"] = preferredCabin; |
| 1463 } |
| 1464 if (prohibitedCarrier != null) { |
| 1465 _json["prohibitedCarrier"] = prohibitedCarrier; |
| 1466 } |
| 1467 return _json; |
| 1468 } |
| 1469 } |
| 1470 |
| 1471 |
| 1472 /** Tax data. */ |
| 1473 class TaxData { |
| 1474 /** An identifier uniquely identifying a tax in a response. */ |
| 1475 core.String id; |
| 1476 |
| 1477 /** |
| 1478 * Identifies this as a tax data object, representing some tax. Value: the |
| 1479 * fixed string qpxexpress#taxData. |
| 1480 */ |
| 1481 core.String kind; |
| 1482 |
| 1483 /** The name of a tax. */ |
| 1484 core.String name; |
| 1485 |
| 1486 |
| 1487 TaxData(); |
| 1488 |
| 1489 TaxData.fromJson(core.Map _json) { |
| 1490 if (_json.containsKey("id")) { |
| 1491 id = _json["id"]; |
| 1492 } |
| 1493 if (_json.containsKey("kind")) { |
| 1494 kind = _json["kind"]; |
| 1495 } |
| 1496 if (_json.containsKey("name")) { |
| 1497 name = _json["name"]; |
| 1498 } |
| 1499 } |
| 1500 |
| 1501 core.Map toJson() { |
| 1502 var _json = new core.Map(); |
| 1503 if (id != null) { |
| 1504 _json["id"] = id; |
| 1505 } |
| 1506 if (kind != null) { |
| 1507 _json["kind"] = kind; |
| 1508 } |
| 1509 if (name != null) { |
| 1510 _json["name"] = name; |
| 1511 } |
| 1512 return _json; |
| 1513 } |
| 1514 } |
| 1515 |
| 1516 |
| 1517 /** Tax information. */ |
| 1518 class TaxInfo { |
| 1519 /** Whether this is a government charge or a carrier surcharge. */ |
| 1520 core.String chargeType; |
| 1521 |
| 1522 /** The code to enter in the ticket's tax box. */ |
| 1523 core.String code; |
| 1524 |
| 1525 /** For government charges, the country levying the charge. */ |
| 1526 core.String country; |
| 1527 |
| 1528 /** |
| 1529 * Identifier uniquely identifying this tax in a response. Not present for |
| 1530 * unnamed carrier surcharges. |
| 1531 */ |
| 1532 core.String id; |
| 1533 |
| 1534 /** |
| 1535 * Identifies this as a tax information object. Value: the fixed string |
| 1536 * qpxexpress#taxInfo. |
| 1537 */ |
| 1538 core.String kind; |
| 1539 |
| 1540 /** The price of the tax in the sales or equivalent currency. */ |
| 1541 core.String salePrice; |
| 1542 |
| 1543 |
| 1544 TaxInfo(); |
| 1545 |
| 1546 TaxInfo.fromJson(core.Map _json) { |
| 1547 if (_json.containsKey("chargeType")) { |
| 1548 chargeType = _json["chargeType"]; |
| 1549 } |
| 1550 if (_json.containsKey("code")) { |
| 1551 code = _json["code"]; |
| 1552 } |
| 1553 if (_json.containsKey("country")) { |
| 1554 country = _json["country"]; |
| 1555 } |
| 1556 if (_json.containsKey("id")) { |
| 1557 id = _json["id"]; |
| 1558 } |
| 1559 if (_json.containsKey("kind")) { |
| 1560 kind = _json["kind"]; |
| 1561 } |
| 1562 if (_json.containsKey("salePrice")) { |
| 1563 salePrice = _json["salePrice"]; |
| 1564 } |
| 1565 } |
| 1566 |
| 1567 core.Map toJson() { |
| 1568 var _json = new core.Map(); |
| 1569 if (chargeType != null) { |
| 1570 _json["chargeType"] = chargeType; |
| 1571 } |
| 1572 if (code != null) { |
| 1573 _json["code"] = code; |
| 1574 } |
| 1575 if (country != null) { |
| 1576 _json["country"] = country; |
| 1577 } |
| 1578 if (id != null) { |
| 1579 _json["id"] = id; |
| 1580 } |
| 1581 if (kind != null) { |
| 1582 _json["kind"] = kind; |
| 1583 } |
| 1584 if (salePrice != null) { |
| 1585 _json["salePrice"] = salePrice; |
| 1586 } |
| 1587 return _json; |
| 1588 } |
| 1589 } |
| 1590 |
| 1591 |
| 1592 /** Two times in a single day defining a time range. */ |
| 1593 class TimeOfDayRange { |
| 1594 /** The earliest time of day in HH:MM format. */ |
| 1595 core.String earliestTime; |
| 1596 |
| 1597 /** |
| 1598 * Identifies this as a time of day range object, representing two times in a |
| 1599 * single day defining a time range. Value: the fixed string |
| 1600 * qpxexpress#timeOfDayRange. |
| 1601 */ |
| 1602 core.String kind; |
| 1603 |
| 1604 /** The latest time of day in HH:MM format. */ |
| 1605 core.String latestTime; |
| 1606 |
| 1607 |
| 1608 TimeOfDayRange(); |
| 1609 |
| 1610 TimeOfDayRange.fromJson(core.Map _json) { |
| 1611 if (_json.containsKey("earliestTime")) { |
| 1612 earliestTime = _json["earliestTime"]; |
| 1613 } |
| 1614 if (_json.containsKey("kind")) { |
| 1615 kind = _json["kind"]; |
| 1616 } |
| 1617 if (_json.containsKey("latestTime")) { |
| 1618 latestTime = _json["latestTime"]; |
| 1619 } |
| 1620 } |
| 1621 |
| 1622 core.Map toJson() { |
| 1623 var _json = new core.Map(); |
| 1624 if (earliestTime != null) { |
| 1625 _json["earliestTime"] = earliestTime; |
| 1626 } |
| 1627 if (kind != null) { |
| 1628 _json["kind"] = kind; |
| 1629 } |
| 1630 if (latestTime != null) { |
| 1631 _json["latestTime"] = latestTime; |
| 1632 } |
| 1633 return _json; |
| 1634 } |
| 1635 } |
| 1636 |
| 1637 |
| 1638 /** Trip information. */ |
| 1639 class TripOption { |
| 1640 /** Identifier uniquely identifying this trip in a response. */ |
| 1641 core.String id; |
| 1642 |
| 1643 /** |
| 1644 * Identifies this as a trip information object. Value: the fixed string |
| 1645 * qpxexpress#tripOption. |
| 1646 */ |
| 1647 core.String kind; |
| 1648 |
| 1649 /** Per passenger pricing information. */ |
| 1650 core.List<PricingInfo> pricing; |
| 1651 |
| 1652 /** |
| 1653 * The total price for all passengers on the trip, in the form of a currency |
| 1654 * followed by an amount, e.g. USD253.35. |
| 1655 */ |
| 1656 core.String saleTotal; |
| 1657 |
| 1658 /** The slices that make up this trip's itinerary. */ |
| 1659 core.List<SliceInfo> slice; |
| 1660 |
| 1661 |
| 1662 TripOption(); |
| 1663 |
| 1664 TripOption.fromJson(core.Map _json) { |
| 1665 if (_json.containsKey("id")) { |
| 1666 id = _json["id"]; |
| 1667 } |
| 1668 if (_json.containsKey("kind")) { |
| 1669 kind = _json["kind"]; |
| 1670 } |
| 1671 if (_json.containsKey("pricing")) { |
| 1672 pricing = _json["pricing"].map((value) => new PricingInfo.fromJson(value))
.toList(); |
| 1673 } |
| 1674 if (_json.containsKey("saleTotal")) { |
| 1675 saleTotal = _json["saleTotal"]; |
| 1676 } |
| 1677 if (_json.containsKey("slice")) { |
| 1678 slice = _json["slice"].map((value) => new SliceInfo.fromJson(value)).toLis
t(); |
| 1679 } |
| 1680 } |
| 1681 |
| 1682 core.Map toJson() { |
| 1683 var _json = new core.Map(); |
| 1684 if (id != null) { |
| 1685 _json["id"] = id; |
| 1686 } |
| 1687 if (kind != null) { |
| 1688 _json["kind"] = kind; |
| 1689 } |
| 1690 if (pricing != null) { |
| 1691 _json["pricing"] = pricing.map((value) => (value).toJson()).toList(); |
| 1692 } |
| 1693 if (saleTotal != null) { |
| 1694 _json["saleTotal"] = saleTotal; |
| 1695 } |
| 1696 if (slice != null) { |
| 1697 _json["slice"] = slice.map((value) => (value).toJson()).toList(); |
| 1698 } |
| 1699 return _json; |
| 1700 } |
| 1701 } |
| 1702 |
| 1703 |
| 1704 /** A QPX Express search request, which will yield one or more solutions. */ |
| 1705 class TripOptionsRequest { |
| 1706 /** |
| 1707 * Do not return solutions that cost more than this price. The alphabetical |
| 1708 * part of the price is in ISO 4217. The format, in regex, is |
| 1709 * [A-Z]{3}\d+(\.\d+)? Example: $102.07 |
| 1710 */ |
| 1711 core.String maxPrice; |
| 1712 |
| 1713 /** Counts for each passenger type in the request. */ |
| 1714 PassengerCounts passengers; |
| 1715 |
| 1716 /** Return only solutions with refundable fares. */ |
| 1717 core.bool refundable; |
| 1718 |
| 1719 /** |
| 1720 * IATA country code representing the point of sale. This determines the |
| 1721 * "equivalent amount paid" currency for the ticket. |
| 1722 */ |
| 1723 core.String saleCountry; |
| 1724 |
| 1725 /** |
| 1726 * The slices that make up the itinerary of this trip. A slice represents a |
| 1727 * traveler's intent, the portion of a low-fare search corresponding to a |
| 1728 * traveler's request to get between two points. One-way journeys are |
| 1729 * generally expressed using one slice, round-trips using two. An example of a |
| 1730 * one slice trip with three segments might be BOS-SYD, SYD-LAX, LAX-BOS if |
| 1731 * the traveler only stopped in SYD and LAX just long enough to change planes. |
| 1732 */ |
| 1733 core.List<SliceInput> slice; |
| 1734 |
| 1735 /** The number of solutions to return, maximum 500. */ |
| 1736 core.int solutions; |
| 1737 |
| 1738 |
| 1739 TripOptionsRequest(); |
| 1740 |
| 1741 TripOptionsRequest.fromJson(core.Map _json) { |
| 1742 if (_json.containsKey("maxPrice")) { |
| 1743 maxPrice = _json["maxPrice"]; |
| 1744 } |
| 1745 if (_json.containsKey("passengers")) { |
| 1746 passengers = new PassengerCounts.fromJson(_json["passengers"]); |
| 1747 } |
| 1748 if (_json.containsKey("refundable")) { |
| 1749 refundable = _json["refundable"]; |
| 1750 } |
| 1751 if (_json.containsKey("saleCountry")) { |
| 1752 saleCountry = _json["saleCountry"]; |
| 1753 } |
| 1754 if (_json.containsKey("slice")) { |
| 1755 slice = _json["slice"].map((value) => new SliceInput.fromJson(value)).toLi
st(); |
| 1756 } |
| 1757 if (_json.containsKey("solutions")) { |
| 1758 solutions = _json["solutions"]; |
| 1759 } |
| 1760 } |
| 1761 |
| 1762 core.Map toJson() { |
| 1763 var _json = new core.Map(); |
| 1764 if (maxPrice != null) { |
| 1765 _json["maxPrice"] = maxPrice; |
| 1766 } |
| 1767 if (passengers != null) { |
| 1768 _json["passengers"] = (passengers).toJson(); |
| 1769 } |
| 1770 if (refundable != null) { |
| 1771 _json["refundable"] = refundable; |
| 1772 } |
| 1773 if (saleCountry != null) { |
| 1774 _json["saleCountry"] = saleCountry; |
| 1775 } |
| 1776 if (slice != null) { |
| 1777 _json["slice"] = slice.map((value) => (value).toJson()).toList(); |
| 1778 } |
| 1779 if (solutions != null) { |
| 1780 _json["solutions"] = solutions; |
| 1781 } |
| 1782 return _json; |
| 1783 } |
| 1784 } |
| 1785 |
| 1786 |
| 1787 /** A QPX Express search response. */ |
| 1788 class TripOptionsResponse { |
| 1789 /** Informational data global to list of solutions. */ |
| 1790 Data data; |
| 1791 |
| 1792 /** |
| 1793 * Identifies this as a QPX Express trip response object, which consists of |
| 1794 * zero or more solutions. Value: the fixed string qpxexpress#tripOptions. |
| 1795 */ |
| 1796 core.String kind; |
| 1797 |
| 1798 /** An identifier uniquely identifying this response. */ |
| 1799 core.String requestId; |
| 1800 |
| 1801 /** A list of priced itinerary solutions to the QPX Express query. */ |
| 1802 core.List<TripOption> tripOption; |
| 1803 |
| 1804 |
| 1805 TripOptionsResponse(); |
| 1806 |
| 1807 TripOptionsResponse.fromJson(core.Map _json) { |
| 1808 if (_json.containsKey("data")) { |
| 1809 data = new Data.fromJson(_json["data"]); |
| 1810 } |
| 1811 if (_json.containsKey("kind")) { |
| 1812 kind = _json["kind"]; |
| 1813 } |
| 1814 if (_json.containsKey("requestId")) { |
| 1815 requestId = _json["requestId"]; |
| 1816 } |
| 1817 if (_json.containsKey("tripOption")) { |
| 1818 tripOption = _json["tripOption"].map((value) => new TripOption.fromJson(va
lue)).toList(); |
| 1819 } |
| 1820 } |
| 1821 |
| 1822 core.Map toJson() { |
| 1823 var _json = new core.Map(); |
| 1824 if (data != null) { |
| 1825 _json["data"] = (data).toJson(); |
| 1826 } |
| 1827 if (kind != null) { |
| 1828 _json["kind"] = kind; |
| 1829 } |
| 1830 if (requestId != null) { |
| 1831 _json["requestId"] = requestId; |
| 1832 } |
| 1833 if (tripOption != null) { |
| 1834 _json["tripOption"] = tripOption.map((value) => (value).toJson()).toList()
; |
| 1835 } |
| 1836 return _json; |
| 1837 } |
| 1838 } |
| 1839 |
| 1840 |
| 1841 /** A QPX Express search request. */ |
| 1842 class TripsSearchRequest { |
| 1843 /** |
| 1844 * A QPX Express search request. Required values are at least one adult or |
| 1845 * senior passenger, an origin, a destination, and a date. |
| 1846 */ |
| 1847 TripOptionsRequest request; |
| 1848 |
| 1849 |
| 1850 TripsSearchRequest(); |
| 1851 |
| 1852 TripsSearchRequest.fromJson(core.Map _json) { |
| 1853 if (_json.containsKey("request")) { |
| 1854 request = new TripOptionsRequest.fromJson(_json["request"]); |
| 1855 } |
| 1856 } |
| 1857 |
| 1858 core.Map toJson() { |
| 1859 var _json = new core.Map(); |
| 1860 if (request != null) { |
| 1861 _json["request"] = (request).toJson(); |
| 1862 } |
| 1863 return _json; |
| 1864 } |
| 1865 } |
| 1866 |
| 1867 |
| 1868 /** A QPX Express search response. */ |
| 1869 class TripsSearchResponse { |
| 1870 /** |
| 1871 * Identifies this as a QPX Express API search response resource. Value: the |
| 1872 * fixed string qpxExpress#tripsSearch. |
| 1873 */ |
| 1874 core.String kind; |
| 1875 |
| 1876 /** All possible solutions to the QPX Express search request. */ |
| 1877 TripOptionsResponse trips; |
| 1878 |
| 1879 |
| 1880 TripsSearchResponse(); |
| 1881 |
| 1882 TripsSearchResponse.fromJson(core.Map _json) { |
| 1883 if (_json.containsKey("kind")) { |
| 1884 kind = _json["kind"]; |
| 1885 } |
| 1886 if (_json.containsKey("trips")) { |
| 1887 trips = new TripOptionsResponse.fromJson(_json["trips"]); |
| 1888 } |
| 1889 } |
| 1890 |
| 1891 core.Map toJson() { |
| 1892 var _json = new core.Map(); |
| 1893 if (kind != null) { |
| 1894 _json["kind"] = kind; |
| 1895 } |
| 1896 if (trips != null) { |
| 1897 _json["trips"] = (trips).toJson(); |
| 1898 } |
| 1899 return _json; |
| 1900 } |
| 1901 } |
| 1902 |
| 1903 |
OLD | NEW |