|
| 1 | +from amadeus.client.decorator import Decorator |
| 2 | + |
| 3 | + |
| 4 | +class FlightDelay(Decorator, object): |
| 5 | + def get(self, **params): |
| 6 | + ''' |
| 7 | + Forecast the chances for a flight to be delayed |
| 8 | +
|
| 9 | + .. code-block:: python |
| 10 | +
|
| 11 | + amadeus.travel.predictions.flight_delay.get(originLocationCode='BRU', |
| 12 | + destinationLocationCode='FRA', |
| 13 | + departureDate='2020-01-14', |
| 14 | + departureTime='11:05:00', |
| 15 | + arrivalDate='2020-01-14', |
| 16 | + arrivalTime='12:10:00', |
| 17 | + aircraftCode='32A', |
| 18 | + carrierCode='LH', |
| 19 | + flightNumber='1009', |
| 20 | + duration='PT1H05M') |
| 21 | +
|
| 22 | + :param originLocationCode: the City/Airport IATA code from which |
| 23 | + the flight will depart. ``"NYC"``, for example for New York |
| 24 | +
|
| 25 | + :param destinationLocationCode: the City/Airport IATA code to which |
| 26 | + the flight is going. ``"MAD"``, for example for Madrid |
| 27 | +
|
| 28 | + :param departureDate: the date on which the traveler departs |
| 29 | + from the origin, in `YYYY-MM-DD` format |
| 30 | +
|
| 31 | + :param departureTime: local time on which to fly out, |
| 32 | + in `HH:MM:SS` format |
| 33 | +
|
| 34 | + :param arrivalDate: the date on which the traveler arrives |
| 35 | + to the destination, in `YYYY-MM-DD` format |
| 36 | +
|
| 37 | + :param arrivalTime: local time on which the traveler arrives |
| 38 | + to the destination, in `HH:MM:SS` format |
| 39 | +
|
| 40 | + :param aircraftCode: IATA aircraft code |
| 41 | +
|
| 42 | + :param carrierCode: airline / carrier code |
| 43 | +
|
| 44 | + :param flightNumber: flight number as assigned by the carrier |
| 45 | +
|
| 46 | + :param duration: flight duration, |
| 47 | + in `PnYnMnDTnHnMnS` format e.g. PT2H10M |
| 48 | +
|
| 49 | + :rtype: amadeus.Response |
| 50 | + :raises amadeus.ResponseError: if the request could not be completed |
| 51 | + ''' |
| 52 | + return self.client.get('/v1/travel/predictions/flight-delay', **params) |
0 commit comments