Skip to content

Commit 52681b2

Browse files
committed
branded fares upsell support
1 parent f03f768 commit 52681b2

6 files changed

Lines changed: 42 additions & 2 deletions

File tree

README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ List of supported endpoints
222222
# Flight Availabilities POST
223223
amadeus.shopping.availability.flight_availabilities.post(body)
224224
225+
# Branded Fares Upsell
226+
amadeus.shopping.flight_offers.upselling.post(body)
227+
225228
# Flight Choice Prediction
226229
body = amadeus.shopping.flight_offers_search.get(
227230
originLocationCode='MAD',

amadeus/shopping/_flight_offers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
from amadeus.client.decorator import Decorator
22
from amadeus.shopping.flight_offers._prediction import FlightChoicePrediction
33
from amadeus.shopping.flight_offers._pricing import FlightOffersPrice
4+
from amadeus.shopping.flight_offers._upselling import Upselling
45

56

67
class FlightOffers(Decorator, object):
78
def __init__(self, client):
89
Decorator.__init__(self, client)
910
self.prediction = FlightChoicePrediction(client)
1011
self.pricing = FlightOffersPrice(client)
12+
self.upselling = Upselling(client)
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from ._prediction import FlightChoicePrediction
22
from ._pricing import FlightOffersPrice
3+
from ._upselling import Upselling
34

4-
__all__ = ['FlightChoicePrediction', 'FlightOffersPrice']
5+
__all__ = ['FlightChoicePrediction', 'FlightOffersPrice',
6+
'Upselling']
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from amadeus.client.decorator import Decorator
2+
3+
4+
class Upselling(Decorator, object):
5+
def post(self, body):
6+
'''
7+
Get flight offers with branded fares
8+
9+
.. code-block:: python
10+
11+
amadeus.shopping.flight_offers.upselling.post(body)
12+
13+
:param body: the parameters to send to the API
14+
15+
:rtype: amadeus.Response
16+
:raises amadeus.ResponseError: if the request could not be completed
17+
'''
18+
return self.client.post(
19+
'/v1/shopping/flight-offers/upselling', body)

docs/index.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,13 @@ Shopping/Hotels
6565
Shopping/FlightOffers
6666
===============
6767

68-
.. autoclass:: amadeus.shopping.FlightOffersPrice
68+
.. autoclass:: amadeus.shopping.flight_offers.FlightChoicePrediction
69+
:members: post
70+
71+
.. autoclass:: amadeus.shopping.flight_offers.FlightChoicePrice
72+
:members: post
73+
74+
.. autoclass:: amadeus.shopping.flight_offers.Upselling
6975
:members: post
7076

7177
Shopping/Activities

specs/namespaces/namespaces_spec.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
expect(client.shopping.flight_offers).not_to(be_none)
4242
expect(client.shopping.flight_offers_search).not_to(be_none)
4343
expect(client.shopping.flight_offers.pricing).not_to(be_none)
44+
expect(client.shopping.flight_offers.upselling).not_to(be_none)
4445

4546
expect(client.shopping.seatmaps).not_to(be_none)
4647

@@ -396,6 +397,13 @@
396397
'/v1/shopping/availability/flight-availabilities', {'foo': 'bar'}
397398
))
398399

400+
with it('.shopping.flight_offers.upselling.post'):
401+
self.client.shopping.flight_offers.upselling.post(
402+
{'foo': 'bar'})
403+
expect(self.client.post).to(have_been_called_with(
404+
'/v1/shopping/flight-offers/upselling', {'foo': 'bar'}
405+
))
406+
399407
with it('.booking.flight_order().get'):
400408
self.client.booking.flight_order('123').get(a='b')
401409
expect(self.client.get).to(have_been_called_with(

0 commit comments

Comments
 (0)