Skip to content

Commit

Permalink
Merge pull request #191 from amadeus4dev/updates-transfer-apis
Browse files Browse the repository at this point in the history
Rename transfer offers method
  • Loading branch information
tsolakoua authored Jun 13, 2023
2 parents c09aaa2 + 0e0102f commit dd709d8
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,14 @@ List of supported endpoints
# Airline Routes
amadeus.airline.destinations.get(airlineCode='BA')
# Transfer Offers Search
amadeus.shopping.transfer_offers_search.post(body)
# Transfer Search
amadeus.shopping.transfer_offers.post(body)
# Transfer Create Order
# Transfer Booking
amadeus.ordering.transfer_orders.post(body, offerId='1000000000')
# Transfer Order Management
amadeus.ordering.transfer_order('ABC').transfers.cancellation.post(body, confirmNbr=123)
# Transfer Management
amadeus.ordering.transfer_orders('ABC').transfers.cancellation.post(body, confirmNbr=123)
Development & Contributing
--------------------------
Expand Down
4 changes: 2 additions & 2 deletions amadeus/namespaces/_shopping.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from amadeus.shopping._availability import Availability
from amadeus.shopping._hotel_offer_search import HotelOfferSearch
from amadeus.shopping._hotel_offers_search import HotelOffersSearch
from amadeus.shopping._transfer_offers_search import TransferOffersSearch
from amadeus.shopping._transfer_offers import TransferOffers


class Shopping(Decorator, object):
Expand All @@ -23,7 +23,7 @@ def __init__(self, client):
self.activities = Activities(client)
self.availability = Availability(client)
self.hotel_offers_search = HotelOffersSearch(client)
self.transfer_offers_search = TransferOffersSearch(client)
self.transfer_offers = TransferOffers(client)

def hotel_offer_search(self, offer_id):
return HotelOfferSearch(self.client, offer_id)
Expand Down
4 changes: 2 additions & 2 deletions amadeus/shopping/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from ._hotel_offer_search import HotelOfferSearch
from ._hotel_offers_search import HotelOffersSearch
from ._activities import Activities
from ._transfer_offers_search import TransferOffersSearch
from ._transfer_offers import TransferOffers

__all__ = ['FlightDates', 'FlightDestinations',
'HotelOffersSearch', 'HotelOfferSearch',
'FlightOffersSearch', 'Activities',
'TransferOffersSearch']
'TransferOffers']
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from amadeus.client.decorator import Decorator


class TransferOffersSearch(Decorator, object):
class TransferOffers(Decorator, object):
def post(self, body):
'''
Get transfer offers
.. code-block:: python
amadeus.shopping.transfer_offers_search.post(body)
amadeus.shopping.transfer_offers.post(body)
:param body: the parameters to send to the API
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Shopping/Availability
Shopping/Transfers
================

.. autoclass:: amadeus.shopping.TransferOffersSearch
.. autoclass:: amadeus.shopping.TransferOffers
:members: post

Travel/Analytics
Expand Down
6 changes: 3 additions & 3 deletions specs/namespaces/test_namespaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_expected_paths(client):
assert client.duty_of_care is not None
assert client.duty_of_care.diseases.covid19_report is not None
assert client.airline.destinations is not None
assert client.shopping.transfer_offers_search is not None
assert client.shopping.transfer_offers is not None
assert client.ordering.transfer_orders is not None
assert client.ordering.transfer_order is not None

Expand Down Expand Up @@ -548,8 +548,8 @@ def test_airline_destinations_get(client_setup):
)


def test_shopping_transfer_offers_search_post(client_setup):
client_setup.shopping.transfer_offers_search.post({'foo': 'bar'})
def test_shopping_transfer_offers_post(client_setup):
client_setup.shopping.transfer_offers.post({'foo': 'bar'})
client_setup.post.assert_called_with(
'/v1/shopping/transfer-offers', {'foo': 'bar'}
)
Expand Down

0 comments on commit dd709d8

Please sign in to comment.