amadeus 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -1
- data/README.md +15 -15
- data/amadeus.gemspec +1 -1
- data/lib/amadeus.rb +2 -3
- data/lib/amadeus/namespaces/reference_data.rb +0 -1
- data/lib/amadeus/namespaces/shopping.rb +16 -6
- data/lib/amadeus/namespaces/shopping/hotel_offer.rb +42 -0
- data/lib/amadeus/namespaces/shopping/hotel_offers.rb +3 -3
- data/lib/amadeus/namespaces/shopping/hotel_offers_by_hotel.rb +31 -0
- data/lib/amadeus/namespaces/travel/analytics/air_traffic/searched_by_destination.rb +6 -6
- data/lib/amadeus/version.rb +1 -1
- metadata +7 -9
- data/lib/amadeus/namespaces/shopping/hotel.rb +0 -56
- data/lib/amadeus/namespaces/shopping/hotel/hotel_offers.rb +0 -44
- data/lib/amadeus/namespaces/shopping/hotel/offer.rb +0 -51
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffd090d42d800bbfae01e30b095e6907ee66922875eb38e81e83d0dfcf93688c
|
4
|
+
data.tar.gz: 1d34a30f43448bae789456f43fb2e96ce89abd63561b7318aec8086dc3b9bf0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3005646311109b6551347efd3ebe559d6f091e9210a84d77666f898e1a12e3f4f7c5166b2d49ddc9af8c67c859c1d7ae45b156656b917d3fe081ee339de81cc9
|
7
|
+
data.tar.gz: 65046569d983b9a988de5fee812b5a38e85311963161f9b9e94841b8f9cb98e524cb2c7e2e162b8f64dd27fdc085213d2a3d65a54ae93f872d40fd4f73082d6a
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,20 @@
|
|
1
1
|
# Changelog
|
2
|
+
## 3.0.0 - 2019-01-22
|
3
|
+
|
4
|
+
## Hotel Search v2 has been deployed (Hotel Search v1 is now deprecated)
|
5
|
+
|
6
|
+
### General
|
7
|
+
* URLs for all three endpoints have been simplified for ease-of-use and consistency
|
8
|
+
### Find Hotels - 1st endpoint
|
9
|
+
* The parameter `hotels` has been renamed to `hotelIds`
|
10
|
+
### View Hotel Rooms - 2nd endpoint
|
11
|
+
* Update from `amadeus.shopping.hotel('IALONCHO').hotel_offers.get` to `amadeus.shopping.hotel_offers_by_hotel.get(hotelId: 'IALONCHO')`
|
12
|
+
* Now get all images in ‘View Hotels Rooms’ endpoint using the view parameter as `FULL_ALL_IMAGES`
|
13
|
+
### View Room Details - 3rd endpoint
|
14
|
+
* Updated from `amadeus.shopping.hotel('IALONCHO').offer('XXX').get` to `amadeus.shopping.hotel_offer('XXX').get`
|
15
|
+
* Image category added under Media in the response
|
16
|
+
* Hotel distance added in the response
|
17
|
+
* Response now refers to the common HotelOffer object model
|
2
18
|
|
3
19
|
## 2.0.0 - 2018-10-12
|
4
20
|
|
@@ -6,7 +22,7 @@
|
|
6
22
|
* 1st endpoint to find the most searched destinations
|
7
23
|
* 2nd endpoint to have more data about a dedicated origin & destination
|
8
24
|
|
9
|
-
[Flight Most Booked Destinations](https://developers.amadeus.com/self-service/category/203/api-doc/
|
25
|
+
[Flight Most Booked Destinations](https://developers.amadeus.com/self-service/category/203/api-doc/27):
|
10
26
|
* Rename origin to originCityCode
|
11
27
|
|
12
28
|
[Flight Most Traveled Destinations](https://developers.amadeus.com/self-service/category/203/api-doc/7):
|
data/README.md
CHANGED
@@ -14,7 +14,7 @@ documentation](https://amadeus4dev.github.io/amadeus-ruby/) on
|
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
17
|
-
This gem requires Ruby 2.
|
17
|
+
This gem requires Ruby 2.3+. You can install install it directly or via bundler.
|
18
18
|
#### Command line
|
19
19
|
```bash
|
20
20
|
gem install amadeus
|
@@ -39,7 +39,7 @@ amadeus = Amadeus::Client.new({
|
|
39
39
|
})
|
40
40
|
|
41
41
|
begin
|
42
|
-
puts amadeus.reference_data.urls.checkin_links.get({
|
42
|
+
puts amadeus.reference_data.urls.checkin_links.get({ airlineCode: 'BA' })
|
43
43
|
rescue Amadeus::ResponseError => error
|
44
44
|
puts error
|
45
45
|
end
|
@@ -90,24 +90,24 @@ in-depth information about every SDK method, its arguments and return types.
|
|
90
90
|
|
91
91
|
This library conveniently maps every API path to a similar path.
|
92
92
|
|
93
|
-
For example, `GET /v2/reference-data/urls/checkin-links?
|
93
|
+
For example, `GET /v2/reference-data/urls/checkin-links?airlineCode=BA` would be:
|
94
94
|
|
95
95
|
```rb
|
96
|
-
amadeus.reference_data.urls.checkin_links.get(
|
96
|
+
amadeus.reference_data.urls.checkin_links.get(airlineCode: 'BA')
|
97
97
|
```
|
98
98
|
|
99
99
|
Similarly, to select a resource by ID, you can pass in the ID to the **singular** path.
|
100
100
|
|
101
|
-
For example, `GET /
|
101
|
+
For example, `GET /v2/shopping/hotel-offers/XZY` would be:
|
102
102
|
|
103
103
|
```rb
|
104
|
-
amadeus.
|
104
|
+
amadeus.shopping.hotel_offer('D5BEE9D0D08B6678C2F5FAD910DC110BCDA187D21D4FCE68ED423426D0A246BB').get
|
105
105
|
```
|
106
106
|
|
107
107
|
You can make any arbitrary API call as well directly with the `.get` method:
|
108
108
|
|
109
109
|
```rb
|
110
|
-
amadeus.get('/v2/reference-data/urls/checkin-links',
|
110
|
+
amadeus.get('/v2/reference-data/urls/checkin-links', airlineCode: 'BA')
|
111
111
|
```
|
112
112
|
|
113
113
|
## Response
|
@@ -184,10 +184,10 @@ amadeus.shopping.flight_dates.get(origin: 'NYC', destination: 'MAD')
|
|
184
184
|
amadeus.shopping.flight_offers.get(origin: 'NYC', destination: 'MAD', departureDate: '2019-08-01')
|
185
185
|
|
186
186
|
# Flight Check-in Links
|
187
|
-
amadeus.reference_data.urls.checkin_links.get(
|
187
|
+
amadeus.reference_data.urls.checkin_links.get(airlineCode: 'BA')
|
188
188
|
|
189
189
|
# Airline Code Lookup
|
190
|
-
amadeus.reference_data.airlines.get(
|
190
|
+
amadeus.reference_data.airlines.get(airlineCodes: 'U2')
|
191
191
|
|
192
192
|
# Airport & City Search (autocomplete)
|
193
193
|
# Find all the cities and airports starting by the keyword 'LON'
|
@@ -198,8 +198,8 @@ amadeus.reference_data.locations.get(
|
|
198
198
|
# Get a specific city or airport based on its id
|
199
199
|
amadeus.reference_data.location('ALHR').get
|
200
200
|
|
201
|
-
# Airport Nearest Relevant
|
202
|
-
amadeus.reference_data.locations.airports.get(longitude:
|
201
|
+
# Airport Nearest Relevant (for London)
|
202
|
+
amadeus.reference_data.locations.airports.get(longitude: 0.1278, latitude: 51.5074)
|
203
203
|
|
204
204
|
# Flight Most Searched Destinations
|
205
205
|
# Get the most searched destinations from an origin
|
@@ -224,9 +224,9 @@ amadeus.travel.analytics.air_traffic.busiest_period.get(
|
|
224
224
|
# Get list of hotels by cityCode
|
225
225
|
amadeus.shopping.hotel_offers.get(cityCode: 'MAD')
|
226
226
|
# Get list of offers for a specific hotel
|
227
|
-
amadeus.shopping.
|
228
|
-
# Confirm the availability of a specific offer
|
229
|
-
amadeus.shopping.
|
227
|
+
amadeus.shopping.hotel_offers_by_hotel.get(hotelId: 'IALONCHO')
|
228
|
+
# Confirm the availability of a specific offer
|
229
|
+
amadeus.shopping.hotel_offer('D5BEE9D0D08B6678C2F5FAD910DC110BCDA187D21D4FCE68ED423426D0A246BB').get
|
230
230
|
```
|
231
231
|
## Development & Contributing
|
232
232
|
|
@@ -248,4 +248,4 @@ to help you. You can find us on
|
|
248
248
|
[gem]: https://rubygems.org/gems/amadeus
|
249
249
|
[travis]: http://travis-ci.org/amadeus4dev/amadeus-ruby
|
250
250
|
[support]: http://developers.amadeus.com/support
|
251
|
-
[codeclimate]: https://codeclimate.com/github/amadeus4dev/amadeus-ruby
|
251
|
+
[codeclimate]: https://codeclimate.com/github/amadeus4dev/amadeus-ruby
|
data/amadeus.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.required_ruby_version = '>= 2.2.0'
|
28
28
|
|
29
29
|
spec.add_development_dependency 'awesome_print', '~> 1.8'
|
30
|
-
spec.add_development_dependency 'bundler', '~> 1
|
30
|
+
spec.add_development_dependency 'bundler', '~> 2.0.1'
|
31
31
|
spec.add_development_dependency 'guard', '~> 2.14'
|
32
32
|
spec.add_development_dependency 'guard-rake', '~> 1.0'
|
33
33
|
spec.add_development_dependency 'guard-yard', '~> 2.2'
|
data/lib/amadeus.rb
CHANGED
@@ -22,9 +22,8 @@ require 'amadeus/namespaces/shopping/flight_destinations'
|
|
22
22
|
require 'amadeus/namespaces/shopping/flight_offers'
|
23
23
|
require 'amadeus/namespaces/shopping/flight_dates'
|
24
24
|
require 'amadeus/namespaces/shopping/hotel_offers'
|
25
|
-
require 'amadeus/namespaces/shopping/
|
26
|
-
require 'amadeus/namespaces/shopping/
|
27
|
-
require 'amadeus/namespaces/shopping/hotel/hotel_offers'
|
25
|
+
require 'amadeus/namespaces/shopping/hotel_offer'
|
26
|
+
require 'amadeus/namespaces/shopping/hotel_offers_by_hotel'
|
28
27
|
require 'amadeus/namespaces/travel/analytics'
|
29
28
|
require 'amadeus/namespaces/travel/analytics/air_traffic'
|
30
29
|
require 'amadeus/namespaces/travel/analytics/air_traffic/traveled'
|
@@ -45,7 +45,6 @@ module Amadeus
|
|
45
45
|
|
46
46
|
# The namespace for the Airline Code APIs - accessing a specific airline
|
47
47
|
#
|
48
|
-
# @param [Number] airline_id The IATA ID for the airline
|
49
48
|
# @return [Amadeus::Namespaces::ReferenceData::Airlines]
|
50
49
|
# @example
|
51
50
|
# amadeus.reference_data.airlines('U2')
|
@@ -51,15 +51,25 @@ module Amadeus
|
|
51
51
|
Amadeus::Namespaces::Shopping::HotelOffers.new(client)
|
52
52
|
end
|
53
53
|
|
54
|
-
# The namespace for the
|
54
|
+
# The namespace for the HotelOffersByHotel API:
|
55
55
|
#
|
56
|
-
# @
|
57
|
-
# @return [Amadeus::Namespaces::Shopping::Hotel]
|
56
|
+
# @return [Amadeus::Namespaces::Shopping::HotelOffersByHotel]
|
58
57
|
# @example
|
59
|
-
# amadeus.shopping.
|
58
|
+
# amadeus.shopping.hotel_offers_by_hotel
|
60
59
|
#
|
61
|
-
def
|
62
|
-
Amadeus::Namespaces::Shopping::
|
60
|
+
def hotel_offers_by_hotel
|
61
|
+
Amadeus::Namespaces::Shopping::HotelOffersByHotel.new(client)
|
62
|
+
end
|
63
|
+
|
64
|
+
# The namespace for the HotelOffers API:
|
65
|
+
#
|
66
|
+
# @param [Number] offer_id The ID for the offer for a specific hotel
|
67
|
+
# @return [Amadeus::Namespaces::Shopping::HotelOffer]
|
68
|
+
# @example
|
69
|
+
# amadeus.shopping.hotel_offer(offer_id)
|
70
|
+
#
|
71
|
+
def hotel_offer(offer_id)
|
72
|
+
Amadeus::Namespaces::Shopping::HotelOffer.new(client, offer_id)
|
63
73
|
end
|
64
74
|
end
|
65
75
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Amadeus
|
4
|
+
module Namespaces
|
5
|
+
class Shopping
|
6
|
+
# A namespaced client for the
|
7
|
+
# +/v2/shopping/hotel-offers/:offer_id+ endpoints
|
8
|
+
#
|
9
|
+
# Access via the +Amadeus::Client+ object
|
10
|
+
#
|
11
|
+
# amadeus = Amadeus::Client.new
|
12
|
+
# amadeus.shopping.hotel_offer('XXXX')
|
13
|
+
#
|
14
|
+
class HotelOffer < Amadeus::Client::Decorator
|
15
|
+
# the Offer ID
|
16
|
+
attr_reader :offer_id
|
17
|
+
|
18
|
+
# Initialize this namespaced client with an
|
19
|
+
# {Amadeus::Client} instance and an Offer ID
|
20
|
+
#
|
21
|
+
# @param [Amadeus::Client] client
|
22
|
+
# @param [Number] offer_id
|
23
|
+
#
|
24
|
+
def initialize(client, offer_id)
|
25
|
+
super(client)
|
26
|
+
@offer_id = offer_id
|
27
|
+
end
|
28
|
+
|
29
|
+
# Return all available details of a specific hotel offer
|
30
|
+
#
|
31
|
+
# @return [Amadeus::Response] a parsed response
|
32
|
+
# @raise [Amadeus::Base] an exception if the call failed
|
33
|
+
# @example
|
34
|
+
# amadeus.shopping.hotel_offer('XXXX').get
|
35
|
+
#
|
36
|
+
def get(params = {})
|
37
|
+
client.get("/v2/shopping/hotel-offers/#{@offer_id}", params)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -4,7 +4,7 @@ module Amadeus
|
|
4
4
|
module Namespaces
|
5
5
|
class Shopping
|
6
6
|
# A namespaced client for the
|
7
|
-
# +/
|
7
|
+
# +/v2/shopping/hotel-offers+ endpoints
|
8
8
|
#
|
9
9
|
# Access via the +Amadeus::Client+ object
|
10
10
|
#
|
@@ -19,7 +19,7 @@ module Amadeus
|
|
19
19
|
# search around. Example: 52.5238
|
20
20
|
# @option params [Double] :longitude Longitude of geographic location to
|
21
21
|
# search around. Example: 13.3835
|
22
|
-
# @option params [String] :
|
22
|
+
# @option params [String] :hotelIds Comma separated list of Amadeus hotel
|
23
23
|
# codes to request. Example: RTPAR001
|
24
24
|
# @return [Amadeus::Response] a parsed response
|
25
25
|
# @raise [Amadeus::Base] an exception if the call failed
|
@@ -29,7 +29,7 @@ module Amadeus
|
|
29
29
|
# )
|
30
30
|
#
|
31
31
|
def get(params = {})
|
32
|
-
client.get('/
|
32
|
+
client.get('/v2/shopping/hotel-offers', params)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Amadeus
|
4
|
+
module Namespaces
|
5
|
+
class Shopping
|
6
|
+
# A namespaced client for the
|
7
|
+
# +/v2/shopping/hotel-offers/by-hotel+ endpoints
|
8
|
+
#
|
9
|
+
# Access via the +Amadeus::Client+ object
|
10
|
+
#
|
11
|
+
# amadeus = Amadeus::Client.new
|
12
|
+
# amadeus.shopping.hotel_offers
|
13
|
+
#
|
14
|
+
class HotelOffersByHotel < Amadeus::Client::Decorator
|
15
|
+
# Get the different offers for a dedicated hotel
|
16
|
+
#
|
17
|
+
# @option params [String] :hotelId Amadeus Property Code (8 chars)
|
18
|
+
# @return [Amadeus::Response] a parsed response
|
19
|
+
# @raise [Amadeus::Base] an exception if the call failed
|
20
|
+
# @example Get all offers for Holiday Inn Paris Notre Dame
|
21
|
+
# amadeus.shopping.hotel_offers_by_hotel.get(
|
22
|
+
# hotelId: 'XKPARC12'
|
23
|
+
# )
|
24
|
+
#
|
25
|
+
def get(params = {})
|
26
|
+
client.get('/v2/shopping/hotel-offers/by-hotel', params)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -31,13 +31,13 @@ module Amadeus
|
|
31
31
|
# in YYYY-MM format - required
|
32
32
|
# @return [Amadeus::Response] a parsed response
|
33
33
|
# @raise [Amadeus::Base] an exception if the call failed
|
34
|
-
# @example How many people in
|
35
|
-
# from
|
34
|
+
# @example How many people in Spain searched for a trip
|
35
|
+
# from Madrid to New-York in August 2017?
|
36
36
|
# amadeus.travel.analytics.air_traffic.searched_by_destination.get(
|
37
|
-
# originCityCode: '
|
38
|
-
# destinationCityCode: '
|
39
|
-
# searchPeriod: '
|
40
|
-
# marketCountryCode: '
|
37
|
+
# originCityCode: 'MAD',
|
38
|
+
# destinationCityCode: 'NYC',
|
39
|
+
# searchPeriod: '2017-08',
|
40
|
+
# marketCountryCode: 'ES'
|
41
41
|
# )
|
42
42
|
#
|
43
43
|
def get(params = {})
|
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:
|
4
|
+
version: 3.0.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: 2019-01-22 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:
|
35
|
+
version: 2.0.1
|
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:
|
42
|
+
version: 2.0.1
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: guard
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -222,10 +222,9 @@ files:
|
|
222
222
|
- lib/amadeus/namespaces/shopping/flight_dates.rb
|
223
223
|
- lib/amadeus/namespaces/shopping/flight_destinations.rb
|
224
224
|
- lib/amadeus/namespaces/shopping/flight_offers.rb
|
225
|
-
- lib/amadeus/namespaces/shopping/
|
226
|
-
- lib/amadeus/namespaces/shopping/hotel/hotel_offers.rb
|
227
|
-
- lib/amadeus/namespaces/shopping/hotel/offer.rb
|
225
|
+
- lib/amadeus/namespaces/shopping/hotel_offer.rb
|
228
226
|
- lib/amadeus/namespaces/shopping/hotel_offers.rb
|
227
|
+
- lib/amadeus/namespaces/shopping/hotel_offers_by_hotel.rb
|
229
228
|
- lib/amadeus/namespaces/travel.rb
|
230
229
|
- lib/amadeus/namespaces/travel/analytics.rb
|
231
230
|
- lib/amadeus/namespaces/travel/analytics/air_traffic.rb
|
@@ -254,8 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
254
253
|
- !ruby/object:Gem::Version
|
255
254
|
version: '0'
|
256
255
|
requirements: []
|
257
|
-
|
258
|
-
rubygems_version: 2.7.8
|
256
|
+
rubygems_version: 3.0.2
|
259
257
|
signing_key:
|
260
258
|
specification_version: 4
|
261
259
|
summary: Amadeus travel APIs
|
@@ -1,56 +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/hotels+ endpoints
|
8
|
-
#
|
9
|
-
# Access via the +Amadeus::Client+ object
|
10
|
-
#
|
11
|
-
# amadeus = Amadeus::Client.new
|
12
|
-
# amadeus.shopping.hotels(123)
|
13
|
-
#
|
14
|
-
class Hotel < Amadeus::Client::Decorator
|
15
|
-
# the Hotel ID
|
16
|
-
attr_reader :hotel_id
|
17
|
-
|
18
|
-
# Initialize this namespaced client with an
|
19
|
-
# {Amadeus::Client} instance and a Hotel ID
|
20
|
-
#
|
21
|
-
# @param [Amadeus::Client] client
|
22
|
-
# @param [Number] hotel_id
|
23
|
-
#
|
24
|
-
def initialize(client, hotel_id)
|
25
|
-
super(client)
|
26
|
-
@hotel_id = hotel_id
|
27
|
-
end
|
28
|
-
|
29
|
-
# The namespace for the Hotels::Offers API:
|
30
|
-
#
|
31
|
-
# @param [Number] offer_id The ID for the offer to find details for
|
32
|
-
# @return [Amadeus::Namespaces::Shopping::Hotels::Offers]
|
33
|
-
# @example
|
34
|
-
# amadeus.shopping.hotel('SMPARCOL').offer(234)
|
35
|
-
#
|
36
|
-
def offer(offer_id)
|
37
|
-
Amadeus::Namespaces::Shopping::Hotel::Offer.new(
|
38
|
-
client, @hotel_id, offer_id
|
39
|
-
)
|
40
|
-
end
|
41
|
-
|
42
|
-
# The namespace for the Hotels::HotelOffers API:
|
43
|
-
#
|
44
|
-
# @return [Amadeus::Namespaces::Shopping::Hotels::HotelOffers]
|
45
|
-
# @example
|
46
|
-
# amadeus.shopping.hotel('SMPARCOL').hotel_offers
|
47
|
-
#
|
48
|
-
def hotel_offers
|
49
|
-
Amadeus::Namespaces::Shopping::Hotel::HotelOffers.new(
|
50
|
-
client, @hotel_id
|
51
|
-
)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Amadeus
|
4
|
-
module Namespaces
|
5
|
-
class Shopping
|
6
|
-
class Hotel
|
7
|
-
# A namespaced client for the
|
8
|
-
# +/v1/shopping/hotels/:id/hotel-offers+ endpoints
|
9
|
-
#
|
10
|
-
# Access via the +Amadeus::Client+ object
|
11
|
-
#
|
12
|
-
# amadeus = Amadeus::Client.new
|
13
|
-
# amadeus.shopping.hotels.hotel_offers
|
14
|
-
#
|
15
|
-
class HotelOffers < Amadeus::Client::Decorator
|
16
|
-
# the Hotel ID
|
17
|
-
attr_reader :hotel_id
|
18
|
-
|
19
|
-
# Initialize this namespaced client with an
|
20
|
-
# {Amadeus::Client} instance and a Hotel ID
|
21
|
-
#
|
22
|
-
# @param [Amadeus::Client] client
|
23
|
-
# @param [Number] hotel_id
|
24
|
-
#
|
25
|
-
def initialize(client, hotel_id)
|
26
|
-
super(client)
|
27
|
-
@hotel_id = hotel_id
|
28
|
-
end
|
29
|
-
|
30
|
-
# Get one hotel and its available offers
|
31
|
-
#
|
32
|
-
# @return [Amadeus::Response] a parsed response
|
33
|
-
# @raise [Amadeus::Base] an exception if the call failed
|
34
|
-
# @example Search for hotels in London
|
35
|
-
# amadeus.shopping.hotel('SMPARCOL').hotel_offers.get
|
36
|
-
#
|
37
|
-
def get(params = {})
|
38
|
-
client.get("/v1/shopping/hotels/#{@hotel_id}/hotel-offers", params)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Amadeus
|
4
|
-
module Namespaces
|
5
|
-
class Shopping
|
6
|
-
class Hotel
|
7
|
-
# A namespaced client for the
|
8
|
-
# +/v1/shopping/hotels/:id/offers+ endpoints
|
9
|
-
#
|
10
|
-
# Access via the +Amadeus::Client+ object
|
11
|
-
#
|
12
|
-
# amadeus = Amadeus::Client.new
|
13
|
-
# amadeus.shopping.hotels.offers
|
14
|
-
#
|
15
|
-
class Offer < Amadeus::Client::Decorator
|
16
|
-
# the Hotel ID
|
17
|
-
attr_reader :hotel_id
|
18
|
-
# the Offer ID
|
19
|
-
attr_reader :offer_id
|
20
|
-
|
21
|
-
# Initialize this namespaced client with an
|
22
|
-
# {Amadeus::Client} instance, a Hotel ID, and an Offer ID
|
23
|
-
#
|
24
|
-
# @param [Amadeus::Client] client
|
25
|
-
# @param [Number] hotel_id
|
26
|
-
# @param [Number] offer_id
|
27
|
-
#
|
28
|
-
def initialize(client, hotel_id, offer_id)
|
29
|
-
super(client)
|
30
|
-
@hotel_id = hotel_id
|
31
|
-
@offer_id = offer_id
|
32
|
-
end
|
33
|
-
|
34
|
-
# Get room and rate details
|
35
|
-
#
|
36
|
-
# @return [Amadeus::Response] a parsed response
|
37
|
-
# @raise [Amadeus::Base] an exception if the call failed
|
38
|
-
# @example Search for hotels in London
|
39
|
-
# amadeus.shopping.hotel('SMPARCOL')
|
40
|
-
# .offers('AC7D4DA2C322A73AF0824318A4965DA2805A3FC2').get
|
41
|
-
#
|
42
|
-
def get(params = {})
|
43
|
-
client.get(
|
44
|
-
"/v1/shopping/hotels/#{@hotel_id}/offers/#{@offer_id}", params
|
45
|
-
)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|