File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -325,6 +325,10 @@ List of supported endpoints
325325 # Returns a single activity from a given id
326326 amadeus.shopping.activity(' 4615' ).get()
327327
328+ # Returns itinerary price metrics
329+ amadeus.analytics.itinerary_price_metrics.get(originIataCode = ' MAD' , destinationIataCode = ' CDG' ,
330+ departureDate = ' 2021-03-21' )
331+
328332 Development & Contributing
329333--------------------------
330334
Original file line number Diff line number Diff line change 1+ from ._itinerary_price_metrics import ItineraryPriceMetrics
2+
3+ __all__ = ['ItineraryPriceMetrics' ]
Original file line number Diff line number Diff line change 1+ from amadeus .client .decorator import Decorator
2+
3+
4+ class ItineraryPriceMetrics (Decorator , object ):
5+
6+ def get (self , ** params ):
7+ '''
8+ Returns itinerary price metrics by search criteria
9+
10+ .. code-block:: python
11+
12+ amadeus.analytics.itinerary_price_metrics.get(
13+ originIataCode='MAD',
14+ destinationIataCode='CDG',
15+ departureDate='2021-03-21')
16+
17+ :param originIataCode: IATA code of the origin city, for
18+ example ``"BOS"`` for Boston.
19+
20+ :param destinationIataCode: IATA code of the destination city,
21+ for example ``"ATH"`` for Athens.
22+
23+ :param departureDate: scheduled departure date of the flight,
24+ local to the departure airport, format YYYY-MM-DD
25+
26+ :rtype: amadeus.Response
27+ :raises amadeus.ResponseError: if the request could not be completed
28+ '''
29+ return self .client .get ('/v1/analytics/itinerary-price-metrics' , ** params )
Original file line number Diff line number Diff line change 1+ from amadeus .client .decorator import Decorator
2+ from amadeus .analytics ._itinerary_price_metrics import ItineraryPriceMetrics
3+
4+
5+ class Analytics (Decorator , object ):
6+ def __init__ (self , client ):
7+ Decorator .__init__ (self , client )
8+ self .itinerary_price_metrics = ItineraryPriceMetrics (client )
Original file line number Diff line number Diff line change 77from amadeus .namespaces ._booking import Booking
88from amadeus .namespaces ._safety import Safety
99from amadeus .namespaces ._schedule import Schedule
10+ from amadeus .namespaces ._analytics import Analytics
1011
1112
1213class Core (object ):
@@ -20,3 +21,4 @@ def __init__(self):
2021 self .booking = Booking (self )
2122 self .safety = Safety (self )
2223 self .schedule = Schedule (self )
24+ self .analytics = Analytics (self )
Original file line number Diff line number Diff line change @@ -197,4 +197,10 @@ Schedule/Flights
197197================
198198
199199.. autoclass :: amadeus.schedule.flights
200+ :members: get
201+
202+ Analytics/ItineraryPriceMetrics
203+ ================
204+
205+ .. autoclass :: amadeus.analytics.itinerary_price_metrics
200206 :members: get
Original file line number Diff line number Diff line change 7777 expect (client .schedule ).not_to (be_none )
7878 expect (client .schedule .flights ).not_to (be_none )
7979
80+ expect (client .analytics ).not_to (be_none )
81+ expect (client .analytics .itinerary_price_metrics ).not_to (be_none )
82+
8083 with it ('should define all expected .get methods' ):
8184 client = self .client
8285 expect (client .reference_data .urls .checkin_links .get ).not_to (be_none )
130133
131134 expect (client .schedule .flights .get ).not_to (be_none )
132135
136+ expect (client .analytics .itinerary_price_metrics .get ).not_to (be_none )
137+
133138 with it ('should define all expected .delete methods' ):
134139 client = self .client
135140 expect (client .booking .flight_order ('123' ).delete ).not_to (be_none )
458463 expect (self .client .get ).to (have_been_called_with (
459464 '/v1/shopping/activities/XXX' , a = 'b'
460465 ))
466+
467+ with it ('.analytics.itinerary_price_metrics().get' ):
468+ self .client .analytics .itinerary_price_metrics .get (a = 'b' )
469+ expect (self .client .get ).to (have_been_called_with (
470+ '/v1/analytics/itinerary-price-metrics' , a = 'b'
471+ ))
You can’t perform that action at this time.
0 commit comments