algolia 3.0.0.alpha.5 → 3.0.0.alpha.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (421) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/VERSION +1 -1
  3. data/CHANGELOG.md +17 -0
  4. data/Gemfile.lock +12 -12
  5. data/algolia.gemspec +2 -1
  6. data/lib/algolia/api/abtesting_client.rb +50 -30
  7. data/lib/algolia/api/analytics_client.rb +132 -64
  8. data/lib/algolia/api/ingestion_client.rb +371 -131
  9. data/lib/algolia/api/insights_client.rb +18 -18
  10. data/lib/algolia/api/monitoring_client.rb +46 -53
  11. data/lib/algolia/api/personalization_client.rb +42 -26
  12. data/lib/algolia/api/query_suggestions_client.rb +66 -38
  13. data/lib/algolia/api/recommend_client.rb +57 -38
  14. data/lib/algolia/api/search_client.rb +625 -280
  15. data/lib/algolia/api_client.rb +2 -5
  16. data/lib/algolia/models/abtesting/ab_test.rb +14 -4
  17. data/lib/algolia/models/abtesting/ab_test_response.rb +7 -3
  18. data/lib/algolia/models/abtesting/ab_tests_variant.rb +7 -3
  19. data/lib/algolia/models/abtesting/ab_tests_variant_search_params.rb +7 -3
  20. data/lib/algolia/models/abtesting/add_ab_tests_request.rb +7 -3
  21. data/lib/algolia/models/abtesting/add_ab_tests_variant.rb +1 -1
  22. data/lib/algolia/models/abtesting/currencies_value.rb +7 -3
  23. data/lib/algolia/models/abtesting/custom_search_params.rb +7 -3
  24. data/lib/algolia/models/abtesting/error_base.rb +13 -4
  25. data/lib/algolia/models/abtesting/filter_effects.rb +7 -3
  26. data/lib/algolia/models/abtesting/filter_effects_empty_search.rb +7 -3
  27. data/lib/algolia/models/abtesting/filter_effects_outliers.rb +7 -3
  28. data/lib/algolia/models/abtesting/list_ab_tests_response.rb +10 -4
  29. data/lib/algolia/models/abtesting/variant.rb +46 -11
  30. data/lib/algolia/models/analytics/average_click_event.rb +7 -3
  31. data/lib/algolia/models/analytics/click_position.rb +7 -3
  32. data/lib/algolia/models/analytics/click_through_rate_event.rb +10 -4
  33. data/lib/algolia/models/analytics/conversion_rate_event.rb +10 -4
  34. data/lib/algolia/models/analytics/error_base.rb +13 -4
  35. data/lib/algolia/models/analytics/get_average_click_position_response.rb +7 -3
  36. data/lib/algolia/models/analytics/get_click_positions_response.rb +7 -3
  37. data/lib/algolia/models/analytics/get_click_through_rate_response.rb +10 -4
  38. data/lib/algolia/models/analytics/get_conversation_rate_response.rb +10 -4
  39. data/lib/algolia/models/analytics/get_no_click_rate_response.rb +7 -3
  40. data/lib/algolia/models/analytics/get_no_results_rate_response.rb +7 -3
  41. data/lib/algolia/models/analytics/get_searches_count_response.rb +7 -3
  42. data/lib/algolia/models/analytics/get_searches_no_clicks_response.rb +7 -3
  43. data/lib/algolia/models/analytics/get_searches_no_results_response.rb +7 -3
  44. data/lib/algolia/models/analytics/get_status_response.rb +7 -3
  45. data/lib/algolia/models/analytics/get_top_countries_response.rb +7 -3
  46. data/lib/algolia/models/analytics/get_top_filter_attribute.rb +7 -3
  47. data/lib/algolia/models/analytics/get_top_filter_attributes_response.rb +7 -3
  48. data/lib/algolia/models/analytics/get_top_filter_for_attribute.rb +7 -3
  49. data/lib/algolia/models/analytics/get_top_filter_for_attribute_response.rb +7 -3
  50. data/lib/algolia/models/analytics/get_top_filters_no_results_response.rb +7 -3
  51. data/lib/algolia/models/analytics/get_top_filters_no_results_value.rb +7 -3
  52. data/lib/algolia/models/analytics/get_top_filters_no_results_values.rb +7 -3
  53. data/lib/algolia/models/analytics/get_top_hits_response.rb +1 -1
  54. data/lib/algolia/models/analytics/get_top_searches_response.rb +1 -1
  55. data/lib/algolia/models/analytics/get_users_count_response.rb +7 -3
  56. data/lib/algolia/models/analytics/no_click_rate_event.rb +7 -3
  57. data/lib/algolia/models/analytics/no_results_rate_event.rb +7 -3
  58. data/lib/algolia/models/analytics/search_event.rb +7 -3
  59. data/lib/algolia/models/analytics/search_no_click_event.rb +7 -3
  60. data/lib/algolia/models/analytics/search_no_result_event.rb +7 -3
  61. data/lib/algolia/models/analytics/top_country.rb +7 -3
  62. data/lib/algolia/models/analytics/top_hit.rb +7 -3
  63. data/lib/algolia/models/analytics/top_hit_with_analytics.rb +10 -4
  64. data/lib/algolia/models/analytics/top_hits_response.rb +7 -3
  65. data/lib/algolia/models/analytics/top_hits_response_with_analytics.rb +7 -3
  66. data/lib/algolia/models/analytics/top_search.rb +7 -3
  67. data/lib/algolia/models/analytics/top_search_with_analytics.rb +10 -4
  68. data/lib/algolia/models/analytics/top_searches_response.rb +7 -3
  69. data/lib/algolia/models/analytics/top_searches_response_with_analytics.rb +7 -3
  70. data/lib/algolia/models/analytics/user_with_date.rb +7 -3
  71. data/lib/algolia/models/ingestion/auth_algolia.rb +7 -3
  72. data/lib/algolia/models/ingestion/auth_algolia_partial.rb +7 -3
  73. data/lib/algolia/models/ingestion/auth_api_key.rb +7 -3
  74. data/lib/algolia/models/ingestion/auth_api_key_partial.rb +7 -3
  75. data/lib/algolia/models/ingestion/auth_basic.rb +7 -3
  76. data/lib/algolia/models/ingestion/auth_basic_partial.rb +7 -3
  77. data/lib/algolia/models/ingestion/auth_google_service_account.rb +7 -3
  78. data/lib/algolia/models/ingestion/auth_google_service_account_partial.rb +7 -3
  79. data/lib/algolia/models/ingestion/auth_input.rb +1 -1
  80. data/lib/algolia/models/ingestion/auth_input_partial.rb +1 -1
  81. data/lib/algolia/models/ingestion/auth_o_auth.rb +7 -3
  82. data/lib/algolia/models/ingestion/auth_o_auth_partial.rb +7 -3
  83. data/lib/algolia/models/ingestion/authentication.rb +7 -3
  84. data/lib/algolia/models/ingestion/authentication_create.rb +7 -3
  85. data/lib/algolia/models/ingestion/authentication_create_response.rb +7 -3
  86. data/lib/algolia/models/ingestion/authentication_search.rb +7 -3
  87. data/lib/algolia/models/ingestion/authentication_update.rb +7 -3
  88. data/lib/algolia/models/ingestion/authentication_update_response.rb +7 -3
  89. data/lib/algolia/models/ingestion/big_commerce_channel.rb +7 -3
  90. data/lib/algolia/models/ingestion/big_commerce_metafield.rb +7 -3
  91. data/lib/algolia/models/ingestion/delete_response.rb +7 -3
  92. data/lib/algolia/models/ingestion/destination.rb +7 -3
  93. data/lib/algolia/models/ingestion/destination_create.rb +7 -3
  94. data/lib/algolia/models/ingestion/destination_create_response.rb +7 -3
  95. data/lib/algolia/models/ingestion/destination_index_name.rb +7 -3
  96. data/lib/algolia/models/ingestion/destination_index_prefix.rb +7 -3
  97. data/lib/algolia/models/ingestion/destination_input.rb +1 -1
  98. data/lib/algolia/models/ingestion/destination_search.rb +7 -3
  99. data/lib/algolia/models/ingestion/destination_update.rb +7 -3
  100. data/lib/algolia/models/ingestion/destination_update_response.rb +7 -3
  101. data/lib/algolia/models/ingestion/docker_source_discover.rb +7 -3
  102. data/lib/algolia/models/ingestion/docker_source_streams.rb +7 -3
  103. data/lib/algolia/models/ingestion/error_base.rb +13 -4
  104. data/lib/algolia/models/ingestion/event.rb +7 -3
  105. data/lib/algolia/models/ingestion/list_authentications_response.rb +7 -3
  106. data/lib/algolia/models/ingestion/list_destinations_response.rb +7 -3
  107. data/lib/algolia/models/ingestion/list_events_response.rb +7 -3
  108. data/lib/algolia/models/ingestion/list_sources_response.rb +7 -3
  109. data/lib/algolia/models/ingestion/list_tasks_response.rb +7 -3
  110. data/lib/algolia/models/ingestion/on_demand_date_utils_input.rb +7 -3
  111. data/lib/algolia/models/ingestion/on_demand_trigger.rb +7 -3
  112. data/lib/algolia/models/ingestion/on_demand_trigger_input.rb +7 -3
  113. data/lib/algolia/models/ingestion/pagination.rb +7 -3
  114. data/lib/algolia/models/ingestion/platform_with_none.rb +1 -1
  115. data/lib/algolia/models/ingestion/run.rb +7 -3
  116. data/lib/algolia/models/ingestion/run_list_response.rb +7 -3
  117. data/lib/algolia/models/ingestion/run_progress.rb +7 -3
  118. data/lib/algolia/models/ingestion/run_response.rb +7 -3
  119. data/lib/algolia/models/ingestion/schedule_date_utils_input.rb +7 -3
  120. data/lib/algolia/models/ingestion/schedule_trigger.rb +7 -3
  121. data/lib/algolia/models/ingestion/schedule_trigger_input.rb +7 -3
  122. data/lib/algolia/models/ingestion/source.rb +7 -3
  123. data/lib/algolia/models/ingestion/source_big_commerce.rb +7 -3
  124. data/lib/algolia/models/ingestion/source_big_query.rb +7 -3
  125. data/lib/algolia/models/ingestion/source_commercetools.rb +7 -3
  126. data/lib/algolia/models/ingestion/source_create.rb +7 -3
  127. data/lib/algolia/models/ingestion/source_create_response.rb +7 -3
  128. data/lib/algolia/models/ingestion/source_csv.rb +7 -3
  129. data/lib/algolia/models/ingestion/source_docker.rb +7 -3
  130. data/lib/algolia/models/ingestion/source_input.rb +1 -1
  131. data/lib/algolia/models/ingestion/source_json.rb +7 -3
  132. data/lib/algolia/models/ingestion/source_search.rb +7 -3
  133. data/lib/algolia/models/ingestion/source_update.rb +7 -3
  134. data/lib/algolia/models/ingestion/source_update_commercetools.rb +7 -3
  135. data/lib/algolia/models/ingestion/source_update_docker.rb +7 -3
  136. data/lib/algolia/models/ingestion/source_update_input.rb +1 -1
  137. data/lib/algolia/models/ingestion/source_update_response.rb +7 -3
  138. data/lib/algolia/models/ingestion/subscription_trigger.rb +7 -3
  139. data/lib/algolia/models/ingestion/task.rb +7 -3
  140. data/lib/algolia/models/ingestion/task_create.rb +7 -3
  141. data/lib/algolia/models/ingestion/task_create_response.rb +7 -3
  142. data/lib/algolia/models/ingestion/task_create_trigger.rb +1 -1
  143. data/lib/algolia/models/ingestion/task_input.rb +1 -1
  144. data/lib/algolia/models/ingestion/task_search.rb +7 -3
  145. data/lib/algolia/models/ingestion/task_update.rb +7 -3
  146. data/lib/algolia/models/ingestion/task_update_response.rb +7 -3
  147. data/lib/algolia/models/ingestion/trigger.rb +1 -1
  148. data/lib/algolia/models/ingestion/trigger_update_input.rb +7 -3
  149. data/lib/algolia/models/ingestion/window.rb +7 -3
  150. data/lib/algolia/models/insights/added_to_cart_object_ids.rb +7 -3
  151. data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +7 -3
  152. data/lib/algolia/models/insights/clicked_filters.rb +7 -3
  153. data/lib/algolia/models/insights/clicked_object_ids.rb +7 -3
  154. data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +7 -3
  155. data/lib/algolia/models/insights/converted_filters.rb +7 -3
  156. data/lib/algolia/models/insights/converted_object_ids.rb +7 -3
  157. data/lib/algolia/models/insights/converted_object_ids_after_search.rb +7 -3
  158. data/lib/algolia/models/insights/discount.rb +1 -1
  159. data/lib/algolia/models/insights/error_base.rb +13 -4
  160. data/lib/algolia/models/insights/events_items.rb +1 -1
  161. data/lib/algolia/models/insights/events_response.rb +7 -3
  162. data/lib/algolia/models/insights/insights_events.rb +7 -3
  163. data/lib/algolia/models/insights/object_data.rb +7 -3
  164. data/lib/algolia/models/insights/object_data_after_search.rb +7 -3
  165. data/lib/algolia/models/insights/price.rb +1 -1
  166. data/lib/algolia/models/insights/purchased_object_ids.rb +7 -3
  167. data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +7 -3
  168. data/lib/algolia/models/insights/value.rb +1 -1
  169. data/lib/algolia/models/insights/viewed_filters.rb +7 -3
  170. data/lib/algolia/models/insights/viewed_object_ids.rb +7 -3
  171. data/lib/algolia/models/monitoring/error_base.rb +13 -4
  172. data/lib/algolia/models/monitoring/get_inventory403_response.rb +7 -3
  173. data/lib/algolia/models/monitoring/incident.rb +7 -3
  174. data/lib/algolia/models/monitoring/incidents_inner.rb +7 -3
  175. data/lib/algolia/models/monitoring/incidents_response.rb +7 -3
  176. data/lib/algolia/models/monitoring/indexing_time_response.rb +7 -3
  177. data/lib/algolia/models/monitoring/indexing_time_response_metrics.rb +7 -3
  178. data/lib/algolia/models/monitoring/infrastructure_response.rb +7 -3
  179. data/lib/algolia/models/monitoring/infrastructure_response_metrics.rb +7 -3
  180. data/lib/algolia/models/monitoring/inventory_response.rb +7 -3
  181. data/lib/algolia/models/monitoring/latency_response.rb +7 -3
  182. data/lib/algolia/models/monitoring/latency_response_metrics.rb +7 -3
  183. data/lib/algolia/models/monitoring/probes_metric.rb +7 -3
  184. data/lib/algolia/models/monitoring/server.rb +7 -3
  185. data/lib/algolia/models/monitoring/status_response.rb +7 -3
  186. data/lib/algolia/models/monitoring/time_inner.rb +7 -3
  187. data/lib/algolia/models/personalization/delete_user_profile_response.rb +7 -3
  188. data/lib/algolia/models/personalization/error_base.rb +13 -4
  189. data/lib/algolia/models/personalization/event_scoring.rb +7 -3
  190. data/lib/algolia/models/personalization/facet_scoring.rb +7 -3
  191. data/lib/algolia/models/personalization/get_user_token_response.rb +7 -3
  192. data/lib/algolia/models/personalization/personalization_strategy_params.rb +7 -3
  193. data/lib/algolia/models/personalization/set_personalization_strategy_response.rb +7 -3
  194. data/lib/algolia/models/query-suggestions/base_query_suggestions_configuration_response.rb +8 -14
  195. data/lib/algolia/models/query-suggestions/base_query_suggestions_configuration_with_index.rb +7 -3
  196. data/lib/algolia/models/query-suggestions/base_response.rb +7 -3
  197. data/lib/algolia/models/query-suggestions/error_base.rb +13 -4
  198. data/lib/algolia/models/query-suggestions/facet.rb +7 -3
  199. data/lib/algolia/models/query-suggestions/get_config_status200_response.rb +7 -3
  200. data/lib/algolia/models/query-suggestions/get_log_file200_response.rb +7 -3
  201. data/lib/algolia/models/query-suggestions/languages.rb +1 -1
  202. data/lib/algolia/models/query-suggestions/query_suggestions_configuration.rb +7 -3
  203. data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +8 -14
  204. data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +7 -3
  205. data/lib/algolia/models/query-suggestions/source_index.rb +7 -3
  206. data/lib/algolia/models/recommend/around_precision.rb +1 -1
  207. data/lib/algolia/models/recommend/around_precision_from_value_inner.rb +7 -3
  208. data/lib/algolia/models/recommend/around_radius.rb +1 -1
  209. data/lib/algolia/models/recommend/automatic_facet_filter.rb +7 -3
  210. data/lib/algolia/models/recommend/automatic_facet_filters.rb +1 -1
  211. data/lib/algolia/models/recommend/base_recommend_request.rb +7 -3
  212. data/lib/algolia/models/recommend/base_recommendations_query.rb +7 -3
  213. data/lib/algolia/models/recommend/base_recommended_for_you_query.rb +7 -3
  214. data/lib/algolia/models/recommend/base_recommended_for_you_query_parameters.rb +7 -3
  215. data/lib/algolia/models/recommend/base_search_params.rb +7 -3
  216. data/lib/algolia/models/recommend/base_search_params_without_query.rb +7 -3
  217. data/lib/algolia/models/recommend/base_search_response.rb +13 -4
  218. data/lib/algolia/models/recommend/base_trending_facets_query.rb +7 -3
  219. data/lib/algolia/models/recommend/base_trending_items_query.rb +7 -3
  220. data/lib/algolia/models/recommend/condition.rb +7 -3
  221. data/lib/algolia/models/recommend/consequence.rb +7 -3
  222. data/lib/algolia/models/recommend/consequence_hide.rb +7 -3
  223. data/lib/algolia/models/recommend/consequence_params.rb +7 -3
  224. data/lib/algolia/models/recommend/consequence_query.rb +1 -1
  225. data/lib/algolia/models/recommend/consequence_query_object.rb +7 -3
  226. data/lib/algolia/models/recommend/deleted_at_response.rb +7 -3
  227. data/lib/algolia/models/recommend/distinct.rb +1 -1
  228. data/lib/algolia/models/recommend/edit.rb +7 -3
  229. data/lib/algolia/models/recommend/error_base.rb +13 -4
  230. data/lib/algolia/models/recommend/exhaustive.rb +7 -3
  231. data/lib/algolia/models/recommend/facet_filters.rb +1 -1
  232. data/lib/algolia/models/recommend/facet_ordering.rb +7 -3
  233. data/lib/algolia/models/recommend/facets.rb +7 -3
  234. data/lib/algolia/models/recommend/facets_stats.rb +7 -3
  235. data/lib/algolia/models/recommend/get_recommend_task_response.rb +7 -3
  236. data/lib/algolia/models/recommend/get_recommendations_params.rb +7 -3
  237. data/lib/algolia/models/recommend/get_recommendations_response.rb +7 -3
  238. data/lib/algolia/models/recommend/highlight_result.rb +2 -1
  239. data/lib/algolia/models/recommend/highlight_result_option.rb +7 -3
  240. data/lib/algolia/models/recommend/ignore_plurals.rb +1 -1
  241. data/lib/algolia/models/recommend/index_settings_as_search_params.rb +7 -3
  242. data/lib/algolia/models/recommend/matched_geo_location.rb +7 -3
  243. data/lib/algolia/models/recommend/mixed_search_filters.rb +1 -1
  244. data/lib/algolia/models/recommend/numeric_filters.rb +1 -1
  245. data/lib/algolia/models/recommend/optional_filters.rb +1 -1
  246. data/lib/algolia/models/recommend/params.rb +7 -3
  247. data/lib/algolia/models/recommend/personalization.rb +7 -3
  248. data/lib/algolia/models/recommend/promote.rb +1 -1
  249. data/lib/algolia/models/recommend/promote_object_id.rb +7 -3
  250. data/lib/algolia/models/recommend/promote_object_ids.rb +7 -3
  251. data/lib/algolia/models/recommend/ranking_info.rb +7 -3
  252. data/lib/algolia/models/recommend/re_ranking_apply_filter.rb +1 -1
  253. data/lib/algolia/models/recommend/recommend_hit.rb +13 -4
  254. data/lib/algolia/models/recommend/recommendations_hit.rb +1 -1
  255. data/lib/algolia/models/recommend/recommendations_hits.rb +7 -3
  256. data/lib/algolia/models/recommend/recommendations_query.rb +7 -3
  257. data/lib/algolia/models/recommend/recommendations_request.rb +1 -1
  258. data/lib/algolia/models/recommend/recommendations_results.rb +7 -3
  259. data/lib/algolia/models/recommend/recommended_for_you_query.rb +7 -3
  260. data/lib/algolia/models/recommend/recommended_for_you_query_parameters.rb +7 -3
  261. data/lib/algolia/models/recommend/redirect.rb +7 -3
  262. data/lib/algolia/models/recommend/redirect_rule_index_metadata.rb +7 -3
  263. data/lib/algolia/models/recommend/redirect_rule_index_metadata_data.rb +7 -3
  264. data/lib/algolia/models/recommend/remove_stop_words.rb +1 -1
  265. data/lib/algolia/models/recommend/rendering_content.rb +7 -3
  266. data/lib/algolia/models/recommend/rule_response.rb +7 -3
  267. data/lib/algolia/models/recommend/rule_response_metadata.rb +7 -3
  268. data/lib/algolia/models/recommend/search_params_object.rb +7 -3
  269. data/lib/algolia/models/recommend/search_params_query.rb +7 -3
  270. data/lib/algolia/models/recommend/search_recommend_rules_params.rb +7 -3
  271. data/lib/algolia/models/recommend/search_recommend_rules_response.rb +7 -3
  272. data/lib/algolia/models/recommend/semantic_search.rb +7 -3
  273. data/lib/algolia/models/recommend/snippet_result.rb +2 -1
  274. data/lib/algolia/models/recommend/snippet_result_option.rb +7 -3
  275. data/lib/algolia/models/recommend/tag_filters.rb +1 -1
  276. data/lib/algolia/models/recommend/trending_facet_hit.rb +7 -3
  277. data/lib/algolia/models/recommend/trending_facets_query.rb +7 -3
  278. data/lib/algolia/models/recommend/trending_items_query.rb +7 -3
  279. data/lib/algolia/models/recommend/typo_tolerance.rb +1 -1
  280. data/lib/algolia/models/recommend/value.rb +7 -3
  281. data/lib/algolia/models/search/add_api_key_response.rb +7 -3
  282. data/lib/algolia/models/search/api_key.rb +7 -3
  283. data/lib/algolia/models/search/around_precision.rb +1 -1
  284. data/lib/algolia/models/search/around_precision_from_value_inner.rb +7 -3
  285. data/lib/algolia/models/search/around_radius.rb +1 -1
  286. data/lib/algolia/models/search/assign_user_id_params.rb +7 -3
  287. data/lib/algolia/models/search/attribute_to_update.rb +1 -1
  288. data/lib/algolia/models/search/automatic_facet_filter.rb +7 -3
  289. data/lib/algolia/models/search/automatic_facet_filters.rb +1 -1
  290. data/lib/algolia/models/search/base_get_api_key_response.rb +7 -3
  291. data/lib/algolia/models/search/base_index_settings.rb +7 -3
  292. data/lib/algolia/models/search/base_search_params.rb +7 -3
  293. data/lib/algolia/models/search/base_search_params_without_query.rb +7 -3
  294. data/lib/algolia/models/search/base_search_response.rb +13 -4
  295. data/lib/algolia/models/search/batch_assign_user_ids_params.rb +7 -3
  296. data/lib/algolia/models/search/batch_dictionary_entries_params.rb +7 -3
  297. data/lib/algolia/models/search/batch_dictionary_entries_request.rb +7 -3
  298. data/lib/algolia/models/search/batch_params.rb +7 -3
  299. data/lib/algolia/models/search/batch_request.rb +7 -3
  300. data/lib/algolia/models/search/batch_response.rb +7 -3
  301. data/lib/algolia/models/search/batch_write_params.rb +7 -3
  302. data/lib/algolia/models/search/browse_params.rb +1 -1
  303. data/lib/algolia/models/search/browse_params_object.rb +7 -3
  304. data/lib/algolia/models/search/browse_response.rb +7 -3
  305. data/lib/algolia/models/search/built_in_operation.rb +7 -3
  306. data/lib/algolia/models/search/condition.rb +7 -3
  307. data/lib/algolia/models/search/consequence.rb +7 -3
  308. data/lib/algolia/models/search/consequence_hide.rb +7 -3
  309. data/lib/algolia/models/search/consequence_params.rb +7 -3
  310. data/lib/algolia/models/search/consequence_query.rb +1 -1
  311. data/lib/algolia/models/search/consequence_query_object.rb +7 -3
  312. data/lib/algolia/models/search/created_at_response.rb +7 -3
  313. data/lib/algolia/models/search/cursor.rb +7 -3
  314. data/lib/algolia/models/search/delete_api_key_response.rb +7 -3
  315. data/lib/algolia/models/search/delete_by_params.rb +7 -3
  316. data/lib/algolia/models/search/delete_source_response.rb +7 -3
  317. data/lib/algolia/models/search/deleted_at_response.rb +7 -3
  318. data/lib/algolia/models/search/dictionary_entry.rb +13 -4
  319. data/lib/algolia/models/search/dictionary_language.rb +7 -3
  320. data/lib/algolia/models/search/dictionary_settings_params.rb +7 -3
  321. data/lib/algolia/models/search/distinct.rb +1 -1
  322. data/lib/algolia/models/search/edit.rb +7 -3
  323. data/lib/algolia/models/search/error_base.rb +13 -4
  324. data/lib/algolia/models/search/exhaustive.rb +7 -3
  325. data/lib/algolia/models/search/facet_filters.rb +1 -1
  326. data/lib/algolia/models/search/facet_hits.rb +7 -3
  327. data/lib/algolia/models/search/facet_ordering.rb +7 -3
  328. data/lib/algolia/models/search/facets.rb +7 -3
  329. data/lib/algolia/models/search/facets_stats.rb +7 -3
  330. data/lib/algolia/models/search/fetched_index.rb +7 -3
  331. data/lib/algolia/models/search/get_api_key_response.rb +7 -3
  332. data/lib/algolia/models/search/get_dictionary_settings_response.rb +7 -3
  333. data/lib/algolia/models/search/get_logs_response.rb +7 -3
  334. data/lib/algolia/models/search/get_objects_params.rb +7 -3
  335. data/lib/algolia/models/search/get_objects_request.rb +7 -3
  336. data/lib/algolia/models/search/get_objects_response.rb +7 -3
  337. data/lib/algolia/models/search/get_task_response.rb +7 -3
  338. data/lib/algolia/models/search/get_top_user_ids_response.rb +7 -3
  339. data/lib/algolia/models/search/has_pending_mappings_response.rb +7 -3
  340. data/lib/algolia/models/search/highlight_result.rb +2 -1
  341. data/lib/algolia/models/search/highlight_result_option.rb +7 -3
  342. data/lib/algolia/models/search/hit.rb +13 -4
  343. data/lib/algolia/models/search/ignore_plurals.rb +1 -1
  344. data/lib/algolia/models/search/index_settings.rb +7 -3
  345. data/lib/algolia/models/search/index_settings_as_search_params.rb +7 -3
  346. data/lib/algolia/models/search/languages.rb +7 -3
  347. data/lib/algolia/models/search/list_api_keys_response.rb +7 -3
  348. data/lib/algolia/models/search/list_clusters_response.rb +7 -3
  349. data/lib/algolia/models/search/list_indices_response.rb +7 -3
  350. data/lib/algolia/models/search/list_user_ids_response.rb +7 -3
  351. data/lib/algolia/models/search/log.rb +7 -3
  352. data/lib/algolia/models/search/log_query.rb +7 -3
  353. data/lib/algolia/models/search/matched_geo_location.rb +7 -3
  354. data/lib/algolia/models/search/mixed_search_filters.rb +1 -1
  355. data/lib/algolia/models/search/multiple_batch_request.rb +7 -3
  356. data/lib/algolia/models/search/multiple_batch_response.rb +7 -3
  357. data/lib/algolia/models/search/numeric_filters.rb +1 -1
  358. data/lib/algolia/models/search/operation_index_params.rb +7 -3
  359. data/lib/algolia/models/search/optional_filters.rb +1 -1
  360. data/lib/algolia/models/search/params.rb +7 -3
  361. data/lib/algolia/models/search/personalization.rb +7 -3
  362. data/lib/algolia/models/search/promote.rb +1 -1
  363. data/lib/algolia/models/search/promote_object_id.rb +7 -3
  364. data/lib/algolia/models/search/promote_object_ids.rb +7 -3
  365. data/lib/algolia/models/search/ranking_info.rb +7 -3
  366. data/lib/algolia/models/search/re_ranking_apply_filter.rb +1 -1
  367. data/lib/algolia/models/search/redirect.rb +7 -3
  368. data/lib/algolia/models/search/redirect_rule_index_metadata.rb +7 -3
  369. data/lib/algolia/models/search/redirect_rule_index_metadata_data.rb +7 -3
  370. data/lib/algolia/models/search/remove_stop_words.rb +1 -1
  371. data/lib/algolia/models/search/remove_user_id_response.rb +7 -3
  372. data/lib/algolia/models/search/rendering_content.rb +7 -3
  373. data/lib/algolia/models/search/replace_source_response.rb +7 -3
  374. data/lib/algolia/models/search/rule.rb +7 -3
  375. data/lib/algolia/models/search/save_object_response.rb +7 -3
  376. data/lib/algolia/models/search/save_synonym_response.rb +7 -3
  377. data/lib/algolia/models/search/search_dictionary_entries_params.rb +7 -3
  378. data/lib/algolia/models/search/search_for_facet_values_request.rb +7 -3
  379. data/lib/algolia/models/search/search_for_facet_values_response.rb +7 -3
  380. data/lib/algolia/models/search/search_for_facets.rb +7 -3
  381. data/lib/algolia/models/search/search_for_facets_options.rb +7 -3
  382. data/lib/algolia/models/search/search_for_hits.rb +7 -3
  383. data/lib/algolia/models/search/search_for_hits_options.rb +7 -3
  384. data/lib/algolia/models/search/search_hits.rb +13 -4
  385. data/lib/algolia/models/search/search_method_params.rb +7 -3
  386. data/lib/algolia/models/search/search_params.rb +1 -1
  387. data/lib/algolia/models/search/search_params_object.rb +7 -3
  388. data/lib/algolia/models/search/search_params_query.rb +7 -3
  389. data/lib/algolia/models/search/search_params_string.rb +7 -3
  390. data/lib/algolia/models/search/search_query.rb +1 -1
  391. data/lib/algolia/models/search/search_response.rb +13 -4
  392. data/lib/algolia/models/search/search_responses.rb +7 -3
  393. data/lib/algolia/models/search/search_result.rb +1 -1
  394. data/lib/algolia/models/search/search_rules_params.rb +7 -3
  395. data/lib/algolia/models/search/search_rules_response.rb +7 -3
  396. data/lib/algolia/models/search/search_synonyms_params.rb +80 -7
  397. data/lib/algolia/models/search/search_synonyms_response.rb +13 -4
  398. data/lib/algolia/models/search/search_user_ids_params.rb +7 -3
  399. data/lib/algolia/models/search/search_user_ids_response.rb +7 -3
  400. data/lib/algolia/models/search/semantic_search.rb +7 -3
  401. data/lib/algolia/models/search/snippet_result.rb +2 -1
  402. data/lib/algolia/models/search/snippet_result_option.rb +7 -3
  403. data/lib/algolia/models/search/source.rb +7 -3
  404. data/lib/algolia/models/search/standard_entries.rb +7 -3
  405. data/lib/algolia/models/search/synonym_hit.rb +7 -3
  406. data/lib/algolia/models/search/tag_filters.rb +1 -1
  407. data/lib/algolia/models/search/time_range.rb +7 -3
  408. data/lib/algolia/models/search/typo_tolerance.rb +1 -1
  409. data/lib/algolia/models/search/update_api_key_response.rb +7 -3
  410. data/lib/algolia/models/search/updated_at_response.rb +7 -3
  411. data/lib/algolia/models/search/updated_at_with_object_id_response.rb +7 -3
  412. data/lib/algolia/models/search/updated_rule_response.rb +7 -3
  413. data/lib/algolia/models/search/user_highlight_result.rb +7 -3
  414. data/lib/algolia/models/search/user_hit.rb +7 -3
  415. data/lib/algolia/models/search/user_id.rb +7 -3
  416. data/lib/algolia/models/search/value.rb +7 -3
  417. data/lib/algolia/transport/http/http_requester.rb +2 -2
  418. data/lib/algolia/transport/stateful_host.rb +2 -1
  419. data/lib/algolia/transport/transport.rb +9 -6
  420. data/lib/algolia/version.rb +1 -1
  421. metadata +2 -2
