Skip to content

Commit

Permalink
Merge 21f700b into 95f9a6a
Browse files Browse the repository at this point in the history
  • Loading branch information
gregsparrow committed Sep 24, 2020
2 parents 95f9a6a + 21f700b commit 83bf4b3
Show file tree
Hide file tree
Showing 20 changed files with 938 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Unreleased
* Implemented `MiniRule_GetFromRec` (Amadeus docs emphasize to use `MiniRule_GetFromRec` instead of `MiniRule_GetFromETicket`, `MiniRule_GetFromPricing`, `MiniRule_GetFromPricingRec`) - Aleksandr Kalugin

## Release 1.11.0 (9 July 2020)
https://github.com/amabnl/amadeus-ws-client/pull/344:
* Added support to add accountNumber in ``Queue_List``
Expand Down
1 change: 1 addition & 0 deletions docs/list-of-supported-messages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ This is the list of messages that are at least partially supported at this time:
- Offer_ConfirmAirOffer
- Offer_ConfirmHotelOffer
- Offer_ConfirmCarOffer
- MiniRule_GetFromRec
- MiniRule_GetFromPricingRec
- MiniRule_GetFromPricing
- MiniRule_GetFromETicket
Expand Down
59 changes: 59 additions & 0 deletions docs/samples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3812,10 +3812,63 @@ Confirm a given CAR offer:
********
MiniRule
********
--------------------------
MiniRule_GetFromRec
--------------------------
Mini Rules provides a short and easy to read summary of the most important rules and restrictions in a structured output so that they can be clearly understood by end-users and customers. This service is used to retrieve the Mini Rules data from: - PNR Record Locator - Offer Notice - Offer ID - TST (Transitional Stored Ticket) - PQR (Quotation Record for Amadeus Offer). - Pricing context - Upsell Context - TKT (eTicket) - Cart (Shopping cart)

MiniRules_GetFromRec function provides possibility to retrieve those mini-rules

- from an e-ticket
- from a PNR (with possible passengers and segments selection )
- from a list of TST returned by pricing/re-pricing
- from all TSTs returned by pricing/re-pricing
- from a list of PQRs
- from all PQR
- from all PQR associated to a list of air Offer
- from all PQR associated to all air Offer
- from a list of fare recommendation returned by pricing/re-pricing
- from all fare recommendations returned by pricing/re-pricing
- from a list of upsell returned by upsell transaction
- from all upsell returned by upsell transaction


Get MiniRules for specific PNR, and specific passenger

.. code-block:: php
use Amadeus\Client\RequestOptions\MiniRuleGetFromRecOptions;
use Amadeus\Client\RequestOptions\MiniRule\Pricing;
$miniRulesResponse = $client->miniRuleGetFromRec(
new MiniRuleGetFromRecOptions([
// mandatory
'pricing' => new Pricing([
'id' => "RECLOCNUM123",
'type' => Pricing::TYPE_RECORD_LOCATOR
]),
// optional
'language' => new Language([
'qualifier' => Language::LQ_LANGUAGE_NORMALLY_USED,
'code' => "UA"
]),
'filteringOptions' => [
new FilteringOption([
'type' => FilteringOption::TYPE_PAX,
'value' => 1
])
]
])
);
--------------------------
MiniRule_GetFromPricingRec
--------------------------

*This web service will not profit of latest Mini Rules enhancements.
Please use MiniRule_GetFromRec (TMRXRQ) instead.*

Get MiniRules for a pricing in context (either a TST pricing, Offers or a pricing quotation):

