Completed
Push — master ( 0fd1a8...1a02a0 )
by Dieter
26:16
created

Client::pnrIgnore()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
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.8.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 388
    public function __construct(Params $params)
189
    {
190 388
        $this->loadClientParams(
191 388
            $params,
192 388
            self::RECEIVED_FROM_IDENTIFIER,
193 194
            self::VERSION
194 194
        );
195 384
    }
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
     * PNR_Ignore - Ignore an Amadeus PNR by record locator
436
     *
437
     * @param RequestOptions\PnrIgnoreOptions $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 pnrIgnore(RequestOptions\PnrIgnoreOptions $options, $messageOptions = [])
445
    {
446 4
        $msgName = 'PNR_Ignore';
447
448 4
        return $this->callMessage($msgName, $options, $messageOptions);
449
    }
450
451
452
    /**
453
     * Queue_RemoveItem - remove an item (a PNR) from a given queue
454
     *
455
     * @param RequestOptions\QueueRemoveItemOptions $options
456
     * @param array $messageOptions (OPTIONAL)
457
     * @return Result
458
     * @throws Client\InvalidMessageException
459
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
460
     * @throws Exception
461
     */
462 4
    public function queueRemoveItem(RequestOptions\QueueRemoveItemOptions $options, $messageOptions = [])
463
    {
464 4
        $msgName = 'Queue_RemoveItem';
465
466 4
        return $this->callMessage($msgName, $options, $messageOptions);
467
    }
468
469
    /**
470
     * Queue_MoveItem - move an item (a PNR) from one queue to another.
471
     *
472
     * @param RequestOptions\QueueMoveItemOptions $options
473
     * @param array $messageOptions (OPTIONAL)
474
     * @return Result
475
     * @throws Client\InvalidMessageException
476
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
477
     * @throws Exception
478
     */
479 4
    public function queueMoveItem(RequestOptions\QueueMoveItemOptions $options, $messageOptions = [])
480
    {
481 4
        $msgName = 'Queue_MoveItem';
482
483 4
        return $this->callMessage($msgName, $options, $messageOptions);
484
    }
485
486
    /**
487
     * Offer_CreateOffer
488
     *
489
     * @param RequestOptions\OfferCreateOptions $options
490
     * @param array $messageOptions (OPTIONAL)
491
     * @return Result
492
     * @throws Client\InvalidMessageException
493
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
494
     * @throws Exception
495
     */
496 4
    public function offerCreate(RequestOptions\OfferCreateOptions $options, $messageOptions = [])
497
    {
498 4
        $msgName = 'Offer_CreateOffer';
499
500 4
        return $this->callMessage($msgName, $options, $messageOptions);
501
    }
502
503
    /**
504
     * Offer_VerifyOffer
505
     *
506
     * To be called in the context of an open PNR
507
     *
508
     * @param RequestOptions\OfferVerifyOptions $options
509
     * @param array $messageOptions (OPTIONAL)
510
     * @return Result
511
     * @throws Client\InvalidMessageException
512
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
513
     * @throws Exception
514
     */
515 4
    public function offerVerify(RequestOptions\OfferVerifyOptions $options, $messageOptions = [])
516
    {
517 4
        $msgName = 'Offer_VerifyOffer';
518
519 4
        return $this->callMessage($msgName, $options, $messageOptions);
520
    }
521
522
    /**
523
     * Offer_ConfirmAirOffer
524
     *
525
     * @param RequestOptions\OfferConfirmAirOptions $options
526
     * @param array $messageOptions (OPTIONAL)
527
     * @return Result
528
     * @throws Client\InvalidMessageException
529
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
530
     * @throws Exception
531
     */
532 4
    public function offerConfirmAir(RequestOptions\OfferConfirmAirOptions $options, $messageOptions = [])
533
    {
534 4
        $msgName = 'Offer_ConfirmAirOffer';
535
536 4
        return $this->callMessage($msgName, $options, $messageOptions);
537
    }
538
539
    /**
540
     * Offer_ConfirmHotelOffer
541
     *
542
     * @param RequestOptions\OfferConfirmHotelOptions $options
543
     * @param array $messageOptions (OPTIONAL)
544
     * @return Result
545
     * @throws Client\InvalidMessageException
546
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
547
     * @throws Exception
548
     */
549 4
    public function offerConfirmHotel(RequestOptions\OfferConfirmHotelOptions $options, $messageOptions = [])
550
    {
551 4
        $msgName = 'Offer_ConfirmHotelOffer';
552
553 4
        return $this->callMessage($msgName, $options, $messageOptions);
554
    }
555
556
    /**
557
     * Offer_ConfirmCarOffer
558
     *
559
     * @param RequestOptions\OfferConfirmCarOptions $options
560
     * @param array $messageOptions (OPTIONAL)
561
     * @return Result
562
     * @throws Client\InvalidMessageException
563
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
564
     * @throws Exception
565
     */
566 4
    public function offerConfirmCar(RequestOptions\OfferConfirmCarOptions $options, $messageOptions = [])
567
    {
568 4
        $msgName = 'Offer_ConfirmCarOffer';
569
570 4
        return $this->callMessage($msgName, $options, $messageOptions);
571
    }
572
573
    /**
574
     * Fare_MasterPricerTravelBoardSearch
575
     *
576
     * @param RequestOptions\FareMasterPricerTbSearch $options
577
     * @param array $messageOptions (OPTIONAL)
578
     * @return Result
579
     * @throws Client\InvalidMessageException
580
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
581
     * @throws Exception
582
     */
