File tree Expand file tree Collapse file tree 7 files changed +51
-0
lines changed
Expand file tree Collapse file tree 7 files changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -359,6 +359,9 @@ List of supported endpoints
359359 # Covid-19 Area Report
360360 amadeus.duty_of_care.diseases.covid19_area_report.get(countryCode = " US" )
361361
362+ # Airline Routes
363+ amadeus.airline.destinations.get(airlineCode = ' BA' )
364+
362365 Development & Contributing
363366--------------------------
364367
Original file line number Diff line number Diff line change 1+ from ._destinations import Destinations
2+
3+ __all__ = ['Destinations' ]
Original file line number Diff line number Diff line change 1+ from amadeus .client .decorator import Decorator
2+
3+
4+ class Destinations (Decorator , object ):
5+ def get (self , ** params ):
6+ '''
7+ Get airline destinations.
8+
9+ .. code-block:: python
10+
11+ amadeus.airline.destinations.get(airlineCode='BA')
12+
13+ :param airlineCode: the airline code following IATA standard.
14+ Example: ``"BA"``
15+
16+ :rtype: amadeus.Response
17+ :raises amadeus.ResponseError: if the request could not be completed
18+ '''
19+ return self .client .get ('/v1/airline/destinations' , ** params )
Original file line number Diff line number Diff line change 1+ from amadeus .client .decorator import Decorator
2+ from amadeus .airline ._destinations import Destinations
3+
4+
5+ class Airline (Decorator , object ):
6+ def __init__ (self , client ):
7+ Decorator .__init__ (self , client )
8+ self .destinations = Destinations (client )
Original file line number Diff line number Diff line change 99from amadeus .namespaces ._analytics import Analytics
1010from amadeus .namespaces ._location import Location
1111from amadeus .namespaces ._duty_of_care import DutyOfCare
12+ from amadeus .namespaces ._airline import Airline
1213
1314
1415class Core (object ):
@@ -24,3 +25,4 @@ def __init__(self):
2425 self .analytics = Analytics (self )
2526 self .location = Location (self )
2627 self .duty_of_care = DutyOfCare (self )
28+ self .airline = Airline (self )
Original file line number Diff line number Diff line change @@ -262,3 +262,9 @@ DutyOfCare/Diseases
262262
263263.. autoclass :: amadeus.duty_of_care.diseases.Covid19AreaReport
264264 :members: get
265+
266+ Airline/Destinations
267+ ================
268+
269+ .. autoclass :: amadeus.airline.Destinations
270+ :members: get
Original file line number Diff line number Diff line change 9595 expect (client .duty_of_care ).not_to (be_none )
9696 expect (client .duty_of_care .diseases .covid19_area_report ).not_to (be_none )
9797
98+ expect (client .airline .destinations ).not_to (be_none )
99+
98100 with it ('should define all expected .get methods' ):
99101 client = self .client
100102 expect (client .reference_data .urls .checkin_links .get ).not_to (be_none )
163165 expect (client .duty_of_care .diseases .covid19_area_report .get ).not_to (
164166 be_none )
165167
168+ expect (client .airline .destinations .get ).not_to (be_none )
169+
166170 with it ('should define all expected .delete methods' ):
167171 client = self .client
168172 expect (client .booking .flight_order ('123' ).delete ).not_to (be_none )
570574 expect (self .client .get ).to (have_been_called_with (
571575 '/v1/reference-data/locations/cities' , a = 'b'
572576 ))
577+
578+ with it ('.airline.destinations.get' ):
579+ self .client .airline .destinations .get (a = 'b' )
580+ expect (self .client .get ).to (have_been_called_with (
581+ '/v1/airline/destinations' , a = 'b'
582+ ))
You can’t perform that action at this time.
0 commit comments