@@ -59,7 +59,7 @@ import com.amadeus.resources.Location;
5959public class AmadeusExample {
6060 public static void main (String [] args ) throws ResponseException {
6161 Amadeus amadeus = Amadeus
62- .builder(" [client_id] " , " [client_secret] " )
62+ .builder(" REPLACE_BY_YOUR_API_KEY " , " REPLACE_BY_YOUR_API_SECRET " )
6363 .build();
6464
6565 Location [] locations = amadeus. referenceData. locations. get(Params
@@ -78,7 +78,7 @@ The client can be initialized directly.
7878``` java
7979// Initialize using parameters
8080Amadeus amadeus = Amadeus
81- .builder(" [client_id] " , " [client_secret] " )
81+ .builder(" REPLACE_BY_YOUR_API_KEY " , " REPLACE_BY_YOUR_API_SECRET " )
8282 .build();
8383```
8484
@@ -123,10 +123,10 @@ in-depth information about every SDK method, its arguments and return types.
123123
124124This library conveniently maps every API path to a similar path.
125125
126- For example, ` GET /v2/reference-data/urls/checkin-links?airline=1X ` would be:
126+ 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" , " 1X " ));
129+ amadeus. referenceData. urls. checkinLinks. get(Params . with(" airline" , " BA " ));
130130```
131131
132132Similarly, 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
144144Resource resource = amadeus. get(' /v2/reference-data/urls/checkin-links' ,
145- Params . with(" airline" , " 1X " ));
145+ Params . with(" airline" , " BA " ));
146146
147147resource. getResult();
148148```
@@ -181,13 +181,18 @@ If a page is not available, the method will return `null`.
181181
182182The SDK makes it easy to add your own logger.
183183
184- ``` java
185- require ' logger'
184+ ``` java TO FIX
185+ import java.util.logging.Logger ;
186+
187+ // Assumes the current class is called MyLogger
188+ private final static Logger LOGGER = Logger . getLogger(MyLogger . class. getName());
186189
187- amadeus = Amadeus :: Client . new (
188- client_id: '...',
189- client_secret: '...',
190- logger: Logger .new(STDOUT )
190+ ...
191+
192+ Amadeus amadeus = Amadeus
193+ .builder(" REPLACE_BY_YOUR_API_KEY" , " REPLACE_BY_YOUR_API_KEY" )
194+ .setLogger(LOGGER )
195+ .build();
191196)
192197```
193198
@@ -198,29 +203,27 @@ variable.
198203
199204``` java
200205Amadeus amadeus = Amadeus
201- .builder(" [client_id] " , " [client_secret] " )
206+ .builder(" REPLACE_BY_YOUR_API_KEY " , " REPLACE_BY_YOUR_API_SECRET " )
202207 .setLogLevel(" debug" ) // or warn
203208 .build();
204209```
205210
206211## List of supported endpoints
207-
208212``` java
209- // Flight Cheapest Date Search
210- FlightDate [] flightDates = amadeus. shopping. flightDates. get(Params
211- .with(" origin" , " LON" )
212- .and(" destination" , " FRA" )
213- .and(" duration" , 3 ));
214-
215213// Flight Inspiration Search
216214FlightDestination [] flightDestinations = amadeus. shopping. flightDestinations. get(Params
217- .with(" origin" , " LON" ));
215+ .with(" origin" , " MAD" ));
216+
217+ // Flight Cheapest Date Search
218+ FlightDate [] flightDates = amadeus. shopping. flightDates. get(Params
219+ .with(" origin" , " NYC" )
220+ .and(" destination" , " MAD" );
218221
219222// Flight Low-fare Search
220223FlightOffer [] flightOffers = amadeus. shopping. flightOffers. get(Params
221- .with(" origin" , " MAD " )
222- .and(" destination" , " OPO " )
223- .and(" departureDate" , " 2018-11 -01" ));
224+ .with(" origin" , " NYC " )
225+ .and(" destination" , " MAD " )
226+ .and(" departureDate" , " 2019-08 -01" ));
224227
225228// Flight Check-in Links
226229CheckinLink [] checkinLinks = amadeus. referenceData. urls. checkinLinks. get(Params
@@ -231,11 +234,10 @@ Airline[] airlines = amadeus.referenceData.airlines.get(Params
231234 .with(" IATACode" , " BA" ));
232235
233236// Airport & City Search (autocomplete)
234- // Find all the cities and airports starting by the keyword 'Lon '
237+ // Find all the cities and airports starting by the keyword 'LON '
235238Location [] locations = amadeus. referenceData. locations. get(Params
236- .with(" keyword" , " lon " )
239+ .with(" keyword" , " LON " )
237240 .and(" subType" , Locations . ANY ));
238-
239241// Get a specific city or airport based on its id
240242Location location = amadeus. referenceData
241243 .location(" ALHR" ). get();
@@ -247,36 +249,34 @@ Location[] locations = amadeus.referenceData.locations.airports.get(Params
247249
248250// Flight Most Searched Destinations
249251FareSearch [] fareSearches = amadeus. travel. analytics. fareSearches. get(Params
250- .with(" origin" , " SFO" )
251- .and(" sourceCountry" , " US" )
252- .and(" period" , " 2017-08" ));
253-
254- // Flight Most Traveled Destinations
255- AirTraffic [] airTraffics = amadeus. travel. analytics. airTraffic. traveled. get(Params
256- .with(" origin" , " NCE" )
252+ .with(" origin" , " MAD" )
253+ .and(" sourceCountry" , " SP" )
257254 .and(" period" , " 2017-08" ));
258255
259256// Flight Most Booked Destinations
260257AirTraffic [] airTraffics = amadeus. travel. analytics. airTraffic. booked. get(Params
261- .with(" origin" , " NCE " )
258+ .with(" origin" , " MAD " )
262259 .and(" period" , " 2017-08" ));
263260
261+ // Flight Most Traveled Destinations
262+ AirTraffic [] airTraffics = amadeus. travel. analytics. airTraffic. traveled. get(Params
263+ .with(" origin" , " MAD" )
264+ .and(" period" , " 2017-01" ));
265+
264266// Flight Busiest Traveling Period
265267Period [] busiestPeriods = amadeus. travel. analytics. airTraffic. busiestPeriod. get(Params
266268 .with(" cityCode" , " MAD" )
267269 .and(" period" , " 2017" )
268270 .and(" direction" , BusiestPeriod . ARRIVING ));
269271
270272// Hotel Search API
271- // Get list of hotels by cityCode
273+ // Get list of hotels by city code
272274HotelOffer [] offers = amadeus. shopping. hotelOffers. get(Params
273- .with(" cityCode" , " PAR" ));
274-
275+ .with(" cityCode" , " MAD" ));
275276// Get list of offers for a specific hotel
276277HotelOffer offer = amadeus. shopping
277278 .hotel(" SMPARCOL" )
278279 .hotelOffers. get();
279-
280280// Confirm the availability of a specific offer for a specific hotel
281281Offer offer = amadeus. shopping
282282 .hotel(" SMPARCOL" )
0 commit comments