Completed
Pull Request — master (#189)
by Dieter
10:43
created

Client::salesReportsDisplayQueryReport()   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
use Amadeus\Client\Session\Handler\UnsupportedOperationException;
31
32
/**
33
 * Amadeus Web Service Client.
34
 *
35
 * TODO:
36
 * - support older versions of SoapHeader (1)
37
 *
38
 * @package Amadeus
39
 * @author Dieter Devlieghere <[email protected]>
40
 */
41
class Client extends Base
42
{
43
    /**
44
     * Amadeus SOAP header version 1
45
     */
46
    const HEADER_V1 = "1";
47
    /**
48
     * Amadeus SOAP header version 2
49
     */
50
    const HEADER_V2 = "2";
51
    /**
52
     * Amadeus SOAP header version 4
53
     */
54
    const HEADER_V4 = "4";
55
56
    /**
57
     * Version string
58
     *
59
     * @var string
60
     */
61
    const VERSION = "1.7.0-dev";
62
63
    /**
64
     * An identifier string for the library (to be used in Received From entries)
65
     *
66
     * @var string
67
     */
68
    const RECEIVED_FROM_IDENTIFIER = "amabnl-amadeus-ws-client";
69
70
    /**
71
     * @var string
72
     */
73
    protected $lastMessage;
74
75
    /**
76
     * Set the session as stateful (true) or stateless (false)
77
     *
78
     * @param bool $newStateful
79
     */
80 4
    public function setStateful($newStateful)
81
    {
82 4
        $this->sessionHandler->setStateful($newStateful);
83 4
    }
84
85
    /**
86
     * @return bool
87
     */
88 12
    public function isStateful()
89
    {
90 12
        return $this->sessionHandler->isStateful();
91
    }
92
93
    /**
94
     * Get TransactionFlowLink Consumer Id
95
     *
96
     * @return string|null
97
     */
98 4
    public function getConsumerId()
99
    {
100 4
        return $this->sessionHandler->getConsumerId();
101
    }
102
103
    /**
104
     * Set TransactionFlowLink Consumer Id
105
     *
106
     * @throws UnsupportedOperationException when used on unsupported WSAP versions
107
     * @param string $id
108
     * @return void
109
     */
110 4
    public function setConsumerId($id)
111
    {
112 4
        $this->sessionHandler->setTransactionFlowLink(true);
113 4
        $this->sessionHandler->setConsumerId($id);
114 4
    }
115
116
    /**
117
     * Get the last raw XML message that was sent out
118
     *
119
     * @return string|null
120
     */
121 4
    public function getLastRequest()
122
    {
123 4
        return $this->sessionHandler->getLastRequest($this->lastMessage);
124
    }
125
126
    /**
127
     * Get the last raw XML message that was received
128
     *
129
     * @return string|null
130
     */
131 4
    public function getLastResponse()
132
    {
133 4
        return $this->sessionHandler->getLastResponse($this->lastMessage);
134
    }
135
136
    /**
137
     * Get the request headers for the last SOAP message that was sent out
138
     *
139
     * @return string|null
140
     */
141 4
    public function getLastRequestHeaders()
142
    {
143 4
        return $this->sessionHandler->getLastRequestHeaders($this->lastMessage);
144
    }
145
146
    /**
147
     * Get the response headers for the last SOAP message that was received
148
     *
149
     * @return string|null
150
     */
151 4
    public function getLastResponseHeaders()
152
    {
153 4
        return $this->sessionHandler->getLastResponseHeaders($this->lastMessage);
154
    }
155
156
    /**
157
     * Get session information for authenticated session
158
     *
159
     * - sessionId
160
     * - sequenceNr
161
     * - securityToken
162
     *
163
     * @return array|null
164
     */
165 4
    public function getSessionData()
166
    {
167 4
        return $this->sessionHandler->getSessionData();
168
    }
169
170
    /**
171
     * Restore a previously used session
172
     *
173
     * To be used when implementing your own session pooling system on legacy Soap Header 2 applications.
174
     *
175
     * @param array $sessionData
176
     * @return bool
177
     */
178 4
    public function setSessionData(array $sessionData)
179
    {
180 4
        return $this->sessionHandler->setSessionData($sessionData);
181
    }
182
183
    /**
184
     * Construct Amadeus Web Services client
185
     *
186
     * @param Params $params
187
     */
188 376
    public function __construct(Params $params)
189
    {
190 376
        $this->loadClientParams(
191 376
            $params,
192 376
            self::RECEIVED_FROM_IDENTIFIER,
193 188
            self::VERSION
194 188
        );
195 372
    }
196
197
    /**
198
     * Authenticate.
199
     *
200
     * Authentication Parameters were provided at construction time (authParams)
201
     *
202
     * @return Result
203
     * @throws Exception
204
     */
205 8
    public function securityAuthenticate()
206
    {
207 8
        $msgName = 'Security_Authenticate';
208
209 8
        return $this->callMessage(
210 8
            $msgName,
211 8
            new RequestOptions\SecurityAuthenticateOptions(
212 8
                $this->authParams
213 4
            ),
214 8
            [],
215 4
            false
216 4
        );
217
    }
218
219
    /**
220
     * Terminate a session - only applicable to non-stateless mode.
221
     *
222
     * @return Result
223
     * @throws Exception
224
     */
225 4
    public function securitySignOut()
226
    {
227 4
        $msgName = 'Security_SignOut';
228
229 4
        return $this->callMessage(
230 4
            $msgName,
231 4
            new RequestOptions\SecuritySignOutOptions(),
232 4
            [],
233 2
            true
234 2
        );
235
    }
236
237
    /**
238
     * PNR_Retrieve - Retrieve an Amadeus PNR by record locator
239
     *
240
     * @param RequestOptions\PnrRetrieveOptions $options
241
     * @param array $messageOptions (OPTIONAL)
242
     * @return Result
243
     * @throws Client\InvalidMessageException
244
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
245
     * @throws Exception
246
     */
247 4
    public function pnrRetrieve(RequestOptions\PnrRetrieveOptions $options, $messageOptions = [])
248
    {
249 4
        $msgName = 'PNR_Retrieve';
250
251 4
        return $this->callMessage($msgName, $options, $messageOptions);
252
    }
253
254
    /**
255
     * PNR_Split
256
     *
257
     * @param RequestOptions\PnrSplitOptions $options
258
     * @param array $messageOptions (OPTIONAL)
259
     * @return Result
260
     * @throws Client\InvalidMessageException
261
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
262
     * @throws Exception
263
     */
264 4
    public function pnrSplit(
265
        RequestOptions\PnrSplitOptions $options,
266
        $messageOptions = []
267
    ) {
268 4
        $msgName = 'PNR_Split';
269
270 4
        return $this->callMessage($msgName, $options, $messageOptions);
271
    }
272
273
    /**
274
     * Create a PNR using PNR_AddMultiElements
275
     *
276
     * @param RequestOptions\PnrCreatePnrOptions $options
277
     * @param array $messageOptions (OPTIONAL)
278
     * @return Result
279
     * @throws Client\InvalidMessageException
280
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
281
     * @throws Exception
282
     */
283 4
    public function pnrCreatePnr(RequestOptions\PnrCreatePnrOptions $options, $messageOptions = [])
284
    {
285 4
        $msgName = 'PNR_AddMultiElements';
286
287 4
        return $this->callMessage($msgName, $options, $messageOptions);
288
    }
289
290
    /**
291
     * PNR_AddMultiElements - Create a new PNR or update an existing PNR.
292
     *
293
     * https://webservices.amadeus.com/extranet/viewService.do?id=25&flavourId=1&menuId=functional
294
     *
295
     * @param RequestOptions\PnrAddMultiElementsOptions $options
296
     * @param array $messageOptions (OPTIONAL)
297
     * @return Result
298
     * @throws Client\InvalidMessageException
299
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
300
     * @throws Exception
301
     */
302 8
    public function pnrAddMultiElements(RequestOptions\PnrAddMultiElementsOptions $options, $messageOptions = [])
303
    {
304 8
        $msgName = 'PNR_AddMultiElements';
305
306 8
        return $this->callMessage($msgName, $options, $messageOptions);
307
    }
308
309
    /**
310
     * PNR_RetrieveAndDisplay - Retrieve an Amadeus PNR by record locator including extra info
311
     *
312
     * This extra info is info you cannot see in the regular PNR, like Offers.
313
     *
314
     * https://webservices.amadeus.com/extranet/viewService.do?id=1922&flavourId=1&menuId=functional
315
     *
316
     * @param RequestOptions\PnrRetrieveAndDisplayOptions $options Amadeus Record Locator for PNR
317
     * @param array $messageOptions (OPTIONAL)
318
     * @return Result
319
     * @throws Client\InvalidMessageException
320
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
321
     * @throws Exception
322
     **/
323 4
    public function pnrRetrieveAndDisplay(RequestOptions\PnrRetrieveAndDisplayOptions $options, $messageOptions = [])
324
    {
325 4
        $msgName = 'PNR_RetrieveAndDisplay';
326
327 4
        return $this->callMessage($msgName, $options, $messageOptions);
328
    }
329
330
    /**
331
     * PNR_Cancel
332
     *
333
     * @param RequestOptions\PnrCancelOptions $options
334
     * @param array $messageOptions (OPTIONAL)
335
     * @return Result
336
     * @throws Client\InvalidMessageException
337
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
338
     * @throws Exception
339
     */
340 4
    public function pnrCancel(RequestOptions\PnrCancelOptions $options, $messageOptions = [])
341
    {
342 4
        $msgName = 'PNR_Cancel';
343
344 4
        return $this->callMessage($msgName, $options, $messageOptions);
345
    }
346
347
    /**
348
     * PNR_DisplayHistory
349
     *
350
     * @param RequestOptions\PnrDisplayHistoryOptions $options
351
     * @param array $messageOptions (OPTIONAL)
352
     * @return Result
353
     * @throws Client\InvalidMessageException
354
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
355
     * @throws Exception
356
     */
357 4
    public function pnrDisplayHistory(RequestOptions\PnrDisplayHistoryOptions $options, $messageOptions = [])
358
    {
359 4
        $msgName = 'PNR_DisplayHistory';
360
361 4
        return $this->callMessage($msgName, $options, $messageOptions);
362
    }
363
364
    /**
365
     * PNR_TransferOwnership
366
     *
367
     * @param RequestOptions\PnrTransferOwnershipOptions $options
368
     * @param array $messageOptions (OPTIONAL)
369
     * @return Result
370
     * @throws Client\InvalidMessageException
371
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
372
     * @throws Exception
373
     */
374 4
    public function pnrTransferOwnership(RequestOptions\PnrTransferOwnershipOptions $options, $messageOptions = [])
375
    {
376 4
        $msgName = 'PNR_TransferOwnership';
377
378 4
        return $this->callMessage($msgName, $options, $messageOptions);
379
    }
380
381
    /**
382
     * PNR_NameChange
383
     *
384
     * @param RequestOptions\PnrNameChangeOptions $options
385
     * @param array $messageOptions (OPTIONAL)
386
     * @return Result
387
     * @throws Client\InvalidMessageException
388
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
389
     * @throws Exception
390
     */
391 4
    public function pnrNameChange(RequestOptions\PnrNameChangeOptions $options, $messageOptions = [])
392
    {
393 4
        $msgName = 'PNR_NameChange';
394
395 4
        return $this->callMessage($msgName, $options, $messageOptions);
396
    }
397
398
    /**
399
     * Queue_List - get a list of all PNR's on a given queue
400
     *
401
     * https://webservices.amadeus.com/extranet/viewService.do?id=52&flavourId=1&menuId=functional
402
     *
403
     * @param RequestOptions\QueueListOptions $options
404
     * @param array $messageOptions (OPTIONAL)
405
     * @return Result
406
     * @throws Client\InvalidMessageException
407
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
408
     * @throws Exception
409
     */
410 4
    public function queueList(RequestOptions\QueueListOptions $options, $messageOptions = [])
411
    {
412 4
        $msgName = 'Queue_List';
413
414 4
        return $this->callMessage($msgName, $options, $messageOptions);
415
    }
416
417
    /**
418
     * Queue_PlacePNR - Place a PNR on a given queue
419
     *
420
     * @param RequestOptions\QueuePlacePnrOptions $options
421
     * @param array $messageOptions (OPTIONAL)
422
     * @return Result
423
     * @throws Client\InvalidMessageException
424
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
425
     * @throws Exception
426
     */
427 4
    public function queuePlacePnr(RequestOptions\QueuePlacePnrOptions $options, $messageOptions = [])
428
    {
429 4
        $msgName = 'Queue_PlacePNR';
430
431 4
        return $this->callMessage($msgName, $options, $messageOptions);
432
    }
433
434
    /**
435
     * Queue_RemoveItem - remove an item (a PNR) from a given queue
436
     *
437
     * @param RequestOptions\QueueRemoveItemOptions $options
438
     * @param array $messageOptions (OPTIONAL)
439
     * @return Result
440
     * @throws Client\InvalidMessageException
441
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
442
     * @throws Exception
443
     */
444 4
    public function queueRemoveItem(RequestOptions\QueueRemoveItemOptions $options, $messageOptions = [])
445
    {
446 4
        $msgName = 'Queue_RemoveItem';
447
448 4
        return $this->callMessage($msgName, $options, $messageOptions);
449
    }
450
451
    /**
452
     * Queue_MoveItem - move an item (a PNR) from one queue to another.
453
     *
454
     * @param RequestOptions\QueueMoveItemOptions $options
455
     * @param array $messageOptions (OPTIONAL)
456
     * @return Result
457
     * @throws Client\InvalidMessageException
458
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
459
     * @throws Exception
460
     */
461 4
    public function queueMoveItem(RequestOptions\QueueMoveItemOptions $options, $messageOptions = [])
462
    {
463 4
        $msgName = 'Queue_MoveItem';
464
465 4
        return $this->callMessage($msgName, $options, $messageOptions);
466
    }
467
468
    /**
469
     * Offer_CreateOffer
470
     *
471
     * @param RequestOptions\OfferCreateOptions $options
472
     * @param array $messageOptions (OPTIONAL)
473
     * @return Result
474
     * @throws Client\InvalidMessageException
475
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
476
     * @throws Exception
477
     */
478 4
    public function offerCreate(RequestOptions\OfferCreateOptions $options, $messageOptions = [])
479
    {
480 4
        $msgName = 'Offer_CreateOffer';
481
482 4
        return $this->callMessage($msgName, $options, $messageOptions);
483
    }
484
485
    /**
486
     * Offer_VerifyOffer
487
     *
488
     * To be called in the context of an open PNR
489
     *
490
     * @param RequestOptions\OfferVerifyOptions $options
491
     * @param array $messageOptions (OPTIONAL)
492
     * @return Result
493
     * @throws Client\InvalidMessageException
494
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
495
     * @throws Exception
496
     */
497 4
    public function offerVerify(RequestOptions\OfferVerifyOptions $options, $messageOptions = [])
498
    {
499 4
        $msgName = 'Offer_VerifyOffer';
500
501 4
        return $this->callMessage($msgName, $options, $messageOptions);
502
    }
503
504
    /**
505
     * Offer_ConfirmAirOffer
506
     *
507
     * @param RequestOptions\OfferConfirmAirOptions $options
508
     * @param array $messageOptions (OPTIONAL)
509
     * @return Result
510
     * @throws Client\InvalidMessageException
511
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
512
     * @throws Exception
513
     */
514 4
    public function offerConfirmAir(RequestOptions\OfferConfirmAirOptions $options, $messageOptions = [])
515
    {
516 4
        $msgName = 'Offer_ConfirmAirOffer';
517
518 4
        return $this->callMessage($msgName, $options, $messageOptions);
519
    }
520
521
    /**
522
     * Offer_ConfirmHotelOffer
523
     *
524
     * @param RequestOptions\OfferConfirmHotelOptions $options
525
     * @param array $messageOptions (OPTIONAL)
526
     * @return Result
527
     * @throws Client\InvalidMessageException
528
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
529
     * @throws Exception
530
     */
531 4
    public function offerConfirmHotel(RequestOptions\OfferConfirmHotelOptions $options, $messageOptions = [])
532
    {
533 4
        $msgName = 'Offer_ConfirmHotelOffer';
534
535 4
        return $this->callMessage($msgName, $options, $messageOptions);
536
    }
537
538
    /**
539
     * Offer_ConfirmCarOffer
540
     *
541
     * @param RequestOptions\OfferConfirmCarOptions $options
542
     * @param array $messageOptions (OPTIONAL)
543
     * @return Result
544
     * @throws Client\InvalidMessageException
545
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
546
     * @throws Exception
547
     */
548 4
    public function offerConfirmCar(RequestOptions\OfferConfirmCarOptions $options, $messageOptions = [])
549
    {
550 4
        $msgName = 'Offer_ConfirmCarOffer';
551
552 4
        return $this->callMessage($msgName, $options, $messageOptions);
553
    }
554
555
    /**
556
     * Fare_MasterPricerTravelBoardSearch
557
     *
558
     * @param RequestOptions\FareMasterPricerTbSearch $options
559
     * @param array $messageOptions (OPTIONAL)
560
     * @return Result
561
     * @throws Client\InvalidMessageException
562
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
563
     * @throws Exception
564
     */
565 4
    public function fareMasterPricerTravelBoardSearch(
566
        RequestOptions\FareMasterPricerTbSearch $options,
567
        $messageOptions = []
568
    ) {
569 4
        $msgName = 'Fare_MasterPricerTravelBoardSearch';
570
571 4
        return $this->callMessage($msgName, $options, $messageOptions);
572
    }
573
574
    /**
575
     * Fare_MasterPricerCalendar
576
     *
577
     * @param RequestOptions\FareMasterPricerCalendarOptions $options
578
     * @param array $messageOptions (OPTIONAL)
579
     * @return Result
580
     * @throws Client\InvalidMessageException
581
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
582
     * @throws Exception
583
     */
584 4
    public function fareMasterPricerCalendar(
585
        RequestOptions\FareMasterPricerCalendarOptions $options,
586
        $messageOptions = []
587
    ) {
588 4
        $msgName = 'Fare_MasterPricerCalendar';
589
590 4
        return $this->callMessage($msgName, $options, $messageOptions);
591
    }
592
593
    /**
594
     * Fare_PricePnrWithBookingClass
595
     *
596
     * @param RequestOptions\FarePricePnrWithBookingClassOptions $options
597
     * @param array $messageOptions (OPTIONAL)
598
     * @return Result
599
     * @throws Client\InvalidMessageException
600
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
601
     * @throws Exception
602
     */
603 8
    public function farePricePnrWithBookingClass(
604
        RequestOptions\FarePricePnrWithBookingClassOptions $options,
605
        $messageOptions = []
606
    ) {
607 8
        $msgName = 'Fare_PricePNRWithBookingClass';
608
609 8
        return $this->callMessage($msgName, $options, $messageOptions);
610
    }
611
612
    /**
613
     * Fare_PricePnrWithLowerFares
614
     *
615
     * @param RequestOptions\FarePricePnrWithLowerFaresOptions $options
616
     * @param array $messageOptions (OPTIONAL)
617
     * @return Result
618
     * @throws Client\InvalidMessageException
619
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
620
     * @throws Exception
621
     */
622 8
    public function farePricePnrWithLowerFares(
623
        RequestOptions\FarePricePnrWithLowerFaresOptions $options,
624
        $messageOptions = []
625
    ) {
626 8
        $msgName = 'Fare_PricePNRWithLowerFares';
627
628 8
        return $this->callMessage($msgName, $options, $messageOptions);
629
    }
630
631
    /**
632
     * Fare_PricePnrWithLowestFare
633
     *
634
     * @param RequestOptions\FarePricePnrWithLowestFareOptions $options
635
     * @param array $messageOptions (OPTIONAL)
636
     * @return Result
637
     * @throws Client\InvalidMessageException
638
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
639
     * @throws Exception
640
     */
641 8
    public function farePricePnrWithLowestFare(
642
        RequestOptions\FarePricePnrWithLowestFareOptions $options,
643
        $messageOptions = []
644
    ) {
645 8
        $msgName = 'Fare_PricePNRWithLowestFare';
646
647 8
        return $this->callMessage($msgName, $options, $messageOptions);
648
    }
649
650
    /**
651
     * Fare_InformativePricingWithoutPNR
652
     *
653
     * @param RequestOptions\FareInformativePricingWithoutPnrOptions $options
654
     * @param array $messageOptions (OPTIONAL)
655
     * @return Result
656
     * @throws Client\InvalidMessageException
657
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
658
     * @throws Exception
659
     */
660 4
    public function fareInformativePricingWithoutPnr(
661
        RequestOptions\FareInformativePricingWithoutPnrOptions $options,
662
        $messageOptions = []
663
    ) {
664 4
        $msgName = 'Fare_InformativePricingWithoutPNR';
665
666 4
        return $this->callMessage($msgName, $options, $messageOptions);
667
    }
668
669
    /**
670
     * Fare_InformativeBestPricingWithoutPNR
671
     *
672
     * @param RequestOptions\FareInformativeBestPricingWithoutPnrOptions $options
673
     * @param array $messageOptions (OPTIONAL)
674
     * @return Result
675
     * @throws Client\InvalidMessageException
676
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
677
     * @throws Exception
678
     */
679 4
    public function fareInformativeBestPricingWithoutPnr(
680
        RequestOptions\FareInformativeBestPricingWithoutPnrOptions $options,
681
        $messageOptions = []
682
    ) {
683 4
        $msgName = 'Fare_InformativeBestPricingWithoutPNR';
684
685 4
        return $this->callMessage($msgName, $options, $messageOptions);
686
    }
687
688
    /**
689
     * Fare_CheckRules
690
     *
691
     * @param RequestOptions\FareCheckRulesOptions $options
692
     * @param array $messageOptions (OPTIONAL)
693
     * @return Result
694
     * @throws Client\InvalidMessageException
695
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
696
     * @throws Exception
697
     */
698 4
    public function fareCheckRules(RequestOptions\FareCheckRulesOptions $options, $messageOptions = [])
699
    {
700 4
        $msgName = 'Fare_CheckRules';
701
702 4
        return $this->callMessage($msgName, $options, $messageOptions);
703
    }
704
705
    /**
706
     * Fare_GetFareRules
707
     *
708
     * @param RequestOptions\FareGetFareRulesOptions $options
709
     * @param array $messageOptions (OPTIONAL)
710
     * @return Result
711
     * @throws Client\InvalidMessageException
712
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
713
     * @throws Exception
714
     */
715 4
    public function fareGetFareRules(RequestOptions\FareGetFareRulesOptions $options, $messageOptions = [])
716
    {
717 4
        $msgName = 'Fare_GetFareRules';
718
719 4
        return $this->callMessage($msgName, $options, $messageOptions);
720
    }
721
722
    /**
723
     * Fare_ConvertCurrency
724
     *
725
     * @param RequestOptions\FareConvertCurrencyOptions $options
726
     * @param array $messageOptions (OPTIONAL)
727
     * @return Result
728
     * @throws Client\InvalidMessageException
729
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
730
     * @throws Exception
731
     */
732 4
    public function fareConvertCurrency(RequestOptions\FareConvertCurrencyOptions $options, $messageOptions = [])
733
    {
734 4
        $msgName = 'Fare_ConvertCurrency';
735
736 4
        return $this->callMessage($msgName, $options, $messageOptions);
737
    }
738
739
    /**
740
     * Air_MultiAvailability
741
     *
742
     * @param RequestOptions\AirMultiAvailabilityOptions $options
743
     * @param array $messageOptions (OPTIONAL)
744
     * @return Result
745
     * @throws Client\InvalidMessageException
746
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
747
     * @throws Exception
748
     */
749 4
    public function airMultiAvailability(
750
        RequestOptions\AirMultiAvailabilityOptions $options,
751
        $messageOptions = []
752
    ) {
753 4
        $msgName = 'Air_MultiAvailability';
754
755 4
        return $this->callMessage($msgName, $options, $messageOptions);
756
    }
757
758
    /**
759
     * Air_SellFromRecommendation
760
     *
761
     * @param RequestOptions\AirSellFromRecommendationOptions $options
762
     * @param array $messageOptions (OPTIONAL)
763
     * @return Result
764
     * @throws Client\InvalidMessageException
765
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
766
     * @throws Exception
767
     */
768 4
    public function airSellFromRecommendation(
769
        RequestOptions\AirSellFromRecommendationOptions $options,
770
        $messageOptions = []
771
    ) {
772 4
        $msgName = 'Air_SellFromRecommendation';
773
774 4
        return $this->callMessage($msgName, $options, $messageOptions);
775
    }
776
777
    /**
778
     * Air_FlightInfo
779
     *
780
     * @param RequestOptions\AirFlightInfoOptions $options
781
     * @param array $messageOptions (OPTIONAL)
782
     * @return Result
783
     * @throws Client\InvalidMessageException
784
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
785
     * @throws Exception
786
     */
787 4
    public function airFlightInfo(RequestOptions\AirFlightInfoOptions $options, $messageOptions = [])
788
    {
789 4
        $msgName = 'Air_FlightInfo';
790
791 4
        return $this->callMessage($msgName, $options, $messageOptions);
792
    }
793
794
    /**
795
     * Air_RetrieveSeatMap
796
     *
797
     * @param RequestOptions\AirRetrieveSeatMapOptions $options
798
     * @param array $messageOptions (OPTIONAL)
799
     * @return Result
800
     * @throws Client\InvalidMessageException
801
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
802
     * @throws Exception
803
     */
804 4
    public function airRetrieveSeatMap(RequestOptions\AirRetrieveSeatMapOptions $options, $messageOptions = [])
805
    {
806 4
        $msgName = 'Air_RetrieveSeatMap';
807
808 4
        return $this->callMessage($msgName, $options, $messageOptions);
809
    }
810
811
    /**
812
     * Air_RebookAirSegment
813
     *
814
     * @param RequestOptions\AirRebookAirSegmentOptions $options
815
     * @param array $messageOptions (OPTIONAL)
816
     * @return Result
817
     * @throws Client\InvalidMessageException
818
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
819
     * @throws Exception
820
     */
821 4
    public function airRebookAirSegment(RequestOptions\AirRebookAirSegmentOptions $options, $messageOptions = [])
822
    {
823 4
        $msgName = 'Air_RebookAirSegment';
824
825 4
        return $this->callMessage($msgName, $options, $messageOptions);
826
    }
827
828
    /**
829
     * Command_Cryptic
830
     *
831
     * @param RequestOptions\CommandCrypticOptions $options
832
     * @param array $messageOptions (OPTIONAL)
833
     * @return Result
834
     * @throws Client\InvalidMessageException
835
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
836
     * @throws Exception
837
     */
838 4
    public function commandCryptic(RequestOptions\CommandCrypticOptions $options, $messageOptions = [])
839
    {
840 4
        $msgName = 'Command_Cryptic';
841
842 4
        return $this->callMessage($msgName, $options, $messageOptions);
843
    }
844
845
    /**
846
     * MiniRule_GetFromPricingRec
847
     *
848
     * @param RequestOptions\MiniRuleGetFromPricingRecOptions $options
849
     * @param array $messageOptions (OPTIONAL)
850
     * @return Result
851
     * @throws Client\InvalidMessageException
852
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
853
     * @throws Exception
854
     */
855 4
    public function miniRuleGetFromPricingRec(
856
        RequestOptions\MiniRuleGetFromPricingRecOptions $options,
857
        $messageOptions = []
858
    ) {
859 4
        $msgName = 'MiniRule_GetFromPricingRec';
860
861 4
        return $this->callMessage($msgName, $options, $messageOptions);
862
    }
863
864
    /**
865
     * MiniRule_GetFromPricing
866
     *
867
     * @param RequestOptions\MiniRuleGetFromPricingOptions $options
868
     * @param array $messageOptions (OPTIONAL)
869
     * @return Result
870
     * @throws Client\InvalidMessageException
871
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
872
     * @throws Exception
873
     */
874 4
    public function miniRuleGetFromPricing(
875
        RequestOptions\MiniRuleGetFromPricingOptions $options,
876
        $messageOptions = []
877
    ) {
878 4
        $msgName = 'MiniRule_GetFromPricing';
879
880 4
        return $this->callMessage($msgName, $options, $messageOptions);
881
    }
882
883
    /**
884
     * MiniRule_GetFromETicket
885
     *
886
     * @param RequestOptions\MiniRuleGetFromETicketOptions $options
887
     * @param array $messageOptions (OPTIONAL)
888
     * @return Result
889
     * @throws Client\InvalidMessageException
890
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
891
     * @throws Exception
892
     */
893 4
    public function miniRuleGetFromETicket(
894
        RequestOptions\MiniRuleGetFromETicketOptions $options,
895
        $messageOptions = []
896
    ) {
897 4
        $msgName = 'MiniRule_GetFromETicket';
898
899 4
        return $this->callMessage($msgName, $options, $messageOptions);
900
    }
901
902
    /**
903
     * Info_EncodeDecodeCity
904
     *
905
     * @param RequestOptions\InfoEncodeDecodeCityOptions $options
906
     * @param array $messageOptions (OPTIONAL)
907
     * @return Result
908
     * @throws Client\InvalidMessageException
909
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
910
     * @throws Exception
911
     */
912 4
    public function infoEncodeDecodeCity(RequestOptions\InfoEncodeDecodeCityOptions $options, $messageOptions = [])
913
    {
914 4
        $msgName = 'Info_EncodeDecodeCity';
915
916 4
        return $this->callMessage($msgName, $options, $messageOptions);
917
    }
918
919
    /**
920
     * PointOfRef_Search
921
     *
922
     * @param RequestOptions\PointOfRefSearchOptions $options
923
     * @param array $messageOptions (OPTIONAL)
924
     * @return Result
925
     * @throws Client\InvalidMessageException
926
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
927
     * @throws Exception
928
     */
929 4
    public function pointOfRefSearch(RequestOptions\PointOfRefSearchOptions $options, $messageOptions = [])
930
    {
931 4
        $msgName = 'PointOfRef_Search';
932
933 4
        return $this->callMessage($msgName, $options, $messageOptions);
934
    }
935
936
937
    /**
938
     * Ticket_CreateTSTFromPricing
939
     *
940
     * @param RequestOptions\TicketCreateTstFromPricingOptions $options
941
     * @param array $messageOptions (OPTIONAL)
942
     * @return Result
943
     * @throws Client\InvalidMessageException
944
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
945
     * @throws Exception
946
     */
947 4
    public function ticketCreateTSTFromPricing(
948
        RequestOptions\TicketCreateTstFromPricingOptions $options,
949
        $messageOptions = []
950
    ) {
951 4
        $msgName = 'Ticket_CreateTSTFromPricing';
952
953 4
        return $this->callMessage($msgName, $options, $messageOptions);
954
    }
955
956
    /**
957
     * Ticket_CreateTSMFromPricing
958
     *
959
     * @param RequestOptions\TicketCreateTsmFromPricingOptions $options
960
     * @param array $messageOptions (OPTIONAL)
961
     * @return Result
962
     * @throws Client\InvalidMessageException
963
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
964
     * @throws Exception
965
     */
966 4
    public function ticketCreateTSMFromPricing(
967
        RequestOptions\TicketCreateTsmFromPricingOptions $options,
968
        $messageOptions = []
969
    ) {
970 4
        $msgName = 'Ticket_CreateTSMFromPricing';
971
972 4
        return $this->callMessage($msgName, $options, $messageOptions);
973
    }
974
975
    /**
976
     * Ticket_CreateTSMFareElement
977
     *
978
     * @param RequestOptions\TicketCreateTsmFareElOptions $options
979
     * @param array $messageOptions (OPTIONAL)
980
     * @return Result
981
     * @throws Client\InvalidMessageException
982
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
983
     * @throws Exception
984
     */
985 4
    public function ticketCreateTSMFareElement(
986
        RequestOptions\TicketCreateTsmFareElOptions $options,
987
        $messageOptions = []
988
    ) {
989 4
        $msgName = 'Ticket_CreateTSMFareElement';
990
991 4
        return $this->callMessage($msgName, $options, $messageOptions);
992
    }
993
994
    /**
995
     * Ticket_DeleteTST
996
     *
997
     * @param RequestOptions\TicketDeleteTstOptions $options
998
     * @param array $messageOptions (OPTIONAL)
999
     * @return Result
1000
     * @throws Client\InvalidMessageException
1001
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1002
     * @throws Exception
1003
     */
1004 4
    public function ticketDeleteTST(RequestOptions\TicketDeleteTstOptions $options, $messageOptions = [])
1005
    {
1006 4
        $msgName = 'Ticket_DeleteTST';
1007
1008 4
        return $this->callMessage($msgName, $options, $messageOptions);
1009
    }
1010
1011
    /**
1012
     * Ticket_DeleteTSMP
1013
     *
1014
     * @param RequestOptions\TicketDeleteTsmpOptions $options
1015
     * @param array $messageOptions (OPTIONAL)
1016
     * @return Result
1017
     * @throws Client\InvalidMessageException
1018
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1019
     * @throws Exception
1020
     */
1021 4
    public function ticketDeleteTSMP(RequestOptions\TicketDeleteTsmpOptions $options, $messageOptions = [])
1022
    {
1023 4
        $msgName = 'Ticket_DeleteTSMP';
1024
1025 4
        return $this->callMessage($msgName, $options, $messageOptions);
1026
    }
1027
1028
    /**
1029
     * Ticket_DisplayTST
1030
     *
1031
     * @param RequestOptions\TicketDisplayTstOptions $options
1032
     * @param array $messageOptions (OPTIONAL)
1033
     * @return Result
1034
     * @throws Client\InvalidMessageException
1035
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1036
     * @throws Exception
1037
     */
1038 4
    public function ticketDisplayTST(RequestOptions\TicketDisplayTstOptions $options, $messageOptions = [])
1039
    {
1040 4
        $msgName = 'Ticket_DisplayTST';
1041
1042 4
        return $this->callMessage($msgName, $options, $messageOptions);
1043
    }
1044
1045
    /**
1046
     * Ticket_DisplayTSMP
1047
     *
1048
     * @param RequestOptions\TicketDisplayTsmpOptions $options
1049
     * @param array $messageOptions (OPTIONAL)
1050
     * @return Result
1051
     * @throws Client\InvalidMessageException
1052
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1053
     * @throws Exception
1054
     */
1055 4
    public function ticketDisplayTSMP(RequestOptions\TicketDisplayTsmpOptions $options, $messageOptions = [])
1056
    {
1057 4
        $msgName = 'Ticket_DisplayTSMP';
1058
1059 4
        return $this->callMessage($msgName, $options, $messageOptions);
1060
    }
1061
1062
    /**
1063
     * Ticket_DisplayTSMFareElement
1064
     *
1065
     * @param RequestOptions\TicketDisplayTsmFareElOptions $options
1066
     * @param array $messageOptions (OPTIONAL)
1067
     * @return Result
1068
     * @throws Client\InvalidMessageException
1069
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1070
     * @throws Exception
1071
     */
1072 4
    public function ticketDisplayTSMFareElement(
1073
        RequestOptions\TicketDisplayTsmFareElOptions $options,
1074
        $messageOptions = []
1075
    ) {
1076 4
        $msgName = 'Ticket_DisplayTSMFareElement';
1077
1078 4
        return $this->callMessage($msgName, $options, $messageOptions);
1079
    }
1080
1081
    /**
1082
     * Ticket_CheckEligibility
1083
     *
1084
     * @param RequestOptions\TicketCheckEligibilityOptions $options
1085
     * @param array $messageOptions (OPTIONAL)
1086
     * @return Result
1087
     * @throws Client\InvalidMessageException
1088
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1089
     * @throws Exception
1090
     */
1091 4
    public function ticketCheckEligibility(
1092
        RequestOptions\TicketCheckEligibilityOptions $options,
1093
        $messageOptions = []
1094
    ) {
1095 4
        $msgName = 'Ticket_CheckEligibility';
1096
1097 4
        return $this->callMessage($msgName, $options, $messageOptions);
1098
    }
1099
1100
    /**
1101
     * Ticket_ATCShopperMasterPricerTravelBoardSearch
1102
     *
1103
     * @param RequestOptions\TicketAtcShopperMpTbSearchOptions $options
1104
     * @param array $messageOptions (OPTIONAL)
1105
     * @return Result
1106
     * @throws Client\InvalidMessageException
1107
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1108
     * @throws Exception
1109
     */
1110 4
    public function ticketAtcShopperMasterPricerTravelBoardSearch(
1111
        RequestOptions\TicketAtcShopperMpTbSearchOptions $options,
1112
        $messageOptions = []
1113
    ) {
1114 4
        $msgName = 'Ticket_ATCShopperMasterPricerTravelBoardSearch';
1115
1116 4
        return $this->callMessage($msgName, $options, $messageOptions);
1117
    }
1118
1119
    /**
1120
     * Ticket_RepricePNRWithBookingClass
1121
     *
1122
     * @param RequestOptions\TicketRepricePnrWithBookingClassOptions $options
1123
     * @param array $messageOptions (OPTIONAL)
1124
     * @return Result
1125
     * @throws Client\InvalidMessageException
1126
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1127
     * @throws Exception
1128
     */
1129 4
    public function ticketRepricePnrWithBookingClass(
1130
        RequestOptions\TicketRepricePnrWithBookingClassOptions $options,
1131
        $messageOptions = []
1132
    ) {
1133 4
        $msgName = 'Ticket_RepricePNRWithBookingClass';
1134
1135 4
        return $this->callMessage($msgName, $options, $messageOptions);
1136
    }
1137
1138
    /**
1139
     * Ticket_CancelDocument
1140
     *
1141
     * @param RequestOptions\TicketCancelDocumentOptions $options
1142
     * @param array $messageOptions (OPTIONAL)
1143
     * @return Result
1144
     * @throws Client\InvalidMessageException
1145
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1146
     * @throws Exception
1147
     */
1148 4
    public function ticketCancelDocument(
1149
        RequestOptions\TicketCancelDocumentOptions $options,
1150
        $messageOptions = []
1151
    ) {
1152 4
        $msgName = 'Ticket_CancelDocument';
1153
1154 4
        return $this->callMessage($msgName, $options, $messageOptions);
1155
    }
1156
1157
    /**
1158
     * Ticket_ReissueConfirmedPricing
1159
     *
1160
     * @param RequestOptions\TicketReissueConfirmedPricingOptions $options
1161
     * @param array $messageOptions (OPTIONAL)
1162
     * @return Result
1163
     * @throws Client\InvalidMessageException
1164
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1165
     * @throws Exception
1166
     */
1167 4
    public function ticketReissueConfirmedPricing(
1168
        RequestOptions\TicketReissueConfirmedPricingOptions $options,
1169
        $messageOptions = []
1170
    ) {
1171 4
        $msgName = 'Ticket_ReissueConfirmedPricing';
1172
1173 4
        return $this->callMessage($msgName, $options, $messageOptions);
1174
    }
1175
1176
    /**
1177
     * Ticket_ProcessEDoc
1178
     *
1179
     * @param RequestOptions\TicketProcessEDocOptions $options
1180
     * @param array $messageOptions (OPTIONAL)
1181
     * @return Result
1182
     * @throws Client\InvalidMessageException
1183
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1184
     * @throws Exception
1185
     */
1186 4
    public function ticketProcessEDoc(RequestOptions\TicketProcessEDocOptions $options, $messageOptions = [])
1187
    {
1188 4
        $msgName = 'Ticket_ProcessEDoc';
1189 4
        return $this->callMessage($msgName, $options, $messageOptions);
1190
    }
1191
1192
    /**
1193
     * Ticket_ProcessETicket
1194
     *
1195
     * @param RequestOptions\TicketProcessETicketOptions $options
1196
     * @param array $messageOptions (OPTIONAL)
1197
     * @return Result
1198
     * @throws Client\InvalidMessageException
1199
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1200
     * @throws Exception
1201
     */
1202 4
    public function ticketProcessETicket(RequestOptions\TicketProcessETicketOptions $options, $messageOptions = [])
1203
    {
1204 4
        $msgName = 'Ticket_ProcessETicket';
1205 4
        return $this->callMessage($msgName, $options, $messageOptions);
1206
    }
1207
1208
    /**
1209
     * DocIssuance_IssueTicket
1210
     *
1211
     * @param RequestOptions\DocIssuanceIssueTicketOptions $options
1212
     * @param array $messageOptions (OPTIONAL)
1213
     * @return Result
1214
     * @throws Client\InvalidMessageException
1215
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1216
     * @throws Exception
1217
     */
1218 4
    public function docIssuanceIssueTicket(
1219
        RequestOptions\DocIssuanceIssueTicketOptions $options,
1220
        $messageOptions = []
1221
    ) {
1222 4
        $msgName = 'DocIssuance_IssueTicket';
1223
1224 4
        return $this->callMessage($msgName, $options, $messageOptions);
1225
    }
1226
1227
    /**
1228
     * DocIssuance_IssueMiscellaneousDocuments
1229
     *
1230
     * @param RequestOptions\DocIssuanceIssueMiscDocOptions $options
1231
     * @param array $messageOptions (OPTIONAL)
1232
     * @return Result
1233
     * @throws Client\InvalidMessageException
1234
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1235
     * @throws Exception
1236
     */
1237 4
    public function docIssuanceIssueMiscellaneousDocuments(
1238
        RequestOptions\DocIssuanceIssueMiscDocOptions $options,
1239
        $messageOptions = []
1240
    ) {
1241 4
        $msgName = 'DocIssuance_IssueMiscellaneousDocuments';
1242
1243 4
        return $this->callMessage($msgName, $options, $messageOptions);
1244
    }
1245
1246
    /**
1247
     * DocIssuance_IssueCombined
1248
     *
1249
     * @param RequestOptions\DocIssuanceIssueCombinedOptions $options
1250
     * @param array $messageOptions (OPTIONAL)
1251
     * @return Result
1252
     * @throws Client\InvalidMessageException
1253
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1254
     * @throws Exception
1255
     */
1256 8
    public function docIssuanceIssueCombined(
1257
        RequestOptions\DocIssuanceIssueCombinedOptions $options,
1258
        $messageOptions = []
1259
    ) {
1260 8
        $msgName = 'DocIssuance_IssueCombined';
1261
1262 8
        return $this->callMessage($msgName, $options, $messageOptions);
1263
    }
1264
1265
    /**
1266
     * DocRefund_InitRefund
1267
     *
1268
     * @param RequestOptions\DocRefundInitRefundOptions $options
1269
     * @param array $messageOptions (OPTIONAL)
1270
     * @return Result
1271
     * @throws Client\InvalidMessageException
1272
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1273
     * @throws Exception
1274
     */
1275 4
    public function docRefundInitRefund(
1276
        RequestOptions\DocRefundInitRefundOptions $options,
1277
        $messageOptions = []
1278
    ) {
1279 4
        $msgName = 'DocRefund_InitRefund';
1280
1281 4
        return $this->callMessage($msgName, $options, $messageOptions);
1282
    }
1283
1284
    /**
1285
     * DocRefund_IgnoreRefund
1286
     *
1287
     * @param RequestOptions\DocRefundIgnoreRefundOptions $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 docRefundIgnoreRefund(
1295
        RequestOptions\DocRefundIgnoreRefundOptions $options,
1296
        $messageOptions = []
1297
    ) {
1298 4
        $msgName = 'DocRefund_IgnoreRefund';
1299
1300 4
        return $this->callMessage($msgName, $options, $messageOptions);
1301
    }
1302
1303
    /**
1304
     * DocRefund_UpdateRefund
1305
     *
1306
     * @param RequestOptions\DocRefundUpdateRefundOptions $options
1307
     * @param array $messageOptions (OPTIONAL)
1308
     * @return Result
1309
     * @throws Client\InvalidMessageException
1310
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1311
     * @throws Exception
1312
     */
1313 4
    public function docRefundUpdateRefund(
1314
        RequestOptions\DocRefundUpdateRefundOptions $options,
1315
        $messageOptions = []
1316
    ) {
1317 4
        $msgName = 'DocRefund_UpdateRefund';
1318
1319 4
        return $this->callMessage($msgName, $options, $messageOptions);
1320
    }
1321
1322
    /**
1323
     * DocRefund_ProcessRefund
1324
     *
1325
     * @param RequestOptions\DocRefundProcessRefundOptions $options
1326
     * @param array $messageOptions (OPTIONAL)
1327
     * @return Result
1328
     * @throws Client\InvalidMessageException
1329
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1330
     * @throws Exception
1331
     */
1332 4
    public function docRefundProcessRefund(
1333
        RequestOptions\DocRefundProcessRefundOptions $options,
1334
        $messageOptions = []
1335
    ) {
1336 4
        $msgName = 'DocRefund_ProcessRefund';
1337
1338 4
        return $this->callMessage($msgName, $options, $messageOptions);
1339
    }
1340
    /**
1341
     * Ticket_InitRefund
1342
     *
1343
     * @param RequestOptions\TicketInitRefundOptions $options
1344
     * @param array $messageOptions (OPTIONAL)
1345
     * @return Result
1346
     * @throws Client\InvalidMessageException
1347
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1348
     * @throws Exception
1349
     */
1350 4
    public function ticketInitRefund(
1351
        RequestOptions\TicketInitRefundOptions $options,
1352
        $messageOptions = []
1353
    ) {
1354 4
        $msgName = 'Ticket_InitRefund';
1355
1356 4
        return $this->callMessage($msgName, $options, $messageOptions);
1357
    }
1358
    /**
1359
     * Ticket_IgnoreRefund
1360
     *
1361
     * @param RequestOptions\TicketIgnoreRefundOptions $options
1362
     * @param array $messageOptions (OPTIONAL)
1363
     * @return Result
1364
     * @throws Client\InvalidMessageException
1365
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1366
     * @throws Exception
1367
     */
1368 4
    public function ticketIgnoreRefund(
1369
        RequestOptions\TicketIgnoreRefundOptions $options,
1370
        $messageOptions = []
1371
    ) {
1372 4
        $msgName = 'Ticket_IgnoreRefund';
1373
1374 4
        return $this->callMessage($msgName, $options, $messageOptions);
1375
    }
1376
    /**
1377
     * Ticket_ProcessRefund
1378
     *
1379
     * @param RequestOptions\TicketProcessRefundOptions $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 ticketProcessRefund(
1387
        RequestOptions\TicketProcessRefundOptions $options,
1388
        $messageOptions = []
1389
    ) {
1390 4
        $msgName = 'Ticket_ProcessRefund';
1391
1392 4
        return $this->callMessage($msgName, $options, $messageOptions);
1393
    }
1394
1395
    
1396
    /**
1397
     * FOP_CreateFormOfPayment
1398
     *
1399
     * @param RequestOptions\FopCreateFopOptions $options
1400
     * @param array $messageOptions (OPTIONAL)
1401
     * @return Result
1402
     * @throws Client\InvalidMessageException
1403
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1404
     * @throws Exception
1405
     */
1406 4
    public function fopCreateFormOfPayment(RequestOptions\FopCreateFopOptions $options, $messageOptions = [])
1407
    {
1408 4
        $msgName = 'FOP_CreateFormOfPayment';
1409
1410 4
        return $this->callMessage($msgName, $options, $messageOptions);
1411
    }
1412
1413
1414
    /**
1415
     * FOP_CreateFormOfPayment
1416
     *
1417
     * @param RequestOptions\FopValidateFopOptions $options
1418
     * @param array $messageOptions (OPTIONAL)
1419
     * @return Result
1420
     * @throws Client\InvalidMessageException
1421
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1422
     * @throws Exception
1423
     */
1424 4
    public function fopValidateFOP(RequestOptions\FopValidateFopOptions $options, $messageOptions = [])
1425
    {
1426 4
        $msgName = 'FOP_ValidateFOP';
1427
1428 4
        return $this->callMessage($msgName, $options, $messageOptions);
1429
    }
1430
1431
    /**
1432
     * PriceXplorer_ExtremeSearch
1433
     *
1434
     * @param RequestOptions\PriceXplorerExtremeSearchOptions $options
1435
     * @param array $messageOptions (OPTIONAL)
1436
     * @return Result
1437
     * @throws Client\InvalidMessageException
1438
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1439
     * @throws Exception
1440
     */
1441 4
    public function priceXplorerExtremeSearch(
1442
        RequestOptions\PriceXplorerExtremeSearchOptions $options,
1443
        $messageOptions = []
1444
    ) {
1445 4
        $msgName = 'PriceXplorer_ExtremeSearch';
1446
1447 4
        return $this->callMessage($msgName, $options, $messageOptions);
1448
    }
1449
1450
    /**
1451
     * SalesReports_DisplayQueryReport
1452
     *
1453
     * @param RequestOptions\SalesReportsDisplayQueryReportOptions $options
1454
     * @param array $messageOptions (OPTIONAL)
1455
     * @return Result
1456
     * @throws Client\InvalidMessageException
1457
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1458
     * @throws Exception
1459
     */
1460 4
    public function salesReportsDisplayQueryReport(
1461
        RequestOptions\SalesReportsDisplayQueryReportOptions $options,
1462
        $messageOptions = []
1463
    ) {
1464 4
        $msgName = 'SalesReports_DisplayQueryReport';
1465
1466 4
        return $this->callMessage($msgName, $options, $messageOptions);
1467
    }
1468
1469
    /**
1470
     * Service_IntegratedPricing
1471
     *
1472
     * @param RequestOptions\ServiceIntegratedPricingOptions $options
1473
     * @param array $messageOptions (OPTIONAL)
1474
     * @return Result
1475
     * @throws Client\InvalidMessageException
1476
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1477
     * @throws Exception
1478
     */
1479 4
    public function serviceIntegratedPricing(
1480
        RequestOptions\ServiceIntegratedPricingOptions $options,
1481
        $messageOptions = []
1482
    ) {
1483 4
        $msgName = 'Service_IntegratedPricing';
1484
1485 4
        return $this->callMessage($msgName, $options, $messageOptions);
1486
    }
1487
1488
    /**
1489
     * Service_IntegratedCatalogue
1490
     *
1491
     * @param RequestOptions\ServiceIntegratedCatalogueOptions $options
1492
     * @param array $messageOptions (OPTIONAL)
1493
     * @return Result
1494
     * @throws Client\InvalidMessageException
1495
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1496
     * @throws Exception
1497
     */
1498 4
    public function serviceIntegratedCatalogue(
1499
        RequestOptions\ServiceIntegratedCatalogueOptions $options,
1500
        $messageOptions = []
1501
    ) {
1502 4
        $msgName = 'Service_IntegratedCatalogue';
1503
1504 4
        return $this->callMessage($msgName, $options, $messageOptions);
1505
    }
1506
1507
    /**
1508
     * Call a message with the given parameters
1509
     *
1510
     * @param string $messageName
1511
     * @param RequestOptions\RequestOptionsInterface $options
1512
     * @param array $messageOptions
1513
     * @param bool $endSession
1514
     * @return Result
1515
     * @throws Client\Exception
1516
     * @throws Client\Struct\InvalidArgumentException
1517
     * @throws Client\InvalidMessageException
1518
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1519
     * @throws \RuntimeException
1520
     * @throws \InvalidArgumentException
1521
     */
1522 312
    protected function callMessage($messageName, $options, $messageOptions, $endSession = false)
1523
    {
1524 312
        $messageOptions = $this->makeMessageOptions($messageOptions, $endSession);
1525
1526 312
        $this->lastMessage = $messageName;
1527
1528 312
        $sendResult = $this->sessionHandler->sendMessage(
1529 312
            $messageName,
1530 312
            $this->requestCreator->createRequest(
1531 312
                $messageName,
1532 156
                $options
1533 156
            ),
1534 156
            $messageOptions
1535 156
        );
1536
1537 312
        $response = $this->responseHandler->analyzeResponse(
1538 312
            $sendResult,
1539 156
            $messageName
1540 156
        );
1541
1542 312
        if ($messageOptions['returnXml'] === false) {
1543 4
            $response->responseXml = null;
1544 2
        }
1545
1546 312
        return $response;
1547
    }
1548
1549
    /**
1550
     * Make message options
1551
     *
1552
     * Message options are meta options when sending a message to the amadeus web services
1553
     * - 'endSession' (if stateful) : should we end the current session after sending this call?
1554
     * - 'returnXml' : Should we return the XML string in the Result::responseXml property?
1555
     *   (this overrides the default setting returnXml in the Amadeus\Client\Params for a single message)
1556
     *
1557
     * @param array $incoming The Message options chosen by the caller - if any.
1558
     * @param bool $endSession Switch if you want to terminate the current session after making the call.
1559
     * @return array
1560
     */
1561 336
    protected function makeMessageOptions(array $incoming, $endSession = false)
1562
    {
1563
        $options = [
1564 336
            'endSession' => $endSession,
1565 336
            'returnXml' => $this->returnResultXml
1566 168
        ];
1567
1568 336
        if (array_key_exists('endSession', $incoming)) {
1569 4
            $options['endSession'] = $incoming['endSession'];
1570 2
        }
1571
1572 336
        if (array_key_exists('returnXml', $incoming)) {
1573 12
            $options['returnXml'] = $incoming['returnXml'];
1574 6
        }
1575
1576 336
        return $options;
1577
    }
1578
}
1579