File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -313,6 +313,9 @@ List of supported endpoints
313313 # Travel Recommendations
314314 amadeus.reference_data.recommended_locations.get(cityCodes = ' PAR' , travelerCountryCode = ' FR' )
315315
316+ # Retrieve status of a given flight
317+ amadeus.schedule.flights.get(carrierCode = ' AZ' , flightNumber = ' 319' , scheduledDepartureDate = ' 2021-03-13' )
318+
316319 Development & Contributing
317320--------------------------
318321
Original file line number Diff line number Diff line change 1+ from amadeus .client .decorator import Decorator
2+ from amadeus .schedule ._flights import Flights
3+
4+
5+ class Schedule (Decorator , object ):
6+ def __init__ (self , client ):
7+ Decorator .__init__ (self , client )
8+ self .flights = Flights (client )
Original file line number Diff line number Diff line change 66from amadeus .namespaces ._media import Media
77from amadeus .namespaces ._booking import Booking
88from amadeus .namespaces ._safety import Safety
9+ from amadeus .namespaces ._schedule import Schedule
910
1011
1112class Core (object ):
@@ -18,3 +19,4 @@ def __init__(self):
1819 self .media = Media (self )
1920 self .booking = Booking (self )
2021 self .safety = Safety (self )
22+ self .schedule = Schedule (self )
Original file line number Diff line number Diff line change 1+ from ._flights import Flights
2+
3+ __all__ = ['Flights' ]
Original file line number Diff line number Diff line change 1+ from amadeus .client .decorator import Decorator
2+
3+
4+ class Flights (Decorator , object ):
5+
6+ def get (self , ** params ):
7+ '''
8+ Retrieves a unique flight status by search criteria
9+
10+ .. code-block:: python
11+
12+ amadeus.schedule.flights.get(
13+ carrierCode='AZ',
14+ flightNumber='319',
15+ scheduledDepartureDate='2021-03-13')
16+
17+ :param carrierCode: the IATA carrier code
18+
19+ :param flightNumber: flight number as assigned by the carrier
20+
21+ :param scheduledDepartureDate: scheduled departure date of the flight,
22+ local to the departure airport, format YYYY-MM-DD
23+
24+ :rtype: amadeus.Response
25+ :raises amadeus.ResponseError: if the request could not be completed
26+ '''
27+ return self .client .get ('/v2/schedule/flights' , ** params )
Original file line number Diff line number Diff line change @@ -179,4 +179,10 @@ Safety/SafetyRatedLocations
179179 :members: get
180180
181181.. autoclass :: amadeus.safety.safety_rated_locations.SafetyRatedLocation
182+ :members: get
183+
184+ Schedule/Flights
185+ ================
186+
187+ .. autoclass :: amadeus.schedule.flights
182188 :members: get
Original file line number Diff line number Diff line change 7272 expect (client .safety .safety_rated_locations .by_square ).not_to (be_none )
7373 expect (client .safety .safety_rated_location ).not_to (be_none )
7474
75+ expect (client .schedule ).not_to (be_none )
76+ expect (client .schedule .flights ).not_to (be_none )
77+
7578 with it ('should define all expected .get methods' ):
7679 client = self .client
7780 expect (client .reference_data .urls .checkin_links .get ).not_to (be_none )
123126 expect (client .safety .safety_rated_location ('Q930402719' ).get ).not_to (
124127 be_none )
125128
129+ expect (client .schedule .flights .get ).not_to (be_none )
130+
126131 with it ('should define all expected .delete methods' ):
127132 client = self .client
128133 expect (client .booking .flight_order ('123' ).delete ).not_to (be_none )
427432 expect (self .client .get ).to (have_been_called_with (
428433 '/v1/safety/safety-rated-locations/XXX' , a = 'b'
429434 ))
435+
436+ with it ('.schedule.flights().get' ):
437+ self .client .schedule .flights .get (a = 'b' )
438+ expect (self .client .get ).to (have_been_called_with (
439+ '/v2/schedule/flights' , a = 'b'
440+ ))
You can’t perform that action at this time.
0 commit comments