amadeus 0.1.0 → 1.0.0.beta1

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.
Files changed (48) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +10 -0
  3. data/LICENSE +15 -0
  4. data/README.md +157 -19
  5. data/amadeus.gemspec +26 -16
  6. data/lib/amadeus.rb +31 -4
  7. data/lib/amadeus/client.rb +120 -0
  8. data/lib/amadeus/client/access_token.rb +61 -0
  9. data/lib/amadeus/client/decorator.rb +27 -0
  10. data/lib/amadeus/client/errors.rb +76 -0
  11. data/lib/amadeus/client/http.rb +137 -0
  12. data/lib/amadeus/client/location.rb +13 -0
  13. data/lib/amadeus/client/pagination.rb +103 -0
  14. data/lib/amadeus/client/request.rb +145 -0
  15. data/lib/amadeus/client/request/hash.rb +32 -0
  16. data/lib/amadeus/client/response.rb +62 -0
  17. data/lib/amadeus/client/response/parser.rb +72 -0
  18. data/lib/amadeus/client/validator.rb +62 -0
  19. data/lib/amadeus/namespaces/core.rb +51 -0
  20. data/lib/amadeus/namespaces/reference_data.rb +41 -0
  21. data/lib/amadeus/namespaces/reference_data/location.rb +42 -0
  22. data/lib/amadeus/namespaces/reference_data/locations.rb +45 -0
  23. data/lib/amadeus/namespaces/reference_data/locations/airports.rb +38 -0
  24. data/lib/amadeus/namespaces/reference_data/urls.rb +27 -0
  25. data/lib/amadeus/namespaces/reference_data/urls/checkin_links.rb +33 -0
  26. data/lib/amadeus/namespaces/shopping.rb +66 -0
  27. data/lib/amadeus/namespaces/shopping/flight_dates.rb +33 -0
  28. data/lib/amadeus/namespaces/shopping/flight_destinations.rb +30 -0
  29. data/lib/amadeus/namespaces/shopping/flight_offers.rb +36 -0
  30. data/lib/amadeus/namespaces/shopping/hotel.rb +56 -0
  31. data/lib/amadeus/namespaces/shopping/hotel/hotel_offers.rb +44 -0
  32. data/lib/amadeus/namespaces/shopping/hotel/offer.rb +58 -0
  33. data/lib/amadeus/namespaces/shopping/hotel_offers.rb +37 -0
  34. data/lib/amadeus/namespaces/travel.rb +26 -0
  35. data/lib/amadeus/namespaces/travel/analytics.rb +37 -0
  36. data/lib/amadeus/namespaces/travel/analytics/air_traffics.rb +37 -0
  37. data/lib/amadeus/namespaces/travel/analytics/fare_searches.rb +46 -0
  38. data/lib/amadeus/version.rb +4 -1
  39. metadata +161 -23
  40. data/.gitignore +0 -12
  41. data/.rspec +0 -2
  42. data/.travis.yml +0 -5
  43. data/CODE_OF_CONDUCT.md +0 -74
  44. data/Gemfile +0 -4
  45. data/LICENSE.txt +0 -21
  46. data/Rakefile +0 -6
  47. data/bin/console +0 -14
  48. data/bin/setup +0 -8
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Amadeus
4
+ module Namespaces
5
+ class Travel
6
+ # A namespaced client for the
7
+ # +/v1/travel/analytics+ endpoints
8
+ #
9
+ # Access via the +Amadeus::Client+ object
10
+ #
11
+ # amadeus = Amadeus::Client.new
12
+ # amadeus.travel.analytics
13
+ #
14
+ class Analytics < Amadeus::Client::Decorator
15
+ # The namespace for the AirTraffics API:
16
+ #
17
+ # @return [Amadeus::Namespaces::Travel::Analytics::AirTraffics]
18
+ # @example
19
+ # amadeus.travel.analytics.air_traffics
20
+ #
21
+ def air_traffics
22
+ Amadeus::Namespaces::Travel::Analytics::AirTraffics.new(client)
23
+ end
24
+
25
+ # The namespace for the FareSearches API:
26
+ #
27
+ # @return [Amadeus::Namespaces::Travel::Analytics::FareSearches]
28
+ # @example
29
+ # amadeus.travel.analytics.fare_searches
30
+ #
31
+ def fare_searches
32
+ Amadeus::Namespaces::Travel::Analytics::FareSearches.new(client)
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Amadeus
4
+ module Namespaces
5
+ class Travel
6
+ class Analytics
7
+ # A namespaced client for the
8
+ # +/v1/travel/analytics/air-traffics+ endpoints
9
+ #
10
+ # Access via the +Amadeus::Client+ object
11
+ #
12
+ # amadeus = Amadeus::Client.new
13
+ # amadeus.travel.analytics.air_traffics
14
+ #
15
+ class AirTraffics < Amadeus::Client::Decorator
16
+ # Returns a list of air traffic reports.
17
+ #
18
+ # @option params [String] :origin IATA code of the origin city -
19
+ # e.g. BOS for Boston - required
20
+ # @option params [String] :query period when consumers are travelling
21
+ # in YYYY-MM format
22
+ # @return [Amadeus::Response] a parsed response
23
+ # @raise [Amadeus::Base] an exception if the call failed
24
+ # @example Find the air traffic from LHR in January 2011
25
+ # amadeus.travel.analytics.air_traffics.get(
26
+ # origin: 'LHR',
27
+ # period: '2011-01'
28
+ # )
29
+ #
30
+ def get(params = {})
31
+ client.get('/v1/travel/analytics/air-traffics', params)
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Amadeus
4
+ module Namespaces
5
+ class Travel
6
+ class Analytics
7
+ # A namespaced client for the
8
+ # +/v1/travel/analytics/fare-searches+ endpoints
9
+ #
10
+ # Access via the +Amadeus::Client+ object
11
+ #
12
+ # amadeus = Amadeus::Client.new
13
+ # amadeus.travel.analytics.fare_searches
14
+ #
15
+ class FareSearches < Amadeus::Client::Decorator
16
+ # The Fare Search History API allows to find the number of
17
+ # estimated searches from an origin, optionally a destination,
18
+ # within a time period when travelers are performing the searches.
19
+ #
20
+ # @option params [String] :origin IATA code of the origin city
21
+ # e.g. BOS for Boston - required
22
+ # @option params [String] :sourceCountry IATA code of the
23
+ # country from which fare searches were made - e.g. US for
24
+ # United States
25
+ # @option params [String] :period period of search; can be a year
26
+ # or a month or a week. ISO format must be used - e.g. 2015
27
+ # for year; 2015-05 for month and 2015-W04 for week. Period
28
+ # ranges are not supported. Only periods from year 2011-01 up
29
+ # to current year and previous month or week are valid. Future
30
+ # dates are not supported.
31
+ # @return [Amadeus::Response] a parsed response
32
+ # @raise [Amadeus::Base] an exception if the call failed
33
+ # @example Find the fare searches for LHR, made from France in 2011
34
+ # amadeus.travel.analytics.fare_searches.get(
35
+ # origin: 'LHR',
36
+ # sourceCountry: 'FR'
37
+ # period: '2011'
38
+ # )
39
+ def get(params = {})
40
+ client.get('/v1/travel/analytics/fare-searches', params)
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -1,3 +1,6 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Amadeus
2
- VERSION = "0.1.0"
4
+ # The current client version
5
+ VERSION = '1.0.0.beta1'.freeze
3
6
  end