@@ -446,19 +446,24 @@ module Algolia
446
446
  transformed_hash = {}
447
447
  types_mapping.each_pair do |key, type|
448
448
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
449
- transformed_hash[key.to_s] = nil
449
+ transformed_hash[key.to_sym] = nil
450
450
  elsif type =~ /\AArray<(.*)>/i
451
451
  # check to ensure the input is an array given that the attribute
452
452
  # is documented as an array but the input is not
453
453
  if attributes[attribute_map[key]].is_a?(Array)
454
- transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
454
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
455
455
  end
456
456
  elsif !attributes[attribute_map[key]].nil?
457
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
457
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
458
458
  end
459
459
  end
460
460
 
461
- transformed_hash.merge!(attributes.reject { |k, _| attribute_map.key?(k.to_sym) })
461
+ # merge additional_properties into transformed_hash
462
+ unless @additional_properties.nil?
463
+ @additional_properties.each_pair do |k, v|
464
+ transformed_hash[k.to_sym] = v
465
+ end
466
+ end
462
467
  new(transformed_hash)
463
468
  end
464
469
 
@@ -517,6 +522,10 @@ module Algolia
517
522
  to_hash
518
523
  end
519
524
 
525
+ def to_json(*_args)
526
+ to_hash.to_json
527
+ end
528
+
520
529
  # Returns the object in the form of hash