583 4
    public function fareMasterPricerTravelBoardSearch(
584
        RequestOptions\FareMasterPricerTbSearch $options,
585
        $messageOptions = []
586
    ) {
587 4
        $msgName = 'Fare_MasterPricerTravelBoardSearch';
588
589 4
        return $this->callMessage($msgName, $options, $messageOptions);
590
    }
591
592
    /**
593
     * Fare_MasterPricerCalendar
594
     *
595
     * @param RequestOptions\FareMasterPricerCalendarOptions $options
596
     * @param array $messageOptions (OPTIONAL)
597
     * @return Result
598
     * @throws Client\InvalidMessageException
599
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
600
     * @throws Exception
601
     */
602 4
    public function fareMasterPricerCalendar(
603
        RequestOptions\FareMasterPricerCalendarOptions $options,
604
        $messageOptions = []
605
    ) {
606 4
        $msgName = 'Fare_MasterPricerCalendar';
607
608 4
        return $this->callMessage($msgName, $options, $messageOptions);
609
    }
610
611
    /**
612
     * Fare_PricePnrWithBookingClass
613
     *
614
     * @param RequestOptions\FarePricePnrWithBookingClassOptions $options
615
     * @param array $messageOptions (OPTIONAL)
616
     * @return Result
617
     * @throws Client\InvalidMessageException
618
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
619
     * @throws Exception
620
     */
621 8
    public function farePricePnrWithBookingClass(
622
        RequestOptions\FarePricePnrWithBookingClassOptions $options,
623
        $messageOptions = []
624
    ) {
625 8
        $msgName = 'Fare_PricePNRWithBookingClass';
626
627 8
        return $this->callMessage($msgName, $options, $messageOptions);
628
    }
629
630
    /**
631
     * Fare_PricePnrWithLowerFares
632
     *
633
     * @param RequestOptions\FarePricePnrWithLowerFaresOptions $options
634
     * @param array $messageOptions (OPTIONAL)
635
     * @return Result
636
     * @throws Client\InvalidMessageException
637
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
638
     * @throws Exception
639
     */
640 8
    public function farePricePnrWithLowerFares(
641
        RequestOptions\FarePricePnrWithLowerFaresOptions $options,
642
        $messageOptions = []
643
    ) {
644 8
        $msgName = 'Fare_PricePNRWithLowerFares';
645
646 8
        return $this->callMessage($msgName, $options, $messageOptions);
647
    }
648
649
    /**
650
     * Fare_PricePnrWithLowestFare
651
     *
652
     * @param RequestOptions\FarePricePnrWithLowestFareOptions $options
653
     * @param array $messageOptions (OPTIONAL)
654
     * @return Result
655
     * @throws Client\InvalidMessageException
656
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
657
     * @throws Exception
658
     */
659 8
    public function farePricePnrWithLowestFare(
660
        RequestOptions\FarePricePnrWithLowestFareOptions $options,
661
        $messageOptions = []
662
    ) {
663 8
        $msgName = 'Fare_PricePNRWithLowestFare';
664
665 8
        return $this->callMessage($msgName, $options, $messageOptions);
666
    }
667
668
    /**
669
     * Fare_InformativePricingWithoutPNR
670
     *
671
     * @param RequestOptions\FareInformativePricingWithoutPnrOptions $options
672
     * @param array $messageOptions (OPTIONAL)
673
     * @return Result
674
     * @throws Client\InvalidMessageException
675
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
676
     * @throws Exception
677
     */
678 4
    public function fareInformativePricingWithoutPnr(
679
        RequestOptions\FareInformativePricingWithoutPnrOptions $options,
680
        $messageOptions = []
681
    ) {
682 4
        $msgName = 'Fare_InformativePricingWithoutPNR';
683
684 4
        return $this->callMessage($msgName, $options, $messageOptions);
685
    }
686
687
    /**
688
     * Fare_InformativeBestPricingWithoutPNR
689
     *
690
     * @param RequestOptions\FareInformativeBestPricingWithoutPnrOptions $options
691
     * @param array $messageOptions (OPTIONAL)
692
     * @return Result
693
     * @throws Client\InvalidMessageException
694
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
695
     * @throws Exception
696
     */
697 4
    public function fareInformativeBestPricingWithoutPnr(
698
        RequestOptions\FareInformativeBestPricingWithoutPnrOptions $options,
699
        $messageOptions = []
700
    ) {
701 4
        $msgName = 'Fare_InformativeBestPricingWithoutPNR';
702
703 4
        return $this->callMessage($msgName, $options, $messageOptions);
704
    }
705
706
    /**
707
     * Fare_CheckRules
708
     *
709
     * @param RequestOptions\FareCheckRulesOptions $options
710
     * @param array $messageOptions (OPTIONAL)
711
     * @return Result
712
     * @throws Client\InvalidMessageException
713
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
714
     * @throws Exception
715
     */
716 4
    public function fareCheckRules(RequestOptions\FareCheckRulesOptions $options, $messageOptions = [])
717
    {
718 4
        $msgName = 'Fare_CheckRules';
719
720 4
        return $this->callMessage($msgName, $options, $messageOptions);
721
    }
722
723
    /**
724
     * Fare_GetFareRules
725
     *
726
     * @param RequestOptions\FareGetFareRulesOptions $options
727
     * @param array $messageOptions (OPTIONAL)
728
     * @return Result
729
     * @throws Client\InvalidMessageException
730
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
731
     * @throws Exception
732
     */
733 4
    public function fareGetFareRules(RequestOptions\FareGetFareRulesOptions $options, $messageOptions = [])
