File tree Expand file tree Collapse file tree 3 files changed +48
-0
lines changed
Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ describe('Namespaces', () => {
7979 expect ( amadeus . media . files ) . toBeDefined ( ) ;
8080
8181 expect ( amadeus . airport ) . toBeDefined ( ) ;
82+ expect ( amadeus . airport . directDestinations ) . toBeDefined ( ) ;
8283 expect ( amadeus . airport . predictions ) . toBeDefined ( ) ;
8384 expect ( amadeus . airport . predictions . onTime ) . toBeDefined ( ) ;
8485
@@ -429,6 +430,13 @@ describe('Namespaces', () => {
429430 . toHaveBeenCalledWith ( '/v1/travel/predictions/flight-delay' , { } ) ;
430431 } ) ;
431432
433+ it ( '.amadeus.airport.directDestinations.get' , ( ) => {
434+ amadeus . client . get = jest . fn ( ) ;
435+ amadeus . airport . directDestinations . get ( ) ;
436+ expect ( amadeus . client . get )
437+ . toHaveBeenCalledWith ( '/v1/airport/direct-destinations' , { } ) ;
438+ } ) ;
439+
432440 it ( '.amadeus.airport.predictions.onTime.get' , ( ) => {
433441 amadeus . client . get = jest . fn ( ) ;
434442 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