metadata CHANGED
@@ -1,78 +1,216 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amadeus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
+ - Amadeus
7
8
  - Cristiano Betta
8
9
  autorequire:
9
10
  bindir: exe
10
11
  cert_chain: []
11
- date: 2017-07-07 00:00:00.000000000 Z
12
+ date: 2018-03-23 00:00:00.000000000 Z
12
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: awesome_print
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: 1.8.0
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: 1.8.0
13
28
  - !ruby/object:Gem::Dependency
14
29
  name: bundler
15
30
  requirement: !ruby/object:Gem::Requirement
16
31
  requirements:
17
32
  - - "~>"
18
33
  - !ruby/object:Gem::Version
19
- version: '1.15'
34
+ version: '1.16'
20
35
  type: :development
21
36
  prerelease: false
22
37
  version_requirements: !ruby/object:Gem::Requirement
23
38
  requirements:
24
39
  - - "~>"
25
40
  - !ruby/object:Gem::Version
26
- version: '1.15'
41
+ version: '1.16'
42
+ - !ruby/object:Gem::Dependency
43
+ name: guard
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: 2.14.1
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: 2.14.1
56
+ - !ruby/object:Gem::Dependency
57
+ name: guard-rake
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: 1.0.0
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: 1.0.0
70
+ - !ruby/object:Gem::Dependency
71
+ name: guard-yard
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: 2.2.0
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: 2.2.0
27
84
  - !ruby/object:Gem::Dependency
28
85
  name: rake
29
86
  requirement: !ruby/object:Gem::Requirement
30
87
  requirements:
31
88
  - - "~>"
32
89
  - !ruby/object:Gem::Version
33
- version: '10.0'
90
+ version: '12.3'
34
91
  type: :development
35
92
  prerelease: false
36
93
  version_requirements: !ruby/object:Gem::Requirement
37
94
  requirements:
38
95
  - - "~>"
39
96
  - !ruby/object:Gem::Version
40
- version: '10.0'
97
+ version: '12.3'
41
98
  - !ruby/object:Gem::Dependency
42
99
  name: rspec
43
100
  requirement: !ruby/object:Gem::Requirement
44
101
  requirements:
45
102
  - - "~>"
46
103
  - !ruby/object:Gem::Version
47
- version: '3.0'
104
+ version: '3.7'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '3.7'
112
+ - !ruby/object:Gem::Dependency
113
+ name: rubocop
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: 0.52.1
48
119
  type: :development
49
120
  prerelease: false
50
121
  version_requirements: !ruby/object:Gem::Requirement
51
122
  requirements:
52
123
  - - "~>"