734
    {
735 4
        $msgName = 'Fare_GetFareRules';
736
737 4
        return $this->callMessage($msgName, $options, $messageOptions);
738
    }
739
740
    /**
741
     * Fare_ConvertCurrency
742
     *
743
     * @param RequestOptions\FareConvertCurrencyOptions $options
744
     * @param array $messageOptions (OPTIONAL)
745
     * @return Result
746
     * @throws Client\InvalidMessageException
747
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
748
     * @throws Exception
749
     */
750 4
    public function fareConvertCurrency(RequestOptions\FareConvertCurrencyOptions $options, $messageOptions = [])
751
    {
752 4
        $msgName = 'Fare_ConvertCurrency';
753
754 4
        return $this->callMessage($msgName, $options, $messageOptions);
755
    }
756
757
    /**
758
     * Air_MultiAvailability
759
     *
760
     * @param RequestOptions\AirMultiAvailabilityOptions $options
761
     * @param array $messageOptions (OPTIONAL)
762
     * @return Result
763
     * @throws Client\InvalidMessageException
764
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
765
     * @throws Exception
766
     */
767 4
    public function airMultiAvailability(
768
        RequestOptions\AirMultiAvailabilityOptions $options,
769
        $messageOptions = []
770
    ) {
771 4
        $msgName = 'Air_MultiAvailability';
772
773 4
        return $this->callMessage($msgName, $options, $messageOptions);
774
    }
775
776
    /**
777
     * Air_SellFromRecommendation
778
     *
779
     * @param RequestOptions\AirSellFromRecommendationOptions $options
780
     * @param array $messageOptions (OPTIONAL)
781
     * @return Result
782
     * @throws Client\InvalidMessageException
783
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
784
     * @throws Exception
785
     */
786 4
    public function airSellFromRecommendation(
787
        RequestOptions\AirSellFromRecommendationOptions $options,
788
        $messageOptions = []
789
    ) {
790 4
        $msgName = 'Air_SellFromRecommendation';
791
792 4
        return $this->callMessage($msgName, $options, $messageOptions);
793
    }
794
795
    /**
796
     * Air_FlightInfo
797
     *
798
     * @param RequestOptions\AirFlightInfoOptions $options
799
     * @param array $messageOptions (OPTIONAL)
800
     * @return Result
801
     * @throws Client\InvalidMessageException
802
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
803
     * @throws Exception
804
     */
805 4
    public function airFlightInfo(RequestOptions\AirFlightInfoOptions $options, $messageOptions = [])
806
    {
807 4
        $msgName = 'Air_FlightInfo';
808
809 4
        return $this->callMessage($msgName, $options, $messageOptions);
810
    }
811
812
    /**
813
     * Air_RetrieveSeatMap
814
     *
815
     * @param RequestOptions\AirRetrieveSeatMapOptions $options
816
     * @param array $messageOptions (OPTIONAL)
817
     * @return Result
818
     * @throws Client\InvalidMessageException
819
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
820
     * @throws Exception
821
     */
822 4
    public function airRetrieveSeatMap(RequestOptions\AirRetrieveSeatMapOptions $options, $messageOptions = [])
823
    {
824 4
        $msgName = 'Air_RetrieveSeatMap';
825
826 4
        return $this->callMessage($msgName, $options, $messageOptions);
827
    }
828
829
    /**
830
     * Air_RebookAirSegment
831
     *
832
     * @param RequestOptions\AirRebookAirSegmentOptions $options
833
     * @param array $messageOptions (OPTIONAL)
834
     * @return Result
835
     * @throws Client\InvalidMessageException
836
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
837
     * @throws Exception
838
     */
839 4
    public function airRebookAirSegment(RequestOptions\AirRebookAirSegmentOptions $options, $messageOptions = [])
840
    {
841 4
        $msgName = 'Air_RebookAirSegment';
842
843 4
        return $this->callMessage($msgName, $options, $messageOptions);
844
    }
845
846
    /**
847
     * Command_Cryptic
848
     *
849
     * @param RequestOptions\CommandCrypticOptions $options
850
     * @param array $messageOptions (OPTIONAL)
851
     * @return Result
852
     * @throws Client\InvalidMessageException
853
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
854
     * @throws Exception
855
     */
856 4
    public function commandCryptic(RequestOptions\CommandCrypticOptions $options, $messageOptions = [])
857
    {
858 4
        $msgName = 'Command_Cryptic';
859
860 4
        return $this->callMessage($msgName, $options, $messageOptions);
861
    }
862
863
    /**
864
     * MiniRule_GetFromPricingRec
865
     *
866
     * @param RequestOptions\MiniRuleGetFromPricingRecOptions $options
867
     * @param array $messageOptions (OPTIONAL)
868
     * @return Result
869
     * @throws Client\InvalidMessageException
870
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
871
     * @throws Exception
872
     */
873 4
    public function miniRuleGetFromPricingRec(
874
        RequestOptions\MiniRuleGetFromPricingRecOptions $options,
875
        $messageOptions = []
876
    ) {
877 4
        $msgName = 'MiniRule_GetFromPricingRec';
878
879 4
        return $this->callMessage($msgName, $options, $messageOptions);
880
    }
881
882
    /**
883
     * MiniRule_GetFromPricing
884
     *
885
     * @param RequestOptions\MiniRuleGetFromPricingOptions $options
886
     * @param array $messageOptions (OPTIONAL)
887
     * @return Result
888
     * @throws Client\InvalidMessageException
889
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
890
     * @throws Exception
891
     */
