diff --git a/README.rst b/README.rst index a8b16b51..93582522 100644 --- a/README.rst +++ b/README.rst @@ -291,15 +291,6 @@ List of supported endpoints # What travelers think about this hotel? amadeus.e_reputation.hotel_sentiments.get(hotelIds = 'ADNYCCTB') - # Points of Interest - # What are the popular places in Barcelona (based a geo location and a radius) - amadeus.reference_data.locations.points_of_interest.get(latitude=41.397158, longitude=2.160873) - # What are the popular places in Barcelona? (based on a square) - amadeus.reference_data.locations.points_of_interest.by_square.get(north=41.397158, west=2.160873, - south=41.394582, east=2.177181) - # Returns a single Point of Interest from a given id - amadeus.reference_data.locations.point_of_interest('9CB40CB5D0').get() - # Location Score amadeus.location.analytics.category_rated_areas.get(latitude=41.397158, longitude=2.160873) diff --git a/amadeus/reference_data/_locations.py b/amadeus/reference_data/_locations.py index 98f3a8b4..70741778 100644 --- a/amadeus/reference_data/_locations.py +++ b/amadeus/reference_data/_locations.py @@ -1,7 +1,5 @@ from amadeus.client.decorator import Decorator from amadeus.reference_data.locations._airports import Airports -from amadeus.reference_data.locations._points_of_interest import PointsOfInterest -from amadeus.reference_data.locations._point_of_interest import PointOfInterest from amadeus.reference_data.locations._hotels import Hotels from amadeus.reference_data.locations._hotel import Hotel from amadeus.reference_data.locations._cities import Cities @@ -11,14 +9,10 @@ class Locations(Decorator, object): def __init__(self, client): Decorator.__init__(self, client) self.airports = Airports(client) - self.points_of_interest = PointsOfInterest(client) self.hotels = Hotels(client) self.hotel = Hotel(client) self.cities = Cities(client) - def point_of_interest(self, poi_id): - return PointOfInterest(self.client, poi_id) - def get(self, **params): ''' Returns details for a specific airport. diff --git a/amadeus/reference_data/locations/__init__.py b/amadeus/reference_data/locations/__init__.py index 6028ed01..65b67566 100644 --- a/amadeus/reference_data/locations/__init__.py +++ b/amadeus/reference_data/locations/__init__.py @@ -1,6 +1,5 @@ from ._airports import Airports -from ._points_of_interest import PointsOfInterest from ._hotel import Hotel from ._cities import Cities -__all__ = ['Airports', 'PointsOfInterest', 'Hotel', 'Cities'] +__all__ = ['Airports', 'Hotel', 'Cities'] diff --git a/amadeus/reference_data/locations/_point_of_interest.py b/amadeus/reference_data/locations/_point_of_interest.py deleted file mode 100644 index 37f48a0a..00000000 --- a/amadeus/reference_data/locations/_point_of_interest.py +++ /dev/null @@ -1,21 +0,0 @@ -from amadeus.client.decorator import Decorator - - -class PointOfInterest(Decorator, object): - def __init__(self, client, poi_id): - Decorator.__init__(self, client) - self.poi_id = poi_id - - def get(self, **params): - ''' - Returns a single Point of Interest from a given id. - - .. code-block:: python - - amadeus.reference_data.locations.point_of_interest('9CB40CB5D0').get() - - :rtype: amadeus.Response - :raises amadeus.ResponseError: if the request could not be completed - ''' - return self.client.get('/v1/reference-data/locations/pois/{0}' - .format(self.poi_id), **params) diff --git a/amadeus/reference_data/locations/_points_of_interest.py b/amadeus/reference_data/locations/_points_of_interest.py deleted file mode 100644 index 222d96fc..00000000 --- a/amadeus/reference_data/locations/_points_of_interest.py +++ /dev/null @@ -1,32 +0,0 @@ -from amadeus.client.decorator import Decorator -from amadeus.reference_data.locations.points_of_interest._by_square \ - import BySquare - - -class PointsOfInterest(Decorator, object): - def __init__(self, client): - Decorator.__init__(self, client) - self.by_square = BySquare(client) - - def get(self, **params): - ''' - Returns a list of relevant point of interests near to a given point. - - .. code-block:: python - - - client.reference_data.locations.points_of_interest.get( - longitude=2.160873, - latitude=41.397158 - ) - - :param latitude: latitude of geographic location to search around. - For example: ``41.397158`` - :param longitude: longitude of geographic location to search around. - For example: ``2.160873`` - - :rtype: amadeus.Response - :raises amadeus.ResponseError: if the request could not be completed - ''' - return self.client.get( - '/v1/reference-data/locations/pois', **params) diff --git a/amadeus/reference_data/locations/points_of_interest/__init__.py b/amadeus/reference_data/locations/points_of_interest/__init__.py deleted file mode 100644 index 0f5ac86a..00000000 --- a/amadeus/reference_data/locations/points_of_interest/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from ._by_square import BySquare -__all__ = ['BySquare'] diff --git a/amadeus/reference_data/locations/points_of_interest/_by_square.py b/amadeus/reference_data/locations/points_of_interest/_by_square.py deleted file mode 100644 index cca0c5c1..00000000 --- a/amadeus/reference_data/locations/points_of_interest/_by_square.py +++ /dev/null @@ -1,33 +0,0 @@ -from amadeus.client.decorator import Decorator - - -class BySquare(Decorator, object): - def get(self, **params): - ''' - Returns a list of relevant point of interests - around a defined square (4 points). - - .. code-block:: python - - - client.reference_data.locations.points_of_interest.by_square.get( - north=41.397158, - west=2.160873, - south=41.394582, - east=2.177181 - ) - - :param north: latitude north of bounding box. - For example: ``41.397158`` - :param west: longitude west of bounding box. - For example: ``2.160873`` - :param south: latitude south of bounding box. - For example: ``41.394582`` - :param east: longitude east of bounding box. - For example: ``2.177181`` - - :rtype: amadeus.Response - :raises amadeus.ResponseError: if the request could not be completed - ''' - return self.client.get( - '/v1/reference-data/locations/pois/by-square', **params) diff --git a/docs/index.rst b/docs/index.rst index 8eba14aa..d9faefed 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -128,18 +128,6 @@ ReferenceData/Locations .. autoclass:: amadeus.reference_data.Airlines :members: get -ReferenceData/Locations/PointsOfInterest -======================= - -.. autoclass:: amadeus.reference_data.locations.PointsOfInterest - :members: get - -.. autoclass:: amadeus.reference_data.locations.points_of_interest.BySquare - :members: get - -.. autoclass:: amadeus.reference_data.locations.PointOfInterest - :members: get - ReferenceData/Urls ================== diff --git a/specs/namespaces/test_namespaces.py b/specs/namespaces/test_namespaces.py index ab215543..54b7ec97 100644 --- a/specs/namespaces/test_namespaces.py +++ b/specs/namespaces/test_namespaces.py @@ -15,9 +15,6 @@ def test_expected_paths(client): assert client.reference_data.location is not None assert client.reference_data.locations is not None assert client.reference_data.locations.airports is not None - assert client.reference_data.locations.points_of_interest is not None - assert client.reference_data.locations.points_of_interest.by_square \ - is not None assert client.reference_data.locations.hotels is not None assert client.reference_data.locations.hotels.by_hotels is not None assert client.reference_data.locations.hotels.by_city is not None @@ -70,11 +67,6 @@ def test_expected_get_methods(client): assert client.reference_data.location('ALHR').get is not None assert client.reference_data.locations.get is not None assert client.reference_data.locations.airports.get is not None - assert client.reference_data.locations.points_of_interest.get is not None - assert client.reference_data.locations.points_of_interest.by_square.get \ - is not None - assert client.reference_data.locations.point_of_interest('9CB40CB5D0').get \ - is not None assert client.reference_data.recommended_locations.get is not None assert client.reference_data.locations.hotels.by_city.get is not None assert client.reference_data.locations.hotels.by_hotels.get is not None @@ -151,29 +143,6 @@ def test_reference_data_locations_airports_get(client_setup): ) -def test_reference_data_locations_points_of_interest_get(client_setup): - client_setup.reference_data.locations.points_of_interest.get(a='b') - client_setup.get.assert_called_with( - '/v1/reference-data/locations/pois', a='b' - ) - - -def test_reference_data_locations_points_of_interest_by_square_get(client_setup): - client_setup.reference_data.locations.points_of_interest.by_square.get( - a='b') - client_setup.get.assert_called_with( - '/v1/reference-data/locations/pois/by-square', a='b' - ) - - -def test_reference_data_locations_point_of_interest_get(client_setup): - client_setup.reference_data.locations.point_of_interest( - 'XXX').get(a='b') - client_setup.get.assert_called_with( - '/v1/reference-data/locations/pois/XXX', a='b' - ) - - def test_location_analytics_category_rated_areas_get(client_setup): client_setup.location.analytics.category_rated_areas.get(a='b') client_setup.get.assert_called_with(