521
530
  # @return [Hash] Returns the object in the form of hash
522
531
  def to_hash
@@ -89,15 +89,15 @@ module Algolia
89
89
  transformed_hash = {}
90
90
  types_mapping.each_pair do |key, type|
91
91
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
92
- transformed_hash[key.to_s] = nil
92
+ transformed_hash[key.to_sym] = nil
93
93
  elsif type =~ /\AArray<(.*)>/i
94
94
  # check to ensure the input is an array given that the attribute
95
95
  # is documented as an array but the input is not
96
96
  if attributes[attribute_map[key]].is_a?(Array)
97
- transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
97
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
98
98
  end
99
99
  elsif !attributes[attribute_map[key]].nil?
100
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
100
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
101
101
  end
102
102
  end
103
103
  new(transformed_hash)
@@ -158,6 +158,10 @@ module Algolia
158
158
  to_hash
159
159
  end
160
160
 
161
+ def to_json(*_args)
162
+ to_hash.to_json
163
+ end
164
+
161
165
  # Returns the object in the form of hash
162
166
  # @return [Hash] Returns the object in the form of hash
163
167
  def to_hash
@@ -71,7 +71,7 @@ module Algolia
71
71
  return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
72
72
  end
73
73
  else # model
74
- const = Algolia.const_get(klass)
74
+ const = Algolia::Search.const_get(klass)
75
75
  if const