892 4
    public function miniRuleGetFromPricing(
893
        RequestOptions\MiniRuleGetFromPricingOptions $options,
894
        $messageOptions = []
895
    ) {
896 4
        $msgName = 'MiniRule_GetFromPricing';
897
898 4
        return $this->callMessage($msgName, $options, $messageOptions);
899
    }
900
901
    /**
902
     * MiniRule_GetFromETicket
903
     *
904
     * @param RequestOptions\MiniRuleGetFromETicketOptions $options
905
     * @param array $messageOptions (OPTIONAL)
906
     * @return Result
907
     * @throws Client\InvalidMessageException
908
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
909
     * @throws Exception
910
     */
911 4
    public function miniRuleGetFromETicket(
912
        RequestOptions\MiniRuleGetFromETicketOptions $options,
913
        $messageOptions = []
914
    ) {
915 4
        $msgName = 'MiniRule_GetFromETicket';
916
917 4
        return $this->callMessage($msgName, $options, $messageOptions);
918
    }
919
920
    /**
921
     * Info_EncodeDecodeCity
922
     *
923
     * @param RequestOptions\InfoEncodeDecodeCityOptions $options
924
     * @param array $messageOptions (OPTIONAL)
925
     * @return Result
926
     * @throws Client\InvalidMessageException
927
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
928
     * @throws Exception
929
     */
930 4
    public function infoEncodeDecodeCity(RequestOptions\InfoEncodeDecodeCityOptions $options, $messageOptions = [])
931
    {
932 4
        $msgName = 'Info_EncodeDecodeCity';
933
934 4
        return $this->callMessage($msgName, $options, $messageOptions);
935
    }
936
937
    /**
938
     * PointOfRef_Search
939
     *
940
     * @param RequestOptions\PointOfRefSearchOptions $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 pointOfRefSearch(RequestOptions\PointOfRefSearchOptions $options, $messageOptions = [])
948
    {
949 4
        $msgName = 'PointOfRef_Search';
950
951 4
        return $this->callMessage($msgName, $options, $messageOptions);
952
    }
953
954
955
    /**
956
     * Ticket_CreateTSTFromPricing
957
     *
958
     * @param RequestOptions\TicketCreateTstFromPricingOptions $options
959
     * @param array $messageOptions (OPTIONAL)
960
     * @return Result
961
     * @throws Client\InvalidMessageException
962
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
963
     * @throws Exception
964
     */
965 4
    public function ticketCreateTSTFromPricing(
966
        RequestOptions\TicketCreateTstFromPricingOptions $options,
967
        $messageOptions = []
968
    ) {
969 4
        $msgName = 'Ticket_CreateTSTFromPricing';
970
971 4
        return $this->callMessage($msgName, $options, $messageOptions);
972
    }
973
974
    /**
975
     * Ticket_CreateTSMFromPricing
976
     *
977
     * @param RequestOptions\TicketCreateTsmFromPricingOptions $options
978
     * @param array $messageOptions (OPTIONAL)
979
     * @return Result
980
     * @throws Client\InvalidMessageException
981
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
982
     * @throws Exception
983
     */
984 4
    public function ticketCreateTSMFromPricing(
985
        RequestOptions\TicketCreateTsmFromPricingOptions $options,
986
        $messageOptions = []
987
    ) {
988 4
        $msgName = 'Ticket_CreateTSMFromPricing';
989
990 4
        return $this->callMessage($msgName, $options, $messageOptions);
991
    }
992
993
    /**
994
     * Ticket_CreateTSMFareElement
995
     *
996
     * @param RequestOptions\TicketCreateTsmFareElOptions $options
997
     * @param array $messageOptions (OPTIONAL)
998
     * @return Result
999
     * @throws Client\InvalidMessageException
1000
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1001
     * @throws Exception
1002
     */
1003 4
    public function ticketCreateTSMFareElement(
1004
        RequestOptions\TicketCreateTsmFareElOptions $options,
1005
        $messageOptions = []
1006
    ) {
1007 4
        $msgName = 'Ticket_CreateTSMFareElement';
1008
1009 4
        return $this->callMessage($msgName, $options, $messageOptions);
1010
    }
1011
1012
    /**
1013
     * Ticket_CreateTASF
1014
     *
1015
     * @param RequestOptions\TicketCreateTasfOptions $options
1016
     * @param array $messageOptions (OPTIONAL)
1017
     * @return Result
1018
     * @throws Client\InvalidMessageException
1019
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1020
     * @throws Exception
1021
     */
1022 4
    public function ticketCreateTASF(
1023
        RequestOptions\TicketCreateTasfOptions $options,
1024
        $messageOptions = []
1025
    ) {
1026 4
        $msgName = 'Ticket_CreateTASF';
1027
1028 4
        return $this->callMessage($msgName, $options, $messageOptions);
1029
    }
1030
1031
    /**
1032
     * Ticket_DeleteTST
1033
     *
1034
     * @param RequestOptions\TicketDeleteTstOptions $options
1035
     * @param array $messageOptions (OPTIONAL)
1036
     * @return Result
1037
     * @throws Client\InvalidMessageException
1038
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1039
     * @throws Exception
1040
     */
1041 4
    public function ticketDeleteTST(RequestOptions\TicketDeleteTstOptions $options, $messageOptions = [])
1042
    {
1043 4
        $msgName = 'Ticket_DeleteTST';
1044
1045 4
        return $this->callMessage($msgName, $options, $messageOptions);
1046
    }
1047
1048
    /**
1049
     * Ticket_DeleteTSMP
1050
     *
1051
     * @param RequestOptions\TicketDeleteTsmpOptions $options
1052
     * @param array $messageOptions (OPTIONAL)
1053
     * @return Result
1054
     * @throws Client\InvalidMessageException
1055
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1056
     * @throws Exception
1057
     */
