Skip to content

Commit 7e71e4b

Browse files
committed
add support for flight availabilities
1 parent 818e0d3 commit 7e71e4b

File tree

4 files changed

+65
-0
lines changed

4 files changed

+65
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ amadeus.shopping.seatmaps.get({
257257
'flight-orderId': 'XXX'
258258
});
259259

260+
// Flight Availabilities Search
261+
amadeus.shopping.seatmaps.post(body);
262+
260263
// Flight Choice Prediction
261264
amadeus.shopping.flightOffersSearch.get({
262265
originLocationCode: 'SYD',

src/amadeus/namespaces/shopping.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import HotelOffersByHotel from './shopping/hotel_offers_by_hotel';
88
import HotelOffer from './shopping/hotel_offer';
99
import Activities from './shopping/activities';
1010
import Activity from './shopping/activity';
11+
import Availability from './shopping/availability';
1112

1213

1314
/**
@@ -30,6 +31,7 @@ import Activity from './shopping/activity';
3031
* @property {HotelOffers} hotelOffers
3132
* @property {HotelOffer} hotelOffer
3233
* @property {HotelOffersByHotel} hotelOffersByHotel
34+
* @property {Availability} availability
3335
*/
3436
class Shopping {
3537
constructor(client) {
@@ -42,6 +44,7 @@ class Shopping {
4244
this.hotelOffers = new HotelOffers(client);
4345
this.hotelOffersByHotel = new HotelOffersByHotel(client);
4446
this.activities = new Activities(client);
47+
this.availability = new Availability(client);
4548
}
4649

4750

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import FlightAvailabilities from './availability/flight_availabilities';
2+
3+
/**
4+
* A namespaced client for the
5+
* `/v1/shopping/availability` endpoints
6+
*
7+
* Access via the {@link Amadeus} object
8+
*
9+
* ```js
10+
* let amadeus = new Amadeus();
11+
* amadeus.shopping.availability;
12+
* ```
13+
*
14+
* @param {Client} client
15+
* @property {Availability} availability
16+
* @protected
17+
*/
18+
class Availability {
19+
constructor(client) {
20+
this.client = client;
21+
this.flight_availabilities = new FlightAvailabilities(client);
22+
}
23+
}
24+
25+
export default Availability;
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* A namespaced client for the
3+
* `/v1/shopping/availability/flight-availabilities` endpoints
4+
*
5+
* Access via the {@link Amadeus} object
6+
*
7+
* ```js
8+
* let amadeus = new Amadeus();
9+
* amadeus.availability.FlightAvailabilities;
10+
* ```
11+
*
12+
* @param {Client} client
13+
*/
14+
class FlightAvailabilities {
15+
constructor(client) {
16+
this.client = client;
17+
}
18+
19+
/**
20+
* Get available seats in different fare classes
21+
*
22+
* @param {Object} params
23+
* @return {Promise.<Response,ResponseError>} a Promise
24+
*
25+
* ```js
26+
* amadeus.shopping.availability.flight_availabilities.post(body);
27+
* ```
28+
*/
29+
post(params = {}) {
30+
return this.client.post('/v1/shopping/availability/flight-availabilities', params);
31+
}
32+
}
33+
34+
export default FlightAvailabilities;

0 commit comments

Comments
 (0)