File tree Expand file tree Collapse file tree 7 files changed +42
-29
lines changed Expand file tree Collapse file tree 7 files changed +42
-29
lines changed Original file line number Diff line number Diff line change 66class Analytics (Decorator , object ):
77 def __init__ (self , client ):
88 Decorator .__init__ (self , client )
9- self .air_traffic = AirTraffic (client )
109 self .fare_searches = FareSearches (client )
10+ self .air_traffic = AirTraffic (client )
Original file line number Diff line number Diff line change 1- from ._air_traffic import AirTraffic
21from ._fare_searches import FareSearches
2+ from ._air_traffic import AirTraffic
3+
34
4- __all__ = ['AirTraffic ' , 'FareSearches ' ]
5+ __all__ = ['FareSearches ' , 'AirTraffic ' ]
Original file line number Diff line number Diff line change 11from amadeus .client .decorator import Decorator
2+ from .air_traffic ._traveled import Traveled
23
34
45class AirTraffic (Decorator , object ):
5- def get (self , ** params ):
6- '''
7- Returns a list of air traffic reports.
8-
9- .. code-block:: python
10-
11- amadeus.travel.analytics.air_traffic.get(
12- origin='LHR',
13- period='2011-01'
14- )
15-
16- :param cityCode: IATA code of the origin city, for
17- example ``"BOS"`` for Boston.
18- :param query: period when consumers are travelling
19- in ``YYYY-MM`` format
20-
21- :rtype: amadeus.Response
22- :raises amadeus.ResponseError: if the request could not be completed
23- '''
24- return self .client .get (
25- '/v1/travel/analytics/air-traffic' , ** params )
6+ def __init__ (self , client ):
7+ Decorator .__init__ (self , client )
8+ self .traveled = Traveled (client )
Original file line number Diff line number Diff line change 1+ from ._traveled import Traveled
2+
3+ __all__ = ['Traveled' ]
Original file line number Diff line number Diff line change 1+ from amadeus .client .decorator import Decorator
2+
3+
4+ class Traveled (Decorator , object ):
5+ def get (self , ** params ):
6+ '''
7+ Returns a list of air traffic reports.
8+
9+ .. code-block:: python
10+
11+ amadeus.travel.analytics.air_traffic.traveled.get(
12+ origin='LHR',
13+ period='2011-01'
14+ )
15+
16+ :param cityCode: IATA code of the origin city, for
17+ example ``"BOS"`` for Boston.
18+ :param query: period when consumers are traveling
19+ in ``YYYY-MM`` format
20+
21+ :rtype: amadeus.Response
22+ :raises amadeus.ResponseError: if the request could not be completed
23+ '''
24+ return self .client .get (
25+ '/v1/travel/analytics/air-traffic/traveled' , ** params )
Original file line number Diff line number Diff line change 2323
2424 expect (client .travel ).not_to (be_none )
2525 expect (client .travel .analytics ).not_to (be_none )
26- expect (client .travel .analytics .air_traffic ).not_to (be_none )
26+ expect (client .travel .analytics .air_traffic . traveled ).not_to (be_none )
2727 expect (client .travel .analytics .fare_searches ).not_to (be_none )
2828
2929 expect (client .shopping ).not_to (be_none )
4343 expect (client .reference_data .locations .get ).not_to (be_none )
4444 expect (client .reference_data .locations .airports .get ).not_to (be_none )
4545
46- expect (client .travel .analytics .air_traffic .get ).not_to (be_none )
46+ expect (client .travel .analytics .air_traffic .traveled . get ).not_to (be_none )
4747 expect (client .travel .analytics .fare_searches .get ).not_to (be_none )
4848
4949 expect (client .shopping .flight_dates .get ).not_to (be_none )
8282 '/v1/reference-data/locations/airports' , a = 'b'
8383 ))
8484
85- with it ('.travel.analytics.air_traffic.get' ):
86- self .client .travel .analytics .air_traffic .get (a = 'b' )
85+ with it ('.travel.analytics.air_traffic.traveled. get' ):
86+ self .client .travel .analytics .air_traffic .traveled . get (a = 'b' )
8787 expect (self .client .get ).to (have_been_called_with (
88- '/v1/travel/analytics/air-traffic' , a = 'b'
88+ '/v1/travel/analytics/air-traffic/traveled ' , a = 'b'
8989 ))
9090
9191 with it ('.travel.analytics.fare_searches.get' ):
Original file line number Diff line number Diff line change @@ -26,3 +26,4 @@ usedevelop=True
2626max-complexity = 5
2727inline-quotes = single
2828multiline-quotes = single
29+ max-line-length = 82
You can’t perform that action at this time.
0 commit comments