File tree Expand file tree Collapse file tree 4 files changed +53
-0
lines changed
Expand file tree Collapse file tree 4 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,11 @@ var amadeus = new Amadeus({
172172## List of supported endpoints
173173
174174``` js
175+ // Airport Routes
176+ amadeus .airport .directDestinations .get ({
177+ departureAirportCode: ' CDG' ,
178+ })
179+
175180// Flight Inspiration Search
176181amadeus .shopping .flightDestinations .get ({
177182 origin : ' MAD'
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ describe('Namespaces', () => {
8282 expect ( amadeus . media . files ) . toBeDefined ( ) ;
8383
8484 expect ( amadeus . airport ) . toBeDefined ( ) ;
85+ expect ( amadeus . airport . directDestinations ) . toBeDefined ( ) ;
8586 expect ( amadeus . airport . predictions ) . toBeDefined ( ) ;
8687 expect ( amadeus . airport . predictions . onTime ) . toBeDefined ( ) ;
8788
@@ -461,6 +462,13 @@ describe('Namespaces', () => {
461462 . toHaveBeenCalledWith ( '/v1/travel/predictions/flight-delay' , { } ) ;
462463 } ) ;
463464
465+ it ( '.amadeus.airport.directDestinations.get' , ( ) => {
466+ amadeus . client . get = jest . fn ( ) ;
467+ amadeus . airport . directDestinations . get ( ) ;
468+ expect ( amadeus . client . get )
469+ . toHaveBeenCalledWith ( '/v1/airport/direct-destinations' , { } ) ;
470+ } ) ;
471+
464472 it ( '.amadeus.airport.predictions.onTime.get' , ( ) => {
465473 amadeus . client . get = jest . fn ( ) ;
466474 amadeus . airport . predictions . onTime . get ( ) ;
Original file line number Diff line number Diff line change 1+ import DirectDestinations from './airport/direct-destinations' ;
12import Predictions from './airport/predictions' ;
23
34/**
@@ -17,6 +18,7 @@ import Predictions from './airport/predictions';
1718class Airport {
1819 constructor ( client ) {
1920 this . client = client ;
21+ this . directDestinations = new DirectDestinations ( client ) ;
2022 this . predictions = new Predictions ( client ) ;
2123 }
2224}
Original file line number Diff line number Diff line change 1+ /**
2+ * A namespaced client for the
3+ * `/v1/airport/direct-destinations` endpoints
4+ *
5+ * Access via the {@link Amadeus} object
6+ *
7+ * ```js
8+ * let amadeus = new Amadeus();
9+ * amadeus.airport.directDestinations;
10+ * ```
11+ *
12+ * @param {Client } client
13+ */
14+ class DirectDestinations {
15+ constructor ( client ) {
16+ this . client = client ;
17+ }
18+
19+ /**
20+ * Get the percentage of on-time flight departures from a given airport
21+ *
22+ * @param {Object } params
23+ * @param {string } params.departureAirportCode airport IATA code, e.g. BOS for Boston
24+ * @return {Promise.<Response,ResponseError> } a Promise
25+ *
26+ * What destinations are served by this airport?
27+ * ```js
28+ * amadeus.airport.directDestinations.get({
29+ * departureAirportCode: 'JFK',
30+ * })
31+ * ```
32+ */
33+ get ( params = { } ) {
34+ return this . client . get ( '/v1/airport/direct-destinations' , params ) ;
35+ }
36+ }
37+
38+ export default DirectDestinations ;
You can’t perform that action at this time.
0 commit comments