Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ List of supported endpoints
amadeus.analytics.itinerary_price_metrics.get(originIataCode='MAD', destinationIataCode='CDG',
departureDate='2021-03-21')

# Covid-19 Area Report
amadeus.duty_of_care.diseases.covid19_area_report.get(countryCode="US")

Development & Contributing
--------------------------

Expand Down
3 changes: 3 additions & 0 deletions amadeus/duty_of_care/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from ._diseases import Diseases

__all__ = ['Diseases']
8 changes: 8 additions & 0 deletions amadeus/duty_of_care/_diseases.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from amadeus.client.decorator import Decorator
from amadeus.duty_of_care.diseases import Covid19AreaReport


class Diseases(Decorator, object):
def __init__(self, client):
Decorator.__init__(self, client)
self.covid19_area_report = Covid19AreaReport(client)
3 changes: 3 additions & 0 deletions amadeus/duty_of_care/diseases/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from ._covid19_area_report import Covid19AreaReport

__all__ = ['Covid19AreaReport']
22 changes: 22 additions & 0 deletions amadeus/duty_of_care/diseases/_covid19_area_report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from amadeus.client.decorator import Decorator


class Covid19AreaReport(Decorator, object):
def get(self, **params):
'''
Returns the Covid-19 restrictions on targerted area.

.. code-block:: python

amadeus.travel_restrictions.covid19_area_report.get(
countryCode='US'
)

:param countryCode: ISO 3166 Alphas-2 code, for
example ``"US"`` for United States of America

:rtype: amadeus.Response
:raises amadeus.ResponseError: if the request could not be completed
'''
return self.client.get(
'/v1/duty-of-care/diseases/covid19-area-report', **params)
8 changes: 8 additions & 0 deletions amadeus/namespaces/_duty_of_care.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from amadeus.client.decorator import Decorator
from amadeus.duty_of_care._diseases import Diseases


class DutyOfCare(Decorator, object):
def __init__(self, client):
Decorator.__init__(self, client)
self.diseases = Diseases(client)
2 changes: 2 additions & 0 deletions amadeus/namespaces/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from amadeus.namespaces._schedule import Schedule
from amadeus.namespaces._analytics import Analytics
from amadeus.namespaces._location import Location
from amadeus.namespaces._duty_of_care import DutyOfCare


class Core(object):
Expand All @@ -24,3 +25,4 @@ def __init__(self):
self.schedule = Schedule(self)
self.analytics = Analytics(self)
self.location = Location(self)
self.duty_of_care = DutyOfCare(self)
8 changes: 7 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,10 @@ Location/Analytics
================

.. autoclass:: amadeus.location.analytics.CategoryRatedAreas
:members: get
:members: get

DutyOfCare/Diseases
================

.. autoclass:: amadeus.duty_of_care.diseases.Covid19AreaReport
:members: get
12 changes: 12 additions & 0 deletions specs/namespaces/namespaces_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@
expect(client.location).not_to(be_none)
expect(client.location.analytics.category_rated_areas).not_to(be_none)

expect(client.duty_of_care).not_to(be_none)
expect(client.duty_of_care.diseases.covid19_area_report).not_to(be_none)

with it('should define all expected .get methods'):
client = self.client
expect(client.reference_data.urls.checkin_links.get).not_to(be_none)
Expand Down Expand Up @@ -144,6 +147,9 @@

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

expect(client.duty_of_care.diseases.covid19_area_report.get).not_to(
be_none)

with it('should define all expected .delete methods'):
client = self.client
expect(client.booking.flight_order('123').delete).not_to(be_none)
Expand Down Expand Up @@ -498,3 +504,9 @@
expect(self.client.get).to(have_been_called_with(
'/v1/analytics/itinerary-price-metrics', a='b'
))

with it('.duty_of_care.diseases.covid19_area_report.get'):
self.client.duty_of_care.diseases.covid19_area_report.get(a='b')
expect(self.client.get).to(have_been_called_with(
'/v1/duty-of-care/diseases/covid19-area-report', a='b'
))