Complex classes like Client often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Client, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 40 | class Client extends Base |
||
| 41 | { |
||
| 42 | /** |
||
| 43 | * Amadeus SOAP header version 1 |
||
| 44 | */ |
||
| 45 | const HEADER_V1 = "1"; |
||
| 46 | /** |
||
| 47 | * Amadeus SOAP header version 2 |
||
| 48 | */ |
||
| 49 | const HEADER_V2 = "2"; |
||
| 50 | /** |
||
| 51 | * Amadeus SOAP header version 4 |
||
| 52 | */ |
||
| 53 | const HEADER_V4 = "4"; |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Version string |
||
| 57 | * |
||
| 58 | * @var string |
||
| 59 | */ |
||
| 60 | const VERSION = "1.7.0-dev"; |
||
| 61 | |||
| 62 | /** |
||
| 63 | * An identifier string for the library (to be used in Received From entries) |
||
| 64 | * |
||
| 65 | * @var string |
||
| 66 | */ |
||
| 67 | const RECEIVED_FROM_IDENTIFIER = "amabnl-amadeus-ws-client"; |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @var string |
||
| 71 | */ |
||
| 72 | protected $lastMessage; |
||
| 73 | |||
| 74 | /** |
||
| 75 | * Set the session as stateful (true) or stateless (false) |
||
| 76 | * |
||
| 77 | * @param bool $newStateful |
||
| 78 | */ |
||
| 79 | 4 | public function setStateful($newStateful) |
|
| 83 | |||
| 84 | /** |
||
| 85 | * @return bool |
||
| 86 | */ |
||
| 87 | 12 | public function isStateful() |
|
| 91 | |||
| 92 | /** |
||
| 93 | * Get the last raw XML message that was sent out |
||
| 94 | * |
||
| 95 | * @return string|null |
||
| 96 | */ |
||
| 97 | 4 | public function getLastRequest() |
|
| 101 | |||
| 102 | /** |
||
| 103 | * Get the last raw XML message that was received |
||
| 104 | * |
||
| 105 | * @return string|null |
||
| 106 | */ |
||
| 107 | 4 | public function getLastResponse() |
|
| 111 | |||
| 112 | /** |
||
| 113 | * Get the request headers for the last SOAP message that was sent out |
||
| 114 | * |
||
| 115 | * @return string|null |
||
| 116 | */ |
||
| 117 | 4 | public function getLastRequestHeaders() |
|
| 121 | |||
| 122 | /** |
||
| 123 | * Get the response headers for the last SOAP message that was received |
||
| 124 | * |
||
| 125 | * @return string|null |
||
| 126 | */ |
||
| 127 | 4 | public function getLastResponseHeaders() |
|
| 131 | |||
| 132 | /** |
||
| 133 | * Get session information for authenticated session |
||
| 134 | * |
||
| 135 | * - sessionId |
||
| 136 | * - sequenceNr |
||
| 137 | * - securityToken |
||
| 138 | * |
||
| 139 | * @return array|null |
||
| 140 | */ |
||
| 141 | 4 | public function getSessionData() |
|
| 145 | |||
| 146 | /** |
||
| 147 | * Restore a previously used session |
||
| 148 | * |
||
| 149 | * To be used when implementing your own session pooling system on legacy Soap Header 2 applications. |
||
| 150 | * |
||
| 151 | * @param array $sessionData |
||
| 152 | * @return bool |
||
| 153 | */ |
||
| 154 | 4 | public function setSessionData(array $sessionData) |
|
| 158 | |||
| 159 | /** |
||
| 160 | * Construct Amadeus Web Services client |
||
| 161 | * |
||
| 162 | * @param Params $params |
||
| 163 | */ |
||
| 164 | 348 | public function __construct(Params $params) |
|
| 172 | |||
| 173 | /** |
||
| 174 | * Authenticate. |
||
| 175 | * |
||
| 176 | * Authentication Parameters were provided at construction time (authParams) |
||
| 177 | * |
||
| 178 | * @return Result |
||
| 179 | * @throws Exception |
||
| 180 | */ |
||
| 181 | 8 | public function securityAuthenticate() |
|
| 194 | |||
| 195 | /** |
||
| 196 | * Terminate a session - only applicable to non-stateless mode. |
||
| 197 | * |
||
| 198 | * @return Result |
||
| 199 | * @throws Exception |
||
| 200 | */ |
||
| 201 | 4 | public function securitySignOut() |
|
| 212 | |||
| 213 | /** |
||
| 214 | * PNR_Retrieve - Retrieve an Amadeus PNR by record locator |
||
| 215 | * |
||
| 216 | * @param RequestOptions\PnrRetrieveOptions $options |
||
| 217 | * @param array $messageOptions (OPTIONAL) |
||
| 218 | * @return Result |
||
| 219 | * @throws Client\InvalidMessageException |
||
| 220 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 221 | * @throws Exception |
||
| 222 | */ |
||
| 223 | 4 | public function pnrRetrieve(RequestOptions\PnrRetrieveOptions $options, $messageOptions = []) |
|
| 229 | |||
| 230 | /** |
||
| 231 | * Create a PNR using PNR_AddMultiElements |
||
| 232 | * |
||
| 233 | * @param RequestOptions\PnrCreatePnrOptions $options |
||
| 234 | * @param array $messageOptions (OPTIONAL) |
||
| 235 | * @return Result |
||
| 236 | * @throws Client\InvalidMessageException |
||
| 237 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 238 | * @throws Exception |
||
| 239 | */ |
||
| 240 | 4 | public function pnrCreatePnr(RequestOptions\PnrCreatePnrOptions $options, $messageOptions = []) |
|
| 246 | |||
| 247 | /** |
||
| 248 | * PNR_AddMultiElements - Create a new PNR or update an existing PNR. |
||
| 249 | * |
||
| 250 | * https://webservices.amadeus.com/extranet/viewService.do?id=25&flavourId=1&menuId=functional |
||
| 251 | * |
||
| 252 | * @param RequestOptions\PnrAddMultiElementsOptions $options |
||
| 253 | * @param array $messageOptions (OPTIONAL) |
||
| 254 | * @return Result |
||
| 255 | * @throws Client\InvalidMessageException |
||
| 256 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 257 | * @throws Exception |
||
| 258 | */ |
||
| 259 | 8 | public function pnrAddMultiElements(RequestOptions\PnrAddMultiElementsOptions $options, $messageOptions = []) |
|
| 265 | |||
| 266 | /** |
||
| 267 | * PNR_RetrieveAndDisplay - Retrieve an Amadeus PNR by record locator including extra info |
||
| 268 | * |
||
| 269 | * This extra info is info you cannot see in the regular PNR, like Offers. |
||
| 270 | * |
||
| 271 | * https://webservices.amadeus.com/extranet/viewService.do?id=1922&flavourId=1&menuId=functional |
||
| 272 | * |
||
| 273 | * @param RequestOptions\PnrRetrieveAndDisplayOptions $options Amadeus Record Locator for PNR |
||
| 274 | * @param array $messageOptions (OPTIONAL) |
||
| 275 | * @return Result |
||
| 276 | * @throws Client\InvalidMessageException |
||
| 277 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 278 | * @throws Exception |
||
| 279 | **/ |
||
| 280 | 4 | public function pnrRetrieveAndDisplay(RequestOptions\PnrRetrieveAndDisplayOptions $options, $messageOptions = []) |
|
| 286 | |||
| 287 | /** |
||
| 288 | * PNR_Cancel |
||
| 289 | * |
||
| 290 | * @param RequestOptions\PnrCancelOptions $options |
||
| 291 | * @param array $messageOptions (OPTIONAL) |
||
| 292 | * @return Result |
||
| 293 | * @throws Client\InvalidMessageException |
||
| 294 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 295 | * @throws Exception |
||
| 296 | */ |
||
| 297 | 4 | public function pnrCancel(RequestOptions\PnrCancelOptions $options, $messageOptions = []) |
|
| 303 | |||
| 304 | /** |
||
| 305 | * PNR_DisplayHistory |
||
| 306 | * |
||
| 307 | * @param RequestOptions\PnrDisplayHistoryOptions $options |
||
| 308 | * @param array $messageOptions (OPTIONAL) |
||
| 309 | * @return Result |
||
| 310 | * @throws Client\InvalidMessageException |
||
| 311 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 312 | * @throws Exception |
||
| 313 | */ |
||
| 314 | 4 | public function pnrDisplayHistory(RequestOptions\PnrDisplayHistoryOptions $options, $messageOptions = []) |
|
| 320 | |||
| 321 | /** |
||
| 322 | * PNR_TransferOwnership |
||
| 323 | * |
||
| 324 | * @param RequestOptions\PnrTransferOwnershipOptions $options |
||
| 325 | * @param array $messageOptions (OPTIONAL) |
||
| 326 | * @return Result |
||
| 327 | * @throws Client\InvalidMessageException |
||
| 328 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 329 | * @throws Exception |
||
| 330 | */ |
||
| 331 | 4 | public function pnrTransferOwnership(RequestOptions\PnrTransferOwnershipOptions $options, $messageOptions = []) |
|
| 337 | |||
| 338 | /** |
||
| 339 | * PNR_NameChange |
||
| 340 | * |
||
| 341 | * @param RequestOptions\PnrNameChangeOptions $options |
||
| 342 | * @param array $messageOptions (OPTIONAL) |
||
| 343 | * @return Result |
||
| 344 | * @throws Client\InvalidMessageException |
||
| 345 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 346 | * @throws Exception |
||
| 347 | */ |
||
| 348 | 4 | public function pnrNameChange(RequestOptions\PnrNameChangeOptions $options, $messageOptions = []) |
|
| 354 | |||
| 355 | /** |
||
| 356 | * Queue_List - get a list of all PNR's on a given queue |
||
| 357 | * |
||
| 358 | * https://webservices.amadeus.com/extranet/viewService.do?id=52&flavourId=1&menuId=functional |
||
| 359 | * |
||
| 360 | * @param RequestOptions\QueueListOptions $options |
||
| 361 | * @param array $messageOptions (OPTIONAL) |
||
| 362 | * @return Result |
||
| 363 | * @throws Client\InvalidMessageException |
||
| 364 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 365 | * @throws Exception |
||
| 366 | */ |
||
| 367 | 4 | public function queueList(RequestOptions\QueueListOptions $options, $messageOptions = []) |
|
| 373 | |||
| 374 | /** |
||
| 375 | * Queue_PlacePNR - Place a PNR on a given queue |
||
| 376 | * |
||
| 377 | * @param RequestOptions\QueuePlacePnrOptions $options |
||
| 378 | * @param array $messageOptions (OPTIONAL) |
||
| 379 | * @return Result |
||
| 380 | * @throws Client\InvalidMessageException |
||
| 381 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 382 | * @throws Exception |
||
| 383 | */ |
||
| 384 | 4 | public function queuePlacePnr(RequestOptions\QueuePlacePnrOptions $options, $messageOptions = []) |
|
| 390 | |||
| 391 | /** |
||
| 392 | * Queue_RemoveItem - remove an item (a PNR) from a given queue |
||
| 393 | * |
||
| 394 | * @param RequestOptions\QueueRemoveItemOptions $options |
||
| 395 | * @param array $messageOptions (OPTIONAL) |
||
| 396 | * @return Result |
||
| 397 | * @throws Client\InvalidMessageException |
||
| 398 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 399 | * @throws Exception |
||
| 400 | */ |
||
| 401 | 4 | public function queueRemoveItem(RequestOptions\QueueRemoveItemOptions $options, $messageOptions = []) |
|
| 407 | |||
| 408 | /** |
||
| 409 | * Queue_MoveItem - move an item (a PNR) from one queue to another. |
||
| 410 | * |
||
| 411 | * @param RequestOptions\QueueMoveItemOptions $options |
||
| 412 | * @param array $messageOptions (OPTIONAL) |
||
| 413 | * @return Result |
||
| 414 | * @throws Client\InvalidMessageException |
||
| 415 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 416 | * @throws Exception |
||
| 417 | */ |
||
| 418 | 4 | public function queueMoveItem(RequestOptions\QueueMoveItemOptions $options, $messageOptions = []) |
|
| 424 | |||
| 425 | /** |
||
| 426 | * Offer_CreateOffer |
||
| 427 | * |
||
| 428 | * @param RequestOptions\OfferCreateOptions $options |
||
| 429 | * @param array $messageOptions (OPTIONAL) |
||
| 430 | * @return Result |
||
| 431 | * @throws Client\InvalidMessageException |
||
| 432 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 433 | * @throws Exception |
||
| 434 | */ |
||
| 435 | 4 | public function offerCreate(RequestOptions\OfferCreateOptions $options, $messageOptions = []) |
|
| 441 | |||
| 442 | /** |
||
| 443 | * Offer_VerifyOffer |
||
| 444 | * |
||
| 445 | * To be called in the context of an open PNR |
||
| 446 | * |
||
| 447 | * @param RequestOptions\OfferVerifyOptions $options |
||
| 448 | * @param array $messageOptions (OPTIONAL) |
||
| 449 | * @return Result |
||
| 450 | * @throws Client\InvalidMessageException |
||
| 451 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 452 | * @throws Exception |
||
| 453 | */ |
||
| 454 | 4 | public function offerVerify(RequestOptions\OfferVerifyOptions $options, $messageOptions = []) |
|
| 460 | |||
| 461 | /** |
||
| 462 | * Offer_ConfirmAirOffer |
||
| 463 | * |
||
| 464 | * @param RequestOptions\OfferConfirmAirOptions $options |
||
| 465 | * @param array $messageOptions (OPTIONAL) |
||
| 466 | * @return Result |
||
| 467 | * @throws Client\InvalidMessageException |
||
| 468 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 469 | * @throws Exception |
||
| 470 | */ |
||
| 471 | 4 | public function offerConfirmAir(RequestOptions\OfferConfirmAirOptions $options, $messageOptions = []) |
|
| 477 | |||
| 478 | /** |
||
| 479 | * Offer_ConfirmHotelOffer |
||
| 480 | * |
||
| 481 | * @param RequestOptions\OfferConfirmHotelOptions $options |
||
| 482 | * @param array $messageOptions (OPTIONAL) |
||
| 483 | * @return Result |
||
| 484 | * @throws Client\InvalidMessageException |
||
| 485 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 486 | * @throws Exception |
||
| 487 | */ |
||
| 488 | 4 | public function offerConfirmHotel(RequestOptions\OfferConfirmHotelOptions $options, $messageOptions = []) |
|
| 494 | |||
| 495 | /** |
||
| 496 | * Offer_ConfirmCarOffer |
||
| 497 | * |
||
| 498 | * @param RequestOptions\OfferConfirmCarOptions $options |
||
| 499 | * @param array $messageOptions (OPTIONAL) |
||
| 500 | * @return Result |
||
| 501 | * @throws Client\InvalidMessageException |
||
| 502 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 503 | * @throws Exception |
||
| 504 | */ |
||
| 505 | 4 | public function offerConfirmCar(RequestOptions\OfferConfirmCarOptions $options, $messageOptions = []) |
|
| 511 | |||
| 512 | /** |
||
| 513 | * Fare_MasterPricerExpertSearch |
||
| 514 | * |
||
| 515 | * @param RequestOptions\FareMasterPricerExSearch $options |
||
| 516 | * @param array $messageOptions (OPTIONAL) |
||
| 517 | * @return Result |
||
| 518 | * @throws Client\InvalidMessageException |
||
| 519 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 520 | * @throws Exception |
||
| 521 | */ |
||
| 522 | public function fareMasterPricerExpertSearch( |
||
| 530 | |||
| 531 | |||
| 532 | /** |
||
| 533 | * Fare_MasterPricerTravelBoardSearch |
||
| 534 | * |
||
| 535 | * @param RequestOptions\FareMasterPricerTbSearch $options |
||
| 536 | * @param array $messageOptions (OPTIONAL) |
||
| 537 | * @return Result |
||
| 538 | * @throws Client\InvalidMessageException |
||
| 539 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 540 | * @throws Exception |
||
| 541 | */ |
||
| 542 | 4 | public function fareMasterPricerTravelBoardSearch( |
|
| 550 | |||
| 551 | /** |
||
| 552 | * Fare_MasterPricerCalendar |
||
| 553 | * |
||
| 554 | * @param RequestOptions\FareMasterPricerCalendarOptions $options |
||
| 555 | * @param array $messageOptions (OPTIONAL) |
||
| 556 | * @return Result |
||
| 557 | * @throws Client\InvalidMessageException |
||
| 558 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 559 | * @throws Exception |
||
| 560 | */ |
||
| 561 | 4 | public function fareMasterPricerCalendar( |
|
| 569 | |||
| 570 | /** |
||
| 571 | * Fare_PricePnrWithBookingClass |
||
| 572 | * |
||
| 573 | * @param RequestOptions\FarePricePnrWithBookingClassOptions $options |
||
| 574 | * @param array $messageOptions (OPTIONAL) |
||
| 575 | * @return Result |
||
| 576 | * @throws Client\InvalidMessageException |
||
| 577 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 578 | * @throws Exception |
||
| 579 | */ |
||
| 580 | 8 | public function farePricePnrWithBookingClass( |
|
| 588 | |||
| 589 | /** |
||
| 590 | * Fare_PricePnrWithLowerFares |
||
| 591 | * |
||
| 592 | * @param RequestOptions\FarePricePnrWithLowerFaresOptions $options |
||
| 593 | * @param array $messageOptions (OPTIONAL) |
||
| 594 | * @return Result |
||
| 595 | * @throws Client\InvalidMessageException |
||
| 596 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 597 | * @throws Exception |
||
| 598 | */ |
||
| 599 | 8 | public function farePricePnrWithLowerFares( |
|
| 607 | |||
| 608 | /** |
||
| 609 | * Fare_PricePnrWithLowestFare |
||
| 610 | * |
||
| 611 | * @param RequestOptions\FarePricePnrWithLowestFareOptions $options |
||
| 612 | * @param array $messageOptions (OPTIONAL) |
||
| 613 | * @return Result |
||
| 614 | * @throws Client\InvalidMessageException |
||
| 615 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 616 | * @throws Exception |
||
| 617 | */ |
||
| 618 | 8 | public function farePricePnrWithLowestFare( |
|
| 626 | |||
| 627 | /** |
||
| 628 | * Fare_InformativePricingWithoutPNR |
||
| 629 | * |
||
| 630 | * @param RequestOptions\FareInformativePricingWithoutPnrOptions $options |
||
| 631 | * @param array $messageOptions (OPTIONAL) |
||
| 632 | * @return Result |
||
| 633 | * @throws Client\InvalidMessageException |
||
| 634 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 635 | * @throws Exception |
||
| 636 | */ |
||
| 637 | 4 | public function fareInformativePricingWithoutPnr( |
|
| 645 | |||
| 646 | /** |
||
| 647 | * Fare_InformativeBestPricingWithoutPNR |
||
| 648 | * |
||
| 649 | * @param RequestOptions\FareInformativeBestPricingWithoutPnrOptions $options |
||
| 650 | * @param array $messageOptions (OPTIONAL) |
||
| 651 | * @return Result |
||
| 652 | * @throws Client\InvalidMessageException |
||
| 653 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 654 | * @throws Exception |
||
| 655 | */ |
||
| 656 | 4 | public function fareInformativeBestPricingWithoutPnr( |
|
| 664 | |||
| 665 | /** |
||
| 666 | * Fare_CheckRules |
||
| 667 | * |
||
| 668 | * @param RequestOptions\FareCheckRulesOptions $options |
||
| 669 | * @param array $messageOptions (OPTIONAL) |
||
| 670 | * @return Result |
||
| 671 | * @throws Client\InvalidMessageException |
||
| 672 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 673 | * @throws Exception |
||
| 674 | */ |
||
| 675 | 4 | public function fareCheckRules(RequestOptions\FareCheckRulesOptions $options, $messageOptions = []) |
|
| 681 | |||
| 682 | /** |
||
| 683 | * Fare_GetFareRules |
||
| 684 | * |
||
| 685 | * @param RequestOptions\FareGetFareRulesOptions $options |
||
| 686 | * @param array $messageOptions (OPTIONAL) |
||
| 687 | * @return Result |
||
| 688 | * @throws Client\InvalidMessageException |
||
| 689 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 690 | * @throws Exception |
||
| 691 | */ |
||
| 692 | 4 | public function fareGetFareRules(RequestOptions\FareGetFareRulesOptions $options, $messageOptions = []) |
|
| 698 | |||
| 699 | /** |
||
| 700 | * Fare_ConvertCurrency |
||
| 701 | * |
||
| 702 | * @param RequestOptions\FareConvertCurrencyOptions $options |
||
| 703 | * @param array $messageOptions (OPTIONAL) |
||
| 704 | * @return Result |
||
| 705 | * @throws Client\InvalidMessageException |
||
| 706 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 707 | * @throws Exception |
||
| 708 | */ |
||
| 709 | 4 | public function fareConvertCurrency(RequestOptions\FareConvertCurrencyOptions $options, $messageOptions = []) |
|
| 715 | |||
| 716 | /** |
||
| 717 | * Air_MultiAvailability |
||
| 718 | * |
||
| 719 | * @param RequestOptions\AirMultiAvailabilityOptions $options |
||
| 720 | * @param array $messageOptions (OPTIONAL) |
||
| 721 | * @return Result |
||
| 722 | * @throws Client\InvalidMessageException |
||
| 723 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 724 | * @throws Exception |
||
| 725 | */ |
||
| 726 | 4 | public function airMultiAvailability( |
|
| 734 | |||
| 735 | /** |
||
| 736 | * Air_SellFromRecommendation |
||
| 737 | * |
||
| 738 | * @param RequestOptions\AirSellFromRecommendationOptions $options |
||
| 739 | * @param array $messageOptions (OPTIONAL) |
||
| 740 | * @return Result |
||
| 741 | * @throws Client\InvalidMessageException |
||
| 742 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 743 | * @throws Exception |
||
| 744 | */ |
||
| 745 | 4 | public function airSellFromRecommendation( |
|
| 753 | |||
| 754 | /** |
||
| 755 | * Air_FlightInfo |
||
| 756 | * |
||
| 757 | * @param RequestOptions\AirFlightInfoOptions $options |
||
| 758 | * @param array $messageOptions (OPTIONAL) |
||
| 759 | * @return Result |
||
| 760 | * @throws Client\InvalidMessageException |
||
| 761 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 762 | * @throws Exception |
||
| 763 | */ |
||
| 764 | 4 | public function airFlightInfo(RequestOptions\AirFlightInfoOptions $options, $messageOptions = []) |
|
| 770 | |||
| 771 | /** |
||
| 772 | * Air_RetrieveSeatMap |
||
| 773 | * |
||
| 774 | * @param RequestOptions\AirRetrieveSeatMapOptions $options |
||
| 775 | * @param array $messageOptions (OPTIONAL) |
||
| 776 | * @return Result |
||
| 777 | * @throws Client\InvalidMessageException |
||
| 778 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 779 | * @throws Exception |
||
| 780 | */ |
||
| 781 | 4 | public function airRetrieveSeatMap(RequestOptions\AirRetrieveSeatMapOptions $options, $messageOptions = []) |
|
| 787 | |||
| 788 | /** |
||
| 789 | * Air_RebookAirSegment |
||
| 790 | * |
||
| 791 | * @param RequestOptions\AirRebookAirSegmentOptions $options |
||
| 792 | * @param array $messageOptions (OPTIONAL) |
||
| 793 | * @return Result |
||
| 794 | * @throws Client\InvalidMessageException |
||
| 795 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 796 | * @throws Exception |
||
| 797 | */ |
||
| 798 | 4 | public function airRebookAirSegment(RequestOptions\AirRebookAirSegmentOptions $options, $messageOptions = []) |
|
| 804 | |||
| 805 | /** |
||
| 806 | * Command_Cryptic |
||
| 807 | * |
||
| 808 | * @param RequestOptions\CommandCrypticOptions $options |
||
| 809 | * @param array $messageOptions (OPTIONAL) |
||
| 810 | * @return Result |
||
| 811 | * @throws Client\InvalidMessageException |
||
| 812 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 813 | * @throws Exception |
||
| 814 | */ |
||
| 815 | 4 | public function commandCryptic(RequestOptions\CommandCrypticOptions $options, $messageOptions = []) |
|
| 821 | |||
| 822 | /** |
||
| 823 | * MiniRule_GetFromPricingRec |
||
| 824 | * |
||
| 825 | * @param RequestOptions\MiniRuleGetFromPricingRecOptions $options |
||
| 826 | * @param array $messageOptions (OPTIONAL) |
||
| 827 | * @return Result |
||
| 828 | * @throws Client\InvalidMessageException |
||
| 829 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 830 | * @throws Exception |
||
| 831 | */ |
||
| 832 | 4 | public function miniRuleGetFromPricingRec( |
|
| 840 | |||
| 841 | /** |
||
| 842 | * MiniRule_GetFromPricing |
||
| 843 | * |
||
| 844 | * @param RequestOptions\MiniRuleGetFromPricingOptions $options |
||
| 845 | * @param array $messageOptions (OPTIONAL) |
||
| 846 | * @return Result |
||
| 847 | * @throws Client\InvalidMessageException |
||
| 848 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 849 | * @throws Exception |
||
| 850 | */ |
||
| 851 | 4 | public function miniRuleGetFromPricing( |
|
| 859 | |||
| 860 | /** |
||
| 861 | * MiniRule_GetFromETicket |
||
| 862 | * |
||
| 863 | * @param RequestOptions\MiniRuleGetFromETicketOptions $options |
||
| 864 | * @param array $messageOptions (OPTIONAL) |
||
| 865 | * @return Result |
||
| 866 | * @throws Client\InvalidMessageException |
||
| 867 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 868 | * @throws Exception |
||
| 869 | */ |
||
| 870 | 4 | public function miniRuleGetFromETicket( |
|
| 878 | |||
| 879 | /** |
||
| 880 | * Info_EncodeDecodeCity |
||
| 881 | * |
||
| 882 | * @param RequestOptions\InfoEncodeDecodeCityOptions $options |
||
| 883 | * @param array $messageOptions (OPTIONAL) |
||
| 884 | * @return Result |
||
| 885 | * @throws Client\InvalidMessageException |
||
| 886 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 887 | * @throws Exception |
||
| 888 | */ |
||
| 889 | 4 | public function infoEncodeDecodeCity(RequestOptions\InfoEncodeDecodeCityOptions $options, $messageOptions = []) |
|
| 895 | |||
| 896 | /** |
||
| 897 | * PointOfRef_Search |
||
| 898 | * |
||
| 899 | * @param RequestOptions\PointOfRefSearchOptions $options |
||
| 900 | * @param array $messageOptions (OPTIONAL) |
||
| 901 | * @return Result |
||
| 902 | * @throws Client\InvalidMessageException |
||
| 903 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 904 | * @throws Exception |
||
| 905 | */ |
||
| 906 | 4 | public function pointOfRefSearch(RequestOptions\PointOfRefSearchOptions $options, $messageOptions = []) |
|
| 912 | |||
| 913 | |||
| 914 | /** |
||
| 915 | * Ticket_CreateTSTFromPricing |
||
| 916 | * |
||
| 917 | * @param RequestOptions\TicketCreateTstFromPricingOptions $options |
||
| 918 | * @param array $messageOptions (OPTIONAL) |
||
| 919 | * @return Result |
||
| 920 | * @throws Client\InvalidMessageException |
||
| 921 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 922 | * @throws Exception |
||
| 923 | */ |
||
| 924 | 4 | public function ticketCreateTSTFromPricing( |
|
| 932 | |||
| 933 | /** |
||
| 934 | * Ticket_CreateTSMFromPricing |
||
| 935 | * |
||
| 936 | * @param RequestOptions\TicketCreateTsmFromPricingOptions $options |
||
| 937 | * @param array $messageOptions (OPTIONAL) |
||
| 938 | * @return Result |
||
| 939 | * @throws Client\InvalidMessageException |
||
| 940 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 941 | * @throws Exception |
||
| 942 | */ |
||
| 943 | 4 | public function ticketCreateTSMFromPricing( |
|
| 951 | |||
| 952 | /** |
||
| 953 | * Ticket_CreateTSMFareElement |
||
| 954 | * |
||
| 955 | * @param RequestOptions\TicketCreateTsmFareElOptions $options |
||
| 956 | * @param array $messageOptions (OPTIONAL) |
||
| 957 | * @return Result |
||
| 958 | * @throws Client\InvalidMessageException |
||
| 959 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 960 | * @throws Exception |
||
| 961 | */ |
||
| 962 | 4 | public function ticketCreateTSMFareElement( |
|
| 970 | |||
| 971 | /** |
||
| 972 | * Ticket_DeleteTST |
||
| 973 | * |
||
| 974 | * @param RequestOptions\TicketDeleteTstOptions $options |
||
| 975 | * @param array $messageOptions (OPTIONAL) |
||
| 976 | * @return Result |
||
| 977 | * @throws Client\InvalidMessageException |
||
| 978 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 979 | * @throws Exception |
||
| 980 | */ |
||
| 981 | 4 | public function ticketDeleteTST(RequestOptions\TicketDeleteTstOptions $options, $messageOptions = []) |
|
| 987 | |||
| 988 | /** |
||
| 989 | * Ticket_DeleteTSMP |
||
| 990 | * |
||
| 991 | * @param RequestOptions\TicketDeleteTsmpOptions $options |
||
| 992 | * @param array $messageOptions (OPTIONAL) |
||
| 993 | * @return Result |
||
| 994 | * @throws Client\InvalidMessageException |
||
| 995 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 996 | * @throws Exception |
||
| 997 | */ |
||
| 998 | 4 | public function ticketDeleteTSMP(RequestOptions\TicketDeleteTsmpOptions $options, $messageOptions = []) |
|
| 1004 | |||
| 1005 | /** |
||
| 1006 | * Ticket_DisplayTST |
||
| 1007 | * |
||
| 1008 | * @param RequestOptions\TicketDisplayTstOptions $options |
||
| 1009 | * @param array $messageOptions (OPTIONAL) |
||
| 1010 | * @return Result |
||
| 1011 | * @throws Client\InvalidMessageException |
||
| 1012 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1013 | * @throws Exception |
||
| 1014 | */ |
||
| 1015 | 4 | public function ticketDisplayTST(RequestOptions\TicketDisplayTstOptions $options, $messageOptions = []) |
|
| 1021 | |||
| 1022 | /** |
||
| 1023 | * Ticket_DisplayTSMP |
||
| 1024 | * |
||
| 1025 | * @param RequestOptions\TicketDisplayTsmpOptions $options |
||
| 1026 | * @param array $messageOptions (OPTIONAL) |
||
| 1027 | * @return Result |
||
| 1028 | * @throws Client\InvalidMessageException |
||
| 1029 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1030 | * @throws Exception |
||
| 1031 | */ |
||
| 1032 | 4 | public function ticketDisplayTSMP(RequestOptions\TicketDisplayTsmpOptions $options, $messageOptions = []) |
|
| 1038 | |||
| 1039 | /** |
||
| 1040 | * Ticket_DisplayTSMFareElement |
||
| 1041 | * |
||
| 1042 | * @param RequestOptions\TicketDisplayTsmFareElOptions $options |
||
| 1043 | * @param array $messageOptions (OPTIONAL) |
||
| 1044 | * @return Result |
||
| 1045 | * @throws Client\InvalidMessageException |
||
| 1046 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1047 | * @throws Exception |
||
| 1048 | */ |
||
| 1049 | 4 | public function ticketDisplayTSMFareElement( |
|
| 1057 | |||
| 1058 | /** |
||
| 1059 | * Ticket_CheckEligibility |
||
| 1060 | * |
||
| 1061 | * @param RequestOptions\TicketCheckEligibilityOptions $options |
||
| 1062 | * @param array $messageOptions (OPTIONAL) |
||
| 1063 | * @return Result |
||
| 1064 | * @throws Client\InvalidMessageException |
||
| 1065 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1066 | * @throws Exception |
||
| 1067 | */ |
||
| 1068 | 4 | public function ticketCheckEligibility( |
|
| 1076 | |||
| 1077 | /** |
||
| 1078 | * Ticket_ATCShopperMasterPricerTravelBoardSearch |
||
| 1079 | * |
||
| 1080 | * @param RequestOptions\TicketAtcShopperMpTbSearchOptions $options |
||
| 1081 | * @param array $messageOptions (OPTIONAL) |
||
| 1082 | * @return Result |
||
| 1083 | * @throws Client\InvalidMessageException |
||
| 1084 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1085 | * @throws Exception |
||
| 1086 | */ |
||
| 1087 | 4 | public function ticketAtcShopperMasterPricerTravelBoardSearch( |
|
| 1095 | |||
| 1096 | /** |
||
| 1097 | * Ticket_RepricePNRWithBookingClass |
||
| 1098 | * |
||
| 1099 | * @param RequestOptions\TicketRepricePnrWithBookingClassOptions $options |
||
| 1100 | * @param array $messageOptions (OPTIONAL) |
||
| 1101 | * @return Result |
||
| 1102 | * @throws Client\InvalidMessageException |
||
| 1103 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1104 | * @throws Exception |
||
| 1105 | */ |
||
| 1106 | 4 | public function ticketRepricePnrWithBookingClass( |
|
| 1114 | |||
| 1115 | /** |
||
| 1116 | * Ticket_CancelDocument |
||
| 1117 | * |
||
| 1118 | * @param RequestOptions\TicketCancelDocumentOptions $options |
||
| 1119 | * @param array $messageOptions (OPTIONAL) |
||
| 1120 | * @return Result |
||
| 1121 | * @throws Client\InvalidMessageException |
||
| 1122 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1123 | * @throws Exception |
||
| 1124 | */ |
||
| 1125 | 4 | public function ticketCancelDocument( |
|
| 1133 | |||
| 1134 | /** |
||
| 1135 | * Ticket_ReissueConfirmedPricing |
||
| 1136 | * |
||
| 1137 | * @param RequestOptions\TicketReissueConfirmedPricingOptions $options |
||
| 1138 | * @param array $messageOptions (OPTIONAL) |
||
| 1139 | * @return Result |
||
| 1140 | * @throws Client\InvalidMessageException |
||
| 1141 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1142 | * @throws Exception |
||
| 1143 | */ |
||
| 1144 | 4 | public function ticketReissueConfirmedPricing( |
|
| 1152 | |||
| 1153 | /** |
||
| 1154 | * Ticket_ProcessEDoc |
||
| 1155 | * |
||
| 1156 | * @param RequestOptions\TicketProcessEDocOptions $options |
||
| 1157 | * @param array $messageOptions (OPTIONAL) |
||
| 1158 | * @return Result |
||
| 1159 | * @throws Client\InvalidMessageException |
||
| 1160 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1161 | * @throws Exception |
||
| 1162 | */ |
||
| 1163 | 4 | public function ticketProcessEDoc(RequestOptions\TicketProcessEDocOptions $options, $messageOptions = []) |
|
| 1168 | |||
| 1169 | /** |
||
| 1170 | * DocIssuance_IssueTicket |
||
| 1171 | * |
||
| 1172 | * @param RequestOptions\DocIssuanceIssueTicketOptions $options |
||
| 1173 | * @param array $messageOptions (OPTIONAL) |
||
| 1174 | * @return Result |
||
| 1175 | * @throws Client\InvalidMessageException |
||
| 1176 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1177 | * @throws Exception |
||
| 1178 | */ |
||
| 1179 | 4 | public function docIssuanceIssueTicket( |
|
| 1187 | |||
| 1188 | /** |
||
| 1189 | * DocIssuance_IssueMiscellaneousDocuments |
||
| 1190 | * |
||
| 1191 | * @param RequestOptions\DocIssuanceIssueMiscDocOptions $options |
||
| 1192 | * @param array $messageOptions (OPTIONAL) |
||
| 1193 | * @return Result |
||
| 1194 | * @throws Client\InvalidMessageException |
||
| 1195 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1196 | * @throws Exception |
||
| 1197 | */ |
||
| 1198 | 4 | public function docIssuanceIssueMiscellaneousDocuments( |
|
| 1206 | |||
| 1207 | /** |
||
| 1208 | * DocIssuance_IssueCombined |
||
| 1209 | * |
||
| 1210 | * @param RequestOptions\DocIssuanceIssueCombinedOptions $options |
||
| 1211 | * @param array $messageOptions (OPTIONAL) |
||
| 1212 | * @return Result |
||
| 1213 | * @throws Client\InvalidMessageException |
||
| 1214 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1215 | * @throws Exception |
||
| 1216 | */ |
||
| 1217 | 8 | public function docIssuanceIssueCombined( |
|
| 1225 | |||
| 1226 | /** |
||
| 1227 | * DocRefund_InitRefund |
||
| 1228 | * |
||
| 1229 | * @param RequestOptions\DocRefundInitRefundOptions $options |
||
| 1230 | * @param array $messageOptions (OPTIONAL) |
||
| 1231 | * @return Result |
||
| 1232 | * @throws Client\InvalidMessageException |
||
| 1233 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1234 | * @throws Exception |
||
| 1235 | */ |
||
| 1236 | 4 | public function docRefundInitRefund( |
|
| 1244 | |||
| 1245 | /** |
||
| 1246 | * DocRefund_UpdateRefund |
||
| 1247 | * |
||
| 1248 | * @param RequestOptions\DocRefundUpdateRefundOptions $options |
||
| 1249 | * @param array $messageOptions (OPTIONAL) |
||
| 1250 | * @return Result |
||
| 1251 | * @throws Client\InvalidMessageException |
||
| 1252 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1253 | * @throws Exception |
||
| 1254 | */ |
||
| 1255 | 4 | public function docRefundUpdateRefund( |
|
| 1263 | |||
| 1264 | /** |
||
| 1265 | * DocRefund_ProcessRefund |
||
| 1266 | * |
||
| 1267 | * @param RequestOptions\DocRefundProcessRefundOptions $options |
||
| 1268 | * @param array $messageOptions (OPTIONAL) |
||
| 1269 | * @return Result |
||
| 1270 | * @throws Client\InvalidMessageException |
||
| 1271 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1272 | * @throws Exception |
||
| 1273 | */ |
||
| 1274 | 4 | public function docRefundProcessRefund( |
|
| 1282 | |||
| 1283 | |||
| 1284 | /** |
||
| 1285 | * FOP_CreateFormOfPayment |
||
| 1286 | * |
||
| 1287 | * @param RequestOptions\FopCreateFopOptions $options |
||
| 1288 | * @param array $messageOptions (OPTIONAL) |
||
| 1289 | * @return Result |
||
| 1290 | * @throws Client\InvalidMessageException |
||
| 1291 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1292 | * @throws Exception |
||
| 1293 | */ |
||
| 1294 | 4 | public function fopCreateFormOfPayment(RequestOptions\FopCreateFopOptions $options, $messageOptions = []) |
|
| 1300 | |||
| 1301 | |||
| 1302 | /** |
||
| 1303 | * FOP_CreateFormOfPayment |
||
| 1304 | * |
||
| 1305 | * @param RequestOptions\FopValidateFopOptions $options |
||
| 1306 | * @param array $messageOptions (OPTIONAL) |
||
| 1307 | * @return Result |
||
| 1308 | * @throws Client\InvalidMessageException |
||
| 1309 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1310 | * @throws Exception |
||
| 1311 | */ |
||
| 1312 | 4 | public function fopValidateFOP(RequestOptions\FopValidateFopOptions $options, $messageOptions = []) |
|
| 1318 | |||
| 1319 | /** |
||
| 1320 | * PriceXplorer_ExtremeSearch |
||
| 1321 | * |
||
| 1322 | * @param RequestOptions\PriceXplorerExtremeSearchOptions $options |
||
| 1323 | * @param array $messageOptions (OPTIONAL) |
||
| 1324 | * @return Result |
||
| 1325 | * @throws Client\InvalidMessageException |
||
| 1326 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1327 | * @throws Exception |
||
| 1328 | */ |
||
| 1329 | 4 | public function priceXplorerExtremeSearch( |
|
| 1337 | |||
| 1338 | /** |
||
| 1339 | * SalesReports_DisplayQueryReport |
||
| 1340 | * |
||
| 1341 | * @param RequestOptions\SalesReportsDisplayQueryReportOptions $options |
||
| 1342 | * @param array $messageOptions (OPTIONAL) |
||
| 1343 | * @return Result |
||
| 1344 | * @throws Client\InvalidMessageException |
||
| 1345 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1346 | * @throws Exception |
||
| 1347 | */ |
||
| 1348 | 4 | public function salesReportsDisplayQueryReport( |
|
| 1356 | |||
| 1357 | /** |
||
| 1358 | * Service_IntegratedPricing |
||
| 1359 | * |
||
| 1360 | * @param RequestOptions\ServiceIntegratedPricingOptions $options |
||
| 1361 | * @param array $messageOptions (OPTIONAL) |
||
| 1362 | * @return Result |
||
| 1363 | * @throws Client\InvalidMessageException |
||
| 1364 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1365 | * @throws Exception |
||
| 1366 | */ |
||
| 1367 | 4 | public function serviceIntegratedPricing( |
|
| 1375 | |||
| 1376 | /** |
||
| 1377 | * Service_IntegratedCatalogue |
||
| 1378 | * |
||
| 1379 | * @param RequestOptions\ServiceIntegratedCatalogueOptions $options |
||
| 1380 | * @param array $messageOptions (OPTIONAL) |
||
| 1381 | * @return Result |
||
| 1382 | * @throws Client\InvalidMessageException |
||
| 1383 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1384 | * @throws Exception |
||
| 1385 | */ |
||
| 1386 | 4 | public function serviceIntegratedCatalogue( |
|
| 1394 | |||
| 1395 | /** |
||
| 1396 | * Call a message with the given parameters |
||
| 1397 | * |
||
| 1398 | * @param string $messageName |
||
| 1399 | * @param RequestOptions\RequestOptionsInterface $options |
||
| 1400 | * @param array $messageOptions |
||
| 1401 | * @param bool $endSession |
||
| 1402 | * @return Result |
||
| 1403 | * @throws Client\Exception |
||
| 1404 | * @throws Client\Struct\InvalidArgumentException |
||
| 1405 | * @throws Client\InvalidMessageException |
||
| 1406 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 1407 | * @throws \RuntimeException |
||
| 1408 | * @throws \InvalidArgumentException |
||
| 1409 | */ |
||
| 1410 | 288 | protected function callMessage($messageName, $options, $messageOptions, $endSession = false) |
|
| 1436 | |||
| 1437 | /** |
||
| 1438 | * Make message options |
||
| 1439 | * |
||
| 1440 | * Message options are meta options when sending a message to the amadeus web services |
||
| 1441 | * - 'endSession' (if stateful) : should we end the current session after sending this call? |
||
| 1442 | * - 'returnXml' : Should we return the XML string in the Result::responseXml property? |
||
| 1443 | * (this overrides the default setting returnXml in the Amadeus\Client\Params for a single message) |
||
| 1444 | * |
||
| 1445 | * @param array $incoming The Message options chosen by the caller - if any. |
||
| 1446 | * @param bool $endSession Switch if you want to terminate the current session after making the call. |
||
| 1447 | * @return array |
||
| 1448 | */ |
||
| 1449 | 312 | protected function makeMessageOptions(array $incoming, $endSession = false) |
|
| 1466 | } |
||
| 1467 |