Completed
Pull Request — master (#170)
by
unknown
10:28
created

Client::airMultiAvailability()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
crap 1
1
<?php
2
/**
3
 * amadeus-ws-client
4
 *
5
 * Copyright 2015 Amadeus Benelux NV
6
 *
7
 * Licensed under the Apache License, Version 2.0 (the "License");
8
 * you may not use this file except in compliance with the License.
9
 * You may obtain a copy of the License at
10
 *
11
 * http://www.apache.org/licenses/LICENSE-2.0
12
 *
13
 * Unless required by applicable law or agreed to in writing, software
14
 * distributed under the License is distributed on an "AS IS" BASIS,
15
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
 * See the License for the specific language governing permissions and
17
 * limitations under the License.
18
 *
19
 * @package Amadeus
20
 * @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
21
 */
22
23
namespace Amadeus;
24
25
use Amadeus\Client\Base;
26
use Amadeus\Client\Exception;
27
use Amadeus\Client\Params;
28
use Amadeus\Client\RequestOptions;
29
use Amadeus\Client\Result;
30
31
/**
32
 * Amadeus Web Service Client.
33
 *
34
 * TODO:
35
 * - support older versions of SoapHeader (1)
36
 *
37
 * @package Amadeus
38
 * @author Dieter Devlieghere <[email protected]>
39
 */
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)
80
    {
81 4
        $this->sessionHandler->setStateful($newStateful);
82 4
    }
83
84
    /**
85
     * @return bool
86
     */
87 12
    public function isStateful()
88
    {
89 12
        return $this->sessionHandler->isStateful();
90
    }
91
92
    /**
93
     * Get the last raw XML message that was sent out
94
     *
95
     * @return string|null
96
     */
97 4
    public function getLastRequest()
98
    {
99 4
        return $this->sessionHandler->getLastRequest($this->lastMessage);
100
    }
101
102
    /**
103
     * Get the last raw XML message that was received
104
     *
105
     * @return string|null
106
     */
107 4
    public function getLastResponse()
108
    {
109 4
        return $this->sessionHandler->getLastResponse($this->lastMessage);
110
    }
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()
118
    {
119 4
        return $this->sessionHandler->getLastRequestHeaders($this->lastMessage);
120
    }
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()
128
    {
129 4
        return $this->sessionHandler->getLastResponseHeaders($this->lastMessage);
130
    }
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()
142
    {
143 4
        return $this->sessionHandler->getSessionData();
144
    }
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)
155
    {
156 4
        return $this->sessionHandler->setSessionData($sessionData);
157
    }
158
159
    /**
160
     * Construct Amadeus Web Services client
161
     *
162
     * @param Params $params
163
     */
164 348
    public function __construct(Params $params)
