File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -282,6 +282,9 @@ List of supported endpoints
282282 # Returns a single Point of Interest from a given id
283283 amadeus.reference_data.locations.point_of_interest(' 9CB40CB5D0' ).get()
284284
285+ # Location Score
286+ amadeus.location.analytics.category_rated_areas.get(latitude = 41.397158 , longitude = 2.160873 )
287+
285288 # Safe Place
286289 # How safe is Barcelona? (based a geo location and a radius)
287290 amadeus.safety.safety_rated_locations.get(latitude = 41.397158 , longitude = 2.160873 )
Original file line number Diff line number Diff line change 1+ from ._analytics import Analytics
2+
3+ __all__ = ['Analytics' ]
Original file line number Diff line number Diff line change 1+ from amadeus .client .decorator import Decorator
2+ from .analytics import CategoryRatedAreas
3+
4+
5+ class Analytics (Decorator , object ):
6+ def __init__ (self , client ):
7+ Decorator .__init__ (self , client )
8+ self .category_rated_areas = CategoryRatedAreas (client )
Original file line number Diff line number Diff line change 1+ from ._category_rated_areas import CategoryRatedAreas
2+
3+ __all__ = ['CategoryRatedAreas' ]
Original file line number Diff line number Diff line change 1+ from amadeus .client .decorator import Decorator
2+
3+
4+ class CategoryRatedAreas (Decorator , object ):
5+ def get (self , ** params ):
6+ '''
7+ Gets popularity score for location categories
8+
9+ .. code-block:: python
10+
11+ amadeus.location.analytics.category_rated_areas.get(
12+ latitude=41.397158,
13+ longitude=2.160873)
14+
15+ :param latitude: latitude of geographic location to search around.
16+ For example: ``41.397158``
17+ :param longitude: longitude of geographic location to search around.
18+ For example: ``2.160873``
19+
20+ :rtype: amadeus.Response
21+ :raises amadeus.ResponseError: if the request could not be completed
22+ '''
23+ return self .client .get ('/v1/location/analytics/category-rated-areas' ,
24+ ** params )
Original file line number Diff line number Diff line change 1+ from amadeus .client .decorator import Decorator
2+ from amadeus .location ._analytics import Analytics
3+
4+
5+ class Location (Decorator , object ):
6+ def __init__ (self , client ):
7+ Decorator .__init__ (self , client )
8+ self .analytics = Analytics (client )
Original file line number Diff line number Diff line change 88from amadeus .namespaces ._safety import Safety
99from amadeus .namespaces ._schedule import Schedule
1010from amadeus .namespaces ._analytics import Analytics
11+ from amadeus .namespaces ._location import Location
1112
1213
1314class Core (object ):
@@ -22,3 +23,4 @@ def __init__(self):
2223 self .safety = Safety (self )
2324 self .schedule = Schedule (self )
2425 self .analytics = Analytics (self )
26+ self .location = Location (self )
Original file line number Diff line number Diff line change @@ -208,11 +208,17 @@ Safety/SafetyRatedLocations
208208Schedule/Flights
209209================
210210
211- .. autoclass :: amadeus.schedule.flights
211+ .. autoclass :: amadeus.schedule.Flights
212212 :members: get
213213
214214Analytics/ItineraryPriceMetrics
215215================
216216
217- .. autoclass :: amadeus.analytics.itinerary_price_metrics
217+ .. autoclass :: amadeus.analytics.ItineraryPriceMetrics
218+ :members: get
219+
220+ Location/Analytics
221+ ================
222+
223+ .. autoclass :: amadeus.location.analytics.CategoryRatedAreas
218224 :members: get
Original file line number Diff line number Diff line change 8484 expect (client .analytics ).not_to (be_none )
8585 expect (client .analytics .itinerary_price_metrics ).not_to (be_none )
8686
87+ expect (client .location ).not_to (be_none )
88+ expect (client .location .analytics .category_rated_areas ).not_to (be_none )
89+
8790 with it ('should define all expected .get methods' ):
8891 client = self .client
8992 expect (client .reference_data .urls .checkin_links .get ).not_to (be_none )
139142
140143 expect (client .analytics .itinerary_price_metrics .get ).not_to (be_none )
141144
145+ expect (client .location .analytics .category_rated_areas .get ).not_to (be_none )
146+
142147 with it ('should define all expected .delete methods' ):
143148 client = self .client
144149 expect (client .booking .flight_order ('123' ).delete ).not_to (be_none )
203208 '/v1/reference-data/locations/pois/XXX' , a = 'b'
204209 ))
205210
211+ with it ('.location.analytics.category_rated_areas.get' ):
212+ self .client .location .analytics .category_rated_areas .get (a = 'b' )
213+ expect (self .client .get ).to (have_been_called_with (
214+ '/v1/location/analytics/category-rated-areas' , a = 'b'
215+ ))
216+
206217 with it ('.reference_data.recommended_locations.get' ):
207218 self .client .reference_data .recommended_locations .get (a = 'b' )
208219 expect (self .client .get ).to (have_been_called_with (
You can’t perform that action at this time.
0 commit comments