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,301 @@
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 'uri'
14
+
15
+ module Quandoo
16
+ class MenusApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Add/remove menu items to/from a reservation's preorders
23
+ # 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\" } ] } ```
24
+ # @param reservation_id Public Id of the reservation
25
+ # @param body Menu items to add
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [ReservationMenuData]
28
+ def add_preordered_items1(reservation_id, body, opts = {})
29
+ data, _status_code, _headers = add_preordered_items1_with_http_info(reservation_id, body, opts)
30
+ data
31
+ end
32
+
33
+ # Add/remove menu items to/from a reservation's preorders
34
+ # 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\" } ] } ```
35
+ # @param reservation_id Public Id of the reservation
36
+ # @param body Menu items to add
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(ReservationMenuData, Fixnum, Hash)>] ReservationMenuData data, response status code and response headers
39
+ def add_preordered_items1_with_http_info(reservation_id, body, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: MenusApi.add_preordered_items1 ...'
42
+ end
43
+ # verify the required parameter 'reservation_id' is set
44
+ if @api_client.config.client_side_validation && reservation_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'reservation_id' when calling MenusApi.add_preordered_items1"
46
+ end
47
+ # verify the required parameter 'body' is set
48
+ if @api_client.config.client_side_validation && body.nil?
49
+ fail ArgumentError, "Missing the required parameter 'body' when calling MenusApi.add_preordered_items1"
50
+ end
51
+ # resource path
52
+ local_var_path = '/v1/reservations/{reservationId}/preorders'.sub('{' + 'reservationId' + '}', reservation_id.to_s)
53
+
54
+ # query parameters
55
+ query_params = {}
56
+
57
+ # header parameters
58
+ header_params = {}
59
+ # HTTP header 'Content-Type'
60
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
61
+
62
+ # form parameters
63
+ form_params = {}
64
+
65
+ # http body (model)
66
+ post_body = @api_client.object_to_http_body(body)
67
+ auth_names = ['CUSTOMER_SESSION']
68
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
69
+ :header_params => header_params,
70
+ :query_params => query_params,
71
+ :form_params => form_params,
72
+ :body => post_body,
73
+ :auth_names => auth_names,
74
+ :return_type => 'ReservationMenuData')
75
+ if @api_client.config.debugging
76
+ @api_client.config.logger.debug "API called: MenusApi#add_preordered_items1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
77
+ end
78
+ return data, status_code, headers
79
+ end
80
+ # Get all available menus for a reservation
81
+ # 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\" } ] } ] } ] } ```
82
+ # @param reservation_id Public Id of the reservation
83
+ # @param [Hash] opts the optional parameters
84
+ # @option opts [String] :locale Locale for translated info (default to en)
85
+ # @return [MerchantMenusDto]
86
+ def find_menus_for_reservation1(reservation_id, opts = {})
87
+ data, _status_code, _headers = find_menus_for_reservation1_with_http_info(reservation_id, opts)
88
+ data
89
+ end
90
+
91
+ # Get all available menus for a reservation
92
+ # 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 &#x60;HTTP 404 - Not Found&#x60; if the reservation with the specified id could not be found. It will return &#x60;HTTP 403 - Forbidden&#x60; if the user is not authenticated or the reservation doesn&#39;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: &#x60;&#x60;&#x60; curl https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/menus?locale&#x3D;en &#x60;&#x60;&#x60; Example response: &#x60;&#x60;&#x60; { \&quot;menus\&quot;: [ { \&quot;id\&quot;: 1836, \&quot;name\&quot;: \&quot;special menu 1\&quot;, \&quot;price\&quot;: \&quot;100.00\&quot;, \&quot;sortOrder\&quot;: 0, \&quot;categories\&quot;: [ { \&quot;id\&quot;: 1109, \&quot;name\&quot;: \&quot;starters\&quot;, \&quot;items\&quot;: [ { \&quot;id\&quot;: 1469, \&quot;name\&quot;: \&quot;fries\&quot;, \&quot;price\&quot;: \&quot;20.00\&quot; } ] }, { \&quot;id\&quot;: 1110, \&quot;name\&quot;: \&quot;fish\&quot;, \&quot;items\&quot;: [ { \&quot;id\&quot;: 1470, \&quot;name\&quot;: \&quot;salmon\&quot;, \&quot;price\&quot;: \&quot;60.00\&quot; } ] }, { \&quot;id\&quot;: 1111, \&quot;name\&quot;: \&quot;dessert\&quot;, \&quot;items\&quot;: [ { \&quot;id\&quot;: 1471, \&quot;name\&quot;: \&quot;sundae\&quot;, \&quot;price\&quot;: \&quot;20.00\&quot; } ] } ] } ] } &#x60;&#x60;&#x60;
93
+ # @param reservation_id Public Id of the reservation
94
+ # @param [Hash] opts the optional parameters
95
+ # @option opts [String] :locale Locale for translated info
96
+ # @return [Array<(MerchantMenusDto, Fixnum, Hash)>] MerchantMenusDto data, response status code and response headers
97
+ def find_menus_for_reservation1_with_http_info(reservation_id, opts = {})
98
+ if @api_client.config.debugging
99
+ @api_client.config.logger.debug 'Calling API: MenusApi.find_menus_for_reservation1 ...'
100
+ end
101
+ # verify the required parameter 'reservation_id' is set
102
+ if @api_client.config.client_side_validation && reservation_id.nil?
103
+ fail ArgumentError, "Missing the required parameter 'reservation_id' when calling MenusApi.find_menus_for_reservation1"
104
+ end
105
+ # resource path
106
+ local_var_path = '/v1/reservations/{reservationId}/menus'.sub('{' + 'reservationId' + '}', reservation_id.to_s)
107
+
108
+ # query parameters
109
+ query_params = {}
110
+ query_params[:'locale'] = opts[:'locale'] if !opts[:'locale'].nil?
111
+
112
+ # header parameters
113
+ header_params = {}
114
+
115
+ # form parameters
116
+ form_params = {}
117
+
118
+ # http body (model)
119
+ post_body = nil
120
+ auth_names = ['CUSTOMER_SESSION']
121
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
122
+ :header_params => header_params,
123
+ :query_params => query_params,
124
+ :form_params => form_params,
125
+ :body => post_body,
126
+ :auth_names => auth_names,
127
+ :return_type => 'MerchantMenusDto')
128
+ if @api_client.config.debugging
129
+ @api_client.config.logger.debug "API called: MenusApi#find_menus_for_reservation1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
130
+ end
131
+ return data, status_code, headers
132
+ end
133
+ # Get information about an available reservation menu
134
+ # 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\" } ] } ] } ```
135
+ # @param reservation_id Public Id of the reservation
136
+ # @param menu_id Id of the menu
137
+ # @param [Hash] opts the optional parameters
138
+ # @option opts [String] :locale Locale for translated info (default to en)
139
+ # @return [MerchantMenuDto]
140
+ def get_menu_for_reservation1(reservation_id, menu_id, opts = {})
141
+ data, _status_code, _headers = get_menu_for_reservation1_with_http_info(reservation_id, menu_id, opts)
142
+ data
143
+ end
144
+
145
+ # Get information about an available reservation menu
146
+ # 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 &#x60;HTTP 404 - Not Found&#x60; if the reservation or menu with the specified id could not be found. It will return &#x60;HTTP 403 - Forbidden&#x60; if the user is not authenticated or the reservation doesn&#39;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: &#x60;&#x60;&#x60; curl https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/menus/1836?locale&#x3D;en &#x60;&#x60;&#x60; Example response: &#x60;&#x60;&#x60; { \&quot;id\&quot;: 1836, \&quot;name\&quot;: \&quot;special menu 1\&quot;, \&quot;price\&quot;: \&quot;100.00\&quot;, \&quot;sortOrder\&quot;: 0, \&quot;categories\&quot;: [ { \&quot;id\&quot;: 1109, \&quot;name\&quot;: \&quot;starters\&quot;, \&quot;items\&quot;: [ { \&quot;id\&quot;: 1469, \&quot;name\&quot;: \&quot;fries\&quot;, \&quot;price\&quot;: \&quot;20.00\&quot; } ] }, { \&quot;id\&quot;: 1110, \&quot;name\&quot;: \&quot;fish\&quot;, \&quot;items\&quot;: [ { \&quot;id\&quot;: 1470, \&quot;name\&quot;: \&quot;salmon\&quot;, \&quot;price\&quot;: \&quot;60.00\&quot; } ] }, { \&quot;id\&quot;: 1111, \&quot;name\&quot;: \&quot;dessert\&quot;, \&quot;items\&quot;: [ { \&quot;id\&quot;: 1471, \&quot;name\&quot;: \&quot;sundae\&quot;, \&quot;price\&quot;: \&quot;20.00\&quot; } ] } ] } &#x60;&#x60;&#x60;
147
+ # @param reservation_id Public Id of the reservation
148
+ # @param menu_id Id of the menu
149
+ # @param [Hash] opts the optional parameters
150
+ # @option opts [String] :locale Locale for translated info
151
+ # @return [Array<(MerchantMenuDto, Fixnum, Hash)>] MerchantMenuDto data, response status code and response headers
152
+ def get_menu_for_reservation1_with_http_info(reservation_id, menu_id, opts = {})
153
+ if @api_client.config.debugging
154
+ @api_client.config.logger.debug 'Calling API: MenusApi.get_menu_for_reservation1 ...'
155
+ end
156
+ # verify the required parameter 'reservation_id' is set
157
+ if @api_client.config.client_side_validation && reservation_id.nil?
158
+ fail ArgumentError, "Missing the required parameter 'reservation_id' when calling MenusApi.get_menu_for_reservation1"
159
+ end
160
+ # verify the required parameter 'menu_id' is set
161
+ if @api_client.config.client_side_validation && menu_id.nil?
162
+ fail ArgumentError, "Missing the required parameter 'menu_id' when calling MenusApi.get_menu_for_reservation1"
163
+ end
164
+ # resource path
165
+ local_var_path = '/v1/reservations/{reservationId}/menus/{menuId}'.sub('{' + 'reservationId' + '}', reservation_id.to_s).sub('{' + 'menuId' + '}', menu_id.to_s)
166
+
167
+ # query parameters
168
+ query_params = {}
169
+ query_params[:'locale'] = opts[:'locale'] if !opts[:'locale'].nil?
170
+
171
+ # header parameters
172
+ header_params = {}
173
+
174
+ # form parameters
175
+ form_params = {}
176
+
177
+ # http body (model)
178
+ post_body = nil
179
+ auth_names = ['CUSTOMER_SESSION']
180
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
181
+ :header_params => header_params,
182
+ :query_params => query_params,
183
+ :form_params => form_params,
184
+ :body => post_body,
185
+ :auth_names => auth_names,
186
+ :return_type => 'MerchantMenuDto')
187
+ if @api_client.config.debugging
188
+ @api_client.config.logger.debug "API called: MenusApi#get_menu_for_reservation1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
189
+ end
190
+ return data, status_code, headers
191
+ end
192
+ # Get preorders of a reservation
193
+ # 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\" } ] } ```
194
+ # @param reservation_id Public Id of the reservation
195
+ # @param [Hash] opts the optional parameters
196
+ # @return [ReservationMenuData]
197
+ def get_preordered_items1(reservation_id, opts = {})
198
+ data, _status_code, _headers = get_preordered_items1_with_http_info(reservation_id, opts)
199
+ data
200
+ end
201
+
202
+ # Get preorders of a reservation
203
+ # 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 &#x60;HTTP 404 - Not Found&#x60; if the reservation with the specified id could not be found. It will return &#x60;HTTP 403 - Forbidden&#x60; if the user is not authenticated or the reservation doesn&#39;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: &#x60;&#x60;&#x60; curl https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/preorders &#x60;&#x60;&#x60; Example response: &#x60;&#x60;&#x60; { \&quot;items\&quot;: [ { \&quot;menuId\&quot;: 1846, \&quot;itemId\&quot;: 1477, \&quot;quantity\&quot;: 1, \&quot;guestPublicId\&quot;: \&quot;a8a66a11-446a-443b-8834-591742825ad4\&quot;, \&quot;href\&quot;: \&quot;https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/menus/1846\&quot; }, { \&quot;menuId\&quot;: 1846, \&quot;itemId\&quot;: 1478, \&quot;quantity\&quot;: 2, \&quot;guestPublicId\&quot;: \&quot;a8a66a11-446a-443b-8834-591742825ad4\&quot;, \&quot;href\&quot;: \&quot;https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/menus/1846\&quot; } ] } &#x60;&#x60;&#x60;
204
+ # @param reservation_id Public Id of the reservation
205
+ # @param [Hash] opts the optional parameters
206
+ # @return [Array<(ReservationMenuData, Fixnum, Hash)>] ReservationMenuData data, response status code and response headers
207
+ def get_preordered_items1_with_http_info(reservation_id, opts = {})
208
+ if @api_client.config.debugging
209
+ @api_client.config.logger.debug 'Calling API: MenusApi.get_preordered_items1 ...'
210
+ end
211
+ # verify the required parameter 'reservation_id' is set
212
+ if @api_client.config.client_side_validation && reservation_id.nil?
213
+ fail ArgumentError, "Missing the required parameter 'reservation_id' when calling MenusApi.get_preordered_items1"
214
+ end
215
+ # resource path
216
+ local_var_path = '/v1/reservations/{reservationId}/preorders'.sub('{' + 'reservationId' + '}', reservation_id.to_s)
217
+
218
+ # query parameters
219
+ query_params = {}
220
+
221
+ # header parameters
222
+ header_params = {}
223
+
224
+ # form parameters
225
+ form_params = {}
226
+
227
+ # http body (model)
228
+ post_body = nil
229
+ auth_names = ['CUSTOMER_SESSION']
230
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
231
+ :header_params => header_params,
232
+ :query_params => query_params,
233
+ :form_params => form_params,
234
+ :body => post_body,
235
+ :auth_names => auth_names,
236
+ :return_type => 'ReservationMenuData')
237
+ if @api_client.config.debugging
238
+ @api_client.config.logger.debug "API called: MenusApi#get_preordered_items1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
239
+ end
240
+ return data, status_code, headers
241
+ end
242
+ # Preorder menu items for a reservation
243
+ # 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\" } ] } ```
244
+ # @param reservation_id Public Id of the reservation
245
+ # @param body Menu items for this reservation
246
+ # @param [Hash] opts the optional parameters
247
+ # @return [ReservationMenuData]
248
+ def save_preordered_items1(reservation_id, body, opts = {})
249
+ data, _status_code, _headers = save_preordered_items1_with_http_info(reservation_id, body, opts)
250
+ data
251
+ end
252
+
253
+ # Preorder menu items for a reservation
254
+ # 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 &#x60;HTTP 404 - Not Found&#x60; if the reservation with the specified id could not be found. It will return &#x60;HTTP 403 - Forbidden&#x60; if the user is not authenticated or the reservation doesn&#39;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 &#x60;href&#x60; 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: &#x60;&#x60;&#x60; curl -H \&quot;Content Type: application/json\&quot; -X PUT -d &#39; { \&quot;items\&quot;: [ { \&quot;menuId\&quot;: 1846, \&quot;itemId\&quot;: 1477, \&quot;quantity\&quot;: 1, \&quot;guestPublicId\&quot;: \&quot;a8a66a11-446a-443b-8834-591742825ad4\&quot; }, { \&quot;menuId\&quot;: 1846, \&quot;itemId\&quot;: 1478, \&quot;quantity\&quot;: 2 } ] } &#39; https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/preorders &#x60;&#x60;&#x60; Example response: &#x60;&#x60;&#x60; { \&quot;items\&quot;: [ { \&quot;menuId\&quot;: 1846, \&quot;itemId\&quot;: 1477, \&quot;quantity\&quot;: 1, \&quot;guestPublicId\&quot;: \&quot;a8a66a11-446a-443b-8834-591742825ad4\&quot;, \&quot;href\&quot;: \&quot;https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/menus/1846\&quot; }, { \&quot;menuId\&quot;: 1846, \&quot;itemId\&quot;: 1478, \&quot;quantity\&quot;: 2, \&quot;href\&quot;: \&quot;https://{host}/v{X}/reservations/ce0706ff-a95d-4229-a220-d21dcd175342/menus/1846\&quot; } ] } &#x60;&#x60;&#x60;
255
+ # @param reservation_id Public Id of the reservation
256
+ # @param body Menu items for this reservation
257
+ # @param [Hash] opts the optional parameters
258
+ # @return [Array<(ReservationMenuData, Fixnum, Hash)>] ReservationMenuData data, response status code and response headers
259
+ def save_preordered_items1_with_http_info(reservation_id, body, opts = {})
260
+ if @api_client.config.debugging
261
+ @api_client.config.logger.debug 'Calling API: MenusApi.save_preordered_items1 ...'
262
+ end
263
+ # verify the required parameter 'reservation_id' is set
264
+ if @api_client.config.client_side_validation && reservation_id.nil?
265
+ fail ArgumentError, "Missing the required parameter 'reservation_id' when calling MenusApi.save_preordered_items1"
266
+ end
267
+ # verify the required parameter 'body' is set
268
+ if @api_client.config.client_side_validation && body.nil?
269
+ fail ArgumentError, "Missing the required parameter 'body' when calling MenusApi.save_preordered_items1"
270
+ end
271
+ # resource path
272
+ local_var_path = '/v1/reservations/{reservationId}/preorders'.sub('{' + 'reservationId' + '}', reservation_id.to_s)
273
+
274
+ # query parameters
275
+ query_params = {}
276
+
277
+ # header parameters
278
+ header_params = {}
279
+ # HTTP header 'Content-Type'
280
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
281
+
282
+ # form parameters
283
+ form_params = {}
284
+
285
+ # http body (model)
286
+ post_body = @api_client.object_to_http_body(body)
287
+ auth_names = ['CUSTOMER_SESSION']
288
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
289
+ :header_params => header_params,
290
+ :query_params => query_params,
291
+ :form_params => form_params,
292
+ :body => post_body,
293
+ :auth_names => auth_names,
294
+ :return_type => 'ReservationMenuData')
295
+ if @api_client.config.debugging
296
+ @api_client.config.logger.debug "API called: MenusApi#save_preordered_items1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
297
+ end
298
+ return data, status_code, headers
299
+ end
300
+ end
301
+ end
@@ -0,0 +1,357 @@
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 'uri'
14
+
15
+ module Quandoo
16
+ class MerchantsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get merchant reservations
23
+ # This endpoint allows an agent to get reservations of a merchant. The results will be filtered by agent id. Reservation IDs in response are agent-specific. 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**: ID 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. * **earliest**: earliest date time of time window in UTC. Format: yyyy-MM-dd HH:mm:ss * **latest**: latest date time of time window in UTC. Format: yyyy-MM-dd HH:mm:ss ####Response: The response will be a _list_ of reservations. Each reservation has the fields explained below: * **id**: The public 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}/merchants/32489/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\" } ] } ```
24
+ # @param merchant_id Id of the merchant
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [Integer] :offset Skip first n reservations (default to 0)
27
+ # @option opts [Integer] :limit limit (default to 100)
28
+ # @option opts [DateTime] :earliest earliest date time of time window in UTC. Format: yyyy-MM-dd HH:mm:ss
29
+ # @option opts [DateTime] :latest latest date time of time window in UTC. Format: yyyy-MM-dd HH:mm:ss
30
+ # @return [ReservationDataList]
31
+ def get_reservations2(merchant_id, opts = {})
32
+ data, _status_code, _headers = get_reservations2_with_http_info(merchant_id, opts)
33
+ data
34
+ end
35
+
36
+ # Get merchant reservations
37
+ # This endpoint allows an agent to get reservations of a merchant. The results will be filtered by agent id. Reservation IDs in response are agent-specific. The agent needs to be authenticated. The endpoint will return &#x60;HTTP 404 - Not Found&#x60; if the merchant with the specified id could not be found. It will return &#x60;HTTP 403 - Forbidden&#x60; if the agent is not authenticated or the agent doesn&#39;t have permissions. ####Request: * **merchantId**: ID 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. * **earliest**: earliest date time of time window in UTC. Format: yyyy-MM-dd HH:mm:ss * **latest**: latest date time of time window in UTC. Format: yyyy-MM-dd HH:mm:ss ####Response: The response will be a _list_ of reservations. Each reservation has the fields explained below: * **id**: The public 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: &#x60;yyyy-MM-ddTHH:mm:ssZ&#x60; * **endTime**: The end time of the reservation. Format: &#x60;yyyy-MM-ddTHH:mm:ssZ&#x60; * **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: &#x60;yyyy-MM-ddTHH:mm:ssZ&#x60; * **updatedAt**: The date the reservation was last updated. Format: &#x60;yyyy-MM-ddTHH:mm:ssZ&#x60; Example curl: &#x60;&#x60;&#x60; curl https://{host}/v{X}/merchants/32489/reservations &#x60;&#x60;&#x60; Example response: &#x60;&#x60;&#x60; { \&quot;reservations\&quot;: [ { \&quot;id\&quot;: \&quot;07f53b36-3f48-11e5-a151-feff819cdc9f\&quot;, \&quot;number\&quot;: 8734957, \&quot;quandooId\&quot;: \&quot;07f53b36-3f48-11e5-a151-feff819cdc9f\&quot;, \&quot;status\&quot;: \&quot;CREATED\&quot;, \&quot;startTime\&quot;: \&quot;2015-06-22T12:00:00+00:00\&quot;, \&quot;endTime\&quot;: \&quot;2015-06-22T13:00:00+00:00\&quot;, \&quot;capacity\&quot;: 4, \&quot;merchantId\&quot;: 1384, \&quot;customerId\&quot;: \&quot;ce0706ff-a95d-4229-a220-d21dcd175342\&quot;, \&quot;promocode\&quot;: \&quot;SOME_CAMPAIGN_CODE\&quot;, \&quot;extraInfo\&quot;: \&quot;request for baby chair\&quot;, \&quot;links\&quot;: [ { \&quot;href\&quot;: \&quot;https://{host}/v{X}/reservations/07f53b36-3f48-11e5-a151-feff819cdc9f\&quot;, \&quot;method\&quot;: \&quot;GET\&quot;, \&quot;rel\&quot;: \&quot;self\&quot; }, { \&quot;href\&quot;: \&quot;https://{host}/v{X}/reservations/07f53b36-3f48-11e5-a151-feff819cdc9f\&quot;, \&quot;method\&quot;: \&quot;PATCH\&quot;, \&quot;rel\&quot;: \&quot;update\&quot; } ], \&quot;createdAt\&quot;: \&quot;2015-06-01T15:21:54Z\&quot;, \&quot;updatedAt\&quot;: \&quot;2015-06-01T18:45:30Z\&quot; }, { \&quot;id\&quot;: \&quot;d8f53b36-3f48-11e5-a151-feff819cdc7a\&quot;, \&quot;number\&quot;: 8734958, \&quot;quandooId\&quot;: \&quot;d8f53b36-3f48-11e5-a151-feff819cdc7a\&quot;, \&quot;status\&quot;: \&quot;CONFIRMED\&quot;, \&quot;startTime\&quot;: \&quot;2015-06-22T12:00:00+00:00\&quot;, \&quot;endTime\&quot;: \&quot;2015-06-22T13:00:00+00:00\&quot;, \&quot;capacity\&quot;: 3, \&quot;merchantId\&quot;: 1384, \&quot;customerId\&quot;: \&quot;ce0706ff-a95d-4229-a220-d21dcd175342\&quot;, \&quot;promocode\&quot;: \&quot;SOME_CAMPAIGN_CODE\&quot;, \&quot;links\&quot;: [ { \&quot;href\&quot;: \&quot;https://{host}/v{X}/reservations/d8f53b36-3f48-11e5-a151-feff819cdc7a\&quot;, \&quot;method\&quot;: \&quot;GET\&quot;, \&quot;rel\&quot;: \&quot;self\&quot; }, { \&quot;href\&quot;: \&quot;https://{host}/v{X}/reservations/d8f53b36-3f48-11e5-a151-feff819cdc7a\&quot;, \&quot;method\&quot;: \&quot;PATCH\&quot;, \&quot;rel\&quot;: \&quot;update\&quot; } ], \&quot;createdAt\&quot;: \&quot;2015-06-01T15:21:54Z\&quot;, \&quot;updatedAt\&quot;: \&quot;2015-06-01T18:45:30Z\&quot; } ] } &#x60;&#x60;&#x60;
38
+ # @param merchant_id Id of the merchant
39
+ # @param [Hash] opts the optional parameters
40
+ # @option opts [Integer] :offset Skip first n reservations
41
+ # @option opts [Integer] :limit limit
42
+ # @option opts [DateTime] :earliest earliest date time of time window in UTC. Format: yyyy-MM-dd HH:mm:ss
43
+ # @option opts [DateTime] :latest latest date time of time window in UTC. Format: yyyy-MM-dd HH:mm:ss
44
+ # @return [Array<(ReservationDataList, Fixnum, Hash)>] ReservationDataList data, response status code and response headers
45
+ def get_reservations2_with_http_info(merchant_id, opts = {})
46
+ if @api_client.config.debugging
47
+ @api_client.config.logger.debug 'Calling API: MerchantsApi.get_reservations2 ...'
48
+ end
49
+ # verify the required parameter 'merchant_id' is set
50
+ if @api_client.config.client_side_validation && merchant_id.nil?
51
+ fail ArgumentError, "Missing the required parameter 'merchant_id' when calling MerchantsApi.get_reservations2"
52
+ end
53
+ # resource path
54
+ local_var_path = '/v1/merchants/{merchantId}/reservations'.sub('{' + 'merchantId' + '}', merchant_id.to_s)
55
+
56
+ # query parameters
57
+ query_params = {}
58
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
59
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
60
+ query_params[:'earliest'] = opts[:'earliest'] if !opts[:'earliest'].nil?
61
+ query_params[:'latest'] = opts[:'latest'] if !opts[:'latest'].nil?
62
+
63
+ # header parameters
64
+ header_params = {}
65
+
66
+ # form parameters
67
+ form_params = {}
68
+
69
+ # http body (model)
70
+ post_body = nil
71
+ auth_names = ['API_TOKEN']
72
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
73
+ :header_params => header_params,
74
+ :query_params => query_params,
75
+ :form_params => form_params,
76
+ :body => post_body,
77
+ :auth_names => auth_names,
78
+ :return_type => 'ReservationDataList')
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug "API called: MerchantsApi#get_reservations2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+ # Retrieves customer reviews for a merchant, specified by reviewId
85
+ # This endpoint retrieves customer reviews for a particular merchant with rating, description, locale, date & the customer's information.This merchant should be specified by their identifier **merchantId**, which is mandatory. Supports pagination via offset & limit parameters in the request. `offset` allows skipping the first n reviews. `limit` makes sure the response contains a maximum of n reviews. If not supplied, offset will be 0 and limit will be 10 ####Response: * **customer**: block contains link to customer's profile image, customer's first name & first letter of customer's last name. * **rating**: a value between 1 and 6, where 1 represents the worst rating and 6 represents the best. * **description**: the review description entered by the customer. * **locale**: represents the language settings of the customer, in the format: <language code>_<country code> * **date**: represents the date of the review, with the format: yyyy-MM-dd Example curl: ``` curl https://{host}/v{X}/merchants/15/reviews?offset=10&limit=5 ``` Example response: ``` { reviews: [ { customer: { firstName: \"Hans\", lastName: \"W\", profileImage: { url: \"https://www...\" }, }, rating: 1, description: \"Foo bar\", locale: \"de_DE\", date: \"2017-07-21\" } ], offset: 10, limit: 5, size: 1 } ```
86
+ # @param merchant_id
87
+ # @param [Hash] opts the optional parameters
88
+ # @option opts [Integer] :offset Skip first n reviews (default to 0)
89
+ # @option opts [Integer] :limit Max number of reviews to be retrieved (default to 10)
90
+ # @return [ReviewDtoList]
91
+ def get_reviews1(merchant_id, opts = {})
92
+ data, _status_code, _headers = get_reviews1_with_http_info(merchant_id, opts)
93
+ data
94
+ end
95
+
96
+ # Retrieves customer reviews for a merchant, specified by reviewId
97
+ # This endpoint retrieves customer reviews for a particular merchant with rating, description, locale, date &amp; the customer&#39;s information.This merchant should be specified by their identifier **merchantId**, which is mandatory. Supports pagination via offset &amp; limit parameters in the request. &#x60;offset&#x60; allows skipping the first n reviews. &#x60;limit&#x60; makes sure the response contains a maximum of n reviews. If not supplied, offset will be 0 and limit will be 10 ####Response: * **customer**: block contains link to customer&#39;s profile image, customer&#39;s first name &amp; first letter of customer&#39;s last name. * **rating**: a value between 1 and 6, where 1 represents the worst rating and 6 represents the best. * **description**: the review description entered by the customer. * **locale**: represents the language settings of the customer, in the format: &lt;language code&gt;_&lt;country code&gt; * **date**: represents the date of the review, with the format: yyyy-MM-dd Example curl: &#x60;&#x60;&#x60; curl https://{host}/v{X}/merchants/15/reviews?offset&#x3D;10&amp;limit&#x3D;5 &#x60;&#x60;&#x60; Example response: &#x60;&#x60;&#x60; { reviews: [ { customer: { firstName: \&quot;Hans\&quot;, lastName: \&quot;W\&quot;, profileImage: { url: \&quot;https://www...\&quot; }, }, rating: 1, description: \&quot;Foo bar\&quot;, locale: \&quot;de_DE\&quot;, date: \&quot;2017-07-21\&quot; } ], offset: 10, limit: 5, size: 1 } &#x60;&#x60;&#x60;
98
+ # @param merchant_id
99
+ # @param [Hash] opts the optional parameters
100
+ # @option opts [Integer] :offset Skip first n reviews
101
+ # @option opts [Integer] :limit Max number of reviews to be retrieved
102
+ # @return [Array<(ReviewDtoList, Fixnum, Hash)>] ReviewDtoList data, response status code and response headers
103
+ def get_reviews1_with_http_info(merchant_id, opts = {})
104
+ if @api_client.config.debugging
105
+ @api_client.config.logger.debug 'Calling API: MerchantsApi.get_reviews1 ...'
106
+ end
107
+ # verify the required parameter 'merchant_id' is set
108
+ if @api_client.config.client_side_validation && merchant_id.nil?
109
+ fail ArgumentError, "Missing the required parameter 'merchant_id' when calling MerchantsApi.get_reviews1"
110
+ end
111
+ # resource path
112
+ local_var_path = '/v1/merchants/{merchantId}/reviews'.sub('{' + 'merchantId' + '}', merchant_id.to_s)
113
+
114
+ # query parameters
115
+ query_params = {}
116
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
117
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
118
+
119
+ # header parameters
120
+ header_params = {}
121
+ # HTTP header 'Accept' (if needed)
122
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
123
+
124
+ # form parameters
125
+ form_params = {}
126
+
127
+ # http body (model)
128
+ post_body = nil
129
+ auth_names = []
130
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
131
+ :header_params => header_params,
132
+ :query_params => query_params,
133
+ :form_params => form_params,
134
+ :body => post_body,
135
+ :auth_names => auth_names,
136
+ :return_type => 'ReviewDtoList')
137
+ if @api_client.config.debugging
138
+ @api_client.config.logger.debug "API called: MerchantsApi#get_reviews1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
139
+ end
140
+ return data, status_code, headers
141
+ end
142
+ # Allows to get merchant information by parameters
143
+ # ###Description This endpoint is used to search merchants by a set of parameters. For each merchant in the result there is information about location, language and tags that describe this merchant's basic characteristics, there is also a set of images selected by the merchant. ####Possible query parameters: * **query**: Filter merchants using text similarity on a number of merchant fields like name, description, categories and tags * **place**: Filter for merchant on a country, city or district whose name matches the parameter. (if the parameter does not match any city or district on the system it is ignored) * **centerPoint**: Filter merchants within the circle defined by center on centerPoint and radius defined by radius parameter (if not informed defaults to 10). Center point has the format LATITUDE,LONGITUDE with both parameters as numbers with . as decimal separator (e.g `centerPoint=52.547928,13.4085728`) * **radius**: The radius of the circle to filter merchants in **kilometers**. Defaults to 10 and is only used if *centerPoint* is also informed * **bookable**: Boolean value, if informed true means that only merchants that are online bookable will be returned and false means that only merchants that are NOT online bookable will be returned * **tags**: Filter out merchants with the selected tags text. Semicolon separated text value. All or nothing field: if a tag is not found, the query will fail. Cannot be used in conjunction with 'tagIds' parameter. * **tagIds**: Filter out merchants with the selected tag ids. Semicolon separated text value. All or nothing field: if a tag is not found, the query will fail. Cannot be used in conjunction with 'tags' parameter. * **reviewScoreMax**: Filter out merchants with review score higher than the one informed. * **onlyWithAttributes**: This field only accepts the value **documents** for now. If informed only merchants with documents will be returned. You need to be **authenticated** to use this filter * **capacity**: Number of people. In order to be effective, \"place\", \"date\" and \"fromTime\" must also be set. * **date**: Date of the desired reservation in merchants' time zone. Format: yyyy-MM-dd. Availability search is only activated if \"place\" is specified. * **fromTime**: Beginning of the desired reservation time frame in merchants' time zone. Format: HH:mm. Consider a 3h buffer for the time (0.5h before the given time and 2.5h after) * **offset**: Number of merchants to skip on the result. Defaults to 0 * **limit**: Maximum number of merchants to return. Defaults to 100 and cannot be more than 100. * **bookable**: This flag indicates whether the merchant is bookable or not. ####Result fields for Merchant object: * **id**: Id of the merchant * **name**: Name of the merchant * **phoneNumber**: The phone number of the merchant * **currency**: Currency of the merchant in the ISO 4217 letter format * **locale**: Locale used to communicate with this merchant * **timezone**: Canonical Timezone name * **location**: Location of the merchant, contains both an geo located point and an address if available * **reviewScore**: Review score of the merchant * **tagGroups**: Tags (grouped) about relevant merchant characteristics * **images**: Group of images selected by the merchant * **documents**: Group of documents released by this merchant (e.g seasonal menus ) * **links**: Links for other pages or api operations for this merchant * **openingTimes**: Group of opening times: restaurant opening times for this merchant. Time range beginning may be greater than the end time of the range, when this range goes beyond the day when it was started, e.g. 19:00:00 - 02:00:00 * **ccvEnabled**: If true, credit card information is required when creating a reservation * **chain**: Merchant chain information, if any ###Authenticated use of the api: * Field `documents` is only accessible for authorized callers and will be empty otherwise. * Queries with parameter `onlyWithAttributes` are only allowed for authorized callers and will return `HTTP 403` for unauthorized requests #####How? In order to make an authenticated call the caller must send a header name `X-Quandoo-AuthToken` with the token obtained from contact with Quandoo. ###Pagination of the result: The result contains the fields `size` with the number of all merchants that matched the informed parameters, `offset` and `limit` defining which merchants from the complete list are on this response, and the caller can use query parameters `offset` and `limit` to get different merchants on the result list ###Examples: Example curl: ``` curl -H 'X-Quandoo-AuthToken: INSERT_KEY_HERE' 'https://{host}/v{X}/merchants?query=Zim&place=Berlin&amp;centerPoint=52.5479288%2C13.4085728&radius=10&bookable=true&reviewScoreMax=200&onlyWithAttributes=documents&offset=0&limit=100' ``` Example response: ``` { \"merchants\": [ { \"id\": 215, \"name\": \"a-merchant-Zim\", \"phoneNumber\": \"+49153153153\", \"currency\": \"EUR\", \"locale\": \"de_DE\", \"timezone\": \"Europe/Berlin\", \"location\": { \"coordinates\": { \"latitude\": 55, \"longitude\": 12 }, \"address\": {} }, \"reviewScore\": \"5.3\", \"tagGroups\": [ { \"type\": \"CUISINE\", \"tags\": [ { \"id\": 63, \"name\": \"Testküche Hauptkategorie\" }, { \"id\": 66, \"name\": \"Test cuisine\" } ] } ], \"images\": [], \"documents\": [ { \"name\": \"Main Menu\", \"url\": \"https://d2s6u6f7snurg9.cloudfront.net/partner/uploads/MD-document-3ec1dc15-1b69-463f-bdd2-c060b9bf844d.pdf\", \"format\": \"pdf\", \"description\": \"Seasonal Main Menu\" } ], \"links\": [ { \"href\": \"https://{host}/{path}?aid=16\", \"method\": \"GET\", \"rel\": \"DETAILS\" }, { \"href\": \"https://{host}/{path}?aid=16&countryId=NLD\", \"method\": \"GET\", \"rel\": \"WIDGET\" }, { \"href\": \"https://{host}/{path}/details?aid=16&countryId=NLD\", \"method\": \"GET\", \"rel\": \"WIDGET_DETAILS\" } ], \"bookable\": true, \"ccvEnabled\": true, \"chain\": { \"id\": 1, \"name\": \"Test chain\" } }, { \"id\": 219, \"name\": \"another merchants Zim\", \"phoneNumber\": \"+49154154154\", \"currency\": \"EUR\", \"locale\": \"de_DE\", \"timezone\": \"Europe/Berlin\", \"location\": { \"coordinates\": { \"latitude\": 52, \"longitude\": 13 }, \"address\": { \"street\": \"Wintersteinstr.\", \"number\": \"15\", \"zipcode\": \"10587\", \"city\": \"Berlin\", \"country\": \"DEU\" } }, \"reviewScore\": \"4.7\", \"tagGroups\": [ { \"type\": \"CUISINE\", \"tags\": [ { \"id\": 79, \"name\": \"Testküche Hauptkategorie\" }, { \"id\": 82, \"name\": \"Test Japanese\" } ] }, { \"type\": \"PRICE\", \"tags\": [ { \"id\": 84, \"name\": \"Test expensive\" } ] } ], \"images\": [ { \"url\": \"https://dci5ez2ey8tr9.cloudfront.net/1482eec7-e585-4821-b096-8a9941e0d2eb/25_sld.jpg\" } ], \"documents\": [], \"links\": [ { \"href\": \"https://{host}/{path}?aid=16\", \"method\": \"GET\", \"rel\": \"DETAILS\" }, { \"href\": \"https://{host}/{path}?aid=16&countryId=NLD\", \"method\": \"GET\", \"rel\": \"WIDGET\" }, { \"href\": \"https://{host}/{path}/details?aid=16&countryId=NLD\", \"method\": \"GET\", \"rel\": \"WIDGET_DETAILS\" } ], \"bookable\": true, \"openingTimes\": { \"standardOpeningTimes\": { \"SATURDAY\": [ { \"start\": \"09:00:00\", \"end\": \"20:00:00\" } ], \"SUNDAY\": [ { \"start\": \"09:00:00\", \"end\": \"18:00:00\" } ] } }, \"ccvEnabled\": true, \"chain\": { \"id\": 1, \"name\": \"Test chain\" } } ], \"size\": 2, \"offset\": 0, \"limit\": 100 } ```
144
+ # @param capacity Number of people. In order to be effective, \&quot;date\&quot; and \&quot;fromTime\&quot; must also be set.
145
+ # @param [Hash] opts the optional parameters
146
+ # @option opts [String] :query Search query for a merchant name
147
+ # @option opts [String] :place Search query for a place (country, city or district) name: the most relevant places, if any, are taken as a filter
148
+ # @option opts [String] :center_point Search with coordinates and radius. \&quot;radius\&quot; argument can be set, otherwise default value of 10 km will be used.&lt;br&gt;Format:&lt;br&gt;53.1222,13.0303&lt;br&gt;where latitude&#x3D;53.1222, longitude&#x3D;13.0303
149
+ # @option opts [Integer] :radius Radius for coordinate-based search (default to 10)
150
+ # @option opts [BOOLEAN] :bookable Filter only bookable merchants
151
+ # @option opts [String] :tags Filter by tags found by text. The value can be either in English or in the specific locale. Semicolon separated. All or nothing behaviour: if one single tag is not found, the whole request fails. Cannot be used in combination with &#39;groupedTagIds&#39; parameter.
152
+ # @option opts [String] :tag_ids Filter by tags found by id. Semicolon separated. All or nothing behaviour: if one single tag id is not found, the whole request fails. Cannot be used in combination with &#39;tags&#39; parameter.
153
+ # @option opts [Integer] :review_score_max Filter by max review score (100 - 600)
154
+ # @option opts [String] :only_with_attributes Search with attributes specified only. Attribute \&quot;documents\&quot; is currently supported
155
+ # @option opts [Date] :date Date of the desired reservation in merchants&#39; time zone. Format: yyyy-MM-dd. Availability search is only activated if \&quot;place\&quot; is specified.
156
+ # @option opts [String] :from_time Beginning of the desired reservation time frame in merchants&#39; time zone. Format: HH:mm. Consider a 3h buffer for the time (0.5h before the given time and 2.5h after)
157
+ # @option opts [Integer] :offset offset (default to 0)
158
+ # @option opts [Integer] :limit limit (default to 100)
159
+ # @option opts [String] :accept_language language
160
+ # @return [MerchantDetailsDtoList]
161
+ def search(capacity, opts = {})
162
+ data, _status_code, _headers = search_with_http_info(capacity, opts)
163
+ data
164
+ end
165
+
166
+ # Allows to get merchant information by parameters
167
+ # ###Description This endpoint is used to search merchants by a set of parameters. For each merchant in the result there is information about location, language and tags that describe this merchant&#39;s basic characteristics, there is also a set of images selected by the merchant. ####Possible query parameters: * **query**: Filter merchants using text similarity on a number of merchant fields like name, description, categories and tags * **place**: Filter for merchant on a country, city or district whose name matches the parameter. (if the parameter does not match any city or district on the system it is ignored) * **centerPoint**: Filter merchants within the circle defined by center on centerPoint and radius defined by radius parameter (if not informed defaults to 10). Center point has the format LATITUDE,LONGITUDE with both parameters as numbers with . as decimal separator (e.g &#x60;centerPoint&#x3D;52.547928,13.4085728&#x60;) * **radius**: The radius of the circle to filter merchants in **kilometers**. Defaults to 10 and is only used if *centerPoint* is also informed * **bookable**: Boolean value, if informed true means that only merchants that are online bookable will be returned and false means that only merchants that are NOT online bookable will be returned * **tags**: Filter out merchants with the selected tags text. Semicolon separated text value. All or nothing field: if a tag is not found, the query will fail. Cannot be used in conjunction with &#39;tagIds&#39; parameter. * **tagIds**: Filter out merchants with the selected tag ids. Semicolon separated text value. All or nothing field: if a tag is not found, the query will fail. Cannot be used in conjunction with &#39;tags&#39; parameter. * **reviewScoreMax**: Filter out merchants with review score higher than the one informed. * **onlyWithAttributes**: This field only accepts the value **documents** for now. If informed only merchants with documents will be returned. You need to be **authenticated** to use this filter * **capacity**: Number of people. In order to be effective, \&quot;place\&quot;, \&quot;date\&quot; and \&quot;fromTime\&quot; must also be set. * **date**: Date of the desired reservation in merchants&#39; time zone. Format: yyyy-MM-dd. Availability search is only activated if \&quot;place\&quot; is specified. * **fromTime**: Beginning of the desired reservation time frame in merchants&#39; time zone. Format: HH:mm. Consider a 3h buffer for the time (0.5h before the given time and 2.5h after) * **offset**: Number of merchants to skip on the result. Defaults to 0 * **limit**: Maximum number of merchants to return. Defaults to 100 and cannot be more than 100. * **bookable**: This flag indicates whether the merchant is bookable or not. ####Result fields for Merchant object: * **id**: Id of the merchant * **name**: Name of the merchant * **phoneNumber**: The phone number of the merchant * **currency**: Currency of the merchant in the ISO 4217 letter format * **locale**: Locale used to communicate with this merchant * **timezone**: Canonical Timezone name * **location**: Location of the merchant, contains both an geo located point and an address if available * **reviewScore**: Review score of the merchant * **tagGroups**: Tags (grouped) about relevant merchant characteristics * **images**: Group of images selected by the merchant * **documents**: Group of documents released by this merchant (e.g seasonal menus ) * **links**: Links for other pages or api operations for this merchant * **openingTimes**: Group of opening times: restaurant opening times for this merchant. Time range beginning may be greater than the end time of the range, when this range goes beyond the day when it was started, e.g. 19:00:00 - 02:00:00 * **ccvEnabled**: If true, credit card information is required when creating a reservation * **chain**: Merchant chain information, if any ###Authenticated use of the api: * Field &#x60;documents&#x60; is only accessible for authorized callers and will be empty otherwise. * Queries with parameter &#x60;onlyWithAttributes&#x60; are only allowed for authorized callers and will return &#x60;HTTP 403&#x60; for unauthorized requests #####How? In order to make an authenticated call the caller must send a header name &#x60;X-Quandoo-AuthToken&#x60; with the token obtained from contact with Quandoo. ###Pagination of the result: The result contains the fields &#x60;size&#x60; with the number of all merchants that matched the informed parameters, &#x60;offset&#x60; and &#x60;limit&#x60; defining which merchants from the complete list are on this response, and the caller can use query parameters &#x60;offset&#x60; and &#x60;limit&#x60; to get different merchants on the result list ###Examples: Example curl: &#x60;&#x60;&#x60; curl -H &#39;X-Quandoo-AuthToken: INSERT_KEY_HERE&#39; &#39;https://{host}/v{X}/merchants?query&#x3D;Zim&amp;place&#x3D;Berlin&amp;amp;centerPoint&#x3D;52.5479288%2C13.4085728&amp;radius&#x3D;10&amp;bookable&#x3D;true&amp;reviewScoreMax&#x3D;200&amp;onlyWithAttributes&#x3D;documents&amp;offset&#x3D;0&amp;limit&#x3D;100&#39; &#x60;&#x60;&#x60; Example response: &#x60;&#x60;&#x60; { \&quot;merchants\&quot;: [ { \&quot;id\&quot;: 215, \&quot;name\&quot;: \&quot;a-merchant-Zim\&quot;, \&quot;phoneNumber\&quot;: \&quot;+49153153153\&quot;, \&quot;currency\&quot;: \&quot;EUR\&quot;, \&quot;locale\&quot;: \&quot;de_DE\&quot;, \&quot;timezone\&quot;: \&quot;Europe/Berlin\&quot;, \&quot;location\&quot;: { \&quot;coordinates\&quot;: { \&quot;latitude\&quot;: 55, \&quot;longitude\&quot;: 12 }, \&quot;address\&quot;: {} }, \&quot;reviewScore\&quot;: \&quot;5.3\&quot;, \&quot;tagGroups\&quot;: [ { \&quot;type\&quot;: \&quot;CUISINE\&quot;, \&quot;tags\&quot;: [ { \&quot;id\&quot;: 63, \&quot;name\&quot;: \&quot;Testküche Hauptkategorie\&quot; }, { \&quot;id\&quot;: 66, \&quot;name\&quot;: \&quot;Test cuisine\&quot; } ] } ], \&quot;images\&quot;: [], \&quot;documents\&quot;: [ { \&quot;name\&quot;: \&quot;Main Menu\&quot;, \&quot;url\&quot;: \&quot;https://d2s6u6f7snurg9.cloudfront.net/partner/uploads/MD-document-3ec1dc15-1b69-463f-bdd2-c060b9bf844d.pdf\&quot;, \&quot;format\&quot;: \&quot;pdf\&quot;, \&quot;description\&quot;: \&quot;Seasonal Main Menu\&quot; } ], \&quot;links\&quot;: [ { \&quot;href\&quot;: \&quot;https://{host}/{path}?aid&#x3D;16\&quot;, \&quot;method\&quot;: \&quot;GET\&quot;, \&quot;rel\&quot;: \&quot;DETAILS\&quot; }, { \&quot;href\&quot;: \&quot;https://{host}/{path}?aid&#x3D;16&amp;countryId&#x3D;NLD\&quot;, \&quot;method\&quot;: \&quot;GET\&quot;, \&quot;rel\&quot;: \&quot;WIDGET\&quot; }, { \&quot;href\&quot;: \&quot;https://{host}/{path}/details?aid&#x3D;16&amp;countryId&#x3D;NLD\&quot;, \&quot;method\&quot;: \&quot;GET\&quot;, \&quot;rel\&quot;: \&quot;WIDGET_DETAILS\&quot; } ], \&quot;bookable\&quot;: true, \&quot;ccvEnabled\&quot;: true, \&quot;chain\&quot;: { \&quot;id\&quot;: 1, \&quot;name\&quot;: \&quot;Test chain\&quot; } }, { \&quot;id\&quot;: 219, \&quot;name\&quot;: \&quot;another merchants Zim\&quot;, \&quot;phoneNumber\&quot;: \&quot;+49154154154\&quot;, \&quot;currency\&quot;: \&quot;EUR\&quot;, \&quot;locale\&quot;: \&quot;de_DE\&quot;, \&quot;timezone\&quot;: \&quot;Europe/Berlin\&quot;, \&quot;location\&quot;: { \&quot;coordinates\&quot;: { \&quot;latitude\&quot;: 52, \&quot;longitude\&quot;: 13 }, \&quot;address\&quot;: { \&quot;street\&quot;: \&quot;Wintersteinstr.\&quot;, \&quot;number\&quot;: \&quot;15\&quot;, \&quot;zipcode\&quot;: \&quot;10587\&quot;, \&quot;city\&quot;: \&quot;Berlin\&quot;, \&quot;country\&quot;: \&quot;DEU\&quot; } }, \&quot;reviewScore\&quot;: \&quot;4.7\&quot;, \&quot;tagGroups\&quot;: [ { \&quot;type\&quot;: \&quot;CUISINE\&quot;, \&quot;tags\&quot;: [ { \&quot;id\&quot;: 79, \&quot;name\&quot;: \&quot;Testküche Hauptkategorie\&quot; }, { \&quot;id\&quot;: 82, \&quot;name\&quot;: \&quot;Test Japanese\&quot; } ] }, { \&quot;type\&quot;: \&quot;PRICE\&quot;, \&quot;tags\&quot;: [ { \&quot;id\&quot;: 84, \&quot;name\&quot;: \&quot;Test expensive\&quot; } ] } ], \&quot;images\&quot;: [ { \&quot;url\&quot;: \&quot;https://dci5ez2ey8tr9.cloudfront.net/1482eec7-e585-4821-b096-8a9941e0d2eb/25_sld.jpg\&quot; } ], \&quot;documents\&quot;: [], \&quot;links\&quot;: [ { \&quot;href\&quot;: \&quot;https://{host}/{path}?aid&#x3D;16\&quot;, \&quot;method\&quot;: \&quot;GET\&quot;, \&quot;rel\&quot;: \&quot;DETAILS\&quot; }, { \&quot;href\&quot;: \&quot;https://{host}/{path}?aid&#x3D;16&amp;countryId&#x3D;NLD\&quot;, \&quot;method\&quot;: \&quot;GET\&quot;, \&quot;rel\&quot;: \&quot;WIDGET\&quot; }, { \&quot;href\&quot;: \&quot;https://{host}/{path}/details?aid&#x3D;16&amp;countryId&#x3D;NLD\&quot;, \&quot;method\&quot;: \&quot;GET\&quot;, \&quot;rel\&quot;: \&quot;WIDGET_DETAILS\&quot; } ], \&quot;bookable\&quot;: true, \&quot;openingTimes\&quot;: { \&quot;standardOpeningTimes\&quot;: { \&quot;SATURDAY\&quot;: [ { \&quot;start\&quot;: \&quot;09:00:00\&quot;, \&quot;end\&quot;: \&quot;20:00:00\&quot; } ], \&quot;SUNDAY\&quot;: [ { \&quot;start\&quot;: \&quot;09:00:00\&quot;, \&quot;end\&quot;: \&quot;18:00:00\&quot; } ] } }, \&quot;ccvEnabled\&quot;: true, \&quot;chain\&quot;: { \&quot;id\&quot;: 1, \&quot;name\&quot;: \&quot;Test chain\&quot; } } ], \&quot;size\&quot;: 2, \&quot;offset\&quot;: 0, \&quot;limit\&quot;: 100 } &#x60;&#x60;&#x60;
168
+ # @param capacity Number of people. In order to be effective, \&quot;date\&quot; and \&quot;fromTime\&quot; must also be set.
169
+ # @param [Hash] opts the optional parameters
170
+ # @option opts [String] :query Search query for a merchant name
171
+ # @option opts [String] :place Search query for a place (country, city or district) name: the most relevant places, if any, are taken as a filter
172
+ # @option opts [String] :center_point Search with coordinates and radius. \&quot;radius\&quot; argument can be set, otherwise default value of 10 km will be used.&lt;br&gt;Format:&lt;br&gt;53.1222,13.0303&lt;br&gt;where latitude&#x3D;53.1222, longitude&#x3D;13.0303
173
+ # @option opts [Integer] :radius Radius for coordinate-based search
174
+ # @option opts [BOOLEAN] :bookable Filter only bookable merchants
175
+ # @option opts [String] :tags Filter by tags found by text. The value can be either in English or in the specific locale. Semicolon separated. All or nothing behaviour: if one single tag is not found, the whole request fails. Cannot be used in combination with &#39;groupedTagIds&#39; parameter.
176
+ # @option opts [String] :tag_ids Filter by tags found by id. Semicolon separated. All or nothing behaviour: if one single tag id is not found, the whole request fails. Cannot be used in combination with &#39;tags&#39; parameter.
177
+ # @option opts [Integer] :review_score_max Filter by max review score (100 - 600)
178
+ # @option opts [String] :only_with_attributes Search with attributes specified only. Attribute \&quot;documents\&quot; is currently supported
179
+ # @option opts [Date] :date Date of the desired reservation in merchants&#39; time zone. Format: yyyy-MM-dd. Availability search is only activated if \&quot;place\&quot; is specified.
180
+ # @option opts [String] :from_time Beginning of the desired reservation time frame in merchants&#39; time zone. Format: HH:mm. Consider a 3h buffer for the time (0.5h before the given time and 2.5h after)
181
+ # @option opts [Integer] :offset offset
182
+ # @option opts [Integer] :limit limit
183
+ # @option opts [String] :accept_language language
184
+ # @return [Array<(MerchantDetailsDtoList, Fixnum, Hash)>] MerchantDetailsDtoList data, response status code and response headers
185
+ def search_with_http_info(capacity, opts = {})
186
+ if @api_client.config.debugging
187
+ @api_client.config.logger.debug 'Calling API: MerchantsApi.search ...'
188
+ end
189
+ # verify the required parameter 'capacity' is set
190
+ if @api_client.config.client_side_validation && capacity.nil?
191
+ fail ArgumentError, "Missing the required parameter 'capacity' when calling MerchantsApi.search"
192
+ end
193
+ # resource path
194
+ local_var_path = '/v1/merchants'
195
+
196
+ # query parameters
197
+ query_params = {}
198
+ query_params[:'capacity'] = capacity
199
+ query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
200
+ query_params[:'place'] = opts[:'place'] if !opts[:'place'].nil?
201
+ query_params[:'centerPoint'] = opts[:'center_point'] if !opts[:'center_point'].nil?
202
+ query_params[:'radius'] = opts[:'radius'] if !opts[:'radius'].nil?
203
+ query_params[:'bookable'] = opts[:'bookable'] if !opts[:'bookable'].nil?
204
+ query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?
205
+ query_params[:'tagIds'] = opts[:'tag_ids'] if !opts[:'tag_ids'].nil?
206
+ query_params[:'reviewScoreMax'] = opts[:'review_score_max'] if !opts[:'review_score_max'].nil?
207
+ query_params[:'onlyWithAttributes'] = opts[:'only_with_attributes'] if !opts[:'only_with_attributes'].nil?
208
+ query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil?
209
+ query_params[:'fromTime'] = opts[:'from_time'] if !opts[:'from_time'].nil?
210
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
211
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
212
+
213
+ # header parameters
214
+ header_params = {}
215
+ # HTTP header 'Accept' (if needed)
216
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
217
+ header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
218
+
219
+ # form parameters
220
+ form_params = {}
221
+
222
+ # http body (model)
223
+ post_body = nil
224
+ auth_names = ['API_TOKEN']
225
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
226
+ :header_params => header_params,
227
+ :query_params => query_params,
228
+ :form_params => form_params,
229
+ :body => post_body,
230
+ :auth_names => auth_names,
231
+ :return_type => 'MerchantDetailsDtoList')
232
+ if @api_client.config.debugging
233
+ @api_client.config.logger.debug "API called: MerchantsApi#search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
234
+ end
235
+ return data, status_code, headers
236
+ end
237
+ # Allows to get a merchant by id
238
+ # This endpoint allows to receive detailed information on a particular merchant in the system. This merchant should be specified by their identifier **merchantId**, which is mandatory. The endpoint can take optional request header **Accept-Language**. This header is used to determine correct locale and has an effect on translation of merchant's entity fields, that may be omitted. The expected value of the header **Accept-Language** should contain language and can contain country, e.g. \"de_DE\" or \"de\". Locale by default is \"en_GB\". The endpoint returns status `HTTP 200` if the request is successful. The endpoint will return status `HTTP 404` if the merchant, specified by identifier, was not found or has no products, allowed for a web search. Example curl: ``` curl -H 'X-Quandoo-AuthToken: {INSERT_KEY_HERE}' -H 'Accept-Language: de_DE' 'https://{host}/v{X}/merchants/11' ``` Example response: ``` { \"id\":11, \"name\":\"Test merchant\", \"phoneNumber\":\"+27113901837\", \"currency\":\"ZAR\", \"locale\":\"en_ZA\", \"timezone\":\"Africa/Johannesburg\", \"location\":{ \"coordinates\":{ \"latitude\":33.9, \"longitude\":18.4 }, \"address\":{ \"street\":\"Tamerlan street\", \"number\":\"6A\", \"zipcode\":\"10787\", \"city\":\"Cape Town\", \"country\":\"ZAF\" } }, \"reviewScore\": \"5.3\", \"tagGroups\":[ { \"type\":\"CUISINE\", \"tags\":[ { \"id\":25, \"name\":\"Testküche Hauptkategorie\" }, { \"id\":28, \"name\":\"Test cuisine\" } ] } ], \"images\":[ { \"url\":\"https://dci5ez2ey8tr9.cloudfront.net/8e4d1063-9171-40b1-94b7-5e9337591a90/7_sld.jpg\" } ], \"documents\":[], \"links\":[ { \"href\":\"https://{host}/{path}?aid=16\", \"method\":\"GET\", \"rel\":\"DETAILS\" }, { \"href\":\"https://{host}/{path}?aid=16&countryId=NLD\", \"method\":\"GET\", \"rel\":\"WIDGET\" }, { \"href\":\"https://{host}/{path}/details?aid=16&countryId=NLD\", \"method\":\"GET\", \"rel\":\"WIDGET_DETAILS\" } ], \"bookable\": true, \"openingTimes\": { \"standardOpeningTimes\": { \"SATURDAY\": [ { \"start\": \"09:00:00\", \"end\": \"20:00:00\" } ], \"SUNDAY\": [ { \"start\": \"09:00:00\", \"end\": \"18:00:00\" } ] } }, \"ccvEnabled\": true, \"chain\": { \"id\": 1, \"name\": \"Test chain\" } } ```
239
+ # @param merchant_id merchantId
240
+ # @param [Hash] opts the optional parameters
241
+ # @option opts [String] :accept_language Locale.&lt;br&gt;Format:&lt;br&gt;&amp;lt;language code&amp;gt;[_&amp;lt;country code&amp;gt;] (default to en_GB)
242
+ # @return [MerchantDetailsDto]
243
+ def search2(merchant_id, opts = {})
244
+ data, _status_code, _headers = search2_with_http_info(merchant_id, opts)
245
+ data
246
+ end
247
+
248
+ # Allows to get a merchant by id
249
+ # This endpoint allows to receive detailed information on a particular merchant in the system. This merchant should be specified by their identifier **merchantId**, which is mandatory. The endpoint can take optional request header **Accept-Language**. This header is used to determine correct locale and has an effect on translation of merchant&#39;s entity fields, that may be omitted. The expected value of the header **Accept-Language** should contain language and can contain country, e.g. \&quot;de_DE\&quot; or \&quot;de\&quot;. Locale by default is \&quot;en_GB\&quot;. The endpoint returns status &#x60;HTTP 200&#x60; if the request is successful. The endpoint will return status &#x60;HTTP 404&#x60; if the merchant, specified by identifier, was not found or has no products, allowed for a web search. Example curl: &#x60;&#x60;&#x60; curl -H &#39;X-Quandoo-AuthToken: {INSERT_KEY_HERE}&#39; -H &#39;Accept-Language: de_DE&#39; &#39;https://{host}/v{X}/merchants/11&#39; &#x60;&#x60;&#x60; Example response: &#x60;&#x60;&#x60; { \&quot;id\&quot;:11, \&quot;name\&quot;:\&quot;Test merchant\&quot;, \&quot;phoneNumber\&quot;:\&quot;+27113901837\&quot;, \&quot;currency\&quot;:\&quot;ZAR\&quot;, \&quot;locale\&quot;:\&quot;en_ZA\&quot;, \&quot;timezone\&quot;:\&quot;Africa/Johannesburg\&quot;, \&quot;location\&quot;:{ \&quot;coordinates\&quot;:{ \&quot;latitude\&quot;:33.9, \&quot;longitude\&quot;:18.4 }, \&quot;address\&quot;:{ \&quot;street\&quot;:\&quot;Tamerlan street\&quot;, \&quot;number\&quot;:\&quot;6A\&quot;, \&quot;zipcode\&quot;:\&quot;10787\&quot;, \&quot;city\&quot;:\&quot;Cape Town\&quot;, \&quot;country\&quot;:\&quot;ZAF\&quot; } }, \&quot;reviewScore\&quot;: \&quot;5.3\&quot;, \&quot;tagGroups\&quot;:[ { \&quot;type\&quot;:\&quot;CUISINE\&quot;, \&quot;tags\&quot;:[ { \&quot;id\&quot;:25, \&quot;name\&quot;:\&quot;Testküche Hauptkategorie\&quot; }, { \&quot;id\&quot;:28, \&quot;name\&quot;:\&quot;Test cuisine\&quot; } ] } ], \&quot;images\&quot;:[ { \&quot;url\&quot;:\&quot;https://dci5ez2ey8tr9.cloudfront.net/8e4d1063-9171-40b1-94b7-5e9337591a90/7_sld.jpg\&quot; } ], \&quot;documents\&quot;:[], \&quot;links\&quot;:[ { \&quot;href\&quot;:\&quot;https://{host}/{path}?aid&#x3D;16\&quot;, \&quot;method\&quot;:\&quot;GET\&quot;, \&quot;rel\&quot;:\&quot;DETAILS\&quot; }, { \&quot;href\&quot;:\&quot;https://{host}/{path}?aid&#x3D;16&amp;countryId&#x3D;NLD\&quot;, \&quot;method\&quot;:\&quot;GET\&quot;, \&quot;rel\&quot;:\&quot;WIDGET\&quot; }, { \&quot;href\&quot;:\&quot;https://{host}/{path}/details?aid&#x3D;16&amp;countryId&#x3D;NLD\&quot;, \&quot;method\&quot;:\&quot;GET\&quot;, \&quot;rel\&quot;:\&quot;WIDGET_DETAILS\&quot; } ], \&quot;bookable\&quot;: true, \&quot;openingTimes\&quot;: { \&quot;standardOpeningTimes\&quot;: { \&quot;SATURDAY\&quot;: [ { \&quot;start\&quot;: \&quot;09:00:00\&quot;, \&quot;end\&quot;: \&quot;20:00:00\&quot; } ], \&quot;SUNDAY\&quot;: [ { \&quot;start\&quot;: \&quot;09:00:00\&quot;, \&quot;end\&quot;: \&quot;18:00:00\&quot; } ] } }, \&quot;ccvEnabled\&quot;: true, \&quot;chain\&quot;: { \&quot;id\&quot;: 1, \&quot;name\&quot;: \&quot;Test chain\&quot; } } &#x60;&#x60;&#x60;
250
+ # @param merchant_id merchantId
251
+ # @param [Hash] opts the optional parameters
252
+ # @option opts [String] :accept_language Locale.&lt;br&gt;Format:&lt;br&gt;&amp;lt;language code&amp;gt;[_&amp;lt;country code&amp;gt;]
253
+ # @return [Array<(MerchantDetailsDto, Fixnum, Hash)>] MerchantDetailsDto data, response status code and response headers
254
+ def search2_with_http_info(merchant_id, opts = {})
255
+ if @api_client.config.debugging
256
+ @api_client.config.logger.debug 'Calling API: MerchantsApi.search2 ...'
257
+ end
258
+ # verify the required parameter 'merchant_id' is set
259
+ if @api_client.config.client_side_validation && merchant_id.nil?
260
+ fail ArgumentError, "Missing the required parameter 'merchant_id' when calling MerchantsApi.search2"
261
+ end
262
+ # resource path
263
+ local_var_path = '/v1/merchants/{merchantId}'.sub('{' + 'merchantId' + '}', merchant_id.to_s)
264
+
265
+ # query parameters
266
+ query_params = {}
267
+
268
+ # header parameters
269
+ header_params = {}
270
+ # HTTP header 'Accept' (if needed)
271
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
272
+ header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
273
+
274
+ # form parameters
275
+ form_params = {}
276
+
277
+ # http body (model)
278
+ post_body = nil
279
+ auth_names = ['API_TOKEN']
280
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
281
+ :header_params => header_params,
282
+ :query_params => query_params,
283
+ :form_params => form_params,
284
+ :body => post_body,
285
+ :auth_names => auth_names,
286
+ :return_type => 'MerchantDetailsDto')
287
+ if @api_client.config.debugging
288
+ @api_client.config.logger.debug "API called: MerchantsApi#search2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
289
+ end
290
+ return data, status_code, headers
291
+ end
292
+ # Allows to get a merchant by id and find similar merchants
293
+ # This endpoint allows to receive detailed information for a particular merchant in the system and for restaurants that are similar to this one. A merchant is similar if all the following conditions are met: 1. Location: the recommended merchants are within 30 km radius from the main merchant 2. The similar merchants are bookable online 3. The similar merchants have the main cuisine in common This merchant should be specified by their identifier **merchantId**, which is mandatory. The endpoint can take optional request header **Accept-Language**. This header is used to determine correct locale and has an effect on translation of merchant's entity fields, that may be omitted. The expected value of the header **Accept-Language** should contain language and can contain country, e.g. \"de_DE\" or \"de\". Locale by default is \"en_GB\". The endpoint returns status `HTTP 200` if the request is successful. In a successful requests the specified merchant was found. If the merchant has no products allowed for a web search, i.e. is not bookable, response data with `HTTP 200` is returned, but the field `merchant` is not set. Instead, the merchant search message is set. The endpoint will return status `HTTP 404` if the merchant, specified by identifier, was not found. Example curl: ``` curl -H 'X-Quandoo-AuthToken: {INSERT_KEY_HERE}' -H 'Accept-Language: de_DE' 'https://{host}/v{X}/merchants/11/similar' ``` Example responses: `merchant bookable` ``` { \"merchant\": { \"id\":11, \"name\":\"Test merchant\", \"phoneNumber\":\"+27113901837\", \"currency\":\"ZAR\", \"locale\":\"en_ZA\", \"timezone\":\"Africa/Johannesburg\", \"location\":{ \"coordinates\":{ \"latitude\":33.9, \"longitude\":18.4 }, \"address\":{ \"street\":\"Tamerlan street\", \"number\":\"6A\", \"zipcode\":\"10787\", \"city\":\"Cape Town\", \"country\":\"ZAF\" } }, \"reviewScore\": \"5.3\", \"tagGroups\":[ { \"type\":\"CUISINE\", \"tags\":[ { \"id\":25, \"name\":\"Testküche Hauptkategorie\" }, { \"id\":28, \"name\":\"Test cuisine\" } ] } ], \"images\":[ { \"url\":\"https://dci5ez2ey8tr9.cloudfront.net/8e4d1063-9171-40b1-94b7-5e9337591a90/7_sld.jpg\" } ], \"documents\":[], \"links\":[ { \"href\":\"https://{host}/{path}?aid=16\", \"method\":\"GET\", \"rel\":\"DETAILS\" }, { \"href\":\"https://{host}/{path}?aid=16&countryId=NLD\", \"method\":\"GET\", \"rel\":\"WIDGET\" }, { \"href\":\"https://{host}/{path}/details?aid=16&countryId=NLD\", \"method\":\"GET\", \"rel\":\"WIDGET_DETAILS\" } ], \"bookable\": true, \"openingTimes\": { \"standardOpeningTimes\": { \"SATURDAY\": [ { \"start\": \"09:00:00\", \"end\": \"20:00:00\" } ], \"SUNDAY\": [ { \"start\": \"09:00:00\", \"end\": \"18:00:00\" } ] } }, \"ccvEnabled\": true, \"chain\": { \"id\": 1, \"name\": \"Test chain\" } }, \"recommendedMerchants\": { \"merchants\": [ { \"id\":12, \"name\":\"similar merchant\", \"phoneNumber\":\"+27113901838\", \"currency\":\"ZAR\", \"locale\":\"en_ZA\", \"timezone\":\"Africa/Johannesburg\", \"location\":{ \"coordinates\":{ \"latitude\":33.8, \"longitude\":18.4 }, \"address\":{ \"street\":\"Tamerlan street\", \"number\":\"5A\", \"zipcode\":\"10787\", \"city\":\"Cape Town\", \"country\":\"ZAF\" } }, \"reviewScore\": \"5.3\", \"tagGroups\":[ { \"type\":\"CUISINE\", \"tags\":[ { \"id\":25, \"name\":\"Testküche Hauptkategorie\" }, { \"id\":28, \"name\":\"Test cuisine\" } ] } ], \"images\":[ { \"url\":\"https://dci5ez2ey8tr9.cloudfront.net/8e4d1063-9171-40b1-94b7-5e9337591a90/7_sld.jpg\" } ], \"documents\":[], \"links\":[ { \"href\":\"https://{host}/{path}?aid=16\", \"method\":\"GET\", \"rel\":\"DETAILS\" }, { \"href\":\"https://{host}/{path}?aid=16&countryId=NLD\", \"method\":\"GET\", \"rel\":\"WIDGET\" }, { \"href\":\"https://{host}/{path}/details?aid=16&countryId=NLD\", \"method\":\"GET\", \"rel\":\"WIDGET_DETAILS\" } ], \"bookable\": true, \"openingTimes\": { \"standardOpeningTimes\": { \"SATURDAY\": [ { \"start\": \"09:00:00\", \"end\": \"20:00:00\" } ], \"SUNDAY\": [ { \"start\": \"09:00:00\", \"end\": \"18:00:00\" } ] } }, \"ccvEnabled\": true, \"chain\": { \"id\": 1, \"name\": \"Test chain\" } } ], \"size\": 1, \"offset\": 0, \"limit\": 10 } } ``` `merchant not bookable` ``` { \"merchantSearchMessage\": \"MERCHANT_NOT_BOOKABLE\", \"recommendedMerchants\": { \"limit\": 10, \"merchants\": [...], \"offset\": 0, \"size\": 0 } } ```
294
+ # @param merchant_id merchantId
295
+ # @param [Hash] opts the optional parameters
296
+ # @option opts [String] :sort Sort order. Default sorting will be by proximity. (default to CLOSEST)
297
+ # @option opts [Integer] :limit Max number of merchant recommendations to return. (default to 10)
298
+ # @option opts [String] :accept_language Locale.&lt;br&gt;Format:&lt;br&gt;&amp;lt;language code&amp;gt;[_&amp;lt;country code&amp;gt;] (default to en_GB)
299
+ # @return [MerchantWithRecommendationsDto]
300
+ def search_similar1(merchant_id, opts = {})
301
+ data, _status_code, _headers = search_similar1_with_http_info(merchant_id, opts)
302
+ data
303
+ end
304
+
305
+ # Allows to get a merchant by id and find similar merchants
306
+ # This endpoint allows to receive detailed information for a particular merchant in the system and for restaurants that are similar to this one. A merchant is similar if all the following conditions are met: 1. Location: the recommended merchants are within 30 km radius from the main merchant 2. The similar merchants are bookable online 3. The similar merchants have the main cuisine in common This merchant should be specified by their identifier **merchantId**, which is mandatory. The endpoint can take optional request header **Accept-Language**. This header is used to determine correct locale and has an effect on translation of merchant&#39;s entity fields, that may be omitted. The expected value of the header **Accept-Language** should contain language and can contain country, e.g. \&quot;de_DE\&quot; or \&quot;de\&quot;. Locale by default is \&quot;en_GB\&quot;. The endpoint returns status &#x60;HTTP 200&#x60; if the request is successful. In a successful requests the specified merchant was found. If the merchant has no products allowed for a web search, i.e. is not bookable, response data with &#x60;HTTP 200&#x60; is returned, but the field &#x60;merchant&#x60; is not set. Instead, the merchant search message is set. The endpoint will return status &#x60;HTTP 404&#x60; if the merchant, specified by identifier, was not found. Example curl: &#x60;&#x60;&#x60; curl -H &#39;X-Quandoo-AuthToken: {INSERT_KEY_HERE}&#39; -H &#39;Accept-Language: de_DE&#39; &#39;https://{host}/v{X}/merchants/11/similar&#39; &#x60;&#x60;&#x60; Example responses: &#x60;merchant bookable&#x60; &#x60;&#x60;&#x60; { \&quot;merchant\&quot;: { \&quot;id\&quot;:11, \&quot;name\&quot;:\&quot;Test merchant\&quot;, \&quot;phoneNumber\&quot;:\&quot;+27113901837\&quot;, \&quot;currency\&quot;:\&quot;ZAR\&quot;, \&quot;locale\&quot;:\&quot;en_ZA\&quot;, \&quot;timezone\&quot;:\&quot;Africa/Johannesburg\&quot;, \&quot;location\&quot;:{ \&quot;coordinates\&quot;:{ \&quot;latitude\&quot;:33.9, \&quot;longitude\&quot;:18.4 }, \&quot;address\&quot;:{ \&quot;street\&quot;:\&quot;Tamerlan street\&quot;, \&quot;number\&quot;:\&quot;6A\&quot;, \&quot;zipcode\&quot;:\&quot;10787\&quot;, \&quot;city\&quot;:\&quot;Cape Town\&quot;, \&quot;country\&quot;:\&quot;ZAF\&quot; } }, \&quot;reviewScore\&quot;: \&quot;5.3\&quot;, \&quot;tagGroups\&quot;:[ { \&quot;type\&quot;:\&quot;CUISINE\&quot;, \&quot;tags\&quot;:[ { \&quot;id\&quot;:25, \&quot;name\&quot;:\&quot;Testküche Hauptkategorie\&quot; }, { \&quot;id\&quot;:28, \&quot;name\&quot;:\&quot;Test cuisine\&quot; } ] } ], \&quot;images\&quot;:[ { \&quot;url\&quot;:\&quot;https://dci5ez2ey8tr9.cloudfront.net/8e4d1063-9171-40b1-94b7-5e9337591a90/7_sld.jpg\&quot; } ], \&quot;documents\&quot;:[], \&quot;links\&quot;:[ { \&quot;href\&quot;:\&quot;https://{host}/{path}?aid&#x3D;16\&quot;, \&quot;method\&quot;:\&quot;GET\&quot;, \&quot;rel\&quot;:\&quot;DETAILS\&quot; }, { \&quot;href\&quot;:\&quot;https://{host}/{path}?aid&#x3D;16&amp;countryId&#x3D;NLD\&quot;, \&quot;method\&quot;:\&quot;GET\&quot;, \&quot;rel\&quot;:\&quot;WIDGET\&quot; }, { \&quot;href\&quot;:\&quot;https://{host}/{path}/details?aid&#x3D;16&amp;countryId&#x3D;NLD\&quot;, \&quot;method\&quot;:\&quot;GET\&quot;, \&quot;rel\&quot;:\&quot;WIDGET_DETAILS\&quot; } ], \&quot;bookable\&quot;: true, \&quot;openingTimes\&quot;: { \&quot;standardOpeningTimes\&quot;: { \&quot;SATURDAY\&quot;: [ { \&quot;start\&quot;: \&quot;09:00:00\&quot;, \&quot;end\&quot;: \&quot;20:00:00\&quot; } ], \&quot;SUNDAY\&quot;: [ { \&quot;start\&quot;: \&quot;09:00:00\&quot;, \&quot;end\&quot;: \&quot;18:00:00\&quot; } ] } }, \&quot;ccvEnabled\&quot;: true, \&quot;chain\&quot;: { \&quot;id\&quot;: 1, \&quot;name\&quot;: \&quot;Test chain\&quot; } }, \&quot;recommendedMerchants\&quot;: { \&quot;merchants\&quot;: [ { \&quot;id\&quot;:12, \&quot;name\&quot;:\&quot;similar merchant\&quot;, \&quot;phoneNumber\&quot;:\&quot;+27113901838\&quot;, \&quot;currency\&quot;:\&quot;ZAR\&quot;, \&quot;locale\&quot;:\&quot;en_ZA\&quot;, \&quot;timezone\&quot;:\&quot;Africa/Johannesburg\&quot;, \&quot;location\&quot;:{ \&quot;coordinates\&quot;:{ \&quot;latitude\&quot;:33.8, \&quot;longitude\&quot;:18.4 }, \&quot;address\&quot;:{ \&quot;street\&quot;:\&quot;Tamerlan street\&quot;, \&quot;number\&quot;:\&quot;5A\&quot;, \&quot;zipcode\&quot;:\&quot;10787\&quot;, \&quot;city\&quot;:\&quot;Cape Town\&quot;, \&quot;country\&quot;:\&quot;ZAF\&quot; } }, \&quot;reviewScore\&quot;: \&quot;5.3\&quot;, \&quot;tagGroups\&quot;:[ { \&quot;type\&quot;:\&quot;CUISINE\&quot;, \&quot;tags\&quot;:[ { \&quot;id\&quot;:25, \&quot;name\&quot;:\&quot;Testküche Hauptkategorie\&quot; }, { \&quot;id\&quot;:28, \&quot;name\&quot;:\&quot;Test cuisine\&quot; } ] } ], \&quot;images\&quot;:[ { \&quot;url\&quot;:\&quot;https://dci5ez2ey8tr9.cloudfront.net/8e4d1063-9171-40b1-94b7-5e9337591a90/7_sld.jpg\&quot; } ], \&quot;documents\&quot;:[], \&quot;links\&quot;:[ { \&quot;href\&quot;:\&quot;https://{host}/{path}?aid&#x3D;16\&quot;, \&quot;method\&quot;:\&quot;GET\&quot;, \&quot;rel\&quot;:\&quot;DETAILS\&quot; }, { \&quot;href\&quot;:\&quot;https://{host}/{path}?aid&#x3D;16&amp;countryId&#x3D;NLD\&quot;, \&quot;method\&quot;:\&quot;GET\&quot;, \&quot;rel\&quot;:\&quot;WIDGET\&quot; }, { \&quot;href\&quot;:\&quot;https://{host}/{path}/details?aid&#x3D;16&amp;countryId&#x3D;NLD\&quot;, \&quot;method\&quot;:\&quot;GET\&quot;, \&quot;rel\&quot;:\&quot;WIDGET_DETAILS\&quot; } ], \&quot;bookable\&quot;: true, \&quot;openingTimes\&quot;: { \&quot;standardOpeningTimes\&quot;: { \&quot;SATURDAY\&quot;: [ { \&quot;start\&quot;: \&quot;09:00:00\&quot;, \&quot;end\&quot;: \&quot;20:00:00\&quot; } ], \&quot;SUNDAY\&quot;: [ { \&quot;start\&quot;: \&quot;09:00:00\&quot;, \&quot;end\&quot;: \&quot;18:00:00\&quot; } ] } }, \&quot;ccvEnabled\&quot;: true, \&quot;chain\&quot;: { \&quot;id\&quot;: 1, \&quot;name\&quot;: \&quot;Test chain\&quot; } } ], \&quot;size\&quot;: 1, \&quot;offset\&quot;: 0, \&quot;limit\&quot;: 10 } } &#x60;&#x60;&#x60; &#x60;merchant not bookable&#x60; &#x60;&#x60;&#x60; { \&quot;merchantSearchMessage\&quot;: \&quot;MERCHANT_NOT_BOOKABLE\&quot;, \&quot;recommendedMerchants\&quot;: { \&quot;limit\&quot;: 10, \&quot;merchants\&quot;: [...], \&quot;offset\&quot;: 0, \&quot;size\&quot;: 0 } } &#x60;&#x60;&#x60;
307
+ # @param merchant_id merchantId
308
+ # @param [Hash] opts the optional parameters
309
+ # @option opts [String] :sort Sort order. Default sorting will be by proximity.
310
+ # @option opts [Integer] :limit Max number of merchant recommendations to return.
311
+ # @option opts [String] :accept_language Locale.&lt;br&gt;Format:&lt;br&gt;&amp;lt;language code&amp;gt;[_&amp;lt;country code&amp;gt;]
312
+ # @return [Array<(MerchantWithRecommendationsDto, Fixnum, Hash)>] MerchantWithRecommendationsDto data, response status code and response headers
313
+ def search_similar1_with_http_info(merchant_id, opts = {})
314
+ if @api_client.config.debugging
315
+ @api_client.config.logger.debug 'Calling API: MerchantsApi.search_similar1 ...'
316
+ end
317
+ # verify the required parameter 'merchant_id' is set
318
+ if @api_client.config.client_side_validation && merchant_id.nil?
319
+ fail ArgumentError, "Missing the required parameter 'merchant_id' when calling MerchantsApi.search_similar1"
320
+ end
321
+ if @api_client.config.client_side_validation && opts[:'sort'] && !['CLOSEST'].include?(opts[:'sort'])
322
+ fail ArgumentError, 'invalid value for "sort", must be one of CLOSEST'
323
+ end
324
+ # resource path
325
+ local_var_path = '/v1/merchants/{merchantId}/similar'.sub('{' + 'merchantId' + '}', merchant_id.to_s)
326
+
327
+ # query parameters
328
+ query_params = {}
329
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
330
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
331
+
332
+ # header parameters
333
+ header_params = {}
334
+ # HTTP header 'Accept' (if needed)
335
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
336
+ header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
337
+
338
+ # form parameters
339
+ form_params = {}
340
+
341
+ # http body (model)
342
+ post_body = nil
343
+ auth_names = ['API_TOKEN']
344
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
345
+ :header_params => header_params,
346
+ :query_params => query_params,
347
+ :form_params => form_params,
348
+ :body => post_body,
349
+ :auth_names => auth_names,
350
+ :return_type => 'MerchantWithRecommendationsDto')
351
+ if @api_client.config.debugging
352
+ @api_client.config.logger.debug "API called: MerchantsApi#search_similar1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
353
+ end
354
+ return data, status_code, headers
355
+ end
356
+ end
357
+ end