Skip to content

Commit a10d50d

Browse files
committed
correct API path mapping
1 parent a7b307a commit a10d50d

9 files changed

Lines changed: 25 additions & 13 deletions

File tree

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ List of supported endpoints
336336
amadeus.analytics.itinerary_price_metrics.get(originIataCode='MAD', destinationIataCode='CDG',
337337
departureDate='2021-03-21')
338338
339-
# Travel Restrictions
340-
amadeus.travel_restrictions.covid19_area_report.get(countryCode="US")
339+
# Covid-19 Area Report
340+
amadeus.duty_of_care.diseases.covid19_area_report.get(countryCode="US")
341341
342342
Development & Contributing
343343
--------------------------

amadeus/duty_of_care/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from ._diseases import Diseases
2+
3+
__all__ = ['Diseases']
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from amadeus.client.decorator import Decorator
2-
from amadeus.travel_restrictions import Covid19AreaReport
2+
from amadeus.duty_of_care.diseases import Covid19AreaReport
33

44

5-
class TravelRestrictions(Decorator, object):
5+
class Diseases(Decorator, object):
66
def __init__(self, client):
77
Decorator.__init__(self, client)
88
self.covid19_area_report = Covid19AreaReport(client)
File renamed without changes.
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.duty_of_care._diseases import Diseases
3+
4+
5+
class DutyOfCare(Decorator, object):
6+
def __init__(self, client):
7+
Decorator.__init__(self, client)
8+
self.diseases = Diseases(client)

amadeus/namespaces/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from amadeus.namespaces._schedule import Schedule
1010
from amadeus.namespaces._analytics import Analytics
1111
from amadeus.namespaces._location import Location
12-
from amadeus.namespaces._travel_restrictions import TravelRestrictions
12+
from amadeus.namespaces._duty_of_care import DutyOfCare
1313

1414

1515
class Core(object):
@@ -25,4 +25,4 @@ def __init__(self):
2525
self.schedule = Schedule(self)
2626
self.analytics = Analytics(self)
2727
self.location = Location(self)
28-
self.travel_restrictions = TravelRestrictions(self)
28+
self.duty_of_care = DutyOfCare(self)

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ Location/Analytics
223223
.. autoclass:: amadeus.location.analytics.CategoryRatedAreas
224224
:members: get
225225

226-
TravelRestrictions/Covid19AreaReport
226+
DutyOfCare/Diseases
227227
================
228228

229-
.. autoclass:: amadeus.travel_restrictions.Covid19AreaReport
229+
.. autoclass:: amadeus.duty_of_care.diseases.Covid19AreaReport
230230
:members: get

specs/namespaces/namespaces_spec.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@
8787
expect(client.location).not_to(be_none)
8888
expect(client.location.analytics.category_rated_areas).not_to(be_none)
8989

90-
expect(client.travel_restrictions).not_to(be_none)
91-
expect(client.travel_restrictions.covid19_area_report).not_to(be_none)
90+
expect(client.duty_of_care).not_to(be_none)
91+
expect(client.duty_of_care.diseases.covid19_area_report).not_to(be_none)
9292

9393
with it('should define all expected .get methods'):
9494
client = self.client
@@ -147,7 +147,8 @@
147147

148148
expect(client.location.analytics.category_rated_areas.get).not_to(be_none)
149149

150-
expect(client.travel_restrictions.covid19_area_report.get).not_to(be_none)
150+
expect(client.duty_of_care.diseases.covid19_area_report.get).not_to(
151+
be_none)
151152

152153
with it('should define all expected .delete methods'):
153154
client = self.client
@@ -504,8 +505,8 @@
504505
'/v1/analytics/itinerary-price-metrics', a='b'
505506
))
506507

507-
with it('.travel_restrictions.covid19_area_report.get'):
508-
self.client.travel_restrictions.covid19_area_report.get(a='b')
508+
with it('.duty_of_care.diseases.covid19_area_report.get'):
509+
self.client.duty_of_care.diseases.covid19_area_report.get(a='b')
509510
expect(self.client.get).to(have_been_called_with(
510511
'/v1/duty-of-care/diseases/covid19-area-report', a='b'
511512
))

0 commit comments

Comments
 (0)