amadeus 5.1.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +8 -6
- data/amadeus.gemspec +1 -1
- data/lib/amadeus.rb +2 -0
- data/lib/amadeus/namespaces/analytics.rb +25 -0
- data/lib/amadeus/namespaces/analytics/itinerary_price_metrics.rb +38 -0
- data/lib/amadeus/namespaces/core.rb +10 -0
- data/lib/amadeus/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b5f631649abaae86acd4e45d35507a0863bcc1f60766d81f2264307c4e10a1a
|
4
|
+
data.tar.gz: c93ab739e245d2ab52ee50e5e2cde0700a7d2ac6a809cbcead2918f9c22987cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1756d0de031d1c00f217d6483fa319810669850b500b95ee4a734255c59dca1368da89d02dc0b4fb74f8c4cb5183ca9ef43607696be2547cb73f8ae10e752918
|
7
|
+
data.tar.gz: 6d17996db303020e08566b6f38ba3b5e82005a616651a3688f39395b8e5779cc30778214de5b49f3b94592cc3512912fa902f3e1dbdf15780c4434ec22c05de4
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -11,7 +11,7 @@ Amadeus provides a rich set of APIs for the travel industry. For more details, c
|
|
11
11
|
|
12
12
|
## Installation
|
13
13
|
|
14
|
-
This gem requires Ruby 2.
|
14
|
+
This gem requires Ruby 2.5+. You can install it directly or via bundler.
|
15
15
|
#### Command line
|
16
16
|
```bash
|
17
17
|
gem install amadeus
|
@@ -34,7 +34,7 @@ amadeus = Amadeus::Client.new({
|
|
34
34
|
})
|
35
35
|
|
36
36
|
begin
|
37
|
-
puts amadeus.
|
37
|
+
puts amadeus.shopping.flight_offers_search.get(originLocationCode: 'NYC', destinationLocationCode: 'MAD', departureDate: '2021-05-01', adults: 1, max: 1).body
|
38
38
|
rescue Amadeus::ResponseError => error
|
39
39
|
puts error
|
40
40
|
end
|
@@ -158,14 +158,14 @@ amadeus.shopping.flight_destinations.get(origin: 'MAD')
|
|
158
158
|
amadeus.shopping.flight_dates.get(origin: 'MAD', destination: 'MUC')
|
159
159
|
|
160
160
|
# Flight Offers Search
|
161
|
-
amadeus.shopping.flight_offers_search.get(originLocationCode: 'NYC', destinationLocationCode: 'MAD', departureDate: '
|
161
|
+
amadeus.shopping.flight_offers_search.get(originLocationCode: 'NYC', destinationLocationCode: 'MAD', departureDate: '2021-05-01', adults: 1)
|
162
162
|
|
163
163
|
# Flight Choice Prediction / Be careful, this example combines 2 API calls: 1. Flight Offers Search then Flight Choice Prediction
|
164
|
-
flight_offers = amadeus.shopping.flight_offers_search.get(originLocationCode: 'NYC', destinationLocationCode: 'MAD', departureDate: '
|
164
|
+
flight_offers = amadeus.shopping.flight_offers_search.get(originLocationCode: 'NYC', destinationLocationCode: 'MAD', departureDate: '2021-05-01', adults: 1, max: 1).body
|
165
165
|
amadeus.shopping.flight_offers_search.prediction.post(flight_offers)
|
166
166
|
|
167
167
|
# Flight Delay Prediction
|
168
|
-
amadeus.travel.predictions.flight_delay.get(originLocationCod: 'NCE', destinationLocationCod: 'IST', departureDat: '
|
168
|
+
amadeus.travel.predictions.flight_delay.get(originLocationCod: 'NCE', destinationLocationCod: 'IST', departureDat: '2021-05-01', departureTim: '18:20:00', arrivalDat: '2020-08-01', arrivalTim: '22:15:00', aircraftCod: '321', carrierCod: 'TK', flightNumber: '1816', duration: 'PT31H10M')
|
169
169
|
# Flight Check-in Links
|
170
170
|
amadeus.reference_data.urls.checkin_links.get(airlineCode: 'BA')
|
171
171
|
|
@@ -221,7 +221,6 @@ amadeus.reference_data.locations.points_of_interest.by_square.get(north: 41.3971
|
|
221
221
|
# Returns a single Point of Interest from a given id
|
222
222
|
amadeus.reference_data.locations.point_of_interest('9CB40CB5D0').get()
|
223
223
|
|
224
|
-
|
225
224
|
# Safe Place
|
226
225
|
# How safe is Barcelona? (based a geo location and a radius)
|
227
226
|
amadeus.safety.safety_rated_locations.get(latitude: 41.397158, longitude: 2.160873)
|
@@ -233,6 +232,9 @@ amadeus.safety.safety_rated_location('Q930402753').get()
|
|
233
232
|
# Airport On-Time Performance
|
234
233
|
amadeus.airport.predictions.on_time.get(airportCode: 'JFK', date: '2020-08-01')
|
235
234
|
|
235
|
+
# Flight Price Analysis
|
236
|
+
amadeus.analytics.itinerary_price_metrics.get(originIataCode: 'AMS', destinationIataCode: 'CDG', departureDate: '2021-08-18')
|
237
|
+
|
236
238
|
# Trip Purpose Prediction
|
237
239
|
amadeus.travel.predictions.trip_purpose.get(originLocationCode: 'ATH', destinationLocationCode: 'MAD', departureDate: '2020-08-01', returnDate: '2020-08-12', searchDate: '2020-06-11')
|
238
240
|
```
|
data/amadeus.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.required_ruby_version = '>= 2.4.0'
|
30
30
|
|
31
31
|
spec.add_development_dependency 'awesome_print', '~> 1.8'
|
32
|
-
spec.add_development_dependency 'bundler', '~> 2.
|
32
|
+
spec.add_development_dependency 'bundler', '~> 2.2.14'
|
33
33
|
spec.add_development_dependency 'guard', '~> 2.16'
|
34
34
|
spec.add_development_dependency 'guard-rake', '~> 1.0'
|
35
35
|
spec.add_development_dependency 'guard-yard', '~> 2.2'
|
data/lib/amadeus.rb
CHANGED
@@ -16,6 +16,7 @@ require 'amadeus/namespaces/e_reputation'
|
|
16
16
|
require 'amadeus/namespaces/booking'
|
17
17
|
require 'amadeus/namespaces/airport'
|
18
18
|
require 'amadeus/namespaces/safety'
|
19
|
+
require 'amadeus/namespaces/analytics'
|
19
20
|
require 'amadeus/namespaces/airport/predictions'
|
20
21
|
require 'amadeus/namespaces/airport/predictions/on_time'
|
21
22
|
require 'amadeus/namespaces/e_reputation/hotel_sentiments'
|
@@ -32,6 +33,7 @@ require 'amadeus/namespaces/reference_data/locations/points_of_interest/by_squar
|
|
32
33
|
require 'amadeus/namespaces/safety/safety_rated_location'
|
33
34
|
require 'amadeus/namespaces/safety/safety_rated_locations'
|
34
35
|
require 'amadeus/namespaces/safety/safety_rated_locations/by_square'
|
36
|
+
require 'amadeus/namespaces/analytics/itinerary_price_metrics'
|
35
37
|
require 'amadeus/namespaces/shopping/flight_destinations'
|
36
38
|
require 'amadeus/namespaces/shopping/flight_offers_search'
|
37
39
|
require 'amadeus/namespaces/shopping/flight_offers_search/prediction'
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Amadeus
|
4
|
+
module Namespaces
|
5
|
+
# A namespaced client for the
|
6
|
+
# +/v1/analytics+ endpoints
|
7
|
+
#
|
8
|
+
# Access via the +Amadeus::Client+ object
|
9
|
+
#
|
10
|
+
# amadeus = Amadeus::Client.new
|
11
|
+
# amadeus.analytics
|
12
|
+
#
|
13
|
+
class Analytics < Amadeus::Client::Decorator
|
14
|
+
# The namespace for the Analytics-ItineraryPriceMetrics API:
|
15
|
+
#
|
16
|
+
# @return [Amadeus::Namespaces::Analytics::ItineraryPriceMetrics]
|
17
|
+
# @example
|
18
|
+
# amadeus.analytics.itinerary_price_metrics
|
19
|
+
#
|
20
|
+
def itinerary_price_metrics
|
21
|
+
Amadeus::Namespaces::Analytics::ItineraryPriceMetrics.new(client)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Amadeus
|
4
|
+
module Namespaces
|
5
|
+
class Analytics
|
6
|
+
# A namespaced client for the
|
7
|
+
# +/v1/analytics/itinerary-price-metrics+ endpoint
|
8
|
+
#
|
9
|
+
# Access via the +Amadeus::Client+ object
|
10
|
+
#
|
11
|
+
# amadeus = Amadeus::Client.new
|
12
|
+
# amadeus.analytics.itinerary_price_metrics
|
13
|
+
#
|
14
|
+
class ItineraryPriceMetrics < Amadeus::Client::Decorator
|
15
|
+
# Returns historical flight prices by date and route so you can see how current ticket
|
16
|
+
# prices stack up against the historical average
|
17
|
+
#
|
18
|
+
# @option params [String] :originIataCode IATA code of the airport to depart from
|
19
|
+
# @option params [String] :destinationIataCode IATA code of the airport to arrive at
|
20
|
+
# @option params [String] :departureDate date to depart on, formatted as YYYY-MM-DD
|
21
|
+
# @option params [String] :currencyCode the preferred currency (ISO 4217) - optional
|
22
|
+
# @option params [Boolean] :oneWay retrieve prices for one-way only - optional
|
23
|
+
# @return [Amadeus::Response] a parsed response
|
24
|
+
# @raise [Amadeus::Base] an exception if the call failed
|
25
|
+
# @example
|
26
|
+
# amadeus.analytics.itinerary_price_metrics.get(
|
27
|
+
# originIataCode: 'AMS',
|
28
|
+
# destinationIataCode: 'CDG',
|
29
|
+
# departureDate: '2021-06-18'
|
30
|
+
# )
|
31
|
+
#
|
32
|
+
def get(params = {})
|
33
|
+
client.get('/v1/analytics/itinerary-price-metrics', params)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -87,5 +87,15 @@ module Amadeus
|
|
87
87
|
def safety
|
88
88
|
Safety.new(self)
|
89
89
|
end
|
90
|
+
|
91
|
+
# The namespace for the Analytics related APIs:
|
92
|
+
#
|
93
|
+
# @return [Amadeus::Namespaces::Analytics]
|
94
|
+
# @example Some of the further namespaces available
|
95
|
+
# amadeus.analytics.itinerary_price_metrics
|
96
|
+
#
|
97
|
+
def analytics
|
98
|
+
Analytics.new(self)
|
99
|
+
end
|
90
100
|
end
|
91
101
|
end
|
data/lib/amadeus/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amadeus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amadeus
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2021-03-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: awesome_print
|
@@ -32,14 +32,14 @@ dependencies:
|
|
32
32
|
requirements:
|
33
33
|
- - "~>"
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 2.
|
35
|
+
version: 2.2.14
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 2.
|
42
|
+
version: 2.2.14
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: guard
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -227,6 +227,8 @@ files:
|
|
227
227
|
- lib/amadeus/namespaces/airport.rb
|
228
228
|
- lib/amadeus/namespaces/airport/predictions.rb
|
229
229
|
- lib/amadeus/namespaces/airport/predictions/on_time.rb
|
230
|
+
- lib/amadeus/namespaces/analytics.rb
|
231
|
+
- lib/amadeus/namespaces/analytics/itinerary_price_metrics.rb
|
230
232
|
- lib/amadeus/namespaces/booking.rb
|
231
233
|
- lib/amadeus/namespaces/booking/hotel_bookings.rb
|
232
234
|
- lib/amadeus/namespaces/core.rb
|