File tree Expand file tree Collapse file tree 4 files changed +57
-0
lines changed
amadeus/namespaces/airline Expand file tree Collapse file tree 4 files changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,12 @@ amadeus.airport.directDestinations.get({
177177 departureAirportCode: ' CDG' ,
178178})
179179
180+ // Airline Routes
181+ // find all destinations served by a given airline
182+ amadeus .airline .destinations .get ({
183+ airlineCode: ' BA' ,
184+ })
185+
180186// Flight Inspiration Search
181187amadeus .shopping .flightDestinations .get ({
182188 origin : ' MAD'
Original file line number Diff line number Diff line change @@ -102,6 +102,8 @@ describe('Namespaces', () => {
102102 expect ( amadeus . dutyOfCare ) . toBeDefined ( ) ;
103103 expect ( amadeus . dutyOfCare . diseases ) . toBeDefined ( ) ;
104104 expect ( amadeus . dutyOfCare . diseases . covid19AreaReport ) . toBeDefined ( ) ;
105+
106+ expect ( amadeus . airline . destinations ) . toBeDefined ( ) ;
105107 } ) ;
106108
107109 it ( 'should define all expected .get methods' , ( ) => {
@@ -160,6 +162,8 @@ describe('Namespaces', () => {
160162 expect ( amadeus . location . analytics . categoryRatedAreas . get ) . toBeDefined ( ) ;
161163
162164 expect ( amadeus . dutyOfCare . diseases . covid19AreaReport . get ) . toBeDefined ( ) ;
165+
166+ expect ( amadeus . airline . destinations . get ) . toBeDefined ( ) ;
163167 } ) ;
164168
165169 it ( 'should define all expected .post methods' , ( ) => {
@@ -547,5 +551,12 @@ describe('Namespaces', () => {
547551 . toHaveBeenCalledWith ( '/v1/duty-of-care/diseases/covid19-area-report' , { } ) ;
548552 } ) ;
549553
554+ it ( '.amadeus.airline.destinations.get' , ( ) => {
555+ amadeus . client . get = jest . fn ( ) ;
556+ amadeus . airline . destinations . get ( ) ;
557+ expect ( amadeus . client . get )
558+ . toHaveBeenCalledWith ( '/v1/airline/destinations' , { } ) ;
559+ } ) ;
560+
550561 } ) ;
551562} ) ;
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import Schedule from './amadeus/namespaces/schedule';
1313import Analytics from './amadeus/namespaces/analytics' ;
1414import Location from './amadeus/namespaces/location' ;
1515import DutyOfCare from './amadeus/namespaces/duty_of_care' ;
16+ import Airline from './amadeus/namespaces/airline' ;
1617
1718
1819/**
@@ -78,6 +79,7 @@ class Amadeus {
7879 this . analytics = new Analytics ( this . client ) ;
7980 this . location = new Location ( this . client ) ;
8081 this . dutyOfCare = new DutyOfCare ( this . client ) ;
82+ this . airline = new Airline ( this . client ) ;
8183 }
8284
8385 /**
Original file line number Diff line number Diff line change 1+ /**
2+ * A namespaced client for the
3+ * `/v1/airline/destinations` endpoints
4+ *
5+ * Access via the {@link Amadeus} object
6+ *
7+ * ```js
8+ * let amadeus = new Amadeus();
9+ * amadeus.airline.destinations;
10+ * ```
11+ *
12+ * @param {Client } client
13+ */
14+ class Destinations {
15+ constructor ( client ) {
16+ this . client = client ;
17+ }
18+
19+ /**
20+ * find all destinations served by a given airline
21+ *
22+ * @param {Object } params
23+ * @param {string } params.airlineCode airline IATA code, e.g. BA for British airways
24+ * @return {Promise.<Response,ResponseError> } a Promise
25+ *
26+ * What destinations are served by this airline?
27+ * ```js
28+ * amadeus.airline.destinations.get({
29+ * airlineCode: 'BA',
30+ * })
31+ * ```
32+ */
33+ get ( params = { } ) {
34+ return this . client . get ( '/v1/airport/direct-destinations' , params ) ;
35+ }
36+ }
37+
38+ export default Destinations ;
You can’t perform that action at this time.
0 commit comments