Skip to content

Commit 7fdf1b8

Browse files
committed
Add support for Location Score API
1 parent 419bbc4 commit 7fdf1b8

5 files changed

Lines changed: 46 additions & 0 deletions

File tree

amadeus/location/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from ._analytics import Analytics
2+
3+
__all__ = ['Analytics']

amadeus/location/_analytics.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from ._category_rated_areas import CategoryRatedAreas
2+
3+
__all__ = ['CategoryRatedAreas']
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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)

amadeus/namespaces/_location.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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)

0 commit comments

Comments
 (0)