Skip to content

Commit

Permalink
release 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xianqiliu committed Jun 29, 2022
1 parent 4a8fc9f commit 46ded53
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 1 deletion.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Changelog

0.1.0 - 2022-06-29
--------------------

The 0.1.0 version of the Amadeus for Developers PHP SDK:

Add support for the [Flight Offers Search API](https://developers.amadeus.com/self-service/category/air/api-doc/flight-offers-search/api-reference)

Add support for the [Flight Offers Price API](https://developers.amadeus.com/self-service/category/air/api-doc/flight-offers-price/api-reference)

Add support for the [Flight Create Orders API](https://developers.amadeus.com/self-service/category/air/api-doc/flight-create-orders/api-reference)

Add support for the [Airport & City Search API](https://developers.amadeus.com/self-service/category/air/api-doc/airport-and-city-search/api-reference)

Add support for the [Hotel Name Autocomplete API](https://developers.amadeus.com/self-service/category/hotel/api-doc/hotel-name-autocomplete/api-reference)

Add support for the [Hotel List API](https://developers.amadeus.com/self-service/category/hotel/api-doc/hotel-list/api-reference)

Add support for the [Hotel Search API](https://developers.amadeus.com/self-service/category/hotel/api-doc/hotel-search/api-reference)

Add support for the [Hotel Booking API](https://developers.amadeus.com/self-service/category/hotel/api-doc/hotel-booking/api-reference)

Add support for the [Flight Availabilities Search API](https://developers.amadeus.com/self-service/category/air/api-doc/flight-availabilities-search/api-reference)

Add support for the [Airport Routes API](https://developers.amadeus.com/self-service/category/air/api-doc/airport-routes/api-reference)

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Amadeus provides a rich set of APIs for the travel industry. For more details, c
This library requires PHP 7.4+. You can install the SDK via Composer

```
composer require amadeus4dev/amadeus-php:dev-master
composer require amadeus4dev/amadeus-php:0.1.0
```

## Getting Started
Expand Down
5 changes: 5 additions & 0 deletions src/Amadeus.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
*/
class Amadeus
{
/**
* The SDK version.
*/
public const VERSION = "0.1.0";

private Configuration $configuration;

private HTTPClient $client;
Expand Down
15 changes: 15 additions & 0 deletions src/client/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Amadeus\Client;

use Amadeus\Amadeus;
use Amadeus\Constants;

/**
Expand Down Expand Up @@ -48,6 +49,11 @@ class Request
*/
private ?string $bearerToken;

/**
* The version of the SDK used.
*/
private ?string $clientVersion;

/**
* The version of PHP used.
*/
Expand Down Expand Up @@ -103,6 +109,7 @@ public function __construct(
$this->params = $params;
$this->body = $body;
$this->bearerToken = $bearerToken;
$this->clientVersion = Amadeus::VERSION;
$this->languageVersion = phpversion();
$this->port = $config->getPort();
$this->ssl = $config->isSsl();
Expand Down Expand Up @@ -217,6 +224,14 @@ public function getBearerToken(): ?string
return $this->bearerToken;
}

/**
* @return string|null
*/
public function getClientVersion(): ?string
{
return $this->clientVersion;
}

/**
* @return string|null
*/
Expand Down
1 change: 1 addition & 0 deletions tests/client/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public function testInitializer(): void
$this->assertEquals($params, $request->getParams());
$this->assertNull($request->getBody());
$this->assertEquals("token", $request->getBearerToken());
$this->assertEquals(Amadeus::VERSION, $request->getClientVersion());
$this->assertEquals(phpversion(), $request->getLanguageVersion());
$this->assertEquals(443, $request->getPort());
$this->assertTrue($request->isSsl());
Expand Down

0 comments on commit 46ded53

Please sign in to comment.