76
76
  if const.respond_to?(:openapi_one_of) # nested oneOf model
77
77
  model = const.build(data)
@@ -204,15 +204,15 @@ module Algolia
204
204
  transformed_hash = {}
205
205
  types_mapping.each_pair do |key, type|
206
206
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
207
- transformed_hash[key.to_s] = nil
207
+ transformed_hash[key.to_sym] = nil
208
208
  elsif type =~ /\AArray<(.*)>/i
209
209
  # check to ensure the input is an array given that the attribute
210
210
  # is documented as an array but the input is not
211
211
  if attributes[attribute_map[key]].is_a?(Array)
212
- transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
212
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
213
213
  end
214
214
  elsif !attributes[attribute_map[key]].nil?
215
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
215
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
216
216
  end
217
217
  end
218
218
  new(transformed_hash)
@@ -273,6 +273,10 @@ module Algolia
273
273
  to_hash
274
274
  end
275
275
 
276
+ def to_json(*_args)
277
+ to_hash.to_json
278
+ end
279
+
276
280
  # Returns the object in the form of hash
277
281
  # @return [Hash] Returns the object in the form of hash
278
282
  def to_hash
@@ -126,15 +126,15 @@ module Algolia
126
126
  transformed_hash = {}
127
127
  types_mapping.each_pair do |key, type|
128
128
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
129
- transformed_hash[key.to_s] = nil
129
+ transformed_hash[key.to_sym] = nil
130
130
  elsif type =~ /\AArray<(.*)>/i
131
131
  # check to ensure the input is an array given that the attribute
132
132
  # is documented as an array but the input is not
133
133
  if attributes[attribute_map[key]].is_a?(Array)
134
- transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
134
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
135
135
  end
136
136
  elsif !attributes[attribute_map[key]].nil?
137
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
137
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
138
138
  end
139
139
  end
140
140
  new(transformed_hash)
@@ -195,6 +195,10 @@ module Algolia
195
195
  to_hash
196
196
  end
197
197
 
198
+ def to_json(*_args)
199
+ to_hash.to_json
200
+ end
201
+
198
202
  # Returns the object in the form of hash
199
203
  # @return [Hash] Returns the object in the form of hash
200
204
  def to_hash
@@ -9,10 +9,43 @@ module Algolia
9
9
  # Text to search for in an index.
10
10
  attr_accessor :query
11
11
 
12
+ attr_accessor :type
13
+
14
+ # Page to retrieve (the first page is `0`, not `1`).
15
+ attr_accessor :page
16
+
17
+ # Number of hits per page.
18
+ attr_accessor :hits_per_page
19
+
20
+ class EnumAttributeValidator
21
+ attr_reader :datatype
22
+ attr_reader :allowable_values
23
+
24
+ def initialize(datatype, allowable_values)
25
+ @allowable_values = allowable_values.map do |value|
26
+ case datatype.to_s
27
+ when /Integer/i
28
+ value.to_i
29
+ when /Float/i
30
+ value.to_f
31
+ else
32
+ value
33
+ end
34
+ end
35
+ end
36
+
37
+ def valid?(value)
38
+ !value || allowable_values.include?(value)
39
+ end
40
+ end
41
+
12
42
  # Attribute mapping from ruby-style variable name to JSON key.
13
43
  def self.attribute_map
14
44
  {
15
- :query => :query
45
+ :query => :query,
46
+ :type => :type,
47
+ :page => :page,
48
+ :hits_per_page => :hitsPerPage
16
49
  }
17
50
  end
18
51
 
@@ -24,7 +57,10 @@ module Algolia
24
57
  # Attribute type mapping.
25
58
  def self.types_mapping
26
59
  {
27
- :query => :String
60
+ :query => :String,
61
+ :type => :SynonymType,
62
+ :page => :Integer,
63
+ :hits_per_page => :Integer
28
64
  }
29
65
  end
30
66
 
@@ -53,6 +89,36 @@ module Algolia
53
89
  if attributes.key?(:query)
54
90
  self.query = attributes[:query]
55
91
  end
92
+
93
+ if attributes.key?(:type)
94
+ self.type = attributes[:type]
95
+ end
96
+
97
+ if attributes.key?(:page)
98
+ self.page = attributes[:page]
99
+ end
100
+
101
+ if attributes.key?(:hits_per_page)
102
+ self.hits_per_page = attributes[:hits_per_page]
103
+ end
104
+ end
105
+
106
+ # Custom attribute writer method with validation
107
+ # @param [Object] hits_per_page Value to be assigned
108
+ def hits_per_page=(hits_per_page)
109
+ if hits_per_page.nil?
110
+ raise ArgumentError, 'hits_per_page cannot be nil'
111
+ end
112
+
113
+ if hits_per_page > 1000
114
+ raise ArgumentError, 'invalid value for "hits_per_page", must be smaller than or equal to 1000.'
115
+ end
116
+
117
+ if hits_per_page < 1
118
+ raise ArgumentError, 'invalid value for "hits_per_page", must be greater than or equal to 1.'
119
+ end
120
+
121
+ @hits_per_page = hits_per_page
56
122
  end
57
123
 
58
124
  # Checks equality by comparing each attribute.
@@ -61,7 +127,10 @@ module Algolia
61
127
  return true if equal?(other)
62
128
 
63
129
  self.class == other.class &&
64
- query == other.query
130
+ query == other.query &&
131
+ type == other.type &&
132
+ page == other.page &&
133
+ hits_per_page == other.hits_per_page
65
134
  end
66
135
 
67
136
  # @see the `==` method
@@ -73,7 +142,7 @@ module Algolia
73
142
  # Calculates hash code according to all attributes.
74
143
  # @return [Integer] Hash code
75
144
  def hash
76
- [query].hash
145
+ [query, type, page, hits_per_page].hash
77
146
  end
78
147
 
79
148
  # Builds the object from hash
@@ -86,15 +155,15 @@ module Algolia
86
155
  transformed_hash = {}
87
156
  types_mapping.each_pair do |key, type|
88
157
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
89
- transformed_hash[key.to_s] = nil
158
+ transformed_hash[key.to_sym] = nil
90
159
  elsif type =~ /\AArray<(.*)>/i
91
160
  # check to ensure the input is an array given that the attribute
92
161
  # is documented as an array but the input is not
93
162
  if attributes[attribute_map[key]].is_a?(Array)
94
- transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
163
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
95
164
  end
96
165
  elsif !attributes[attribute_map[key]].nil?
97
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
166
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
98
167
  end
99
168
  end
100
169
  new(transformed_hash)
@@ -155,6 +224,10 @@ module Algolia
155
224
  to_hash
156
225
  end
157
226
 
227
+ def to_json(*_args)
228
+ to_hash.to_json
229
+ end
230
+
158
231
  # Returns the object in the form of hash
159
232
  # @return [Hash] Returns the object in the form of hash
160
233
  def to_hash
@@ -98,19 +98,24 @@ module Algolia
98
98
  transformed_hash = {}
99
99
  types_mapping.each_pair do |key, type|
100
100
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
101
- transformed_hash[key.to_s] = nil
101
+ transformed_hash[key.to_sym] = nil
102
102
  elsif type =~ /\AArray<(.*)>/i
103
103
  # check to ensure the input is an array given that the attribute
104
104
  # is documented as an array but the input is not
105
105
  if attributes[attribute_map[key]].is_a?(Array)
106
- transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
106
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
107
107
  end
108
108
  elsif !attributes[attribute_map[key]].nil?
109
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
109
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
110
110
  end
111
111
  end
112
112
 
113
- transformed_hash.merge!(attributes.reject { |k, _| attribute_map.key?(k.to_sym) })
113
+ # merge additional_properties into transformed_hash
114
+ unless @additional_properties.nil?
115
+ @additional_properties.each_pair do |k, v|
116
+ transformed_hash[k.to_sym] = v
117
+ end
118
+ end
114
119
  new(transformed_hash)
115
120
  end
116
121
 
@@ -169,6 +174,10 @@ module Algolia
169
174
  to_hash
170
175
  end
171
176
 
177
+ def to_json(*_args)
178
+ to_hash.to_json
179
+ end
180
+
172
181
  # Returns the object in the form of hash
173
182
  # @return [Hash] Returns the object in the form of hash
174
183
  def to_hash
@@ -137,15 +137,15 @@ module Algolia
137
137
  transformed_hash = {}
138
138
  types_mapping.each_pair do |key, type|
139
139
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
140
- transformed_hash[key.to_s] = nil
140
+ transformed_hash[key.to_sym] = nil
141
141
  elsif type =~ /\AArray<(.*)>/i
142
142
  # check to ensure the input is an array given that the attribute
143
143
  # is documented as an array but the input is not
144
144
  if attributes[attribute_map[key]].is_a?(Array)
145
- transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
145
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
146
146
  end
147
147
  elsif !attributes[attribute_map[key]].nil?
148
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
148
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
149
149
  end
150
150
  end
151
151
  new(transformed_hash)
@@ -206,6 +206,10 @@ module Algolia
206
206
  to_hash
207
207
  end
208
208
 
209
+ def to_json(*_args)
210
+ to_hash.to_json
211
+ end
212
+
209
213
  # Returns the object in the form of hash
210
214
  # @return [Hash] Returns the object in the form of hash
211
215
  def to_hash
@@ -157,15 +157,15 @@ module Algolia
157
157
  transformed_hash = {}
158
158
  types_mapping.each_pair do |key, type|
159
159
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
160
- transformed_hash[key.to_s] = nil
160
+ transformed_hash[key.to_sym] = nil
161
161
  elsif type =~ /\AArray<(.*)>/i
162
162
  # check to ensure the input is an array given that the attribute
163
163
  # is documented as an array but the input is not
164
164
  if attributes[attribute_map[key]].is_a?(Array)
165
- transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
165
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
166
166
  end
167
167
  elsif !attributes[attribute_map[key]].nil?
168
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
168
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
169
169
  end
170
170
  end
171
171
  new(transformed_hash)
@@ -226,6 +226,10 @@ module Algolia
226
226
  to_hash
227
227
  end
228
228
 
229
+ def to_json(*_args)
230
+ to_hash.to_json
231
+ end
232
+
229
233
  # Returns the object in the form of hash
230
234
  # @return [Hash] Returns the object in the form of hash
231
235
  def to_hash
@@ -91,15 +91,15 @@ module Algolia
91
91
  transformed_hash = {}
92
92
  types_mapping.each_pair do |key, type|
93
93
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
94
- transformed_hash[key.to_s] = nil
94
+ transformed_hash[key.to_sym] = nil
95
95
  elsif type =~ /\AArray<(.*)>/i
96
96
  # check to ensure the input is an array given that the attribute
97
97
  # is documented as an array but the input is not
98
98
  if attributes[attribute_map[key]].is_a?(Array)
99
- transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
99
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
100
100
  end
101
101
  elsif !attributes[attribute_map[key]].nil?
102
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
102
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
103
103
  end
104
104
  end
105
105
  new(transformed_hash)
@@ -160,6 +160,10 @@ module Algolia
160
160
  to_hash
161
161
  end
162
162
 
163
+ def to_json(*_args)
164
+ to_hash.to_json
165
+ end
166
+
163
167
  # Returns the object in the form of hash
164
168
  # @return [Hash] Returns the object in the form of hash
165
169
  def to_hash
@@ -10,6 +10,7 @@ module Algolia
10
10
  # List of class defined in oneOf (OpenAPI v3)
11
11
  def openapi_one_of
12
12
  [
13
+ :'Array<SnippetResultOption>',
13
14
  :'Hash<String, SnippetResultOption>',
14
15
  :SnippetResultOption
15
16
  ]
@@ -71,7 +72,7 @@ module Algolia
71
72
  return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
72
73
  end
73
74
  else # model
74
- const = Algolia.const_get(klass)
75
+ const = Algolia::Search.const_get(klass)
75
76
  if const
76
77
  if const.respond_to?(:openapi_one_of) # nested oneOf model
77
78
  model = const.build(data)
@@ -122,15 +122,15 @@ module Algolia
122
122
  transformed_hash = {}
123
123
  types_mapping.each_pair do |key, type|
124
124
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
125
- transformed_hash[key.to_s] = nil
125
+ transformed_hash[key.to_sym] = nil
126
126
  elsif type =~ /\AArray<(.*)>/i
127
127
  # check to ensure the input is an array given that the attribute
128
128
  # is documented as an array but the input is not
129
129
  if attributes[attribute_map[key]].is_a?(Array)
130
- transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
130
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
131
131
  end
132
132
  elsif !attributes[attribute_map[key]].nil?
133
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
133
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
134
134
  end
135
135
  end
136
136
  new(transformed_hash)
@@ -191,6 +191,10 @@ module Algolia
191
191
  to_hash
192
192
  end
193
193
 
194
+ def to_json(*_args)
195
+ to_hash.to_json
196
+ end
197
+
194
198
  # Returns the object in the form of hash
195
199
  # @return [Hash] Returns the object in the form of hash
196
200
  def to_hash
@@ -99,15 +99,15 @@ module Algolia
99
99
  transformed_hash = {}
100
100
  types_mapping.each_pair do |key, type|
101
101
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
102
- transformed_hash[key.to_s] = nil
102
+ transformed_hash[key.to_sym] = nil
103
103
  elsif type =~ /\AArray<(.*)>/i
104
104
  # check to ensure the input is an array given that the attribute
105
105
  # is documented as an array but the input is not
106
106
  if attributes[attribute_map[key]].is_a?(Array)
107
- transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
107
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
108
108
  end
109
109
  elsif !attributes[attribute_map[key]].nil?
110
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
110
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
111
111
  end
112
112
  end
113
113
  new(transformed_hash)
@@ -168,6 +168,10 @@ module Algolia
168
168
  to_hash
169
169
  end
170
170
 
171
+ def to_json(*_args)
172
+ to_hash.to_json
173
+ end
174
+
171
175
  # Returns the object in the form of hash
172
176
  # @return [Hash] Returns the object in the form of hash
173
177
  def to_hash
@@ -117,15 +117,15 @@ module Algolia
117
117
  transformed_hash = {}
118
118
  types_mapping.each_pair do |key, type|
119
119
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
120
- transformed_hash[key.to_s] = nil
120
+ transformed_hash[key.to_sym] = nil
121
121
  elsif type =~ /\AArray<(.*)>/i
122
122
  # check to ensure the input is an array given that the attribute
123
123
  # is documented as an array but the input is not
124
124
  if attributes[attribute_map[key]].is_a?(Array)
125
- transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
125
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
126
126
  end
127
127
  elsif !attributes[attribute_map[key]].nil?
128
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
128
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
129
129
  end
130
130
  end
131
131
  new(transformed_hash)
@@ -186,6 +186,10 @@ module Algolia
186
186
  to_hash
187
187
  end
188
188
 
189
+ def to_json(*_args)
190
+ to_hash.to_json
191
+ end
192
+
189
193
  # Returns the object in the form of hash
190
194
  # @return [Hash] Returns the object in the form of hash
191
195
  def to_hash
@@ -188,15 +188,15 @@ module Algolia
188
188
  transformed_hash = {}
189
189
  types_mapping.each_pair do |key, type|
190
190
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
191
- transformed_hash[key.to_s] = nil
191
+ transformed_hash[key.to_sym] = nil
192
192
  elsif type =~ /\AArray<(.*)>/i
193
193
  # check to ensure the input is an array given that the attribute
194
194
  # is documented as an array but the input is not
195
195
  if attributes[attribute_map[key]].is_a?(Array)
196
- transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
196
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
197
197
  end
198
198
  elsif !attributes[attribute_map[key]].nil?
199
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
199
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
200
200
  end
201
201
  end
202
202
  new(transformed_hash)
@@ -257,6 +257,10 @@ module Algolia
257
257
  to_hash
258
258
  end
259
259
 
260
+ def to_json(*_args)
261
+ to_hash.to_json
262
+ end
263
+
260
264
  # Returns the object in the form of hash
261
265
  # @return [Hash] Returns the object in the form of hash
262
266
  def to_hash
@@ -72,7 +72,7 @@ module Algolia
72
72
  return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
73
73
  end
74
74
  else # model
75
- const = Algolia.const_get(klass)
75
+ const = Algolia::Search.const_get(klass)
76
76
  if const
77
77
  if const.respond_to?(:openapi_one_of) # nested oneOf model
78
78
  model = const.build(data)
@@ -100,15 +100,15 @@ module Algolia
100
100
  transformed_hash = {}
101
101
  types_mapping.each_pair do |key, type|
102
102
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
103
- transformed_hash[key.to_s] = nil
103
+ transformed_hash[key.to_sym] = nil
104
104
  elsif type =~ /\AArray<(.*)>/i
105
105
  # check to ensure the input is an array given that the attribute
106
106
  # is documented as an array but the input is not
107
107
  if attributes[attribute_map[key]].is_a?(Array)
108
- transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
108
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
109
109
  end
110
110
  elsif !attributes[attribute_map[key]].nil?
111
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
111
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
112
112
  end
113
113
  end
114
114
  new(transformed_hash)
@@ -169,6 +169,10 @@ module Algolia
169
169
  to_hash
170
170
  end
171
171
 
172
+ def to_json(*_args)
173
+ to_hash.to_json
174
+ end
175
+
172
176
  # Returns the object in the form of hash
173
177
  # @return [Hash] Returns the object in the form of hash
174
178
  def to_hash
@@ -72,7 +72,7 @@ module Algolia
72
72
  return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
73
73
  end
74
74
  else # model
75
- const = Algolia.const_get(klass)
75
+ const = Algolia::Search.const_get(klass)
76
76
  if const
77
77
  if const.respond_to?(:openapi_one_of) # nested oneOf model
78
78
  model = const.build(data)
@@ -100,15 +100,15 @@ module Algolia
100
100
  transformed_hash = {}
101
101
  types_mapping.each_pair do |key, type|
102
102
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
103
- transformed_hash[key.to_s] = nil
103
+ transformed_hash[key.to_sym] = nil
104
104
  elsif type =~ /\AArray<(.*)>/i
105
105
  # check to ensure the input is an array given that the attribute
106
106
  # is documented as an array but the input is not
107
107
  if attributes[attribute_map[key]].is_a?(Array)
108
- transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
108
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
109
109
  end
110
110
  elsif !attributes[attribute_map[key]].nil?
111
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
111
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
112
112
  end
113
113
  end
114
114
  new(transformed_hash)
@@ -169,6 +169,10 @@ module Algolia
169
169
  to_hash
170
170
  end
171
171
 
172
+ def to_json(*_args)
173
+ to_hash.to_json
174
+ end
175
+
172
176
  # Returns the object in the form of hash
173
177
  # @return [Hash] Returns the object in the form of hash
174
178
  def to_hash