algolia 2.3.4 → 3.0.0.alpha.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (602) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -93
  3. data/Gemfile +1 -14
  4. data/Gemfile.lock +64 -0
  5. data/README.md +4 -6
  6. data/Rakefile +0 -39
  7. data/algolia.gemspec +24 -39
  8. data/lib/algolia/api/abtesting_client.rb +418 -0
  9. data/lib/algolia/api/analytics_client.rb +1294 -0
  10. data/lib/algolia/api/ingestion_client.rb +1659 -0
  11. data/lib/algolia/api/insights_client.rb +252 -0
  12. data/lib/algolia/api/monitoring_client.rb +555 -0
  13. data/lib/algolia/api/personalization_client.rb +365 -0
  14. data/lib/algolia/api/query_suggestions_client.rb +491 -0
  15. data/lib/algolia/api/recommend_client.rb +460 -0
  16. data/lib/algolia/api/search_client.rb +2723 -0
  17. data/lib/algolia/api_client.rb +153 -0
  18. data/lib/algolia/api_error.rb +48 -0
  19. data/lib/algolia/configuration.rb +41 -0
  20. data/lib/algolia/logger_helper.rb +1 -1
  21. data/lib/algolia/models/abtesting/ab_test.rb +332 -0
  22. data/lib/algolia/models/abtesting/ab_test_response.rb +219 -0
  23. data/lib/algolia/models/abtesting/ab_tests_variant.rb +217 -0
  24. data/lib/algolia/models/abtesting/ab_tests_variant_search_params.rb +236 -0
  25. data/lib/algolia/models/abtesting/add_ab_tests_request.rb +239 -0
  26. data/lib/algolia/models/abtesting/add_ab_tests_variant.rb +96 -0
  27. data/lib/algolia/models/abtesting/currencies_value.rb +223 -0
  28. data/lib/algolia/models/abtesting/custom_search_params.rb +195 -0
  29. data/lib/algolia/models/abtesting/error_base.rb +196 -0
  30. data/lib/algolia/models/abtesting/filter_effects.rb +202 -0
  31. data/lib/algolia/models/abtesting/filter_effects_empty_search.rb +204 -0
  32. data/lib/algolia/models/abtesting/filter_effects_outliers.rb +204 -0
  33. data/lib/algolia/models/abtesting/list_ab_tests_response.rb +221 -0
  34. data/lib/algolia/models/abtesting/variant.rb +399 -0
  35. data/lib/algolia/models/analytics/average_click_event.rb +219 -0
  36. data/lib/algolia/models/analytics/click_position.rb +209 -0
  37. data/lib/algolia/models/analytics/click_through_rate_event.rb +249 -0
  38. data/lib/algolia/models/analytics/conversion_rate_event.rb +249 -0
  39. data/lib/algolia/models/analytics/direction.rb +33 -0
  40. data/lib/algolia/models/analytics/error_base.rb +196 -0
  41. data/lib/algolia/models/analytics/get_average_click_position_response.rb +221 -0
  42. data/lib/algolia/models/analytics/get_click_positions_response.rb +215 -0
  43. data/lib/algolia/models/analytics/get_click_through_rate_response.rb +251 -0
  44. data/lib/algolia/models/analytics/get_conversation_rate_response.rb +251 -0
  45. data/lib/algolia/models/analytics/get_no_click_rate_response.rb +251 -0
  46. data/lib/algolia/models/analytics/get_no_results_rate_response.rb +251 -0
  47. data/lib/algolia/models/analytics/get_searches_count_response.rb +209 -0
  48. data/lib/algolia/models/analytics/get_searches_no_clicks_response.rb +197 -0
  49. data/lib/algolia/models/analytics/get_searches_no_results_response.rb +197 -0
  50. data/lib/algolia/models/analytics/get_status_response.rb +195 -0
  51. data/lib/algolia/models/analytics/get_top_countries_response.rb +197 -0
  52. data/lib/algolia/models/analytics/get_top_filter_attribute.rb +207 -0
  53. data/lib/algolia/models/analytics/get_top_filter_attributes_response.rb +197 -0
  54. data/lib/algolia/models/analytics/get_top_filter_for_attribute.rb +231 -0
  55. data/lib/algolia/models/analytics/get_top_filter_for_attribute_response.rb +197 -0
  56. data/lib/algolia/models/analytics/get_top_filters_no_results_response.rb +197 -0
  57. data/lib/algolia/models/analytics/get_top_filters_no_results_value.rb +219 -0
  58. data/lib/algolia/models/analytics/get_top_filters_no_results_values.rb +209 -0
  59. data/lib/algolia/models/analytics/get_top_hits_response.rb +96 -0
  60. data/lib/algolia/models/analytics/get_top_searches_response.rb +96 -0
  61. data/lib/algolia/models/analytics/get_users_count_response.rb +209 -0
  62. data/lib/algolia/models/analytics/no_click_rate_event.rb +249 -0
  63. data/lib/algolia/models/analytics/no_results_rate_event.rb +249 -0
  64. data/lib/algolia/models/analytics/order_by.rb +35 -0
  65. data/lib/algolia/models/analytics/search_event.rb +207 -0
  66. data/lib/algolia/models/analytics/search_no_click_event.rb +219 -0
  67. data/lib/algolia/models/analytics/search_no_result_event.rb +219 -0
  68. data/lib/algolia/models/analytics/top_country.rb +207 -0
  69. data/lib/algolia/models/analytics/top_hit.rb +207 -0
  70. data/lib/algolia/models/analytics/top_hit_with_analytics.rb +285 -0
  71. data/lib/algolia/models/analytics/top_hits_response.rb +197 -0
  72. data/lib/algolia/models/analytics/top_hits_response_with_analytics.rb +197 -0
  73. data/lib/algolia/models/analytics/top_search.rb +219 -0
  74. data/lib/algolia/models/analytics/top_search_with_analytics.rb +309 -0
  75. data/lib/algolia/models/analytics/top_searches_response.rb +197 -0
  76. data/lib/algolia/models/analytics/top_searches_response_with_analytics.rb +197 -0
  77. data/lib/algolia/models/analytics/user_with_date.rb +207 -0
  78. data/lib/algolia/models/ingestion/action_type.rb +34 -0
  79. data/lib/algolia/models/ingestion/auth_algolia.rb +207 -0
  80. data/lib/algolia/models/ingestion/auth_algolia_partial.rb +203 -0
  81. data/lib/algolia/models/ingestion/auth_api_key.rb +195 -0
  82. data/lib/algolia/models/ingestion/auth_api_key_partial.rb +193 -0
  83. data/lib/algolia/models/ingestion/auth_basic.rb +206 -0
  84. data/lib/algolia/models/ingestion/auth_basic_partial.rb +202 -0
  85. data/lib/algolia/models/ingestion/auth_google_service_account.rb +208 -0
  86. data/lib/algolia/models/ingestion/auth_google_service_account_partial.rb +204 -0
  87. data/lib/algolia/models/ingestion/auth_input.rb +99 -0
  88. data/lib/algolia/models/ingestion/auth_input_partial.rb +99 -0
  89. data/lib/algolia/models/ingestion/auth_o_auth.rb +220 -0
  90. data/lib/algolia/models/ingestion/auth_o_auth_partial.rb +214 -0
  91. data/lib/algolia/models/ingestion/authentication.rb +283 -0
  92. data/lib/algolia/models/ingestion/authentication_create.rb +249 -0
  93. data/lib/algolia/models/ingestion/authentication_create_response.rb +220 -0
  94. data/lib/algolia/models/ingestion/authentication_search.rb +197 -0
  95. data/lib/algolia/models/ingestion/authentication_sort_keys.rb +36 -0
  96. data/lib/algolia/models/ingestion/authentication_type.rb +36 -0
  97. data/lib/algolia/models/ingestion/authentication_update.rb +243 -0
  98. data/lib/algolia/models/ingestion/authentication_update_response.rb +220 -0
  99. data/lib/algolia/models/ingestion/big_commerce_channel.rb +207 -0
  100. data/lib/algolia/models/ingestion/big_commerce_metafield.rb +207 -0
  101. data/lib/algolia/models/ingestion/big_query_data_type.rb +33 -0
  102. data/lib/algolia/models/ingestion/delete_response.rb +195 -0
  103. data/lib/algolia/models/ingestion/destination.rb +283 -0
  104. data/lib/algolia/models/ingestion/destination_create.rb +250 -0
  105. data/lib/algolia/models/ingestion/destination_create_response.rb +220 -0
  106. data/lib/algolia/models/ingestion/destination_index_name.rb +238 -0
  107. data/lib/algolia/models/ingestion/destination_index_prefix.rb +195 -0
  108. data/lib/algolia/models/ingestion/destination_input.rb +96 -0
  109. data/lib/algolia/models/ingestion/destination_search.rb +197 -0
  110. data/lib/algolia/models/ingestion/destination_sort_keys.rb +35 -0
  111. data/lib/algolia/models/ingestion/destination_type.rb +34 -0
  112. data/lib/algolia/models/ingestion/destination_update.rb +243 -0
  113. data/lib/algolia/models/ingestion/destination_update_response.rb +220 -0
  114. data/lib/algolia/models/ingestion/docker_image_type.rb +34 -0
  115. data/lib/algolia/models/ingestion/docker_registry.rb +33 -0
  116. data/lib/algolia/models/ingestion/docker_source_discover.rb +207 -0
  117. data/lib/algolia/models/ingestion/docker_source_streams.rb +196 -0
  118. data/lib/algolia/models/ingestion/error_base.rb +196 -0
  119. data/lib/algolia/models/ingestion/event.rb +311 -0
  120. data/lib/algolia/models/ingestion/event_sort_keys.rb +34 -0
  121. data/lib/algolia/models/ingestion/event_status.rb +37 -0
  122. data/lib/algolia/models/ingestion/event_type.rb +35 -0
  123. data/lib/algolia/models/ingestion/list_authentications_response.rb +207 -0
  124. data/lib/algolia/models/ingestion/list_destinations_response.rb +207 -0
  125. data/lib/algolia/models/ingestion/list_events_response.rb +218 -0
  126. data/lib/algolia/models/ingestion/list_sources_response.rb +207 -0
  127. data/lib/algolia/models/ingestion/list_tasks_response.rb +208 -0
  128. data/lib/algolia/models/ingestion/mapping_type_csv.rb +36 -0
  129. data/lib/algolia/models/ingestion/method_type.rb +33 -0
  130. data/lib/algolia/models/ingestion/on_demand_date_utils_input.rb +208 -0
  131. data/lib/algolia/models/ingestion/on_demand_trigger.rb +227 -0
  132. data/lib/algolia/models/ingestion/on_demand_trigger_input.rb +217 -0
  133. data/lib/algolia/models/ingestion/on_demand_trigger_type.rb +32 -0
  134. data/lib/algolia/models/ingestion/order_keys.rb +33 -0
  135. data/lib/algolia/models/ingestion/pagination.rb +227 -0
  136. data/lib/algolia/models/ingestion/platform.rb +33 -0
  137. data/lib/algolia/models/ingestion/platform_none.rb +32 -0
  138. data/lib/algolia/models/ingestion/platform_with_none.rb +96 -0
  139. data/lib/algolia/models/ingestion/record_type.rb +33 -0
  140. data/lib/algolia/models/ingestion/run.rb +359 -0
  141. data/lib/algolia/models/ingestion/run_list_response.rb +218 -0
  142. data/lib/algolia/models/ingestion/run_outcome.rb +34 -0
  143. data/lib/algolia/models/ingestion/run_progress.rb +201 -0
  144. data/lib/algolia/models/ingestion/run_reason_code.rb +38 -0
  145. data/lib/algolia/models/ingestion/run_response.rb +208 -0
  146. data/lib/algolia/models/ingestion/run_sort_keys.rb +34 -0
  147. data/lib/algolia/models/ingestion/run_status.rb +36 -0
  148. data/lib/algolia/models/ingestion/run_type.rb +34 -0
  149. data/lib/algolia/models/ingestion/schedule_date_utils_input.rb +214 -0
  150. data/lib/algolia/models/ingestion/schedule_trigger.rb +251 -0
  151. data/lib/algolia/models/ingestion/schedule_trigger_input.rb +229 -0
  152. data/lib/algolia/models/ingestion/schedule_trigger_type.rb +32 -0
  153. data/lib/algolia/models/ingestion/source.rb +282 -0
  154. data/lib/algolia/models/ingestion/source_big_commerce.rb +235 -0
  155. data/lib/algolia/models/ingestion/source_big_query.rb +278 -0
  156. data/lib/algolia/models/ingestion/source_commercetools.rb +238 -0
  157. data/lib/algolia/models/ingestion/source_create.rb +248 -0
  158. data/lib/algolia/models/ingestion/source_create_response.rb +218 -0
  159. data/lib/algolia/models/ingestion/source_csv.rb +276 -0
  160. data/lib/algolia/models/ingestion/source_docker.rb +261 -0
  161. data/lib/algolia/models/ingestion/source_input.rb +100 -0
  162. data/lib/algolia/models/ingestion/source_json.rb +236 -0
  163. data/lib/algolia/models/ingestion/source_search.rb +196 -0
  164. data/lib/algolia/models/ingestion/source_sort_keys.rb +35 -0
  165. data/lib/algolia/models/ingestion/source_type.rb +37 -0
  166. data/lib/algolia/models/ingestion/source_update.rb +211 -0
  167. data/lib/algolia/models/ingestion/source_update_commercetools.rb +207 -0
  168. data/lib/algolia/models/ingestion/source_update_docker.rb +246 -0
  169. data/lib/algolia/models/ingestion/source_update_input.rb +99 -0
  170. data/lib/algolia/models/ingestion/source_update_response.rb +218 -0
  171. data/lib/algolia/models/ingestion/subscription_trigger.rb +217 -0
  172. data/lib/algolia/models/ingestion/subscription_trigger_type.rb +32 -0
  173. data/lib/algolia/models/ingestion/task.rb +334 -0
  174. data/lib/algolia/models/ingestion/task_create.rb +299 -0
  175. data/lib/algolia/models/ingestion/task_create_response.rb +208 -0
  176. data/lib/algolia/models/ingestion/task_create_trigger.rb +97 -0
  177. data/lib/algolia/models/ingestion/task_input.rb +96 -0
  178. data/lib/algolia/models/ingestion/task_search.rb +196 -0
  179. data/lib/algolia/models/ingestion/task_sort_keys.rb +36 -0
  180. data/lib/algolia/models/ingestion/task_update.rb +250 -0
  181. data/lib/algolia/models/ingestion/task_update_response.rb +208 -0
  182. data/lib/algolia/models/ingestion/trigger.rb +97 -0
  183. data/lib/algolia/models/ingestion/trigger_type.rb +34 -0
  184. data/lib/algolia/models/ingestion/trigger_update_input.rb +196 -0
  185. data/lib/algolia/models/ingestion/window.rb +208 -0
  186. data/lib/algolia/models/insights/add_to_cart_event.rb +32 -0
  187. data/lib/algolia/models/insights/added_to_cart_object_ids.rb +384 -0
  188. data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +419 -0
  189. data/lib/algolia/models/insights/click_event.rb +32 -0
  190. data/lib/algolia/models/insights/clicked_filters.rb +351 -0
  191. data/lib/algolia/models/insights/clicked_object_ids.rb +341 -0
  192. data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +418 -0
  193. data/lib/algolia/models/insights/conversion_event.rb +32 -0
  194. data/lib/algolia/models/insights/converted_filters.rb +350 -0
  195. data/lib/algolia/models/insights/converted_object_ids.rb +351 -0
  196. data/lib/algolia/models/insights/converted_object_ids_after_search.rb +386 -0
  197. data/lib/algolia/models/insights/discount.rb +97 -0
  198. data/lib/algolia/models/insights/error_base.rb +196 -0
  199. data/lib/algolia/models/insights/events_items.rb +106 -0
  200. data/lib/algolia/models/insights/events_response.rb +204 -0
  201. data/lib/algolia/models/insights/insights_events.rb +215 -0
  202. data/lib/algolia/models/insights/object_data.rb +211 -0
  203. data/lib/algolia/models/insights/object_data_after_search.rb +221 -0
  204. data/lib/algolia/models/insights/price.rb +97 -0
  205. data/lib/algolia/models/insights/purchase_event.rb +32 -0
  206. data/lib/algolia/models/insights/purchased_object_ids.rb +384 -0
  207. data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +419 -0
  208. data/lib/algolia/models/insights/view_event.rb +32 -0
  209. data/lib/algolia/models/insights/viewed_filters.rb +351 -0
  210. data/lib/algolia/models/insights/viewed_object_ids.rb +351 -0
  211. data/lib/algolia/models/monitoring/error_base.rb +196 -0
  212. data/lib/algolia/models/monitoring/get_inventory403_response.rb +192 -0
  213. data/lib/algolia/models/monitoring/incident.rb +225 -0
  214. data/lib/algolia/models/monitoring/incidents_inner.rb +202 -0
  215. data/lib/algolia/models/monitoring/incidents_response.rb +194 -0
  216. data/lib/algolia/models/monitoring/indexing_time_response.rb +192 -0
  217. data/lib/algolia/models/monitoring/indexing_time_response_metrics.rb +194 -0
  218. data/lib/algolia/models/monitoring/infrastructure_response.rb +192 -0
  219. data/lib/algolia/models/monitoring/infrastructure_response_metrics.rb +243 -0
  220. data/lib/algolia/models/monitoring/inventory_response.rb +194 -0
  221. data/lib/algolia/models/monitoring/latency_response.rb +192 -0
  222. data/lib/algolia/models/monitoring/latency_response_metrics.rb +194 -0
  223. data/lib/algolia/models/monitoring/metric.rb +37 -0
  224. data/lib/algolia/models/monitoring/period.rb +36 -0
  225. data/lib/algolia/models/monitoring/probes_metric.rb +203 -0
  226. data/lib/algolia/models/monitoring/region.rb +46 -0
  227. data/lib/algolia/models/monitoring/server.rb +272 -0
  228. data/lib/algolia/models/monitoring/server_status.rb +32 -0
  229. data/lib/algolia/models/monitoring/status.rb +35 -0
  230. data/lib/algolia/models/monitoring/status_response.rb +194 -0
  231. data/lib/algolia/models/monitoring/time_inner.rb +203 -0
  232. data/lib/algolia/models/monitoring/type.rb +32 -0
  233. data/lib/algolia/models/personalization/delete_user_profile_response.rb +207 -0
  234. data/lib/algolia/models/personalization/error_base.rb +196 -0
  235. data/lib/algolia/models/personalization/event_scoring.rb +219 -0
  236. data/lib/algolia/models/personalization/facet_scoring.rb +207 -0
  237. data/lib/algolia/models/personalization/get_user_token_response.rb +219 -0
  238. data/lib/algolia/models/personalization/personalization_strategy_params.rb +223 -0
  239. data/lib/algolia/models/personalization/set_personalization_strategy_response.rb +195 -0
  240. data/lib/algolia/models/query-suggestions/base_query_suggestions_configuration_response.rb +223 -0
  241. data/lib/algolia/models/query-suggestions/base_query_suggestions_configuration_with_index.rb +195 -0
  242. data/lib/algolia/models/query-suggestions/base_response.rb +203 -0
  243. data/lib/algolia/models/query-suggestions/error_base.rb +196 -0
  244. data/lib/algolia/models/query-suggestions/facet.rb +204 -0
  245. data/lib/algolia/models/query-suggestions/get_config_status200_response.rb +233 -0
  246. data/lib/algolia/models/query-suggestions/get_log_file200_response.rb +244 -0
  247. data/lib/algolia/models/query-suggestions/languages.rb +97 -0
  248. data/lib/algolia/models/query-suggestions/log_level.rb +34 -0
  249. data/lib/algolia/models/query-suggestions/query_suggestions_configuration.rb +255 -0
  250. data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +315 -0
  251. data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +275 -0
  252. data/lib/algolia/models/query-suggestions/source_index.rb +305 -0
  253. data/lib/algolia/models/recommend/advanced_syntax_features.rb +33 -0
  254. data/lib/algolia/models/recommend/alternatives_as_exact.rb +34 -0
  255. data/lib/algolia/models/recommend/anchoring.rb +35 -0
  256. data/lib/algolia/models/recommend/around_precision.rb +97 -0
  257. data/lib/algolia/models/recommend/around_precision_from_value_inner.rb +201 -0
  258. data/lib/algolia/models/recommend/around_radius.rb +97 -0
  259. data/lib/algolia/models/recommend/around_radius_all.rb +32 -0
  260. data/lib/algolia/models/recommend/automatic_facet_filter.rb +216 -0
  261. data/lib/algolia/models/recommend/automatic_facet_filters.rb +97 -0
  262. data/lib/algolia/models/recommend/base_recommend_request.rb +233 -0
  263. data/lib/algolia/models/recommend/base_recommendations_query.rb +246 -0
  264. data/lib/algolia/models/recommend/base_recommended_for_you_query.rb +234 -0
  265. data/lib/algolia/models/recommend/base_recommended_for_you_query_parameters.rb +195 -0
  266. data/lib/algolia/models/recommend/base_search_params.rb +564 -0
  267. data/lib/algolia/models/recommend/base_search_params_without_query.rb +546 -0
  268. data/lib/algolia/models/recommend/base_search_response.rb +517 -0
  269. data/lib/algolia/models/recommend/base_trending_facets_query.rb +226 -0
  270. data/lib/algolia/models/recommend/base_trending_items_query.rb +252 -0
  271. data/lib/algolia/models/recommend/condition.rb +244 -0
  272. data/lib/algolia/models/recommend/consequence.rb +239 -0
  273. data/lib/algolia/models/recommend/consequence_hide.rb +196 -0
  274. data/lib/algolia/models/recommend/consequence_params.rb +1121 -0
  275. data/lib/algolia/models/recommend/consequence_query.rb +97 -0
  276. data/lib/algolia/models/recommend/consequence_query_object.rb +207 -0
  277. data/lib/algolia/models/recommend/deleted_at_response.rb +208 -0
  278. data/lib/algolia/models/recommend/distinct.rb +97 -0
  279. data/lib/algolia/models/recommend/edit.rb +234 -0
  280. data/lib/algolia/models/recommend/edit_type.rb +33 -0
  281. data/lib/algolia/models/recommend/error_base.rb +196 -0
  282. data/lib/algolia/models/recommend/exact_on_single_word_query.rb +34 -0
  283. data/lib/algolia/models/recommend/exhaustive.rb +234 -0
  284. data/lib/algolia/models/recommend/facet_filters.rb +97 -0
  285. data/lib/algolia/models/recommend/facet_ordering.rb +205 -0
  286. data/lib/algolia/models/recommend/facets.rb +196 -0
  287. data/lib/algolia/models/recommend/facets_stats.rb +223 -0
  288. data/lib/algolia/models/recommend/get_recommend_task_response.rb +216 -0
  289. data/lib/algolia/models/recommend/get_recommendations_params.rb +198 -0
  290. data/lib/algolia/models/recommend/get_recommendations_response.rb +194 -0
  291. data/lib/algolia/models/recommend/highlight_result.rb +96 -0
  292. data/lib/algolia/models/recommend/highlight_result_option.rb +253 -0
  293. data/lib/algolia/models/recommend/ignore_plurals.rb +97 -0
  294. data/lib/algolia/models/recommend/index_settings_as_search_params.rb +723 -0
  295. data/lib/algolia/models/recommend/match_level.rb +34 -0
  296. data/lib/algolia/models/recommend/matched_geo_location.rb +213 -0
  297. data/lib/algolia/models/recommend/mixed_search_filters.rb +96 -0
  298. data/lib/algolia/models/recommend/mode.rb +33 -0
  299. data/lib/algolia/models/recommend/numeric_filters.rb +97 -0
  300. data/lib/algolia/models/recommend/optional_filters.rb +97 -0
  301. data/lib/algolia/models/recommend/params.rb +220 -0
  302. data/lib/algolia/models/recommend/personalization.rb +213 -0
  303. data/lib/algolia/models/recommend/promote.rb +96 -0
  304. data/lib/algolia/models/recommend/promote_object_id.rb +208 -0
  305. data/lib/algolia/models/recommend/promote_object_ids.rb +210 -0
  306. data/lib/algolia/models/recommend/query_type.rb +34 -0
  307. data/lib/algolia/models/recommend/ranking_info.rb +328 -0
  308. data/lib/algolia/models/recommend/re_ranking_apply_filter.rb +97 -0
  309. data/lib/algolia/models/recommend/recommend_hit.rb +271 -0
  310. data/lib/algolia/models/recommend/recommend_models.rb +35 -0
  311. data/lib/algolia/models/recommend/recommendation_models.rb +33 -0
  312. data/lib/algolia/models/recommend/recommendations_hit.rb +96 -0
  313. data/lib/algolia/models/recommend/recommendations_hits.rb +216 -0
  314. data/lib/algolia/models/recommend/recommendations_query.rb +304 -0
  315. data/lib/algolia/models/recommend/recommendations_request.rb +98 -0
  316. data/lib/algolia/models/recommend/recommendations_results.rb +553 -0
  317. data/lib/algolia/models/recommend/recommended_for_you_model.rb +32 -0
  318. data/lib/algolia/models/recommend/recommended_for_you_query.rb +292 -0
  319. data/lib/algolia/models/recommend/recommended_for_you_query_parameters.rb +1105 -0
  320. data/lib/algolia/models/recommend/redirect.rb +195 -0
  321. data/lib/algolia/models/recommend/redirect_rule_index_metadata.rb +242 -0
  322. data/lib/algolia/models/recommend/redirect_rule_index_metadata_data.rb +195 -0
  323. data/lib/algolia/models/recommend/remove_stop_words.rb +97 -0
  324. data/lib/algolia/models/recommend/remove_words_if_no_results.rb +35 -0
  325. data/lib/algolia/models/recommend/rendering_content.rb +193 -0
  326. data/lib/algolia/models/recommend/rule_response.rb +246 -0
  327. data/lib/algolia/models/recommend/rule_response_metadata.rb +193 -0
  328. data/lib/algolia/models/recommend/search_params_object.rb +1103 -0
  329. data/lib/algolia/models/recommend/search_params_query.rb +193 -0
  330. data/lib/algolia/models/recommend/search_recommend_rules_params.rb +268 -0
  331. data/lib/algolia/models/recommend/search_recommend_rules_response.rb +233 -0
  332. data/lib/algolia/models/recommend/semantic_search.rb +198 -0
  333. data/lib/algolia/models/recommend/snippet_result.rb +96 -0
  334. data/lib/algolia/models/recommend/snippet_result_option.rb +229 -0
  335. data/lib/algolia/models/recommend/sort_remaining_by.rb +34 -0
  336. data/lib/algolia/models/recommend/tag_filters.rb +97 -0
  337. data/lib/algolia/models/recommend/task_status.rb +33 -0
  338. data/lib/algolia/models/recommend/trending_facet_hit.rb +238 -0
  339. data/lib/algolia/models/recommend/trending_facets_model.rb +32 -0
  340. data/lib/algolia/models/recommend/trending_facets_query.rb +284 -0
  341. data/lib/algolia/models/recommend/trending_items_model.rb +32 -0
  342. data/lib/algolia/models/recommend/trending_items_query.rb +310 -0
  343. data/lib/algolia/models/recommend/typo_tolerance.rb +97 -0
  344. data/lib/algolia/models/recommend/typo_tolerance_enum.rb +33 -0
  345. data/lib/algolia/models/recommend/value.rb +226 -0
  346. data/lib/algolia/models/search/acl.rb +47 -0
  347. data/lib/algolia/models/search/action.rb +38 -0
  348. data/lib/algolia/models/search/add_api_key_response.rb +207 -0
  349. data/lib/algolia/models/search/advanced_syntax_features.rb +33 -0
  350. data/lib/algolia/models/search/alternatives_as_exact.rb +34 -0
  351. data/lib/algolia/models/search/anchoring.rb +35 -0
  352. data/lib/algolia/models/search/api_key.rb +272 -0
  353. data/lib/algolia/models/search/around_precision.rb +97 -0
  354. data/lib/algolia/models/search/around_precision_from_value_inner.rb +201 -0
  355. data/lib/algolia/models/search/around_radius.rb +97 -0
  356. data/lib/algolia/models/search/around_radius_all.rb +32 -0
  357. data/lib/algolia/models/search/assign_user_id_params.rb +196 -0
  358. data/lib/algolia/models/search/attribute_to_update.rb +96 -0
  359. data/lib/algolia/models/search/automatic_facet_filter.rb +216 -0
  360. data/lib/algolia/models/search/automatic_facet_filters.rb +97 -0
  361. data/lib/algolia/models/search/base_get_api_key_response.rb +205 -0
  362. data/lib/algolia/models/search/base_index_settings.rb +366 -0
  363. data/lib/algolia/models/search/base_search_params.rb +564 -0
  364. data/lib/algolia/models/search/base_search_params_without_query.rb +546 -0
  365. data/lib/algolia/models/search/base_search_response.rb +517 -0
  366. data/lib/algolia/models/search/batch_assign_user_ids_params.rb +210 -0
  367. data/lib/algolia/models/search/batch_dictionary_entries_params.rb +208 -0
  368. data/lib/algolia/models/search/batch_dictionary_entries_request.rb +227 -0
  369. data/lib/algolia/models/search/batch_params.rb +197 -0
  370. data/lib/algolia/models/search/batch_request.rb +228 -0
  371. data/lib/algolia/models/search/batch_response.rb +209 -0
  372. data/lib/algolia/models/search/batch_write_params.rb +197 -0
  373. data/lib/algolia/models/search/browse_params.rb +96 -0
  374. data/lib/algolia/models/search/browse_params_object.rb +1113 -0
  375. data/lib/algolia/models/search/browse_response.rb +568 -0
  376. data/lib/algolia/models/search/built_in_operation.rb +229 -0
  377. data/lib/algolia/models/search/built_in_operation_type.rb +38 -0
  378. data/lib/algolia/models/search/condition.rb +244 -0
  379. data/lib/algolia/models/search/consequence.rb +239 -0
  380. data/lib/algolia/models/search/consequence_hide.rb +196 -0
  381. data/lib/algolia/models/search/consequence_params.rb +1121 -0
  382. data/lib/algolia/models/search/consequence_query.rb +97 -0
  383. data/lib/algolia/models/search/consequence_query_object.rb +207 -0
  384. data/lib/algolia/models/search/created_at_response.rb +196 -0
  385. data/lib/algolia/models/search/cursor.rb +193 -0
  386. data/lib/algolia/models/search/delete_api_key_response.rb +195 -0
  387. data/lib/algolia/models/search/delete_by_params.rb +263 -0
  388. data/lib/algolia/models/search/delete_source_response.rb +195 -0
  389. data/lib/algolia/models/search/deleted_at_response.rb +208 -0
  390. data/lib/algolia/models/search/dictionary_action.rb +33 -0
  391. data/lib/algolia/models/search/dictionary_entry.rb +276 -0
  392. data/lib/algolia/models/search/dictionary_entry_state.rb +33 -0
  393. data/lib/algolia/models/search/dictionary_language.rb +194 -0
  394. data/lib/algolia/models/search/dictionary_settings_params.rb +195 -0
  395. data/lib/algolia/models/search/dictionary_type.rb +34 -0
  396. data/lib/algolia/models/search/distinct.rb +97 -0
  397. data/lib/algolia/models/search/edit.rb +234 -0
  398. data/lib/algolia/models/search/edit_type.rb +33 -0
  399. data/lib/algolia/models/search/error_base.rb +196 -0
  400. data/lib/algolia/models/search/exact_on_single_word_query.rb +34 -0
  401. data/lib/algolia/models/search/exhaustive.rb +234 -0
  402. data/lib/algolia/models/search/facet_filters.rb +97 -0
  403. data/lib/algolia/models/search/facet_hits.rb +219 -0
  404. data/lib/algolia/models/search/facet_ordering.rb +205 -0
  405. data/lib/algolia/models/search/facets.rb +196 -0
  406. data/lib/algolia/models/search/facets_stats.rb +223 -0
  407. data/lib/algolia/models/search/fetched_index.rb +313 -0
  408. data/lib/algolia/models/search/get_api_key_response.rb +301 -0
  409. data/lib/algolia/models/search/get_dictionary_settings_response.rb +194 -0
  410. data/lib/algolia/models/search/get_logs_response.rb +196 -0
  411. data/lib/algolia/models/search/get_objects_params.rb +197 -0
  412. data/lib/algolia/models/search/get_objects_request.rb +220 -0
  413. data/lib/algolia/models/search/get_objects_response.rb +197 -0
  414. data/lib/algolia/models/search/get_task_response.rb +216 -0
  415. data/lib/algolia/models/search/get_top_user_ids_response.rb +198 -0
  416. data/lib/algolia/models/search/has_pending_mappings_response.rb +207 -0
  417. data/lib/algolia/models/search/highlight_result.rb +96 -0
  418. data/lib/algolia/models/search/highlight_result_option.rb +253 -0
  419. data/lib/algolia/models/search/hit.rb +241 -0
  420. data/lib/algolia/models/search/ignore_plurals.rb +97 -0
  421. data/lib/algolia/models/search/index_settings.rb +912 -0
  422. data/lib/algolia/models/search/index_settings_as_search_params.rb +723 -0
  423. data/lib/algolia/models/search/languages.rb +221 -0
  424. data/lib/algolia/models/search/list_api_keys_response.rb +197 -0
  425. data/lib/algolia/models/search/list_clusters_response.rb +198 -0
  426. data/lib/algolia/models/search/list_indices_response.rb +207 -0
  427. data/lib/algolia/models/search/list_user_ids_response.rb +198 -0
  428. data/lib/algolia/models/search/log.rb +358 -0
  429. data/lib/algolia/models/search/log_query.rb +213 -0
  430. data/lib/algolia/models/search/log_type.rb +35 -0
  431. data/lib/algolia/models/search/match_level.rb +34 -0
  432. data/lib/algolia/models/search/matched_geo_location.rb +213 -0
  433. data/lib/algolia/models/search/mixed_search_filters.rb +96 -0
  434. data/lib/algolia/models/search/mode.rb +33 -0
  435. data/lib/algolia/models/search/multiple_batch_request.rb +240 -0
  436. data/lib/algolia/models/search/multiple_batch_response.rb +211 -0
  437. data/lib/algolia/models/search/numeric_filters.rb +97 -0
  438. data/lib/algolia/models/search/operation_index_params.rb +240 -0
  439. data/lib/algolia/models/search/operation_type.rb +33 -0
  440. data/lib/algolia/models/search/optional_filters.rb +97 -0
  441. data/lib/algolia/models/search/params.rb +220 -0
  442. data/lib/algolia/models/search/personalization.rb +213 -0
  443. data/lib/algolia/models/search/promote.rb +96 -0
  444. data/lib/algolia/models/search/promote_object_id.rb +208 -0
  445. data/lib/algolia/models/search/promote_object_ids.rb +210 -0
  446. data/lib/algolia/models/search/query_type.rb +34 -0
  447. data/lib/algolia/models/search/ranking_info.rb +328 -0
  448. data/lib/algolia/models/search/re_ranking_apply_filter.rb +97 -0
  449. data/lib/algolia/models/search/redirect.rb +195 -0
  450. data/lib/algolia/models/search/redirect_rule_index_metadata.rb +242 -0
  451. data/lib/algolia/models/search/redirect_rule_index_metadata_data.rb +195 -0
  452. data/lib/algolia/models/search/remove_stop_words.rb +97 -0
  453. data/lib/algolia/models/search/remove_user_id_response.rb +195 -0
  454. data/lib/algolia/models/search/remove_words_if_no_results.rb +35 -0
  455. data/lib/algolia/models/search/rendering_content.rb +193 -0
  456. data/lib/algolia/models/search/replace_source_response.rb +195 -0
  457. data/lib/algolia/models/search/rule.rb +249 -0
  458. data/lib/algolia/models/search/save_object_response.rb +217 -0
  459. data/lib/algolia/models/search/save_synonym_response.rb +219 -0
  460. data/lib/algolia/models/search/scope_type.rb +34 -0
  461. data/lib/algolia/models/search/search_dictionary_entries_params.rb +244 -0
  462. data/lib/algolia/models/search/search_for_facet_values_request.rb +227 -0
  463. data/lib/algolia/models/search/search_for_facet_values_response.rb +218 -0
  464. data/lib/algolia/models/search/search_for_facets.rb +1158 -0
  465. data/lib/algolia/models/search/search_for_facets_options.rb +274 -0
  466. data/lib/algolia/models/search/search_for_hits.rb +1134 -0
  467. data/lib/algolia/models/search/search_for_hits_options.rb +226 -0
  468. data/lib/algolia/models/search/search_hits.rb +223 -0
  469. data/lib/algolia/models/search/search_method_params.rb +227 -0
  470. data/lib/algolia/models/search/search_params.rb +96 -0
  471. data/lib/algolia/models/search/search_params_object.rb +1103 -0
  472. data/lib/algolia/models/search/search_params_query.rb +193 -0
  473. data/lib/algolia/models/search/search_params_string.rb +193 -0
  474. data/lib/algolia/models/search/search_query.rb +96 -0
  475. data/lib/algolia/models/search/search_response.rb +560 -0
  476. data/lib/algolia/models/search/search_responses.rb +196 -0
  477. data/lib/algolia/models/search/search_result.rb +96 -0
  478. data/lib/algolia/models/search/search_rules_params.rb +311 -0
  479. data/lib/algolia/models/search/search_rules_response.rb +233 -0
  480. data/lib/algolia/models/search/search_strategy.rb +33 -0
  481. data/lib/algolia/models/search/search_synonyms_params.rb +193 -0
  482. data/lib/algolia/models/search/search_synonyms_response.rb +212 -0
  483. data/lib/algolia/models/search/search_type_default.rb +32 -0
  484. data/lib/algolia/models/search/search_type_facet.rb +32 -0
  485. data/lib/algolia/models/search/search_user_ids_params.rb +244 -0
  486. data/lib/algolia/models/search/search_user_ids_response.rb +264 -0
  487. data/lib/algolia/models/search/semantic_search.rb +198 -0
  488. data/lib/algolia/models/search/snippet_result.rb +96 -0
  489. data/lib/algolia/models/search/snippet_result_option.rb +229 -0
  490. data/lib/algolia/models/search/sort_remaining_by.rb +34 -0
  491. data/lib/algolia/models/search/source.rb +206 -0
  492. data/lib/algolia/models/search/standard_entries.rb +224 -0
  493. data/lib/algolia/models/search/synonym_hit.rb +295 -0
  494. data/lib/algolia/models/search/synonym_type.rb +36 -0
  495. data/lib/algolia/models/search/tag_filters.rb +97 -0
  496. data/lib/algolia/models/search/task_status.rb +33 -0
  497. data/lib/algolia/models/search/time_range.rb +207 -0
  498. data/lib/algolia/models/search/typo_tolerance.rb +97 -0
  499. data/lib/algolia/models/search/typo_tolerance_enum.rb +33 -0
  500. data/lib/algolia/models/search/update_api_key_response.rb +207 -0
  501. data/lib/algolia/models/search/updated_at_response.rb +208 -0
  502. data/lib/algolia/models/search/updated_at_with_object_id_response.rb +214 -0
  503. data/lib/algolia/models/search/updated_rule_response.rb +219 -0
  504. data/lib/algolia/models/search/user_highlight_result.rb +205 -0
  505. data/lib/algolia/models/search/user_hit.rb +269 -0
  506. data/lib/algolia/models/search/user_id.rb +247 -0
  507. data/lib/algolia/models/search/value.rb +226 -0
  508. data/lib/algolia/transport/echo_requester.rb +10 -0
  509. data/lib/algolia/{http → transport/http}/http_requester.rb +24 -19
  510. data/lib/algolia/{http → transport/http}/response.rb +11 -1
  511. data/lib/algolia/transport/request_options.rb +19 -31
  512. data/lib/algolia/transport/retry_strategy.rb +5 -8
  513. data/lib/algolia/transport/stateful_host.rb +1 -2
  514. data/lib/algolia/transport/transport.rb +33 -73
  515. data/lib/algolia/user_agent.rb +4 -14
  516. data/lib/algolia/version.rb +3 -1
  517. data/lib/algolia.rb +23 -40
  518. metadata +522 -217
  519. data/.circleci/config.yml +0 -155
  520. data/.dockerignore +0 -38
  521. data/.github/ISSUE_TEMPLATE.md +0 -20
  522. data/.github/PULL_REQUEST_TEMPLATE.md +0 -22
  523. data/.gitignore +0 -40
  524. data/.rubocop.yml +0 -189
  525. data/.rubocop_todo.yml +0 -14
  526. data/CODE_OF_CONDUCT.md +0 -74
  527. data/CONTRIBUTING.MD +0 -184
  528. data/DOCKER_README.MD +0 -89
  529. data/Dockerfile +0 -7
  530. data/LICENSE +0 -21
  531. data/SECURITY.md +0 -3
  532. data/Steepfile +0 -6
  533. data/bin/console +0 -21
  534. data/bin/setup +0 -8
  535. data/lib/algolia/account_client.rb +0 -65
  536. data/lib/algolia/analytics_client.rb +0 -105
  537. data/lib/algolia/config/analytics_config.rb +0 -20
  538. data/lib/algolia/config/base_config.rb +0 -43
  539. data/lib/algolia/config/insights_config.rb +0 -20
  540. data/lib/algolia/config/personalization_config.rb +0 -20
  541. data/lib/algolia/config/recommend_config.rb +0 -6
  542. data/lib/algolia/config/recommendation_config.rb +0 -7
  543. data/lib/algolia/config/search_config.rb +0 -40
  544. data/lib/algolia/defaults.rb +0 -35
  545. data/lib/algolia/helpers.rb +0 -134
  546. data/lib/algolia/insights_client.rb +0 -238
  547. data/lib/algolia/iterators/base_iterator.rb +0 -19
  548. data/lib/algolia/iterators/object_iterator.rb +0 -28
  549. data/lib/algolia/iterators/paginator_iterator.rb +0 -46
  550. data/lib/algolia/iterators/rule_iterator.rb +0 -9
  551. data/lib/algolia/iterators/synonym_iterator.rb +0 -9
  552. data/lib/algolia/personalization_client.rb +0 -60
  553. data/lib/algolia/recommend_client.rb +0 -134
  554. data/lib/algolia/recommendation_client.rb +0 -7
  555. data/lib/algolia/responses/add_api_key_response.rb +0 -38
  556. data/lib/algolia/responses/base_response.rb +0 -9
  557. data/lib/algolia/responses/delete_api_key_response.rb +0 -40
  558. data/lib/algolia/responses/dictionary_response.rb +0 -33
  559. data/lib/algolia/responses/indexing_response.rb +0 -28
  560. data/lib/algolia/responses/multiple_batch_indexing_response.rb +0 -29
  561. data/lib/algolia/responses/multiple_response.rb +0 -45
  562. data/lib/algolia/responses/restore_api_key_response.rb +0 -36
  563. data/lib/algolia/responses/update_api_key_response.rb +0 -39
  564. data/lib/algolia/search_client.rb +0 -791
  565. data/lib/algolia/search_index.rb +0 -1059
  566. data/renovate.json +0 -5
  567. data/sig/config/algolia_config.rbs +0 -24
  568. data/sig/config/analytics_config.rbs +0 -11
  569. data/sig/config/insights_config.rbs +0 -11
  570. data/sig/config/recommendation_config.rbs +0 -11
  571. data/sig/config/search_config.rbs +0 -11
  572. data/sig/enums/call_type.rbs +0 -5
  573. data/sig/helpers.rbs +0 -12
  574. data/sig/http/http_requester.rbs +0 -17
  575. data/sig/http/response.rbs +0 -14
  576. data/sig/interfaces/_connection.rbs +0 -16
  577. data/sig/iterators/base_iterator.rbs +0 -15
  578. data/sig/iterators/object_iterator.rbs +0 -6
  579. data/sig/iterators/paginator_iterator.rbs +0 -8
  580. data/sig/iterators/rule_iterator.rbs +0 -5
  581. data/sig/iterators/synonym_iterator.rbs +0 -5
  582. data/sig/transport/request_options.rbs +0 -33
  583. data/sig/transport/stateful_host.rbs +0 -21
  584. data/test/algolia/integration/account_client_test.rb +0 -47
  585. data/test/algolia/integration/analytics_client_test.rb +0 -117
  586. data/test/algolia/integration/base_test.rb +0 -9
  587. data/test/algolia/integration/insights_client_test.rb +0 -80
  588. data/test/algolia/integration/mocks/mock_requester.rb +0 -47
  589. data/test/algolia/integration/personalization_client_test.rb +0 -30
  590. data/test/algolia/integration/recommend_client_test.rb +0 -70
  591. data/test/algolia/integration/recommendation_client_test.rb +0 -30
  592. data/test/algolia/integration/search_client_test.rb +0 -465
  593. data/test/algolia/integration/search_index_test.rb +0 -729
  594. data/test/algolia/unit/algolia_config_test.rb +0 -16
  595. data/test/algolia/unit/helpers_test.rb +0 -92
  596. data/test/algolia/unit/http_requester_test.rb +0 -27
  597. data/test/algolia/unit/retry_strategy_test.rb +0 -139
  598. data/test/algolia/unit/user_agent_test.rb +0 -16
  599. data/test/test_helper.rb +0 -121
  600. data/upgrade_guide.md +0 -603
  601. /data/lib/algolia/{enums → transport}/call_type.rb +0 -0
  602. /data/lib/algolia/{enums → transport}/retry_outcome_type.rb +0 -0
