Skip to content

Commit

Permalink
Merge pull request #324 from whatsahoy/master
Browse files Browse the repository at this point in the history
Anchored Search + Service_BookPriceService
  • Loading branch information
bimusiek authored Feb 5, 2020
2 parents b072260 + 283bec5 commit 14ed4ff
Show file tree
Hide file tree
Showing 28 changed files with 1,147 additions and 13 deletions.
5 changes: 1 addition & 4 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ build:
tests:
override:
-
command: 'phpunit --coverage-clover=build/logs/clover.xml'
coverage:
file: 'build/logs/clover.xml'
format: 'clover'
command: 'phpunit'
nodes:
php54:
environment:
Expand Down
47 changes: 47 additions & 0 deletions docs/samples/masterpricertravelboard.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,53 @@ Brussels - London with preferred airlines BA or SN:
$message = new MasterPricerTravelBoardSearch($opt);
Anchored segments
==================

Brussels - London with anchored segment:

.. code-block:: php
use Amadeus\Client\RequestOptions\FareMasterPricerTbSearch;
use Amadeus\Client\RequestOptions\Fare\MPItinerary;
use Amadeus\Client\RequestOptions\Fare\MPLocation;
use Amadeus\Client\RequestOptions\Fare\MPPassenger;
use Amadeus\Client\RequestOptions\Fare\MPDate;
use Amadeus\Client\RequestOptions\Fare\MPAnchoredSegment;
$opt = new FareMasterPricerTbSearch([
'nrOfRequestedResults' => 30,
'nrOfRequestedPassengers' => 1,
'passengers' => [
new MPPassenger([
'type' => MPPassenger::TYPE_ADULT,
'count' => 1
])
],
'itinerary' => [
new MPItinerary([
'departureLocation' => new MPLocation(['city' => 'BRU']),
'arrivalLocation' => new MPLocation(['city' => 'LON']),
'date' => new MPDate([
'dateTime' => new \DateTime('2017-01-15T14:00:00+0000', new \DateTimeZone('UTC'))
])
])
],
'anchoredSegments' => [
new MPAnchoredSegment([
'departureDate' => \DateTime::createFromFormat('Ymd Hi','20180315 1540', new \DateTimeZone('UTC')),
'arrivalDate' => \DateTime::createFromFormat('Ymd Hi','20180316 0010', new \DateTimeZone('UTC')),
'dateVariation' => '',
'from' => 'BRU',
'to' => 'LHR',
'companyCode' => 'BA',
'flightNumber' => '20'
])
]
]);
$message = new MasterPricerTravelBoardSearch($opt);
Multi-city & airline exclusion
==============================
Expand Down
19 changes: 19 additions & 0 deletions src/Amadeus/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -1584,6 +1584,25 @@ public function serviceIntegratedCatalogue(
return $this->callMessage($msgName, $options, $messageOptions);
}

/**
* Service_BookPriceService
*
* @param RequestOptions\ServiceBookPriceServiceOptions $options
* @param array $messageOptions (OPTIONAL)
* @return Result
* @throws Client\InvalidMessageException
* @throws Client\RequestCreator\MessageVersionUnsupportedException
* @throws Exception
*/
public function serviceBookPriceService(
RequestOptions\ServiceBookPriceServiceOptions $options,
$messageOptions = []
) {
$msgName = 'Service_BookPriceService';

return $this->callMessage($msgName, $options, $messageOptions);
}

/**
* SalesReports_DisplayorSummarizedReport
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/**
* amadeus-ws-client
*
* Copyright 2015 Amadeus Benelux NV
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package Amadeus
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
*/

namespace Amadeus\Client\RequestCreator\Converter\Service;

use Amadeus\Client\RequestCreator\Converter\BaseConverter;
use Amadeus\Client\RequestOptions\ServiceBookPriceServiceOptions;
use Amadeus\Client\Struct;