1058 4
    public function ticketDeleteTSMP(RequestOptions\TicketDeleteTsmpOptions $options, $messageOptions = [])
1059
    {
1060 4
        $msgName = 'Ticket_DeleteTSMP';
1061
1062 4
        return $this->callMessage($msgName, $options, $messageOptions);
1063
    }
1064
1065
    /**
1066
     * Ticket_DisplayTST
1067
     *
1068
     * @param RequestOptions\TicketDisplayTstOptions $options
1069
     * @param array $messageOptions (OPTIONAL)
1070
     * @return Result
1071
     * @throws Client\InvalidMessageException
1072
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1073
     * @throws Exception
1074
     */
1075 4
    public function ticketDisplayTST(RequestOptions\TicketDisplayTstOptions $options, $messageOptions = [])
1076
    {
1077 4
        $msgName = 'Ticket_DisplayTST';
1078
1079 4
        return $this->callMessage($msgName, $options, $messageOptions);
1080
    }
1081
1082
    /**
1083
     * Ticket_DisplayTSMP
1084
     *
1085
     * @param RequestOptions\TicketDisplayTsmpOptions $options
1086
     * @param array $messageOptions (OPTIONAL)
1087
     * @return Result
1088
     * @throws Client\InvalidMessageException
1089
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1090
     * @throws Exception
1091
     */
1092 4
    public function ticketDisplayTSMP(RequestOptions\TicketDisplayTsmpOptions $options, $messageOptions = [])
1093
    {
1094 4
        $msgName = 'Ticket_DisplayTSMP';
1095
1096 4
        return $this->callMessage($msgName, $options, $messageOptions);
1097
    }
1098
1099
    /**
1100
     * Ticket_RetrieveListOfTSM
1101
     *
1102
     * @param RequestOptions\TicketRetrieveListOfTSMOptions $options
1103
     * @param array $messageOptions (OPTIONAL)
1104
     * @return Result
1105
     * @throws Client\InvalidMessageException
1106
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1107
     * @throws Exception
1108
     */
1109 4
    public function ticketRetrieveListOfTSM(
1110
        RequestOptions\TicketRetrieveListOfTSMOptions $options,
1111
        $messageOptions = []
1112
    ) {
1113 4
        $msgName = 'Ticket_RetrieveListOfTSM';
1114
1115 4
        return $this->callMessage($msgName, $options, $messageOptions);
1116
    }
1117
1118
    /**
1119
     * Ticket_DisplayTSMFareElement
1120
     *
1121
     * @param RequestOptions\TicketDisplayTsmFareElOptions $options
1122
     * @param array $messageOptions (OPTIONAL)
1123
     * @return Result
1124
     * @throws Client\InvalidMessageException
1125
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1126
     * @throws Exception
1127
     */
1128 4
    public function ticketDisplayTSMFareElement(
1129
        RequestOptions\TicketDisplayTsmFareElOptions $options,
1130
        $messageOptions = []
1131
    ) {
1132 4
        $msgName = 'Ticket_DisplayTSMFareElement';
1133
1134 4
        return $this->callMessage($msgName, $options, $messageOptions);
1135
    }
1136
1137
    /**
1138
     * Ticket_CheckEligibility
1139
     *
1140
     * @param RequestOptions\TicketCheckEligibilityOptions $options
1141
     * @param array $messageOptions (OPTIONAL)
1142
     * @return Result
1143
     * @throws Client\InvalidMessageException
1144
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1145
     * @throws Exception
1146
     */
1147 4
    public function ticketCheckEligibility(
1148
        RequestOptions\TicketCheckEligibilityOptions $options,
1149
        $messageOptions = []
1150
    ) {
1151 4
        $msgName = 'Ticket_CheckEligibility';
1152
1153 4
        return $this->callMessage($msgName, $options, $messageOptions);
1154
    }
1155
1156
    /**
1157
     * Ticket_ATCShopperMasterPricerTravelBoardSearch
1158
     *
1159
     * @param RequestOptions\TicketAtcShopperMpTbSearchOptions $options
1160
     * @param array $messageOptions (OPTIONAL)
1161
     * @return Result
1162
     * @throws Client\InvalidMessageException
1163
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1164
     * @throws Exception
1165
     */
1166 4
    public function ticketAtcShopperMasterPricerTravelBoardSearch(
1167
        RequestOptions\TicketAtcShopperMpTbSearchOptions $options,
1168
        $messageOptions = []
1169
    ) {
1170 4
        $msgName = 'Ticket_ATCShopperMasterPricerTravelBoardSearch';
1171
1172 4
        return $this->callMessage($msgName, $options, $messageOptions);
1173
    }
1174
1175
    /**
1176
     * Ticket_RepricePNRWithBookingClass
1177
     *
1178
     * @param RequestOptions\TicketRepricePnrWithBookingClassOptions $options
1179
     * @param array $messageOptions (OPTIONAL)
1180
     * @return Result
1181
     * @throws Client\InvalidMessageException
1182
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1183
     * @throws Exception
1184
     */
1185 4
    public function ticketRepricePnrWithBookingClass(
1186
        RequestOptions\TicketRepricePnrWithBookingClassOptions $options,
1187
        $messageOptions = []
1188
    ) {
1189 4
        $msgName = 'Ticket_RepricePNRWithBookingClass';
1190
1191 4
        return $this->callMessage($msgName, $options, $messageOptions);
1192
    }
