amadeus 1.0.0 → 1.1.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: 116bbcff741bb5fab5803f00b10308532d62a2f4b14b68f46907fac8a8da2c28
4
- data.tar.gz: deb8b9c78e5b04d33416ff206f69aeb7fe7864d021672cfd6a4568d8c4ec99a8
3
+ metadata.gz: 77b263da6fa9f3a99fca139c2bd0857dc81ffbde4e80901e18becd1a2f109e77
4
+ data.tar.gz: cf75057bd42b724f96ff1aeae897965cc9cae19f609f717835986669c595e137
5
5
  SHA512:
6
- metadata.gz: f2079ed0e6473ec1f8e1084bd8c6b1d6e7d27a13a201f92a99ec0daf8cd5396db55400f377d8a4a5a05ef4921eb5412f6eb8a0c299c6384bf543e4c5b4860fa4
7
- data.tar.gz: bced7a7488c3048c5f181155dd3e57a5bfe1c6903be9694d4479d5c8c2efec3719ee905d00b00051bae3f94dd5232a2adcea2bede43869a16b90d8f053154113
6
+ metadata.gz: c30c255a1508a6143d1b857d0149a86e63060117a62a4112acc28087be932f1ec4e86977490ae01cb63d1bb96f9eb5abe8a0d3f0ac0cc674c991042424f262f7
7
+ data.tar.gz: 8b79e44597f7e3b822a1d2d316ad997fceff08f6e42b89ec0401a52eca203cf6402a8dd6becfeeab88060026f314ad55a3316b36c18fe7b22251af52d16e3eb0
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.0 - 2018-04-19
4
+
5
+ The first stable version of the Amadeus for Developers ruby SDK
6
+
7
+ ## 1.0.0.beta7 - 2018-04-19
8
+
9
+ Fix the Flight Most Traveled Destinations endpoint (air_traffic/traveled)
10
+
3
11
  ## 1.0.0.beta6 - 2018-04-05
4
12
 
5
13
  Adds easier to read error messages
data/README.md CHANGED
@@ -26,7 +26,7 @@ gem 'amadeus'
26
26
 
27
27
  ## Getting Started
28
28
 