53
124
  - !ruby/object:Gem::Version
54
- version: '3.0'
55
- description: Placeholder gem for Amadeus API
125
+ version: 0.52.1
126
+ - !ruby/object:Gem::Dependency
127
+ name: simplecov
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - "~>"
131
+ - !ruby/object:Gem::Version
132
+ version: 0.15.1
133
+ type: :development
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - "~>"
138
+ - !ruby/object:Gem::Version
139
+ version: 0.15.1
140
+ - !ruby/object:Gem::Dependency
141
+ name: vcr
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - "~>"
145
+ - !ruby/object:Gem::Version
146
+ version: 4.0.0
147
+ type: :development
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - "~>"
152
+ - !ruby/object:Gem::Version
153
+ version: 4.0.0
154
+ - !ruby/object:Gem::Dependency
155
+ name: webmock
156
+ requirement: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - "~>"
159
+ - !ruby/object:Gem::Version
160
+ version: 3.3.0
161
+ type: :development
162
+ prerelease: false
163
+ version_requirements: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - "~>"
166
+ - !ruby/object:Gem::Version
167
+ version: 3.3.0
168
+ description: Ruby library for the Amadeus travel APIs
56
169
  email:
170
+ - developer@amadeus.com
57
171
  - cristiano@betta.io
58
172
  executables: []
59
173
  extensions: []
60
174
  extra_rdoc_files: []
61
175
  files:
62
- - ".gitignore"
63
- - ".rspec"
64
- - ".travis.yml"
65
- - CODE_OF_CONDUCT.md
66
- - Gemfile
67
- - LICENSE.txt
176
+ - CHANGELOG.md
177
+ - LICENSE
68
178
  - README.md
69
- - Rakefile
70
179
  - amadeus.gemspec
71
- - bin/console
72
- - bin/setup
73
180
  - lib/amadeus.rb
181
+ - lib/amadeus/client.rb
182
+ - lib/amadeus/client/access_token.rb
183
+ - lib/amadeus/client/decorator.rb
184
+ - lib/amadeus/client/errors.rb
185
+ - lib/amadeus/client/http.rb
186
+ - lib/amadeus/client/location.rb
187
+ - lib/amadeus/client/pagination.rb
188
+ - lib/amadeus/client/request.rb
189
+ - lib/amadeus/client/request/hash.rb
190
+ - lib/amadeus/client/response.rb
191
+ - lib/amadeus/client/response/parser.rb
192
+ - lib/amadeus/client/validator.rb
193
+ - lib/amadeus/namespaces/core.rb
194
+ - lib/amadeus/namespaces/reference_data.rb
195
+ - lib/amadeus/namespaces/reference_data/location.rb
196
+ - lib/amadeus/namespaces/reference_data/locations.rb
197
+ - lib/amadeus/namespaces/reference_data/locations/airports.rb
198
+ - lib/amadeus/namespaces/reference_data/urls.rb
199
+ - lib/amadeus/namespaces/reference_data/urls/checkin_links.rb
200
+ - lib/amadeus/namespaces/shopping.rb
201
+ - lib/amadeus/namespaces/shopping/flight_dates.rb
202
+ - lib/amadeus/namespaces/shopping/flight_destinations.rb
203
+ - lib/amadeus/namespaces/shopping/flight_offers.rb
204
+ - lib/amadeus/namespaces/shopping/hotel.rb
205
+ - lib/amadeus/namespaces/shopping/hotel/hotel_offers.rb
206
+ - lib/amadeus/namespaces/shopping/hotel/offer.rb
207
+ - lib/amadeus/namespaces/shopping/hotel_offers.rb
208
+ - lib/amadeus/namespaces/travel.rb
209
+ - lib/amadeus/namespaces/travel/analytics.rb
210
+ - lib/amadeus/namespaces/travel/analytics/air_traffics.rb
211
+ - lib/amadeus/namespaces/travel/analytics/fare_searches.rb
74
212
  - lib/amadeus/version.rb
75
- homepage: https://github.com/cbetta/amadeus
213
+ homepage: https://github.com/amadeusdev/amadeus-ruby
76
214
  licenses:
77
215
  - MIT
78
216
  metadata: {}
@@ -87,13 +225,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
87
225
  version: '0'
88
226
  required_rubygems_version: !ruby/object:Gem::Requirement
89
227
  requirements:
90
- - - ">="
228
+ - - ">"
91
229
  - !ruby/object:Gem::Version
92
- version: '0'
230
+ version: 1.3.1
93
231
  requirements: []
94
232
  rubyforge_project:
95
- rubygems_version: 2.6.11
233
+ rubygems_version: 2.7.6
96
234
  signing_key:
97
235
  specification_version: 4
98
- summary: Placeholder gem for Amadeus API
236
+ summary: Ruby library for the Amadeus travel APIs
99
237
  test_files: []
data/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
-
11
- # rspec failure tracking
12
- .rspec_status
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --format documentation
2
- --color
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.4.1
5
- before_install: gem install bundler -v 1.15.1
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at cristiano@betta.io. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/