Skip to content

Commit c6359ae

Browse files
committed
branded upsell endpoint
1 parent c195eb0 commit c6359ae

File tree

5 files changed

+46
-1
lines changed

5 files changed

+46
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ amadeus.shopping.seatmaps.get({
260260
// Flight Availabilities Search
261261
amadeus.shopping.availability.flightAvailabilities.post(body);
262262

263+
// Branded Fares Upsell
264+
amadeus.shopping.flightOffers.upselling.post(body);
265+
263266
// Flight Choice Prediction
264267
amadeus.shopping.flightOffersSearch.get({
265268
originLocationCode: 'SYD',

spec/amadeus/namespaces.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,12 @@ describe('Namespaces', () => {
459459
.toHaveBeenCalledWith('/v1/shopping/availability/flight-availabilities', {});
460460
});
461461

462+
it('.amadeus.shopping.flight_offers.upselling.post', () => {
463+
amadeus.client.post = jest.fn();
464+
amadeus.shopping.flightOffers.upselling.post();
465+
expect(amadeus.client.post)
466+
.toHaveBeenCalledWith('/v1/shopping/flight-offers/upselling', {});
467+
});
462468

463469
});
464470
});

src/amadeus/namespaces/shopping/availability/flight_availabilities.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* ```js
88
* let amadeus = new Amadeus();
9-
* amadeus.availability.FlightAvailabilities;
9+
* amadeus.availability.flightAvailabilities;
1010
* ```
1111
*
1212
* @param {Client} client

src/amadeus/namespaces/shopping/flight_offers.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import FlightChoicePrediction from './flight_offers/flight_choice_prediction.js';
22
import Pricing from './flight_offers/pricing.js';
3+
import Upselling from './flight_offers/upselling.js';
34

45
/**
56
* A namespaced client for the
@@ -19,6 +20,7 @@ class FlightOffers {
1920
this.client = client;
2021
this.prediction = new FlightChoicePrediction(client);
2122
this.pricing = new Pricing(client);
23+
this.upselling = new Upselling(client);
2224
}
2325
}
2426

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/flight-offers/upselling` endpoints
4+
*
5+
* Access via the {@link Amadeus} object
6+
*
7+
* ```js
8+
* let amadeus = new Amadeus();
9+
* amadeus.shopping.flightOffers.upselling;
10+
* ```
11+
*
12+
* @param {Client} client
13+
*/
14+
class Upselling {
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.flightOffers.upselling.post(body);
27+
* ```
28+
*/
29+
post(params = {}) {
30+
return this.client.post('/v1/shopping/flight-offers/upselling', params);
31+
}
32+
}
33+
34+
export default Upselling;

0 commit comments

Comments
 (0)