1193
1194
    /**
1195
     * Ticket_CancelDocument
1196
     *
1197
     * @param RequestOptions\TicketCancelDocumentOptions $options
1198
     * @param array $messageOptions (OPTIONAL)
1199
     * @return Result
1200
     * @throws Client\InvalidMessageException
1201
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1202
     * @throws Exception
1203
     */
1204 4
    public function ticketCancelDocument(
1205
        RequestOptions\TicketCancelDocumentOptions $options,
1206
        $messageOptions = []
1207
    ) {
1208 4
        $msgName = 'Ticket_CancelDocument';
1209
1210 4
        return $this->callMessage($msgName, $options, $messageOptions);
1211
    }
1212
1213
    /**
1214
     * Ticket_ReissueConfirmedPricing
1215
     *
1216
     * @param RequestOptions\TicketReissueConfirmedPricingOptions $options
1217
     * @param array $messageOptions (OPTIONAL)
1218
     * @return Result
1219
     * @throws Client\InvalidMessageException
1220
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1221
     * @throws Exception
1222
     */
1223 4
    public function ticketReissueConfirmedPricing(
1224
        RequestOptions\TicketReissueConfirmedPricingOptions $options,
1225
        $messageOptions = []
1226
    ) {
1227 4
        $msgName = 'Ticket_ReissueConfirmedPricing';
1228
1229 4
        return $this->callMessage($msgName, $options, $messageOptions);
1230
    }
1231
1232
    /**
1233
     * Ticket_ProcessEDoc
1234
     *
1235
     * @param RequestOptions\TicketProcessEDocOptions $options
1236
     * @param array $messageOptions (OPTIONAL)
1237
     * @return Result
1238
     * @throws Client\InvalidMessageException
1239
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1240
     * @throws Exception
1241
     */
1242 4
    public function ticketProcessEDoc(RequestOptions\TicketProcessEDocOptions $options, $messageOptions = [])
1243
    {
1244 4
        $msgName = 'Ticket_ProcessEDoc';
1245
1246 4
        return $this->callMessage($msgName, $options, $messageOptions);
1247
    }
1248
1249
    /**
1250
     * Ticket_ProcessETicket
1251
     *
1252
     * @param RequestOptions\TicketProcessETicketOptions $options
1253
     * @param array $messageOptions (OPTIONAL)
1254
     * @return Result
1255
     * @throws Client\InvalidMessageException
1256
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1257
     * @throws Exception
1258
     */
1259 4
    public function ticketProcessETicket(RequestOptions\TicketProcessETicketOptions $options, $messageOptions = [])
1260
    {
1261 4
        $msgName = 'Ticket_ProcessETicket';
1262
1263 4
        return $this->callMessage($msgName, $options, $messageOptions);
1264
    }
1265
1266
    /**
1267
     * DocIssuance_IssueTicket
1268
     *
1269
     * @param RequestOptions\DocIssuanceIssueTicketOptions $options
1270
     * @param array $messageOptions (OPTIONAL)
1271
     * @return Result
1272
     * @throws Client\InvalidMessageException
1273
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1274
     * @throws Exception
1275
     */
1276 4
    public function docIssuanceIssueTicket(
1277
        RequestOptions\DocIssuanceIssueTicketOptions $options,
1278
        $messageOptions = []
1279
    ) {
1280 4
        $msgName = 'DocIssuance_IssueTicket';
1281
1282 4
        return $this->callMessage($msgName, $options, $messageOptions);
1283
    }
1284
1285
    /**
1286
     * DocIssuance_IssueMiscellaneousDocuments
1287
     *
1288
     * @param RequestOptions\DocIssuanceIssueMiscDocOptions $options
1289
     * @param array $messageOptions (OPTIONAL)
1290
     * @return Result
1291
     * @throws Client\InvalidMessageException
1292
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1293
     * @throws Exception
1294
     */
1295 4
    public function docIssuanceIssueMiscellaneousDocuments(
1296
        RequestOptions\DocIssuanceIssueMiscDocOptions $options,
1297
        $messageOptions = []
1298
    ) {
1299 4
        $msgName = 'DocIssuance_IssueMiscellaneousDocuments';
1300
1301 4
        return $this->callMessage($msgName, $options, $messageOptions);
1302
    }
1303
1304
    /**
1305
     * DocIssuance_IssueCombined
1306
     *
1307
     * @param RequestOptions\DocIssuanceIssueCombinedOptions $options
1308
     * @param array $messageOptions (OPTIONAL)
1309
     * @return Result
1310
     * @throws Client\InvalidMessageException
1311
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1312
     * @throws Exception
1313
     */
1314 8
    public function docIssuanceIssueCombined(
1315
        RequestOptions\DocIssuanceIssueCombinedOptions $options,
1316
        $messageOptions = []
1317
    ) {
1318 8
        $msgName = 'DocIssuance_IssueCombined';
1319
1320 8
        return $this->callMessage($msgName, $options, $messageOptions);
1321
    }
1322
1323
    /**
1324
     * DocRefund_InitRefund
1325
     *
1326
     * @param RequestOptions\DocRefundInitRefundOptions $options
1327
     * @param array $messageOptions (OPTIONAL)
1328
     * @return Result
1329
     * @throws Client\InvalidMessageException
1330
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1331
     * @throws Exception
1332
     */
1333 4
    public function docRefundInitRefund(
1334
        RequestOptions\DocRefundInitRefundOptions $options,
1335
        $messageOptions = []
1336
    ) {
1337 4
        $msgName = 'DocRefund_InitRefund';
1338
1339 4
        return $this->callMessage($msgName, $options, $messageOptions);
1340
    }