165
    {
166 348
        $this->loadClientParams(
167 348
            $params,
168 348
            self::RECEIVED_FROM_IDENTIFIER,
169 174
            self::VERSION
170 174
        );
171 344
    }
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()
182
    {
183 8
        $msgName = 'Security_Authenticate';
184
185 8
        return $this->callMessage(
186 8
            $msgName,
187 8
            new RequestOptions\SecurityAuthenticateOptions(
188 8
                $this->authParams
189 4
            ),
190 8
            [],
191 4
            false
192 4
        );
193
    }
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()
202
    {
203 4
        $msgName = 'Security_SignOut';
204
205 4
        return $this->callMessage(
206 4
            $msgName,
207 4
            new RequestOptions\SecuritySignOutOptions(),
208 4
            [],
209 2
            true
210 2
        );
211
    }
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 = [])
224
    {
225 4
        $msgName = 'PNR_Retrieve';
226
227 4
        return $this->callMessage($msgName, $options, $messageOptions);
228
    }
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 = [])
241
    {
242 4
        $msgName = 'PNR_AddMultiElements';
243
244 4
        return $this->callMessage($msgName, $options, $messageOptions);
245
    }
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 = [])
260
    {
261 8
        $msgName = 'PNR_AddMultiElements';
262
263 8
        return $this->callMessage($msgName, $options, $messageOptions);
264
    }
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 = [])
281
    {
282 4
        $msgName = 'PNR_RetrieveAndDisplay';
283
284 4
        return $this->callMessage($msgName, $options, $messageOptions);
285
    }
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 = [])
298
    {
299 4
        $msgName = 'PNR_Cancel';
300
301 4
        return $this->callMessage($msgName, $options, $messageOptions);
302
    }
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 = [])
315
    {
316 4
        $msgName = 'PNR_DisplayHistory';
317
318 4
        return $this->callMessage($msgName, $options, $messageOptions);
319
    }
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 = [])
332
    {
333 4
        $msgName = 'PNR_TransferOwnership';
334
335 4
        return $this->callMessage($msgName, $options, $messageOptions);
336
    }
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 = [])
349
    {
350 4
        $msgName = 'PNR_NameChange';
351
352 4
        return $this->callMessage($msgName, $options, $messageOptions);
353
    }
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 = [])
368
    {
369 4
        $msgName = 'Queue_List';
370
371 4
        return $this->callMessage($msgName, $options, $messageOptions);
372
    }
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 = [])
385
    {
386 4
        $msgName = 'Queue_PlacePNR';
387
388 4
        return $this->callMessage($msgName, $options, $messageOptions);
389
    }
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 = [])
402
    {
403 4
        $msgName = 'Queue_RemoveItem';
404
405 4
        return $this->callMessage($msgName, $options, $messageOptions);
406
    }
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 = [])
419
    {
420 4
        $msgName = 'Queue_MoveItem';
421
422 4
        return $this->callMessage($msgName, $options, $messageOptions);
423
    }
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 = [])
436
    {
437 4
        $msgName = 'Offer_CreateOffer';
438
439 4
        return $this->callMessage($msgName, $options, $messageOptions);
440
    }
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 = [])
455
    {
456 4
        $msgName = 'Offer_VerifyOffer';
457
458 4
        return $this->callMessage($msgName, $options, $messageOptions);
459
    }
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 = [])
472
    {
473 4
        $msgName = 'Offer_ConfirmAirOffer';
474
475 4
        return $this->callMessage($msgName, $options, $messageOptions);
476
    }
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 = [])
489
    {
490 4
        $msgName = 'Offer_ConfirmHotelOffer';
491
492 4
        return $this->callMessage($msgName, $options, $messageOptions);
493
    }
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 = [])
506
    {
507 4
        $msgName = 'Offer_ConfirmCarOffer';
508
509 4
        return $this->callMessage($msgName, $options, $messageOptions);
510
    }
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(
523
        RequestOptions\FareMasterPricerExSearch $options,
524
        $messageOptions = []
525
    ) {
526
        $msgName = 'Fare_MasterPricerExpertSearch';
527
528
        return $this->callMessage($msgName, $options, $messageOptions);
529
    }
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(
543
        RequestOptions\FareMasterPricerTbSearch $options,
544
        $messageOptions = []
545
    ) {
546 4
        $msgName = 'Fare_MasterPricerTravelBoardSearch';
547
548 4
        return $this->callMessage($msgName, $options, $messageOptions);
549
    }
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(
562
        RequestOptions\FareMasterPricerCalendarOptions $options,
563
        $messageOptions = []
564
    ) {
565 4
        $msgName = 'Fare_MasterPricerCalendar';
566
567 4
        return $this->callMessage($msgName, $options, $messageOptions);
568
    }
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(
581
        RequestOptions\FarePricePnrWithBookingClassOptions $options,
582
        $messageOptions = []
583
    ) {
584 8
        $msgName = 'Fare_PricePNRWithBookingClass';
585
586 8
        return $this->callMessage($msgName, $options, $messageOptions);
587
    }
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(
600
        RequestOptions\FarePricePnrWithLowerFaresOptions $options,
601
        $messageOptions = []
602
    ) {
603 8
        $msgName = 'Fare_PricePNRWithLowerFares';
604
605 8
        return $this->callMessage($msgName, $options, $messageOptions);
606
    }
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(
619
        RequestOptions\FarePricePnrWithLowestFareOptions $options,
620
        $messageOptions = []
621
    ) {
622 8
        $msgName = 'Fare_PricePNRWithLowestFare';
623
624 8
        return $this->callMessage($msgName, $options, $messageOptions);
625
    }
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(
638
        RequestOptions\FareInformativePricingWithoutPnrOptions $options,
639
        $messageOptions = []
640
    ) {
641 4
        $msgName = 'Fare_InformativePricingWithoutPNR';
642
643 4
        return $this->callMessage($msgName, $options, $messageOptions);
644
    }
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(
657
        RequestOptions\FareInformativeBestPricingWithoutPnrOptions $options,
658
        $messageOptions = []
659
    ) {
660 4
        $msgName = 'Fare_InformativeBestPricingWithoutPNR';
661
662 4
        return $this->callMessage($msgName, $options, $messageOptions);
663
    }
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 = [])
676
    {
677 4
        $msgName = 'Fare_CheckRules';
678
679 4
        return $this->callMessage($msgName, $options, $messageOptions);
680
    }
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 = [])
693
    {
694 4
        $msgName = 'Fare_GetFareRules';
695
696 4
        return $this->callMessage($msgName, $options, $messageOptions);
697
    }
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 = [])
710
    {
711 4
        $msgName = 'Fare_ConvertCurrency';
712
713 4
        return $this->callMessage($msgName, $options, $messageOptions);
714
    }
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(
727
        RequestOptions\AirMultiAvailabilityOptions $options,
728
        $messageOptions = []
729
    ) {
730 4
        $msgName = 'Air_MultiAvailability';
731
732 4
        return $this->callMessage($msgName, $options, $messageOptions);
733
    }
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(
746
        RequestOptions\AirSellFromRecommendationOptions $options,
747
        $messageOptions = []
748
    ) {
749 4
        $msgName = 'Air_SellFromRecommendation';
750
751 4
        return $this->callMessage($msgName, $options, $messageOptions);
752
    }
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 = [])
765
    {
766 4
        $msgName = 'Air_FlightInfo';
767
768 4
        return $this->callMessage($msgName, $options, $messageOptions);
769
    }
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 = [])
782
    {
783 4
        $msgName = 'Air_RetrieveSeatMap';
784
785 4
        return $this->callMessage($msgName, $options, $messageOptions);
786
    }
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 = [])
799
    {
800 4
        $msgName = 'Air_RebookAirSegment';
801
802 4
        return $this->callMessage($msgName, $options, $messageOptions);
803
    }
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 = [])
816
    {
817 4
        $msgName = 'Command_Cryptic';
818
819 4
        return $this->callMessage($msgName, $options, $messageOptions);
820
    }
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(
833
        RequestOptions\MiniRuleGetFromPricingRecOptions $options,
834
        $messageOptions = []
835
    ) {
836 4
        $msgName = 'MiniRule_GetFromPricingRec';
837
838 4
        return $this->callMessage($msgName, $options, $messageOptions);
839
    }
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(
852
        RequestOptions\MiniRuleGetFromPricingOptions $options,
853
        $messageOptions = []
854
    ) {
855 4
        $msgName = 'MiniRule_GetFromPricing';
856
857 4
        return $this->callMessage($msgName, $options, $messageOptions);
858
    }
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(
871
        RequestOptions\MiniRuleGetFromETicketOptions $options,
872
        $messageOptions = []
873
    ) {
874 4
        $msgName = 'MiniRule_GetFromETicket';
875
876 4
        return $this->callMessage($msgName, $options, $messageOptions);
877
    }
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 = [])
890
    {
891 4
        $msgName = 'Info_EncodeDecodeCity';
892
893 4
        return $this->callMessage($msgName, $options, $messageOptions);
894
    }
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 = [])
907
    {
908 4
        $msgName = 'PointOfRef_Search';
909
910 4
        return $this->callMessage($msgName, $options, $messageOptions);
911
    }
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(
925
        RequestOptions\TicketCreateTstFromPricingOptions $options,
926
        $messageOptions = []
927
    ) {
928 4
        $msgName = 'Ticket_CreateTSTFromPricing';
929
930 4
        return $this->callMessage($msgName, $options, $messageOptions);
931
    }
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(
944
        RequestOptions\TicketCreateTsmFromPricingOptions $options,
945
        $messageOptions = []
946
    ) {
947 4
        $msgName = 'Ticket_CreateTSMFromPricing';
948
949 4
        return $this->callMessage($msgName, $options, $messageOptions);
950
    }
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(
963
        RequestOptions\TicketCreateTsmFareElOptions $options,
964
        $messageOptions = []
965
    ) {
966 4
        $msgName = 'Ticket_CreateTSMFareElement';
967
968 4
        return $this->callMessage($msgName, $options, $messageOptions);
969
    }
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 = [])
982
    {
983 4
        $msgName = 'Ticket_DeleteTST';
984
985 4
        return $this->callMessage($msgName, $options, $messageOptions);
986
    }
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 = [])
999
    {
1000 4
        $msgName = 'Ticket_DeleteTSMP';
1001
1002 4
        return $this->callMessage($msgName, $options, $messageOptions);
1003
    }
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 = [])
1016
    {
1017 4
        $msgName = 'Ticket_DisplayTST';
1018
1019 4
        return $this->callMessage($msgName, $options, $messageOptions);
1020
    }
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 = [])
1033
    {
1034 4
        $msgName = 'Ticket_DisplayTSMP';
1035
1036 4
        return $this->callMessage($msgName, $options, $messageOptions);
1037
    }
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(
1050
        RequestOptions\TicketDisplayTsmFareElOptions $options,
1051
        $messageOptions = []
1052
    ) {
1053 4
        $msgName = 'Ticket_DisplayTSMFareElement';
1054
1055 4
        return $this->callMessage($msgName, $options, $messageOptions);
1056
    }
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(
1069
        RequestOptions\TicketCheckEligibilityOptions $options,
1070
        $messageOptions = []
1071
    ) {
1072 4
        $msgName = 'Ticket_CheckEligibility';
1073
1074 4
        return $this->callMessage($msgName, $options, $messageOptions);
1075
    }
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(
1088
        RequestOptions\TicketAtcShopperMpTbSearchOptions $options,
1089
        $messageOptions = []
1090
    ) {
1091 4
        $msgName = 'Ticket_ATCShopperMasterPricerTravelBoardSearch';
1092
1093 4
        return $this->callMessage($msgName, $options, $messageOptions);
1094
    }
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(
1107
        RequestOptions\TicketRepricePnrWithBookingClassOptions $options,
1108
        $messageOptions = []
1109
    ) {
1110 4
        $msgName = 'Ticket_RepricePNRWithBookingClass';
1111
1112 4
        return $this->callMessage($msgName, $options, $messageOptions);
1113
    }
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(
1126
        RequestOptions\TicketCancelDocumentOptions $options,
1127
        $messageOptions = []
1128
    ) {
1129 4
        $msgName = 'Ticket_CancelDocument';
1130
1131 4
        return $this->callMessage($msgName, $options, $messageOptions);
1132
    }
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(
1145
        RequestOptions\TicketReissueConfirmedPricingOptions $options,
1146
        $messageOptions = []
1147
    ) {
1148 4
        $msgName = 'Ticket_ReissueConfirmedPricing';
1149
1150 4
        return $this->callMessage($msgName, $options, $messageOptions);
1151
    }
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 = [])
1164
    {
1165 4
        $msgName = 'Ticket_ProcessEDoc';
1166 4
        return $this->callMessage($msgName, $options, $messageOptions);
1167
    }
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(
1180
        RequestOptions\DocIssuanceIssueTicketOptions $options,
1181
        $messageOptions = []
1182
    ) {
1183 4
        $msgName = 'DocIssuance_IssueTicket';
1184
1185 4
        return $this->callMessage($msgName, $options, $messageOptions);
1186
    }
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(
1199
        RequestOptions\DocIssuanceIssueMiscDocOptions $options,
1200
        $messageOptions = []
1201
    ) {
1202 4
        $msgName = 'DocIssuance_IssueMiscellaneousDocuments';
1203
1204 4
        return $this->callMessage($msgName, $options, $messageOptions);
1205
    }
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(
1218
        RequestOptions\DocIssuanceIssueCombinedOptions $options,
1219
        $messageOptions = []
1220
    ) {
1221 8
        $msgName = 'DocIssuance_IssueCombined';
1222
1223 8
        return $this->callMessage($msgName, $options, $messageOptions);
1224
    }
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(
1237
        RequestOptions\DocRefundInitRefundOptions $options,
1238
        $messageOptions = []
1239
    ) {
1240 4
        $msgName = 'DocRefund_InitRefund';
1241
1242 4
        return $this->callMessage($msgName, $options, $messageOptions);
1243
    }
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(
1256
        RequestOptions\DocRefundUpdateRefundOptions $options,
1257
        $messageOptions = []
1258
    ) {
1259 4
        $msgName = 'DocRefund_UpdateRefund';
1260
1261 4
        return $this->callMessage($msgName, $options, $messageOptions);
1262
    }
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(
1275
        RequestOptions\DocRefundProcessRefundOptions $options,
1276
        $messageOptions = []
1277
    ) {
1278 4
        $msgName = 'DocRefund_ProcessRefund';
1279
1280 4
        return $this->callMessage($msgName, $options, $messageOptions);
1281
    }
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 = [])
1295
    {
1296 4
        $msgName = 'FOP_CreateFormOfPayment';
1297
1298 4
        return $this->callMessage($msgName, $options, $messageOptions);
1299
    }
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 = [])
1313
    {
1314 4
        $msgName = 'FOP_ValidateFOP';
1315
1316 4
        return $this->callMessage($msgName, $options, $messageOptions);
1317
    }
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(
1330
        RequestOptions\PriceXplorerExtremeSearchOptions $options,
1331
        $messageOptions = []
1332
    ) {
1333 4
        $msgName = 'PriceXplorer_ExtremeSearch';
1334
1335 4
        return $this->callMessage($msgName, $options, $messageOptions);
1336
    }
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(
1349
        RequestOptions\SalesReportsDisplayQueryReportOptions $options,
1350
        $messageOptions = []
1351
    ) {
1352 4
        $msgName = 'SalesReports_DisplayQueryReport';
1353
1354 4
        return $this->callMessage($msgName, $options, $messageOptions);
1355
    }
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(
1368
        RequestOptions\ServiceIntegratedPricingOptions $options,
1369
        $messageOptions = []
1370
    ) {
1371 4
        $msgName = 'Service_IntegratedPricing';
1372
1373 4
        return $this->callMessage($msgName, $options, $messageOptions);
1374
    }
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(
1387
        RequestOptions\ServiceIntegratedCatalogueOptions $options,
1388
        $messageOptions = []
1389
    ) {
1390 4
        $msgName = 'Service_IntegratedCatalogue';
1391
1392 4
        return $this->callMessage($msgName, $options, $messageOptions);
1393
    }
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)
1411
    {
1412 288
        $messageOptions = $this->makeMessageOptions($messageOptions, $endSession);
1413
1414 288
        $this->lastMessage = $messageName;
1415
1416 288
        $sendResult = $this->sessionHandler->sendMessage(
1417 288
            $messageName,
1418 288
            $this->requestCreator->createRequest(
1419 288
                $messageName,
1420 144
                $options
1421 144
            ),
1422 144
            $messageOptions
1423 144
        );
1424
1425 288
        $response = $this->responseHandler->analyzeResponse(
1426 288
            $sendResult,
1427 144
            $messageName
1428 144
        );
1429
1430 288
        if ($messageOptions['returnXml'] === false) {
1431 4
            $response->responseXml = null;
1432 2
        }
1433
1434 288
        return $response;
1435
    }
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)
1450
    {
1451
        $options = [
1452 312
            'endSession' => $endSession,
1453 312
            'returnXml' => $this->returnResultXml
1454 156
        ];
1455
1456 312
        if (array_key_exists('endSession', $incoming)) {
1457 4
            $options['endSession'] = $incoming['endSession'];
1458 2
        }
1459
1460 312
        if (array_key_exists('returnXml', $incoming)) {
1461 12
            $options['returnXml'] = $incoming['returnXml'];
1462 6
        }
1463
1464 312
        return $options;
1465
    }
1466
}
1467