quandoo 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (238) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +197 -0
  4. data/Rakefile +8 -0
  5. data/config.json +8 -0
  6. data/docs/AgentTracking.md +8 -0
  7. data/docs/AreaDto.md +10 -0
  8. data/docs/AvailabilitiesApi.md +132 -0
  9. data/docs/ChainDto.md +9 -0
  10. data/docs/ChangedReviewDto.md +10 -0
  11. data/docs/CoordinatesDto.md +9 -0
  12. data/docs/CreateReviewDto.md +10 -0
  13. data/docs/CreatedMasterCustomer.md +8 -0
  14. data/docs/CreatedReservation.md +11 -0
  15. data/docs/CreatedReservationData.md +10 -0
  16. data/docs/CreatedReservationEnquiry.md +8 -0
  17. data/docs/CreatedReservationEnquiryData.md +10 -0
  18. data/docs/CustomerDataList.md +10 -0
  19. data/docs/CustomerDto.md +10 -0
  20. data/docs/CustomerResponse.md +17 -0
  21. data/docs/CustomerReviewData.md +11 -0
  22. data/docs/CustomerStatisticsData.md +10 -0
  23. data/docs/CustomersApi.md +183 -0
  24. data/docs/DealData.md +10 -0
  25. data/docs/DocumentDto.md +11 -0
  26. data/docs/ErrorResponse.md +9 -0
  27. data/docs/GetReservationEnquiryData.md +14 -0
  28. data/docs/GetReviewDto.md +14 -0
  29. data/docs/GetReviewsDto.md +11 -0
  30. data/docs/ImageDto.md +8 -0
  31. data/docs/LinkRelationDto.md +10 -0
  32. data/docs/LocationDto.md +9 -0
  33. data/docs/MarketingSettingDto.md +9 -0
  34. data/docs/MenusApi.md +300 -0
  35. data/docs/MerchantAddressDto.md +12 -0
  36. data/docs/MerchantAvailabilityDaysDto.md +9 -0
  37. data/docs/MerchantAvailabilityDto.md +11 -0
  38. data/docs/MerchantAvailabilityDtoList.md +10 -0
  39. data/docs/MerchantCustomer.md +15 -0
  40. data/docs/MerchantCustomerData.md +21 -0
  41. data/docs/MerchantDetailsDto.md +24 -0
  42. data/docs/MerchantDetailsDtoList.md +11 -0
  43. data/docs/MerchantMenuCategoryDto.md +10 -0
  44. data/docs/MerchantMenuDto.md +13 -0
  45. data/docs/MerchantMenuItemDto.md +11 -0
  46. data/docs/MerchantMenusDto.md +8 -0
  47. data/docs/MerchantReservation.md +18 -0
  48. data/docs/MerchantReservationData.md +10 -0
  49. data/docs/MerchantReservationEnquiry.md +13 -0
  50. data/docs/MerchantReservationEnquiryData.md +10 -0
  51. data/docs/MerchantReservationSettingsDto.md +18 -0
  52. data/docs/MerchantSubscription.md +8 -0
  53. data/docs/MerchantVaultSettingsDto.md +11 -0
  54. data/docs/MerchantWithRecommendationsDto.md +10 -0
  55. data/docs/MerchantsApi.md +334 -0
  56. data/docs/OpeningTimesDto.md +8 -0
  57. data/docs/ReservationData.md +18 -0
  58. data/docs/ReservationDataList.md +8 -0
  59. data/docs/ReservationDetails.md +11 -0
  60. data/docs/ReservationEnquiriesApi.md +230 -0
  61. data/docs/ReservationEnquiryMessageData.md +10 -0
  62. data/docs/ReservationEnquiryMessageList.md +8 -0
  63. data/docs/ReservationMenuData.md +8 -0
  64. data/docs/ReservationMenuItemData.md +12 -0
  65. data/docs/ReservationSettingsApi.md +56 -0
  66. data/docs/ReservationsApi.md +168 -0
  67. data/docs/RestCookie.md +9 -0
  68. data/docs/ReviewDto.md +12 -0
  69. data/docs/ReviewDtoList.md +11 -0
  70. data/docs/ReviewsApi.md +235 -0
  71. data/docs/StandardOpeningTimesDto.md +7 -0
  72. data/docs/StatusApi.md +90 -0
  73. data/docs/TagGroupDto.md +9 -0
  74. data/docs/Tracking.md +9 -0
  75. data/docs/TranslatedTagDto.md +9 -0
  76. data/docs/UpdateReservationData.md +8 -0
  77. data/docs/UpdateReservationEnquiryData.md +8 -0
  78. data/docs/UpdateReviewDto.md +10 -0
  79. data/docs/ValidationsApi.md +59 -0
  80. data/git_push.sh +55 -0
  81. data/lib/quandoo.rb +113 -0
  82. data/lib/quandoo/api/availabilities_api.rb +171 -0
  83. data/lib/quandoo/api/customers_api.rb +185 -0
  84. data/lib/quandoo/api/menus_api.rb +301 -0
  85. data/lib/quandoo/api/merchants_api.rb +357 -0
  86. data/lib/quandoo/api/reservation_enquiries_api.rb +232 -0
  87. data/lib/quandoo/api/reservation_settings_api.rb +73 -0
  88. data/lib/quandoo/api/reservations_api.rb +178 -0
  89. data/lib/quandoo/api/reviews_api.rb +241 -0
  90. data/lib/quandoo/api/status_api.rb +111 -0
  91. data/lib/quandoo/api/validations_api.rb +76 -0
  92. data/lib/quandoo/api_client.rb +389 -0
  93. data/lib/quandoo/api_error.rb +38 -0
  94. data/lib/quandoo/configuration.rb +216 -0
  95. data/lib/quandoo/models/agent_tracking.rb +189 -0
  96. data/lib/quandoo/models/area_dto.rb +204 -0
  97. data/lib/quandoo/models/chain_dto.rb +192 -0
  98. data/lib/quandoo/models/changed_review_dto.rb +250 -0
  99. data/lib/quandoo/models/coordinates_dto.rb +192 -0
  100. data/lib/quandoo/models/create_review_dto.rb +214 -0
  101. data/lib/quandoo/models/created_master_customer.rb +189 -0
  102. data/lib/quandoo/models/created_reservation.rb +229 -0
  103. data/lib/quandoo/models/created_reservation_data.rb +221 -0
  104. data/lib/quandoo/models/created_reservation_enquiry.rb +189 -0
  105. data/lib/quandoo/models/created_reservation_enquiry_data.rb +221 -0
  106. data/lib/quandoo/models/customer_data_list.rb +203 -0
  107. data/lib/quandoo/models/customer_dto.rb +201 -0
  108. data/lib/quandoo/models/customer_response.rb +362 -0
  109. data/lib/quandoo/models/customer_review_data.rb +214 -0
  110. data/lib/quandoo/models/customer_statistics_data.rb +219 -0
  111. data/lib/quandoo/models/deal_data.rb +253 -0
  112. data/lib/quandoo/models/document_dto.rb +210 -0
  113. data/lib/quandoo/models/error_response.rb +226 -0
  114. data/lib/quandoo/models/get_reservation_enquiry_data.rb +249 -0
  115. data/lib/quandoo/models/get_review_dto.rb +288 -0
  116. data/lib/quandoo/models/get_reviews_dto.rb +216 -0
  117. data/lib/quandoo/models/image_dto.rb +183 -0
  118. data/lib/quandoo/models/link_relation_dto.rb +235 -0
  119. data/lib/quandoo/models/location_dto.rb +192 -0
  120. data/lib/quandoo/models/marketing_setting_dto.rb +238 -0
  121. data/lib/quandoo/models/merchant_address_dto.rb +219 -0
  122. data/lib/quandoo/models/merchant_availability_days_dto.rb +198 -0
  123. data/lib/quandoo/models/merchant_availability_dto.rb +226 -0
  124. data/lib/quandoo/models/merchant_availability_dto_list.rb +215 -0
  125. data/lib/quandoo/models/merchant_customer.rb +271 -0
  126. data/lib/quandoo/models/merchant_customer_data.rb +390 -0
  127. data/lib/quandoo/models/merchant_details_dto.rb +402 -0
  128. data/lib/quandoo/models/merchant_details_dto_list.rb +218 -0
  129. data/lib/quandoo/models/merchant_menu_category_dto.rb +216 -0
  130. data/lib/quandoo/models/merchant_menu_dto.rb +251 -0
  131. data/lib/quandoo/models/merchant_menu_item_dto.rb +224 -0
  132. data/lib/quandoo/models/merchant_menus_dto.rb +185 -0
  133. data/lib/quandoo/models/merchant_reservation.rb +301 -0
  134. data/lib/quandoo/models/merchant_reservation_data.rb +219 -0
  135. data/lib/quandoo/models/merchant_reservation_enquiry.rb +311 -0
  136. data/lib/quandoo/models/merchant_reservation_enquiry_data.rb +219 -0
  137. data/lib/quandoo/models/merchant_reservation_settings_dto.rb +290 -0
  138. data/lib/quandoo/models/merchant_subscription.rb +217 -0
  139. data/lib/quandoo/models/merchant_vault_settings_dto.rb +231 -0
  140. data/lib/quandoo/models/merchant_with_recommendations_dto.rb +248 -0
  141. data/lib/quandoo/models/opening_times_dto.rb +189 -0
  142. data/lib/quandoo/models/reservation_data.rb +331 -0
  143. data/lib/quandoo/models/reservation_data_list.rb +185 -0
  144. data/lib/quandoo/models/reservation_details.rb +229 -0
  145. data/lib/quandoo/models/reservation_enquiry_message_data.rb +241 -0
  146. data/lib/quandoo/models/reservation_enquiry_message_list.rb +185 -0
  147. data/lib/quandoo/models/reservation_menu_data.rb +190 -0
  148. data/lib/quandoo/models/reservation_menu_item_data.rb +219 -0
  149. data/lib/quandoo/models/rest_cookie.rb +194 -0
  150. data/lib/quandoo/models/review_dto.rb +238 -0
  151. data/lib/quandoo/models/review_dto_list.rb +218 -0
  152. data/lib/quandoo/models/standard_opening_times_dto.rb +174 -0
  153. data/lib/quandoo/models/tag_group_dto.rb +228 -0
  154. data/lib/quandoo/models/tracking.rb +199 -0
  155. data/lib/quandoo/models/translated_tag_dto.rb +192 -0
  156. data/lib/quandoo/models/update_reservation_data.rb +189 -0
  157. data/lib/quandoo/models/update_reservation_enquiry_data.rb +184 -0
  158. data/lib/quandoo/models/update_review_dto.rb +209 -0
  159. data/lib/quandoo/version.rb +15 -0
  160. data/quandoo.gemspec +45 -0
  161. data/spec/api/availabilities_api_spec.rb +69 -0
  162. data/spec/api/customers_api_spec.rb +75 -0
  163. data/spec/api/menus_api_spec.rb +100 -0
  164. data/spec/api/merchants_api_spec.rb +119 -0
  165. data/spec/api/reservation_enquiries_api_spec.rb +84 -0
  166. data/spec/api/reservation_settings_api_spec.rb +47 -0
  167. data/spec/api/reservations_api_spec.rb +72 -0
  168. data/spec/api/reviews_api_spec.rb +86 -0
  169. data/spec/api/status_api_spec.rb +57 -0
  170. data/spec/api/validations_api_spec.rb +48 -0
  171. data/spec/api_client_spec.rb +226 -0
  172. data/spec/configuration_spec.rb +42 -0
  173. data/spec/models/agent_tracking_spec.rb +41 -0
  174. data/spec/models/area_dto_spec.rb +53 -0
  175. data/spec/models/chain_dto_spec.rb +47 -0
  176. data/spec/models/changed_review_dto_spec.rb +57 -0
  177. data/spec/models/coordinates_dto_spec.rb +47 -0
  178. data/spec/models/create_review_dto_spec.rb +53 -0
  179. data/spec/models/created_master_customer_spec.rb +41 -0
  180. data/spec/models/created_reservation_data_spec.rb +53 -0
  181. data/spec/models/created_reservation_enquiry_data_spec.rb +53 -0
  182. data/spec/models/created_reservation_enquiry_spec.rb +41 -0
  183. data/spec/models/created_reservation_spec.rb +59 -0
  184. data/spec/models/customer_data_list_spec.rb +53 -0
  185. data/spec/models/customer_dto_spec.rb +53 -0
  186. data/spec/models/customer_response_spec.rb +99 -0
  187. data/spec/models/customer_review_data_spec.rb +59 -0
  188. data/spec/models/customer_statistics_data_spec.rb +53 -0
  189. data/spec/models/deal_data_spec.rb +57 -0
  190. data/spec/models/document_dto_spec.rb +59 -0
  191. data/spec/models/error_response_spec.rb +51 -0
  192. data/spec/models/get_reservation_enquiry_data_spec.rb +77 -0
  193. data/spec/models/get_review_dto_spec.rb +81 -0
  194. data/spec/models/get_reviews_dto_spec.rb +59 -0
  195. data/spec/models/image_dto_spec.rb +41 -0
  196. data/spec/models/link_relation_dto_spec.rb +57 -0
  197. data/spec/models/location_dto_spec.rb +47 -0
  198. data/spec/models/marketing_setting_dto_spec.rb +55 -0
  199. data/spec/models/merchant_address_dto_spec.rb +65 -0
  200. data/spec/models/merchant_availability_days_dto_spec.rb +47 -0
  201. data/spec/models/merchant_availability_dto_list_spec.rb +53 -0
  202. data/spec/models/merchant_availability_dto_spec.rb +59 -0
  203. data/spec/models/merchant_customer_data_spec.rb +119 -0
  204. data/spec/models/merchant_customer_spec.rb +83 -0
  205. data/spec/models/merchant_details_dto_list_spec.rb +59 -0
  206. data/spec/models/merchant_details_dto_spec.rb +137 -0
  207. data/spec/models/merchant_menu_category_dto_spec.rb +53 -0
  208. data/spec/models/merchant_menu_dto_spec.rb +71 -0
  209. data/spec/models/merchant_menu_item_dto_spec.rb +59 -0
  210. data/spec/models/merchant_menus_dto_spec.rb +41 -0
  211. data/spec/models/merchant_reservation_data_spec.rb +53 -0
  212. data/spec/models/merchant_reservation_enquiry_data_spec.rb +53 -0
  213. data/spec/models/merchant_reservation_enquiry_spec.rb +71 -0
  214. data/spec/models/merchant_reservation_settings_dto_spec.rb +101 -0
  215. data/spec/models/merchant_reservation_spec.rb +101 -0
  216. data/spec/models/merchant_subscription_spec.rb +45 -0
  217. data/spec/models/merchant_vault_settings_dto_spec.rb +59 -0
  218. data/spec/models/merchant_with_recommendations_dto_spec.rb +57 -0
  219. data/spec/models/opening_times_dto_spec.rb +41 -0
  220. data/spec/models/reservation_data_list_spec.rb +41 -0
  221. data/spec/models/reservation_data_spec.rb +101 -0
  222. data/spec/models/reservation_details_spec.rb +59 -0
  223. data/spec/models/reservation_enquiry_message_data_spec.rb +57 -0
  224. data/spec/models/reservation_enquiry_message_list_spec.rb +41 -0
  225. data/spec/models/reservation_menu_data_spec.rb +41 -0
  226. data/spec/models/reservation_menu_item_data_spec.rb +65 -0
  227. data/spec/models/rest_cookie_spec.rb +47 -0
  228. data/spec/models/review_dto_list_spec.rb +59 -0
  229. data/spec/models/review_dto_spec.rb +65 -0
  230. data/spec/models/standard_opening_times_dto_spec.rb +35 -0
  231. data/spec/models/tag_group_dto_spec.rb +51 -0
  232. data/spec/models/tracking_spec.rb +47 -0
  233. data/spec/models/translated_tag_dto_spec.rb +47 -0
  234. data/spec/models/update_reservation_data_spec.rb +41 -0
  235. data/spec/models/update_reservation_enquiry_data_spec.rb +41 -0
  236. data/spec/models/update_review_dto_spec.rb +53 -0
  237. data/spec/spec_helper.rb +111 -0
  238. metadata +538 -0