1341
1342
    /**
1343
     * DocRefund_IgnoreRefund
1344
     *
1345
     * @param RequestOptions\DocRefundIgnoreRefundOptions $options
1346
     * @param array $messageOptions (OPTIONAL)
1347
     * @return Result
1348
     * @throws Client\InvalidMessageException
1349
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1350
     * @throws Exception
1351
     */
1352 4
    public function docRefundIgnoreRefund(
1353
        RequestOptions\DocRefundIgnoreRefundOptions $options,
1354
        $messageOptions = []
1355
    ) {
1356 4
        $msgName = 'DocRefund_IgnoreRefund';
1357
1358 4
        return $this->callMessage($msgName, $options, $messageOptions);
1359
    }
1360
1361
    /**
1362
     * DocRefund_UpdateRefund
1363
     *
1364
     * @param RequestOptions\DocRefundUpdateRefundOptions $options
1365
     * @param array $messageOptions (OPTIONAL)
1366
     * @return Result
1367
     * @throws Client\InvalidMessageException
1368
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1369
     * @throws Exception
1370
     */
1371 4
    public function docRefundUpdateRefund(
1372
        RequestOptions\DocRefundUpdateRefundOptions $options,
1373
        $messageOptions = []
1374
    ) {
1375 4
        $msgName = 'DocRefund_UpdateRefund';
1376
1377 4
        return $this->callMessage($msgName, $options, $messageOptions);
1378
    }
1379
1380
    /**
1381
     * DocRefund_ProcessRefund
1382
     *
1383
     * @param RequestOptions\DocRefundProcessRefundOptions $options
1384
     * @param array $messageOptions (OPTIONAL)
1385
     * @return Result
1386
     * @throws Client\InvalidMessageException
1387
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1388
     * @throws Exception
1389
     */
1390 4
    public function docRefundProcessRefund(
1391
        RequestOptions\DocRefundProcessRefundOptions $options,
1392
        $messageOptions = []
1393
    ) {
1394 4
        $msgName = 'DocRefund_ProcessRefund';
1395
1396 4
        return $this->callMessage($msgName, $options, $messageOptions);
1397
    }
1398
1399
    /**
1400
     * Ticket_InitRefund
1401
     *
1402
     * @param RequestOptions\TicketInitRefundOptions $options
1403
     * @param array $messageOptions (OPTIONAL)
1404
     * @return Result
1405
     * @throws Client\InvalidMessageException
1406
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1407
     * @throws Exception
1408
     */
1409 4
    public function ticketInitRefund(
1410
        RequestOptions\TicketInitRefundOptions $options,
1411
        $messageOptions = []
1412
    ) {
1413 4
        $msgName = 'Ticket_InitRefund';
1414
1415 4
        return $this->callMessage($msgName, $options, $messageOptions);
1416
    }
1417
1418
    /**
1419
     * Ticket_IgnoreRefund
1420
     *
1421
     * @param RequestOptions\TicketIgnoreRefundOptions $options
1422
     * @param array $messageOptions (OPTIONAL)
1423
     * @return Result
1424
     * @throws Client\InvalidMessageException
1425
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1426
     * @throws Exception
1427
     */
1428 4
    public function ticketIgnoreRefund(
1429
        RequestOptions\TicketIgnoreRefundOptions $options,
1430
        $messageOptions = []
1431
    ) {
1432 4
        $msgName = 'Ticket_IgnoreRefund';
1433
1434 4
        return $this->callMessage($msgName, $options, $messageOptions);
1435
    }
1436
1437
    /**
1438
     * Ticket_ProcessRefund
1439
     *
1440
     * @param RequestOptions\TicketProcessRefundOptions $options
1441
     * @param array $messageOptions (OPTIONAL)
1442
     * @return Result
1443
     * @throws Client\InvalidMessageException
1444
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1445
     * @throws Exception
1446
     */
1447 4
    public function ticketProcessRefund(
1448
        RequestOptions\TicketProcessRefundOptions $options,
1449
        $messageOptions = []
1450
    ) {
1451 4
        $msgName = 'Ticket_ProcessRefund';
1452
1453 4
        return $this->callMessage($msgName, $options, $messageOptions);
1454
    }
1455
1456
    /**
1457
     * FOP_CreateFormOfPayment
1458
     *
1459
     * @param RequestOptions\FopCreateFopOptions $options
1460
     * @param array $messageOptions (OPTIONAL)
1461
     * @return Result
1462
     * @throws Client\InvalidMessageException
1463
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1464
     * @throws Exception
1465
     */
1466 4
    public function fopCreateFormOfPayment(RequestOptions\FopCreateFopOptions $options, $messageOptions = [])
1467
    {
1468 4
        $msgName = 'FOP_CreateFormOfPayment';
1469
1470 4
        return $this->callMessage($msgName, $options, $messageOptions);
1471
    }
1472
1473
1474
    /**
1475
     * FOP_CreateFormOfPayment
1476
     *
1477
     * @param RequestOptions\FopValidateFopOptions $options
1478
     * @param array $messageOptions (OPTIONAL)
1479
     * @return Result
1480
     * @throws Client\InvalidMessageException
1481
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1482
     * @throws Exception
1483
     */
1484 4
    public function fopValidateFOP(RequestOptions\FopValidateFopOptions $options, $messageOptions = [])
1485
    {
1486 4
        $msgName = 'FOP_ValidateFOP';
1487
1488 4
        return $this->callMessage($msgName, $options, $messageOptions);
1489
    }
