quandoo 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +197 -0
- data/Rakefile +8 -0
- data/config.json +8 -0
- data/docs/AgentTracking.md +8 -0
- data/docs/AreaDto.md +10 -0
- data/docs/AvailabilitiesApi.md +132 -0
- data/docs/ChainDto.md +9 -0
- data/docs/ChangedReviewDto.md +10 -0
- data/docs/CoordinatesDto.md +9 -0
- data/docs/CreateReviewDto.md +10 -0
- data/docs/CreatedMasterCustomer.md +8 -0
- data/docs/CreatedReservation.md +11 -0
- data/docs/CreatedReservationData.md +10 -0
- data/docs/CreatedReservationEnquiry.md +8 -0
- data/docs/CreatedReservationEnquiryData.md +10 -0
- data/docs/CustomerDataList.md +10 -0
- data/docs/CustomerDto.md +10 -0
- data/docs/CustomerResponse.md +17 -0
- data/docs/CustomerReviewData.md +11 -0
- data/docs/CustomerStatisticsData.md +10 -0
- data/docs/CustomersApi.md +183 -0
- data/docs/DealData.md +10 -0
- data/docs/DocumentDto.md +11 -0
- data/docs/ErrorResponse.md +9 -0
- data/docs/GetReservationEnquiryData.md +14 -0
- data/docs/GetReviewDto.md +14 -0
- data/docs/GetReviewsDto.md +11 -0
- data/docs/ImageDto.md +8 -0
- data/docs/LinkRelationDto.md +10 -0
- data/docs/LocationDto.md +9 -0
- data/docs/MarketingSettingDto.md +9 -0
- data/docs/MenusApi.md +300 -0
- data/docs/MerchantAddressDto.md +12 -0
- data/docs/MerchantAvailabilityDaysDto.md +9 -0
- data/docs/MerchantAvailabilityDto.md +11 -0
- data/docs/MerchantAvailabilityDtoList.md +10 -0
- data/docs/MerchantCustomer.md +15 -0
- data/docs/MerchantCustomerData.md +21 -0
- data/docs/MerchantDetailsDto.md +24 -0
- data/docs/MerchantDetailsDtoList.md +11 -0
- data/docs/MerchantMenuCategoryDto.md +10 -0
- data/docs/MerchantMenuDto.md +13 -0
- data/docs/MerchantMenuItemDto.md +11 -0
- data/docs/MerchantMenusDto.md +8 -0
- data/docs/MerchantReservation.md +18 -0
- data/docs/MerchantReservationData.md +10 -0
- data/docs/MerchantReservationEnquiry.md +13 -0
- data/docs/MerchantReservationEnquiryData.md +10 -0
- data/docs/MerchantReservationSettingsDto.md +18 -0
- data/docs/MerchantSubscription.md +8 -0
- data/docs/MerchantVaultSettingsDto.md +11 -0
- data/docs/MerchantWithRecommendationsDto.md +10 -0
- data/docs/MerchantsApi.md +334 -0
- data/docs/OpeningTimesDto.md +8 -0
- data/docs/ReservationData.md +18 -0
- data/docs/ReservationDataList.md +8 -0
- data/docs/ReservationDetails.md +11 -0
- data/docs/ReservationEnquiriesApi.md +230 -0
- data/docs/ReservationEnquiryMessageData.md +10 -0
- data/docs/ReservationEnquiryMessageList.md +8 -0
- data/docs/ReservationMenuData.md +8 -0
- data/docs/ReservationMenuItemData.md +12 -0
- data/docs/ReservationSettingsApi.md +56 -0
- data/docs/ReservationsApi.md +168 -0
- data/docs/RestCookie.md +9 -0
- data/docs/ReviewDto.md +12 -0
- data/docs/ReviewDtoList.md +11 -0
- data/docs/ReviewsApi.md +235 -0
- data/docs/StandardOpeningTimesDto.md +7 -0
- data/docs/StatusApi.md +90 -0
- data/docs/TagGroupDto.md +9 -0
- data/docs/Tracking.md +9 -0
- data/docs/TranslatedTagDto.md +9 -0
- data/docs/UpdateReservationData.md +8 -0
- data/docs/UpdateReservationEnquiryData.md +8 -0
- data/docs/UpdateReviewDto.md +10 -0
- data/docs/ValidationsApi.md +59 -0
- data/git_push.sh +55 -0
- data/lib/quandoo.rb +113 -0
- data/lib/quandoo/api/availabilities_api.rb +171 -0
- data/lib/quandoo/api/customers_api.rb +185 -0
- data/lib/quandoo/api/menus_api.rb +301 -0
- data/lib/quandoo/api/merchants_api.rb +357 -0
- data/lib/quandoo/api/reservation_enquiries_api.rb +232 -0
- data/lib/quandoo/api/reservation_settings_api.rb +73 -0
- data/lib/quandoo/api/reservations_api.rb +178 -0
- data/lib/quandoo/api/reviews_api.rb +241 -0
- data/lib/quandoo/api/status_api.rb +111 -0
- data/lib/quandoo/api/validations_api.rb +76 -0
- data/lib/quandoo/api_client.rb +389 -0
- data/lib/quandoo/api_error.rb +38 -0
- data/lib/quandoo/configuration.rb +216 -0
- data/lib/quandoo/models/agent_tracking.rb +189 -0
- data/lib/quandoo/models/area_dto.rb +204 -0
- data/lib/quandoo/models/chain_dto.rb +192 -0
- data/lib/quandoo/models/changed_review_dto.rb +250 -0
- data/lib/quandoo/models/coordinates_dto.rb +192 -0
- data/lib/quandoo/models/create_review_dto.rb +214 -0
- data/lib/quandoo/models/created_master_customer.rb +189 -0
- data/lib/quandoo/models/created_reservation.rb +229 -0
- data/lib/quandoo/models/created_reservation_data.rb +221 -0
- data/lib/quandoo/models/created_reservation_enquiry.rb +189 -0
- data/lib/quandoo/models/created_reservation_enquiry_data.rb +221 -0
- data/lib/quandoo/models/customer_data_list.rb +203 -0
- data/lib/quandoo/models/customer_dto.rb +201 -0
- data/lib/quandoo/models/customer_response.rb +362 -0
- data/lib/quandoo/models/customer_review_data.rb +214 -0
- data/lib/quandoo/models/customer_statistics_data.rb +219 -0
- data/lib/quandoo/models/deal_data.rb +253 -0
- data/lib/quandoo/models/document_dto.rb +210 -0
- data/lib/quandoo/models/error_response.rb +226 -0
- data/lib/quandoo/models/get_reservation_enquiry_data.rb +249 -0
- data/lib/quandoo/models/get_review_dto.rb +288 -0
- data/lib/quandoo/models/get_reviews_dto.rb +216 -0
- data/lib/quandoo/models/image_dto.rb +183 -0
- data/lib/quandoo/models/link_relation_dto.rb +235 -0
- data/lib/quandoo/models/location_dto.rb +192 -0
- data/lib/quandoo/models/marketing_setting_dto.rb +238 -0
- data/lib/quandoo/models/merchant_address_dto.rb +219 -0
- data/lib/quandoo/models/merchant_availability_days_dto.rb +198 -0
- data/lib/quandoo/models/merchant_availability_dto.rb +226 -0
- data/lib/quandoo/models/merchant_availability_dto_list.rb +215 -0
- data/lib/quandoo/models/merchant_customer.rb +271 -0
- data/lib/quandoo/models/merchant_customer_data.rb +390 -0
- data/lib/quandoo/models/merchant_details_dto.rb +402 -0
- data/lib/quandoo/models/merchant_details_dto_list.rb +218 -0
- data/lib/quandoo/models/merchant_menu_category_dto.rb +216 -0
- data/lib/quandoo/models/merchant_menu_dto.rb +251 -0
- data/lib/quandoo/models/merchant_menu_item_dto.rb +224 -0
- data/lib/quandoo/models/merchant_menus_dto.rb +185 -0
- data/lib/quandoo/models/merchant_reservation.rb +301 -0
- data/lib/quandoo/models/merchant_reservation_data.rb +219 -0
- data/lib/quandoo/models/merchant_reservation_enquiry.rb +311 -0
- data/lib/quandoo/models/merchant_reservation_enquiry_data.rb +219 -0
- data/lib/quandoo/models/merchant_reservation_settings_dto.rb +290 -0
- data/lib/quandoo/models/merchant_subscription.rb +217 -0
- data/lib/quandoo/models/merchant_vault_settings_dto.rb +231 -0
- data/lib/quandoo/models/merchant_with_recommendations_dto.rb +248 -0
- data/lib/quandoo/models/opening_times_dto.rb +189 -0
- data/lib/quandoo/models/reservation_data.rb +331 -0
- data/lib/quandoo/models/reservation_data_list.rb +185 -0
- data/lib/quandoo/models/reservation_details.rb +229 -0
- data/lib/quandoo/models/reservation_enquiry_message_data.rb +241 -0
- data/lib/quandoo/models/reservation_enquiry_message_list.rb +185 -0
- data/lib/quandoo/models/reservation_menu_data.rb +190 -0
- data/lib/quandoo/models/reservation_menu_item_data.rb +219 -0
- data/lib/quandoo/models/rest_cookie.rb +194 -0
- data/lib/quandoo/models/review_dto.rb +238 -0
- data/lib/quandoo/models/review_dto_list.rb +218 -0
- data/lib/quandoo/models/standard_opening_times_dto.rb +174 -0
- data/lib/quandoo/models/tag_group_dto.rb +228 -0
- data/lib/quandoo/models/tracking.rb +199 -0
- data/lib/quandoo/models/translated_tag_dto.rb +192 -0
- data/lib/quandoo/models/update_reservation_data.rb +189 -0
- data/lib/quandoo/models/update_reservation_enquiry_data.rb +184 -0
- data/lib/quandoo/models/update_review_dto.rb +209 -0
- data/lib/quandoo/version.rb +15 -0
- data/quandoo.gemspec +45 -0
- data/spec/api/availabilities_api_spec.rb +69 -0
- data/spec/api/customers_api_spec.rb +75 -0
- data/spec/api/menus_api_spec.rb +100 -0
- data/spec/api/merchants_api_spec.rb +119 -0
- data/spec/api/reservation_enquiries_api_spec.rb +84 -0
- data/spec/api/reservation_settings_api_spec.rb +47 -0
- data/spec/api/reservations_api_spec.rb +72 -0
- data/spec/api/reviews_api_spec.rb +86 -0
- data/spec/api/status_api_spec.rb +57 -0
- data/spec/api/validations_api_spec.rb +48 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/agent_tracking_spec.rb +41 -0
- data/spec/models/area_dto_spec.rb +53 -0
- data/spec/models/chain_dto_spec.rb +47 -0
- data/spec/models/changed_review_dto_spec.rb +57 -0
- data/spec/models/coordinates_dto_spec.rb +47 -0
- data/spec/models/create_review_dto_spec.rb +53 -0
- data/spec/models/created_master_customer_spec.rb +41 -0
- data/spec/models/created_reservation_data_spec.rb +53 -0
- data/spec/models/created_reservation_enquiry_data_spec.rb +53 -0
- data/spec/models/created_reservation_enquiry_spec.rb +41 -0
- data/spec/models/created_reservation_spec.rb +59 -0
- data/spec/models/customer_data_list_spec.rb +53 -0
- data/spec/models/customer_dto_spec.rb +53 -0
- data/spec/models/customer_response_spec.rb +99 -0
- data/spec/models/customer_review_data_spec.rb +59 -0
- data/spec/models/customer_statistics_data_spec.rb +53 -0
- data/spec/models/deal_data_spec.rb +57 -0
- data/spec/models/document_dto_spec.rb +59 -0
- data/spec/models/error_response_spec.rb +51 -0
- data/spec/models/get_reservation_enquiry_data_spec.rb +77 -0
- data/spec/models/get_review_dto_spec.rb +81 -0
- data/spec/models/get_reviews_dto_spec.rb +59 -0
- data/spec/models/image_dto_spec.rb +41 -0
- data/spec/models/link_relation_dto_spec.rb +57 -0
- data/spec/models/location_dto_spec.rb +47 -0
- data/spec/models/marketing_setting_dto_spec.rb +55 -0
- data/spec/models/merchant_address_dto_spec.rb +65 -0
- data/spec/models/merchant_availability_days_dto_spec.rb +47 -0
- data/spec/models/merchant_availability_dto_list_spec.rb +53 -0
- data/spec/models/merchant_availability_dto_spec.rb +59 -0
- data/spec/models/merchant_customer_data_spec.rb +119 -0
- data/spec/models/merchant_customer_spec.rb +83 -0
- data/spec/models/merchant_details_dto_list_spec.rb +59 -0
- data/spec/models/merchant_details_dto_spec.rb +137 -0
- data/spec/models/merchant_menu_category_dto_spec.rb +53 -0
- data/spec/models/merchant_menu_dto_spec.rb +71 -0
- data/spec/models/merchant_menu_item_dto_spec.rb +59 -0
- data/spec/models/merchant_menus_dto_spec.rb +41 -0
- data/spec/models/merchant_reservation_data_spec.rb +53 -0
- data/spec/models/merchant_reservation_enquiry_data_spec.rb +53 -0
- data/spec/models/merchant_reservation_enquiry_spec.rb +71 -0
- data/spec/models/merchant_reservation_settings_dto_spec.rb +101 -0
- data/spec/models/merchant_reservation_spec.rb +101 -0
- data/spec/models/merchant_subscription_spec.rb +45 -0
- data/spec/models/merchant_vault_settings_dto_spec.rb +59 -0
- data/spec/models/merchant_with_recommendations_dto_spec.rb +57 -0
- data/spec/models/opening_times_dto_spec.rb +41 -0
- data/spec/models/reservation_data_list_spec.rb +41 -0
- data/spec/models/reservation_data_spec.rb +101 -0
- data/spec/models/reservation_details_spec.rb +59 -0
- data/spec/models/reservation_enquiry_message_data_spec.rb +57 -0
- data/spec/models/reservation_enquiry_message_list_spec.rb +41 -0
- data/spec/models/reservation_menu_data_spec.rb +41 -0
- data/spec/models/reservation_menu_item_data_spec.rb +65 -0
- data/spec/models/rest_cookie_spec.rb +47 -0
- data/spec/models/review_dto_list_spec.rb +59 -0
- data/spec/models/review_dto_spec.rb +65 -0
- data/spec/models/standard_opening_times_dto_spec.rb +35 -0
- data/spec/models/tag_group_dto_spec.rb +51 -0
- data/spec/models/tracking_spec.rb +47 -0
- data/spec/models/translated_tag_dto_spec.rb +47 -0
- data/spec/models/update_reservation_data_spec.rb +41 -0
- data/spec/models/update_reservation_enquiry_data_spec.rb +41 -0
- data/spec/models/update_review_dto_spec.rb +53 -0
- data/spec/spec_helper.rb +111 -0
- metadata +538 -0
@@ -0,0 +1,209 @@
|
|
1
|
+
=begin
|
2
|
+
#Quandoo API Documentation
|
3
|
+
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.5
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Quandoo
|
16
|
+
class UpdateReviewDto
|
17
|
+
# UUID identifying the review.
|
18
|
+
attr_accessor :review_id
|
19
|
+
|
20
|
+
# Rating associated to this review. Possible values: 1 to 6.
|
21
|
+
attr_accessor :rating
|
22
|
+
|
23
|
+
# Description associated to this review.
|
24
|
+
attr_accessor :description
|
25
|
+
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
27
|
+
def self.attribute_map
|
28
|
+
{
|
29
|
+
:'review_id' => :'reviewId',
|
30
|
+
:'rating' => :'rating',
|
31
|
+
:'description' => :'description'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.swagger_types
|
37
|
+
{
|
38
|
+
:'review_id' => :'String',
|
39
|
+
:'rating' => :'Integer',
|
40
|
+
:'description' => :'String'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# Initializes the object
|
45
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
46
|
+
def initialize(attributes = {})
|
47
|
+
return unless attributes.is_a?(Hash)
|
48
|
+
|
49
|
+
# convert string to symbol for hash key
|
50
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
51
|
+
|
52
|
+
if attributes.has_key?(:'reviewId')
|
53
|
+
self.review_id = attributes[:'reviewId']
|
54
|
+
end
|
55
|
+
|
56
|
+
if attributes.has_key?(:'rating')
|
57
|
+
self.rating = attributes[:'rating']
|
58
|
+
end
|
59
|
+
|
60
|
+
if attributes.has_key?(:'description')
|
61
|
+
self.description = attributes[:'description']
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
66
|
+
# @return Array for valid properties with the reasons
|
67
|
+
def list_invalid_properties
|
68
|
+
invalid_properties = Array.new
|
69
|
+
if @review_id.nil?
|
70
|
+
invalid_properties.push('invalid value for "review_id", review_id cannot be nil.')
|
71
|
+
end
|
72
|
+
|
73
|
+
invalid_properties
|
74
|
+
end
|
75
|
+
|
76
|
+
# Check to see if the all the properties in the model are valid
|
77
|
+
# @return true if the model is valid
|
78
|
+
def valid?
|
79
|
+
return false if @review_id.nil?
|
80
|
+
true
|
81
|
+
end
|
82
|
+
|
83
|
+
# Checks equality by comparing each attribute.
|
84
|
+
# @param [Object] Object to be compared
|
85
|
+
def ==(o)
|
86
|
+
return true if self.equal?(o)
|
87
|
+
self.class == o.class &&
|
88
|
+
review_id == o.review_id &&
|
89
|
+
rating == o.rating &&
|
90
|
+
description == o.description
|
91
|
+
end
|
92
|
+
|
93
|
+
# @see the `==` method
|
94
|
+
# @param [Object] Object to be compared
|
95
|
+
def eql?(o)
|
96
|
+
self == o
|
97
|
+
end
|
98
|
+
|
99
|
+
# Calculates hash code according to all attributes.
|
100
|
+
# @return [Fixnum] Hash code
|
101
|
+
def hash
|
102
|
+
[review_id, rating, description].hash
|
103
|
+
end
|
104
|
+
|
105
|
+
# Builds the object from hash
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
+
# @return [Object] Returns the model itself
|
108
|
+
def build_from_hash(attributes)
|
109
|
+
return nil unless attributes.is_a?(Hash)
|
110
|
+
self.class.swagger_types.each_pair do |key, type|
|
111
|
+
if type =~ /\AArray<(.*)>/i
|
112
|
+
# check to ensure the input is an array given that the the attribute
|
113
|
+
# is documented as an array but the input is not
|
114
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
115
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
116
|
+
end
|
117
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
118
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
119
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
120
|
+
end
|
121
|
+
|
122
|
+
self
|
123
|
+
end
|
124
|
+
|
125
|
+
# Deserializes the data based on type
|
126
|
+
# @param string type Data type
|
127
|
+
# @param string value Value to be deserialized
|
128
|
+
# @return [Object] Deserialized data
|
129
|
+
def _deserialize(type, value)
|
130
|
+
case type.to_sym
|
131
|
+
when :DateTime
|
132
|
+
DateTime.parse(value)
|
133
|
+
when :Date
|
134
|
+
Date.parse(value)
|
135
|
+
when :String
|
136
|
+
value.to_s
|
137
|
+
when :Integer
|
138
|
+
value.to_i
|
139
|
+
when :Float
|
140
|
+
value.to_f
|
141
|
+
when :BOOLEAN
|
142
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
143
|
+
true
|
144
|
+
else
|
145
|
+
false
|
146
|
+
end
|
147
|
+
when :Object
|
148
|
+
# generic object (usually a Hash), return directly
|
149
|
+
value
|
150
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
151
|
+
inner_type = Regexp.last_match[:inner_type]
|
152
|
+
value.map { |v| _deserialize(inner_type, v) }
|
153
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
154
|
+
k_type = Regexp.last_match[:k_type]
|
155
|
+
v_type = Regexp.last_match[:v_type]
|
156
|
+
{}.tap do |hash|
|
157
|
+
value.each do |k, v|
|
158
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
else # model
|
162
|
+
temp_model = Quandoo.const_get(type).new
|
163
|
+
temp_model.build_from_hash(value)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
# Returns the string representation of the object
|
168
|
+
# @return [String] String presentation of the object
|
169
|
+
def to_s
|
170
|
+
to_hash.to_s
|
171
|
+
end
|
172
|
+
|
173
|
+
# to_body is an alias to to_hash (backward compatibility)
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
175
|
+
def to_body
|
176
|
+
to_hash
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns the object in the form of hash
|
180
|
+
# @return [Hash] Returns the object in the form of hash
|
181
|
+
def to_hash
|
182
|
+
hash = {}
|
183
|
+
self.class.attribute_map.each_pair do |attr, param|
|
184
|
+
value = self.send(attr)
|
185
|
+
next if value.nil?
|
186
|
+
hash[param] = _to_hash(value)
|
187
|
+
end
|
188
|
+
hash
|
189
|
+
end
|
190
|
+
|
191
|
+
# Outputs non-array value in the form of hash
|
192
|
+
# For object, use to_hash. Otherwise, just return the value
|
193
|
+
# @param [Object] value Any valid value
|
194
|
+
# @return [Hash] Returns the value in the form of hash
|
195
|
+
def _to_hash(value)
|
196
|
+
if value.is_a?(Array)
|
197
|
+
value.compact.map { |v| _to_hash(v) }
|
198
|
+
elsif value.is_a?(Hash)
|
199
|
+
{}.tap do |hash|
|
200
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
201
|
+
end
|
202
|
+
elsif value.respond_to? :to_hash
|
203
|
+
value.to_hash
|
204
|
+
else
|
205
|
+
value
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
=begin
|
2
|
+
#Quandoo API Documentation
|
3
|
+
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.5
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
module Quandoo
|
14
|
+
VERSION = '1.0.0'
|
15
|
+
end
|
data/quandoo.gemspec
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
=begin
|
4
|
+
#Quandoo API Documentation
|
5
|
+
|
6
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
7
|
+
|
8
|
+
OpenAPI spec version: 1.0.0
|
9
|
+
|
10
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
11
|
+
Swagger Codegen version: 2.4.5
|
12
|
+
|
13
|
+
=end
|
14
|
+
|
15
|
+
$:.push File.expand_path("../lib", __FILE__)
|
16
|
+
require "quandoo/version"
|
17
|
+
|
18
|
+
Gem::Specification.new do |s|
|
19
|
+
s.name = "quandoo"
|
20
|
+
s.version = Quandoo::VERSION
|
21
|
+
s.platform = Gem::Platform::RUBY
|
22
|
+
s.authors = ["Joshua Kelly"]
|
23
|
+
s.email = [""]
|
24
|
+
s.homepage = "https://github.com/swagger-api/swagger-codegen"
|
25
|
+
s.summary = "A Ruby wrapper for the Quandoo API"
|
26
|
+
s.description = "This gem maps all of the publicly available methods in the Quandoo API to a Ruby library"
|
27
|
+
s.license = "Unlicense"
|
28
|
+
s.required_ruby_version = ">= 1.9"
|
29
|
+
|
30
|
+
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
31
|
+
s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
|
32
|
+
|
33
|
+
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
34
|
+
s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
|
35
|
+
s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3'
|
36
|
+
s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
|
37
|
+
s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
|
38
|
+
s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
|
39
|
+
s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'
|
40
|
+
|
41
|
+
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
|
42
|
+
s.test_files = `find spec/*`.split("\n")
|
43
|
+
s.executables = []
|
44
|
+
s.require_paths = ["lib"]
|
45
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
=begin
|
2
|
+
#Quandoo API Documentation
|
3
|
+
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.5
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for Quandoo::AvailabilitiesApi
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'AvailabilitiesApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@instance = Quandoo::AvailabilitiesApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of AvailabilitiesApi' do
|
30
|
+
it 'should create an instance of AvailabilitiesApi' do
|
31
|
+
expect(@instance).to be_instance_of(Quandoo::AvailabilitiesApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for availability_days1
|
36
|
+
# Get merchant availability days
|
37
|
+
# This endpoint returns days which a customer can select for his reservation. The response is based on when the merchant is known to be open. It is not guaranteed that they have available times for reservation. The days are returned starting from the first available day up to the merchant-defined limit, but never more than 365 days. ####Request parameters: * **merchantId**: Id of the merchant. Path parameter. * **agentId**: Id of the agent making the request * **capacity**: Specifies the number of people in reservation. Availability days will be returned based on this capacity. ####Response: The response returns availability days that could be selected for reservation. * **days**: List of availability days that could be reserved. Format: yyyy-MM-dd * **links**: Related links that can be followed based on this response. ####Example curl: ``` curl https://{host}/v{X}/merchants/15/availabilities?agentId=3&capacity=4 ``` ####Example response: ``` { \"days\": [ \"2017-01-01\", \"2017-01-02\", \"2017-01-03\", ... ], \"links\": [ { \"href\": \"https://{host}/v{X}/merchants/15\", \"method\": \"GET\", \"rel\": \"parent\" }, { \"href\": \"https://{host}/v{X}/merchants/15/reservation-settings\", \"method\": \"GET\", \"rel\": \"settings\" }, { \"href\": \"https://{host}/v{X}/merchants/15/availabilities/2017-01-01/times\", \"method\": \"GET\", \"rel\": \"availabilities\" } ] } ```
|
38
|
+
# @param merchant_id Id of the merchant
|
39
|
+
# @param agent_id Id of the agent
|
40
|
+
# @param [Hash] opts the optional parameters
|
41
|
+
# @option opts [Integer] :capacity Number of people
|
42
|
+
# @return [MerchantAvailabilityDaysDto]
|
43
|
+
describe 'availability_days1 test' do
|
44
|
+
it 'should work' do
|
45
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# unit tests for availability_options1
|
50
|
+
# Get merchant availability time slots
|
51
|
+
# This endpoint returns availability time slots which can be reserved for a given capacity. ####Request parameters: * **merchantId**: Id of the merchant. Path parameter. * **date**: Specifies date of the desired reservation. Format: `yyyy-MM-dd`. Path parameter. * **fromTime**: Beginning of the desired reservation time frame. Format: `HH:mm`. Optional. * **toTime**: End of the desired reservation time frame. Format: `HH:mm`. Optional. * **agentId**: Id of the agent making the request * **capacity**: Specifies the number of people in reservation. Availabilities will be returned based on this capacity. If not provided, the default value is 2. * **areaId**: Restricts availabilities to a certain area. Optional. * **dealId/dealType**: Filter availabilities for a certain deal. Optional. If used, both must be provided. * **dealType** specifies type of the deal. Can be `OFFER`, `DISCOUNT` or `SPECIAL`. * **dealId** specifies the ID of the deal. ####Response: The response returns availability time slots that could be reserved, along with the areas it is associated with and contains information on how much should be paid if the reservation is cancelled by a client. * **timeSlots**: List of available time slots. * **areaIds**: List of areas for which this time slot can be reserved. * **dateTime**: Date and time of the available slot. Format: `yyyy-MM-dd'T'HH:mm:ssZ` * **occupancy**: Occupancy of the available time slot. This is an integer between `0` and `100`. * **vaultSettingId**: ID of the vault setting, if there is any. See: `vaultSettings` * **vaultSettings**: Credit card vault settings representing the fees to be paid in case of cancellation. * **id**: ID of the setting as shown in `timeSlots`. * **fee**: Fee to be paid in case of cancellation. Currency is defined by merchant. See reservation-settings. * **feeType**: Type of fee to be paid. Can be `PER_PERSON` or `PER_RESERVATION`. * **feePercentageForTime**: Fee percentage depending of the time of cancellation. Format: `\"{hoursStart}-{hoursEnd}\": {percentage}` , where hours are the number of hours before the visit. * **links**: Related links that can be followed based on this response. ####Example curl: ``` curl https://{host}/v{X}/merchants/15/availabilities/2017-11-09/times?capacity=2&areaId=24&agentId=3&dealId=ce0706ff-a95d-4229-a220-d21dcd175342&dealType=OFFER&fromTime=10:45&toTime=12:45 ``` ####Example response: ``` { \"timeSlots\": [ { \"areaIds\": [33532, 33533], \"dateTime\": \"2017-09-27T10:45:00+01:00\", \"occupancy\": 0, \"vaultSettingId\": \"284d701f-f79a-4efa-9859-fd09851dfdce\" }, ... ], \"vaultSettings\": [ { \"id\": \"284d701f-f79a-4efa-9859-fd09851dfdce\", \"fee\": \"10.00\", \"feeType\": \"PER_PERSON\", \"feePercentageForTime\": { \"0-12\":100, \"12-24\":50, \"24-48\":20 } } ], \"links\": [ { \"href\": \"https://{host}/v{X}/merchants/15\", \"method\": \"GET\", \"rel\": \"parent\" }, { \"href\": \"https://{host}/v{X}/merchants/15/reservation-settings\", \"method\": \"GET\", \"rel\": \"reservation-settings\" }, { \"href\": \"https://{host}/v{X}/merchants/reservations\", \"method\": \"PUT\", \"rel\": \"create-reservation\" } ] } ```
|
52
|
+
# @param merchant_id Id of the merchant
|
53
|
+
# @param agent_id Id of the agent
|
54
|
+
# @param capacity Number of people
|
55
|
+
# @param date Date of the desired reservation. Format: yyyy-MM-dd
|
56
|
+
# @param [Hash] opts the optional parameters
|
57
|
+
# @option opts [String] :from_time Beginning of the desired reservation time frame. Format: HH:mm
|
58
|
+
# @option opts [String] :to_time End of the desired reservation time frame. Format: HH:mm
|
59
|
+
# @option opts [Integer] :area_id Id of the area
|
60
|
+
# @option opts [String] :deal_id Id of the deal
|
61
|
+
# @option opts [String] :deal_type type of the deal - SPECIAL, DISCOUNT or OFFER
|
62
|
+
# @return [MerchantAvailabilityDtoList]
|
63
|
+
describe 'availability_options1 test' do
|
64
|
+
it 'should work' do
|
65
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
=begin
|
2
|
+
#Quandoo API Documentation
|
3
|
+
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.5
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for Quandoo::CustomersApi
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'CustomersApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@instance = Quandoo::CustomersApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of CustomersApi' do
|
30
|
+
it 'should create an instance of CustomersApi' do
|
31
|
+
expect(@instance).to be_instance_of(Quandoo::CustomersApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for get_customer1
|
36
|
+
# Get customer Data
|
37
|
+
# This endpoint allows an agent to get customer information by id. Customer id both in the request and response are agent-specific. The agent needs to be authenticated. The endpoint will return `HTTP 404 - Not Found` if the customer with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the agent is not authenticated or the agent doesn't have permissions. ####Request: * **customerId**: Agent-specific ID of the customer ####Response: The response contains the following data of the customer as explained below: * **id**: The agent-dependent identifier of the customer * **email**: The given email of this customer. _Optional_ * **firstName**: First name of the customer. _Optional_ * **lastName**: Last name of the customer. _Optional_ * **gender**: The given gender of the customer (one of MALE, FEMALE, OTHER or UNDEFINED). _Optional_ * **phoneNumber**: The ID of the merchant at which this reservation was made * **mobileNumber**: The ID of the customer to which this reservation belongs * **country**: 2-letter ISO country code of the customer, e.g. DE * **links**: Related links that can be followed based on this response * **subscriptions**: The newsletter subscriptions, e.g. QUANDOO, MERCHANT Example curl: ``` curl https://{host}/v{X}/customers/9ffb3466-3562-42cc-add1-92a46a2f0902 ``` Example response: ``` { \"id\": \"9ffb3466-3562-42cc-add1-92a46a2f0902\", \"firstName\": \"Gaius\", \"lastName\": \"Octavius\", \"gender\": \"male\", \"email\": \"c2f22117-6148-45b8-ae79-41eda25eae67augustus@spqr.com\", \"phoneNumber\": \"+4917312345678\", \"country\": \"DE\", \"links\": [ { \"href\": \"http://localhost:39250/v1/customers/9ffb3466-3562-42cc-add1-92a46a2f0902/reservations\", \"method\": \"GET\", \"rel\": \"get-customer-reservations\" } ], \"subscriptions\": [ { \"id\": \"QUANDOO\" } ] } ```
|
38
|
+
# @param customer_id Id of the customer
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @return [CustomerResponse]
|
41
|
+
describe 'get_customer1 test' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# unit tests for get_customers_of_merchant1
|
48
|
+
# Get a list of Customers of a merchant
|
49
|
+
# This endpoint allows a third party to get a list of customers of a merchant. The list is filtered, showing only the customers that the third party system has access. Customer id is agent-specific if the customer was created by the agent. The agent needs to be authenticated. The endpoint will return `HTTP 404 - Not Found` if the merchant with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the agent is not authenticated or the agent doesn't have permissions. ####Request: * **merchantId**: Identifier of the merchant * **offset**: sets the starting element to be returned. Defaults to 0 when unset or malformed. * **limit**: maximum number of results to be returned. Value must be between 1 and 100. Defaults to 100 when unset, malformed or outside bounds. * **modifiedSince**: earliest date time of time window in UTC. Format: yyyy-MM-dd HH:mm:ss * **modifiedUntil**: latest date time of time window in UTC. Format: yyyy-MM-dd HH:mm:ss ####Response: The response contains the following data of the customer as explained below: * **id**: The agent-dependent identifier of the customer * **title**: The title of the customer. _Optional_ * **firstName**: First name of the customer. _Optional_ * **lastName**: Last name of the customer. _Optional_ * **email**: The given email of this customer. _Optional_ * **gender**: The given gender of the customer (one of MALE, FEMALE, OTHER or UNDEFINED). _Optional_ * **phoneNumber**: The phone number of the customer. _Optional_ * **mobileNumber**: The mobile phone number of the customer. _Optional_ * **locale**: The locale of the customer. * **links**: Related links that can be followed based on this response * **subscriptions**: The newsletter subscriptions, e.g. QUANDOO, MERCHANT * **statistics**: The customer statistics: number of successful, cancelled and no-show reservations * **createdAt**: The date the customer was created. Format: yyyy-MM-ddTHH:mm:ssZ * **updatedAt**: The date the customer was last updated. Format: yyyy-MM-ddTHH:mm:ssZ Example curl: ``` curl https://{host}/v{X}/merchants/1234/customers ``` Example response: ``` { \"result\": [ { \"id\": \"9ffb3466-3562-42cc-add1-92a46a2f0902\", \"customerRef\": \"9ffb3466-3562-42cc-add1-92a46a2f0902\", \"marketingFlags\": [ { \"marketingSettingType\": \"NEWSLETTERS\", \"marketingSettingStatus\": \"INACTIVE\" }, { \"marketingSettingType\": \"PROMO_CODES\", \"marketingSettingStatus\": \"ACTIVE\" } ], \"title\": \"Mr.\", \"firstName\": \"John\", \"lastName\": \"Doe\", \"email\": \"test@quandoo.de\", \"phoneNumber\": \"+493012345678\", \"mobileNumber\": \"+17712345678\", \"locale\": \"de_DE\", \"links\": [ { \"href\": \"http://localhost:39250/v1/customers/9ffb3466-3562-42cc-add1-92a46a2f0902/reservations\", \"method\": \"GET\", \"rel\": \"get-customer-reservations\" } ], \"subscriptions\": [ { \"id\": \"QUANDOO\" } ], \"statistics\": { \"reservationSuccessfulCount\": 8, \"reservationCancelledCount\": 5, \"reservationNoShowCount\": 2 }, \"createdAt\": \"2018-11-22T18:42:16Z\", \"updatedAt\": \"2018-11-30T18:16:02Z\" } ], \"offset\": 0, \"limit\": 100 } ```
|
50
|
+
# @param merchant_id Id of the merchant
|
51
|
+
# @param [Hash] opts the optional parameters
|
52
|
+
# @option opts [Integer] :offset offset
|
53
|
+
# @option opts [Integer] :limit limit
|
54
|
+
# @option opts [DateTime] :modified_since modifiedSince. Format: yyyy-MM-dd HH:mm:ss
|
55
|
+
# @option opts [DateTime] :modified_until modifiedUntil. Format: yyyy-MM-dd HH:mm:ss
|
56
|
+
# @return [CustomerDataList]
|
57
|
+
describe 'get_customers_of_merchant1 test' do
|
58
|
+
it 'should work' do
|
59
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# unit tests for get_reservations1
|
64
|
+
# Get customer reservations
|
65
|
+
# This endpoint allows an agent to get reservations of a customer. The results will be filtered by agent id. Customer id in the request and reservation IDs in response are agent-specific. The agent needs to be authenticated. The endpoint will return `HTTP 404 - Not Found` if the customer with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the agent is not authenticated or the agent doesn't have permissions. ####Request: * **customerId**: Agent-specific ID of the customer ####Response: The response will be a _list_ of reservations. Each reservation has the fields explained below: * **id**: The agent-dependent unique id of the reservation * **number**: Quandoo internal identifier of the reservation. * **quandooId**: The public id of this reservation on quandoo system. * **status**: The status of the reservation eg. CREATED, CONFIRMED, CUSTOMER CANCELED etc. * **startTime**: The start time of the reservation. Format: `yyyy-MM-ddTHH:mm:ssZ` * **endTime**: The end time of the reservation. Format: `yyyy-MM-ddTHH:mm:ssZ` * **capacity**: The capacity (people count) of the reservation * **merchantId**: The ID of the merchant at which this reservation was made. * **customerId**: The public ID of the customer to which this reservation belongs * **promoCode**: The promotion code associated with this reservation. Optional. * **extraInfo**: extra information that the customer provided for the reservation. Optional. * **links**: Related links that can be followed based on this response. * **createdAt**: The date the reservation was created. Format: `yyyy-MM-ddTHH:mm:ssZ` * **updatedAt**: The date the reservation was last updated. Format: `yyyy-MM-ddTHH:mm:ssZ` Example curl: ``` curl https://{host}/v{X}/customers/ce0706ff-a95d-4229-a220-d21dcd175342/reservations ``` Example response: ``` { \"reservations\": [ { \"id\": \"07f53b36-3f48-11e5-a151-feff819cdc9f\", \"number\": 8734957, \"quandooId\": \"07f53b36-3f48-11e5-a151-feff819cdc9f\", \"status\": \"CREATED\", \"startTime\": \"2015-06-22T12:00:00+00:00\", \"endTime\": \"2015-06-22T13:00:00+00:00\", \"capacity\": 4, \"merchantId\": 1384, \"customerId\": \"ce0706ff-a95d-4229-a220-d21dcd175342\", \"promocode\": \"SOME_CAMPAIGN_CODE\", \"extraInfo\": \"request for baby chair\", \"links\": [ { \"href\": \"https://{host}/v{X}/reservations/07f53b36-3f48-11e5-a151-feff819cdc9f\", \"method\": \"GET\", \"rel\": \"self\" }, { \"href\": \"https://{host}/v{X}/reservations/07f53b36-3f48-11e5-a151-feff819cdc9f\", \"method\": \"PATCH\", \"rel\": \"update\" } ], \"createdAt\": \"2015-06-01T15:21:54Z\", \"updatedAt\": \"2015-06-01T18:45:30Z\" }, { \"id\": \"d8f53b36-3f48-11e5-a151-feff819cdc7a\", \"number\": 8734958, \"quandooId\": \"d8f53b36-3f48-11e5-a151-feff819cdc7a\", \"status\": \"CONFIRMED\", \"startTime\": \"2015-06-22T12:00:00+00:00\", \"endTime\": \"2015-06-22T13:00:00+00:00\", \"capacity\": 3, \"merchantId\": 1384, \"customerId\": \"ce0706ff-a95d-4229-a220-d21dcd175342\", \"promocode\": \"SOME_CAMPAIGN_CODE\", \"links\": [ { \"href\": \"https://{host}/v{X}/reservations/d8f53b36-3f48-11e5-a151-feff819cdc7a\", \"method\": \"GET\", \"rel\": \"self\" }, { \"href\": \"https://{host}/v{X}/reservations/d8f53b36-3f48-11e5-a151-feff819cdc7a\", \"method\": \"PATCH\", \"rel\": \"update\" } ], \"createdAt\": \"2015-06-01T15:21:54Z\", \"updatedAt\": \"2015-06-01T18:45:30Z\" } ] } ```
|
66
|
+
# @param customer_id Id of the customer
|
67
|
+
# @param [Hash] opts the optional parameters
|
68
|
+
# @return [ReservationDataList]
|
69
|
+
describe 'get_reservations1 test' do
|
70
|
+
it 'should work' do
|
71
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
=begin
|
2
|
+
#Quandoo API Documentation
|
3
|
+
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.5
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for Quandoo::MenusApi
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'MenusApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@instance = Quandoo::MenusApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of MenusApi' do
|
30
|
+
it 'should create an instance of MenusApi' do
|
31
|
+
expect(@instance).to be_instance_of(Quandoo::MenusApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for add_preordered_items1
|
36
|
+
# Add/remove menu items to/from a reservation's preorders
|
37
|
+
# This endpoint will add/remove menu items to/from preorders of a reservation. If an item already exists, the quantitiy specified for the item will be added to the existing quantity. For example, if an item has a quantity of 2, and a PATCH request specifies the same item with a quantity of 1, the result will be a quantity of 3 for that item. This can be also used to remove items, by specifying a negative quantity. For example, if an item has a quantity of 2, and a PATCH request specifies the same item with a quantity of -1, the result will be a quantity of 1. No item can have a negative quantity in the end, which means a PATCH request with a quantity of -5 for an item that currently has a quantity of 2, will result in that item to be simply deleted from the preorder, instead of having a final quantity of -3. If an item does not exist in the current preorders, it will be added, provided it has a positive quantity. The reservation ID in the request is the public ID of the reservation and **not** agent-specific. This endpoint requires user to be logged in. The endpoint will return `HTTP 404 - Not Found` if the reservation with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the user is not authenticated or the reservation doesn't belong to the customer associated with the user. ####Request: * **reservationId**: Public ID of the reservation. Path parameter. Request body has the same structure as Get Preorder response, except not having the `href` field. * **items**: List of menu items to be edited. Each menu item will have the fields explained below. * **menuId**: The Id of the menu that this item belongs to. **Required**. * **itemId**: The Id of the menu item. **Required**. * **quantity**: Change in quantity to be applied to the existing item's quantity. See above for explanation. **Required**. * **guestPublicId**: The ID of the guest for whom this item is being preordered. Optional. Format: UUID. ####Response: * **items**: The response will be a _list_ of successfully preordered menu items. Each menu item has the fields explained below: * **menuId**: The Id of the menu that this item belongs to * **itemId**: The Id of the menu item * **quantity**: Quantity of this menu item selected for the reservation * **guestPublicId**: The ID of the guest for whom this item has been preordered, if any. * **href**: Link that can be followed to get information about the menu and its available items Example curl: ``` curl -H \"Content Type: application/json\" -X PATCH -d ' { \"items\": [ { \"menuId\": 1846, \"itemId\": 1477, \"quantity\": 1, \"guestPublicId\": \"a8a66a11-446a-443b-8834-591742825ad4\" }, { \"menuId\": 1846, \"itemId\": 1478, \"quantity\": -1 } ] } ' https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/preorders ``` Example response: ``` { \"items\": [ { \"menuId\": 1846, \"itemId\": 1477, \"quantity\": 2, \"guestPublicId\": \"a8a66a11-446a-443b-8834-591742825ad4\", \"href\": \"https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/menus/1846\" }, { \"menuId\": 1846, \"itemId\": 1478, \"quantity\": 1, \"guestPublicId\": \"f871d6d7-e92e-4672-b24a-edb76963073b\", \"href\": \"https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/menus/1846\" } ] } ```
|
38
|
+
# @param reservation_id Public Id of the reservation
|
39
|
+
# @param body Menu items to add
|
40
|
+
# @param [Hash] opts the optional parameters
|
41
|
+
# @return [ReservationMenuData]
|
42
|
+
describe 'add_preordered_items1 test' do
|
43
|
+
it 'should work' do
|
44
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# unit tests for find_menus_for_reservation1
|
49
|
+
# Get all available menus for a reservation
|
50
|
+
# This endpoint will return the available menus for a reservation. The reservation ID in the request is the public ID of the reservation and **not** agent-specific. This endpoint requires user to be logged in. The endpoint will return `HTTP 404 - Not Found` if the reservation with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the user is not authenticated or the reservation doesn't belong to the customer associated with the user. ####Request: * **reservationId**: Public Id of the reservation * **locale**: Locale for translated info. Default: _en_ ####Response: The response will be a _list_ of available menus. Each menu has the fields explained below: * **id**: The unique id of the menu * **name**: The name or title of the menu * **description**: Menu description * **price**: Total price for the menu * **sortOrder**: The order in which this menu should be displayed * **categories**: Categories of the menu * **id**: The Id of the menu category * **name**: Name or title of the menu category * **items**: Items inside the menu category * **id**: Id of the menu item * **name**: Name of menu item * **description**: Menu item description * **price**: Item price Example curl: ``` curl https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/menus?locale=en ``` Example response: ``` { \"menus\": [ { \"id\": 1836, \"name\": \"special menu 1\", \"price\": \"100.00\", \"sortOrder\": 0, \"categories\": [ { \"id\": 1109, \"name\": \"starters\", \"items\": [ { \"id\": 1469, \"name\": \"fries\", \"price\": \"20.00\" } ] }, { \"id\": 1110, \"name\": \"fish\", \"items\": [ { \"id\": 1470, \"name\": \"salmon\", \"price\": \"60.00\" } ] }, { \"id\": 1111, \"name\": \"dessert\", \"items\": [ { \"id\": 1471, \"name\": \"sundae\", \"price\": \"20.00\" } ] } ] } ] } ```
|
51
|
+
# @param reservation_id Public Id of the reservation
|
52
|
+
# @param [Hash] opts the optional parameters
|
53
|
+
# @option opts [String] :locale Locale for translated info
|
54
|
+
# @return [MerchantMenusDto]
|
55
|
+
describe 'find_menus_for_reservation1 test' do
|
56
|
+
it 'should work' do
|
57
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# unit tests for get_menu_for_reservation1
|
62
|
+
# Get information about an available reservation menu
|
63
|
+
# This endpoint will return details for a single available menu. The reservation ID in the request is the public ID of the reservation and **not** agent-specific. This endpoint requires user to be logged in. The endpoint will return `HTTP 404 - Not Found` if the reservation or menu with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the user is not authenticated or the reservation doesn't belong to the customer associated with the user. ####Request: * **reservationId**: Public id of the reservation * **menuId**: Id of the menu * **locale**: Locale for translated info. Default: _en_ ####Response: The response will be a menu with each field as explained below: * **id**: The unique id of the menu * **name**: The name or title of the menu * **description**: Menu description * **price**: Total price for the menu * **sortOrder**: The order in which this menu should be displayed * **categories**: Categories of the menu * **id**: The id of the menu category * **name**: Name or title of the menu category * **items**: Items inside the menu category * **id**: Id of the menu item * **name**: Name of menu item * **description**: Menu item description * **price**: Item price Example curl: ``` curl https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/menus/1836?locale=en ``` Example response: ``` { \"id\": 1836, \"name\": \"special menu 1\", \"price\": \"100.00\", \"sortOrder\": 0, \"categories\": [ { \"id\": 1109, \"name\": \"starters\", \"items\": [ { \"id\": 1469, \"name\": \"fries\", \"price\": \"20.00\" } ] }, { \"id\": 1110, \"name\": \"fish\", \"items\": [ { \"id\": 1470, \"name\": \"salmon\", \"price\": \"60.00\" } ] }, { \"id\": 1111, \"name\": \"dessert\", \"items\": [ { \"id\": 1471, \"name\": \"sundae\", \"price\": \"20.00\" } ] } ] } ```
|
64
|
+
# @param reservation_id Public Id of the reservation
|
65
|
+
# @param menu_id Id of the menu
|
66
|
+
# @param [Hash] opts the optional parameters
|
67
|
+
# @option opts [String] :locale Locale for translated info
|
68
|
+
# @return [MerchantMenuDto]
|
69
|
+
describe 'get_menu_for_reservation1 test' do
|
70
|
+
it 'should work' do
|
71
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# unit tests for get_preordered_items1
|
76
|
+
# Get preorders of a reservation
|
77
|
+
# This endpoint will return the preordered menu items of a reservation. The reservation ID in the request is the public ID of the reservation and **not** agent-specific. This endpoint requires user to be logged in. The endpoint will return `HTTP 404 - Not Found` if the reservation with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the user is not authenticated or the reservation doesn't belong to the customer associated with the user. ####Request: * **reservationId**: Public ID of the reservation ####Response: The response will be a _list_ of menu items. Each menu item has the fields explained below: * **menuId**: The Id of the menu that this item belongs to * **itemId**: The Id of the menu item * **quantity**: Quantity of this menu item selected for the reservation * **guestPublicId**: The ID of the guest for whom this item has been preordered, if any. * **href**: Link that can be followed to get information about the menu and its available items Example curl: ``` curl https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/preorders ``` Example response: ``` { \"items\": [ { \"menuId\": 1846, \"itemId\": 1477, \"quantity\": 1, \"guestPublicId\": \"a8a66a11-446a-443b-8834-591742825ad4\", \"href\": \"https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/menus/1846\" }, { \"menuId\": 1846, \"itemId\": 1478, \"quantity\": 2, \"guestPublicId\": \"a8a66a11-446a-443b-8834-591742825ad4\", \"href\": \"https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/menus/1846\" } ] } ```
|
78
|
+
# @param reservation_id Public Id of the reservation
|
79
|
+
# @param [Hash] opts the optional parameters
|
80
|
+
# @return [ReservationMenuData]
|
81
|
+
describe 'get_preordered_items1 test' do
|
82
|
+
it 'should work' do
|
83
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# unit tests for save_preordered_items1
|
88
|
+
# Preorder menu items for a reservation
|
89
|
+
# This endpoint will preorder menu items for a reservation. The reservation ID in the request is the public ID of the reservation and **not** agent-specific. This endpoint requires user to be logged in. The endpoint will return `HTTP 404 - Not Found` if the reservation with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the user is not authenticated or the reservation doesn't belong to the customer associated with the user. ####Request: * **reservationId**: Public ID of the reservation. Path parameter. Request body has the same structure as Get Preorder response, except not having the `href` field. * **items**: List of menu items to be preordered. Each menu item will have the fields explained below. * **menuId**: The Id of the menu that this item belongs to. **Required**. * **itemId**: The Id of the menu item. **Required**. * **quantity**: Number of specified items to be preordered. **Required**. * **guestPublicId**: The ID of the guest for whom this item is being preordered. Optional. Format: UUID. ####Response: * **items**: The response will be a _list_ of successfully preordered menu items. Each menu item has the fields explained below: * **menuId**: The Id of the menu that this item belongs to * **itemId**: The Id of the menu item * **quantity**: Quantity of this menu item selected for the reservation * **guestPublicId**: The ID of the guest for whom this item has been preordered, if any. * **href**: Link that can be followed to get information about the menu and its available items Example curl: ``` curl -H \"Content Type: application/json\" -X PUT -d ' { \"items\": [ { \"menuId\": 1846, \"itemId\": 1477, \"quantity\": 1, \"guestPublicId\": \"a8a66a11-446a-443b-8834-591742825ad4\" }, { \"menuId\": 1846, \"itemId\": 1478, \"quantity\": 2 } ] } ' https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/preorders ``` Example response: ``` { \"items\": [ { \"menuId\": 1846, \"itemId\": 1477, \"quantity\": 1, \"guestPublicId\": \"a8a66a11-446a-443b-8834-591742825ad4\", \"href\": \"https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/menus/1846\" }, { \"menuId\": 1846, \"itemId\": 1478, \"quantity\": 2, \"href\": \"https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/menus/1846\" } ] } ```
|
90
|
+
# @param reservation_id Public Id of the reservation
|
91
|
+
# @param body Menu items for this reservation
|
92
|
+
# @param [Hash] opts the optional parameters
|
93
|
+
# @return [ReservationMenuData]
|
94
|
+
describe 'save_preordered_items1 test' do
|
95
|
+
it 'should work' do
|
96
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
end
|