|
| 1 | +from amadeus.client.decorator import Decorator |
| 2 | + |
| 3 | + |
| 4 | +class TripPurpose(Decorator, object): |
| 5 | + def get(self, **params): |
| 6 | + ''' |
| 7 | + Predicts traveler purpose, Business or Leisure, |
| 8 | + with the probability in the context of search & shopping |
| 9 | +
|
| 10 | + .. code-block:: python |
| 11 | +
|
| 12 | + amadeus.travel.predictions.trip_purpose.get( |
| 13 | + originLocationCode='NYC', |
| 14 | + destinationLocationCode='MAD', |
| 15 | + departureDate='2020-08-01', |
| 16 | + returnDate='2020-08-12', |
| 17 | + searchDate='2020-06-11') |
| 18 | +
|
| 19 | + :param originLocationCode: the City/Airport IATA code from which |
| 20 | + the flight will depart. ``"NYC"``, for example for New York |
| 21 | +
|
| 22 | + :param destinationLocationCode: the City/Airport IATA code to which |
| 23 | + the flight is going. ``"MAD"``, for example for Madrid |
| 24 | +
|
| 25 | + :param departureDate: the date on which to fly out, in `YYYY-MM-DD` format |
| 26 | +
|
| 27 | + :param returnDate: the date on which the flight returns to the origin, |
| 28 | + in `YYYY-MM-DD` format |
| 29 | +
|
| 30 | + :param searchDate: the date on which the traveler performs the search, |
| 31 | + in `YYYY-MM-DD` format. |
| 32 | + If it is not specified the current date will be used |
| 33 | +
|
| 34 | + :rtype: amadeus.Response |
| 35 | + :raises amadeus.ResponseError: if the request could not be completed |
| 36 | + ''' |
| 37 | + return self.client.get('/v1/travel/predictions/trip-purpose', **params) |
0 commit comments