-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Trip Purpose Prediction API
- Loading branch information
1 parent
56c0e5c
commit 7c00e22
Showing
8 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
from amadeus.client.decorator import Decorator | ||
from amadeus.travel._analytics import Analytics | ||
from amadeus.travel._predictions import Predictions | ||
|
||
|
||
class Travel(Decorator, object): | ||
def __init__(self, client): | ||
Decorator.__init__(self, client) | ||
self.analytics = Analytics(client) | ||
self.predictions = Predictions(client) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from ._analytics import Analytics | ||
from ._predictions import TripPurpose | ||
|
||
|
||
__all__ = ['Analytics'] | ||
__all__ = ['Analytics', 'TripPurpose'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from amadeus.client.decorator import Decorator | ||
from .predictions import TripPurpose | ||
|
||
|
||
class Predictions(Decorator, object): | ||
def __init__(self, client): | ||
Decorator.__init__(self, client) | ||
self.trip_purpose = TripPurpose(client) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from ._trip_purpose import TripPurpose | ||
|
||
|
||
__all__ = ['TripPurpose'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from amadeus.client.decorator import Decorator | ||
|
||
|
||
class TripPurpose(Decorator, object): | ||
def get(self, **params): | ||
''' | ||
Predicts traveler purpose, Business or Leisure, | ||
with the probability in the context of search & shopping | ||
.. code-block:: python | ||
amadeus.travel.predictions.trip_purpose.get( | ||
originLocationCode='NYC', | ||
destinationLocationCode='MAD', | ||
departureDate='2020-08-01', | ||
returnDate='2020-08-12', | ||
searchDate='2020-06-11') | ||
:param originLocationCode: the City/Airport IATA code from which | ||
the flight will depart. ``"NYC"``, for example for New York | ||
:param destinationLocationCode: the City/Airport IATA code to which | ||
the flight is going. ``"MAD"``, for example for Madrid | ||
:param departureDate: the date on which to fly out, in `YYYY-MM-DD` format | ||
:param returnDate: the date on which the flight returns to the origin, | ||
in `YYYY-MM-DD` format | ||
:param searchDate: the date on which the traveler performs the search, | ||
in `YYYY-MM-DD` format. | ||
If it is not specified the current date will be used | ||
:rtype: amadeus.Response | ||
:raises amadeus.ResponseError: if the request could not be completed | ||
''' | ||
return self.client.get('/v1/travel/predictions/trip-purpose', **params) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters