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,185 @@
|
|
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 ReservationEnquiryMessageList
|
17
|
+
attr_accessor :messages
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'messages' => :'messages'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Attribute type mapping.
|
27
|
+
def self.swagger_types
|
28
|
+
{
|
29
|
+
:'messages' => :'Array<ReservationEnquiryMessageData>'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Initializes the object
|
34
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
+
def initialize(attributes = {})
|
36
|
+
return unless attributes.is_a?(Hash)
|
37
|
+
|
38
|
+
# convert string to symbol for hash key
|
39
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
40
|
+
|
41
|
+
if attributes.has_key?(:'messages')
|
42
|
+
if (value = attributes[:'messages']).is_a?(Array)
|
43
|
+
self.messages = value
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
49
|
+
# @return Array for valid properties with the reasons
|
50
|
+
def list_invalid_properties
|
51
|
+
invalid_properties = Array.new
|
52
|
+
invalid_properties
|
53
|
+
end
|
54
|
+
|
55
|
+
# Check to see if the all the properties in the model are valid
|
56
|
+
# @return true if the model is valid
|
57
|
+
def valid?
|
58
|
+
true
|
59
|
+
end
|
60
|
+
|
61
|
+
# Checks equality by comparing each attribute.
|
62
|
+
# @param [Object] Object to be compared
|
63
|
+
def ==(o)
|
64
|
+
return true if self.equal?(o)
|
65
|
+
self.class == o.class &&
|
66
|
+
messages == o.messages
|
67
|
+
end
|
68
|
+
|
69
|
+
# @see the `==` method
|
70
|
+
# @param [Object] Object to be compared
|
71
|
+
def eql?(o)
|
72
|
+
self == o
|
73
|
+
end
|
74
|
+
|
75
|
+
# Calculates hash code according to all attributes.
|
76
|
+
# @return [Fixnum] Hash code
|
77
|
+
def hash
|
78
|
+
[messages].hash
|
79
|
+
end
|
80
|
+
|
81
|
+
# Builds the object from hash
|
82
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
83
|
+
# @return [Object] Returns the model itself
|
84
|
+
def build_from_hash(attributes)
|
85
|
+
return nil unless attributes.is_a?(Hash)
|
86
|
+
self.class.swagger_types.each_pair do |key, type|
|
87
|
+
if type =~ /\AArray<(.*)>/i
|
88
|
+
# check to ensure the input is an array given that the the attribute
|
89
|
+
# is documented as an array but the input is not
|
90
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
91
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
92
|
+
end
|
93
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
94
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
95
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
96
|
+
end
|
97
|
+
|
98
|
+
self
|
99
|
+
end
|
100
|
+
|
101
|
+
# Deserializes the data based on type
|
102
|
+
# @param string type Data type
|
103
|
+
# @param string value Value to be deserialized
|
104
|
+
# @return [Object] Deserialized data
|
105
|
+
def _deserialize(type, value)
|
106
|
+
case type.to_sym
|
107
|
+
when :DateTime
|
108
|
+
DateTime.parse(value)
|
109
|
+
when :Date
|
110
|
+
Date.parse(value)
|
111
|
+
when :String
|
112
|
+
value.to_s
|
113
|
+
when :Integer
|
114
|
+
value.to_i
|
115
|
+
when :Float
|
116
|
+
value.to_f
|
117
|
+
when :BOOLEAN
|
118
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
119
|
+
true
|
120
|
+
else
|
121
|
+
false
|
122
|
+
end
|
123
|
+
when :Object
|
124
|
+
# generic object (usually a Hash), return directly
|
125
|
+
value
|
126
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
127
|
+
inner_type = Regexp.last_match[:inner_type]
|
128
|
+
value.map { |v| _deserialize(inner_type, v) }
|
129
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
130
|
+
k_type = Regexp.last_match[:k_type]
|
131
|
+
v_type = Regexp.last_match[:v_type]
|
132
|
+
{}.tap do |hash|
|
133
|
+
value.each do |k, v|
|
134
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
else # model
|
138
|
+
temp_model = Quandoo.const_get(type).new
|
139
|
+
temp_model.build_from_hash(value)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# Returns the string representation of the object
|
144
|
+
# @return [String] String presentation of the object
|
145
|
+
def to_s
|
146
|
+
to_hash.to_s
|
147
|
+
end
|
148
|
+
|
149
|
+
# to_body is an alias to to_hash (backward compatibility)
|
150
|
+
# @return [Hash] Returns the object in the form of hash
|
151
|
+
def to_body
|
152
|
+
to_hash
|
153
|
+
end
|
154
|
+
|
155
|
+
# Returns the object in the form of hash
|
156
|
+
# @return [Hash] Returns the object in the form of hash
|
157
|
+
def to_hash
|
158
|
+
hash = {}
|
159
|
+
self.class.attribute_map.each_pair do |attr, param|
|
160
|
+
value = self.send(attr)
|
161
|
+
next if value.nil?
|
162
|
+
hash[param] = _to_hash(value)
|
163
|
+
end
|
164
|
+
hash
|
165
|
+
end
|
166
|
+
|
167
|
+
# Outputs non-array value in the form of hash
|
168
|
+
# For object, use to_hash. Otherwise, just return the value
|
169
|
+
# @param [Object] value Any valid value
|
170
|
+
# @return [Hash] Returns the value in the form of hash
|
171
|
+
def _to_hash(value)
|
172
|
+
if value.is_a?(Array)
|
173
|
+
value.compact.map { |v| _to_hash(v) }
|
174
|
+
elsif value.is_a?(Hash)
|
175
|
+
{}.tap do |hash|
|
176
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
177
|
+
end
|
178
|
+
elsif value.respond_to? :to_hash
|
179
|
+
value.to_hash
|
180
|
+
else
|
181
|
+
value
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
@@ -0,0 +1,190 @@
|
|
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 ReservationMenuData
|
17
|
+
attr_accessor :items
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'items' => :'items'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Attribute type mapping.
|
27
|
+
def self.swagger_types
|
28
|
+
{
|
29
|
+
:'items' => :'Array<ReservationMenuItemData>'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Initializes the object
|
34
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
+
def initialize(attributes = {})
|
36
|
+
return unless attributes.is_a?(Hash)
|
37
|
+
|
38
|
+
# convert string to symbol for hash key
|
39
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
40
|
+
|
41
|
+
if attributes.has_key?(:'items')
|
42
|
+
if (value = attributes[:'items']).is_a?(Array)
|
43
|
+
self.items = value
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
49
|
+
# @return Array for valid properties with the reasons
|
50
|
+
def list_invalid_properties
|
51
|
+
invalid_properties = Array.new
|
52
|
+
if @items.nil?
|
53
|
+
invalid_properties.push('invalid value for "items", items cannot be nil.')
|
54
|
+
end
|
55
|
+
|
56
|
+
invalid_properties
|
57
|
+
end
|
58
|
+
|
59
|
+
# Check to see if the all the properties in the model are valid
|
60
|
+
# @return true if the model is valid
|
61
|
+
def valid?
|
62
|
+
return false if @items.nil?
|
63
|
+
true
|
64
|
+
end
|
65
|
+
|
66
|
+
# Checks equality by comparing each attribute.
|
67
|
+
# @param [Object] Object to be compared
|
68
|
+
def ==(o)
|
69
|
+
return true if self.equal?(o)
|
70
|
+
self.class == o.class &&
|
71
|
+
items == o.items
|
72
|
+
end
|
73
|
+
|
74
|
+
# @see the `==` method
|
75
|
+
# @param [Object] Object to be compared
|
76
|
+
def eql?(o)
|
77
|
+
self == o
|
78
|
+
end
|
79
|
+
|
80
|
+
# Calculates hash code according to all attributes.
|
81
|
+
# @return [Fixnum] Hash code
|
82
|
+
def hash
|
83
|
+
[items].hash
|
84
|
+
end
|
85
|
+
|
86
|
+
# Builds the object from hash
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
88
|
+
# @return [Object] Returns the model itself
|
89
|
+
def build_from_hash(attributes)
|
90
|
+
return nil unless attributes.is_a?(Hash)
|
91
|
+
self.class.swagger_types.each_pair do |key, type|
|
92
|
+
if type =~ /\AArray<(.*)>/i
|
93
|
+
# check to ensure the input is an array given that the the attribute
|
94
|
+
# is documented as an array but the input is not
|
95
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
96
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
97
|
+
end
|
98
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
99
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
100
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
101
|
+
end
|
102
|
+
|
103
|
+
self
|
104
|
+
end
|
105
|
+
|
106
|
+
# Deserializes the data based on type
|
107
|
+
# @param string type Data type
|
108
|
+
# @param string value Value to be deserialized
|
109
|
+
# @return [Object] Deserialized data
|
110
|
+
def _deserialize(type, value)
|
111
|
+
case type.to_sym
|
112
|
+
when :DateTime
|
113
|
+
DateTime.parse(value)
|
114
|
+
when :Date
|
115
|
+
Date.parse(value)
|
116
|
+
when :String
|
117
|
+
value.to_s
|
118
|
+
when :Integer
|
119
|
+
value.to_i
|
120
|
+
when :Float
|
121
|
+
value.to_f
|
122
|
+
when :BOOLEAN
|
123
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
124
|
+
true
|
125
|
+
else
|
126
|
+
false
|
127
|
+
end
|
128
|
+
when :Object
|
129
|
+
# generic object (usually a Hash), return directly
|
130
|
+
value
|
131
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
132
|
+
inner_type = Regexp.last_match[:inner_type]
|
133
|
+
value.map { |v| _deserialize(inner_type, v) }
|
134
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
135
|
+
k_type = Regexp.last_match[:k_type]
|
136
|
+
v_type = Regexp.last_match[:v_type]
|
137
|
+
{}.tap do |hash|
|
138
|
+
value.each do |k, v|
|
139
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
else # model
|
143
|
+
temp_model = Quandoo.const_get(type).new
|
144
|
+
temp_model.build_from_hash(value)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
# Returns the string representation of the object
|
149
|
+
# @return [String] String presentation of the object
|
150
|
+
def to_s
|
151
|
+
to_hash.to_s
|
152
|
+
end
|
153
|
+
|
154
|
+
# to_body is an alias to to_hash (backward compatibility)
|
155
|
+
# @return [Hash] Returns the object in the form of hash
|
156
|
+
def to_body
|
157
|
+
to_hash
|
158
|
+
end
|
159
|
+
|
160
|
+
# Returns the object in the form of hash
|
161
|
+
# @return [Hash] Returns the object in the form of hash
|
162
|
+
def to_hash
|
163
|
+
hash = {}
|
164
|
+
self.class.attribute_map.each_pair do |attr, param|
|
165
|
+
value = self.send(attr)
|
166
|
+
next if value.nil?
|
167
|
+
hash[param] = _to_hash(value)
|
168
|
+
end
|
169
|
+
hash
|
170
|
+
end
|
171
|
+
|
172
|
+
# Outputs non-array value in the form of hash
|
173
|
+
# For object, use to_hash. Otherwise, just return the value
|
174
|
+
# @param [Object] value Any valid value
|
175
|
+
# @return [Hash] Returns the value in the form of hash
|
176
|
+
def _to_hash(value)
|
177
|
+
if value.is_a?(Array)
|
178
|
+
value.compact.map { |v| _to_hash(v) }
|
179
|
+
elsif value.is_a?(Hash)
|
180
|
+
{}.tap do |hash|
|
181
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
182
|
+
end
|
183
|
+
elsif value.respond_to? :to_hash
|
184
|
+
value.to_hash
|
185
|
+
else
|
186
|
+
value
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
@@ -0,0 +1,219 @@
|
|
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 ReservationMenuItemData
|
17
|
+
attr_accessor :menu_id
|
18
|
+
|
19
|
+
attr_accessor :item_id
|
20
|
+
|
21
|
+
attr_accessor :guest_public_id
|
22
|
+
|
23
|
+
attr_accessor :quantity
|
24
|
+
|
25
|
+
attr_accessor :href
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'menu_id' => :'menuId',
|
31
|
+
:'item_id' => :'itemId',
|
32
|
+
:'guest_public_id' => :'guestPublicId',
|
33
|
+
:'quantity' => :'quantity',
|
34
|
+
:'href' => :'href'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.swagger_types
|
40
|
+
{
|
41
|
+
:'menu_id' => :'Integer',
|
42
|
+
:'item_id' => :'Integer',
|
43
|
+
:'guest_public_id' => :'String',
|
44
|
+
:'quantity' => :'Integer',
|
45
|
+
:'href' => :'String'
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
return unless attributes.is_a?(Hash)
|
53
|
+
|
54
|
+
# convert string to symbol for hash key
|
55
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
56
|
+
|
57
|
+
if attributes.has_key?(:'menuId')
|
58
|
+
self.menu_id = attributes[:'menuId']
|
59
|
+
end
|
60
|
+
|
61
|
+
if attributes.has_key?(:'itemId')
|
62
|
+
self.item_id = attributes[:'itemId']
|
63
|
+
end
|
64
|
+
|
65
|
+
if attributes.has_key?(:'guestPublicId')
|
66
|
+
self.guest_public_id = attributes[:'guestPublicId']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.has_key?(:'quantity')
|
70
|
+
self.quantity = attributes[:'quantity']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.has_key?(:'href')
|
74
|
+
self.href = attributes[:'href']
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
79
|
+
# @return Array for valid properties with the reasons
|
80
|
+
def list_invalid_properties
|
81
|
+
invalid_properties = Array.new
|
82
|
+
invalid_properties
|
83
|
+
end
|
84
|
+
|
85
|
+
# Check to see if the all the properties in the model are valid
|
86
|
+
# @return true if the model is valid
|
87
|
+
def valid?
|
88
|
+
true
|
89
|
+
end
|
90
|
+
|
91
|
+
# Checks equality by comparing each attribute.
|
92
|
+
# @param [Object] Object to be compared
|
93
|
+
def ==(o)
|
94
|
+
return true if self.equal?(o)
|
95
|
+
self.class == o.class &&
|
96
|
+
menu_id == o.menu_id &&
|
97
|
+
item_id == o.item_id &&
|
98
|
+
guest_public_id == o.guest_public_id &&
|
99
|
+
quantity == o.quantity &&
|
100
|
+
href == o.href
|
101
|
+
end
|
102
|
+
|
103
|
+
# @see the `==` method
|
104
|
+
# @param [Object] Object to be compared
|
105
|
+
def eql?(o)
|
106
|
+
self == o
|
107
|
+
end
|
108
|
+
|
109
|
+
# Calculates hash code according to all attributes.
|
110
|
+
# @return [Fixnum] Hash code
|
111
|
+
def hash
|
112
|
+
[menu_id, item_id, guest_public_id, quantity, href].hash
|
113
|
+
end
|
114
|
+
|
115
|
+
# Builds the object from hash
|
116
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
117
|
+
# @return [Object] Returns the model itself
|
118
|
+
def build_from_hash(attributes)
|
119
|
+
return nil unless attributes.is_a?(Hash)
|
120
|
+
self.class.swagger_types.each_pair do |key, type|
|
121
|
+
if type =~ /\AArray<(.*)>/i
|
122
|
+
# check to ensure the input is an array given that the the attribute
|
123
|
+
# is documented as an array but the input is not
|
124
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
125
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
126
|
+
end
|
127
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
128
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
129
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
130
|
+
end
|
131
|
+
|
132
|
+
self
|
133
|
+
end
|
134
|
+
|
135
|
+
# Deserializes the data based on type
|
136
|
+
# @param string type Data type
|
137
|
+
# @param string value Value to be deserialized
|
138
|
+
# @return [Object] Deserialized data
|
139
|
+
def _deserialize(type, value)
|
140
|
+
case type.to_sym
|
141
|
+
when :DateTime
|
142
|
+
DateTime.parse(value)
|
143
|
+
when :Date
|
144
|
+
Date.parse(value)
|
145
|
+
when :String
|
146
|
+
value.to_s
|
147
|
+
when :Integer
|
148
|
+
value.to_i
|
149
|
+
when :Float
|
150
|
+
value.to_f
|
151
|
+
when :BOOLEAN
|
152
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
153
|
+
true
|
154
|
+
else
|
155
|
+
false
|
156
|
+
end
|
157
|
+
when :Object
|
158
|
+
# generic object (usually a Hash), return directly
|
159
|
+
value
|
160
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
161
|
+
inner_type = Regexp.last_match[:inner_type]
|
162
|
+
value.map { |v| _deserialize(inner_type, v) }
|
163
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
164
|
+
k_type = Regexp.last_match[:k_type]
|
165
|
+
v_type = Regexp.last_match[:v_type]
|
166
|
+
{}.tap do |hash|
|
167
|
+
value.each do |k, v|
|
168
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
else # model
|
172
|
+
temp_model = Quandoo.const_get(type).new
|
173
|
+
temp_model.build_from_hash(value)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
# Returns the string representation of the object
|
178
|
+
# @return [String] String presentation of the object
|
179
|
+
def to_s
|
180
|
+
to_hash.to_s
|
181
|
+
end
|
182
|
+
|
183
|
+
# to_body is an alias to to_hash (backward compatibility)
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
185
|
+
def to_body
|
186
|
+
to_hash
|
187
|
+
end
|
188
|
+
|
189
|
+
# Returns the object in the form of hash
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
191
|
+
def to_hash
|
192
|
+
hash = {}
|
193
|
+
self.class.attribute_map.each_pair do |attr, param|
|
194
|
+
value = self.send(attr)
|
195
|
+
next if value.nil?
|
196
|
+
hash[param] = _to_hash(value)
|
197
|
+
end
|
198
|
+
hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# Outputs non-array value in the form of hash
|
202
|
+
# For object, use to_hash. Otherwise, just return the value
|
203
|
+
# @param [Object] value Any valid value
|
204
|
+
# @return [Hash] Returns the value in the form of hash
|
205
|
+
def _to_hash(value)
|
206
|
+
if value.is_a?(Array)
|
207
|
+
value.compact.map { |v| _to_hash(v) }
|
208
|
+
elsif value.is_a?(Hash)
|
209
|
+
{}.tap do |hash|
|
210
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
211
|
+
end
|
212
|
+
elsif value.respond_to? :to_hash
|
213
|
+
value.to_hash
|
214
|
+
else
|
215
|
+
value
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|