29
- To send make your first API call you will need to [register for an Amadeus
29
+ To make your first API call you will need to [register for an Amadeus
30
30
  Developer Account](https://developers.amadeus.com/create-account) and set up
31
31
  your first application.
32
32
 
@@ -185,7 +185,10 @@ amadeus.shopping.flight_destinations.get(origin: 'MAD')
185
185
  amadeus.shopping.flight_offers.get(origin: 'MAD', destination: 'OPO', departureDate: '2018-07-08')
186
186
 
187
187
  # Flight Check-in Links
188
- amadeus.reference_data.urls.checkin_links.get({ airline: '1X' })
188
+ amadeus.reference_data.urls.checkin_links.get({ airline: 'BA' })
189
+
190
+ # Airline Code Lookup
191
+ amadeus.reference_data.airlines.get({ IATAcode: 'U2' })
189
192
 
190
193
  # Airport & City Search (autocomplete)
191
194
  # Find all the cities and airports starting by the keyword 'Lon'
@@ -203,7 +206,17 @@ amadeus.reference_data.locations.airports.get(longitude: 49.0000, latitude: 2.55
203
206
  amadeus.travel.analytics.fare_searches.get(origin: 'NCE', sourceCountry: 'FR', period: '2017-08')
204
207
 
205
208
  # Flight Most Traveled Destinations
206
- ramadeus.travel.analytics.air_traffic.traveled.get(origin: 'NCE', period: '2017-08')
209
+ amadeus.travel.analytics.air_traffic.traveled.get(origin: 'NCE', period: '2017-08')
210
+
211
+ # Flight Most Booked Destinations
212
+ amadeus.travel.analytics.air_traffic.booked.get(origin: 'NCE', period: '2017-08')
213
+
214
+ # Flight Busiest Period
215
+ amadeus.travel.analytics.air_traffic.busiest_period.get(
216
+ city: 'NCE',
217
+ period: '2017',
218
+ direction = Amadeus::Direction::ARRIVING
219
+ )
207
220
 
208
221
  # Hotel Search API
209
222
  # Get list of hotels by cityCode
@@ -1,4 +1,3 @@
1
-
2
1
  lib = File.expand_path('lib', __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'amadeus/version'
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'amadeus/version'
4
4
  require 'amadeus/client/location'
5
+ require 'amadeus/client/direction'
5
6
  require 'amadeus/client/response'
6
7
  require 'amadeus/client/decorator'
7
8
  require 'amadeus/client/access_token'
@@ -11,6 +12,7 @@ require 'amadeus/client'
11
12
  require 'amadeus/namespaces/travel'
12
13
  require 'amadeus/namespaces/shopping'
13
14
  require 'amadeus/namespaces/reference_data'
15
+ require 'amadeus/namespaces/reference_data/airlines'
14
16
  require 'amadeus/namespaces/reference_data/urls'
15
17
  require 'amadeus/namespaces/reference_data/urls/checkin_links'
16
18
  require 'amadeus/namespaces/reference_data/location'
@@ -27,6 +29,8 @@ require 'amadeus/namespaces/travel/analytics'
27
29
  require 'amadeus/namespaces/travel/analytics/fare_searches'
28
30
  require 'amadeus/namespaces/travel/analytics/air_traffic'
29
31
  require 'amadeus/namespaces/travel/analytics/air_traffic/traveled'
32
+ require 'amadeus/namespaces/travel/analytics/air_traffic/booked'
33
+ require 'amadeus/namespaces/travel/analytics/air_traffic/busiest_period'
30
34
 
31
35
  # The namespace for the files used to make API
32
36
  # calls to the Amadeus travel APIs
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Amadeus
4
+ # A list of directions, as used in Busiest Travel Period
5
+ module Direction
6
+ # Airport
7
+ ARRIVING = 'ARRIVING'.freeze
8
+ # City
9
+ DEPARTING = 'DEPARTING'.freeze
10
+ end
11
+ end
@@ -42,6 +42,17 @@ module Amadeus
42
42
  def location(location_id)
43
43
  Amadeus::Namespaces::ReferenceData::Location.new(client, location_id)
44
44
  end
45
+
46
+ # The namespace for the Airline Code APIs - accessing a specific airline
47
+ #
48
+ # @param [Number] airline_id The IATA ID for the airline
49
+ # @return [Amadeus::Namespaces::ReferenceData::Airlines]
50
+ # @example
51
+ # amadeus.reference_data.airlines('U2')
52
+ #
53
+ def airlines
54
+ Amadeus::Namespaces::ReferenceData::Airlines.new(client)
55
+ end
45
56
  end
46
57
  end
47
58
  end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Amadeus
4
+ module Namespaces
5
+ class ReferenceData
6
+ # A namespaced client for the
7
+ # +/v1/reference-data/airlines+ endpoints
8
+ #
9
+ # Access via the +Amadeus::Client+ object
10
+ #
11
+ # amadeus = Amadeus::Client.new
12
+ # amadeus.reference_data.airlines
13
+ #
14
+ class Airlines < Amadeus::Client::Decorator
15
+ # Returns the airline name for a given IATA code
16
+ # @option params [String] :airline airline ID - required
17
+ # @option params [String] :language (en-GB) the locale for the links
18
+ # @return [Amadeus::Response] a parsed response
19
+ # @raise [Amadeus::Base] an exception if the call failed
20
+ # @example what is the name of airline code 'U2'
21
+ # amadeus.reference_data.airlines.get(IATACode: 'U2')
22
+ #
23
+ def get(params = {})
24
+ client.get('/v1/reference-data/airlines', params)
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -21,7 +21,7 @@ module Amadeus
21
21
  # @return [Amadeus::Response] a parsed response
22
22
  # @raise [Amadeus::Base] an exception if the call failed
23
23
  # @example Find a the checkin links for Branson AirExpress
24
- # amadeus.reference_data.urls.checkin_links.get(airline: '1X')
24
+ # amadeus.reference_data.urls.checkin_links.get(airline: 'BA')
25
25
  #
26
26
  def get(params = {})
27
27
  client.get('/v2/reference-data/urls/checkin-links', params)
@@ -19,12 +19,34 @@ module Amadeus
19
19
  # [Amadeus::Namespaces::Travel::Analytics::AirTraffic::Traveled]
20
20
  # @example
21
21
  # amadeus.travel.analytics.air_traffic.traveled
22
- #
23
22
  def traveled
24
23
  Amadeus::Namespaces::Travel::Analytics::AirTraffic::Traveled.new(
25
24
  client
26
25
  )
27
26
  end
27
+
28
+ # The namespace for the Booked API:
29
+ #
30
+ # @return
31
+ # [Amadeus::Namespaces::Travel::Analytics::AirTraffic::Booked]
32
+ # @example
33
+ # amadeus.travel.analytics.air_traffic.booked
34
+ def booked
35
+ Amadeus::Namespaces::Travel::Analytics::AirTraffic::Booked.new(
36
+ client
37
+ )
38
+ end
39
+
40
+ # The namespace for the Busiest Period API:
41
+ #
42
+ # @return
43
+ # [Amadeus::Namespaces::Travel::Analytics::AirTraffic::BusiestPeriod]
44
+ # @example
45
+ # amadeus.travel.analytics.air_traffic.busiest_period
46
+ def busiest_period
47
+ Amadeus::Namespaces::Travel::Analytics::AirTraffic::BusiestPeriod
48
+ .new(client)
49
+ end
28
50
  end
29
51
  end
30
52
  end
@@ -0,0 +1,40 @@
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/booked+ endpoints
10
+ #
11
+ # Access via the +Amadeus::Client+ object
12
+ #
13
+ # amadeus = Amadeus::Client.new
14
+ # amadeus.travel.analytics.air_traffic.booked
15
+ #
16
+ class Booked < Amadeus::Client::Decorator
17
+ # Returns a list of air traffic reports, based on bookings.
18
+ #
19
+ # @option params [String] :origin IATA code of the origin city -
20
+ # e.g. BOS for Boston - required
21
+ # @option params [String] :query period when consumers
22
+ # are travelling
23
+ # in YYYY-MM format
24
+ # @return [Amadeus::Response] a parsed response
25
+ # @raise [Amadeus::Base] an exception if the call failed
26
+ # @example Find the air traffic from LHR in January 2011
27
+ # amadeus.travel.analytics.air_traffic.booked.get(
28
+ # origin: 'LHR',
29
+ # period: '2017-03'
30
+ # )
31
+ #
32
+ def get(params = {})
33
+ client.get('/v1/travel/analytics/air-traffic/booked', params)
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,44 @@
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/busiest-period+ endpoints
10
+ #
11
+ # Access via the +Amadeus::Client+ object
12
+ #
13
+ # amadeus = Amadeus::Client.new
14
+ # amadeus.travel.analytics.air_traffic.busiest_period
15
+ #
16
+ class BusiestPeriod < Amadeus::Client::Decorator
17
+ # Returns the months of the selected year, ordered from busiest
18
+ # to least busy.
19
+ #
20
+ # @option params [String] :city IATA code of the origin city -
21
+ # e.g. BOS for Boston - required
22
+ # @option params [String] :period period when consumers
23
+ # are travelling in YYYY format
24
+ # @option params [String] :direction to select between
25
+ # arrivals and departures (default: arrivals)
26
+ # @return [Amadeus::Response] a parsed response
27
+ # @raise [Amadeus::Base] an exception if the call failed
28
+ # @example What was the busiest travel period in 2017
29
+ # amadeus.travel.analytics.air_traffic.busiest_period.get(
30
+ # city: 'MAD',
31
+ # period: '2017',
32
+ # direction: Amadeus::Direction::ARRIVING
33
+ # )
34
+ #
35
+ def get(params = {})
36
+ client.get('/v1/travel/analytics/air-traffic/busiest-period',
37
+ params)
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Amadeus
4
4
  # The current client version
5
- VERSION = '1.0.0'.freeze
5
+ VERSION = '1.1.0'.freeze
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: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amadeus
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-04-20 00:00:00.000000000 Z
12
+ date: 2018-08-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: awesome_print
@@ -197,6 +197,7 @@ files:
197
197
  - lib/amadeus/client.rb
198
198
  - lib/amadeus/client/access_token.rb
199
199
  - lib/amadeus/client/decorator.rb
200
+ - lib/amadeus/client/direction.rb
200
201
  - lib/amadeus/client/errors.rb
201
202
  - lib/amadeus/client/http.rb
202
203
  - lib/amadeus/client/location.rb
@@ -208,6 +209,7 @@ files:
208
209
  - lib/amadeus/client/validator.rb
209
210
  - lib/amadeus/namespaces/core.rb
210
211
  - lib/amadeus/namespaces/reference_data.rb
212
+ - lib/amadeus/namespaces/reference_data/airlines.rb
211
213
  - lib/amadeus/namespaces/reference_data/location.rb
212
214
  - lib/amadeus/namespaces/reference_data/locations.rb
213
215
  - lib/amadeus/namespaces/reference_data/locations/airports.rb
@@ -224,6 +226,8 @@ files:
224
226
  - lib/amadeus/namespaces/travel.rb
225
227
  - lib/amadeus/namespaces/travel/analytics.rb
226
228
  - lib/amadeus/namespaces/travel/analytics/air_traffic.rb
229
+ - lib/amadeus/namespaces/travel/analytics/air_traffic/booked.rb
230
+ - lib/amadeus/namespaces/travel/analytics/air_traffic/busiest_period.rb
227
231
  - lib/amadeus/namespaces/travel/analytics/air_traffic/traveled.rb
228
232
  - lib/amadeus/namespaces/travel/analytics/fare_searches.rb
229
233
  - lib/amadeus/version.rb
@@ -247,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
247
251
  version: '0'
248
252
  requirements: []
249
253
  rubyforge_project:
250
- rubygems_version: 2.7.6
254
+ rubygems_version: 2.7.7
251
255
  signing_key:
252
256
  specification_version: 4
253
257
  summary: Amadeus travel APIs