@@ -0,0 +1,1158 @@
1
+ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2
+
3
+ require 'date'
4
+ require 'time'
5
+
6
+ module Algolia
7
+ module Search
8
+ class SearchForFacets
9
+ # Search parameters as a URL-encoded query string.
10
+ attr_accessor :params
11
+
12
+ # Text to search for in an index.
13
+ attr_accessor :query
14
+
15
+ # Overrides the query parameter and performs a more generic search.
16
+ attr_accessor :similar_query
17
+
18
+ # [Filter](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/) the query with numeric, facet, or tag filters.
19
+ attr_accessor :filters
20
+
21
+ attr_accessor :facet_filters
22
+
23
+ attr_accessor :optional_filters
24
+
25
+ attr_accessor :numeric_filters
26
+
27
+ attr_accessor :tag_filters
28
+
29
+ # Determines how to calculate [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). If `false`, maximum score is kept. If `true`, score is summed.
30
+ attr_accessor :sum_or_filters_scores
31
+
32
+ # Restricts a query to only look at a subset of your [searchable attributes](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/).
33
+ attr_accessor :restrict_searchable_attributes
34
+
35
+ # Returns [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts), their facet values, and the number of matching facet values.
36
+ attr_accessor :facets
37
+
38
+ # Forces faceting to be applied after [de-duplication](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/) (with the distinct feature). Alternatively, the `afterDistinct` [modifier](https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/#modifiers) of `attributesForFaceting` allows for more granular control.
39
+ attr_accessor :faceting_after_distinct
40
+
41
+ # Page to retrieve (the first page is `0`, not `1`).
42
+ attr_accessor :page
43
+
44
+ # Specifies the offset of the first hit to return. > **Note**: Using `page` and `hitsPerPage` is the recommended method for [paging results](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/). However, you can use `offset` and `length` to implement [an alternative approach to paging](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/#retrieving-a-subset-of-records-with-offset-and-length).
45
+ attr_accessor :offset
46
+
47
+ # Sets the number of hits to retrieve (for use with `offset`). > **Note**: Using `page` and `hitsPerPage` is the recommended method for [paging results](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/). However, you can use `offset` and `length` to implement [an alternative approach to paging](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/#retrieving-a-subset-of-records-with-offset-and-length).
48
+ attr_accessor :length
49
+
50
+ # Search for entries [around a central location](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filter-around-a-central-point), enabling a geographical search within a circular area.
51
+ attr_accessor :around_lat_lng
52
+
53
+ # Search for entries around a location. The location is automatically computed from the requester's IP address.
54
+ attr_accessor :around_lat_lng_via_ip
55
+
56
+ attr_accessor :around_radius
57
+
58
+ attr_accessor :around_precision
59
+
60
+ # Minimum radius (in meters) used for a geographical search when `aroundRadius` isn't set.
61
+ attr_accessor :minimum_around_radius
62
+
63
+ # Search inside a [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas) (in geographical coordinates).
64
+ attr_accessor :inside_bounding_box
65
+
66
+ # Search inside a [polygon](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas) (in geographical coordinates).
67
+ attr_accessor :inside_polygon
68
+
69
+ # Changes the default values of parameters that work best for a natural language query, such as `ignorePlurals`, `removeStopWords`, `removeWordsIfNoResults`, `analyticsTags`, and `ruleContexts`. These parameters work well together when the query consists of fuller natural language strings instead of keywords, for example when processing voice search queries.
70
+ attr_accessor :natural_languages
71
+
72
+ # Assigns [rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) to search queries.
73
+ attr_accessor :rule_contexts
74
+
75
+ # Defines how much [Personalization affects results](https://www.algolia.com/doc/guides/personalization/personalizing-results/in-depth/configuring-personalization/#understanding-personalization-impact).
76
+ attr_accessor :personalization_impact
77
+
78
+ # Associates a [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/) with the current search.
79
+ attr_accessor :user_token
80
+
81
+ # Incidates whether the search response includes [detailed ranking information](https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/understanding-the-api-response/#ranking-information).
82
+ attr_accessor :get_ranking_info
83
+
84
+ # Enriches the API's response with information about how the query was processed.
85
+ attr_accessor :explain
86
+
87
+ # Whether to take into account an index's synonyms for a particular search.
88
+ attr_accessor :synonyms
89
+
90
+ # Indicates whether a query ID parameter is included in the search response. This is required for [tracking click and conversion events](https://www.algolia.com/doc/guides/sending-events/concepts/event-types/#events-related-to-algolia-requests).
91
+ attr_accessor :click_analytics
92
+
93
+ # Indicates whether this query will be included in [analytics](https://www.algolia.com/doc/guides/search-analytics/guides/exclude-queries/).
94
+ attr_accessor :analytics
95
+
96
+ # Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
97
+ attr_accessor :analytics_tags
98
+
99
+ # Whether to include or exclude a query from the processing-time percentile computation.
100
+ attr_accessor :percentile_computation
101
+
102
+ # Incidates whether this search will be considered in A/B testing.
103
+ attr_accessor :enable_ab_test
104
+
105
+ # Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/) and the [modifiers](https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/#modifiers) that can be applied: `filterOnly`, `searchable`, and `afterDistinct`.
106
+ attr_accessor :attributes_for_faceting
107
+
108
+ # Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. By default, the response includes all attributes.
109
+ attr_accessor :attributes_to_retrieve
110
+
111
+ # Determines the order in which Algolia [returns your results](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/).
112
+ attr_accessor :ranking
113
+
114
+ # Specifies the [Custom ranking criterion](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Use the `asc` and `desc` modifiers to specify the ranking order: ascending or descending.
115
+ attr_accessor :custom_ranking
116
+
117
+ # Relevancy threshold below which less relevant results aren't included in the results.
118
+ attr_accessor :relevancy_strictness
119
+
120
+ # Attributes to highlight. Strings that match the search query in the attributes are highlighted by surrounding them with HTML tags (`highlightPreTag` and `highlightPostTag`).
121
+ attr_accessor :attributes_to_highlight
122
+
123
+ # Attributes to _snippet_. 'Snippeting' is shortening the attribute to a certain number of words. If not specified, the attribute is shortened to the 10 words around the matching string but you can specify the number. For example: `body:20`.
124
+ attr_accessor :attributes_to_snippet
125
+
126
+ # HTML string to insert before the highlighted parts in all highlight and snippet results.
127
+ attr_accessor :highlight_pre_tag
128
+
129
+ # HTML string to insert after the highlighted parts in all highlight and snippet results.
130
+ attr_accessor :highlight_post_tag
131
+
132
+ # String used as an ellipsis indicator when a snippet is truncated.
133
+ attr_accessor :snippet_ellipsis_text
134
+
135
+ # Restrict highlighting and snippeting to items that matched the query.
136
+ attr_accessor :restrict_highlight_and_snippet_arrays
137
+
138
+ # Number of hits per page.
139
+ attr_accessor :hits_per_page
140
+
141
+ # Minimum number of characters a word in the query string must contain to accept matches with [one typo](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos).
142
+ attr_accessor :min_word_sizefor1_typo
143
+
144
+ # Minimum number of characters a word in the query string must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos).
145
+ attr_accessor :min_word_sizefor2_typos
146
+
147
+ attr_accessor :typo_tolerance
148
+
149
+ # Whether to allow typos on numbers (\"numeric tokens\") in the query string.
150
+ attr_accessor :allow_typos_on_numeric_tokens
151
+
152
+ # Attributes for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/).
153
+ attr_accessor :disable_typo_tolerance_on_attributes
154
+
155
+ attr_accessor :ignore_plurals
156
+
157
+ attr_accessor :remove_stop_words
158
+
159
+ # Characters that the engine shouldn't automatically [normalize](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/).
160
+ attr_accessor :keep_diacritics_on_characters
161
+
162
+ # Sets your user's search language. This adjusts language-specific settings and features such as `ignorePlurals`, `removeStopWords`, and [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) word detection.
163
+ attr_accessor :query_languages
164
+
165
+ # [Splits compound words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words) into their component word parts in the query.
166
+ attr_accessor :decompound_query
167
+
168
+ # Incidates whether [Rules](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/) are enabled.
169
+ attr_accessor :enable_rules
170
+
171
+ # Incidates whether [Personalization](https://www.algolia.com/doc/guides/personalization/what-is-personalization/) is enabled.
172
+ attr_accessor :enable_personalization
173
+
174
+ attr_accessor :query_type
175
+
176
+ attr_accessor :remove_words_if_no_results
177
+
178
+ attr_accessor :mode
179
+
180
+ attr_accessor :semantic_search
181
+
182
+ # Enables the [advanced query syntax](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/#advanced-syntax).
183
+ attr_accessor :advanced_syntax
184
+
185
+ # Words which should be considered [optional](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words) when found in a query.
186
+ attr_accessor :optional_words
187
+
188
+ # Attributes for which you want to [turn off the exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes).
189
+ attr_accessor :disable_exact_on_attributes
190
+
191
+ attr_accessor :exact_on_single_word_query
192
+
193
+ # Alternatives that should be considered an exact match by [the exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes).
194
+ attr_accessor :alternatives_as_exact
195
+
196
+ # Allows you to specify which advanced syntax features are active when `advancedSyntax` is enabled.
197
+ attr_accessor :advanced_syntax_features
198
+
199
+ attr_accessor :distinct
200
+
201
+ # Whether to highlight and snippet the original word that matches the synonym or the synonym itself.
202
+ attr_accessor :replace_synonyms_in_highlight
203
+
204
+ # Precision of the [proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity).
205
+ attr_accessor :min_proximity
206
+
207
+ # Attributes to include in the API response for search and browse queries.
208
+ attr_accessor :response_fields
209
+
210
+ # Maximum number of facet hits to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
211
+ attr_accessor :max_facet_hits
212
+
213
+ # Maximum number of facet values to return for each facet.
214
+ attr_accessor :max_values_per_facet
215
+
216
+ # Controls how facet values are fetched.
217
+ attr_accessor :sort_facet_values_by
218
+
219
+ # When the [Attribute criterion is ranked above Proximity](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute-and-proximity-combinations) in your ranking formula, Proximity is used to select which searchable attribute is matched in the Attribute ranking stage.
220
+ attr_accessor :attribute_criteria_computed_by_min_proximity
221
+
222
+ attr_accessor :rendering_content
223
+
224
+ # Indicates whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/).
225
+ attr_accessor :enable_re_ranking
226
+
227
+ attr_accessor :re_ranking_apply_filter
228
+
229
+ # Facet name.
230
+ attr_accessor :facet
231
+
232
+ # Algolia index name.
233
+ attr_accessor :index_name
234
+
235
+ # Text to search inside the facet's values.
236
+ attr_accessor :facet_query
237
+
238
+ attr_accessor :type
239
+
240
+ class EnumAttributeValidator
241
+ attr_reader :datatype
242
+ attr_reader :allowable_values
243
+
244
+ def initialize(datatype, allowable_values)
245
+ @allowable_values = allowable_values.map do |value|
246
+ case datatype.to_s
247
+ when /Integer/i
248
+ value.to_i
249
+ when /Float/i
250
+ value.to_f
251
+ else
252
+ value
253
+ end
254
+ end
255
+ end
256
+
257
+ def valid?(value)
258
+ !value || allowable_values.include?(value)
259
+ end
260
+ end
261
+
262
+ # Attribute mapping from ruby-style variable name to JSON key.
263
+ def self.attribute_map
264
+ {
265
+ :params => :params,
266
+ :query => :query,
267
+ :similar_query => :similarQuery,
268
+ :filters => :filters,
269
+ :facet_filters => :facetFilters,
270
+ :optional_filters => :optionalFilters,
271
+ :numeric_filters => :numericFilters,
272
+ :tag_filters => :tagFilters,
273
+ :sum_or_filters_scores => :sumOrFiltersScores,
274
+ :restrict_searchable_attributes => :restrictSearchableAttributes,
275
+ :facets => :facets,
276
+ :faceting_after_distinct => :facetingAfterDistinct,
277
+ :page => :page,
278
+ :offset => :offset,
279
+ :length => :length,
280
+ :around_lat_lng => :aroundLatLng,
281
+ :around_lat_lng_via_ip => :aroundLatLngViaIP,
282
+ :around_radius => :aroundRadius,
283
+ :around_precision => :aroundPrecision,
284
+ :minimum_around_radius => :minimumAroundRadius,
285
+ :inside_bounding_box => :insideBoundingBox,
286
+ :inside_polygon => :insidePolygon,
287
+ :natural_languages => :naturalLanguages,
288
+ :rule_contexts => :ruleContexts,
289
+ :personalization_impact => :personalizationImpact,
290
+ :user_token => :userToken,
291
+ :get_ranking_info => :getRankingInfo,
292
+ :explain => :explain,
293
+ :synonyms => :synonyms,
294
+ :click_analytics => :clickAnalytics,
295
+ :analytics => :analytics,
296
+ :analytics_tags => :analyticsTags,
297
+ :percentile_computation => :percentileComputation,
298
+ :enable_ab_test => :enableABTest,
299
+ :attributes_for_faceting => :attributesForFaceting,
300
+ :attributes_to_retrieve => :attributesToRetrieve,
301
+ :ranking => :ranking,
302
+ :custom_ranking => :customRanking,
303
+ :relevancy_strictness => :relevancyStrictness,
304
+ :attributes_to_highlight => :attributesToHighlight,
305
+ :attributes_to_snippet => :attributesToSnippet,
306
+ :highlight_pre_tag => :highlightPreTag,
307
+ :highlight_post_tag => :highlightPostTag,
308
+ :snippet_ellipsis_text => :snippetEllipsisText,
309
+ :restrict_highlight_and_snippet_arrays => :restrictHighlightAndSnippetArrays,
310
+ :hits_per_page => :hitsPerPage,
311
+ :min_word_sizefor1_typo => :minWordSizefor1Typo,
312
+ :min_word_sizefor2_typos => :minWordSizefor2Typos,
313
+ :typo_tolerance => :typoTolerance,
314
+ :allow_typos_on_numeric_tokens => :allowTyposOnNumericTokens,
315
+ :disable_typo_tolerance_on_attributes => :disableTypoToleranceOnAttributes,
316
+ :ignore_plurals => :ignorePlurals,
317
+ :remove_stop_words => :removeStopWords,
318
+ :keep_diacritics_on_characters => :keepDiacriticsOnCharacters,
319
+ :query_languages => :queryLanguages,
320
+ :decompound_query => :decompoundQuery,
321
+ :enable_rules => :enableRules,
322
+ :enable_personalization => :enablePersonalization,
323
+ :query_type => :queryType,
324
+ :remove_words_if_no_results => :removeWordsIfNoResults,
325
+ :mode => :mode,
326
+ :semantic_search => :semanticSearch,
327
+ :advanced_syntax => :advancedSyntax,
328
+ :optional_words => :optionalWords,
329
+ :disable_exact_on_attributes => :disableExactOnAttributes,
330
+ :exact_on_single_word_query => :exactOnSingleWordQuery,
331
+ :alternatives_as_exact => :alternativesAsExact,
332
+ :advanced_syntax_features => :advancedSyntaxFeatures,
333
+ :distinct => :distinct,
334
+ :replace_synonyms_in_highlight => :replaceSynonymsInHighlight,
335
+ :min_proximity => :minProximity,
336
+ :response_fields => :responseFields,
337
+ :max_facet_hits => :maxFacetHits,
338
+ :max_values_per_facet => :maxValuesPerFacet,
339
+ :sort_facet_values_by => :sortFacetValuesBy,
340
+ :attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity,
341
+ :rendering_content => :renderingContent,
342
+ :enable_re_ranking => :enableReRanking,
343
+ :re_ranking_apply_filter => :reRankingApplyFilter,
344
+ :facet => :facet,
345
+ :index_name => :indexName,
346
+ :facet_query => :facetQuery,
347
+ :type => :type
348
+ }
349
+ end
350
+
351
+ # Returns all the JSON keys this model knows about
352
+ def self.acceptable_attributes
353
+ attribute_map.values
354
+ end
355
+
356
+ # Attribute type mapping.
357
+ def self.types_mapping
358
+ {
359
+ :params => :String,
360
+ :query => :String,
361
+ :similar_query => :String,
362
+ :filters => :String,
363
+ :facet_filters => :FacetFilters,
364
+ :optional_filters => :OptionalFilters,
365
+ :numeric_filters => :NumericFilters,
366
+ :tag_filters => :TagFilters,
367
+ :sum_or_filters_scores => :Boolean,
368
+ :restrict_searchable_attributes => :'Array<String>',
369
+ :facets => :'Array<String>',
370
+ :faceting_after_distinct => :Boolean,
371
+ :page => :Integer,
372
+ :offset => :Integer,
373
+ :length => :Integer,
374
+ :around_lat_lng => :String,
375
+ :around_lat_lng_via_ip => :Boolean,
376
+ :around_radius => :AroundRadius,
377
+ :around_precision => :AroundPrecision,
378
+ :minimum_around_radius => :Integer,
379
+ :inside_bounding_box => :'Array<Array<Float>>',
380
+ :inside_polygon => :'Array<Array<Float>>',
381
+ :natural_languages => :'Array<String>',
382
+ :rule_contexts => :'Array<String>',
383
+ :personalization_impact => :Integer,
384
+ :user_token => :String,
385
+ :get_ranking_info => :Boolean,
386
+ :explain => :'Array<String>',
387
+ :synonyms => :Boolean,
388
+ :click_analytics => :Boolean,
389
+ :analytics => :Boolean,
390
+ :analytics_tags => :'Array<String>',
391
+ :percentile_computation => :Boolean,
392
+ :enable_ab_test => :Boolean,
393
+ :attributes_for_faceting => :'Array<String>',
394
+ :attributes_to_retrieve => :'Array<String>',
395
+ :ranking => :'Array<String>',
396
+ :custom_ranking => :'Array<String>',
397
+ :relevancy_strictness => :Integer,
398
+ :attributes_to_highlight => :'Array<String>',
399
+ :attributes_to_snippet => :'Array<String>',
400
+ :highlight_pre_tag => :String,
401
+ :highlight_post_tag => :String,
402
+ :snippet_ellipsis_text => :String,
403
+ :restrict_highlight_and_snippet_arrays => :Boolean,
404
+ :hits_per_page => :Integer,
405
+ :min_word_sizefor1_typo => :Integer,
406
+ :min_word_sizefor2_typos => :Integer,
407
+ :typo_tolerance => :TypoTolerance,
408
+ :allow_typos_on_numeric_tokens => :Boolean,
409
+ :disable_typo_tolerance_on_attributes => :'Array<String>',
410
+ :ignore_plurals => :IgnorePlurals,
411
+ :remove_stop_words => :RemoveStopWords,
412
+ :keep_diacritics_on_characters => :String,
413
+ :query_languages => :'Array<String>',
414
+ :decompound_query => :Boolean,
415
+ :enable_rules => :Boolean,
416
+ :enable_personalization => :Boolean,
417
+ :query_type => :QueryType,
418
+ :remove_words_if_no_results => :RemoveWordsIfNoResults,
419
+ :mode => :Mode,
420
+ :semantic_search => :SemanticSearch,
421
+ :advanced_syntax => :Boolean,
422
+ :optional_words => :'Array<String>',
423
+ :disable_exact_on_attributes => :'Array<String>',
424
+ :exact_on_single_word_query => :ExactOnSingleWordQuery,
425
+ :alternatives_as_exact => :'Array<AlternativesAsExact>',
426
+ :advanced_syntax_features => :'Array<AdvancedSyntaxFeatures>',
427
+ :distinct => :Distinct,
428
+ :replace_synonyms_in_highlight => :Boolean,
429
+ :min_proximity => :Integer,
430
+ :response_fields => :'Array<String>',
431
+ :max_facet_hits => :Integer,
432
+ :max_values_per_facet => :Integer,
433
+ :sort_facet_values_by => :String,
434
+ :attribute_criteria_computed_by_min_proximity => :Boolean,
435
+ :rendering_content => :RenderingContent,
436
+ :enable_re_ranking => :Boolean,
437
+ :re_ranking_apply_filter => :ReRankingApplyFilter,
438
+ :facet => :String,
439
+ :index_name => :String,
440
+ :facet_query => :String,
441
+ :type => :SearchTypeFacet
442
+ }
443
+ end
444
+
445
+ # List of attributes with nullable: true
446
+ def self.openapi_nullable
447
+ Set.new([
448
+ :re_ranking_apply_filter
449
+ ])
450
+ end
451
+
452
+ # List of class defined in allOf (OpenAPI v3)
453
+ def self.openapi_all_of
454
+ [
455
+ :SearchForFacetsOptions,
456
+ :SearchParams
457
+ ]
458
+ end
459
+
460
+ # Initializes the object
461
+ # @param [Hash] attributes Model attributes in the form of hash
462
+ def initialize(attributes = {})
463
+ unless attributes.is_a?(Hash)
464
+ raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::SearchForFacets` initialize method"
465
+ end
466
+
467
+ # check to see if the attribute exists and convert string to symbol for hash key
468
+ attributes = attributes.each_with_object({}) do |(k, v), h|
469
+ unless self.class.attribute_map.key?(k.to_sym)
470
+ raise ArgumentError,
471
+ "`#{k}` is not a valid attribute in `Algolia::SearchForFacets`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
472
+ end
473
+
474
+ h[k.to_sym] = v
475
+ end
476
+
477
+ if attributes.key?(:params)
478
+ self.params = attributes[:params]
479
+ end
480
+
481
+ if attributes.key?(:query)
482
+ self.query = attributes[:query]
483
+ end
484
+
485
+ if attributes.key?(:similar_query)
486
+ self.similar_query = attributes[:similar_query]
487
+ end
488
+
489
+ if attributes.key?(:filters)
490
+ self.filters = attributes[:filters]
491
+ end
492
+
493
+ if attributes.key?(:facet_filters)
494
+ self.facet_filters = attributes[:facet_filters]
495
+ end
496
+
497
+ if attributes.key?(:optional_filters)
498
+ self.optional_filters = attributes[:optional_filters]
499
+ end
500
+
501
+ if attributes.key?(:numeric_filters)
502
+ self.numeric_filters = attributes[:numeric_filters]
503
+ end
504
+
505
+ if attributes.key?(:tag_filters)
506
+ self.tag_filters = attributes[:tag_filters]
507
+ end
508
+
509
+ if attributes.key?(:sum_or_filters_scores)
510
+ self.sum_or_filters_scores = attributes[:sum_or_filters_scores]
511
+ end
512
+
513
+ if attributes.key?(:restrict_searchable_attributes)
514
+ if (value = attributes[:restrict_searchable_attributes]).is_a?(Array)
515
+ self.restrict_searchable_attributes = value
516
+ end
517
+ end
518
+
519
+ if attributes.key?(:facets)
520
+ if (value = attributes[:facets]).is_a?(Array)
521
+ self.facets = value
522
+ end
523
+ end
524
+
525
+ if attributes.key?(:faceting_after_distinct)
526
+ self.faceting_after_distinct = attributes[:faceting_after_distinct]
527
+ end
528
+
529
+ if attributes.key?(:page)
530
+ self.page = attributes[:page]
531
+ end
532
+
533
+ if attributes.key?(:offset)
534
+ self.offset = attributes[:offset]
535
+ end
536
+
537
+ if attributes.key?(:length)
538
+ self.length = attributes[:length]
539
+ end
540
+
541
+ if attributes.key?(:around_lat_lng)
542
+ self.around_lat_lng = attributes[:around_lat_lng]
543
+ end
544
+
545
+ if attributes.key?(:around_lat_lng_via_ip)
546
+ self.around_lat_lng_via_ip = attributes[:around_lat_lng_via_ip]
547
+ end
548
+
549
+ if attributes.key?(:around_radius)
550
+ self.around_radius = attributes[:around_radius]
551
+ end
552
+
553
+ if attributes.key?(:around_precision)
554
+ self.around_precision = attributes[:around_precision]
555
+ end
556
+
557
+ if attributes.key?(:minimum_around_radius)
558
+ self.minimum_around_radius = attributes[:minimum_around_radius]
559
+ end
560
+
561
+ if attributes.key?(:inside_bounding_box)
562
+ if (value = attributes[:inside_bounding_box]).is_a?(Array)
563
+ self.inside_bounding_box = value
564
+ end
565
+ end
566
+
567
+ if attributes.key?(:inside_polygon)
568
+ if (value = attributes[:inside_polygon]).is_a?(Array)
569
+ self.inside_polygon = value
570
+ end
571
+ end
572
+
573
+ if attributes.key?(:natural_languages)
574
+ if (value = attributes[:natural_languages]).is_a?(Array)
575
+ self.natural_languages = value
576
+ end
577
+ end
578
+
579
+ if attributes.key?(:rule_contexts)
580
+ if (value = attributes[:rule_contexts]).is_a?(Array)
581
+ self.rule_contexts = value
582
+ end
583
+ end
584
+
585
+ if attributes.key?(:personalization_impact)
586
+ self.personalization_impact = attributes[:personalization_impact]
587
+ end
588
+
589
+ if attributes.key?(:user_token)
590
+ self.user_token = attributes[:user_token]
591
+ end
592
+
593
+ if attributes.key?(:get_ranking_info)
594
+ self.get_ranking_info = attributes[:get_ranking_info]
595
+ end
596
+
597
+ if attributes.key?(:explain)
598
+ if (value = attributes[:explain]).is_a?(Array)
599
+ self.explain = value
600
+ end
601
+ end
602
+
603
+ if attributes.key?(:synonyms)
604
+ self.synonyms = attributes[:synonyms]
605
+ end
606
+
607
+ if attributes.key?(:click_analytics)
608
+ self.click_analytics = attributes[:click_analytics]
609
+ end
610
+
611
+ if attributes.key?(:analytics)
612
+ self.analytics = attributes[:analytics]
613
+ end
614
+
615
+ if attributes.key?(:analytics_tags)
616
+ if (value = attributes[:analytics_tags]).is_a?(Array)
617
+ self.analytics_tags = value
618
+ end
619
+ end
620
+
621
+ if attributes.key?(:percentile_computation)
622
+ self.percentile_computation = attributes[:percentile_computation]
623
+ end
624
+
625
+ if attributes.key?(:enable_ab_test)
626
+ self.enable_ab_test = attributes[:enable_ab_test]
627
+ end
628
+
629
+ if attributes.key?(:attributes_for_faceting)
630
+ if (value = attributes[:attributes_for_faceting]).is_a?(Array)
631
+ self.attributes_for_faceting = value
632
+ end
633
+ end
634
+
635
+ if attributes.key?(:attributes_to_retrieve)
636
+ if (value = attributes[:attributes_to_retrieve]).is_a?(Array)
637
+ self.attributes_to_retrieve = value
638
+ end
639
+ end
640
+
641
+ if attributes.key?(:ranking)
642
+ if (value = attributes[:ranking]).is_a?(Array)
643
+ self.ranking = value
644
+ end
645
+ end
646
+
647
+ if attributes.key?(:custom_ranking)
648
+ if (value = attributes[:custom_ranking]).is_a?(Array)
649
+ self.custom_ranking = value
650
+ end
651
+ end
652
+
653
+ if attributes.key?(:relevancy_strictness)
654
+ self.relevancy_strictness = attributes[:relevancy_strictness]
655
+ end
656
+
657
+ if attributes.key?(:attributes_to_highlight)
658
+ if (value = attributes[:attributes_to_highlight]).is_a?(Array)
659
+ self.attributes_to_highlight = value
660
+ end
661
+ end
662
+
663
+ if attributes.key?(:attributes_to_snippet)
664
+ if (value = attributes[:attributes_to_snippet]).is_a?(Array)
665
+ self.attributes_to_snippet = value
666
+ end
667
+ end
668
+
669
+ if attributes.key?(:highlight_pre_tag)
670
+ self.highlight_pre_tag = attributes[:highlight_pre_tag]
671
+ end
672
+
673
+ if attributes.key?(:highlight_post_tag)
674
+ self.highlight_post_tag = attributes[:highlight_post_tag]
675
+ end
676
+
677
+ if attributes.key?(:snippet_ellipsis_text)
678
+ self.snippet_ellipsis_text = attributes[:snippet_ellipsis_text]
679
+ end
680
+
681
+ if attributes.key?(:restrict_highlight_and_snippet_arrays)
682
+ self.restrict_highlight_and_snippet_arrays = attributes[:restrict_highlight_and_snippet_arrays]
683
+ end
684
+
685
+ if attributes.key?(:hits_per_page)
686
+ self.hits_per_page = attributes[:hits_per_page]
687
+ end
688
+
689
+ if attributes.key?(:min_word_sizefor1_typo)
690
+ self.min_word_sizefor1_typo = attributes[:min_word_sizefor1_typo]
691
+ end
692
+
693
+ if attributes.key?(:min_word_sizefor2_typos)
694
+ self.min_word_sizefor2_typos = attributes[:min_word_sizefor2_typos]
695
+ end
696
+
697
+ if attributes.key?(:typo_tolerance)
698
+ self.typo_tolerance = attributes[:typo_tolerance]
699
+ end
700
+
701
+ if attributes.key?(:allow_typos_on_numeric_tokens)
702
+ self.allow_typos_on_numeric_tokens = attributes[:allow_typos_on_numeric_tokens]
703
+ end
704
+
705
+ if attributes.key?(:disable_typo_tolerance_on_attributes)
706
+ if (value = attributes[:disable_typo_tolerance_on_attributes]).is_a?(Array)
707
+ self.disable_typo_tolerance_on_attributes = value
708
+ end
709
+ end
710
+
711
+ if attributes.key?(:ignore_plurals)
712
+ self.ignore_plurals = attributes[:ignore_plurals]
713
+ end
714
+
715
+ if attributes.key?(:remove_stop_words)
716
+ self.remove_stop_words = attributes[:remove_stop_words]
717
+ end
718
+
719
+ if attributes.key?(:keep_diacritics_on_characters)
720
+ self.keep_diacritics_on_characters = attributes[:keep_diacritics_on_characters]
721
+ end
722
+
723
+ if attributes.key?(:query_languages)
724
+ if (value = attributes[:query_languages]).is_a?(Array)
725
+ self.query_languages = value
726
+ end
727
+ end
728
+
729
+ if attributes.key?(:decompound_query)
730
+ self.decompound_query = attributes[:decompound_query]
731
+ end
732
+
733
+ if attributes.key?(:enable_rules)
734
+ self.enable_rules = attributes[:enable_rules]
735
+ end
736
+
737
+ if attributes.key?(:enable_personalization)
738
+ self.enable_personalization = attributes[:enable_personalization]
739
+ end
740
+
741
+ if attributes.key?(:query_type)
742
+ self.query_type = attributes[:query_type]
743
+ end
744
+
745
+ if attributes.key?(:remove_words_if_no_results)
746
+ self.remove_words_if_no_results = attributes[:remove_words_if_no_results]
747
+ end
748
+
749
+ if attributes.key?(:mode)
750
+ self.mode = attributes[:mode]
751
+ end
752
+
753
+ if attributes.key?(:semantic_search)
754
+ self.semantic_search = attributes[:semantic_search]
755
+ end
756
+
757
+ if attributes.key?(:advanced_syntax)
758
+ self.advanced_syntax = attributes[:advanced_syntax]
759
+ end
760
+
761
+ if attributes.key?(:optional_words)
762
+ if (value = attributes[:optional_words]).is_a?(Array)
763
+ self.optional_words = value
764
+ end
765
+ end
766
+
767
+ if attributes.key?(:disable_exact_on_attributes)
768
+ if (value = attributes[:disable_exact_on_attributes]).is_a?(Array)
769
+ self.disable_exact_on_attributes = value
770
+ end
771
+ end
772
+
773
+ if attributes.key?(:exact_on_single_word_query)
774
+ self.exact_on_single_word_query = attributes[:exact_on_single_word_query]
775
+ end
776
+
777
+ if attributes.key?(:alternatives_as_exact)
778
+ if (value = attributes[:alternatives_as_exact]).is_a?(Array)
779
+ self.alternatives_as_exact = value
780
+ end
781
+ end
782
+
783
+ if attributes.key?(:advanced_syntax_features)
784
+ if (value = attributes[:advanced_syntax_features]).is_a?(Array)
785
+ self.advanced_syntax_features = value
786
+ end
787
+ end
788
+
789
+ if attributes.key?(:distinct)
790
+ self.distinct = attributes[:distinct]
791
+ end
792
+
793
+ if attributes.key?(:replace_synonyms_in_highlight)
794
+ self.replace_synonyms_in_highlight = attributes[:replace_synonyms_in_highlight]
795
+ end
796
+
797
+ if attributes.key?(:min_proximity)
798
+ self.min_proximity = attributes[:min_proximity]
799
+ end
800
+
801
+ if attributes.key?(:response_fields)
802
+ if (value = attributes[:response_fields]).is_a?(Array)
803
+ self.response_fields = value
804
+ end
805
+ end
806
+
807
+ if attributes.key?(:max_facet_hits)
808
+ self.max_facet_hits = attributes[:max_facet_hits]
809
+ end
810
+
811
+ if attributes.key?(:max_values_per_facet)
812
+ self.max_values_per_facet = attributes[:max_values_per_facet]
813
+ end
814
+
815
+ if attributes.key?(:sort_facet_values_by)
816
+ self.sort_facet_values_by = attributes[:sort_facet_values_by]
817
+ end
818
+
819
+ if attributes.key?(:attribute_criteria_computed_by_min_proximity)
820
+ self.attribute_criteria_computed_by_min_proximity = attributes[:attribute_criteria_computed_by_min_proximity]
821
+ end
822
+
823
+ if attributes.key?(:rendering_content)
824
+ self.rendering_content = attributes[:rendering_content]
825
+ end
826
+
827
+ if attributes.key?(:enable_re_ranking)
828
+ self.enable_re_ranking = attributes[:enable_re_ranking]
829
+ end
830
+
831
+ if attributes.key?(:re_ranking_apply_filter)
832
+ self.re_ranking_apply_filter = attributes[:re_ranking_apply_filter]
833
+ end
834
+
835
+ if attributes.key?(:facet)
836
+ self.facet = attributes[:facet]
837
+ else
838
+ self.facet = nil
839
+ end
840
+
841
+ if attributes.key?(:index_name)
842
+ self.index_name = attributes[:index_name]
843
+ else
844
+ self.index_name = nil
845
+ end
846
+
847
+ if attributes.key?(:facet_query)
848
+ self.facet_query = attributes[:facet_query]
849
+ end
850
+
851
+ if attributes.key?(:type)
852
+ self.type = attributes[:type]
853
+ else
854
+ self.type = nil
855
+ end
856
+ end
857
+
858
+ # Custom attribute writer method with validation
859
+ # @param [Object] length Value to be assigned
860
+ def length=(length)
861
+ if length.nil?
862
+ raise ArgumentError, 'length cannot be nil'
863
+ end
864
+
865
+ if length > 1000
866
+ raise ArgumentError, 'invalid value for "length", must be smaller than or equal to 1000.'
867
+ end
868
+
869
+ if length < 1
870
+ raise ArgumentError, 'invalid value for "length", must be greater than or equal to 1.'
871
+ end
872
+
873
+ @length = length
874
+ end
875
+
876
+ # Custom attribute writer method with validation
877
+ # @param [Object] minimum_around_radius Value to be assigned
878
+ def minimum_around_radius=(minimum_around_radius)
879
+ if minimum_around_radius.nil?
880
+ raise ArgumentError, 'minimum_around_radius cannot be nil'
881
+ end
882
+
883
+ if minimum_around_radius < 1
884
+ raise ArgumentError, 'invalid value for "minimum_around_radius", must be greater than or equal to 1.'
885
+ end
886
+
887
+ @minimum_around_radius = minimum_around_radius
888
+ end
889
+
890
+ # Custom attribute writer method with validation
891
+ # @param [Object] hits_per_page Value to be assigned
892
+ def hits_per_page=(hits_per_page)
893
+ if hits_per_page.nil?
894
+ raise ArgumentError, 'hits_per_page cannot be nil'
895
+ end
896
+
897
+ if hits_per_page > 1000
898
+ raise ArgumentError, 'invalid value for "hits_per_page", must be smaller than or equal to 1000.'
899
+ end
900
+
901
+ if hits_per_page < 1
902
+ raise ArgumentError, 'invalid value for "hits_per_page", must be greater than or equal to 1.'
903
+ end
904
+
905
+ @hits_per_page = hits_per_page
906
+ end
907
+
908
+ # Custom attribute writer method with validation
909
+ # @param [Object] min_proximity Value to be assigned
910
+ def min_proximity=(min_proximity)
911
+ if min_proximity.nil?
912
+ raise ArgumentError, 'min_proximity cannot be nil'
913
+ end
914
+
915
+ if min_proximity > 7
916
+ raise ArgumentError, 'invalid value for "min_proximity", must be smaller than or equal to 7.'
917
+ end
918
+
919
+ if min_proximity < 1
920
+ raise ArgumentError, 'invalid value for "min_proximity", must be greater than or equal to 1.'
921
+ end
922
+
923
+ @min_proximity = min_proximity
924
+ end
925
+
926
+ # Custom attribute writer method with validation
927
+ # @param [Object] max_facet_hits Value to be assigned
928
+ def max_facet_hits=(max_facet_hits)
929
+ if max_facet_hits.nil?
930
+ raise ArgumentError, 'max_facet_hits cannot be nil'
931
+ end
932
+
933
+ if max_facet_hits > 100
934
+ raise ArgumentError, 'invalid value for "max_facet_hits", must be smaller than or equal to 100.'
935
+ end
936
+
937
+ @max_facet_hits = max_facet_hits
938
+ end
939
+
940
+ # Checks equality by comparing each attribute.
941
+ # @param [Object] Object to be compared
942
+ def ==(other)
943
+ return true if equal?(other)
944
+
945
+ self.class == other.class &&
946
+ params == other.params &&
947
+ query == other.query &&
948
+ similar_query == other.similar_query &&
949
+ filters == other.filters &&
950
+ facet_filters == other.facet_filters &&
951
+ optional_filters == other.optional_filters &&
952
+ numeric_filters == other.numeric_filters &&
953
+ tag_filters == other.tag_filters &&
954
+ sum_or_filters_scores == other.sum_or_filters_scores &&
955
+ restrict_searchable_attributes == other.restrict_searchable_attributes &&
956
+ facets == other.facets &&
957
+ faceting_after_distinct == other.faceting_after_distinct &&
958
+ page == other.page &&
959
+ offset == other.offset &&
960
+ length == other.length &&
961
+ around_lat_lng == other.around_lat_lng &&
962
+ around_lat_lng_via_ip == other.around_lat_lng_via_ip &&
963
+ around_radius == other.around_radius &&
964
+ around_precision == other.around_precision &&
965
+ minimum_around_radius == other.minimum_around_radius &&
966
+ inside_bounding_box == other.inside_bounding_box &&
967
+ inside_polygon == other.inside_polygon &&
968
+ natural_languages == other.natural_languages &&
969
+ rule_contexts == other.rule_contexts &&
970
+ personalization_impact == other.personalization_impact &&
971
+ user_token == other.user_token &&
972
+ get_ranking_info == other.get_ranking_info &&
973
+ explain == other.explain &&
974
+ synonyms == other.synonyms &&
975
+ click_analytics == other.click_analytics &&
976
+ analytics == other.analytics &&
977
+ analytics_tags == other.analytics_tags &&
978
+ percentile_computation == other.percentile_computation &&
979
+ enable_ab_test == other.enable_ab_test &&
980
+ attributes_for_faceting == other.attributes_for_faceting &&
981
+ attributes_to_retrieve == other.attributes_to_retrieve &&
982
+ ranking == other.ranking &&
983
+ custom_ranking == other.custom_ranking &&
984
+ relevancy_strictness == other.relevancy_strictness &&
985
+ attributes_to_highlight == other.attributes_to_highlight &&
986
+ attributes_to_snippet == other.attributes_to_snippet &&
987
+ highlight_pre_tag == other.highlight_pre_tag &&
988
+ highlight_post_tag == other.highlight_post_tag &&
989
+ snippet_ellipsis_text == other.snippet_ellipsis_text &&
990
+ restrict_highlight_and_snippet_arrays == other.restrict_highlight_and_snippet_arrays &&
991
+ hits_per_page == other.hits_per_page &&
992
+ min_word_sizefor1_typo == other.min_word_sizefor1_typo &&
993
+ min_word_sizefor2_typos == other.min_word_sizefor2_typos &&
994
+ typo_tolerance == other.typo_tolerance &&
995
+ allow_typos_on_numeric_tokens == other.allow_typos_on_numeric_tokens &&
996
+ disable_typo_tolerance_on_attributes == other.disable_typo_tolerance_on_attributes &&
997
+ ignore_plurals == other.ignore_plurals &&
998
+ remove_stop_words == other.remove_stop_words &&
999
+ keep_diacritics_on_characters == other.keep_diacritics_on_characters &&
1000
+ query_languages == other.query_languages &&
1001
+ decompound_query == other.decompound_query &&
1002
+ enable_rules == other.enable_rules &&
1003
+ enable_personalization == other.enable_personalization &&
1004
+ query_type == other.query_type &&
1005
+ remove_words_if_no_results == other.remove_words_if_no_results &&
1006
+ mode == other.mode &&
1007
+ semantic_search == other.semantic_search &&
1008
+ advanced_syntax == other.advanced_syntax &&
1009
+ optional_words == other.optional_words &&
1010
+ disable_exact_on_attributes == other.disable_exact_on_attributes &&
1011
+ exact_on_single_word_query == other.exact_on_single_word_query &&
1012
+ alternatives_as_exact == other.alternatives_as_exact &&
1013
+ advanced_syntax_features == other.advanced_syntax_features &&
1014
+ distinct == other.distinct &&
1015
+ replace_synonyms_in_highlight == other.replace_synonyms_in_highlight &&
1016
+ min_proximity == other.min_proximity &&
1017
+ response_fields == other.response_fields &&
1018
+ max_facet_hits == other.max_facet_hits &&
1019
+ max_values_per_facet == other.max_values_per_facet &&
1020
+ sort_facet_values_by == other.sort_facet_values_by &&
1021
+ attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity &&
1022
+ rendering_content == other.rendering_content &&
1023
+ enable_re_ranking == other.enable_re_ranking &&
1024
+ re_ranking_apply_filter == other.re_ranking_apply_filter &&
1025
+ facet == other.facet &&
1026
+ index_name == other.index_name &&
1027
+ facet_query == other.facet_query &&
1028
+ type == other.type
1029
+ end
1030
+
1031
+ # @see the `==` method
1032
+ # @param [Object] Object to be compared
1033
+ def eql?(other)
1034
+ self == other
1035
+ end
1036
+
1037
+ # Calculates hash code according to all attributes.
1038
+ # @return [Integer] Hash code
1039
+ def hash
1040
+ [params, query, similar_query, filters, facet_filters, optional_filters, numeric_filters, tag_filters, sum_or_filters_scores, restrict_searchable_attributes, facets,
1041
+ faceting_after_distinct, page, offset, length, around_lat_lng, around_lat_lng_via_ip, around_radius, around_precision, minimum_around_radius, inside_bounding_box, inside_polygon, natural_languages, rule_contexts, personalization_impact, user_token, get_ranking_info, explain, synonyms, click_analytics, analytics, analytics_tags, percentile_computation, enable_ab_test, attributes_for_faceting, attributes_to_retrieve, ranking, custom_ranking, relevancy_strictness, attributes_to_highlight, attributes_to_snippet, highlight_pre_tag, highlight_post_tag, snippet_ellipsis_text, restrict_highlight_and_snippet_arrays, hits_per_page, min_word_sizefor1_typo, min_word_sizefor2_typos, typo_tolerance, allow_typos_on_numeric_tokens, disable_typo_tolerance_on_attributes, ignore_plurals, remove_stop_words, keep_diacritics_on_characters, query_languages, decompound_query, enable_rules, enable_personalization, query_type, remove_words_if_no_results, mode, semantic_search, advanced_syntax, optional_words, disable_exact_on_attributes, exact_on_single_word_query, alternatives_as_exact, advanced_syntax_features, distinct, replace_synonyms_in_highlight, min_proximity, response_fields, max_facet_hits, max_values_per_facet, sort_facet_values_by, attribute_criteria_computed_by_min_proximity, rendering_content, enable_re_ranking, re_ranking_apply_filter, facet, index_name, facet_query, type].hash
1042
+ end
1043
+
1044
+ # Builds the object from hash
1045
+ # @param [Hash] attributes Model attributes in the form of hash
1046
+ # @return [Object] Returns the model itself
1047
+ def self.build_from_hash(attributes)
1048
+ return nil unless attributes.is_a?(Hash)
1049
+
1050
+ attributes = attributes.transform_keys(&:to_sym)
1051
+ transformed_hash = {}
1052
+ types_mapping.each_pair do |key, type|
1053
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
1054
+ transformed_hash[key.to_s] = nil
1055
+ elsif type =~ /\AArray<(.*)>/i
1056
+ # check to ensure the input is an array given that the attribute
1057
+ # is documented as an array but the input is not
1058
+ if attributes[attribute_map[key]].is_a?(Array)
1059
+ transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
1060
+ end
1061
+ elsif !attributes[attribute_map[key]].nil?
1062
+ transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
1063
+ end
1064
+ end
1065
+ new(transformed_hash)
1066
+ end
1067
+
1068
+ # Deserializes the data based on type
1069
+ # @param string type Data type
1070
+ # @param string value Value to be deserialized
1071
+ # @return [Object] Deserialized data
1072
+ def self._deserialize(type, value)
1073
+ case type.to_sym
1074
+ when :Time
1075
+ Time.parse(value)
1076
+ when :Date
1077
+ Date.parse(value)
1078
+ when :String
1079
+ value.to_s
1080
+ when :Integer
1081
+ value.to_i
1082
+ when :Float
1083
+ value.to_f
1084
+ when :Boolean
1085
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
1086
+ true
1087
+ else
1088
+ false
1089
+ end
1090
+ when :Object
1091
+ # generic object (usually a Hash), return directly
1092
+ value
1093
+ when /\AArray<(?<inner_type>.+)>\z/
1094
+ inner_type = Regexp.last_match[:inner_type]
1095
+ value.map { |v| _deserialize(inner_type, v) }
1096
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
1097
+ k_type = Regexp.last_match[:k_type]
1098
+ v_type = Regexp.last_match[:v_type]
1099
+ {}.tap do |hash|
1100
+ value.each do |k, v|
1101
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
1102
+ end
1103
+ end
1104
+ else # model
1105
+ # models (e.g. Pet) or oneOf
1106
+ klass = Algolia::Search.const_get(type)
1107
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
1108
+ end
1109
+ end
1110
+
1111
+ # Returns the string representation of the object
1112
+ # @return [String] String presentation of the object
1113
+ def to_s
1114
+ to_hash.to_s
1115
+ end
1116
+
1117
+ # to_body is an alias to to_hash (backward compatibility)
1118
+ # @return [Hash] Returns the object in the form of hash
1119
+ def to_body
1120
+ to_hash
1121
+ end
1122
+
1123
+ # Returns the object in the form of hash
1124
+ # @return [Hash] Returns the object in the form of hash
1125
+ def to_hash
1126
+ hash = {}
1127
+ self.class.attribute_map.each_pair do |attr, param|
1128
+ value = send(attr)
1129
+ if value.nil?
1130
+ is_nullable = self.class.openapi_nullable.include?(attr)
1131
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
1132
+ end
1133
+
1134
+ hash[param] = _to_hash(value)
1135
+ end
1136
+ hash
1137
+ end
1138
+
1139
+ # Outputs non-array value in the form of hash
1140
+ # For object, use to_hash. Otherwise, just return the value
1141
+ # @param [Object] value Any valid value
1142
+ # @return [Hash] Returns the value in the form of hash
1143
+ def _to_hash(value)
1144
+ if value.is_a?(Array)
1145
+ value.compact.map { |v| _to_hash(v) }
1146
+ elsif value.is_a?(Hash)
1147
+ {}.tap do |hash|
1148
+ value.each { |k, v| hash[k] = _to_hash(v) }
1149
+ end
1150
+ elsif value.respond_to? :to_hash
1151
+ value.to_hash
1152
+ else
1153
+ value
1154
+ end
1155
+ end
1156
+ end
1157
+ end
1158
+ end