Skip to content

Commit fe04b42

Browse files
authored
Merge pull request #19 from anthonyroux/api_updated_NOV2018
Redesign of the Flight Most Searched Destinations
2 parents 19bc30a + 5a1074d commit fe04b42

24 files changed

+452
-273
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ build
55
.settings
66
.classpath
77
.idea
8-
out
8+
out
9+
.DS_Store

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# Changelog
22

3+
## 2.0.0 - 2018-10-16
4+
5+
[Flight Most Searched Destinations](https://developers.amadeus.com/self-service/category/203/api-doc/6): Redesign of the API - Split the previous endpoint in 2 endpoints:
6+
* 1st endpoint to find the most searched destinations
7+
* 2nd endpoint to have more data about a dedicated origin & destination
8+
9+
[Flight Most Booked Destinations](https://developers.amadeus.com/self-service/category/203/api-doc/27):
10+
* Rename origin to originCityCode
11+
12+
[Flight Most Traveled Destinations](https://developers.amadeus.com/self-service/category/203/api-doc/7):
13+
* Rename origin in originCityCode
14+
15+
[Flight Check-in Links](https://developers.amadeus.com/self-service/category/203/api-doc/8):
16+
* Rename airline to airlineCode
17+
18+
[Airport & City Search](https://developers.amadeus.com/self-service/category/203/api-doc/10):
19+
* Remove parameter onlyMajor
20+
21+
[Airport Nearest Relevant](https://developers.amadeus.com/self-service/category/203/api-doc/9):
22+
* Add radius as parameter
23+
24+
[Airline Code Lookup](https://developers.amadeus.com/self-service/category/203/api-doc/26):
25+
* Regroup parameters _IATACode_ and _ICAOCode_ under the same name _airlineCodes_
26+
327
## 1.1.2 - 2018-10-28
428
Contribution by [nirmalvp](https://github.com/nirmalvp)
529

README.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ You can install the SDK via Maven or Gradle.
3434
<dependency>
3535
<groupId>com.amadeus</groupId>
3636
<artifactId>amadeus-java</artifactId>
37-
<version>1.1.2</version>
37+
<version>2.0.0</version>
3838
</dependency>
3939
```
4040
#### Gradle
4141
```js
42-
compile "com.amadeus:amadeus-java:1.1.2"
42+
compile "com.amadeus:amadeus-java:2.0.0"
4343
```
4444

4545
## Getting Started
@@ -126,7 +126,7 @@ This library conveniently maps every API path to a similar path.
126126
For example, `GET /v2/reference-data/urls/checkin-links?airline=BA` would be:
127127

128128
```java
129-
amadeus.referenceData.urls.checkinLinks.get(Params.with("airline", "BA"));
129+
amadeus.referenceData.urls.checkinLinks.get(Params.with("airlineCode", "BA"));
130130
```
131131

132132
Similarly, to select a resource by ID, you can pass in the ID to the **singular** path.
@@ -142,7 +142,7 @@ Keep in mind, this returns a raw `Resource`
142142

143143
```java
144144
Resource resource = amadeus.get('/v2/reference-data/urls/checkin-links',
145-
Params.with("airline", "BA"));
145+
Params.with("airlineCode", "BA"));
146146

147147
resource.getResult();
148148
```
@@ -181,7 +181,7 @@ If a page is not available, the method will return `null`.
181181

182182
The SDK makes it easy to add your own logger.
183183

184-
```java TO FIX
184+
```java
185185
import java.util.logging.Logger;
186186

187187
// Assumes the current class is called MyLogger
@@ -227,11 +227,11 @@ FlightOffer[] flightOffers = amadeus.shopping.flightOffers.get(Params
227227

228228
// Flight Check-in Links
229229
CheckinLink[] checkinLinks = amadeus.referenceData.urls.checkinLinks.get(Params
230-
.with("airline", "BA"));
230+
.with("airlineCode", "BA"));
231231

232232
// Airline Code LookUp
233233
Airline[] airlines = amadeus.referenceData.airlines.get(Params
234-
.with("IATACode", "BA"));
234+
.with("airlineCodes", "BA"));
235235

236236
// Airport & City Search (autocomplete)
237237
// Find all the cities and airports starting by the keyword 'LON'
@@ -248,19 +248,26 @@ Location[] locations = amadeus.referenceData.locations.airports.get(Params
248248
.and("longitude", 2.55));
249249

250250
// Flight Most Searched Destinations
251-
FareSearch[] fareSearches = amadeus.travel.analytics.fareSearches.get(Params
252-
.with("origin", "MAD")
253-
.and("sourceCountry", "SP")
254-
.and("period", "2017-08"));
251+
// Which were the most searched flight destinations from Madrid in August 2017?
252+
SearchedDestination searchedDestination = amadeus.travel.analytics.airTraffic.searchedByDestination.get(Params
253+
.with("originCityCode", "MAD")
254+
.and("destinationCityCode", "NYC")
255+
.and("searchPeriod", "2017-08")
256+
.and("marketCountryCode", "ES"));
257+
// How many people in Spain searched for a trip from Madrid to New-York in September 2017?
258+
Search[] search = amadeus.travel.analytics.airTraffic.searched.get(Params
259+
.with("originCityCode", "MAD")
260+
.and("searchPeriod", "2017-08")
261+
.and("marketCountryCode", "ES"));
255262

256263
// Flight Most Booked Destinations
257264
AirTraffic[] airTraffics = amadeus.travel.analytics.airTraffic.booked.get(Params
258-
.with("origin", "MAD")
265+
.with("originCityCode", "MAD")
259266
.and("period", "2017-08"));
260267

261268
// Flight Most Traveled Destinations
262269
AirTraffic[] airTraffics = amadeus.travel.analytics.airTraffic.traveled.get(Params
263-
.with("origin", "MAD")
270+
.with("originCityCode", "MAD")
264271
.and("period", "2017-01"));
265272

266273
// Flight Busiest Traveling Period

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
GROUP=com.amadeus
2-
VERSION_NAME=1.1.2
2+
VERSION_NAME=2.0.0
33

44
POM_URL=https://github.com/amadeus4dev/amadeus-java
55
POM_SCM_URL[email protected]:amadeus4dev/amadeus-java.git

src/main/java/com/amadeus/Amadeus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class Amadeus extends HTTPClient {
2525
/**
2626
* The API version.
2727
*/
28-
public static final String VERSION = "1.1.2";
28+
public static final String VERSION = "2.0.0";
2929

3030
/**
3131
* <p>

src/main/java/com/amadeus/referenceData/Airlines.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public Airlines(Amadeus client) {
4040
*
4141
* <pre>
4242
* amadeus.referenceData.airlines.get(Params
43-
* .with("IATACode", "BA"));</pre>
43+
* .with("airlineCodes", "BA"));</pre>
4444
*
4545
* @param params the parameters to send to the API
4646
* @return an API response object

src/main/java/com/amadeus/referenceData/Location.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import com.amadeus.exceptions.ResponseException;
77
import com.amadeus.referenceData.locations.Airports;
88
import com.amadeus.resources.Resource;
9-
import com.google.gson.Gson;
109

1110
/**
1211
* <p>
@@ -19,7 +18,7 @@
1918
* </p>
2019
*
2120
* <pre>
22-
* Amadeus amadeus = Amadeus.builder("clientId", "secret").build();
21+
* Amadeus amadeus = Amadeus.builder(API_KEY, API_SECRET).build();
2322
* amadeus.referenceData.location(locationId);</pre>
2423
*
2524
* @hide

src/main/java/com/amadeus/referenceData/urls/CheckinLinks.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* </p>
2020
*
2121
* <pre>
22-
* Amadeus amadeus = Amadeus.builder("clientId", "secret").build();
22+
* Amadeus amadeus = Amadeus.builder(API_KEY, API_SECRET).build();
2323
* amadeus.referenceData.urls.checkinLinks;</pre>
2424
*/
2525
public class CheckinLinks {
@@ -40,7 +40,7 @@ public CheckinLinks(Amadeus client) {
4040
* </p>
4141
*
4242
* <pre>
43-
* amadeus.referenceData.urls.checkinLinks.get(Params.with("airline", "1X"));</pre>
43+
* amadeus.referenceData.urls.checkinLinks.get(Params.with("airlineCode", "BA"));</pre>
4444
*
4545
* @param params the parameters to send to the API
4646
* @return an API resource

src/main/java/com/amadeus/resources/AirTraffic.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import lombok.Getter;
44
import lombok.ToString;
55

6+
7+
68
/**
79
* An AirTraffic object as returned by the AirTraffic API.
810
* @see Traveled#get()

src/main/java/com/amadeus/resources/FareSearch.java

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)