1490
1491
    /**
1492
     * PriceXplorer_ExtremeSearch
1493
     *
1494
     * @param RequestOptions\PriceXplorerExtremeSearchOptions $options
1495
     * @param array $messageOptions (OPTIONAL)
1496
     * @return Result
1497
     * @throws Client\InvalidMessageException
1498
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1499
     * @throws Exception
1500
     */
1501 4
    public function priceXplorerExtremeSearch(
1502
        RequestOptions\PriceXplorerExtremeSearchOptions $options,
1503
        $messageOptions = []
1504
    ) {
1505 4
        $msgName = 'PriceXplorer_ExtremeSearch';
1506
1507 4
        return $this->callMessage($msgName, $options, $messageOptions);
1508
    }
1509
1510
    /**
1511
     * SalesReports_DisplayQueryReport
1512
     *
1513
     * @param RequestOptions\SalesReportsDisplayQueryReportOptions $options
1514
     * @param array $messageOptions (OPTIONAL)
1515
     * @return Result
1516
     * @throws Client\InvalidMessageException
1517
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1518
     * @throws Exception
1519
     */
1520 4
    public function salesReportsDisplayQueryReport(
1521
        RequestOptions\SalesReportsDisplayQueryReportOptions $options,
1522
        $messageOptions = []
1523
    ) {
1524 4
        $msgName = 'SalesReports_DisplayQueryReport';
1525
1526 4
        return $this->callMessage($msgName, $options, $messageOptions);
1527
    }
1528
1529
    /**
1530
     * Service_IntegratedPricing
1531
     *
1532
     * @param RequestOptions\ServiceIntegratedPricingOptions $options
1533
     * @param array $messageOptions (OPTIONAL)
1534
     * @return Result
1535
     * @throws Client\InvalidMessageException
1536
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1537
     * @throws Exception
1538
     */
1539 4
    public function serviceIntegratedPricing(
1540
        RequestOptions\ServiceIntegratedPricingOptions $options,
1541
        $messageOptions = []
1542
    ) {
1543 4
        $msgName = 'Service_IntegratedPricing';
1544
1545 4
        return $this->callMessage($msgName, $options, $messageOptions);
1546
    }
1547
1548
    /**
1549
     * Service_IntegratedCatalogue
1550
     *
1551
     * @param RequestOptions\ServiceIntegratedCatalogueOptions $options
1552
     * @param array $messageOptions (OPTIONAL)
1553
     * @return Result
1554
     * @throws Client\InvalidMessageException
1555
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1556
     * @throws Exception
1557
     */
1558 4
    public function serviceIntegratedCatalogue(
1559
        RequestOptions\ServiceIntegratedCatalogueOptions $options,
1560
        $messageOptions = []
1561
    ) {
1562 4
        $msgName = 'Service_IntegratedCatalogue';
1563
1564 4
        return $this->callMessage($msgName, $options, $messageOptions);
1565
    }
1566
1567
    /**
1568
     * Call a message with the given parameters
1569
     *
1570
     * @param string $messageName
1571
     * @param RequestOptions\RequestOptionsInterface $options
1572
     * @param array $messageOptions
1573
     * @param bool $endSession
1574
     * @return Result
1575
     * @throws Client\Exception
1576
     * @throws Client\Struct\InvalidArgumentException
1577
     * @throws Client\InvalidMessageException
1578
     * @throws Client\RequestCreator\MessageVersionUnsupportedException
1579
     * @throws \RuntimeException
1580
     * @throws \InvalidArgumentException
1581
     */
1582 324
    protected function callMessage($messageName, $options, $messageOptions, $endSession = false)
1583
    {
1584 324
        $messageOptions = $this->makeMessageOptions($messageOptions, $endSession);
1585
1586 324
        $this->lastMessage = $messageName;
1587
1588 324
        $sendResult = $this->sessionHandler->sendMessage(
1589 324
            $messageName,
1590 324
            $this->requestCreator->createRequest(
1591 324
                $messageName,
1592 162
                $options
1593 162
            ),
1594 162
            $messageOptions
1595 162
        );
1596
1597 324
        $response = $this->responseHandler->analyzeResponse(
1598 324
            $sendResult,
1599 162
            $messageName
1600 162
        );
1601
1602 324
        if ($messageOptions['returnXml'] === false) {
1603 4
            $response->responseXml = null;
1604 2
        }
1605
1606 324
        return $response;
1607
    }
1608
1609
    /**
1610
     * Make message options
1611
     *
1612
     * Message options are meta options when sending a message to the amadeus web services
1613
     * - 'endSession' (if stateful) : should we end the current session after sending this call?
1614
     * - 'returnXml' : Should we return the XML string in the Result::responseXml property?
1615
     *   (this overrides the default setting returnXml in the Amadeus\Client\Params for a single message)
1616
     *
1617
     * @param array $incoming The Message options chosen by the caller - if any.
1618
     * @param bool $endSession Switch if you want to terminate the current session after making the call.
1619
     * @return array
1620
     */
1621 348
    protected function makeMessageOptions(array $incoming, $endSession = false)
1622
    {
1623
        $options = [
1624 348
            'endSession' => $endSession,
1625 348
            'returnXml' => $this->returnResultXml
1626 174
        ];
1627
1628 348
        if (array_key_exists('endSession', $incoming)) {
1629 4
            $options['endSession'] = $incoming['endSession'];
1630 2
        }
1631
1632 348
        if (array_key_exists('returnXml', $incoming)) {
1633 12
            $options['returnXml'] = $incoming['returnXml'];
1634 6
        }
1635
1636 348
        return $options;
1637
    }
1638
}
1639