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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d85348bf45e54be187cc91e512d1958c1a1162ae22d1bdeb3d7171ac78f4272
4
- data.tar.gz: 06020e4f010c2512ac639e44fcdf36cfbd0492cf6cba07111a6ddb2167b9035d
3
+ metadata.gz: 1b5f631649abaae86acd4e45d35507a0863bcc1f60766d81f2264307c4e10a1a
4
+ data.tar.gz: c93ab739e245d2ab52ee50e5e2cde0700a7d2ac6a809cbcead2918f9c22987cf
5
5
  SHA512:
6
- metadata.gz: 6f775996bc4b672820ac34c79296fca9a8b586a007c067af46335d9f3d9793cff5597c26845171cce8cf81dfc63a836f5a9951f9c18c6864a6d733270764ae10
7
- data.tar.gz: 0bfa4b4bdc56a8e19b052e95587c96026d9eeda00211e932e2e40bf133c689059432cdb91430721bdbe732742a481f6b924decfe552259b8e1795efa3c0543be
6
+ metadata.gz: 1756d0de031d1c00f217d6483fa319810669850b500b95ee4a734255c59dca1368da89d02dc0b4fb74f8c4cb5183ca9ef43607696be2547cb73f8ae10e752918
7
+ data.tar.gz: 6d17996db303020e08566b6f38ba3b5e82005a616651a3688f39395b8e5779cc30778214de5b49f3b94592cc3512912fa902f3e1dbdf15780c4434ec22c05de4
data/CHANGELOG.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # Changelog
2
+ ## 5.2.0 - 2021-03-20
3
+
4
+ Add support for Flight Price Analysis. Thanks [@developius](https://github.com/developius) for the contribution.
2
5
  ## 5.1.0 - 2020-11-26
3
6
 
4
7
  Add support for Safe Place API.
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.4+. You can install it directly or via bundler.
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.reference_data.urls.checkin_links.get({ airlineCode: 'BA' })
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: '2020-10-01', adults: 1)
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: '2020-10-01', adults: 1, max: 1).body
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: '2020-08-01', departureTim: '18:20:00', arrivalDat: '2020-08-01', arrivalTim: '22:15:00', aircraftCod: '321', carrierCod: 'TK', flightNumber: '1816', duration: 'PT31H10M')
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.1.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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Amadeus
4
4
  # The current client version
5
- VERSION = '5.1.0'
5
+ VERSION = '5.2.0'
6
6
  end
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.1.0
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: 2020-11-26 00:00:00.000000000 Z
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.1.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.1.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