Skip to content

Commit 1e52f41

Browse files
committed
remove trip parser v2 and add v3
1 parent ee2792b commit 1e52f41

File tree

8 files changed

+33
-96
lines changed

8 files changed

+33
-96
lines changed

amadeus/namespaces/_travel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from amadeus.client.decorator import Decorator
22
from amadeus.travel._analytics import Analytics
33
from amadeus.travel._predictions import Predictions
4-
from amadeus.travel._trip_parser_jobs import TripParser
4+
from amadeus.travel._trip_parser import TripParser
55
from amadeus.travel._encoder import from_file, from_base64
66

77

@@ -10,7 +10,7 @@ def __init__(self, client):
1010
Decorator.__init__(self, client)
1111
self.analytics = Analytics(client)
1212
self.predictions = Predictions(client)
13-
self.trip_parser_jobs = TripParser(client)
13+
self.trip_parser = TripParser(client)
1414

1515
def from_file(self, file):
1616
return from_file(file)

amadeus/travel/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from ._analytics import Analytics
22
from ._predictions import TripPurpose, FlightDelay
3-
from ._trip_parser_jobs import TripParser
3+
from ._trip_parser import TripParser
44

55
__all__ = ['Analytics', 'TripPurpose', 'FlightDelay', 'TripParser']

amadeus/travel/_trip_parser.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from amadeus.client.decorator import Decorator
2+
3+
4+
class TripParser(Decorator, object):
5+
def __init__(self, client):
6+
Decorator.__init__(self, client)
7+
8+
def post(self, body):
9+
'''
10+
Sends the request for the parsing with the
11+
booking details and input parameters.
12+
13+
.. code-block:: python
14+
15+
amadeus.travel.trip_parser.post(
16+
'{
17+
"payload": "base64string"
18+
}'
19+
20+
You can call our helper functions with your booking details
21+
in a file or the content encoded in Base64
22+
23+
.. code-block:: python
24+
amadeus.travel.trip_parser.post(amadeus.travel.from_file(path_to_file))
25+
amadeus.travel.trip_parser.post(amadeus.travel.from_base64(base64))
26+
27+
:rtype: amadeus.Response
28+
:raises amadeus.ResponseError: if the request could not be completed
29+
'''
30+
return self.client.post('/v3/travel/trip-parser', body)

amadeus/travel/_trip_parser_jobs.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

amadeus/travel/trip_parser_jobs/__init__.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

amadeus/travel/trip_parser_jobs/_result.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

amadeus/travel/trip_parser_jobs/_status.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

docs/index.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,6 @@ Travel/TripParser
122122
.. autoclass:: amadeus.travel.TripParser
123123
:members: post
124124

125-
.. autoclass:: amadeus.travel.trip_parser_jobs.status.TripParserStatus
126-
:members: get
127-
128-
.. autoclass:: amadeus.travel.trip_parser_jobs.result.TripParserResult
129-
:members: get
130-
131125
ReferenceData/Locations
132126
=======================
133127

0 commit comments

Comments
 (0)