1unit googleqpxExpress; 2{$MODE objfpc} 3{$H+} 4 5interface 6 7uses sysutils, classes, googleservice, restbase, googlebase; 8 9type 10 11 //Top-level schema types 12 TAircraftData = Class; 13 TAirportData = Class; 14 TBagDescriptor = Class; 15 TCarrierData = Class; 16 TCityData = Class; 17 TData = Class; 18 TFareInfo = Class; 19 TFlightInfo = Class; 20 TFreeBaggageAllowance = Class; 21 TLegInfo = Class; 22 TPassengerCounts = Class; 23 TPricingInfo = Class; 24 TSegmentInfo = Class; 25 TSegmentPricing = Class; 26 TSliceInfo = Class; 27 TSliceInput = Class; 28 TTaxData = Class; 29 TTaxInfo = Class; 30 TTimeOfDayRange = Class; 31 TTripOption = Class; 32 TTripOptionsRequest = Class; 33 TTripOptionsResponse = Class; 34 TTripsSearchRequest = Class; 35 TTripsSearchResponse = Class; 36 TAircraftDataArray = Array of TAircraftData; 37 TAirportDataArray = Array of TAirportData; 38 TBagDescriptorArray = Array of TBagDescriptor; 39 TCarrierDataArray = Array of TCarrierData; 40 TCityDataArray = Array of TCityData; 41 TDataArray = Array of TData; 42 TFareInfoArray = Array of TFareInfo; 43 TFlightInfoArray = Array of TFlightInfo; 44 TFreeBaggageAllowanceArray = Array of TFreeBaggageAllowance; 45 TLegInfoArray = Array of TLegInfo; 46 TPassengerCountsArray = Array of TPassengerCounts; 47 TPricingInfoArray = Array of TPricingInfo; 48 TSegmentInfoArray = Array of TSegmentInfo; 49 TSegmentPricingArray = Array of TSegmentPricing; 50 TSliceInfoArray = Array of TSliceInfo; 51 TSliceInputArray = Array of TSliceInput; 52 TTaxDataArray = Array of TTaxData; 53 TTaxInfoArray = Array of TTaxInfo; 54 TTimeOfDayRangeArray = Array of TTimeOfDayRange; 55 TTripOptionArray = Array of TTripOption; 56 TTripOptionsRequestArray = Array of TTripOptionsRequest; 57 TTripOptionsResponseArray = Array of TTripOptionsResponse; 58 TTripsSearchRequestArray = Array of TTripsSearchRequest; 59 TTripsSearchResponseArray = Array of TTripsSearchResponse; 60 //Anonymous types, using auto-generated names 61 TDataTypeaircraftArray = Array of TAircraftData; 62 TDataTypeairportArray = Array of TAirportData; 63 TDataTypecarrierArray = Array of TCarrierData; 64 TDataTypecityArray = Array of TCityData; 65 TDataTypetaxArray = Array of TTaxData; 66 TFreeBaggageAllowanceTypebagDescriptorArray = Array of TBagDescriptor; 67 TPricingInfoTypefareArray = Array of TFareInfo; 68 TPricingInfoTypesegmentPricingArray = Array of TSegmentPricing; 69 TPricingInfoTypetaxArray = Array of TTaxInfo; 70 TSegmentInfoTypelegArray = Array of TLegInfo; 71 TSegmentPricingTypefreeBaggageOptionArray = Array of TFreeBaggageAllowance; 72 TSliceInfoTypesegmentArray = Array of TSegmentInfo; 73 TTripOptionTypepricingArray = Array of TPricingInfo; 74 TTripOptionTypesliceArray = Array of TSliceInfo; 75 TTripOptionsRequestTypesliceArray = Array of TSliceInput; 76 TTripOptionsResponseTypetripOptionArray = Array of TTripOption; 77 78 { -------------------------------------------------------------------- 79 TAircraftData 80 --------------------------------------------------------------------} 81 82 TAircraftData = Class(TGoogleBaseObject) 83 Private 84 Fcode : String; 85 Fkind : String; 86 Fname : String; 87 Protected 88 //Property setters 89 Procedure Setcode(AIndex : Integer; const AValue : String); virtual; 90 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 91 Procedure Setname(AIndex : Integer; const AValue : String); virtual; 92 Public 93 Published 94 Property code : String Index 0 Read Fcode Write Setcode; 95 Property kind : String Index 8 Read Fkind Write Setkind; 96 Property name : String Index 16 Read Fname Write Setname; 97 end; 98 TAircraftDataClass = Class of TAircraftData; 99 100 { -------------------------------------------------------------------- 101 TAirportData 102 --------------------------------------------------------------------} 103 104 TAirportData = Class(TGoogleBaseObject) 105 Private 106 Fcity : String; 107 Fcode : String; 108 Fkind : String; 109 Fname : String; 110 Protected 111 //Property setters 112 Procedure Setcity(AIndex : Integer; const AValue : String); virtual; 113 Procedure Setcode(AIndex : Integer; const AValue : String); virtual; 114 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 115 Procedure Setname(AIndex : Integer; const AValue : String); virtual; 116 Public 117 Published 118 Property city : String Index 0 Read Fcity Write Setcity; 119 Property code : String Index 8 Read Fcode Write Setcode; 120 Property kind : String Index 16 Read Fkind Write Setkind; 121 Property name : String Index 24 Read Fname Write Setname; 122 end; 123 TAirportDataClass = Class of TAirportData; 124 125 { -------------------------------------------------------------------- 126 TBagDescriptor 127 --------------------------------------------------------------------} 128 129 TBagDescriptor = Class(TGoogleBaseObject) 130 Private 131 FcommercialName : String; 132 Fcount : integer; 133 Fdescription : TStringArray; 134 Fkind : String; 135 Fsubcode : String; 136 Protected 137 //Property setters 138 Procedure SetcommercialName(AIndex : Integer; const AValue : String); virtual; 139 Procedure Setcount(AIndex : Integer; const AValue : integer); virtual; 140 Procedure Setdescription(AIndex : Integer; const AValue : TStringArray); virtual; 141 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 142 Procedure Setsubcode(AIndex : Integer; const AValue : String); virtual; 143 //2.6.4. bug workaround 144 {$IFDEF VER2_6} 145 Procedure SetArrayLength(Const AName : String; ALength : Longint); override; 146 {$ENDIF VER2_6} 147 Public 148 Published 149 Property commercialName : String Index 0 Read FcommercialName Write SetcommercialName; 150 Property count : integer Index 8 Read Fcount Write Setcount; 151 Property description : TStringArray Index 16 Read Fdescription Write Setdescription; 152 Property kind : String Index 24 Read Fkind Write Setkind; 153 Property subcode : String Index 32 Read Fsubcode Write Setsubcode; 154 end; 155 TBagDescriptorClass = Class of TBagDescriptor; 156 157 { -------------------------------------------------------------------- 158 TCarrierData 159 --------------------------------------------------------------------} 160 161 TCarrierData = Class(TGoogleBaseObject) 162 Private 163 Fcode : String; 164 Fkind : String; 165 Fname : String; 166 Protected 167 //Property setters 168 Procedure Setcode(AIndex : Integer; const AValue : String); virtual; 169 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 170 Procedure Setname(AIndex : Integer; const AValue : String); virtual; 171 Public 172 Published 173 Property code : String Index 0 Read Fcode Write Setcode; 174 Property kind : String Index 8 Read Fkind Write Setkind; 175 Property name : String Index 16 Read Fname Write Setname; 176 end; 177 TCarrierDataClass = Class of TCarrierData; 178 179 { -------------------------------------------------------------------- 180 TCityData 181 --------------------------------------------------------------------} 182 183 TCityData = Class(TGoogleBaseObject) 184 Private 185 Fcode : String; 186 Fcountry : String; 187 Fkind : String; 188 Fname : String; 189 Protected 190 //Property setters 191 Procedure Setcode(AIndex : Integer; const AValue : String); virtual; 192 Procedure Setcountry(AIndex : Integer; const AValue : String); virtual; 193 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 194 Procedure Setname(AIndex : Integer; const AValue : String); virtual; 195 Public 196 Published 197 Property code : String Index 0 Read Fcode Write Setcode; 198 Property country : String Index 8 Read Fcountry Write Setcountry; 199 Property kind : String Index 16 Read Fkind Write Setkind; 200 Property name : String Index 24 Read Fname Write Setname; 201 end; 202 TCityDataClass = Class of TCityData; 203 204 { -------------------------------------------------------------------- 205 TData 206 --------------------------------------------------------------------} 207 208 TData = Class(TGoogleBaseObject) 209 Private 210 Faircraft : TDataTypeaircraftArray; 211 Fairport : TDataTypeairportArray; 212 Fcarrier : TDataTypecarrierArray; 213 Fcity : TDataTypecityArray; 214 Fkind : String; 215 Ftax : TDataTypetaxArray; 216 Protected 217 //Property setters 218 Procedure Setaircraft(AIndex : Integer; const AValue : TDataTypeaircraftArray); virtual; 219 Procedure Setairport(AIndex : Integer; const AValue : TDataTypeairportArray); virtual; 220 Procedure Setcarrier(AIndex : Integer; const AValue : TDataTypecarrierArray); virtual; 221 Procedure Setcity(AIndex : Integer; const AValue : TDataTypecityArray); virtual; 222 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 223 Procedure Settax(AIndex : Integer; const AValue : TDataTypetaxArray); virtual; 224 //2.6.4. bug workaround 225 {$IFDEF VER2_6} 226 Procedure SetArrayLength(Const AName : String; ALength : Longint); override; 227 {$ENDIF VER2_6} 228 Public 229 Published 230 Property aircraft : TDataTypeaircraftArray Index 0 Read Faircraft Write Setaircraft; 231 Property airport : TDataTypeairportArray Index 8 Read Fairport Write Setairport; 232 Property carrier : TDataTypecarrierArray Index 16 Read Fcarrier Write Setcarrier; 233 Property city : TDataTypecityArray Index 24 Read Fcity Write Setcity; 234 Property kind : String Index 32 Read Fkind Write Setkind; 235 Property tax : TDataTypetaxArray Index 40 Read Ftax Write Settax; 236 end; 237 TDataClass = Class of TData; 238 239 { -------------------------------------------------------------------- 240 TFareInfo 241 --------------------------------------------------------------------} 242 243 TFareInfo = Class(TGoogleBaseObject) 244 Private 245 FbasisCode : String; 246 Fcarrier : String; 247 Fdestination : String; 248 Fid : String; 249 Fkind : String; 250 Forigin : String; 251 F_private : boolean; 252 Protected 253 Class Function ExportPropertyName(Const AName : String) : string; override; 254 //Property setters 255 Procedure SetbasisCode(AIndex : Integer; const AValue : String); virtual; 256 Procedure Setcarrier(AIndex : Integer; const AValue : String); virtual; 257 Procedure Setdestination(AIndex : Integer; const AValue : String); virtual; 258 Procedure Setid(AIndex : Integer; const AValue : String); virtual; 259 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 260 Procedure Setorigin(AIndex : Integer; const AValue : String); virtual; 261 Procedure Set_private(AIndex : Integer; const AValue : boolean); virtual; 262 Public 263 Published 264 Property basisCode : String Index 0 Read FbasisCode Write SetbasisCode; 265 Property carrier : String Index 8 Read Fcarrier Write Setcarrier; 266 Property destination : String Index 16 Read Fdestination Write Setdestination; 267 Property id : String Index 24 Read Fid Write Setid; 268 Property kind : String Index 32 Read Fkind Write Setkind; 269 Property origin : String Index 40 Read Forigin Write Setorigin; 270 Property _private : boolean Index 48 Read F_private Write Set_private; 271 end; 272 TFareInfoClass = Class of TFareInfo; 273 274 { -------------------------------------------------------------------- 275 TFlightInfo 276 --------------------------------------------------------------------} 277 278 TFlightInfo = Class(TGoogleBaseObject) 279 Private 280 Fcarrier : String; 281 Fnumber : String; 282 Protected 283 //Property setters 284 Procedure Setcarrier(AIndex : Integer; const AValue : String); virtual; 285 Procedure Setnumber(AIndex : Integer; const AValue : String); virtual; 286 Public 287 Published 288 Property carrier : String Index 0 Read Fcarrier Write Setcarrier; 289 Property number : String Index 8 Read Fnumber Write Setnumber; 290 end; 291 TFlightInfoClass = Class of TFlightInfo; 292 293 { -------------------------------------------------------------------- 294 TFreeBaggageAllowance 295 --------------------------------------------------------------------} 296 297 TFreeBaggageAllowance = Class(TGoogleBaseObject) 298 Private 299 FbagDescriptor : TFreeBaggageAllowanceTypebagDescriptorArray; 300 Fkilos : integer; 301 FkilosPerPiece : integer; 302 Fkind : String; 303 Fpieces : integer; 304 Fpounds : integer; 305 Protected 306 //Property setters 307 Procedure SetbagDescriptor(AIndex : Integer; const AValue : TFreeBaggageAllowanceTypebagDescriptorArray); virtual; 308 Procedure Setkilos(AIndex : Integer; const AValue : integer); virtual; 309 Procedure SetkilosPerPiece(AIndex : Integer; const AValue : integer); virtual; 310 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 311 Procedure Setpieces(AIndex : Integer; const AValue : integer); virtual; 312 Procedure Setpounds(AIndex : Integer; const AValue : integer); virtual; 313 //2.6.4. bug workaround 314 {$IFDEF VER2_6} 315 Procedure SetArrayLength(Const AName : String; ALength : Longint); override; 316 {$ENDIF VER2_6} 317 Public 318 Published 319 Property bagDescriptor : TFreeBaggageAllowanceTypebagDescriptorArray Index 0 Read FbagDescriptor Write SetbagDescriptor; 320 Property kilos : integer Index 8 Read Fkilos Write Setkilos; 321 Property kilosPerPiece : integer Index 16 Read FkilosPerPiece Write SetkilosPerPiece; 322 Property kind : String Index 24 Read Fkind Write Setkind; 323 Property pieces : integer Index 32 Read Fpieces Write Setpieces; 324 Property pounds : integer Index 40 Read Fpounds Write Setpounds; 325 end; 326 TFreeBaggageAllowanceClass = Class of TFreeBaggageAllowance; 327 328 { -------------------------------------------------------------------- 329 TLegInfo 330 --------------------------------------------------------------------} 331 332 TLegInfo = Class(TGoogleBaseObject) 333 Private 334 Faircraft : String; 335 FarrivalTime : String; 336 FchangePlane : boolean; 337 FconnectionDuration : integer; 338 FdepartureTime : String; 339 Fdestination : String; 340 FdestinationTerminal : String; 341 Fduration : integer; 342 Fid : String; 343 Fkind : String; 344 Fmeal : String; 345 Fmileage : integer; 346 FonTimePerformance : integer; 347 FoperatingDisclosure : String; 348 Forigin : String; 349 ForiginTerminal : String; 350 Fsecure : boolean; 351 Protected 352 //Property setters 353 Procedure Setaircraft(AIndex : Integer; const AValue : String); virtual; 354 Procedure SetarrivalTime(AIndex : Integer; const AValue : String); virtual; 355 Procedure SetchangePlane(AIndex : Integer; const AValue : boolean); virtual; 356 Procedure SetconnectionDuration(AIndex : Integer; const AValue : integer); virtual; 357 Procedure SetdepartureTime(AIndex : Integer; const AValue : String); virtual; 358 Procedure Setdestination(AIndex : Integer; const AValue : String); virtual; 359 Procedure SetdestinationTerminal(AIndex : Integer; const AValue : String); virtual; 360 Procedure Setduration(AIndex : Integer; const AValue : integer); virtual; 361 Procedure Setid(AIndex : Integer; const AValue : String); virtual; 362 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 363 Procedure Setmeal(AIndex : Integer; const AValue : String); virtual; 364 Procedure Setmileage(AIndex : Integer; const AValue : integer); virtual; 365 Procedure SetonTimePerformance(AIndex : Integer; const AValue : integer); virtual; 366 Procedure SetoperatingDisclosure(AIndex : Integer; const AValue : String); virtual; 367 Procedure Setorigin(AIndex : Integer; const AValue : String); virtual; 368 Procedure SetoriginTerminal(AIndex : Integer; const AValue : String); virtual; 369 Procedure Setsecure(AIndex : Integer; const AValue : boolean); virtual; 370 Public 371 Published 372 Property aircraft : String Index 0 Read Faircraft Write Setaircraft; 373 Property arrivalTime : String Index 8 Read FarrivalTime Write SetarrivalTime; 374 Property changePlane : boolean Index 16 Read FchangePlane Write SetchangePlane; 375 Property connectionDuration : integer Index 24 Read FconnectionDuration Write SetconnectionDuration; 376 Property departureTime : String Index 32 Read FdepartureTime Write SetdepartureTime; 377 Property destination : String Index 40 Read Fdestination Write Setdestination; 378 Property destinationTerminal : String Index 48 Read FdestinationTerminal Write SetdestinationTerminal; 379 Property duration : integer Index 56 Read Fduration Write Setduration; 380 Property id : String Index 64 Read Fid Write Setid; 381 Property kind : String Index 72 Read Fkind Write Setkind; 382 Property meal : String Index 80 Read Fmeal Write Setmeal; 383 Property mileage : integer Index 88 Read Fmileage Write Setmileage; 384 Property onTimePerformance : integer Index 96 Read FonTimePerformance Write SetonTimePerformance; 385 Property operatingDisclosure : String Index 104 Read FoperatingDisclosure Write SetoperatingDisclosure; 386 Property origin : String Index 112 Read Forigin Write Setorigin; 387 Property originTerminal : String Index 120 Read ForiginTerminal Write SetoriginTerminal; 388 Property secure : boolean Index 128 Read Fsecure Write Setsecure; 389 end; 390 TLegInfoClass = Class of TLegInfo; 391 392 { -------------------------------------------------------------------- 393 TPassengerCounts 394 --------------------------------------------------------------------} 395 396 TPassengerCounts = Class(TGoogleBaseObject) 397 Private 398 FadultCount : integer; 399 FchildCount : integer; 400 FinfantInLapCount : integer; 401 FinfantInSeatCount : integer; 402 Fkind : String; 403 FseniorCount : integer; 404 Protected 405 //Property setters 406 Procedure SetadultCount(AIndex : Integer; const AValue : integer); virtual; 407 Procedure SetchildCount(AIndex : Integer; const AValue : integer); virtual; 408 Procedure SetinfantInLapCount(AIndex : Integer; const AValue : integer); virtual; 409 Procedure SetinfantInSeatCount(AIndex : Integer; const AValue : integer); virtual; 410 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 411 Procedure SetseniorCount(AIndex : Integer; const AValue : integer); virtual; 412 Public 413 Published 414 Property adultCount : integer Index 0 Read FadultCount Write SetadultCount; 415 Property childCount : integer Index 8 Read FchildCount Write SetchildCount; 416 Property infantInLapCount : integer Index 16 Read FinfantInLapCount Write SetinfantInLapCount; 417 Property infantInSeatCount : integer Index 24 Read FinfantInSeatCount Write SetinfantInSeatCount; 418 Property kind : String Index 32 Read Fkind Write Setkind; 419 Property seniorCount : integer Index 40 Read FseniorCount Write SetseniorCount; 420 end; 421 TPassengerCountsClass = Class of TPassengerCounts; 422 423 { -------------------------------------------------------------------- 424 TPricingInfo 425 --------------------------------------------------------------------} 426 427 TPricingInfo = Class(TGoogleBaseObject) 428 Private 429 FbaseFareTotal : String; 430 Ffare : TPricingInfoTypefareArray; 431 FfareCalculation : String; 432 Fkind : String; 433 FlatestTicketingTime : String; 434 Fpassengers : TPassengerCounts; 435 Fptc : String; 436 Frefundable : boolean; 437 FsaleFareTotal : String; 438 FsaleTaxTotal : String; 439 FsaleTotal : String; 440 FsegmentPricing : TPricingInfoTypesegmentPricingArray; 441 Ftax : TPricingInfoTypetaxArray; 442 Protected 443 //Property setters 444 Procedure SetbaseFareTotal(AIndex : Integer; const AValue : String); virtual; 445 Procedure Setfare(AIndex : Integer; const AValue : TPricingInfoTypefareArray); virtual; 446 Procedure SetfareCalculation(AIndex : Integer; const AValue : String); virtual; 447 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 448 Procedure SetlatestTicketingTime(AIndex : Integer; const AValue : String); virtual; 449 Procedure Setpassengers(AIndex : Integer; const AValue : TPassengerCounts); virtual; 450 Procedure Setptc(AIndex : Integer; const AValue : String); virtual; 451 Procedure Setrefundable(AIndex : Integer; const AValue : boolean); virtual; 452 Procedure SetsaleFareTotal(AIndex : Integer; const AValue : String); virtual; 453 Procedure SetsaleTaxTotal(AIndex : Integer; const AValue : String); virtual; 454 Procedure SetsaleTotal(AIndex : Integer; const AValue : String); virtual; 455 Procedure SetsegmentPricing(AIndex : Integer; const AValue : TPricingInfoTypesegmentPricingArray); virtual; 456 Procedure Settax(AIndex : Integer; const AValue : TPricingInfoTypetaxArray); virtual; 457 //2.6.4. bug workaround 458 {$IFDEF VER2_6} 459 Procedure SetArrayLength(Const AName : String; ALength : Longint); override; 460 {$ENDIF VER2_6} 461 Public 462 Published 463 Property baseFareTotal : String Index 0 Read FbaseFareTotal Write SetbaseFareTotal; 464 Property fare : TPricingInfoTypefareArray Index 8 Read Ffare Write Setfare; 465 Property fareCalculation : String Index 16 Read FfareCalculation Write SetfareCalculation; 466 Property kind : String Index 24 Read Fkind Write Setkind; 467 Property latestTicketingTime : String Index 32 Read FlatestTicketingTime Write SetlatestTicketingTime; 468 Property passengers : TPassengerCounts Index 40 Read Fpassengers Write Setpassengers; 469 Property ptc : String Index 48 Read Fptc Write Setptc; 470 Property refundable : boolean Index 56 Read Frefundable Write Setrefundable; 471 Property saleFareTotal : String Index 64 Read FsaleFareTotal Write SetsaleFareTotal; 472 Property saleTaxTotal : String Index 72 Read FsaleTaxTotal Write SetsaleTaxTotal; 473 Property saleTotal : String Index 80 Read FsaleTotal Write SetsaleTotal; 474 Property segmentPricing : TPricingInfoTypesegmentPricingArray Index 88 Read FsegmentPricing Write SetsegmentPricing; 475 Property tax : TPricingInfoTypetaxArray Index 96 Read Ftax Write Settax; 476 end; 477 TPricingInfoClass = Class of TPricingInfo; 478 479 { -------------------------------------------------------------------- 480 TSegmentInfo 481 --------------------------------------------------------------------} 482 483 TSegmentInfo = Class(TGoogleBaseObject) 484 Private 485 FbookingCode : String; 486 FbookingCodeCount : integer; 487 Fcabin : String; 488 FconnectionDuration : integer; 489 Fduration : integer; 490 Fflight : TFlightInfo; 491 Fid : String; 492 Fkind : String; 493 Fleg : TSegmentInfoTypelegArray; 494 FmarriedSegmentGroup : String; 495 FsubjectToGovernmentApproval : boolean; 496 Protected 497 //Property setters 498 Procedure SetbookingCode(AIndex : Integer; const AValue : String); virtual; 499 Procedure SetbookingCodeCount(AIndex : Integer; const AValue : integer); virtual; 500 Procedure Setcabin(AIndex : Integer; const AValue : String); virtual; 501 Procedure SetconnectionDuration(AIndex : Integer; const AValue : integer); virtual; 502 Procedure Setduration(AIndex : Integer; const AValue : integer); virtual; 503 Procedure Setflight(AIndex : Integer; const AValue : TFlightInfo); virtual; 504 Procedure Setid(AIndex : Integer; const AValue : String); virtual; 505 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 506 Procedure Setleg(AIndex : Integer; const AValue : TSegmentInfoTypelegArray); virtual; 507 Procedure SetmarriedSegmentGroup(AIndex : Integer; const AValue : String); virtual; 508 Procedure SetsubjectToGovernmentApproval(AIndex : Integer; const AValue : boolean); virtual; 509 //2.6.4. bug workaround 510 {$IFDEF VER2_6} 511 Procedure SetArrayLength(Const AName : String; ALength : Longint); override; 512 {$ENDIF VER2_6} 513 Public 514 Published 515 Property bookingCode : String Index 0 Read FbookingCode Write SetbookingCode; 516 Property bookingCodeCount : integer Index 8 Read FbookingCodeCount Write SetbookingCodeCount; 517 Property cabin : String Index 16 Read Fcabin Write Setcabin; 518 Property connectionDuration : integer Index 24 Read FconnectionDuration Write SetconnectionDuration; 519 Property duration : integer Index 32 Read Fduration Write Setduration; 520 Property flight : TFlightInfo Index 40 Read Fflight Write Setflight; 521 Property id : String Index 48 Read Fid Write Setid; 522 Property kind : String Index 56 Read Fkind Write Setkind; 523 Property leg : TSegmentInfoTypelegArray Index 64 Read Fleg Write Setleg; 524 Property marriedSegmentGroup : String Index 72 Read FmarriedSegmentGroup Write SetmarriedSegmentGroup; 525 Property subjectToGovernmentApproval : boolean Index 80 Read FsubjectToGovernmentApproval Write SetsubjectToGovernmentApproval; 526 end; 527 TSegmentInfoClass = Class of TSegmentInfo; 528 529 { -------------------------------------------------------------------- 530 TSegmentPricing 531 --------------------------------------------------------------------} 532 533 TSegmentPricing = Class(TGoogleBaseObject) 534 Private 535 FfareId : String; 536 FfreeBaggageOption : TSegmentPricingTypefreeBaggageOptionArray; 537 Fkind : String; 538 FsegmentId : String; 539 Protected 540 //Property setters 541 Procedure SetfareId(AIndex : Integer; const AValue : String); virtual; 542 Procedure SetfreeBaggageOption(AIndex : Integer; const AValue : TSegmentPricingTypefreeBaggageOptionArray); virtual; 543 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 544 Procedure SetsegmentId(AIndex : Integer; const AValue : String); virtual; 545 //2.6.4. bug workaround 546 {$IFDEF VER2_6} 547 Procedure SetArrayLength(Const AName : String; ALength : Longint); override; 548 {$ENDIF VER2_6} 549 Public 550 Published 551 Property fareId : String Index 0 Read FfareId Write SetfareId; 552 Property freeBaggageOption : TSegmentPricingTypefreeBaggageOptionArray Index 8 Read FfreeBaggageOption Write SetfreeBaggageOption; 553 Property kind : String Index 16 Read Fkind Write Setkind; 554 Property segmentId : String Index 24 Read FsegmentId Write SetsegmentId; 555 end; 556 TSegmentPricingClass = Class of TSegmentPricing; 557 558 { -------------------------------------------------------------------- 559 TSliceInfo 560 --------------------------------------------------------------------} 561 562 TSliceInfo = Class(TGoogleBaseObject) 563 Private 564 Fduration : integer; 565 Fkind : String; 566 Fsegment : TSliceInfoTypesegmentArray; 567 Protected 568 //Property setters 569 Procedure Setduration(AIndex : Integer; const AValue : integer); virtual; 570 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 571 Procedure Setsegment(AIndex : Integer; const AValue : TSliceInfoTypesegmentArray); virtual; 572 //2.6.4. bug workaround 573 {$IFDEF VER2_6} 574 Procedure SetArrayLength(Const AName : String; ALength : Longint); override; 575 {$ENDIF VER2_6} 576 Public 577 Published 578 Property duration : integer Index 0 Read Fduration Write Setduration; 579 Property kind : String Index 8 Read Fkind Write Setkind; 580 Property segment : TSliceInfoTypesegmentArray Index 16 Read Fsegment Write Setsegment; 581 end; 582 TSliceInfoClass = Class of TSliceInfo; 583 584 { -------------------------------------------------------------------- 585 TSliceInput 586 --------------------------------------------------------------------} 587 588 TSliceInput = Class(TGoogleBaseObject) 589 Private 590 Falliance : String; 591 Fdate : String; 592 Fdestination : String; 593 Fkind : String; 594 FmaxConnectionDuration : integer; 595 FmaxStops : integer; 596 Forigin : String; 597 FpermittedCarrier : TStringArray; 598 FpermittedDepartureTime : TTimeOfDayRange; 599 FpreferredCabin : String; 600 FprohibitedCarrier : TStringArray; 601 Protected 602 //Property setters 603 Procedure Setalliance(AIndex : Integer; const AValue : String); virtual; 604 Procedure Setdate(AIndex : Integer; const AValue : String); virtual; 605 Procedure Setdestination(AIndex : Integer; const AValue : String); virtual; 606 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 607 Procedure SetmaxConnectionDuration(AIndex : Integer; const AValue : integer); virtual; 608 Procedure SetmaxStops(AIndex : Integer; const AValue : integer); virtual; 609 Procedure Setorigin(AIndex : Integer; const AValue : String); virtual; 610 Procedure SetpermittedCarrier(AIndex : Integer; const AValue : TStringArray); virtual; 611 Procedure SetpermittedDepartureTime(AIndex : Integer; const AValue : TTimeOfDayRange); virtual; 612 Procedure SetpreferredCabin(AIndex : Integer; const AValue : String); virtual; 613 Procedure SetprohibitedCarrier(AIndex : Integer; const AValue : TStringArray); virtual; 614 //2.6.4. bug workaround 615 {$IFDEF VER2_6} 616 Procedure SetArrayLength(Const AName : String; ALength : Longint); override; 617 {$ENDIF VER2_6} 618 Public 619 Published 620 Property alliance : String Index 0 Read Falliance Write Setalliance; 621 Property date : String Index 8 Read Fdate Write Setdate; 622 Property destination : String Index 16 Read Fdestination Write Setdestination; 623 Property kind : String Index 24 Read Fkind Write Setkind; 624 Property maxConnectionDuration : integer Index 32 Read FmaxConnectionDuration Write SetmaxConnectionDuration; 625 Property maxStops : integer Index 40 Read FmaxStops Write SetmaxStops; 626 Property origin : String Index 48 Read Forigin Write Setorigin; 627 Property permittedCarrier : TStringArray Index 56 Read FpermittedCarrier Write SetpermittedCarrier; 628 Property permittedDepartureTime : TTimeOfDayRange Index 64 Read FpermittedDepartureTime Write SetpermittedDepartureTime; 629 Property preferredCabin : String Index 72 Read FpreferredCabin Write SetpreferredCabin; 630 Property prohibitedCarrier : TStringArray Index 80 Read FprohibitedCarrier Write SetprohibitedCarrier; 631 end; 632 TSliceInputClass = Class of TSliceInput; 633 634 { -------------------------------------------------------------------- 635 TTaxData 636 --------------------------------------------------------------------} 637 638 TTaxData = Class(TGoogleBaseObject) 639 Private 640 Fid : String; 641 Fkind : String; 642 Fname : String; 643 Protected 644 //Property setters 645 Procedure Setid(AIndex : Integer; const AValue : String); virtual; 646 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 647 Procedure Setname(AIndex : Integer; const AValue : String); virtual; 648 Public 649 Published 650 Property id : String Index 0 Read Fid Write Setid; 651 Property kind : String Index 8 Read Fkind Write Setkind; 652 Property name : String Index 16 Read Fname Write Setname; 653 end; 654 TTaxDataClass = Class of TTaxData; 655 656 { -------------------------------------------------------------------- 657 TTaxInfo 658 --------------------------------------------------------------------} 659 660 TTaxInfo = Class(TGoogleBaseObject) 661 Private 662 FchargeType : String; 663 Fcode : String; 664 Fcountry : String; 665 Fid : String; 666 Fkind : String; 667 FsalePrice : String; 668 Protected 669 //Property setters 670 Procedure SetchargeType(AIndex : Integer; const AValue : String); virtual; 671 Procedure Setcode(AIndex : Integer; const AValue : String); virtual; 672 Procedure Setcountry(AIndex : Integer; const AValue : String); virtual; 673 Procedure Setid(AIndex : Integer; const AValue : String); virtual; 674 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 675 Procedure SetsalePrice(AIndex : Integer; const AValue : String); virtual; 676 Public 677 Published 678 Property chargeType : String Index 0 Read FchargeType Write SetchargeType; 679 Property code : String Index 8 Read Fcode Write Setcode; 680 Property country : String Index 16 Read Fcountry Write Setcountry; 681 Property id : String Index 24 Read Fid Write Setid; 682 Property kind : String Index 32 Read Fkind Write Setkind; 683 Property salePrice : String Index 40 Read FsalePrice Write SetsalePrice; 684 end; 685 TTaxInfoClass = Class of TTaxInfo; 686 687 { -------------------------------------------------------------------- 688 TTimeOfDayRange 689 --------------------------------------------------------------------} 690 691 TTimeOfDayRange = Class(TGoogleBaseObject) 692 Private 693 FearliestTime : String; 694 Fkind : String; 695 FlatestTime : String; 696 Protected 697 //Property setters 698 Procedure SetearliestTime(AIndex : Integer; const AValue : String); virtual; 699 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 700 Procedure SetlatestTime(AIndex : Integer; const AValue : String); virtual; 701 Public 702 Published 703 Property earliestTime : String Index 0 Read FearliestTime Write SetearliestTime; 704 Property kind : String Index 8 Read Fkind Write Setkind; 705 Property latestTime : String Index 16 Read FlatestTime Write SetlatestTime; 706 end; 707 TTimeOfDayRangeClass = Class of TTimeOfDayRange; 708 709 { -------------------------------------------------------------------- 710 TTripOption 711 --------------------------------------------------------------------} 712 713 TTripOption = Class(TGoogleBaseObject) 714 Private 715 Fid : String; 716 Fkind : String; 717 Fpricing : TTripOptionTypepricingArray; 718 FsaleTotal : String; 719 Fslice : TTripOptionTypesliceArray; 720 Protected 721 //Property setters 722 Procedure Setid(AIndex : Integer; const AValue : String); virtual; 723 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 724 Procedure Setpricing(AIndex : Integer; const AValue : TTripOptionTypepricingArray); virtual; 725 Procedure SetsaleTotal(AIndex : Integer; const AValue : String); virtual; 726 Procedure Setslice(AIndex : Integer; const AValue : TTripOptionTypesliceArray); virtual; 727 //2.6.4. bug workaround 728 {$IFDEF VER2_6} 729 Procedure SetArrayLength(Const AName : String; ALength : Longint); override; 730 {$ENDIF VER2_6} 731 Public 732 Published 733 Property id : String Index 0 Read Fid Write Setid; 734 Property kind : String Index 8 Read Fkind Write Setkind; 735 Property pricing : TTripOptionTypepricingArray Index 16 Read Fpricing Write Setpricing; 736 Property saleTotal : String Index 24 Read FsaleTotal Write SetsaleTotal; 737 Property slice : TTripOptionTypesliceArray Index 32 Read Fslice Write Setslice; 738 end; 739 TTripOptionClass = Class of TTripOption; 740 741 { -------------------------------------------------------------------- 742 TTripOptionsRequest 743 --------------------------------------------------------------------} 744 745 TTripOptionsRequest = Class(TGoogleBaseObject) 746 Private 747 FmaxPrice : String; 748 Fpassengers : TPassengerCounts; 749 Frefundable : boolean; 750 FsaleCountry : String; 751 Fslice : TTripOptionsRequestTypesliceArray; 752 Fsolutions : integer; 753 Protected 754 //Property setters 755 Procedure SetmaxPrice(AIndex : Integer; const AValue : String); virtual; 756 Procedure Setpassengers(AIndex : Integer; const AValue : TPassengerCounts); virtual; 757 Procedure Setrefundable(AIndex : Integer; const AValue : boolean); virtual; 758 Procedure SetsaleCountry(AIndex : Integer; const AValue : String); virtual; 759 Procedure Setslice(AIndex : Integer; const AValue : TTripOptionsRequestTypesliceArray); virtual; 760 Procedure Setsolutions(AIndex : Integer; const AValue : integer); virtual; 761 //2.6.4. bug workaround 762 {$IFDEF VER2_6} 763 Procedure SetArrayLength(Const AName : String; ALength : Longint); override; 764 {$ENDIF VER2_6} 765 Public 766 Published 767 Property maxPrice : String Index 0 Read FmaxPrice Write SetmaxPrice; 768 Property passengers : TPassengerCounts Index 8 Read Fpassengers Write Setpassengers; 769 Property refundable : boolean Index 16 Read Frefundable Write Setrefundable; 770 Property saleCountry : String Index 24 Read FsaleCountry Write SetsaleCountry; 771 Property slice : TTripOptionsRequestTypesliceArray Index 32 Read Fslice Write Setslice; 772 Property solutions : integer Index 40 Read Fsolutions Write Setsolutions; 773 end; 774 TTripOptionsRequestClass = Class of TTripOptionsRequest; 775 776 { -------------------------------------------------------------------- 777 TTripOptionsResponse 778 --------------------------------------------------------------------} 779 780 TTripOptionsResponse = Class(TGoogleBaseObject) 781 Private 782 Fdata : TData; 783 Fkind : String; 784 FrequestId : String; 785 FtripOption : TTripOptionsResponseTypetripOptionArray; 786 Protected 787 //Property setters 788 Procedure Setdata(AIndex : Integer; const AValue : TData); virtual; 789 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 790 Procedure SetrequestId(AIndex : Integer; const AValue : String); virtual; 791 Procedure SettripOption(AIndex : Integer; const AValue : TTripOptionsResponseTypetripOptionArray); virtual; 792 //2.6.4. bug workaround 793 {$IFDEF VER2_6} 794 Procedure SetArrayLength(Const AName : String; ALength : Longint); override; 795 {$ENDIF VER2_6} 796 Public 797 Published 798 Property data : TData Index 0 Read Fdata Write Setdata; 799 Property kind : String Index 8 Read Fkind Write Setkind; 800 Property requestId : String Index 16 Read FrequestId Write SetrequestId; 801 Property tripOption : TTripOptionsResponseTypetripOptionArray Index 24 Read FtripOption Write SettripOption; 802 end; 803 TTripOptionsResponseClass = Class of TTripOptionsResponse; 804 805 { -------------------------------------------------------------------- 806 TTripsSearchRequest 807 --------------------------------------------------------------------} 808 809 TTripsSearchRequest = Class(TGoogleBaseObject) 810 Private 811 Frequest : TTripOptionsRequest; 812 Protected 813 //Property setters 814 Procedure Setrequest(AIndex : Integer; const AValue : TTripOptionsRequest); virtual; 815 Public 816 Published 817 Property request : TTripOptionsRequest Index 0 Read Frequest Write Setrequest; 818 end; 819 TTripsSearchRequestClass = Class of TTripsSearchRequest; 820 821 { -------------------------------------------------------------------- 822 TTripsSearchResponse 823 --------------------------------------------------------------------} 824 825 TTripsSearchResponse = Class(TGoogleBaseObject) 826 Private 827 Fkind : String; 828 Ftrips : TTripOptionsResponse; 829 Protected 830 //Property setters 831 Procedure Setkind(AIndex : Integer; const AValue : String); virtual; 832 Procedure Settrips(AIndex : Integer; const AValue : TTripOptionsResponse); virtual; 833 Public 834 Published 835 Property kind : String Index 0 Read Fkind Write Setkind; 836 Property trips : TTripOptionsResponse Index 8 Read Ftrips Write Settrips; 837 end; 838 TTripsSearchResponseClass = Class of TTripsSearchResponse; 839 840 { -------------------------------------------------------------------- 841 TTripsResource 842 --------------------------------------------------------------------} 843 844 TTripsResource = Class(TGoogleResource) 845 Public 846 Class Function ResourceName : String; override; 847 Class Function DefaultAPI : TGoogleAPIClass; override; 848 Function Search(aTripsSearchRequest : TTripsSearchRequest) : TTripsSearchResponse; 849 end; 850 851 852 { -------------------------------------------------------------------- 853 TQpxExpressAPI 854 --------------------------------------------------------------------} 855 856 TQpxExpressAPI = Class(TGoogleAPI) 857 Private 858 FTripsInstance : TTripsResource; 859 Function GetTripsInstance : TTripsResource;virtual; 860 Public 861 //Override class functions with API info 862 Class Function APIName : String; override; 863 Class Function APIVersion : String; override; 864 Class Function APIRevision : String; override; 865 Class Function APIID : String; override; 866 Class Function APITitle : String; override; 867 Class Function APIDescription : String; override; 868 Class Function APIOwnerDomain : String; override; 869 Class Function APIOwnerName : String; override; 870 Class Function APIIcon16 : String; override; 871 Class Function APIIcon32 : String; override; 872 Class Function APIdocumentationLink : String; override; 873 Class Function APIrootUrl : string; override; 874 Class Function APIbasePath : string;override; 875 Class Function APIbaseURL : String;override; 876 Class Function APIProtocol : string;override; 877 Class Function APIservicePath : string;override; 878 Class Function APIbatchPath : String;override; 879 Class Function APIAuthScopes : TScopeInfoArray;override; 880 Class Function APINeedsAuth : Boolean;override; 881 Class Procedure RegisterAPIResources; override; 882 //Add create function for resources 883 Function CreateTripsResource(AOwner : TComponent) : TTripsResource;virtual;overload; 884 Function CreateTripsResource : TTripsResource;virtual;overload; 885 //Add default on-demand instances for resources 886 Property TripsResource : TTripsResource Read GetTripsInstance; 887 end; 888 889implementation 890 891 892{ -------------------------------------------------------------------- 893 TAircraftData 894 --------------------------------------------------------------------} 895 896 897Procedure TAircraftData.Setcode(AIndex : Integer; const AValue : String); 898 899begin 900 If (Fcode=AValue) then exit; 901 Fcode:=AValue; 902 MarkPropertyChanged(AIndex); 903end; 904 905 906 907Procedure TAircraftData.Setkind(AIndex : Integer; const AValue : String); 908 909begin 910 If (Fkind=AValue) then exit; 911 Fkind:=AValue; 912 MarkPropertyChanged(AIndex); 913end; 914 915 916 917Procedure TAircraftData.Setname(AIndex : Integer; const AValue : String); 918 919begin 920 If (Fname=AValue) then exit; 921 Fname:=AValue; 922 MarkPropertyChanged(AIndex); 923end; 924 925 926 927 928 929{ -------------------------------------------------------------------- 930 TAirportData 931 --------------------------------------------------------------------} 932 933 934Procedure TAirportData.Setcity(AIndex : Integer; const AValue : String); 935 936begin 937 If (Fcity=AValue) then exit; 938 Fcity:=AValue; 939 MarkPropertyChanged(AIndex); 940end; 941 942 943 944Procedure TAirportData.Setcode(AIndex : Integer; const AValue : String); 945 946begin 947 If (Fcode=AValue) then exit; 948 Fcode:=AValue; 949 MarkPropertyChanged(AIndex); 950end; 951 952 953 954Procedure TAirportData.Setkind(AIndex : Integer; const AValue : String); 955 956begin 957 If (Fkind=AValue) then exit; 958 Fkind:=AValue; 959 MarkPropertyChanged(AIndex); 960end; 961 962 963 964Procedure TAirportData.Setname(AIndex : Integer; const AValue : String); 965 966begin 967 If (Fname=AValue) then exit; 968 Fname:=AValue; 969 MarkPropertyChanged(AIndex); 970end; 971 972 973 974 975 976{ -------------------------------------------------------------------- 977 TBagDescriptor 978 --------------------------------------------------------------------} 979 980 981Procedure TBagDescriptor.SetcommercialName(AIndex : Integer; const AValue : String); 982 983begin 984 If (FcommercialName=AValue) then exit; 985 FcommercialName:=AValue; 986 MarkPropertyChanged(AIndex); 987end; 988 989 990 991Procedure TBagDescriptor.Setcount(AIndex : Integer; const AValue : integer); 992 993begin 994 If (Fcount=AValue) then exit; 995 Fcount:=AValue; 996 MarkPropertyChanged(AIndex); 997end; 998 999 1000 1001Procedure TBagDescriptor.Setdescription(AIndex : Integer; const AValue : TStringArray); 1002 1003begin 1004 If (Fdescription=AValue) then exit; 1005 Fdescription:=AValue; 1006 MarkPropertyChanged(AIndex); 1007end; 1008 1009 1010 1011Procedure TBagDescriptor.Setkind(AIndex : Integer; const AValue : String); 1012 1013begin 1014 If (Fkind=AValue) then exit; 1015 Fkind:=AValue; 1016 MarkPropertyChanged(AIndex); 1017end; 1018 1019 1020 1021Procedure TBagDescriptor.Setsubcode(AIndex : Integer; const AValue : String); 1022 1023begin 1024 If (Fsubcode=AValue) then exit; 1025 Fsubcode:=AValue; 1026 MarkPropertyChanged(AIndex); 1027end; 1028 1029 1030//2.6.4. bug workaround 1031{$IFDEF VER2_6} 1032Procedure TBagDescriptor.SetArrayLength(Const AName : String; ALength : Longint); 1033 1034begin 1035 Case AName of 1036 'description' : SetLength(Fdescription,ALength); 1037 else 1038 Inherited SetArrayLength(AName,ALength); 1039 end; 1040end; 1041{$ENDIF VER2_6} 1042 1043 1044 1045 1046{ -------------------------------------------------------------------- 1047 TCarrierData 1048 --------------------------------------------------------------------} 1049 1050 1051Procedure TCarrierData.Setcode(AIndex : Integer; const AValue : String); 1052 1053begin 1054 If (Fcode=AValue) then exit; 1055 Fcode:=AValue; 1056 MarkPropertyChanged(AIndex); 1057end; 1058 1059 1060 1061Procedure TCarrierData.Setkind(AIndex : Integer; const AValue : String); 1062 1063begin 1064 If (Fkind=AValue) then exit; 1065 Fkind:=AValue; 1066 MarkPropertyChanged(AIndex); 1067end; 1068 1069 1070 1071Procedure TCarrierData.Setname(AIndex : Integer; const AValue : String); 1072 1073begin 1074 If (Fname=AValue) then exit; 1075 Fname:=AValue; 1076 MarkPropertyChanged(AIndex); 1077end; 1078 1079 1080 1081 1082 1083{ -------------------------------------------------------------------- 1084 TCityData 1085 --------------------------------------------------------------------} 1086 1087 1088Procedure TCityData.Setcode(AIndex : Integer; const AValue : String); 1089 1090begin 1091 If (Fcode=AValue) then exit; 1092 Fcode:=AValue; 1093 MarkPropertyChanged(AIndex); 1094end; 1095 1096 1097 1098Procedure TCityData.Setcountry(AIndex : Integer; const AValue : String); 1099 1100begin 1101 If (Fcountry=AValue) then exit; 1102 Fcountry:=AValue; 1103 MarkPropertyChanged(AIndex); 1104end; 1105 1106 1107 1108Procedure TCityData.Setkind(AIndex : Integer; const AValue : String); 1109 1110begin 1111 If (Fkind=AValue) then exit; 1112 Fkind:=AValue; 1113 MarkPropertyChanged(AIndex); 1114end; 1115 1116 1117 1118Procedure TCityData.Setname(AIndex : Integer; const AValue : String); 1119 1120begin 1121 If (Fname=AValue) then exit; 1122 Fname:=AValue; 1123 MarkPropertyChanged(AIndex); 1124end; 1125 1126 1127 1128 1129 1130{ -------------------------------------------------------------------- 1131 TData 1132 --------------------------------------------------------------------} 1133 1134 1135Procedure TData.Setaircraft(AIndex : Integer; const AValue : TDataTypeaircraftArray); 1136 1137begin 1138 If (Faircraft=AValue) then exit; 1139 Faircraft:=AValue; 1140 MarkPropertyChanged(AIndex); 1141end; 1142 1143 1144 1145Procedure TData.Setairport(AIndex : Integer; const AValue : TDataTypeairportArray); 1146 1147begin 1148 If (Fairport=AValue) then exit; 1149 Fairport:=AValue; 1150 MarkPropertyChanged(AIndex); 1151end; 1152 1153 1154 1155Procedure TData.Setcarrier(AIndex : Integer; const AValue : TDataTypecarrierArray); 1156 1157begin 1158 If (Fcarrier=AValue) then exit; 1159 Fcarrier:=AValue; 1160 MarkPropertyChanged(AIndex); 1161end; 1162 1163 1164 1165Procedure TData.Setcity(AIndex : Integer; const AValue : TDataTypecityArray); 1166 1167begin 1168 If (Fcity=AValue) then exit; 1169 Fcity:=AValue; 1170 MarkPropertyChanged(AIndex); 1171end; 1172 1173 1174 1175Procedure TData.Setkind(AIndex : Integer; const AValue : String); 1176 1177begin 1178 If (Fkind=AValue) then exit; 1179 Fkind:=AValue; 1180 MarkPropertyChanged(AIndex); 1181end; 1182 1183 1184 1185Procedure TData.Settax(AIndex : Integer; const AValue : TDataTypetaxArray); 1186 1187begin 1188 If (Ftax=AValue) then exit; 1189 Ftax:=AValue; 1190 MarkPropertyChanged(AIndex); 1191end; 1192 1193 1194//2.6.4. bug workaround 1195{$IFDEF VER2_6} 1196Procedure TData.SetArrayLength(Const AName : String; ALength : Longint); 1197 1198begin 1199 Case AName of 1200 'aircraft' : SetLength(Faircraft,ALength); 1201 'airport' : SetLength(Fairport,ALength); 1202 'carrier' : SetLength(Fcarrier,ALength); 1203 'city' : SetLength(Fcity,ALength); 1204 'tax' : SetLength(Ftax,ALength); 1205 else 1206 Inherited SetArrayLength(AName,ALength); 1207 end; 1208end; 1209{$ENDIF VER2_6} 1210 1211 1212 1213 1214{ -------------------------------------------------------------------- 1215 TFareInfo 1216 --------------------------------------------------------------------} 1217 1218 1219Procedure TFareInfo.SetbasisCode(AIndex : Integer; const AValue : String); 1220 1221begin 1222 If (FbasisCode=AValue) then exit; 1223 FbasisCode:=AValue; 1224 MarkPropertyChanged(AIndex); 1225end; 1226 1227 1228 1229Procedure TFareInfo.Setcarrier(AIndex : Integer; const AValue : String); 1230 1231begin 1232 If (Fcarrier=AValue) then exit; 1233 Fcarrier:=AValue; 1234 MarkPropertyChanged(AIndex); 1235end; 1236 1237 1238 1239Procedure TFareInfo.Setdestination(AIndex : Integer; const AValue : String); 1240 1241begin 1242 If (Fdestination=AValue) then exit; 1243 Fdestination:=AValue; 1244 MarkPropertyChanged(AIndex); 1245end; 1246 1247 1248 1249Procedure TFareInfo.Setid(AIndex : Integer; const AValue : String); 1250 1251begin 1252 If (Fid=AValue) then exit; 1253 Fid:=AValue; 1254 MarkPropertyChanged(AIndex); 1255end; 1256 1257 1258 1259Procedure TFareInfo.Setkind(AIndex : Integer; const AValue : String); 1260 1261begin 1262 If (Fkind=AValue) then exit; 1263 Fkind:=AValue; 1264 MarkPropertyChanged(AIndex); 1265end; 1266 1267 1268 1269Procedure TFareInfo.Setorigin(AIndex : Integer; const AValue : String); 1270 1271begin 1272 If (Forigin=AValue) then exit; 1273 Forigin:=AValue; 1274 MarkPropertyChanged(AIndex); 1275end; 1276 1277 1278 1279Procedure TFareInfo.Set_private(AIndex : Integer; const AValue : boolean); 1280 1281begin 1282 If (F_private=AValue) then exit; 1283 F_private:=AValue; 1284 MarkPropertyChanged(AIndex); 1285end; 1286 1287 1288 1289Class Function TFareInfo.ExportPropertyName(Const AName : String) :String; 1290 1291begin 1292 Case AName of 1293 '_private' : Result:='private'; 1294 else 1295 Result:=Inherited ExportPropertyName(AName); 1296 end; 1297end; 1298 1299 1300 1301 1302{ -------------------------------------------------------------------- 1303 TFlightInfo 1304 --------------------------------------------------------------------} 1305 1306 1307Procedure TFlightInfo.Setcarrier(AIndex : Integer; const AValue : String); 1308 1309begin 1310 If (Fcarrier=AValue) then exit; 1311 Fcarrier:=AValue; 1312 MarkPropertyChanged(AIndex); 1313end; 1314 1315 1316 1317Procedure TFlightInfo.Setnumber(AIndex : Integer; const AValue : String); 1318 1319begin 1320 If (Fnumber=AValue) then exit; 1321 Fnumber:=AValue; 1322 MarkPropertyChanged(AIndex); 1323end; 1324 1325 1326 1327 1328 1329{ -------------------------------------------------------------------- 1330 TFreeBaggageAllowance 1331 --------------------------------------------------------------------} 1332 1333 1334Procedure TFreeBaggageAllowance.SetbagDescriptor(AIndex : Integer; const AValue : TFreeBaggageAllowanceTypebagDescriptorArray); 1335 1336begin 1337 If (FbagDescriptor=AValue) then exit; 1338 FbagDescriptor:=AValue; 1339 MarkPropertyChanged(AIndex); 1340end; 1341 1342 1343 1344Procedure TFreeBaggageAllowance.Setkilos(AIndex : Integer; const AValue : integer); 1345 1346begin 1347 If (Fkilos=AValue) then exit; 1348 Fkilos:=AValue; 1349 MarkPropertyChanged(AIndex); 1350end; 1351 1352 1353 1354Procedure TFreeBaggageAllowance.SetkilosPerPiece(AIndex : Integer; const AValue : integer); 1355 1356begin 1357 If (FkilosPerPiece=AValue) then exit; 1358 FkilosPerPiece:=AValue; 1359 MarkPropertyChanged(AIndex); 1360end; 1361 1362 1363 1364Procedure TFreeBaggageAllowance.Setkind(AIndex : Integer; const AValue : String); 1365 1366begin 1367 If (Fkind=AValue) then exit; 1368 Fkind:=AValue; 1369 MarkPropertyChanged(AIndex); 1370end; 1371 1372 1373 1374Procedure TFreeBaggageAllowance.Setpieces(AIndex : Integer; const AValue : integer); 1375 1376begin 1377 If (Fpieces=AValue) then exit; 1378 Fpieces:=AValue; 1379 MarkPropertyChanged(AIndex); 1380end; 1381 1382 1383 1384Procedure TFreeBaggageAllowance.Setpounds(AIndex : Integer; const AValue : integer); 1385 1386begin 1387 If (Fpounds=AValue) then exit; 1388 Fpounds:=AValue; 1389 MarkPropertyChanged(AIndex); 1390end; 1391 1392 1393//2.6.4. bug workaround 1394{$IFDEF VER2_6} 1395Procedure TFreeBaggageAllowance.SetArrayLength(Const AName : String; ALength : Longint); 1396 1397begin 1398 Case AName of 1399 'bagdescriptor' : SetLength(FbagDescriptor,ALength); 1400 else 1401 Inherited SetArrayLength(AName,ALength); 1402 end; 1403end; 1404{$ENDIF VER2_6} 1405 1406 1407 1408 1409{ -------------------------------------------------------------------- 1410 TLegInfo 1411 --------------------------------------------------------------------} 1412 1413 1414Procedure TLegInfo.Setaircraft(AIndex : Integer; const AValue : String); 1415 1416begin 1417 If (Faircraft=AValue) then exit; 1418 Faircraft:=AValue; 1419 MarkPropertyChanged(AIndex); 1420end; 1421 1422 1423 1424Procedure TLegInfo.SetarrivalTime(AIndex : Integer; const AValue : String); 1425 1426begin 1427 If (FarrivalTime=AValue) then exit; 1428 FarrivalTime:=AValue; 1429 MarkPropertyChanged(AIndex); 1430end; 1431 1432 1433 1434Procedure TLegInfo.SetchangePlane(AIndex : Integer; const AValue : boolean); 1435 1436begin 1437 If (FchangePlane=AValue) then exit; 1438 FchangePlane:=AValue; 1439 MarkPropertyChanged(AIndex); 1440end; 1441 1442 1443 1444Procedure TLegInfo.SetconnectionDuration(AIndex : Integer; const AValue : integer); 1445 1446begin 1447 If (FconnectionDuration=AValue) then exit; 1448 FconnectionDuration:=AValue; 1449 MarkPropertyChanged(AIndex); 1450end; 1451 1452 1453 1454Procedure TLegInfo.SetdepartureTime(AIndex : Integer; const AValue : String); 1455 1456begin 1457 If (FdepartureTime=AValue) then exit; 1458 FdepartureTime:=AValue; 1459 MarkPropertyChanged(AIndex); 1460end; 1461 1462 1463 1464Procedure TLegInfo.Setdestination(AIndex : Integer; const AValue : String); 1465 1466begin 1467 If (Fdestination=AValue) then exit; 1468 Fdestination:=AValue; 1469 MarkPropertyChanged(AIndex); 1470end; 1471 1472 1473 1474Procedure TLegInfo.SetdestinationTerminal(AIndex : Integer; const AValue : String); 1475 1476begin 1477 If (FdestinationTerminal=AValue) then exit; 1478 FdestinationTerminal:=AValue; 1479 MarkPropertyChanged(AIndex); 1480end; 1481 1482 1483 1484Procedure TLegInfo.Setduration(AIndex : Integer; const AValue : integer); 1485 1486begin 1487 If (Fduration=AValue) then exit; 1488 Fduration:=AValue; 1489 MarkPropertyChanged(AIndex); 1490end; 1491 1492 1493 1494Procedure TLegInfo.Setid(AIndex : Integer; const AValue : String); 1495 1496begin 1497 If (Fid=AValue) then exit; 1498 Fid:=AValue; 1499 MarkPropertyChanged(AIndex); 1500end; 1501 1502 1503 1504Procedure TLegInfo.Setkind(AIndex : Integer; const AValue : String); 1505 1506begin 1507 If (Fkind=AValue) then exit; 1508 Fkind:=AValue; 1509 MarkPropertyChanged(AIndex); 1510end; 1511 1512 1513 1514Procedure TLegInfo.Setmeal(AIndex : Integer; const AValue : String); 1515 1516begin 1517 If (Fmeal=AValue) then exit; 1518 Fmeal:=AValue; 1519 MarkPropertyChanged(AIndex); 1520end; 1521 1522 1523 1524Procedure TLegInfo.Setmileage(AIndex : Integer; const AValue : integer); 1525 1526begin 1527 If (Fmileage=AValue) then exit; 1528 Fmileage:=AValue; 1529 MarkPropertyChanged(AIndex); 1530end; 1531 1532 1533 1534Procedure TLegInfo.SetonTimePerformance(AIndex : Integer; const AValue : integer); 1535 1536begin 1537 If (FonTimePerformance=AValue) then exit; 1538 FonTimePerformance:=AValue; 1539 MarkPropertyChanged(AIndex); 1540end; 1541 1542 1543 1544Procedure TLegInfo.SetoperatingDisclosure(AIndex : Integer; const AValue : String); 1545 1546begin 1547 If (FoperatingDisclosure=AValue) then exit; 1548 FoperatingDisclosure:=AValue; 1549 MarkPropertyChanged(AIndex); 1550end; 1551 1552 1553 1554Procedure TLegInfo.Setorigin(AIndex : Integer; const AValue : String); 1555 1556begin 1557 If (Forigin=AValue) then exit; 1558 Forigin:=AValue; 1559 MarkPropertyChanged(AIndex); 1560end; 1561 1562 1563 1564Procedure TLegInfo.SetoriginTerminal(AIndex : Integer; const AValue : String); 1565 1566begin 1567 If (ForiginTerminal=AValue) then exit; 1568 ForiginTerminal:=AValue; 1569 MarkPropertyChanged(AIndex); 1570end; 1571 1572 1573 1574Procedure TLegInfo.Setsecure(AIndex : Integer; const AValue : boolean); 1575 1576begin 1577 If (Fsecure=AValue) then exit; 1578 Fsecure:=AValue; 1579 MarkPropertyChanged(AIndex); 1580end; 1581 1582 1583 1584 1585 1586{ -------------------------------------------------------------------- 1587 TPassengerCounts 1588 --------------------------------------------------------------------} 1589 1590 1591Procedure TPassengerCounts.SetadultCount(AIndex : Integer; const AValue : integer); 1592 1593begin 1594 If (FadultCount=AValue) then exit; 1595 FadultCount:=AValue; 1596 MarkPropertyChanged(AIndex); 1597end; 1598 1599 1600 1601Procedure TPassengerCounts.SetchildCount(AIndex : Integer; const AValue : integer); 1602 1603begin 1604 If (FchildCount=AValue) then exit; 1605 FchildCount:=AValue; 1606 MarkPropertyChanged(AIndex); 1607end; 1608 1609 1610 1611Procedure TPassengerCounts.SetinfantInLapCount(AIndex : Integer; const AValue : integer); 1612 1613begin 1614 If (FinfantInLapCount=AValue) then exit; 1615 FinfantInLapCount:=AValue; 1616 MarkPropertyChanged(AIndex); 1617end; 1618 1619 1620 1621Procedure TPassengerCounts.SetinfantInSeatCount(AIndex : Integer; const AValue : integer); 1622 1623begin 1624 If (FinfantInSeatCount=AValue) then exit; 1625 FinfantInSeatCount:=AValue; 1626 MarkPropertyChanged(AIndex); 1627end; 1628 1629 1630 1631Procedure TPassengerCounts.Setkind(AIndex : Integer; const AValue : String); 1632 1633begin 1634 If (Fkind=AValue) then exit; 1635 Fkind:=AValue; 1636 MarkPropertyChanged(AIndex); 1637end; 1638 1639 1640 1641Procedure TPassengerCounts.SetseniorCount(AIndex : Integer; const AValue : integer); 1642 1643begin 1644 If (FseniorCount=AValue) then exit; 1645 FseniorCount:=AValue; 1646 MarkPropertyChanged(AIndex); 1647end; 1648 1649 1650 1651 1652 1653{ -------------------------------------------------------------------- 1654 TPricingInfo 1655 --------------------------------------------------------------------} 1656 1657 1658Procedure TPricingInfo.SetbaseFareTotal(AIndex : Integer; const AValue : String); 1659 1660begin 1661 If (FbaseFareTotal=AValue) then exit; 1662 FbaseFareTotal:=AValue; 1663 MarkPropertyChanged(AIndex); 1664end; 1665 1666 1667 1668Procedure TPricingInfo.Setfare(AIndex : Integer; const AValue : TPricingInfoTypefareArray); 1669 1670begin 1671 If (Ffare=AValue) then exit; 1672 Ffare:=AValue; 1673 MarkPropertyChanged(AIndex); 1674end; 1675 1676 1677 1678Procedure TPricingInfo.SetfareCalculation(AIndex : Integer; const AValue : String); 1679 1680begin 1681 If (FfareCalculation=AValue) then exit; 1682 FfareCalculation:=AValue; 1683 MarkPropertyChanged(AIndex); 1684end; 1685 1686 1687 1688Procedure TPricingInfo.Setkind(AIndex : Integer; const AValue : String); 1689 1690begin 1691 If (Fkind=AValue) then exit; 1692 Fkind:=AValue; 1693 MarkPropertyChanged(AIndex); 1694end; 1695 1696 1697 1698Procedure TPricingInfo.SetlatestTicketingTime(AIndex : Integer; const AValue : String); 1699 1700begin 1701 If (FlatestTicketingTime=AValue) then exit; 1702 FlatestTicketingTime:=AValue; 1703 MarkPropertyChanged(AIndex); 1704end; 1705 1706 1707 1708Procedure TPricingInfo.Setpassengers(AIndex : Integer; const AValue : TPassengerCounts); 1709 1710begin 1711 If (Fpassengers=AValue) then exit; 1712 Fpassengers:=AValue; 1713 MarkPropertyChanged(AIndex); 1714end; 1715 1716 1717 1718Procedure TPricingInfo.Setptc(AIndex : Integer; const AValue : String); 1719 1720begin 1721 If (Fptc=AValue) then exit; 1722 Fptc:=AValue; 1723 MarkPropertyChanged(AIndex); 1724end; 1725 1726 1727 1728Procedure TPricingInfo.Setrefundable(AIndex : Integer; const AValue : boolean); 1729 1730begin 1731 If (Frefundable=AValue) then exit; 1732 Frefundable:=AValue; 1733 MarkPropertyChanged(AIndex); 1734end; 1735 1736 1737 1738Procedure TPricingInfo.SetsaleFareTotal(AIndex : Integer; const AValue : String); 1739 1740begin 1741 If (FsaleFareTotal=AValue) then exit; 1742 FsaleFareTotal:=AValue; 1743 MarkPropertyChanged(AIndex); 1744end; 1745 1746 1747 1748Procedure TPricingInfo.SetsaleTaxTotal(AIndex : Integer; const AValue : String); 1749 1750begin 1751 If (FsaleTaxTotal=AValue) then exit; 1752 FsaleTaxTotal:=AValue; 1753 MarkPropertyChanged(AIndex); 1754end; 1755 1756 1757 1758Procedure TPricingInfo.SetsaleTotal(AIndex : Integer; const AValue : String); 1759 1760begin 1761 If (FsaleTotal=AValue) then exit; 1762 FsaleTotal:=AValue; 1763 MarkPropertyChanged(AIndex); 1764end; 1765 1766 1767 1768Procedure TPricingInfo.SetsegmentPricing(AIndex : Integer; const AValue : TPricingInfoTypesegmentPricingArray); 1769 1770begin 1771 If (FsegmentPricing=AValue) then exit; 1772 FsegmentPricing:=AValue; 1773 MarkPropertyChanged(AIndex); 1774end; 1775 1776 1777 1778Procedure TPricingInfo.Settax(AIndex : Integer; const AValue : TPricingInfoTypetaxArray); 1779 1780begin 1781 If (Ftax=AValue) then exit; 1782 Ftax:=AValue; 1783 MarkPropertyChanged(AIndex); 1784end; 1785 1786 1787//2.6.4. bug workaround 1788{$IFDEF VER2_6} 1789Procedure TPricingInfo.SetArrayLength(Const AName : String; ALength : Longint); 1790 1791begin 1792 Case AName of 1793 'fare' : SetLength(Ffare,ALength); 1794 'segmentpricing' : SetLength(FsegmentPricing,ALength); 1795 'tax' : SetLength(Ftax,ALength); 1796 else 1797 Inherited SetArrayLength(AName,ALength); 1798 end; 1799end; 1800{$ENDIF VER2_6} 1801 1802 1803 1804 1805{ -------------------------------------------------------------------- 1806 TSegmentInfo 1807 --------------------------------------------------------------------} 1808 1809 1810Procedure TSegmentInfo.SetbookingCode(AIndex : Integer; const AValue : String); 1811 1812begin 1813 If (FbookingCode=AValue) then exit; 1814 FbookingCode:=AValue; 1815 MarkPropertyChanged(AIndex); 1816end; 1817 1818 1819 1820Procedure TSegmentInfo.SetbookingCodeCount(AIndex : Integer; const AValue : integer); 1821 1822begin 1823 If (FbookingCodeCount=AValue) then exit; 1824 FbookingCodeCount:=AValue; 1825 MarkPropertyChanged(AIndex); 1826end; 1827 1828 1829 1830Procedure TSegmentInfo.Setcabin(AIndex : Integer; const AValue : String); 1831 1832begin 1833 If (Fcabin=AValue) then exit; 1834 Fcabin:=AValue; 1835 MarkPropertyChanged(AIndex); 1836end; 1837 1838 1839 1840Procedure TSegmentInfo.SetconnectionDuration(AIndex : Integer; const AValue : integer); 1841 1842begin 1843 If (FconnectionDuration=AValue) then exit; 1844 FconnectionDuration:=AValue; 1845 MarkPropertyChanged(AIndex); 1846end; 1847 1848 1849 1850Procedure TSegmentInfo.Setduration(AIndex : Integer; const AValue : integer); 1851 1852begin 1853 If (Fduration=AValue) then exit; 1854 Fduration:=AValue; 1855 MarkPropertyChanged(AIndex); 1856end; 1857 1858 1859 1860Procedure TSegmentInfo.Setflight(AIndex : Integer; const AValue : TFlightInfo); 1861 1862begin 1863 If (Fflight=AValue) then exit; 1864 Fflight:=AValue; 1865 MarkPropertyChanged(AIndex); 1866end; 1867 1868 1869 1870Procedure TSegmentInfo.Setid(AIndex : Integer; const AValue : String); 1871 1872begin 1873 If (Fid=AValue) then exit; 1874 Fid:=AValue; 1875 MarkPropertyChanged(AIndex); 1876end; 1877 1878 1879 1880Procedure TSegmentInfo.Setkind(AIndex : Integer; const AValue : String); 1881 1882begin 1883 If (Fkind=AValue) then exit; 1884 Fkind:=AValue; 1885 MarkPropertyChanged(AIndex); 1886end; 1887 1888 1889 1890Procedure TSegmentInfo.Setleg(AIndex : Integer; const AValue : TSegmentInfoTypelegArray); 1891 1892begin 1893 If (Fleg=AValue) then exit; 1894 Fleg:=AValue; 1895 MarkPropertyChanged(AIndex); 1896end; 1897 1898 1899 1900Procedure TSegmentInfo.SetmarriedSegmentGroup(AIndex : Integer; const AValue : String); 1901 1902begin 1903 If (FmarriedSegmentGroup=AValue) then exit; 1904 FmarriedSegmentGroup:=AValue; 1905 MarkPropertyChanged(AIndex); 1906end; 1907 1908 1909 1910Procedure TSegmentInfo.SetsubjectToGovernmentApproval(AIndex : Integer; const AValue : boolean); 1911 1912begin 1913 If (FsubjectToGovernmentApproval=AValue) then exit; 1914 FsubjectToGovernmentApproval:=AValue; 1915 MarkPropertyChanged(AIndex); 1916end; 1917 1918 1919//2.6.4. bug workaround 1920{$IFDEF VER2_6} 1921Procedure TSegmentInfo.SetArrayLength(Const AName : String; ALength : Longint); 1922 1923begin 1924 Case AName of 1925 'leg' : SetLength(Fleg,ALength); 1926 else 1927 Inherited SetArrayLength(AName,ALength); 1928 end; 1929end; 1930{$ENDIF VER2_6} 1931 1932 1933 1934 1935{ -------------------------------------------------------------------- 1936 TSegmentPricing 1937 --------------------------------------------------------------------} 1938 1939 1940Procedure TSegmentPricing.SetfareId(AIndex : Integer; const AValue : String); 1941 1942begin 1943 If (FfareId=AValue) then exit; 1944 FfareId:=AValue; 1945 MarkPropertyChanged(AIndex); 1946end; 1947 1948 1949 1950Procedure TSegmentPricing.SetfreeBaggageOption(AIndex : Integer; const AValue : TSegmentPricingTypefreeBaggageOptionArray); 1951 1952begin 1953 If (FfreeBaggageOption=AValue) then exit; 1954 FfreeBaggageOption:=AValue; 1955 MarkPropertyChanged(AIndex); 1956end; 1957 1958 1959 1960Procedure TSegmentPricing.Setkind(AIndex : Integer; const AValue : String); 1961 1962begin 1963 If (Fkind=AValue) then exit; 1964 Fkind:=AValue; 1965 MarkPropertyChanged(AIndex); 1966end; 1967 1968 1969 1970Procedure TSegmentPricing.SetsegmentId(AIndex : Integer; const AValue : String); 1971 1972begin 1973 If (FsegmentId=AValue) then exit; 1974 FsegmentId:=AValue; 1975 MarkPropertyChanged(AIndex); 1976end; 1977 1978 1979//2.6.4. bug workaround 1980{$IFDEF VER2_6} 1981Procedure TSegmentPricing.SetArrayLength(Const AName : String; ALength : Longint); 1982 1983begin 1984 Case AName of 1985 'freebaggageoption' : SetLength(FfreeBaggageOption,ALength); 1986 else 1987 Inherited SetArrayLength(AName,ALength); 1988 end; 1989end; 1990{$ENDIF VER2_6} 1991 1992 1993 1994 1995{ -------------------------------------------------------------------- 1996 TSliceInfo 1997 --------------------------------------------------------------------} 1998 1999 2000Procedure TSliceInfo.Setduration(AIndex : Integer; const AValue : integer); 2001 2002begin 2003 If (Fduration=AValue) then exit; 2004 Fduration:=AValue; 2005 MarkPropertyChanged(AIndex); 2006end; 2007 2008 2009 2010Procedure TSliceInfo.Setkind(AIndex : Integer; const AValue : String); 2011 2012begin 2013 If (Fkind=AValue) then exit; 2014 Fkind:=AValue; 2015 MarkPropertyChanged(AIndex); 2016end; 2017 2018 2019 2020Procedure TSliceInfo.Setsegment(AIndex : Integer; const AValue : TSliceInfoTypesegmentArray); 2021 2022begin 2023 If (Fsegment=AValue) then exit; 2024 Fsegment:=AValue; 2025 MarkPropertyChanged(AIndex); 2026end; 2027 2028 2029//2.6.4. bug workaround 2030{$IFDEF VER2_6} 2031Procedure TSliceInfo.SetArrayLength(Const AName : String; ALength : Longint); 2032 2033begin 2034 Case AName of 2035 'segment' : SetLength(Fsegment,ALength); 2036 else 2037 Inherited SetArrayLength(AName,ALength); 2038 end; 2039end; 2040{$ENDIF VER2_6} 2041 2042 2043 2044 2045{ -------------------------------------------------------------------- 2046 TSliceInput 2047 --------------------------------------------------------------------} 2048 2049 2050Procedure TSliceInput.Setalliance(AIndex : Integer; const AValue : String); 2051 2052begin 2053 If (Falliance=AValue) then exit; 2054 Falliance:=AValue; 2055 MarkPropertyChanged(AIndex); 2056end; 2057 2058 2059 2060Procedure TSliceInput.Setdate(AIndex : Integer; const AValue : String); 2061 2062begin 2063 If (Fdate=AValue) then exit; 2064 Fdate:=AValue; 2065 MarkPropertyChanged(AIndex); 2066end; 2067 2068 2069 2070Procedure TSliceInput.Setdestination(AIndex : Integer; const AValue : String); 2071 2072begin 2073 If (Fdestination=AValue) then exit; 2074 Fdestination:=AValue; 2075 MarkPropertyChanged(AIndex); 2076end; 2077 2078 2079 2080Procedure TSliceInput.Setkind(AIndex : Integer; const AValue : String); 2081 2082begin 2083 If (Fkind=AValue) then exit; 2084 Fkind:=AValue; 2085 MarkPropertyChanged(AIndex); 2086end; 2087 2088 2089 2090Procedure TSliceInput.SetmaxConnectionDuration(AIndex : Integer; const AValue : integer); 2091 2092begin 2093 If (FmaxConnectionDuration=AValue) then exit; 2094 FmaxConnectionDuration:=AValue; 2095 MarkPropertyChanged(AIndex); 2096end; 2097 2098 2099 2100Procedure TSliceInput.SetmaxStops(AIndex : Integer; const AValue : integer); 2101 2102begin 2103 If (FmaxStops=AValue) then exit; 2104 FmaxStops:=AValue; 2105 MarkPropertyChanged(AIndex); 2106end; 2107 2108 2109 2110Procedure TSliceInput.Setorigin(AIndex : Integer; const AValue : String); 2111 2112begin 2113 If (Forigin=AValue) then exit; 2114 Forigin:=AValue; 2115 MarkPropertyChanged(AIndex); 2116end; 2117 2118 2119 2120Procedure TSliceInput.SetpermittedCarrier(AIndex : Integer; const AValue : TStringArray); 2121 2122begin 2123 If (FpermittedCarrier=AValue) then exit; 2124 FpermittedCarrier:=AValue; 2125 MarkPropertyChanged(AIndex); 2126end; 2127 2128 2129 2130Procedure TSliceInput.SetpermittedDepartureTime(AIndex : Integer; const AValue : TTimeOfDayRange); 2131 2132begin 2133 If (FpermittedDepartureTime=AValue) then exit; 2134 FpermittedDepartureTime:=AValue; 2135 MarkPropertyChanged(AIndex); 2136end; 2137 2138 2139 2140Procedure TSliceInput.SetpreferredCabin(AIndex : Integer; const AValue : String); 2141 2142begin 2143 If (FpreferredCabin=AValue) then exit; 2144 FpreferredCabin:=AValue; 2145 MarkPropertyChanged(AIndex); 2146end; 2147 2148 2149 2150Procedure TSliceInput.SetprohibitedCarrier(AIndex : Integer; const AValue : TStringArray); 2151 2152begin 2153 If (FprohibitedCarrier=AValue) then exit; 2154 FprohibitedCarrier:=AValue; 2155 MarkPropertyChanged(AIndex); 2156end; 2157 2158 2159//2.6.4. bug workaround 2160{$IFDEF VER2_6} 2161Procedure TSliceInput.SetArrayLength(Const AName : String; ALength : Longint); 2162 2163begin 2164 Case AName of 2165 'permittedcarrier' : SetLength(FpermittedCarrier,ALength); 2166 'prohibitedcarrier' : SetLength(FprohibitedCarrier,ALength); 2167 else 2168 Inherited SetArrayLength(AName,ALength); 2169 end; 2170end; 2171{$ENDIF VER2_6} 2172 2173 2174 2175 2176{ -------------------------------------------------------------------- 2177 TTaxData 2178 --------------------------------------------------------------------} 2179 2180 2181Procedure TTaxData.Setid(AIndex : Integer; const AValue : String); 2182 2183begin 2184 If (Fid=AValue) then exit; 2185 Fid:=AValue; 2186 MarkPropertyChanged(AIndex); 2187end; 2188 2189 2190 2191Procedure TTaxData.Setkind(AIndex : Integer; const AValue : String); 2192 2193begin 2194 If (Fkind=AValue) then exit; 2195 Fkind:=AValue; 2196 MarkPropertyChanged(AIndex); 2197end; 2198 2199 2200 2201Procedure TTaxData.Setname(AIndex : Integer; const AValue : String); 2202 2203begin 2204 If (Fname=AValue) then exit; 2205 Fname:=AValue; 2206 MarkPropertyChanged(AIndex); 2207end; 2208 2209 2210 2211 2212 2213{ -------------------------------------------------------------------- 2214 TTaxInfo 2215 --------------------------------------------------------------------} 2216 2217 2218Procedure TTaxInfo.SetchargeType(AIndex : Integer; const AValue : String); 2219 2220begin 2221 If (FchargeType=AValue) then exit; 2222 FchargeType:=AValue; 2223 MarkPropertyChanged(AIndex); 2224end; 2225 2226 2227 2228Procedure TTaxInfo.Setcode(AIndex : Integer; const AValue : String); 2229 2230begin 2231 If (Fcode=AValue) then exit; 2232 Fcode:=AValue; 2233 MarkPropertyChanged(AIndex); 2234end; 2235 2236 2237 2238Procedure TTaxInfo.Setcountry(AIndex : Integer; const AValue : String); 2239 2240begin 2241 If (Fcountry=AValue) then exit; 2242 Fcountry:=AValue; 2243 MarkPropertyChanged(AIndex); 2244end; 2245 2246 2247 2248Procedure TTaxInfo.Setid(AIndex : Integer; const AValue : String); 2249 2250begin 2251 If (Fid=AValue) then exit; 2252 Fid:=AValue; 2253 MarkPropertyChanged(AIndex); 2254end; 2255 2256 2257 2258Procedure TTaxInfo.Setkind(AIndex : Integer; const AValue : String); 2259 2260begin 2261 If (Fkind=AValue) then exit; 2262 Fkind:=AValue; 2263 MarkPropertyChanged(AIndex); 2264end; 2265 2266 2267 2268Procedure TTaxInfo.SetsalePrice(AIndex : Integer; const AValue : String); 2269 2270begin 2271 If (FsalePrice=AValue) then exit; 2272 FsalePrice:=AValue; 2273 MarkPropertyChanged(AIndex); 2274end; 2275 2276 2277 2278 2279 2280{ -------------------------------------------------------------------- 2281 TTimeOfDayRange 2282 --------------------------------------------------------------------} 2283 2284 2285Procedure TTimeOfDayRange.SetearliestTime(AIndex : Integer; const AValue : String); 2286 2287begin 2288 If (FearliestTime=AValue) then exit; 2289 FearliestTime:=AValue; 2290 MarkPropertyChanged(AIndex); 2291end; 2292 2293 2294 2295Procedure TTimeOfDayRange.Setkind(AIndex : Integer; const AValue : String); 2296 2297begin 2298 If (Fkind=AValue) then exit; 2299 Fkind:=AValue; 2300 MarkPropertyChanged(AIndex); 2301end; 2302 2303 2304 2305Procedure TTimeOfDayRange.SetlatestTime(AIndex : Integer; const AValue : String); 2306 2307begin 2308 If (FlatestTime=AValue) then exit; 2309 FlatestTime:=AValue; 2310 MarkPropertyChanged(AIndex); 2311end; 2312 2313 2314 2315 2316 2317{ -------------------------------------------------------------------- 2318 TTripOption 2319 --------------------------------------------------------------------} 2320 2321 2322Procedure TTripOption.Setid(AIndex : Integer; const AValue : String); 2323 2324begin 2325 If (Fid=AValue) then exit; 2326 Fid:=AValue; 2327 MarkPropertyChanged(AIndex); 2328end; 2329 2330 2331 2332Procedure TTripOption.Setkind(AIndex : Integer; const AValue : String); 2333 2334begin 2335 If (Fkind=AValue) then exit; 2336 Fkind:=AValue; 2337 MarkPropertyChanged(AIndex); 2338end; 2339 2340 2341 2342Procedure TTripOption.Setpricing(AIndex : Integer; const AValue : TTripOptionTypepricingArray); 2343 2344begin 2345 If (Fpricing=AValue) then exit; 2346 Fpricing:=AValue; 2347 MarkPropertyChanged(AIndex); 2348end; 2349 2350 2351 2352Procedure TTripOption.SetsaleTotal(AIndex : Integer; const AValue : String); 2353 2354begin 2355 If (FsaleTotal=AValue) then exit; 2356 FsaleTotal:=AValue; 2357 MarkPropertyChanged(AIndex); 2358end; 2359 2360 2361 2362Procedure TTripOption.Setslice(AIndex : Integer; const AValue : TTripOptionTypesliceArray); 2363 2364begin 2365 If (Fslice=AValue) then exit; 2366 Fslice:=AValue; 2367 MarkPropertyChanged(AIndex); 2368end; 2369 2370 2371//2.6.4. bug workaround 2372{$IFDEF VER2_6} 2373Procedure TTripOption.SetArrayLength(Const AName : String; ALength : Longint); 2374 2375begin 2376 Case AName of 2377 'pricing' : SetLength(Fpricing,ALength); 2378 'slice' : SetLength(Fslice,ALength); 2379 else 2380 Inherited SetArrayLength(AName,ALength); 2381 end; 2382end; 2383{$ENDIF VER2_6} 2384 2385 2386 2387 2388{ -------------------------------------------------------------------- 2389 TTripOptionsRequest 2390 --------------------------------------------------------------------} 2391 2392 2393Procedure TTripOptionsRequest.SetmaxPrice(AIndex : Integer; const AValue : String); 2394 2395begin 2396 If (FmaxPrice=AValue) then exit; 2397 FmaxPrice:=AValue; 2398 MarkPropertyChanged(AIndex); 2399end; 2400 2401 2402 2403Procedure TTripOptionsRequest.Setpassengers(AIndex : Integer; const AValue : TPassengerCounts); 2404 2405begin 2406 If (Fpassengers=AValue) then exit; 2407 Fpassengers:=AValue; 2408 MarkPropertyChanged(AIndex); 2409end; 2410 2411 2412 2413Procedure TTripOptionsRequest.Setrefundable(AIndex : Integer; const AValue : boolean); 2414 2415begin 2416 If (Frefundable=AValue) then exit; 2417 Frefundable:=AValue; 2418 MarkPropertyChanged(AIndex); 2419end; 2420 2421 2422 2423Procedure TTripOptionsRequest.SetsaleCountry(AIndex : Integer; const AValue : String); 2424 2425begin 2426 If (FsaleCountry=AValue) then exit; 2427 FsaleCountry:=AValue; 2428 MarkPropertyChanged(AIndex); 2429end; 2430 2431 2432 2433Procedure TTripOptionsRequest.Setslice(AIndex : Integer; const AValue : TTripOptionsRequestTypesliceArray); 2434 2435begin 2436 If (Fslice=AValue) then exit; 2437 Fslice:=AValue; 2438 MarkPropertyChanged(AIndex); 2439end; 2440 2441 2442 2443Procedure TTripOptionsRequest.Setsolutions(AIndex : Integer; const AValue : integer); 2444 2445begin 2446 If (Fsolutions=AValue) then exit; 2447 Fsolutions:=AValue; 2448 MarkPropertyChanged(AIndex); 2449end; 2450 2451 2452//2.6.4. bug workaround 2453{$IFDEF VER2_6} 2454Procedure TTripOptionsRequest.SetArrayLength(Const AName : String; ALength : Longint); 2455 2456begin 2457 Case AName of 2458 'slice' : SetLength(Fslice,ALength); 2459 else 2460 Inherited SetArrayLength(AName,ALength); 2461 end; 2462end; 2463{$ENDIF VER2_6} 2464 2465 2466 2467 2468{ -------------------------------------------------------------------- 2469 TTripOptionsResponse 2470 --------------------------------------------------------------------} 2471 2472 2473Procedure TTripOptionsResponse.Setdata(AIndex : Integer; const AValue : TData); 2474 2475begin 2476 If (Fdata=AValue) then exit; 2477 Fdata:=AValue; 2478 MarkPropertyChanged(AIndex); 2479end; 2480 2481 2482 2483Procedure TTripOptionsResponse.Setkind(AIndex : Integer; const AValue : String); 2484 2485begin 2486 If (Fkind=AValue) then exit; 2487 Fkind:=AValue; 2488 MarkPropertyChanged(AIndex); 2489end; 2490 2491 2492 2493Procedure TTripOptionsResponse.SetrequestId(AIndex : Integer; const AValue : String); 2494 2495begin 2496 If (FrequestId=AValue) then exit; 2497 FrequestId:=AValue; 2498 MarkPropertyChanged(AIndex); 2499end; 2500 2501 2502 2503Procedure TTripOptionsResponse.SettripOption(AIndex : Integer; const AValue : TTripOptionsResponseTypetripOptionArray); 2504 2505begin 2506 If (FtripOption=AValue) then exit; 2507 FtripOption:=AValue; 2508 MarkPropertyChanged(AIndex); 2509end; 2510 2511 2512//2.6.4. bug workaround 2513{$IFDEF VER2_6} 2514Procedure TTripOptionsResponse.SetArrayLength(Const AName : String; ALength : Longint); 2515 2516begin 2517 Case AName of 2518 'tripoption' : SetLength(FtripOption,ALength); 2519 else 2520 Inherited SetArrayLength(AName,ALength); 2521 end; 2522end; 2523{$ENDIF VER2_6} 2524 2525 2526 2527 2528{ -------------------------------------------------------------------- 2529 TTripsSearchRequest 2530 --------------------------------------------------------------------} 2531 2532 2533Procedure TTripsSearchRequest.Setrequest(AIndex : Integer; const AValue : TTripOptionsRequest); 2534 2535begin 2536 If (Frequest=AValue) then exit; 2537 Frequest:=AValue; 2538 MarkPropertyChanged(AIndex); 2539end; 2540 2541 2542 2543 2544 2545{ -------------------------------------------------------------------- 2546 TTripsSearchResponse 2547 --------------------------------------------------------------------} 2548 2549 2550Procedure TTripsSearchResponse.Setkind(AIndex : Integer; const AValue : String); 2551 2552begin 2553 If (Fkind=AValue) then exit; 2554 Fkind:=AValue; 2555 MarkPropertyChanged(AIndex); 2556end; 2557 2558 2559 2560Procedure TTripsSearchResponse.Settrips(AIndex : Integer; const AValue : TTripOptionsResponse); 2561 2562begin 2563 If (Ftrips=AValue) then exit; 2564 Ftrips:=AValue; 2565 MarkPropertyChanged(AIndex); 2566end; 2567 2568 2569 2570 2571 2572{ -------------------------------------------------------------------- 2573 TTripsResource 2574 --------------------------------------------------------------------} 2575 2576 2577Class Function TTripsResource.ResourceName : String; 2578 2579begin 2580 Result:='trips'; 2581end; 2582 2583Class Function TTripsResource.DefaultAPI : TGoogleAPIClass; 2584 2585begin 2586 Result:=TqpxExpressAPI; 2587end; 2588 2589Function TTripsResource.Search(aTripsSearchRequest : TTripsSearchRequest) : TTripsSearchResponse; 2590 2591Const 2592 _HTTPMethod = 'POST'; 2593 _Path = 'search'; 2594 _Methodid = 'qpxExpress.trips.search'; 2595 2596begin 2597 Result:=ServiceCall(_HTTPMethod,_Path,'',aTripsSearchRequest,TTripsSearchResponse) as TTripsSearchResponse; 2598end; 2599 2600 2601 2602{ -------------------------------------------------------------------- 2603 TQpxExpressAPI 2604 --------------------------------------------------------------------} 2605 2606Class Function TQpxExpressAPI.APIName : String; 2607 2608begin 2609 Result:='qpxExpress'; 2610end; 2611 2612Class Function TQpxExpressAPI.APIVersion : String; 2613 2614begin 2615 Result:='v1'; 2616end; 2617 2618Class Function TQpxExpressAPI.APIRevision : String; 2619 2620begin 2621 Result:='20160307'; 2622end; 2623 2624Class Function TQpxExpressAPI.APIID : String; 2625 2626begin 2627 Result:='qpxExpress:v1'; 2628end; 2629 2630Class Function TQpxExpressAPI.APITitle : String; 2631 2632begin 2633 Result:='QPX Express API'; 2634end; 2635 2636Class Function TQpxExpressAPI.APIDescription : String; 2637 2638begin 2639 Result:='Finds the least expensive flights between an origin and a destination.'; 2640end; 2641 2642Class Function TQpxExpressAPI.APIOwnerDomain : String; 2643 2644begin 2645 Result:='google.com'; 2646end; 2647 2648Class Function TQpxExpressAPI.APIOwnerName : String; 2649 2650begin 2651 Result:='Google'; 2652end; 2653 2654Class Function TQpxExpressAPI.APIIcon16 : String; 2655 2656begin 2657 Result:='http://www.google.com/images/icons/product/search-16.gif'; 2658end; 2659 2660Class Function TQpxExpressAPI.APIIcon32 : String; 2661 2662begin 2663 Result:='http://www.google.com/images/icons/product/search-32.gif'; 2664end; 2665 2666Class Function TQpxExpressAPI.APIdocumentationLink : String; 2667 2668begin 2669 Result:='http://developers.google.com/qpx-express'; 2670end; 2671 2672Class Function TQpxExpressAPI.APIrootUrl : string; 2673 2674begin 2675 Result:='https://www.googleapis.com/'; 2676end; 2677 2678Class Function TQpxExpressAPI.APIbasePath : string; 2679 2680begin 2681 Result:='/qpxExpress/v1/trips/'; 2682end; 2683 2684Class Function TQpxExpressAPI.APIbaseURL : String; 2685 2686begin 2687 Result:='https://www.googleapis.com/qpxExpress/v1/trips/'; 2688end; 2689 2690Class Function TQpxExpressAPI.APIProtocol : string; 2691 2692begin 2693 Result:='rest'; 2694end; 2695 2696Class Function TQpxExpressAPI.APIservicePath : string; 2697 2698begin 2699 Result:='qpxExpress/v1/trips/'; 2700end; 2701 2702Class Function TQpxExpressAPI.APIbatchPath : String; 2703 2704begin 2705 Result:='batch'; 2706end; 2707 2708Class Function TQpxExpressAPI.APIAuthScopes : TScopeInfoArray; 2709 2710begin 2711 SetLength(Result,0); 2712 2713end; 2714 2715Class Function TQpxExpressAPI.APINeedsAuth : Boolean; 2716 2717begin 2718 Result:=False; 2719end; 2720 2721Class Procedure TQpxExpressAPI.RegisterAPIResources; 2722 2723begin 2724 TAircraftData.RegisterObject; 2725 TAirportData.RegisterObject; 2726 TBagDescriptor.RegisterObject; 2727 TCarrierData.RegisterObject; 2728 TCityData.RegisterObject; 2729 TData.RegisterObject; 2730 TFareInfo.RegisterObject; 2731 TFlightInfo.RegisterObject; 2732 TFreeBaggageAllowance.RegisterObject; 2733 TLegInfo.RegisterObject; 2734 TPassengerCounts.RegisterObject; 2735 TPricingInfo.RegisterObject; 2736 TSegmentInfo.RegisterObject; 2737 TSegmentPricing.RegisterObject; 2738 TSliceInfo.RegisterObject; 2739 TSliceInput.RegisterObject; 2740 TTaxData.RegisterObject; 2741 TTaxInfo.RegisterObject; 2742 TTimeOfDayRange.RegisterObject; 2743 TTripOption.RegisterObject; 2744 TTripOptionsRequest.RegisterObject; 2745 TTripOptionsResponse.RegisterObject; 2746 TTripsSearchRequest.RegisterObject; 2747 TTripsSearchResponse.RegisterObject; 2748end; 2749 2750 2751Function TQpxExpressAPI.GetTripsInstance : TTripsResource; 2752 2753begin 2754 if (FTripsInstance=Nil) then 2755 FTripsInstance:=CreateTripsResource; 2756 Result:=FTripsInstance; 2757end; 2758 2759Function TQpxExpressAPI.CreateTripsResource : TTripsResource; 2760 2761begin 2762 Result:=CreateTripsResource(Self); 2763end; 2764 2765 2766Function TQpxExpressAPI.CreateTripsResource(AOwner : TComponent) : TTripsResource; 2767 2768begin 2769 Result:=TTripsResource.Create(AOwner); 2770 Result.API:=Self.API; 2771end; 2772 2773 2774 2775initialization 2776 TQpxExpressAPI.RegisterAPI; 2777end. 2778