.. code-block:: php
Expand All @@ -3838,6 +3891,9 @@ Get MiniRules for a pricing in context (either a TST pricing, Offers or a pricin
MiniRule_GetFromPricing
-----------------------

*This web service will not profit of latest Mini Rules enhancements.
Please use MiniRule_GetFromRec (TMRXRQ) instead.*

Get MiniRules for a pricing in context *(After a Fare_PricePNRWithBookingClass, Fare_PricePNRWithLowerFares, FarePricePNRWithLowestFare, Fare_InformativePricingWithoutPNR or Fare_InformativeBestPricingWithoutPNR message)*:

Get Minirules for all pricings returned:
Expand Down Expand Up @@ -3867,6 +3923,9 @@ Get Minirules for specific recommendations *(recommendations nr 1 & 2 in this ex
MiniRule_GetFromETicket
-----------------------

*This web service will not profit of latest Mini Rules enhancements.
Please use MiniRule_GetFromRec (TMRXRQ) instead.*

Display Mini Rules corresponding to the e-ticket number 1234567891987:

.. code-block:: php
Expand Down
17 changes: 17 additions & 0 deletions src/Amadeus/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,23 @@ public function commandCryptic(RequestOptions\CommandCrypticOptions $options, $m
return $this->callMessage($msgName, $options, $messageOptions);
}

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

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

/**
* MiniRule_GetFromPricingRec
*
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\MiniRule;

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

/**
* MiniRule_GetFromRec
*
* @package Amadeus\Client\RequestCreator\Converter\MiniRule
* @author Aleksandr Kalugin <xkalugin@gmail.com>
*/
class GetFromRecConv extends BaseConverter
{
/**
* @param MiniRuleGetFromRecOptions $requestOptions
* @param int|string $version
* @return Struct\MiniRule\GetFromRec
*/
public function convert($requestOptions, $version)
{
return new Struct\MiniRule\GetFromRec($requestOptions);
}
}
55 changes: 55 additions & 0 deletions src/Amadeus/Client/RequestOptions/MiniRule/FilteringOption.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?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\MiniRule;

use Amadeus\Client\LoadParamsFromArray;

/**
* MiniRule FilteringSelection
*
* @package Amadeus\Client\RequestOptions\MiniRule
* @author Aleksandr Kalugin <xkalugin@gmail.com>
*/
class FilteringOption extends LoadParamsFromArray
{
const TYPE_PAX = 'P';

const TYPE_ADULT_PASSENGER = "PA";

const TYPE_INFANT_PASSENGER = "PI";

const TYPE_SEGMENT = 'S';

/**
* self::TYPE_*
*
* @var string
*/
public $type;

/**
* @var string|int
*/
public $value;
}
55 changes: 55 additions & 0 deletions src/Amadeus/Client/RequestOptions/MiniRule/Language.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?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\MiniRule;

use Amadeus\Client\LoadParamsFromArray;

/**
* MiniRule Language
* @package Amadeus\Client\RequestOptions\MiniRule
* @author Aleksandr Kalugin <xkalugin@gmail.com>
*/
class Language extends LoadParamsFromArray
{
const LQ_LANGUAGE_NORMALLY_USED = 1;
const LQ_LANGUAGE_UNDERSTOOD = 2;
const LQ_SPOKEN_LANGUAGE = 3;
const LQ_WRITTEN_LANGUAGE = 4;
const LQ_READ_LANGUAGE = 5;
const LQ_FOR_ALL_TYPES_OF_COMMUNICATION = 6;
const LQ_NATIVE_LANGUAGE = 7;

/**
* self::LQ_*
*
* @var int
*/
public $qualifier = self::LQ_LANGUAGE_NORMALLY_USED;

/**
* a two letters code (for example EN)
*
* @var string
*/
public $code = "EN";
}
31 changes: 27 additions & 4 deletions src/Amadeus/Client/RequestOptions/MiniRule/Pricing.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,35 +47,58 @@ class Pricing extends LoadParamsFromArray
/**
* Transitional Stored Ticket
*
* Only to be used with MiniRule_GetFromPricingRec
* Only to be used with MiniRule_GetFromPricingRec, MiniRule_GetFromRec
*/
const TYPE_TST = "TST";

/**
* Ticket Number
*
* Only to be used with MiniRule_GetFromRec
*/
const TYPE_TKT = "TKT";

/**
* Record Locator
*
* Only to be used with MiniRule_GetFromRec
*/
const TYPE_RECORD_LOCATOR = "PNR";

/**
* Product Quotation Record Reference
*
* Only to be used with MiniRule_GetFromPricingRec
* Only to be used with MiniRule_GetFromPricingRec, MiniRule_GetFromRec
*/
const TYPE_PROD_QUOTATION = "PQR";

/**
* Fare Recommendation Number
*
* Only to be used with MiniRule_GetFromPricing
* Only to be used with MiniRule_GetFromPricing, MiniRule_GetFromRec
*/
const TYPE_FARE_RECOMMENDATION_NUMBER = "FRN";

/**
* Fare Upsell reco. Number
*
* Only to be used with MiniRule_GetFromRec
*/
const TYPE_FARE_UPSELL_RECOMMENDATION_NUMBER = "FUN";

/**
* self::ALL_PRICINGS to indicate ALL or a number indicating a specific pricing
*
* Contains TST tatoo, ticket number, PNR recloc, fare recommendation, PQR Offer Id, fare upsell recommendation or the keyword 'ALL', when used with MiniRule_GetFromRec
*
* @var int|string
*/
public $id;

/**
* self::TYPE_*
*
* Only necessary for MiniRule_GetFromPricingRec:
* Only necessary for MiniRule_GetFromPricingRec, MiniRule_GetFromRec:
* For MiniRule_GetFromPricing, "FRN" is assumed.
*
* @var string
Expand Down
48 changes: 48 additions & 0 deletions src/Amadeus/Client/RequestOptions/MiniRuleGetFromRecOptions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?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\MiniRule\Language;

/**
* MiniRule_GetFromRec Request Options
*
* @package Amadeus\Client\RequestOptions
* @author Aleksandr Kalugin <xkalugin@gmail.com>
*/
class MiniRuleGetFromRecOptions extends Base
{
/**
* @var null|Language
*/
public $language = null;
/**
* @var MiniRule\Pricing
*/
public $pricing = null;

/**
* @var MiniRule\FilteringOption[]
*/
public $filteringOptions = [];
}

0 comments on commit 83bf4b3

Please sign in to comment.