/**
* Service_BookPriceService Request converter
*
* @package Amadeus\Client\RequestCreator\Converter\Service
* @author Mike Hernas <mike@ahoy.io>
*/
class BookPriceServiceConv extends BaseConverter
{
/**
* @param ServiceBookPriceServiceOptions $requestOptions
* @param int|string $version
* @return Struct\Service\BookPriceService
*/
public function convert($requestOptions, $version)
{
return new Struct\Service\BookPriceService($requestOptions);
}
}
35 changes: 35 additions & 0 deletions src/Amadeus/Client/RequestOptions/Fare/MPAnchoredSegment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/**
* amadeus-ws-client
*
* Copyright 2015 Amadeus Benelux NV
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package Amadeus
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
*/

namespace Amadeus\Client\RequestOptions\Fare;

use Amadeus\Client\RequestOptions\Air\SellFromRecommendation\Segment as SegmentOptions;

/**
* MPAnchoredSegment request options.
*
* @package Amadeus\Client\RequestOptions\Fare
* @author Mike Hernas <mike@ahoy.io>
*/
class MPAnchoredSegment extends SegmentOptions
{
}
9 changes: 9 additions & 0 deletions src/Amadeus/Client/RequestOptions/Fare/MPItinerary.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,13 @@ class MPItinerary extends LoadParamsFromArray
* @var string
*/
public $cabinOption;

public $travelDetails;

/**
* Anchored Search segment (MPAnchoredSegment)
*
* @var array[MPAnchoredSegment]
*/
public $anchoredSegments;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php
/**
* amadeus-ws-client
*
* Copyright 2015 Amadeus Benelux NV
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package Amadeus
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
*/

namespace Amadeus\Client\RequestOptions\Service\BookPriceService;

use Amadeus\Client\LoadParamsFromArray;

/**
* Identifier
*
* @package Amadeus\Client\RequestOptions\Service\BookPriceService
* @author Mike Hernas <mike@ahoy.io>
*/
class Identifier extends LoadParamsFromArray
{
const BOOKING_METHOD_SSR = "01";
const BOOKING_METHOD_SVC = "02";

/**
* self::BOOKING_METHOD_*
*
* 01 SSR type of booking method
* 02 SVC type of booking method
*
* @var string
*/
public $bookingMethod;

/**
*
* @var string
*/
public $RFIC;

/**
*
* @var string
*/
public $RFISC;

/**
*
* @var string
*/
public $code;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php
/**
* amadeus-ws-client
*
* Copyright 2015 Amadeus Benelux NV
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package Amadeus
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
*/

namespace Amadeus\Client\RequestOptions\Service\BookPriceService;

use Amadeus\Client\LoadParamsFromArray;

/**
* Service
*
* @package Amadeus\Client\RequestOptions\Service\BookPriceService
* @author Mike Hernas <mike@ahoy.io>
*/
class Service extends LoadParamsFromArray
{
/**
* Booking carrier of the service
*
* @var string
*/
public $serviceProvider;

/**
*
* @var Identifier
*/
public $identifier;

/**
* Request ID
* @var string
*/
public $TID;

/**
* Tatoo of the passenger to whom the service applies
* @var string|null
*/
public $passengerTattoo;

/**
* Tatoo of the passenger to whom the service applies
* @var string|null
*/
public $segmentTattoo;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* amadeus-ws-client
*
* Copyright 2015 Amadeus Benelux NV
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package Amadeus
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
*/

namespace Amadeus\Client\RequestOptions;

use Amadeus\Client\RequestOptions\Service\BookPriceService\Identifier;
use Amadeus\Client\RequestOptions\Service\BookPriceService\Service;

/**
* Service_BookPriceService Request Options
*
* @package Amadeus\Client\RequestOptions
* @author Mike Hernas <mike@ahoy.io>
*/
class ServiceBookPriceServiceOptions extends Base
{
/**
*
* @var Service[]
*/
public $services;
}
Loading

0 comments on commit 14ed4ff

Please sign in to comment.