-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented Ticket_DeleteTSMP message
- Loading branch information
Showing
14 changed files
with
539 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/Amadeus/Client/RequestCreator/Converter/Ticket/DeleteTSMPConv.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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\Ticket; | ||
|
||
use Amadeus\Client\RequestCreator\Converter\BaseConverter; | ||
use Amadeus\Client\RequestOptions\TicketDeleteTsmpOptions; | ||
use Amadeus\Client\Struct; | ||
|
||
/** | ||
* Ticket_DeleteTSMP Request converter | ||
* | ||
* @package Amadeus\Client\RequestCreator\Converter\Ticket | ||
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com> | ||
*/ | ||
class DeleteTSMPConv extends BaseConverter | ||
{ | ||
/** | ||
* @param TicketDeleteTsmpOptions $requestOptions | ||
* @param int|string $version | ||
* @return Struct\Ticket\DeleteTSMP | ||
*/ | ||
public function convert($requestOptions, $version) | ||
{ | ||
return new Struct\Ticket\DeleteTSMP($requestOptions); | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
src/Amadeus/Client/RequestOptions/TicketDeleteTsmpOptions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
||
/** | ||
* TicketDeleteTsmpOptions | ||
* | ||
* @package Amadeus\Client\RequestOptions | ||
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com> | ||
*/ | ||
class TicketDeleteTsmpOptions extends Base | ||
{ | ||
/** | ||
* List of TSM-P tattoos to delete | ||
* | ||
* @var int[] | ||
*/ | ||
public $tsmTattoos = []; | ||
|
||
/** | ||
* List of passenger tattoos for who to delete all TSMP's | ||
* | ||
* @var int[] | ||
*/ | ||
public $paxTattoos = []; | ||
|
||
/** | ||
* List of infant tattoos for who to delete all TSMP's | ||
* | ||
* (The tattoos you need to provide here are the parent passenger tattoos) | ||
* | ||
* @var int[] | ||
*/ | ||
public $infantTattoos = []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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\Struct\Ticket; | ||
|
||
/** | ||
* CriteriaTattoo | ||
* | ||
* @package Amadeus\Client\Struct\Ticket | ||
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com> | ||
*/ | ||
class CriteriaTattoo | ||
{ | ||
/** | ||
* @var ReferenceDetails | ||
*/ | ||
public $referenceDetails; | ||
|
||
/** | ||
* CriteriaTattoo constructor. | ||
* | ||
* @param string $type ReferenceDetails::TYPE_* | ||
* @param string|int $value the tattoo | ||
*/ | ||
public function __construct($type, $value) | ||
{ | ||
$this->referenceDetails = new ReferenceDetails($type, $value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?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\Struct\Ticket; | ||
|
||
use Amadeus\Client\RequestOptions\TicketDeleteTsmpOptions; | ||
use Amadeus\Client\Struct\BaseWsMessage; | ||
|
||
/** | ||
* DeleteTSMP | ||
* | ||
* @package Amadeus\Client\Struct\Ticket | ||
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com> | ||
*/ | ||
class DeleteTSMP extends BaseWsMessage | ||
{ | ||
/** | ||
* @var CriteriaTattoo[] | ||
*/ | ||
public $criteriaTattoo = []; | ||
|
||
/** | ||
* DeleteTSMP constructor. | ||
* | ||
* @param TicketDeleteTsmpOptions $params | ||
*/ | ||
public function __construct(TicketDeleteTsmpOptions $params) | ||
{ | ||
foreach ($params->infantTattoos as $infantTattoo) { | ||
$this->addCriteriaTattoo($infantTattoo, ReferenceDetails::TYPE_INFANT_PARENT_TATTOO); | ||
} | ||
|
||
foreach ($params->paxTattoos as $paxTattoo) { | ||
$this->addCriteriaTattoo($paxTattoo, ReferenceDetails::TYPE_PASSENGER_TATTOO); | ||
} | ||
|
||
foreach ($params->tsmTattoos as $tsmTattoo) { | ||
$this->addCriteriaTattoo($tsmTattoo, ReferenceDetails::TYPE_TSM_TATTOO); | ||
} | ||
} | ||
|
||
/** | ||
* Add a tattoo ref to the message | ||
* | ||
* @param string|int $tattoo | ||
* @param string $type | ||
*/ | ||
protected function addCriteriaTattoo($tattoo, $type) | ||
{ | ||
$this->criteriaTattoo[] = new CriteriaTattoo($type, $tattoo); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?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\Struct\Ticket; | ||
|
||
/** | ||
* ReferenceDetails | ||
* | ||
* @package Amadeus\Client\Struct\Ticket | ||
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com> | ||
*/ | ||
class ReferenceDetails | ||
{ | ||
const TYPE_INFANT_PARENT_TATTOO = "INF"; | ||
const TYPE_PASSENGER_TATTOO = "PAX"; | ||
const TYPE_TSM_TATTOO = "TSM"; | ||
|
||
/** | ||
* self::TYPE_* | ||
* | ||
* @var string | ||
*/ | ||
public $type; | ||
|
||
/** | ||
* @var string|int | ||
*/ | ||
public $value; | ||
|
||
/** | ||
* ReferenceDetails constructor. | ||
* | ||
* @param string $type | ||
* @param int|string $value | ||
*/ | ||
public function __construct($type, $value) | ||
{ | ||
$this->type = $type; | ||
$this->value = $value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.