File tree Expand file tree Collapse file tree 9 files changed +65
-0
lines changed
Expand file tree Collapse file tree 9 files changed +65
-0
lines changed Original file line number Diff line number Diff line change @@ -276,6 +276,9 @@ List of supported endpoints
276276 # Airport On-Time Performance
277277 amadeus.airport.predictions.on_time.get(airportCode = ' JFK' , date = ' 2020-03-01' )
278278
279+ # AI Generated Photos
280+ amadeus.media.files.generated_photos.get(category = ' MOUNTAIN' )
281+
279282 Development & Contributing
280283--------------------------
281284
Original file line number Diff line number Diff line change 1+ from ._files import GeneratedPhotos
2+
3+ __all__ = ['GeneratedPhotos' ]
Original file line number Diff line number Diff line change 1+ from amadeus .client .decorator import Decorator
2+ from .files import GeneratedPhotos
3+
4+
5+ class Files (Decorator , object ):
6+ def __init__ (self , client ):
7+ Decorator .__init__ (self , client )
8+ self .generated_photos = GeneratedPhotos (client )
Original file line number Diff line number Diff line change 1+ from ._generated_photos import GeneratedPhotos
2+
3+
4+ __all__ = ['GeneratedPhotos' ]
Original file line number Diff line number Diff line change 1+ from amadeus .client .decorator import Decorator
2+
3+
4+ class GeneratedPhotos (Decorator , object ):
5+ def get (self , ** params ):
6+ '''
7+ Returns a link with a rendered image of a landscape
8+
9+ .. code-block:: python
10+
11+ amadeus.media.files.generated_photos.get(category='MOUNTAIN')
12+
13+ :param category: the type of landscape to be generated,
14+ ``"MOUNTAIN"`` or ``"BEACH"``
15+
16+ :rtype: amadeus.Response
17+ :raises amadeus.ResponseError: if the request could not be completed
18+ '''
19+ return self .client .get ('/v2/media/files/generated-photos' , ** params )
Original file line number Diff line number Diff line change 1+ from amadeus .client .decorator import Decorator
2+ from amadeus .media ._files import Files
3+
4+
5+ class Media (Decorator , object ):
6+ def __init__ (self , client ):
7+ Decorator .__init__ (self , client )
8+ self .files = Files (client )
Original file line number Diff line number Diff line change 33from amadeus .namespaces ._shopping import Shopping
44from amadeus .namespaces ._e_reputation import EReputation
55from amadeus .namespaces ._airport import Airport
6+ from amadeus .namespaces ._media import Media
67
78
89class Core (object ):
@@ -12,3 +13,4 @@ def __init__(self):
1213 self .shopping = Shopping (self )
1314 self .e_reputation = EReputation (self )
1415 self .airport = Airport (self )
16+ self .media = Media (self )
Original file line number Diff line number Diff line change @@ -108,3 +108,9 @@ Airport/Predictions
108108
109109.. autoclass :: amadeus.airport.predictions.AirportOnTime
110110 :members: get
111+
112+ Media/Files
113+ ================
114+
115+ .. autoclass :: amadeus.media.files.GeneratedPhotos
116+ :members: get
Original file line number Diff line number Diff line change 5454 expect (client .airport .predictions ).not_to (be_none )
5555 expect (client .airport .predictions .on_time ).not_to (be_none )
5656
57+ expect (client .media ).not_to (be_none )
58+ expect (client .media .files ).not_to (be_none )
59+ expect (client .media .files .generated_photos ).not_to (be_none )
60+
5761 with it ('should define all expected .get methods' ):
5862 client = self .client
5963 expect (client .reference_data .urls .checkin_links .get ).not_to (be_none )
9397
9498 expect (client .airport .predictions .on_time .get ).not_to (be_none )
9599
100+ expect (client .media .files .generated_photos .get ).not_to (be_none )
101+
96102 with context ('testing all calls to the client' ):
97103 with before .each :
98104 self .client .get = method_returning (None )
232238 expect (self .client .get ).to (have_been_called_with (
233239 '/v1/airport/predictions/on-time' , a = 'b'
234240 ))
241+
242+ with it ('.media.files.generated_photos.get' ):
243+ self .client .media .files .generated_photos .get (a = 'b' )
244+ expect (self .client .get ).to (have_been_called_with (
245+ '/v2/media/files/generated-photos' , a = 'b'
246+ ))
You can’t perform that action at this time.
0 commit comments