amadeus 3.2.0 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +28 -1
  3. data/README.md +52 -52
  4. data/amadeus.gemspec +12 -10
  5. data/lib/amadeus.rb +19 -4
  6. data/lib/amadeus/client/direction.rb +2 -4
  7. data/lib/amadeus/client/errors.rb +5 -4
  8. data/lib/amadeus/client/location.rb +2 -2
  9. data/lib/amadeus/client/request/hash.rb +1 -1
  10. data/lib/amadeus/namespaces/airport.rb +25 -0
  11. data/lib/amadeus/namespaces/airport/predictions.rb +27 -0
  12. data/lib/amadeus/namespaces/airport/predictions/on_time.rb +32 -0
  13. data/lib/amadeus/namespaces/analytics.rb +25 -0
  14. data/lib/amadeus/namespaces/analytics/itinerary_price_metrics.rb +38 -0
  15. data/lib/amadeus/namespaces/booking.rb +25 -0
  16. data/lib/amadeus/namespaces/booking/hotel_bookings.rb +52 -0
  17. data/lib/amadeus/namespaces/core.rb +50 -0
  18. data/lib/amadeus/namespaces/e_reputation.rb +25 -0
  19. data/lib/amadeus/namespaces/e_reputation/hotel_sentiments.rb +31 -0
  20. data/lib/amadeus/namespaces/reference_data/locations.rb +13 -1
  21. data/lib/amadeus/namespaces/reference_data/locations/point_of_interest.rb +44 -0
  22. data/lib/amadeus/namespaces/safety.rb +34 -0
  23. data/lib/amadeus/namespaces/safety/safety_rated_location.rb +32 -0
  24. data/lib/amadeus/namespaces/safety/safety_rated_locations.rb +46 -0
  25. data/lib/amadeus/namespaces/safety/safety_rated_locations/by_square.rb +41 -0
  26. data/lib/amadeus/namespaces/shopping.rb +4 -4
  27. data/lib/amadeus/namespaces/shopping/flight_offers_search.rb +61 -0
  28. data/lib/amadeus/namespaces/shopping/{flight_offers → flight_offers_search}/prediction.rb +7 -6
  29. data/lib/amadeus/namespaces/travel.rb +10 -1
  30. data/lib/amadeus/namespaces/travel/analytics/air_traffic.rb +0 -23
  31. data/lib/amadeus/namespaces/travel/predictions.rb +37 -0
  32. data/lib/amadeus/namespaces/travel/predictions/flight_delay.rb +55 -0
  33. data/lib/amadeus/namespaces/travel/predictions/trip_purpose.rb +46 -0
  34. data/lib/amadeus/version.rb +1 -1
  35. metadata +41 -26
  36. data/lib/amadeus/namespaces/shopping/flight_offers.rb +0 -47
  37. data/lib/amadeus/namespaces/travel/analytics/air_traffic/searched.rb +0 -46
  38. data/lib/amadeus/namespaces/travel/analytics/air_traffic/searched_by_destination.rb +0 -54
