diff --git a/README.rst b/README.rst index e18e3073..4552ff36 100644 --- a/README.rst +++ b/README.rst @@ -295,15 +295,6 @@ List of supported endpoints # Location Score amadeus.location.analytics.category_rated_areas.get(latitude=41.397158, longitude=2.160873) - # Safe Place - # How safe is Barcelona? (based a geo location and a radius) - amadeus.safety.safety_rated_locations.get(latitude=41.397158, longitude=2.160873) - # How safe is Barcelona? (based on a square) - amadeus.safety.safety_rated_locations.by_square.get(north=41.397158, west=2.160873, - south=41.394582, east=2.177181) - # What is the safety information of a location based on it's Id? - amadeus.safety.safety_rated_location('Q930400801').get() - # Trip Purpose Prediction amadeus.travel.predictions.trip_purpose.get(originLocationCode='ATH', destinationLocationCode='MAD', departureDate='2022-11-01', returnDate='2022-11-08') diff --git a/amadeus/namespaces/_safety.py b/amadeus/namespaces/_safety.py deleted file mode 100644 index 9cdf69a4..00000000 --- a/amadeus/namespaces/_safety.py +++ /dev/null @@ -1,12 +0,0 @@ -from amadeus.client.decorator import Decorator -from amadeus.safety._safety_rated_locations import SafetyRatedLocations -from amadeus.safety._safety_rated_location import SafetyRatedLocation - - -class Safety(Decorator, object): - def __init__(self, client): - Decorator.__init__(self, client) - self.safety_rated_locations = SafetyRatedLocations(client) - - def safety_rated_location(self, safety_id): - return SafetyRatedLocation(self.client, safety_id) diff --git a/amadeus/namespaces/core.py b/amadeus/namespaces/core.py index 7c28c426..d6b2dd26 100644 --- a/amadeus/namespaces/core.py +++ b/amadeus/namespaces/core.py @@ -4,7 +4,6 @@ from amadeus.namespaces._e_reputation import EReputation from amadeus.namespaces._airport import Airport from amadeus.namespaces._booking import Booking -from amadeus.namespaces._safety import Safety from amadeus.namespaces._schedule import Schedule from amadeus.namespaces._analytics import Analytics from amadeus.namespaces._location import Location @@ -20,7 +19,6 @@ def __init__(self): self.e_reputation = EReputation(self) self.airport = Airport(self) self.booking = Booking(self) - self.safety = Safety(self) self.schedule = Schedule(self) self.analytics = Analytics(self) self.location = Location(self) diff --git a/amadeus/safety/__init__.py b/amadeus/safety/__init__.py deleted file mode 100644 index 64d3bb12..00000000 --- a/amadeus/safety/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from ._safety_rated_locations import SafetyRatedLocations -from ._safety_rated_location import SafetyRatedLocation - -__all__ = ['SafetyRatedLocations', 'SafetyRatedLocation'] diff --git a/amadeus/safety/_safety_rated_location.py b/amadeus/safety/_safety_rated_location.py deleted file mode 100644 index 4b3dcc17..00000000 --- a/amadeus/safety/_safety_rated_location.py +++ /dev/null @@ -1,21 +0,0 @@ -from amadeus.client.decorator import Decorator - - -class SafetyRatedLocation(Decorator, object): - def __init__(self, client, safety_id): - Decorator.__init__(self, client) - self.safety_id = safety_id - - def get(self, **params): - ''' - Returns safety information of a location by its Id. - - .. code-block:: python - - amadeus.safety.safety_rated_location('Q930400801').get() - - :rtype: amadeus.Response - :raises amadeus.ResponseError: if the request could not be completed - ''' - return self.client.get('/v1/safety/safety-rated-locations/{0}' - .format(self.safety_id), **params) diff --git a/amadeus/safety/_safety_rated_locations.py b/amadeus/safety/_safety_rated_locations.py deleted file mode 100644 index 3d39c473..00000000 --- a/amadeus/safety/_safety_rated_locations.py +++ /dev/null @@ -1,32 +0,0 @@ -from amadeus.client.decorator import Decorator -from amadeus.safety.safety_rated_locations._by_square import BySquare - - -class SafetyRatedLocations(Decorator, object): - def __init__(self, client): - Decorator.__init__(self, client) - self.by_square = BySquare(client) - - def get(self, **params): - ''' - Returns the overall safety ranking and a detailed safety - ranking of all the districts within the given radius. - - .. code-block:: python - - - amadeus.safety.safety_rated_locations.get( - longitude=2.160873, - latitude=41.397158 - ) - - :param latitude: latitude of the location to safety ranking search. - For example: ``41.397158`` - :param longitude: longitude of the location to safety ranking search. - For example: ``2.160873`` - - :rtype: amadeus.Response - :raises amadeus.ResponseError: if the request could not be completed - ''' - return self.client.get( - '/v1/safety/safety-rated-locations', **params) diff --git a/amadeus/safety/safety_rated_locations/__init__.py b/amadeus/safety/safety_rated_locations/__init__.py deleted file mode 100644 index 0f5ac86a..00000000 --- a/amadeus/safety/safety_rated_locations/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from ._by_square import BySquare -__all__ = ['BySquare'] diff --git a/amadeus/safety/safety_rated_locations/_by_square.py b/amadeus/safety/safety_rated_locations/_by_square.py deleted file mode 100644 index f76cb28b..00000000 --- a/amadeus/safety/safety_rated_locations/_by_square.py +++ /dev/null @@ -1,32 +0,0 @@ -from amadeus.client.decorator import Decorator - - -class BySquare(Decorator, object): - def get(self, **params): - ''' - Returns detailed safety ranking of all the districts - within the designated area. - - .. code-block:: python - - amadeus.safety.safety_rated_locations.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/safety/safety-rated-locations/by-square', **params) diff --git a/docs/index.rst b/docs/index.rst index 12303f5b..96fe572d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -218,18 +218,6 @@ Booking .. autoclass:: amadeus.booking.HotelBookings :members: post -Safety/SafetyRatedLocations -======================= - -.. autoclass:: amadeus.safety.SafetyRatedLocations - :members: get - -.. autoclass:: amadeus.safety.safety_rated_locations.BySquare - :members: get - -.. autoclass:: amadeus.safety.safety_rated_locations.SafetyRatedLocation - :members: get - Schedule/Flights ================ diff --git a/specs/namespaces/test_namespaces.py b/specs/namespaces/test_namespaces.py index 605ddf0c..4687e9a6 100644 --- a/specs/namespaces/test_namespaces.py +++ b/specs/namespaces/test_namespaces.py @@ -55,9 +55,6 @@ def test_expected_paths(client): assert client.travel.from_base64 is not None assert client.booking.flight_orders is not None assert client.booking.flight_order is not None - assert client.safety.safety_rated_locations is not None - assert client.safety.safety_rated_locations.by_square is not None - assert client.safety.safety_rated_location is not None assert client.schedule is not None assert client.schedule.flights is not None assert client.analytics is not None @@ -101,8 +98,6 @@ def test_expected_get_methods(client): assert client.airport.direct_destinations.get is not None assert client.booking.flight_order('123').get is not None assert client.booking.flight_order('123').delete is not None - assert client.safety.safety_rated_locations.by_square.get is not None - assert client.safety.safety_rated_location('Q930402719').get is not None assert client.schedule.flights.get is not None assert client.analytics.itinerary_price_metrics.get is not None assert client.location.analytics.category_rated_areas.get is not None @@ -440,27 +435,6 @@ def test_shopping_booking_hotel_bookings_post_list(client_setup): ) -def test_safety_safety_rated_locations_get(client_setup): - client_setup.safety.safety_rated_locations.get(a='b') - client_setup.get.assert_called_with( - '/v1/safety/safety-rated-locations', a='b' - ) - - -def test_safety_safety_rated_locations_by_square_get(client_setup): - client_setup.safety.safety_rated_locations.by_square.get(a='b') - client_setup.get.assert_called_with( - '/v1/safety/safety-rated-locations/by-square', a='b' - ) - - -def test_safety_safety_rated_location_get(client_setup): - client_setup.safety.safety_rated_location('XXX').get(a='b') - client_setup.get.assert_called_with( - '/v1/safety/safety-rated-locations/XXX', a='b' - ) - - def test_schedule_flights_get(client_setup): client_setup.schedule.flights.get(a='b') client_setup.get.assert_called_with(