@@ -0,0 +1,402 @@
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 MerchantDetailsDto
17
+ # The id of the merchant.
18
+ attr_accessor :id
19
+
20
+ # The name of the merchant.
21
+ attr_accessor :name
22
+
23
+ # The phone number of the merchant.
24
+ attr_accessor :phone_number
25
+
26
+ # The currency of the merchant.
27
+ attr_accessor :currency
28
+
29
+ # The locale of the merchant.
30
+ attr_accessor :locale
31
+
32
+ # The timezone of the merchant.
33
+ attr_accessor :timezone
34
+
35
+ # The location of the merchant.
36
+ attr_accessor :location
37
+
38
+ # The review score of the merchant.
39
+ attr_accessor :review_score
40
+
41
+ # The tag groups this merchant belongs to.
42
+ attr_accessor :tag_groups
43
+
44
+ # The images this merchant has.
45
+ attr_accessor :images
46
+
47
+ # The documents this merchant has.
48
+ attr_accessor :documents
49
+
50
+ # The links related to this entity.
51
+ attr_accessor :links
52
+
53
+ # The flag indicates whether the merchant is bookable or not.
54
+ attr_accessor :bookable
55
+
56
+ # All opening times of the merchant.
57
+ attr_accessor :opening_times
58
+
59
+ # If true, credit card information is required when creating a reservation.
60
+ attr_accessor :ccv_enabled
61
+
62
+ # The chain of the merchant.
63
+ attr_accessor :chain
64
+
65
+ # The IVR forwarding phone number.
66
+ attr_accessor :ivr_redirect_number
67
+
68
+ # Attribute mapping from ruby-style variable name to JSON key.
69
+ def self.attribute_map
70
+ {
71
+ :'id' => :'id',
72
+ :'name' => :'name',
73
+ :'phone_number' => :'phoneNumber',
74
+ :'currency' => :'currency',
75
+ :'locale' => :'locale',
76
+ :'timezone' => :'timezone',
77
+ :'location' => :'location',
78
+ :'review_score' => :'reviewScore',
79
+ :'tag_groups' => :'tagGroups',
80
+ :'images' => :'images',
81
+ :'documents' => :'documents',
82
+ :'links' => :'links',
83
+ :'bookable' => :'bookable',
84
+ :'opening_times' => :'openingTimes',
85
+ :'ccv_enabled' => :'ccvEnabled',
86
+ :'chain' => :'chain',
87
+ :'ivr_redirect_number' => :'ivrRedirectNumber'
88
+ }
89
+ end
90
+
91
+ # Attribute type mapping.
92
+ def self.swagger_types
93
+ {
94
+ :'id' => :'Integer',
95
+ :'name' => :'String',
96
+ :'phone_number' => :'String',
97
+ :'currency' => :'String',
98
+ :'locale' => :'String',
99
+ :'timezone' => :'String',
100
+ :'location' => :'LocationDto',
101
+ :'review_score' => :'String',
102
+ :'tag_groups' => :'Array<TagGroupDto>',
103
+ :'images' => :'Array<ImageDto>',
104
+ :'documents' => :'Array<DocumentDto>',
105
+ :'links' => :'Array<LinkRelationDto>',
106
+ :'bookable' => :'BOOLEAN',
107
+ :'opening_times' => :'OpeningTimesDto',
108
+ :'ccv_enabled' => :'BOOLEAN',
109
+ :'chain' => :'ChainDto',
110
+ :'ivr_redirect_number' => :'String'
111
+ }
112
+ end
113
+
114
+ # Initializes the object
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ def initialize(attributes = {})
117
+ return unless attributes.is_a?(Hash)
118
+
119
+ # convert string to symbol for hash key
120
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
121
+
122
+ if attributes.has_key?(:'id')
123
+ self.id = attributes[:'id']
124
+ end
125
+
126
+ if attributes.has_key?(:'name')
127
+ self.name = attributes[:'name']
128
+ end
129
+
130
+ if attributes.has_key?(:'phoneNumber')
131
+ self.phone_number = attributes[:'phoneNumber']
132
+ end
133
+
134
+ if attributes.has_key?(:'currency')
135
+ self.currency = attributes[:'currency']
136
+ end
137
+
138
+ if attributes.has_key?(:'locale')
139
+ self.locale = attributes[:'locale']
140
+ end
141
+
142
+ if attributes.has_key?(:'timezone')
143
+ self.timezone = attributes[:'timezone']
144
+ end
145
+
146
+ if attributes.has_key?(:'location')
147
+ self.location = attributes[:'location']
148
+ end
149
+
150
+ if attributes.has_key?(:'reviewScore')
151
+ self.review_score = attributes[:'reviewScore']
152
+ end
153
+
154
+ if attributes.has_key?(:'tagGroups')
155
+ if (value = attributes[:'tagGroups']).is_a?(Array)
156
+ self.tag_groups = value
157
+ end
158
+ end
159
+
160
+ if attributes.has_key?(:'images')
161
+ if (value = attributes[:'images']).is_a?(Array)
162
+ self.images = value
163
+ end
164
+ end
165
+
166
+ if attributes.has_key?(:'documents')
167
+ if (value = attributes[:'documents']).is_a?(Array)
168
+ self.documents = value
169
+ end
170
+ end
171
+
172
+ if attributes.has_key?(:'links')
173
+ if (value = attributes[:'links']).is_a?(Array)
174
+ self.links = value
175
+ end
176
+ end
177
+
178
+ if attributes.has_key?(:'bookable')
179
+ self.bookable = attributes[:'bookable']
180
+ end
181
+
182
+ if attributes.has_key?(:'openingTimes')
183
+ self.opening_times = attributes[:'openingTimes']
184
+ end
185
+
186
+ if attributes.has_key?(:'ccvEnabled')
187
+ self.ccv_enabled = attributes[:'ccvEnabled']
188
+ end
189
+
190
+ if attributes.has_key?(:'chain')
191
+ self.chain = attributes[:'chain']
192
+ end
193
+
194
+ if attributes.has_key?(:'ivrRedirectNumber')
195
+ self.ivr_redirect_number = attributes[:'ivrRedirectNumber']
196
+ end
197
+ end
198
+
199
+ # Show invalid properties with the reasons. Usually used together with valid?
200
+ # @return Array for valid properties with the reasons
201
+ def list_invalid_properties
202
+ invalid_properties = Array.new
203
+ if @id.nil?
204
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
205
+ end
206
+
207
+ if @name.nil?
208
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
209
+ end
210
+
211
+ if @phone_number.nil?
212
+ invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
213
+ end
214
+
215
+ if @timezone.nil?
216
+ invalid_properties.push('invalid value for "timezone", timezone cannot be nil.')
217
+ end
218
+
219
+ if @location.nil?
220
+ invalid_properties.push('invalid value for "location", location cannot be nil.')
221
+ end
222
+
223
+ if @review_score.nil?
224
+ invalid_properties.push('invalid value for "review_score", review_score cannot be nil.')
225
+ end
226
+
227
+ if @links.nil?
228
+ invalid_properties.push('invalid value for "links", links cannot be nil.')
229
+ end
230
+
231
+ if @bookable.nil?
232
+ invalid_properties.push('invalid value for "bookable", bookable cannot be nil.')
233
+ end
234
+
235
+ if @opening_times.nil?
236
+ invalid_properties.push('invalid value for "opening_times", opening_times cannot be nil.')
237
+ end
238
+
239
+ if @ccv_enabled.nil?
240
+ invalid_properties.push('invalid value for "ccv_enabled", ccv_enabled cannot be nil.')
241
+ end
242
+
243
+ invalid_properties
244
+ end
245
+
246
+ # Check to see if the all the properties in the model are valid
247
+ # @return true if the model is valid
248
+ def valid?
249
+ return false if @id.nil?
250
+ return false if @name.nil?
251
+ return false if @phone_number.nil?
252
+ return false if @timezone.nil?
253
+ return false if @location.nil?
254
+ return false if @review_score.nil?
255
+ return false if @links.nil?
256
+ return false if @bookable.nil?
257
+ return false if @opening_times.nil?
258
+ return false if @ccv_enabled.nil?
259
+ true
260
+ end
261
+
262
+ # Checks equality by comparing each attribute.
263
+ # @param [Object] Object to be compared
264
+ def ==(o)
265
+ return true if self.equal?(o)
266
+ self.class == o.class &&
267
+ id == o.id &&
268
+ name == o.name &&
269
+ phone_number == o.phone_number &&
270
+ currency == o.currency &&
271
+ locale == o.locale &&
272
+ timezone == o.timezone &&
273
+ location == o.location &&
274
+ review_score == o.review_score &&
275
+ tag_groups == o.tag_groups &&
276
+ images == o.images &&
277
+ documents == o.documents &&
278
+ links == o.links &&
279
+ bookable == o.bookable &&
280
+ opening_times == o.opening_times &&
281
+ ccv_enabled == o.ccv_enabled &&
282
+ chain == o.chain &&
283
+ ivr_redirect_number == o.ivr_redirect_number
284
+ end
285
+
286
+ # @see the `==` method
287
+ # @param [Object] Object to be compared
288
+ def eql?(o)
289
+ self == o
290
+ end
291
+
292
+ # Calculates hash code according to all attributes.
293
+ # @return [Fixnum] Hash code
294
+ def hash
295
+ [id, name, phone_number, currency, locale, timezone, location, review_score, tag_groups, images, documents, links, bookable, opening_times, ccv_enabled, chain, ivr_redirect_number].hash
296
+ end
297
+
298
+ # Builds the object from hash
299
+ # @param [Hash] attributes Model attributes in the form of hash
300
+ # @return [Object] Returns the model itself
301
+ def build_from_hash(attributes)
302
+ return nil unless attributes.is_a?(Hash)
303
+ self.class.swagger_types.each_pair do |key, type|
304
+ if type =~ /\AArray<(.*)>/i
305
+ # check to ensure the input is an array given that the the attribute
306
+ # is documented as an array but the input is not
307
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
308
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
309
+ end
310
+ elsif !attributes[self.class.attribute_map[key]].nil?
311
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
312
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
313
+ end
314
+
315
+ self
316
+ end
317
+
318
+ # Deserializes the data based on type
319
+ # @param string type Data type
320
+ # @param string value Value to be deserialized
321
+ # @return [Object] Deserialized data
322
+ def _deserialize(type, value)
323
+ case type.to_sym
324
+ when :DateTime
325
+ DateTime.parse(value)
326
+ when :Date
327
+ Date.parse(value)
328
+ when :String
329
+ value.to_s
330
+ when :Integer
331
+ value.to_i
332
+ when :Float
333
+ value.to_f
334
+ when :BOOLEAN
335
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
336
+ true
337
+ else
338
+ false
339
+ end
340
+ when :Object
341
+ # generic object (usually a Hash), return directly
342
+ value
343
+ when /\AArray<(?<inner_type>.+)>\z/
344
+ inner_type = Regexp.last_match[:inner_type]
345
+ value.map { |v| _deserialize(inner_type, v) }
346
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
347
+ k_type = Regexp.last_match[:k_type]
348
+ v_type = Regexp.last_match[:v_type]
349
+ {}.tap do |hash|
350
+ value.each do |k, v|
351
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
352
+ end
353
+ end
354
+ else # model
355
+ temp_model = Quandoo.const_get(type).new
356
+ temp_model.build_from_hash(value)
357
+ end
358
+ end
359
+
360
+ # Returns the string representation of the object
361
+ # @return [String] String presentation of the object
362
+ def to_s
363
+ to_hash.to_s
364
+ end
365
+
366
+ # to_body is an alias to to_hash (backward compatibility)
367
+ # @return [Hash] Returns the object in the form of hash
368
+ def to_body
369
+ to_hash
370
+ end
371
+
372
+ # Returns the object in the form of hash
373
+ # @return [Hash] Returns the object in the form of hash
374
+ def to_hash
375
+ hash = {}
376
+ self.class.attribute_map.each_pair do |attr, param|
377
+ value = self.send(attr)
378
+ next if value.nil?
379
+ hash[param] = _to_hash(value)
380
+ end
381
+ hash
382
+ end
383
+
384
+ # Outputs non-array value in the form of hash
385
+ # For object, use to_hash. Otherwise, just return the value
386
+ # @param [Object] value Any valid value
387
+ # @return [Hash] Returns the value in the form of hash
388
+ def _to_hash(value)
389
+ if value.is_a?(Array)
390
+ value.compact.map { |v| _to_hash(v) }
391
+ elsif value.is_a?(Hash)
392
+ {}.tap do |hash|
393
+ value.each { |k, v| hash[k] = _to_hash(v) }
394
+ end
395
+ elsif value.respond_to? :to_hash
396
+ value.to_hash
397
+ else
398
+ value
399
+ end
400
+ end
401
+ end
402
+ end
@@ -0,0 +1,218 @@
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 MerchantDetailsDtoList
17
+ # Merchant details collection.
18
+ attr_accessor :merchants
19
+
20
+ attr_accessor :size
21
+
22
+ attr_accessor :offset
23
+
24
+ attr_accessor :limit
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'merchants' => :'merchants',
30
+ :'size' => :'size',
31
+ :'offset' => :'offset',
32
+ :'limit' => :'limit'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.swagger_types
38
+ {
39
+ :'merchants' => :'Array<MerchantDetailsDto>',
40
+ :'size' => :'Integer',
41
+ :'offset' => :'Integer',
42
+ :'limit' => :'Integer'
43
+ }
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ return unless attributes.is_a?(Hash)
50
+
51
+ # convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
53
+
54
+ if attributes.has_key?(:'merchants')
55
+ if (value = attributes[:'merchants']).is_a?(Array)
56
+ self.merchants = value
57
+ end
58
+ end
59
+
60
+ if attributes.has_key?(:'size')
61
+ self.size = attributes[:'size']
62
+ end
63
+
64
+ if attributes.has_key?(:'offset')
65
+ self.offset = attributes[:'offset']
66
+ end
67
+
68
+ if attributes.has_key?(:'limit')
69
+ self.limit = attributes[:'limit']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ if @merchants.nil?
78
+ invalid_properties.push('invalid value for "merchants", merchants cannot be nil.')
79
+ end
80
+
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ return false if @merchants.nil?
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
+ merchants == o.merchants &&
97
+ size == o.size &&
98
+ offset == o.offset &&
99
+ limit == o.limit
100
+ end
101
+
102
+ # @see the `==` method
103
+ # @param [Object] Object to be compared
104
+ def eql?(o)
105
+ self == o
106
+ end
107
+
108
+ # Calculates hash code according to all attributes.
109
+ # @return [Fixnum] Hash code
110
+ def hash
111
+ [merchants, size, offset, limit].hash
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ self.class.swagger_types.each_pair do |key, type|
120
+ if type =~ /\AArray<(.*)>/i
121
+ # check to ensure the input is an array given that the the attribute
122
+ # is documented as an array but the input is not
123
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
124
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
125
+ end
126
+ elsif !attributes[self.class.attribute_map[key]].nil?
127
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
128
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
129
+ end
130
+
131
+ self
132
+ end
133
+
134
+ # Deserializes the data based on type
135
+ # @param string type Data type
136
+ # @param string value Value to be deserialized
137
+ # @return [Object] Deserialized data
138
+ def _deserialize(type, value)
139
+ case type.to_sym
140
+ when :DateTime
141
+ DateTime.parse(value)
142
+ when :Date
143
+ Date.parse(value)
144
+ when :String
145
+ value.to_s
146
+ when :Integer
147
+ value.to_i
148
+ when :Float
149
+ value.to_f
150
+ when :BOOLEAN
151
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
152
+ true
153
+ else
154
+ false
155
+ end
156
+ when :Object
157
+ # generic object (usually a Hash), return directly
158
+ value
159
+ when /\AArray<(?<inner_type>.+)>\z/
160
+ inner_type = Regexp.last_match[:inner_type]
161
+ value.map { |v| _deserialize(inner_type, v) }
162
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
163
+ k_type = Regexp.last_match[:k_type]
164
+ v_type = Regexp.last_match[:v_type]
165
+ {}.tap do |hash|
166
+ value.each do |k, v|
167
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
168
+ end
169
+ end
170
+ else # model
171
+ temp_model = Quandoo.const_get(type).new
172
+ temp_model.build_from_hash(value)
173
+ end
174
+ end
175
+
176
+ # Returns the string representation of the object
177
+ # @return [String] String presentation of the object
178
+ def to_s
179
+ to_hash.to_s
180
+ end
181
+
182
+ # to_body is an alias to to_hash (backward compatibility)
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_body
185
+ to_hash
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = self.send(attr)
194
+ next if value.nil?
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+ end
218
+ end