-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Service_BookPriceProduct #457
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8b430d4
Add Service_BookPriceProduct message
tsari-invia 6d6ffee
Add Service_BookPriceProduct message
tsari-invia dd4a0f5
Add Service_BookPriceProduct message - fix style
tsari-invia 57a7659
Add Service_BookPriceProduct message - add example
tsari-invia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
image_name = amadeus-ws-client:build | ||
composer_version = 2.5.1 | ||
|
||
SHELL = /bin/sh | ||
|
||
build-docker-image: | ||
docker build -t $(image_name) -f docker/Dockerfile . | ||
|
||
build-docker-image-once: | ||
make verify-docker-image-exists || make build-docker-image | ||
|
||
build-docker-image-no-cache: | ||
docker build --no-cache -t $(image_name) -f docker/Dockerfile . | ||
|
||
composer-download: | ||
test -f composer.phar || wget -O composer.phar https://getcomposer.org/download/$(composer_version)/composer.phar | ||
|
||
composer-install: | ||
make composer-download | ||
test -d ./vendor || docker run --rm -ti -v ~/.composer:/.composer -v $(shell pwd):/var/www -w /var/www -u $(shell id -u) $(image_name) php composer.phar install | ||
|
||
composer-update: | ||
make composer-download | ||
docker run --rm -ti -v ~/.composer:/.composer -v $(shell pwd):/var/www -w /var/www -u $(shell id -u) $(image_name) php composer.phar update | ||
|
||
phpunit: | ||
docker run --rm -ti -v $(shell pwd):/var/www -w /var/www -u $(shell id -u) $(image_name) vendor/bin/phpunit tests/ | ||
|
||
test: | ||
make build-docker-image-once | ||
make composer-install | ||
make phpunit | ||
|
||
verify-docker-image-exists: | ||
docker image inspect $(image_name) >/dev/null 2>&1 |
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,8 @@ | ||
xdebug.mode=debug,coverage | ||
xdebug.client_port=9000 | ||
xdebug.idekey=xdebug | ||
xdebug.discover_client_host=1 | ||
; we would receive errors from xdebug if we use the cli | ||
; if you need xdebug logs, change this to https://xdebug.org/docs/all_settings#log_level | ||
; @see https://stackoverflow.com/questions/65213171/disable-xdebug-3-could-not-connect-message-in-cli | ||
xdebug.log_level=0 |
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,19 @@ | ||
FROM php:7.4-fpm-alpine3.16 | ||
|
||
RUN apk upgrade --no-cache --ignore alpine-baselayout \ | ||
&& apk --no-cache add git libzip-dev libxml2-dev libxslt-dev | ||
|
||
RUN set -xe \ | ||
&& apk add --no-cache --virtual .build-deps \ | ||
$PHPIZE_DEPS \ | ||
coreutils \ | ||
&& docker-php-ext-install -j"$(/usr/bin/nproc)" zip soap xsl \ | ||
&& pecl install xdebug-3.1.6 \ | ||
&& docker-php-ext-enable xdebug \ | ||
&& apk del .build-deps | ||
|
||
COPY ./docker/20-xdebug.ini /tmp/xdebug.ini | ||
RUN cat /tmp/xdebug.ini >> $PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini | ||
|
||
COPY . /var/www | ||
WORKDIR /var/www |
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
45 changes: 45 additions & 0 deletions
45
src/Amadeus/Client/RequestCreator/Converter/Service/BookPriceProductConv.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,45 @@ | ||
<?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\ServiceBookPriceProductOptions; | ||
use Amadeus\Client\Struct; | ||
|
||
/** | ||
* Service_BookPriceProduct Request converter | ||
* | ||
* @package Amadeus\Client\RequestCreator\Converter\Service | ||
*/ | ||
class BookPriceProductConv extends BaseConverter | ||
{ | ||
/** | ||
* @param ServiceBookPriceProductOptions $requestOptions | ||
* @param int|string $version | ||
* @return Struct\Service\BookPriceProduct | ||
*/ | ||
public function convert($requestOptions, $version) | ||
{ | ||
return new Struct\Service\BookPriceProduct($requestOptions); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Amadeus/Client/RequestOptions/Service/BookPriceProduct/Recommendation.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,18 @@ | ||
<?php | ||
|
||
namespace Amadeus\Client\RequestOptions\Service\BookPriceProduct; | ||
|
||
use Amadeus\Client\LoadParamsFromArray; | ||
|
||
class Recommendation extends LoadParamsFromArray | ||
{ | ||
/** | ||
* @var string|int | ||
*/ | ||
public $id; | ||
|
||
/** | ||
* @var string[]|int[] One or more travelers to whom this service applies | ||
*/ | ||
public $customerRefIds = []; | ||
} |
43 changes: 43 additions & 0 deletions
43
src/Amadeus/Client/RequestOptions/ServiceBookPriceProductOptions.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,43 @@ | ||
<?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\BookPriceProduct\Recommendation; | ||
|
||
/** | ||
* Service_BookPriceProduct Request Options | ||
* | ||
* @package Amadeus\Client\RequestOptions | ||
*/ | ||
class ServiceBookPriceProductOptions extends Base | ||
{ | ||
/** | ||
* @var string For all OpenTravel versioned messages, the version of the message is indicated by a decimal value. | ||
*/ | ||
public $version = '1.0'; | ||
|
||
/** | ||
* @var Recommendation[] | ||
*/ | ||
public $recommendations = []; | ||
} |
32 changes: 32 additions & 0 deletions
32
src/Amadeus/Client/ResponseHandler/Service/HandlerBookPriceProduct.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,32 @@ | ||
<?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\ResponseHandler\Service; | ||
|
||
/** | ||
* HandlerBookPriceService | ||
* | ||
* @package Amadeus\Client\ResponseHandler\Service | ||
*/ | ||
class HandlerBookPriceProduct extends HandlerBookPriceService | ||
{ | ||
} |
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,29 @@ | ||
<?php | ||
|
||
namespace Amadeus\Client\Struct\Service; | ||
|
||
use Amadeus\Client\RequestOptions\ServiceBookPriceProductOptions; | ||
use Amadeus\Client\Struct\BaseWsMessage; | ||
use Amadeus\Client\Struct\Service\BookPriceProduct\Recommendation; | ||
|
||
class BookPriceProduct extends BaseWsMessage | ||
{ | ||
/** | ||
* @var Recommendation[] | ||
*/ | ||
public $Recommendation; | ||
|
||
public $Version; | ||
|
||
/** | ||
* @param ServiceBookPriceProductOptions $options | ||
*/ | ||
public function __construct($options) | ||
{ | ||
$this->Version = $options->version; | ||
|
||
foreach ($options->recommendations as $recommendation) { | ||
$this->Recommendation[] = new Recommendation($recommendation); | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/Amadeus/Client/Struct/Service/BookPriceProduct/Recommendation.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,28 @@ | ||
<?php | ||
|
||
namespace Amadeus\Client\Struct\Service\BookPriceProduct; | ||
|
||
class Recommendation | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $RecoID; | ||
|
||
/** | ||
* @var string[] | ||
*/ | ||
public $CustomerRefIds; | ||
|
||
/** | ||
* @param \Amadeus\Client\RequestOptions\Service\BookPriceProduct\Recommendation $recommendationOptions | ||
*/ | ||
public function __construct($recommendationOptions) | ||
{ | ||
$this->RecoID = $recommendationOptions->id; | ||
|
||
if (!empty($recommendationOptions->customerRefIds)) { | ||
$this->CustomerRefIds = $recommendationOptions->customerRefIds; | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the reason for including this file and the Dockerfile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nevermind, i saw you updated the readme to make testing easier