@@ -1,47 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Amadeus
4
- module Namespaces
5
- class Shopping
6
- # A namespaced client for the
7
- # +/v1/shopping/flight-offers+ endpoints
8
- #
9
- # Access via the +Amadeus::Client+ object
10
- #
11
- # amadeus = Amadeus::Client.new
12
- # amadeus.shopping.flight_offers
13
- #
14
- class FlightOffers < Amadeus::Client::Decorator
15
- # The namespace for the Prediction API:
16
- #
17
- # @return [Amadeus::Namespaces::Shopping::FlightOffers::Prediction]
18
- # @example
19
- # amadeus.shopping.flight_offers.prediction
20
- #
21
- def prediction
22
- Amadeus::Namespaces::Shopping::FlightOffers::Prediction.new(client)
23
- end
24
- # Find the cheapest bookable flights.
25
- #
26
- # @option params [String] :origin City/Airport IATA code from which the
27
- # flight will depart. BOS, for example.
28
- # @option params [String] :destination City/Airport IATA code to which
29
- # the traveler is going. PAR, for example
30
- # @return [Amadeus::Response] a parsed response
31
- # @raise [Amadeus::Base] an exception if the call failed
32
- # @example Find the cheapest flight offers from New-York to Madrid,
33
- # for the first of August 2019
34
- # amadeus.shopping.flight_offers.get(
35
- # origin: 'NYC',
36
- # destination: 'MAD',
37
- # departureDate: '2019-08-01'
38
- # )
39
- #
40
-
41
- def get(params = {})
42
- client.get('/v1/shopping/flight-offers', params)
43
- end
44
- end
45
- end
46
- end
47
- end
@@ -1,46 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Amadeus
4
- module Namespaces
5
- class Travel
6
- class Analytics
7
- class AirTraffic
8
- # A namespaced client for the
9
- # +/v1/travel/analytics/air-traffic/searched+ endpoints
10
- #
11
- # Access via the +Amadeus::Client+ object
12
- #
13
- # amadeus = Amadeus::Client.new
14
- # amadeus.travel.analytics.air_traffic.searched
15
- #
16
- class Searched < Amadeus::Client::Decorator
17
- # Returns a list of air traffic reports, based on searches.
18
- #
19
- # @option params [String] :originCityCode
20
- # IATA code of the origin city -
21
- # e.g. MAD for Madrid - required
22
- # @option params [String] :marketCountryCode
23
- # IATA code of the country from which the searches were made -
24
- # e.g. ES for Spain - required
25
- # @option params [String] :searchPeriod when consumers
26
- # are searching -
27
- # in YYYY-MM format - required
28
- # @return [Amadeus::Response] a parsed response
29
- # @raise [Amadeus::Base] an exception if the call failed
30
- # @example Which were the most searched flight destinations
31
- # from Madrid in August 2017?
32
- # amadeus.travel.analytics.air_traffic.searched.get(
33
- # originCityCode: 'MAD',
34
- # searchPeriod: '2017-08',
35
- # marketCountryCode: 'ES'
36
- # )
37
- #
38
- def get(params = {})
39
- client.get('/v1/travel/analytics/air-traffic/searched', params)
40
- end
41
- end
42
- end
43
- end
44
- end
45
- end
46
- end
@@ -1,54 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Amadeus
4
- module Namespaces
5
- class Travel
6
- class Analytics
7
- class AirTraffic
8
- # A namespaced client for the
9
- # +/v1/travel/analytics/air-traffic/searched_by_destination+ endpoints
10
- #
11
- # Access via the +Amadeus::Client+ object
12
- #
13
- # amadeus = Amadeus::Client.new
14
- # amadeus.travel.analytics.air_traffic.searched_by_destination
15
- #
16
- class SearchedByDestination < Amadeus::Client::Decorator
17
- # Returns a list of air traffic reports,
18
- # based on searches for a dedicated destination.
19
- #
20
- # @option params [String] :originCityCode
21
- # IATA code of the origin city -
22
- # e.g. NCE for Nice - required
23
- # @option params [String] :destinationCityCode
24
- # IATA code of the destinaton city -
25
- # e.g. PAR for Paris - required
26
- # @option params [String] :marketCountryCode
27
- # IATA code of the country from which the searches were made -
28
- # e.g. FR for France - required
29
- # @option params [String] :searchPeriod when consumers
30
- # are searching -
31
- # in YYYY-MM format - required
32
- # @return [Amadeus::Response] a parsed response
33
- # @raise [Amadeus::Base] an exception if the call failed
34
- # @example How many people in Spain searched for a trip
35
- # from Madrid to New-York in August 2017?
36
- # amadeus.travel.analytics.air_traffic.searched_by_destination.get(
37
- # originCityCode: 'MAD',
38
- # destinationCityCode: 'NYC',
39
- # searchPeriod: '2017-08',
40
- # marketCountryCode: 'ES'
41
- # )
42
- #
43
- def get(params = {})
44
- client.get(
45
- '/v1/travel/analytics/air-traffic/searched/by-destination',
46
- params
47
- )
48
- end
49
- end
50
- end
51
- end
52
- end
53
- end
54
- end