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,2723 @@
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
+ module Algolia
4
+ class SearchClient
5
+ attr_accessor :api_client
6
+
7
+ def initialize(config = nil)
8
+ raise '`config` is missing.' if config.nil?
9
+ raise '`app_id` is missing.' if config.app_id.nil? || config.app_id == ''
10
+ raise '`api_key` is missing.' if config.api_key.nil? || config.api_key == ''
11
+
12
+ @api_client = Algolia::ApiClient.new(config)
13
+ end
14
+
15
+ def self.create(app_id, api_key, opts = {})
16
+ hosts = []
17
+
18
+ hosts << Transport::StatefulHost.new("#{app_id}-dsn.algolia.net", accept: CallType::READ)
19
+ hosts << Transport::StatefulHost.new("#{app_id}.algolia.net", accept: CallType::WRITE)
20
+
21
+ hosts += 1.upto(3).map do |i|
22
+ Transport::StatefulHost.new("#{app_id}-#{i}.algolianet.com", accept: CallType::READ | CallType::WRITE)
23
+ end.shuffle
24
+
25
+ config = Algolia::Configuration.new(app_id, api_key, hosts, 'Search', opts)
26
+ create_with_config(config)
27
+ end
28
+
29
+ def self.create_with_config(config)
30
+ new(config)
31
+ end
32
+
33
+ # Add API key.
34
+ # Add a new API key with specific permissions and restrictions. The request must be authenticated with the admin API key. The response returns an API key string.
35
+ # @param api_key [ApiKey] (required)
36
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
37
+ # @return [Http::Response] the response
38
+ def add_api_key_with_http_info(api_key, request_options = {})
39
+ # verify the required parameter 'api_key' is set
40
+ if @api_client.config.client_side_validation && api_key.nil?
41
+ raise ArgumentError, "Parameter `api_key` is required when calling `add_api_key`."
42
+ end
43
+
44
+ path = '/1/keys'
45
+ query_params = {}
46
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
47
+ header_params = {}
48
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
49
+
50
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(api_key)
51
+
52
+ new_options = request_options.merge(
53
+ :operation => :'SearchClient.add_api_key',
54
+ :header_params => header_params,
55
+ :query_params => query_params,
56
+ :body => post_body,
57
+ :use_read_transporter => false
58
+ )
59
+
60
+ @api_client.call_api(:POST, path, new_options)
61
+ end
62
+
63
+ # Add API key.
64
+ # Add a new API key with specific permissions and restrictions. The request must be authenticated with the admin API key. The response returns an API key string.
65
+ # @param api_key [ApiKey] (required)
66
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
67
+ # @return [AddApiKeyResponse]
68
+ def add_api_key(api_key, request_options = {})
69
+ response = add_api_key_with_http_info(api_key, request_options)
70
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::AddApiKeyResponse')
71
+ end
72
+
73
+ # Add or update a record (using objectID).
74
+ # If you use an existing &#x60;objectID&#x60;, the existing record will be replaced with the new one. To update only some attributes of an existing record, use the [&#x60;partial&#x60; operation](#tag/Records/operation/partialUpdateObject) instead. To add multiple records to your index in a single API request, use the [&#x60;batch&#x60; operation](#tag/Records/operation/batch).
75
+ # @param index_name [String] Index on which to perform the request. (required)
76
+ # @param object_id [String] Unique record (object) identifier. (required)
77
+ # @param body [Object] Algolia record. (required)
78
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
79
+ # @return [Http::Response] the response
80
+ def add_or_update_object_with_http_info(index_name, object_id, body, request_options = {})
81
+ # verify the required parameter 'index_name' is set
82
+ if @api_client.config.client_side_validation && index_name.nil?
83
+ raise ArgumentError, "Parameter `index_name` is required when calling `add_or_update_object`."
84
+ end
85
+ # verify the required parameter 'object_id' is set
86
+ if @api_client.config.client_side_validation && object_id.nil?
87
+ raise ArgumentError, "Parameter `object_id` is required when calling `add_or_update_object`."
88
+ end
89
+ # verify the required parameter 'body' is set
90
+ if @api_client.config.client_side_validation && body.nil?
91
+ raise ArgumentError, "Parameter `body` is required when calling `add_or_update_object`."
92
+ end
93
+
94
+ path = '/1/indexes/{indexName}/{objectID}'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
95
+ @api_client.encode_uri(object_id.to_s))
96
+ query_params = {}
97
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
98
+ header_params = {}
99
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
100
+
101
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)
102
+
103
+ new_options = request_options.merge(
104
+ :operation => :'SearchClient.add_or_update_object',
105
+ :header_params => header_params,
106
+ :query_params => query_params,
107
+ :body => post_body,
108
+ :use_read_transporter => false
109
+ )
110
+
111
+ @api_client.call_api(:PUT, path, new_options)
112
+ end
113
+
114
+ # Add or update a record (using objectID).
115
+ # If you use an existing `objectID`, the existing record will be replaced with the new one. To update only some attributes of an existing record, use the [`partial` operation](#tag/Records/operation/partialUpdateObject) instead. To add multiple records to your index in a single API request, use the [`batch` operation](#tag/Records/operation/batch).
116
+ # @param index_name [String] Index on which to perform the request. (required)
117
+ # @param object_id [String] Unique record (object) identifier. (required)
118
+ # @param body [Object] Algolia record. (required)
119
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
120
+ # @return [UpdatedAtWithObjectIdResponse]
121
+ def add_or_update_object(index_name, object_id, body, request_options = {})
122
+ response = add_or_update_object_with_http_info(index_name, object_id, body, request_options)
123
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtWithObjectIdResponse')
124
+ end
125
+
126
+ # Add a source.
127
+ # Add a source to the list of allowed sources.
128
+ # @param source [Source] Source to add. (required)
129
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
130
+ # @return [Http::Response] the response
131
+ def append_source_with_http_info(source, request_options = {})
132
+ # verify the required parameter 'source' is set
133
+ if @api_client.config.client_side_validation && source.nil?
134
+ raise ArgumentError, "Parameter `source` is required when calling `append_source`."
135
+ end
136
+
137
+ path = '/1/security/sources/append'
138
+ query_params = {}
139
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
140
+ header_params = {}
141
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
142
+
143
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(source)
144
+
145
+ new_options = request_options.merge(
146
+ :operation => :'SearchClient.append_source',
147
+ :header_params => header_params,
148
+ :query_params => query_params,
149
+ :body => post_body,
150
+ :use_read_transporter => false
151
+ )
152
+
153
+ @api_client.call_api(:POST, path, new_options)
154
+ end
155
+
156
+ # Add a source.
157
+ # Add a source to the list of allowed sources.
158
+ # @param source [Source] Source to add. (required)
159
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
160
+ # @return [CreatedAtResponse]
161
+ def append_source(source, request_options = {})
162
+ response = append_source_with_http_info(source, request_options)
163
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::CreatedAtResponse')
164
+ end
165
+
166
+ # Assign or move a user ID.
167
+ # Assign or move a user ID to a cluster. The time it takes to move a user is proportional to the amount of data linked to the user ID.
168
+ # @param x_algolia_user_id [String] userID to assign. (required)
169
+ # @param assign_user_id_params [AssignUserIdParams] (required)
170
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
171
+ # @return [Http::Response] the response
172
+ def assign_user_id_with_http_info(x_algolia_user_id, assign_user_id_params, request_options = {})
173
+ # verify the required parameter 'x_algolia_user_id' is set
174
+ if @api_client.config.client_side_validation && x_algolia_user_id.nil?
175
+ raise ArgumentError, "Parameter `x_algolia_user_id` is required when calling `assign_user_id`."
176
+ end
177
+
178
+ pattern = /^[a-zA-Z0-9 \-*.]+$/
179
+ if @api_client.config.client_side_validation && x_algolia_user_id !~ pattern
180
+ raise ArgumentError, "invalid value for 'x_algolia_user_id' when calling SearchClient.assign_user_id, must conform to the pattern #{pattern}."
181
+ end
182
+
183
+ # verify the required parameter 'assign_user_id_params' is set
184
+ if @api_client.config.client_side_validation && assign_user_id_params.nil?
185
+ raise ArgumentError, "Parameter `assign_user_id_params` is required when calling `assign_user_id`."
186
+ end
187
+
188
+ path = '/1/clusters/mapping'
189
+ query_params = {}
190
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
191
+ header_params = {}
192
+ header_params[:'X-Algolia-User-ID'] = x_algolia_user_id
193
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
194
+
195
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(assign_user_id_params)
196
+
197
+ new_options = request_options.merge(
198
+ :operation => :'SearchClient.assign_user_id',
199
+ :header_params => header_params,
200
+ :query_params => query_params,
201
+ :body => post_body,
202
+ :use_read_transporter => false
203
+ )
204
+
205
+ @api_client.call_api(:POST, path, new_options)
206
+ end
207
+
208
+ # Assign or move a user ID.
209
+ # Assign or move a user ID to a cluster. The time it takes to move a user is proportional to the amount of data linked to the user ID.
210
+ # @param x_algolia_user_id [String] userID to assign. (required)
211
+ # @param assign_user_id_params [AssignUserIdParams] (required)
212
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
213
+ # @return [CreatedAtResponse]
214
+ def assign_user_id(x_algolia_user_id, assign_user_id_params, request_options = {})
215
+ response = assign_user_id_with_http_info(x_algolia_user_id, assign_user_id_params, request_options)
216
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::CreatedAtResponse')
217
+ end
218
+
219
+ # Batch write operations on one index.
220
+ # To reduce the time spent on network round trips, you can perform several write actions in a single API call. Actions are applied in the order they are specified. The supported &#x60;action&#x60;s are equivalent to the individual operations of the same name.
221
+ # @param index_name [String] Index on which to perform the request. (required)
222
+ # @param batch_write_params [BatchWriteParams] (required)
223
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
224
+ # @return [Http::Response] the response
225
+ def batch_with_http_info(index_name, batch_write_params, request_options = {})
226
+ # verify the required parameter 'index_name' is set
227
+ if @api_client.config.client_side_validation && index_name.nil?
228
+ raise ArgumentError, "Parameter `index_name` is required when calling `batch`."
229
+ end
230
+ # verify the required parameter 'batch_write_params' is set
231
+ if @api_client.config.client_side_validation && batch_write_params.nil?
232
+ raise ArgumentError, "Parameter `batch_write_params` is required when calling `batch`."
233
+ end
234
+
235
+ path = '/1/indexes/{indexName}/batch'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
236
+ query_params = {}
237
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
238
+ header_params = {}
239
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
240
+
241
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(batch_write_params)
242
+
243
+ new_options = request_options.merge(
244
+ :operation => :'SearchClient.batch',
245
+ :header_params => header_params,
246
+ :query_params => query_params,
247
+ :body => post_body,
248
+ :use_read_transporter => false
249
+ )
250
+
251
+ @api_client.call_api(:POST, path, new_options)
252
+ end
253
+
254
+ # Batch write operations on one index.
255
+ # To reduce the time spent on network round trips, you can perform several write actions in a single API call. Actions are applied in the order they are specified. The supported `action`s are equivalent to the individual operations of the same name.
256
+ # @param index_name [String] Index on which to perform the request. (required)
257
+ # @param batch_write_params [BatchWriteParams] (required)
258
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
259
+ # @return [BatchResponse]
260
+ def batch(index_name, batch_write_params, request_options = {})
261
+ response = batch_with_http_info(index_name, batch_write_params, request_options)
262
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::BatchResponse')
263
+ end
264
+
265
+ # Batch assign userIDs.
266
+ # Assign multiple user IDs to a cluster. **You can&#39;t _move_ users with this operation.**.
267
+ # @param x_algolia_user_id [String] userID to assign. (required)
268
+ # @param batch_assign_user_ids_params [BatchAssignUserIdsParams] (required)
269
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
270
+ # @return [Http::Response] the response
271
+ def batch_assign_user_ids_with_http_info(x_algolia_user_id, batch_assign_user_ids_params, request_options = {})
272
+ # verify the required parameter 'x_algolia_user_id' is set
273
+ if @api_client.config.client_side_validation && x_algolia_user_id.nil?
274
+ raise ArgumentError, "Parameter `x_algolia_user_id` is required when calling `batch_assign_user_ids`."
275
+ end
276
+
277
+ pattern = /^[a-zA-Z0-9 \-*.]+$/
278
+ if @api_client.config.client_side_validation && x_algolia_user_id !~ pattern
279
+ raise ArgumentError, "invalid value for 'x_algolia_user_id' when calling SearchClient.batch_assign_user_ids, must conform to the pattern #{pattern}."
280
+ end
281
+
282
+ # verify the required parameter 'batch_assign_user_ids_params' is set
283
+ if @api_client.config.client_side_validation && batch_assign_user_ids_params.nil?
284
+ raise ArgumentError, "Parameter `batch_assign_user_ids_params` is required when calling `batch_assign_user_ids`."
285
+ end
286
+
287
+ path = '/1/clusters/mapping/batch'
288
+ query_params = {}
289
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
290
+ header_params = {}
291
+ header_params[:'X-Algolia-User-ID'] = x_algolia_user_id
292
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
293
+
294
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(batch_assign_user_ids_params)
295
+
296
+ new_options = request_options.merge(
297
+ :operation => :'SearchClient.batch_assign_user_ids',
298
+ :header_params => header_params,
299
+ :query_params => query_params,
300
+ :body => post_body,
301
+ :use_read_transporter => false
302
+ )
303
+
304
+ @api_client.call_api(:POST, path, new_options)
305
+ end
306
+
307
+ # Batch assign userIDs.
308
+ # Assign multiple user IDs to a cluster. **You can't _move_ users with this operation.**.
309
+ # @param x_algolia_user_id [String] userID to assign. (required)
310
+ # @param batch_assign_user_ids_params [BatchAssignUserIdsParams] (required)
311
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
312
+ # @return [CreatedAtResponse]
313
+ def batch_assign_user_ids(x_algolia_user_id, batch_assign_user_ids_params, request_options = {})
314
+ response = batch_assign_user_ids_with_http_info(x_algolia_user_id, batch_assign_user_ids_params, request_options)
315
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::CreatedAtResponse')
316
+ end
317
+
318
+ # Batch dictionary entries.
319
+ # Add or remove a batch of dictionary entries.
320
+ # @param dictionary_name [DictionaryType] Dictionary to search in. (required)
321
+ # @param batch_dictionary_entries_params [BatchDictionaryEntriesParams] (required)
322
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
323
+ # @return [Http::Response] the response
324
+ def batch_dictionary_entries_with_http_info(dictionary_name, batch_dictionary_entries_params, request_options = {})
325
+ # verify the required parameter 'dictionary_name' is set
326
+ if @api_client.config.client_side_validation && dictionary_name.nil?
327
+ raise ArgumentError, "Parameter `dictionary_name` is required when calling `batch_dictionary_entries`."
328
+ end
329
+ # verify the required parameter 'batch_dictionary_entries_params' is set
330
+ if @api_client.config.client_side_validation && batch_dictionary_entries_params.nil?
331
+ raise ArgumentError, "Parameter `batch_dictionary_entries_params` is required when calling `batch_dictionary_entries`."
332
+ end
333
+
334
+ path = '/1/dictionaries/{dictionaryName}/batch'.sub('{' + 'dictionaryName' + '}', @api_client.encode_uri(dictionary_name.to_s))
335
+ query_params = {}
336
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
337
+ header_params = {}
338
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
339
+
340
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(batch_dictionary_entries_params)
341
+
342
+ new_options = request_options.merge(
343
+ :operation => :'SearchClient.batch_dictionary_entries',
344
+ :header_params => header_params,
345
+ :query_params => query_params,
346
+ :body => post_body,
347
+ :use_read_transporter => false
348
+ )
349
+
350
+ @api_client.call_api(:POST, path, new_options)
351
+ end
352
+
353
+ # Batch dictionary entries.
354
+ # Add or remove a batch of dictionary entries.
355
+ # @param dictionary_name [DictionaryType] Dictionary to search in. (required)
356
+ # @param batch_dictionary_entries_params [BatchDictionaryEntriesParams] (required)
357
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
358
+ # @return [UpdatedAtResponse]
359
+ def batch_dictionary_entries(dictionary_name, batch_dictionary_entries_params, request_options = {})
360
+ response = batch_dictionary_entries_with_http_info(dictionary_name, batch_dictionary_entries_params, request_options)
361
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
362
+ end
363
+
364
+ # Get all records from an index.
365
+ # Retrieve up to 1,000 records per call. Supports full-text search and filters. For better performance, it doesn&#39;t support: - The &#x60;distinct&#x60; query parameter - Sorting by typos, proximity, words, or geographical distance.
366
+ # @param index_name [String] Index on which to perform the request. (required)
367
+ # @param browse_params [BrowseParams]
368
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
369
+ # @return [Http::Response] the response
370
+ def browse_with_http_info(index_name, browse_params = nil, request_options = {})
371
+ # verify the required parameter 'index_name' is set
372
+ if @api_client.config.client_side_validation && index_name.nil?
373
+ raise ArgumentError, "Parameter `index_name` is required when calling `browse`."
374
+ end
375
+
376
+ path = '/1/indexes/{indexName}/browse'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
377
+ query_params = {}
378
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
379
+ header_params = {}
380
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
381
+
382
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(browse_params)
383
+
384
+ new_options = request_options.merge(
385
+ :operation => :'SearchClient.browse',
386
+ :header_params => header_params,
387
+ :query_params => query_params,
388
+ :body => post_body,
389
+ :use_read_transporter => false
390
+ )
391
+
392
+ @api_client.call_api(:POST, path, new_options)
393
+ end
394
+
395
+ # Get all records from an index.
396
+ # Retrieve up to 1,000 records per call. Supports full-text search and filters. For better performance, it doesn't support: - The `distinct` query parameter - Sorting by typos, proximity, words, or geographical distance.
397
+ # @param index_name [String] Index on which to perform the request. (required)
398
+ # @param browse_params [BrowseParams]
399
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
400
+ # @return [BrowseResponse]
401
+ def browse(index_name, browse_params = nil, request_options = {})
402
+ response = browse_with_http_info(index_name, browse_params, request_options)
403
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::BrowseResponse')
404
+ end
405
+
406
+ # Delete all synonyms.
407
+ # Delete all synonyms in the index.
408
+ # @param index_name [String] Index on which to perform the request. (required)
409
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
410
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
411
+ # @return [Http::Response] the response
412
+ def clear_all_synonyms_with_http_info(index_name, forward_to_replicas = nil, request_options = {})
413
+ # verify the required parameter 'index_name' is set
414
+ if @api_client.config.client_side_validation && index_name.nil?
415
+ raise ArgumentError, "Parameter `index_name` is required when calling `clear_all_synonyms`."
416
+ end
417
+
418
+ path = '/1/indexes/{indexName}/synonyms/clear'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
419
+ query_params = {}
420
+ query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
421
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
422
+ header_params = {}
423
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
424
+
425
+ post_body = request_options[:debug_body]
426
+
427
+ new_options = request_options.merge(
428
+ :operation => :'SearchClient.clear_all_synonyms',
429
+ :header_params => header_params,
430
+ :query_params => query_params,
431
+ :body => post_body,
432
+ :use_read_transporter => false
433
+ )
434
+
435
+ @api_client.call_api(:POST, path, new_options)
436
+ end
437
+
438
+ # Delete all synonyms.
439
+ # Delete all synonyms in the index.
440
+ # @param index_name [String] Index on which to perform the request. (required)
441
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
442
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
443
+ # @return [UpdatedAtResponse]
444
+ def clear_all_synonyms(index_name, forward_to_replicas = nil, request_options = {})
445
+ response = clear_all_synonyms_with_http_info(index_name, forward_to_replicas, request_options)
446
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
447
+ end
448
+
449
+ # Delete all records from an index.
450
+ # Delete the records but leave settings and index-specific API keys untouched.
451
+ # @param index_name [String] Index on which to perform the request. (required)
452
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
453
+ # @return [Http::Response] the response
454
+ def clear_objects_with_http_info(index_name, request_options = {})
455
+ # verify the required parameter 'index_name' is set
456
+ if @api_client.config.client_side_validation && index_name.nil?
457
+ raise ArgumentError, "Parameter `index_name` is required when calling `clear_objects`."
458
+ end
459
+
460
+ path = '/1/indexes/{indexName}/clear'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
461
+ query_params = {}
462
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
463
+ header_params = {}
464
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
465
+
466
+ post_body = request_options[:debug_body]
467
+
468
+ new_options = request_options.merge(
469
+ :operation => :'SearchClient.clear_objects',
470
+ :header_params => header_params,
471
+ :query_params => query_params,
472
+ :body => post_body,
473
+ :use_read_transporter => false
474
+ )
475
+
476
+ @api_client.call_api(:POST, path, new_options)
477
+ end
478
+
479
+ # Delete all records from an index.
480
+ # Delete the records but leave settings and index-specific API keys untouched.
481
+ # @param index_name [String] Index on which to perform the request. (required)
482
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
483
+ # @return [UpdatedAtResponse]
484
+ def clear_objects(index_name, request_options = {})
485
+ response = clear_objects_with_http_info(index_name, request_options)
486
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
487
+ end
488
+
489
+ # Delete all rules.
490
+ # Delete all rules in the index.
491
+ # @param index_name [String] Index on which to perform the request. (required)
492
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
493
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
494
+ # @return [Http::Response] the response
495
+ def clear_rules_with_http_info(index_name, forward_to_replicas = nil, request_options = {})
496
+ # verify the required parameter 'index_name' is set
497
+ if @api_client.config.client_side_validation && index_name.nil?
498
+ raise ArgumentError, "Parameter `index_name` is required when calling `clear_rules`."
499
+ end
500
+
501
+ path = '/1/indexes/{indexName}/rules/clear'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
502
+ query_params = {}
503
+ query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
504
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
505
+ header_params = {}
506
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
507
+
508
+ post_body = request_options[:debug_body]
509
+
510
+ new_options = request_options.merge(
511
+ :operation => :'SearchClient.clear_rules',
512
+ :header_params => header_params,
513
+ :query_params => query_params,
514
+ :body => post_body,
515
+ :use_read_transporter => false
516
+ )
517
+
518
+ @api_client.call_api(:POST, path, new_options)
519
+ end
520
+
521
+ # Delete all rules.
522
+ # Delete all rules in the index.
523
+ # @param index_name [String] Index on which to perform the request. (required)
524
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
525
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
526
+ # @return [UpdatedAtResponse]
527
+ def clear_rules(index_name, forward_to_replicas = nil, request_options = {})
528
+ response = clear_rules_with_http_info(index_name, forward_to_replicas, request_options)
529
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
530
+ end
531
+
532
+ # Send requests to the Algolia REST API.
533
+ # This method allow you to send requests to the Algolia REST API.
534
+ # @param path [String] Path of the endpoint, anything after \&quot;/1\&quot; must be specified. (required)
535
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
536
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
537
+ # @return [Http::Response] the response
538
+ def custom_delete_with_http_info(path, parameters = nil, request_options = {})
539
+ # verify the required parameter 'path' is set
540
+ if @api_client.config.client_side_validation && path.nil?
541
+ raise ArgumentError, "Parameter `path` is required when calling `custom_delete`."
542
+ end
543
+
544
+ path = '/1{path}'.sub('{' + 'path' + '}', path.to_s)
545
+ query_params = {}
546
+ query_params = query_params.merge(parameters) unless parameters.nil?
547
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
548
+ header_params = {}
549
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
550
+
551
+ post_body = request_options[:debug_body]
552
+
553
+ new_options = request_options.merge(
554
+ :operation => :'SearchClient.custom_delete',
555
+ :header_params => header_params,
556
+ :query_params => query_params,
557
+ :body => post_body,
558
+ :use_read_transporter => false
559
+ )
560
+
561
+ @api_client.call_api(:DELETE, path, new_options)
562
+ end
563
+
564
+ # Send requests to the Algolia REST API.
565
+ # This method allow you to send requests to the Algolia REST API.
566
+ # @param path [String] Path of the endpoint, anything after \&quot;/1\&quot; must be specified. (required)
567
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
568
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
569
+ # @return [Object]
570
+ def custom_delete(path, parameters = nil, request_options = {})
571
+ response = custom_delete_with_http_info(path, parameters, request_options)
572
+ deserialize(response.body, request_options[:debug_return_type] || 'Object')
573
+ end
574
+
575
+ # Send requests to the Algolia REST API.
576
+ # This method allow you to send requests to the Algolia REST API.
577
+ # @param path [String] Path of the endpoint, anything after \&quot;/1\&quot; must be specified. (required)
578
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
579
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
580
+ # @return [Http::Response] the response
581
+ def custom_get_with_http_info(path, parameters = nil, request_options = {})
582
+ # verify the required parameter 'path' is set
583
+ if @api_client.config.client_side_validation && path.nil?
584
+ raise ArgumentError, "Parameter `path` is required when calling `custom_get`."
585
+ end
586
+
587
+ path = '/1{path}'.sub('{' + 'path' + '}', path.to_s)
588
+ query_params = {}
589
+ query_params = query_params.merge(parameters) unless parameters.nil?
590
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
591
+ header_params = {}
592
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
593
+
594
+ post_body = request_options[:debug_body]
595
+
596
+ new_options = request_options.merge(
597
+ :operation => :'SearchClient.custom_get',
598
+ :header_params => header_params,
599
+ :query_params => query_params,
600
+ :body => post_body,
601
+ :use_read_transporter => false
602
+ )
603
+
604
+ @api_client.call_api(:GET, path, new_options)
605
+ end
606
+
607
+ # Send requests to the Algolia REST API.
608
+ # This method allow you to send requests to the Algolia REST API.
609
+ # @param path [String] Path of the endpoint, anything after \&quot;/1\&quot; must be specified. (required)
610
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
611
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
612
+ # @return [Object]
613
+ def custom_get(path, parameters = nil, request_options = {})
614
+ response = custom_get_with_http_info(path, parameters, request_options)
615
+ deserialize(response.body, request_options[:debug_return_type] || 'Object')
616
+ end
617
+
618
+ # Send requests to the Algolia REST API.
619
+ # This method allow you to send requests to the Algolia REST API.
620
+ # @param path [String] Path of the endpoint, anything after \&quot;/1\&quot; must be specified. (required)
621
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
622
+ # @param body [Object] Parameters to send with the custom request.
623
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
624
+ # @return [Http::Response] the response
625
+ def custom_post_with_http_info(path, parameters = nil, body = nil, request_options = {})
626
+ # verify the required parameter 'path' is set
627
+ if @api_client.config.client_side_validation && path.nil?
628
+ raise ArgumentError, "Parameter `path` is required when calling `custom_post`."
629
+ end
630
+
631
+ path = '/1{path}'.sub('{' + 'path' + '}', path.to_s)
632
+ query_params = {}
633
+ query_params = query_params.merge(parameters) unless parameters.nil?
634
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
635
+ header_params = {}
636
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
637
+
638
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)
639
+
640
+ new_options = request_options.merge(
641
+ :operation => :'SearchClient.custom_post',
642
+ :header_params => header_params,
643
+ :query_params => query_params,
644
+ :body => post_body,
645
+ :use_read_transporter => false
646
+ )
647
+
648
+ @api_client.call_api(:POST, path, new_options)
649
+ end
650
+
651
+ # Send requests to the Algolia REST API.
652
+ # This method allow you to send requests to the Algolia REST API.
653
+ # @param path [String] Path of the endpoint, anything after \&quot;/1\&quot; must be specified. (required)
654
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
655
+ # @param body [Object] Parameters to send with the custom request.
656
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
657
+ # @return [Object]
658
+ def custom_post(path, parameters = nil, body = nil, request_options = {})
659
+ response = custom_post_with_http_info(path, parameters, body, request_options)
660
+ deserialize(response.body, request_options[:debug_return_type] || 'Object')
661
+ end
662
+
663
+ # Send requests to the Algolia REST API.
664
+ # This method allow you to send requests to the Algolia REST API.
665
+ # @param path [String] Path of the endpoint, anything after \&quot;/1\&quot; must be specified. (required)
666
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
667
+ # @param body [Object] Parameters to send with the custom request.
668
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
669
+ # @return [Http::Response] the response
670
+ def custom_put_with_http_info(path, parameters = nil, body = nil, request_options = {})
671
+ # verify the required parameter 'path' is set
672
+ if @api_client.config.client_side_validation && path.nil?
673
+ raise ArgumentError, "Parameter `path` is required when calling `custom_put`."
674
+ end
675
+
676
+ path = '/1{path}'.sub('{' + 'path' + '}', path.to_s)
677
+ query_params = {}
678
+ query_params = query_params.merge(parameters) unless parameters.nil?
679
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
680
+ header_params = {}
681
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
682
+
683
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)
684
+
685
+ new_options = request_options.merge(
686
+ :operation => :'SearchClient.custom_put',
687
+ :header_params => header_params,
688
+ :query_params => query_params,
689
+ :body => post_body,
690
+ :use_read_transporter => false
691
+ )
692
+
693
+ @api_client.call_api(:PUT, path, new_options)
694
+ end
695
+
696
+ # Send requests to the Algolia REST API.
697
+ # This method allow you to send requests to the Algolia REST API.
698
+ # @param path [String] Path of the endpoint, anything after \&quot;/1\&quot; must be specified. (required)
699
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
700
+ # @param body [Object] Parameters to send with the custom request.
701
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
702
+ # @return [Object]
703
+ def custom_put(path, parameters = nil, body = nil, request_options = {})
704
+ response = custom_put_with_http_info(path, parameters, body, request_options)
705
+ deserialize(response.body, request_options[:debug_return_type] || 'Object')
706
+ end
707
+
708
+ # Delete API key.
709
+ # Delete an existing API key. The request must be authenticated with the admin API key.
710
+ # @param key [String] API key. (required)
711
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
712
+ # @return [Http::Response] the response
713
+ def delete_api_key_with_http_info(key, request_options = {})
714
+ # verify the required parameter 'key' is set
715
+ if @api_client.config.client_side_validation && key.nil?
716
+ raise ArgumentError, "Parameter `key` is required when calling `delete_api_key`."
717
+ end
718
+
719
+ path = '/1/keys/{key}'.sub('{' + 'key' + '}', @api_client.encode_uri(key.to_s))
720
+ query_params = {}
721
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
722
+ header_params = {}
723
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
724
+
725
+ post_body = request_options[:debug_body]
726
+
727
+ new_options = request_options.merge(
728
+ :operation => :'SearchClient.delete_api_key',
729
+ :header_params => header_params,
730
+ :query_params => query_params,
731
+ :body => post_body,
732
+ :use_read_transporter => false
733
+ )
734
+
735
+ @api_client.call_api(:DELETE, path, new_options)
736
+ end
737
+
738
+ # Delete API key.
739
+ # Delete an existing API key. The request must be authenticated with the admin API key.
740
+ # @param key [String] API key. (required)
741
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
742
+ # @return [DeleteApiKeyResponse]
743
+ def delete_api_key(key, request_options = {})
744
+ response = delete_api_key_with_http_info(key, request_options)
745
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::DeleteApiKeyResponse')
746
+ end
747
+
748
+ # Delete all records matching a query.
749
+ # This operation doesn&#39;t support all the query options, only its filters (numeric, facet, or tag) and geo queries. It doesn&#39;t accept empty filters or queries.
750
+ # @param index_name [String] Index on which to perform the request. (required)
751
+ # @param delete_by_params [DeleteByParams] (required)
752
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
753
+ # @return [Http::Response] the response
754
+ def delete_by_with_http_info(index_name, delete_by_params, request_options = {})
755
+ # verify the required parameter 'index_name' is set
756
+ if @api_client.config.client_side_validation && index_name.nil?
757
+ raise ArgumentError, "Parameter `index_name` is required when calling `delete_by`."
758
+ end
759
+ # verify the required parameter 'delete_by_params' is set
760
+ if @api_client.config.client_side_validation && delete_by_params.nil?
761
+ raise ArgumentError, "Parameter `delete_by_params` is required when calling `delete_by`."
762
+ end
763
+
764
+ path = '/1/indexes/{indexName}/deleteByQuery'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
765
+ query_params = {}
766
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
767
+ header_params = {}
768
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
769
+
770
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(delete_by_params)
771
+
772
+ new_options = request_options.merge(
773
+ :operation => :'SearchClient.delete_by',
774
+ :header_params => header_params,
775
+ :query_params => query_params,
776
+ :body => post_body,
777
+ :use_read_transporter => false
778
+ )
779
+
780
+ @api_client.call_api(:POST, path, new_options)
781
+ end
782
+
783
+ # Delete all records matching a query.
784
+ # This operation doesn't support all the query options, only its filters (numeric, facet, or tag) and geo queries. It doesn't accept empty filters or queries.
785
+ # @param index_name [String] Index on which to perform the request. (required)
786
+ # @param delete_by_params [DeleteByParams] (required)
787
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
788
+ # @return [DeletedAtResponse]
789
+ def delete_by(index_name, delete_by_params, request_options = {})
790
+ response = delete_by_with_http_info(index_name, delete_by_params, request_options)
791
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::DeletedAtResponse')
792
+ end
793
+
794
+ # Delete index.
795
+ # Delete an existing index.
796
+ # @param index_name [String] Index on which to perform the request. (required)
797
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
798
+ # @return [Http::Response] the response
799
+ def delete_index_with_http_info(index_name, request_options = {})
800
+ # verify the required parameter 'index_name' is set
801
+ if @api_client.config.client_side_validation && index_name.nil?
802
+ raise ArgumentError, "Parameter `index_name` is required when calling `delete_index`."
803
+ end
804
+
805
+ path = '/1/indexes/{indexName}'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
806
+ query_params = {}
807
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
808
+ header_params = {}
809
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
810
+
811
+ post_body = request_options[:debug_body]
812
+
813
+ new_options = request_options.merge(
814
+ :operation => :'SearchClient.delete_index',
815
+ :header_params => header_params,
816
+ :query_params => query_params,
817
+ :body => post_body,
818
+ :use_read_transporter => false
819
+ )
820
+
821
+ @api_client.call_api(:DELETE, path, new_options)
822
+ end
823
+
824
+ # Delete index.
825
+ # Delete an existing index.
826
+ # @param index_name [String] Index on which to perform the request. (required)
827
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
828
+ # @return [DeletedAtResponse]
829
+ def delete_index(index_name, request_options = {})
830
+ response = delete_index_with_http_info(index_name, request_options)
831
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::DeletedAtResponse')
832
+ end
833
+
834
+ # Delete a record.
835
+ # To delete a set of records matching a query, use the [&#x60;deleteByQuery&#x60; operation](#tag/Records/operation/deleteBy) instead.
836
+ # @param index_name [String] Index on which to perform the request. (required)
837
+ # @param object_id [String] Unique record (object) identifier. (required)
838
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
839
+ # @return [Http::Response] the response
840
+ def delete_object_with_http_info(index_name, object_id, request_options = {})
841
+ # verify the required parameter 'index_name' is set
842
+ if @api_client.config.client_side_validation && index_name.nil?
843
+ raise ArgumentError, "Parameter `index_name` is required when calling `delete_object`."
844
+ end
845
+ # verify the required parameter 'object_id' is set
846
+ if @api_client.config.client_side_validation && object_id.nil?
847
+ raise ArgumentError, "Parameter `object_id` is required when calling `delete_object`."
848
+ end
849
+
850
+ path = '/1/indexes/{indexName}/{objectID}'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
851
+ @api_client.encode_uri(object_id.to_s))
852
+ query_params = {}
853
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
854
+ header_params = {}
855
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
856
+
857
+ post_body = request_options[:debug_body]
858
+
859
+ new_options = request_options.merge(
860
+ :operation => :'SearchClient.delete_object',
861
+ :header_params => header_params,
862
+ :query_params => query_params,
863
+ :body => post_body,
864
+ :use_read_transporter => false
865
+ )
866
+
867
+ @api_client.call_api(:DELETE, path, new_options)
868
+ end
869
+
870
+ # Delete a record.
871
+ # To delete a set of records matching a query, use the [`deleteByQuery` operation](#tag/Records/operation/deleteBy) instead.
872
+ # @param index_name [String] Index on which to perform the request. (required)
873
+ # @param object_id [String] Unique record (object) identifier. (required)
874
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
875
+ # @return [DeletedAtResponse]
876
+ def delete_object(index_name, object_id, request_options = {})
877
+ response = delete_object_with_http_info(index_name, object_id, request_options)
878
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::DeletedAtResponse')
879
+ end
880
+
881
+ # Delete a rule.
882
+ # Delete a rule by its &#x60;objectID&#x60;. To find the &#x60;objectID&#x60; for rules, use the [&#x60;search&#x60; operation](#tag/Rules/operation/searchRules).
883
+ # @param index_name [String] Index on which to perform the request. (required)
884
+ # @param object_id [String] Unique identifier of a rule object. (required)
885
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
886
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
887
+ # @return [Http::Response] the response
888
+ def delete_rule_with_http_info(index_name, object_id, forward_to_replicas = nil, request_options = {})
889
+ # verify the required parameter 'index_name' is set
890
+ if @api_client.config.client_side_validation && index_name.nil?
891
+ raise ArgumentError, "Parameter `index_name` is required when calling `delete_rule`."
892
+ end
893
+ # verify the required parameter 'object_id' is set
894
+ if @api_client.config.client_side_validation && object_id.nil?
895
+ raise ArgumentError, "Parameter `object_id` is required when calling `delete_rule`."
896
+ end
897
+
898
+ path = '/1/indexes/{indexName}/rules/{objectID}'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
899
+ @api_client.encode_uri(object_id.to_s))
900
+ query_params = {}
901
+ query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
902
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
903
+ header_params = {}
904
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
905
+
906
+ post_body = request_options[:debug_body]
907
+
908
+ new_options = request_options.merge(
909
+ :operation => :'SearchClient.delete_rule',
910
+ :header_params => header_params,
911
+ :query_params => query_params,
912
+ :body => post_body,
913
+ :use_read_transporter => false
914
+ )
915
+
916
+ @api_client.call_api(:DELETE, path, new_options)
917
+ end
918
+
919
+ # Delete a rule.
920
+ # Delete a rule by its `objectID`. To find the `objectID` for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
921
+ # @param index_name [String] Index on which to perform the request. (required)
922
+ # @param object_id [String] Unique identifier of a rule object. (required)
923
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
924
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
925
+ # @return [UpdatedAtResponse]
926
+ def delete_rule(index_name, object_id, forward_to_replicas = nil, request_options = {})
927
+ response = delete_rule_with_http_info(index_name, object_id, forward_to_replicas, request_options)
928
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
929
+ end
930
+
931
+ # Remove a source.
932
+ # Remove a source from the list of allowed sources.
933
+ # @param source [String] IP address range of the source. (required)
934
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
935
+ # @return [Http::Response] the response
936
+ def delete_source_with_http_info(source, request_options = {})
937
+ # verify the required parameter 'source' is set
938
+ if @api_client.config.client_side_validation && source.nil?
939
+ raise ArgumentError, "Parameter `source` is required when calling `delete_source`."
940
+ end
941
+
942
+ path = '/1/security/sources/{source}'.sub('{' + 'source' + '}', @api_client.encode_uri(source.to_s))
943
+ query_params = {}
944
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
945
+ header_params = {}
946
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
947
+
948
+ post_body = request_options[:debug_body]
949
+
950
+ new_options = request_options.merge(
951
+ :operation => :'SearchClient.delete_source',
952
+ :header_params => header_params,
953
+ :query_params => query_params,
954
+ :body => post_body,
955
+ :use_read_transporter => false
956
+ )
957
+
958
+ @api_client.call_api(:DELETE, path, new_options)
959
+ end
960
+
961
+ # Remove a source.
962
+ # Remove a source from the list of allowed sources.
963
+ # @param source [String] IP address range of the source. (required)
964
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
965
+ # @return [DeleteSourceResponse]
966
+ def delete_source(source, request_options = {})
967
+ response = delete_source_with_http_info(source, request_options)
968
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::DeleteSourceResponse')
969
+ end
970
+
971
+ # Delete a synonym.
972
+ # Delete a synonym by its &#x60;objectID&#x60;. To find the object IDs of your synonyms, use the [&#x60;search&#x60; operation](#tag/Synonyms/operation/searchSynonyms).
973
+ # @param index_name [String] Index on which to perform the request. (required)
974
+ # @param object_id [String] Unique identifier of a synonym object. (required)
975
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
976
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
977
+ # @return [Http::Response] the response
978
+ def delete_synonym_with_http_info(index_name, object_id, forward_to_replicas = nil, request_options = {})
979
+ # verify the required parameter 'index_name' is set
980
+ if @api_client.config.client_side_validation && index_name.nil?
981
+ raise ArgumentError, "Parameter `index_name` is required when calling `delete_synonym`."
982
+ end
983
+ # verify the required parameter 'object_id' is set
984
+ if @api_client.config.client_side_validation && object_id.nil?
985
+ raise ArgumentError, "Parameter `object_id` is required when calling `delete_synonym`."
986
+ end
987
+
988
+ path = '/1/indexes/{indexName}/synonyms/{objectID}'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
989
+ @api_client.encode_uri(object_id.to_s))
990
+ query_params = {}
991
+ query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
992
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
993
+ header_params = {}
994
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
995
+
996
+ post_body = request_options[:debug_body]
997
+
998
+ new_options = request_options.merge(
999
+ :operation => :'SearchClient.delete_synonym',
1000
+ :header_params => header_params,
1001
+ :query_params => query_params,
1002
+ :body => post_body,
1003
+ :use_read_transporter => false
1004
+ )
1005
+
1006
+ @api_client.call_api(:DELETE, path, new_options)
1007
+ end
1008
+
1009
+ # Delete a synonym.
1010
+ # Delete a synonym by its `objectID`. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
1011
+ # @param index_name [String] Index on which to perform the request. (required)
1012
+ # @param object_id [String] Unique identifier of a synonym object. (required)
1013
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
1014
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1015
+ # @return [DeletedAtResponse]
1016
+ def delete_synonym(index_name, object_id, forward_to_replicas = nil, request_options = {})
1017
+ response = delete_synonym_with_http_info(index_name, object_id, forward_to_replicas, request_options)
1018
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::DeletedAtResponse')
1019
+ end
1020
+
1021
+ # Get API key permissions.
1022
+ # Get the permissions and restrictions of a specific API key. When authenticating with the admin API key, you can request information for any of your application&#39;s keys. When authenticating with other API keys, you can only retrieve information for that key.
1023
+ # @param key [String] API key. (required)
1024
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1025
+ # @return [Http::Response] the response
1026
+ def get_api_key_with_http_info(key, request_options = {})
1027
+ # verify the required parameter 'key' is set
1028
+ if @api_client.config.client_side_validation && key.nil?
1029
+ raise ArgumentError, "Parameter `key` is required when calling `get_api_key`."
1030
+ end
1031
+
1032
+ path = '/1/keys/{key}'.sub('{' + 'key' + '}', @api_client.encode_uri(key.to_s))
1033
+ query_params = {}
1034
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1035
+ header_params = {}
1036
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1037
+
1038
+ post_body = request_options[:debug_body]
1039
+
1040
+ new_options = request_options.merge(
1041
+ :operation => :'SearchClient.get_api_key',
1042
+ :header_params => header_params,
1043
+ :query_params => query_params,
1044
+ :body => post_body,
1045
+ :use_read_transporter => false
1046
+ )
1047
+
1048
+ @api_client.call_api(:GET, path, new_options)
1049
+ end
1050
+
1051
+ # Get API key permissions.
1052
+ # Get the permissions and restrictions of a specific API key. When authenticating with the admin API key, you can request information for any of your application's keys. When authenticating with other API keys, you can only retrieve information for that key.
1053
+ # @param key [String] API key. (required)
1054
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1055
+ # @return [GetApiKeyResponse]
1056
+ def get_api_key(key, request_options = {})
1057
+ response = get_api_key_with_http_info(key, request_options)
1058
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::GetApiKeyResponse')
1059
+ end
1060
+
1061
+ # List available languages.
1062
+ # Lists Algolia&#39;s [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/) and any customizations applied to each language&#39;s [stop word](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-stop-words/), [plural](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-plurals-and-other-declensions/), and [segmentation (compound)](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-segmentation/) features.
1063
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1064
+ # @return [Http::Response] the response
1065
+ def get_dictionary_languages_with_http_info(request_options = {})
1066
+ path = '/1/dictionaries/*/languages'
1067
+ query_params = {}
1068
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1069
+ header_params = {}
1070
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1071
+
1072
+ post_body = request_options[:debug_body]
1073
+
1074
+ new_options = request_options.merge(
1075
+ :operation => :'SearchClient.get_dictionary_languages',
1076
+ :header_params => header_params,
1077
+ :query_params => query_params,
1078
+ :body => post_body,
1079
+ :use_read_transporter => false
1080
+ )
1081
+
1082
+ @api_client.call_api(:GET, path, new_options)
1083
+ end
1084
+
1085
+ # List available languages.
1086
+ # Lists Algolia's [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/) and any customizations applied to each language's [stop word](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-stop-words/), [plural](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-plurals-and-other-declensions/), and [segmentation (compound)](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-segmentation/) features.
1087
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1088
+ # @return [Hash<String, Languages>]
1089
+ def get_dictionary_languages(request_options = {})
1090
+ response = get_dictionary_languages_with_http_info(request_options)
1091
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::Hash<String, Languages>')
1092
+ end
1093
+
1094
+ # Get stop word settings.
1095
+ # Get the languages for which [stop words are turned off](#tag/Dictionaries/operation/setDictionarySettings).
1096
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1097
+ # @return [Http::Response] the response
1098
+ def get_dictionary_settings_with_http_info(request_options = {})
1099
+ path = '/1/dictionaries/*/settings'
1100
+ query_params = {}
1101
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1102
+ header_params = {}
1103
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1104
+
1105
+ post_body = request_options[:debug_body]
1106
+
1107
+ new_options = request_options.merge(
1108
+ :operation => :'SearchClient.get_dictionary_settings',
1109
+ :header_params => header_params,
1110
+ :query_params => query_params,
1111
+ :body => post_body,
1112
+ :use_read_transporter => false
1113
+ )
1114
+
1115
+ @api_client.call_api(:GET, path, new_options)
1116
+ end
1117
+
1118
+ # Get stop word settings.
1119
+ # Get the languages for which [stop words are turned off](#tag/Dictionaries/operation/setDictionarySettings).
1120
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1121
+ # @return [GetDictionarySettingsResponse]
1122
+ def get_dictionary_settings(request_options = {})
1123
+ response = get_dictionary_settings_with_http_info(request_options)
1124
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::GetDictionarySettingsResponse')
1125
+ end
1126
+
1127
+ # Return the latest log entries.
1128
+ # The request must be authenticated by an API key with the [&#x60;logs&#x60; ACL](https://www.algolia.com/doc/guides/security/api-keys/#access-control-list-acl). Logs are held for the last seven days. There&#39;s also a logging limit of 1,000 API calls per server. This request counts towards your [operations quota](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-) but doesn&#39;t appear in the logs itself. &gt; **Note**: To fetch the logs for a Distributed Search Network (DSN) cluster, target the [DSN&#39;s endpoint](https://www.algolia.com/doc/guides/scaling/distributed-search-network-dsn/#accessing-dsn-servers).
1129
+ # @param offset [Integer] First log entry to retrieve. Sorted by decreasing date with 0 being the most recent. (default to 0)
1130
+ # @param length [Integer] Maximum number of entries to retrieve. (default to 10)
1131
+ # @param index_name [String] Index for which log entries should be retrieved. When omitted, log entries are retrieved for all indices.
1132
+ # @param type [LogType] Type of log entries to retrieve. When omitted, all log entries are retrieved. (default to 'all')
1133
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1134
+ # @return [Http::Response] the response
1135
+ def get_logs_with_http_info(offset = nil, length = nil, index_name = nil, type = nil, request_options = {})
1136
+ if @api_client.config.client_side_validation && !length.nil? && length > 1000
1137
+ raise ArgumentError, 'invalid value for ""length"" when calling SearchClient.get_logs, must be smaller than or equal to 1000.'
1138
+ end
1139
+
1140
+ path = '/1/logs'
1141
+ query_params = {}
1142
+ query_params[:offset] = offset unless offset.nil?
1143
+ query_params[:length] = length unless length.nil?
1144
+ query_params[:indexName] = index_name unless index_name.nil?
1145
+ query_params[:type] = type unless type.nil?
1146
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1147
+ header_params = {}
1148
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1149
+
1150
+ post_body = request_options[:debug_body]
1151
+
1152
+ new_options = request_options.merge(
1153
+ :operation => :'SearchClient.get_logs',
1154
+ :header_params => header_params,
1155
+ :query_params => query_params,
1156
+ :body => post_body,
1157
+ :use_read_transporter => false
1158
+ )
1159
+
1160
+ @api_client.call_api(:GET, path, new_options)
1161
+ end
1162
+
1163
+ # Return the latest log entries.
1164
+ # The request must be authenticated by an API key with the [`logs` ACL](https://www.algolia.com/doc/guides/security/api-keys/#access-control-list-acl). Logs are held for the last seven days. There's also a logging limit of 1,000 API calls per server. This request counts towards your [operations quota](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-) but doesn't appear in the logs itself. > **Note**: To fetch the logs for a Distributed Search Network (DSN) cluster, target the [DSN's endpoint](https://www.algolia.com/doc/guides/scaling/distributed-search-network-dsn/#accessing-dsn-servers).
1165
+ # @param offset [Integer] First log entry to retrieve. Sorted by decreasing date with 0 being the most recent. (default to 0)
1166
+ # @param length [Integer] Maximum number of entries to retrieve. (default to 10)
1167
+ # @param index_name [String] Index for which log entries should be retrieved. When omitted, log entries are retrieved for all indices.
1168
+ # @param type [LogType] Type of log entries to retrieve. When omitted, all log entries are retrieved. (default to 'all')
1169
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1170
+ # @return [GetLogsResponse]
1171
+ def get_logs(offset = nil, length = nil, index_name = nil, type = nil, request_options = {})
1172
+ response = get_logs_with_http_info(offset, length, index_name, type, request_options)
1173
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::GetLogsResponse')
1174
+ end
1175
+
1176
+ # Get a record.
1177
+ # To get more than one record, use the [&#x60;objects&#x60; operation](#tag/Records/operation/getObjects).
1178
+ # @param index_name [String] Index on which to perform the request. (required)
1179
+ # @param object_id [String] Unique record (object) identifier. (required)
1180
+ # @param attributes_to_retrieve [Array<String>] Attributes to include with the records in the response. This is useful to reduce the size of the API response. By default, all retrievable attributes are returned. &#x60;objectID&#x60; is always retrieved, even when not specified. [&#x60;unretrievableAttributes&#x60;](https://www.algolia.com/doc/api-reference/api-parameters/unretrievableAttributes/) won&#39;t be retrieved unless the request is authenticated with the admin API key.
1181
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1182
+ # @return [Http::Response] the response
1183
+ def get_object_with_http_info(index_name, object_id, attributes_to_retrieve = nil, request_options = {})
1184
+ # verify the required parameter 'index_name' is set
1185
+ if @api_client.config.client_side_validation && index_name.nil?
1186
+ raise ArgumentError, "Parameter `index_name` is required when calling `get_object`."
1187
+ end
1188
+ # verify the required parameter 'object_id' is set
1189
+ if @api_client.config.client_side_validation && object_id.nil?
1190
+ raise ArgumentError, "Parameter `object_id` is required when calling `get_object`."
1191
+ end
1192
+
1193
+ path = '/1/indexes/{indexName}/{objectID}'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
1194
+ @api_client.encode_uri(object_id.to_s))
1195
+ query_params = {}
1196
+ query_params[:attributesToRetrieve] = @api_client.build_collection_param(attributes_to_retrieve, :multi) unless attributes_to_retrieve.nil?
1197
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1198
+ header_params = {}
1199
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1200
+
1201
+ post_body = request_options[:debug_body]
1202
+
1203
+ new_options = request_options.merge(
1204
+ :operation => :'SearchClient.get_object',
1205
+ :header_params => header_params,
1206
+ :query_params => query_params,
1207
+ :body => post_body,
1208
+ :use_read_transporter => false
1209
+ )
1210
+
1211
+ @api_client.call_api(:GET, path, new_options)
1212
+ end
1213
+
1214
+ # Get a record.
1215
+ # To get more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
1216
+ # @param index_name [String] Index on which to perform the request. (required)
1217
+ # @param object_id [String] Unique record (object) identifier. (required)
1218
+ # @param attributes_to_retrieve [Array<String>] Attributes to include with the records in the response. This is useful to reduce the size of the API response. By default, all retrievable attributes are returned. &#x60;objectID&#x60; is always retrieved, even when not specified. [&#x60;unretrievableAttributes&#x60;](https://www.algolia.com/doc/api-reference/api-parameters/unretrievableAttributes/) won&#39;t be retrieved unless the request is authenticated with the admin API key.
1219
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1220
+ # @return [Hash<String, String>]
1221
+ def get_object(index_name, object_id, attributes_to_retrieve = nil, request_options = {})
1222
+ response = get_object_with_http_info(index_name, object_id, attributes_to_retrieve, request_options)
1223
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::Hash<String, String>')
1224
+ end
1225
+
1226
+ # Get multiple records.
1227
+ # Retrieve one or more records, potentially from different indices, in a single API operation. Results will be received in the same order as the requests.
1228
+ # @param get_objects_params [GetObjectsParams] Request object. (required)
1229
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1230
+ # @return [Http::Response] the response
1231
+ def get_objects_with_http_info(get_objects_params, request_options = {})
1232
+ # verify the required parameter 'get_objects_params' is set
1233
+ if @api_client.config.client_side_validation && get_objects_params.nil?
1234
+ raise ArgumentError, "Parameter `get_objects_params` is required when calling `get_objects`."
1235
+ end
1236
+
1237
+ path = '/1/indexes/*/objects'
1238
+ query_params = {}
1239
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1240
+ header_params = {}
1241
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1242
+
1243
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(get_objects_params)
1244
+
1245
+ new_options = request_options.merge(
1246
+ :operation => :'SearchClient.get_objects',
1247
+ :header_params => header_params,
1248
+ :query_params => query_params,
1249
+ :body => post_body,
1250
+ :use_read_transporter => false
1251
+ )
1252
+
1253
+ @api_client.call_api(:POST, path, new_options)
1254
+ end
1255
+
1256
+ # Get multiple records.
1257
+ # Retrieve one or more records, potentially from different indices, in a single API operation. Results will be received in the same order as the requests.
1258
+ # @param get_objects_params [GetObjectsParams] Request object. (required)
1259
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1260
+ # @return [GetObjectsResponse]
1261
+ def get_objects(get_objects_params, request_options = {})
1262
+ response = get_objects_with_http_info(get_objects_params, request_options)
1263
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::GetObjectsResponse')
1264
+ end
1265
+
1266
+ # Get a rule.
1267
+ # Get a rule by its &#x60;objectID&#x60;. To find the &#x60;objectID&#x60; for rules, use the [&#x60;search&#x60; operation](#tag/Rules/operation/searchRules).
1268
+ # @param index_name [String] Index on which to perform the request. (required)
1269
+ # @param object_id [String] Unique identifier of a rule object. (required)
1270
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1271
+ # @return [Http::Response] the response
1272
+ def get_rule_with_http_info(index_name, object_id, request_options = {})
1273
+ # verify the required parameter 'index_name' is set
1274
+ if @api_client.config.client_side_validation && index_name.nil?
1275
+ raise ArgumentError, "Parameter `index_name` is required when calling `get_rule`."
1276
+ end
1277
+ # verify the required parameter 'object_id' is set
1278
+ if @api_client.config.client_side_validation && object_id.nil?
1279
+ raise ArgumentError, "Parameter `object_id` is required when calling `get_rule`."
1280
+ end
1281
+
1282
+ path = '/1/indexes/{indexName}/rules/{objectID}'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
1283
+ @api_client.encode_uri(object_id.to_s))
1284
+ query_params = {}
1285
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1286
+ header_params = {}
1287
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1288
+
1289
+ post_body = request_options[:debug_body]
1290
+
1291
+ new_options = request_options.merge(
1292
+ :operation => :'SearchClient.get_rule',
1293
+ :header_params => header_params,
1294
+ :query_params => query_params,
1295
+ :body => post_body,
1296
+ :use_read_transporter => false
1297
+ )
1298
+
1299
+ @api_client.call_api(:GET, path, new_options)
1300
+ end
1301
+
1302
+ # Get a rule.
1303
+ # Get a rule by its `objectID`. To find the `objectID` for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
1304
+ # @param index_name [String] Index on which to perform the request. (required)
1305
+ # @param object_id [String] Unique identifier of a rule object. (required)
1306
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1307
+ # @return [Rule]
1308
+ def get_rule(index_name, object_id, request_options = {})
1309
+ response = get_rule_with_http_info(index_name, object_id, request_options)
1310
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::Rule')
1311
+ end
1312
+
1313
+ # Get index settings.
1314
+ # Return an object containing an index&#39;s [configuration settings](https://www.algolia.com/doc/api-reference/settings-api-parameters/).
1315
+ # @param index_name [String] Index on which to perform the request. (required)
1316
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1317
+ # @return [Http::Response] the response
1318
+ def get_settings_with_http_info(index_name, request_options = {})
1319
+ # verify the required parameter 'index_name' is set
1320
+ if @api_client.config.client_side_validation && index_name.nil?
1321
+ raise ArgumentError, "Parameter `index_name` is required when calling `get_settings`."
1322
+ end
1323
+
1324
+ path = '/1/indexes/{indexName}/settings'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
1325
+ query_params = {}
1326
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1327
+ header_params = {}
1328
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1329
+
1330
+ post_body = request_options[:debug_body]
1331
+
1332
+ new_options = request_options.merge(
1333
+ :operation => :'SearchClient.get_settings',
1334
+ :header_params => header_params,
1335
+ :query_params => query_params,
1336
+ :body => post_body,
1337
+ :use_read_transporter => false
1338
+ )
1339
+
1340
+ @api_client.call_api(:GET, path, new_options)
1341
+ end
1342
+
1343
+ # Get index settings.
1344
+ # Return an object containing an index's [configuration settings](https://www.algolia.com/doc/api-reference/settings-api-parameters/).
1345
+ # @param index_name [String] Index on which to perform the request. (required)
1346
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1347
+ # @return [IndexSettings]
1348
+ def get_settings(index_name, request_options = {})
1349
+ response = get_settings_with_http_info(index_name, request_options)
1350
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::IndexSettings')
1351
+ end
1352
+
1353
+ # Get all allowed IP addresses.
1354
+ # Get all allowed sources (IP addresses).
1355
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1356
+ # @return [Http::Response] the response
1357
+ def get_sources_with_http_info(request_options = {})
1358
+ path = '/1/security/sources'
1359
+ query_params = {}
1360
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1361
+ header_params = {}
1362
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1363
+
1364
+ post_body = request_options[:debug_body]
1365
+
1366
+ new_options = request_options.merge(
1367
+ :operation => :'SearchClient.get_sources',
1368
+ :header_params => header_params,
1369
+ :query_params => query_params,
1370
+ :body => post_body,
1371
+ :use_read_transporter => false
1372
+ )
1373
+
1374
+ @api_client.call_api(:GET, path, new_options)
1375
+ end
1376
+
1377
+ # Get all allowed IP addresses.
1378
+ # Get all allowed sources (IP addresses).
1379
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1380
+ # @return [Array<Source>]
1381
+ def get_sources(request_options = {})
1382
+ response = get_sources_with_http_info(request_options)
1383
+ deserialize(response.body, request_options[:debug_return_type] || 'Array<Search::Source>')
1384
+ end
1385
+
1386
+ # Get a synonym object.
1387
+ # Get a syonym by its &#x60;objectID&#x60;. To find the object IDs for your synonyms, use the [&#x60;search&#x60; operation](#tag/Synonyms/operation/searchSynonyms).
1388
+ # @param index_name [String] Index on which to perform the request. (required)
1389
+ # @param object_id [String] Unique identifier of a synonym object. (required)
1390
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1391
+ # @return [Http::Response] the response
1392
+ def get_synonym_with_http_info(index_name, object_id, request_options = {})
1393
+ # verify the required parameter 'index_name' is set
1394
+ if @api_client.config.client_side_validation && index_name.nil?
1395
+ raise ArgumentError, "Parameter `index_name` is required when calling `get_synonym`."
1396
+ end
1397
+ # verify the required parameter 'object_id' is set
1398
+ if @api_client.config.client_side_validation && object_id.nil?
1399
+ raise ArgumentError, "Parameter `object_id` is required when calling `get_synonym`."
1400
+ end
1401
+
1402
+ path = '/1/indexes/{indexName}/synonyms/{objectID}'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
1403
+ @api_client.encode_uri(object_id.to_s))
1404
+ query_params = {}
1405
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1406
+ header_params = {}
1407
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1408
+
1409
+ post_body = request_options[:debug_body]
1410
+
1411
+ new_options = request_options.merge(
1412
+ :operation => :'SearchClient.get_synonym',
1413
+ :header_params => header_params,
1414
+ :query_params => query_params,
1415
+ :body => post_body,
1416
+ :use_read_transporter => false
1417
+ )
1418
+
1419
+ @api_client.call_api(:GET, path, new_options)
1420
+ end
1421
+
1422
+ # Get a synonym object.
1423
+ # Get a syonym by its `objectID`. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
1424
+ # @param index_name [String] Index on which to perform the request. (required)
1425
+ # @param object_id [String] Unique identifier of a synonym object. (required)
1426
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1427
+ # @return [SynonymHit]
1428
+ def get_synonym(index_name, object_id, request_options = {})
1429
+ response = get_synonym_with_http_info(index_name, object_id, request_options)
1430
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::SynonymHit')
1431
+ end
1432
+
1433
+ # Check a task&#39;s status.
1434
+ # Some operations, such as copying an index, will respond with a &#x60;taskID&#x60; value. Use this value here to check the status of that task.
1435
+ # @param index_name [String] Index on which to perform the request. (required)
1436
+ # @param task_id [Integer] Unique task identifier. (required)
1437
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1438
+ # @return [Http::Response] the response
1439
+ def get_task_with_http_info(index_name, task_id, request_options = {})
1440
+ # verify the required parameter 'index_name' is set
1441
+ if @api_client.config.client_side_validation && index_name.nil?
1442
+ raise ArgumentError, "Parameter `index_name` is required when calling `get_task`."
1443
+ end
1444
+ # verify the required parameter 'task_id' is set
1445
+ if @api_client.config.client_side_validation && task_id.nil?
1446
+ raise ArgumentError, "Parameter `task_id` is required when calling `get_task`."
1447
+ end
1448
+
1449
+ path = '/1/indexes/{indexName}/task/{taskID}'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s)).sub('{' + 'taskID' + '}',
1450
+ @api_client.encode_uri(task_id.to_s))
1451
+ query_params = {}
1452
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1453
+ header_params = {}
1454
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1455
+
1456
+ post_body = request_options[:debug_body]
1457
+
1458
+ new_options = request_options.merge(
1459
+ :operation => :'SearchClient.get_task',
1460
+ :header_params => header_params,
1461
+ :query_params => query_params,
1462
+ :body => post_body,
1463
+ :use_read_transporter => false
1464
+ )
1465
+
1466
+ @api_client.call_api(:GET, path, new_options)
1467
+ end
1468
+
1469
+ # Check a task's status.
1470
+ # Some operations, such as copying an index, will respond with a `taskID` value. Use this value here to check the status of that task.
1471
+ # @param index_name [String] Index on which to perform the request. (required)
1472
+ # @param task_id [Integer] Unique task identifier. (required)
1473
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1474
+ # @return [GetTaskResponse]
1475
+ def get_task(index_name, task_id, request_options = {})
1476
+ response = get_task_with_http_info(index_name, task_id, request_options)
1477
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::GetTaskResponse')
1478
+ end
1479
+
1480
+ # Get top userID.
1481
+ # Get the IDs of the 10 users with the highest number of records per cluster. Since it can take up to a few seconds to get the data from the different clusters, the response isn&#39;t real-time.
1482
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1483
+ # @return [Http::Response] the response
1484
+ def get_top_user_ids_with_http_info(request_options = {})
1485
+ path = '/1/clusters/mapping/top'
1486
+ query_params = {}
1487
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1488
+ header_params = {}
1489
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1490
+
1491
+ post_body = request_options[:debug_body]
1492
+
1493
+ new_options = request_options.merge(
1494
+ :operation => :'SearchClient.get_top_user_ids',
1495
+ :header_params => header_params,
1496
+ :query_params => query_params,
1497
+ :body => post_body,
1498
+ :use_read_transporter => false
1499
+ )
1500
+
1501
+ @api_client.call_api(:GET, path, new_options)
1502
+ end
1503
+
1504
+ # Get top userID.
1505
+ # Get the IDs of the 10 users with the highest number of records per cluster. Since it can take up to a few seconds to get the data from the different clusters, the response isn't real-time.
1506
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1507
+ # @return [GetTopUserIdsResponse]
1508
+ def get_top_user_ids(request_options = {})
1509
+ response = get_top_user_ids_with_http_info(request_options)
1510
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::GetTopUserIdsResponse')
1511
+ end
1512
+
1513
+ # Get userID.
1514
+ # Returns the userID data stored in the mapping. Since it can take up to a few seconds to get the data from the different clusters, the response isn&#39;t real-time.
1515
+ # @param user_id [String] userID to assign. (required)
1516
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1517
+ # @return [Http::Response] the response
1518
+ def get_user_id_with_http_info(user_id, request_options = {})
1519
+ # verify the required parameter 'user_id' is set
1520
+ if @api_client.config.client_side_validation && user_id.nil?
1521
+ raise ArgumentError, "Parameter `user_id` is required when calling `get_user_id`."
1522
+ end
1523
+
1524
+ pattern = /^[a-zA-Z0-9 \-*.]+$/
1525
+ if @api_client.config.client_side_validation && user_id !~ pattern
1526
+ raise ArgumentError, "invalid value for 'user_id' when calling SearchClient.get_user_id, must conform to the pattern #{pattern}."
1527
+ end
1528
+
1529
+ path = '/1/clusters/mapping/{userID}'.sub('{' + 'userID' + '}', @api_client.encode_uri(user_id.to_s))
1530
+ query_params = {}
1531
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1532
+ header_params = {}
1533
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1534
+
1535
+ post_body = request_options[:debug_body]
1536
+
1537
+ new_options = request_options.merge(
1538
+ :operation => :'SearchClient.get_user_id',
1539
+ :header_params => header_params,
1540
+ :query_params => query_params,
1541
+ :body => post_body,
1542
+ :use_read_transporter => false
1543
+ )
1544
+
1545
+ @api_client.call_api(:GET, path, new_options)
1546
+ end
1547
+
1548
+ # Get userID.
1549
+ # Returns the userID data stored in the mapping. Since it can take up to a few seconds to get the data from the different clusters, the response isn't real-time.
1550
+ # @param user_id [String] userID to assign. (required)
1551
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1552
+ # @return [UserId]
1553
+ def get_user_id(user_id, request_options = {})
1554
+ response = get_user_id_with_http_info(user_id, request_options)
1555
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::UserId')
1556
+ end
1557
+
1558
+ # Get migration and user mapping status.
1559
+ # To determine when the time-consuming process of creating a large batch of users or migrating users from one cluster to another is complete, this operation retrieves the status of the process.
1560
+ # @param get_clusters [Boolean] Indicates whether to include the cluster&#39;s pending mapping state in the response.
1561
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1562
+ # @return [Http::Response] the response
1563
+ def has_pending_mappings_with_http_info(get_clusters = nil, request_options = {})
1564
+ path = '/1/clusters/mapping/pending'
1565
+ query_params = {}
1566
+ query_params[:getClusters] = get_clusters unless get_clusters.nil?
1567
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1568
+ header_params = {}
1569
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1570
+
1571
+ post_body = request_options[:debug_body]
1572
+
1573
+ new_options = request_options.merge(
1574
+ :operation => :'SearchClient.has_pending_mappings',
1575
+ :header_params => header_params,
1576
+ :query_params => query_params,
1577
+ :body => post_body,
1578
+ :use_read_transporter => false
1579
+ )
1580
+
1581
+ @api_client.call_api(:GET, path, new_options)
1582
+ end
1583
+
1584
+ # Get migration and user mapping status.
1585
+ # To determine when the time-consuming process of creating a large batch of users or migrating users from one cluster to another is complete, this operation retrieves the status of the process.
1586
+ # @param get_clusters [Boolean] Indicates whether to include the cluster&#39;s pending mapping state in the response.
1587
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1588
+ # @return [HasPendingMappingsResponse]
1589
+ def has_pending_mappings(get_clusters = nil, request_options = {})
1590
+ response = has_pending_mappings_with_http_info(get_clusters, request_options)
1591
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::HasPendingMappingsResponse')
1592
+ end
1593
+
1594
+ # List API keys.
1595
+ # List all API keys associated with your Algolia application, including their permissions and restrictions.
1596
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1597
+ # @return [Http::Response] the response
1598
+ def list_api_keys_with_http_info(request_options = {})
1599
+ path = '/1/keys'
1600
+ query_params = {}
1601
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1602
+ header_params = {}
1603
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1604
+
1605
+ post_body = request_options[:debug_body]
1606
+
1607
+ new_options = request_options.merge(
1608
+ :operation => :'SearchClient.list_api_keys',
1609
+ :header_params => header_params,
1610
+ :query_params => query_params,
1611
+ :body => post_body,
1612
+ :use_read_transporter => false
1613
+ )
1614
+
1615
+ @api_client.call_api(:GET, path, new_options)
1616
+ end
1617
+
1618
+ # List API keys.
1619
+ # List all API keys associated with your Algolia application, including their permissions and restrictions.
1620
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1621
+ # @return [ListApiKeysResponse]
1622
+ def list_api_keys(request_options = {})
1623
+ response = list_api_keys_with_http_info(request_options)
1624
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::ListApiKeysResponse')
1625
+ end
1626
+
1627
+ # List clusters.
1628
+ # List the available clusters in a multi-cluster setup.
1629
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1630
+ # @return [Http::Response] the response
1631
+ def list_clusters_with_http_info(request_options = {})
1632
+ path = '/1/clusters'
1633
+ query_params = {}
1634
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1635
+ header_params = {}
1636
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1637
+
1638
+ post_body = request_options[:debug_body]
1639
+
1640
+ new_options = request_options.merge(
1641
+ :operation => :'SearchClient.list_clusters',
1642
+ :header_params => header_params,
1643
+ :query_params => query_params,
1644
+ :body => post_body,
1645
+ :use_read_transporter => false
1646
+ )
1647
+
1648
+ @api_client.call_api(:GET, path, new_options)
1649
+ end
1650
+
1651
+ # List clusters.
1652
+ # List the available clusters in a multi-cluster setup.
1653
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1654
+ # @return [ListClustersResponse]
1655
+ def list_clusters(request_options = {})
1656
+ response = list_clusters_with_http_info(request_options)
1657
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::ListClustersResponse')
1658
+ end
1659
+
1660
+ # List indices.
1661
+ # List indices in an Algolia application.
1662
+ # @param page [Integer] Returns the requested page number. The page size is determined by the &#x60;hitsPerPage&#x60; parameter. You can see the number of available pages in the &#x60;nbPages&#x60; response attribute. When &#x60;page&#x60; is null, the API response is not paginated.
1663
+ # @param hits_per_page [Integer] Maximum number of hits per page. (default to 100)
1664
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1665
+ # @return [Http::Response] the response
1666
+ def list_indices_with_http_info(page = nil, hits_per_page = nil, request_options = {})
1667
+ if @api_client.config.client_side_validation && !page.nil? && page < 0
1668
+ raise ArgumentError, 'invalid value for ""page"" when calling SearchClient.list_indices, must be greater than or equal to 0.'
1669
+ end
1670
+
1671
+ path = '/1/indexes'
1672
+ query_params = {}
1673
+ query_params[:page] = page unless page.nil?
1674
+ query_params[:hitsPerPage] = hits_per_page unless hits_per_page.nil?
1675
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1676
+ header_params = {}
1677
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1678
+
1679
+ post_body = request_options[:debug_body]
1680
+
1681
+ new_options = request_options.merge(
1682
+ :operation => :'SearchClient.list_indices',
1683
+ :header_params => header_params,
1684
+ :query_params => query_params,
1685
+ :body => post_body,
1686
+ :use_read_transporter => false
1687
+ )
1688
+
1689
+ @api_client.call_api(:GET, path, new_options)
1690
+ end
1691
+
1692
+ # List indices.
1693
+ # List indices in an Algolia application.
1694
+ # @param page [Integer] Returns the requested page number. The page size is determined by the &#x60;hitsPerPage&#x60; parameter. You can see the number of available pages in the &#x60;nbPages&#x60; response attribute. When &#x60;page&#x60; is null, the API response is not paginated.
1695
+ # @param hits_per_page [Integer] Maximum number of hits per page. (default to 100)
1696
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1697
+ # @return [ListIndicesResponse]
1698
+ def list_indices(page = nil, hits_per_page = nil, request_options = {})
1699
+ response = list_indices_with_http_info(page, hits_per_page, request_options)
1700
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::ListIndicesResponse')
1701
+ end
1702
+
1703
+ # List userIDs.
1704
+ # List the userIDs assigned to a multi-cluster application. Since it can take up to a few seconds to get the data from the different clusters, the response isn&#39;t real-time.
1705
+ # @param page [Integer] Returns the requested page number. The page size is determined by the &#x60;hitsPerPage&#x60; parameter. You can see the number of available pages in the &#x60;nbPages&#x60; response attribute. When &#x60;page&#x60; is null, the API response is not paginated.
1706
+ # @param hits_per_page [Integer] Maximum number of hits per page. (default to 100)
1707
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1708
+ # @return [Http::Response] the response
1709
+ def list_user_ids_with_http_info(page = nil, hits_per_page = nil, request_options = {})
1710
+ if @api_client.config.client_side_validation && !page.nil? && page < 0
1711
+ raise ArgumentError, 'invalid value for ""page"" when calling SearchClient.list_user_ids, must be greater than or equal to 0.'
1712
+ end
1713
+
1714
+ path = '/1/clusters/mapping'
1715
+ query_params = {}
1716
+ query_params[:page] = page unless page.nil?
1717
+ query_params[:hitsPerPage] = hits_per_page unless hits_per_page.nil?
1718
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1719
+ header_params = {}
1720
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1721
+
1722
+ post_body = request_options[:debug_body]
1723
+
1724
+ new_options = request_options.merge(
1725
+ :operation => :'SearchClient.list_user_ids',
1726
+ :header_params => header_params,
1727
+ :query_params => query_params,
1728
+ :body => post_body,
1729
+ :use_read_transporter => false
1730
+ )
1731
+
1732
+ @api_client.call_api(:GET, path, new_options)
1733
+ end
1734
+
1735
+ # List userIDs.
1736
+ # List the userIDs assigned to a multi-cluster application. Since it can take up to a few seconds to get the data from the different clusters, the response isn't real-time.
1737
+ # @param page [Integer] Returns the requested page number. The page size is determined by the &#x60;hitsPerPage&#x60; parameter. You can see the number of available pages in the &#x60;nbPages&#x60; response attribute. When &#x60;page&#x60; is null, the API response is not paginated.
1738
+ # @param hits_per_page [Integer] Maximum number of hits per page. (default to 100)
1739
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1740
+ # @return [ListUserIdsResponse]
1741
+ def list_user_ids(page = nil, hits_per_page = nil, request_options = {})
1742
+ response = list_user_ids_with_http_info(page, hits_per_page, request_options)
1743
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::ListUserIdsResponse')
1744
+ end
1745
+
1746
+ # Batch write operations on multiple indices.
1747
+ # To reduce the time spent on network round trips, you can perform several write actions in a single request. It&#39;s a multi-index version of the [&#x60;batch&#x60; operation](#tag/Records/operation/batch). Actions are applied in the order they are specified. The supported actions are equivalent to the individual operations of the same name.
1748
+ # @param batch_params [BatchParams] (required)
1749
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1750
+ # @return [Http::Response] the response
1751
+ def multiple_batch_with_http_info(batch_params, request_options = {})
1752
+ # verify the required parameter 'batch_params' is set
1753
+ if @api_client.config.client_side_validation && batch_params.nil?
1754
+ raise ArgumentError, "Parameter `batch_params` is required when calling `multiple_batch`."
1755
+ end
1756
+
1757
+ path = '/1/indexes/*/batch'
1758
+ query_params = {}
1759
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1760
+ header_params = {}
1761
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1762
+
1763
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(batch_params)
1764
+
1765
+ new_options = request_options.merge(
1766
+ :operation => :'SearchClient.multiple_batch',
1767
+ :header_params => header_params,
1768
+ :query_params => query_params,
1769
+ :body => post_body,
1770
+ :use_read_transporter => false
1771
+ )
1772
+
1773
+ @api_client.call_api(:POST, path, new_options)
1774
+ end
1775
+
1776
+ # Batch write operations on multiple indices.
1777
+ # To reduce the time spent on network round trips, you can perform several write actions in a single request. It's a multi-index version of the [`batch` operation](#tag/Records/operation/batch). Actions are applied in the order they are specified. The supported actions are equivalent to the individual operations of the same name.
1778
+ # @param batch_params [BatchParams] (required)
1779
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1780
+ # @return [MultipleBatchResponse]
1781
+ def multiple_batch(batch_params, request_options = {})
1782
+ response = multiple_batch_with_http_info(batch_params, request_options)
1783
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::MultipleBatchResponse')
1784
+ end
1785
+
1786
+ # Copy, move, or rename an index.
1787
+ # This &#x60;operation&#x60;, _copy_ or _move_, will copy or move a source index&#39;s (&#x60;IndexName&#x60;) records, settings, synonyms, and rules to a &#x60;destination&#x60; index. If the destination index exists, it will be replaced, except for index-specific API keys and analytics data. If the destination index doesn&#39;t exist, it will be created. The choice between moving or copying an index depends on your needs. Choose: - **Move** to rename an index. - **Copy** to create a new index with the same records and configuration as an existing one. &gt; **Note**: When considering copying or moving, be aware of the [rate limitations](https://www.algolia.com/doc/guides/scaling/algolia-service-limits/#application-record-and-index-limits) on these processes and the [impact on your analytics data](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/concepts/indices-analytics/).
1788
+ # @param index_name [String] Index on which to perform the request. (required)
1789
+ # @param operation_index_params [OperationIndexParams] (required)
1790
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1791
+ # @return [Http::Response] the response
1792
+ def operation_index_with_http_info(index_name, operation_index_params, request_options = {})
1793
+ # verify the required parameter 'index_name' is set
1794
+ if @api_client.config.client_side_validation && index_name.nil?
1795
+ raise ArgumentError, "Parameter `index_name` is required when calling `operation_index`."
1796
+ end
1797
+ # verify the required parameter 'operation_index_params' is set
1798
+ if @api_client.config.client_side_validation && operation_index_params.nil?
1799
+ raise ArgumentError, "Parameter `operation_index_params` is required when calling `operation_index`."
1800
+ end
1801
+
1802
+ path = '/1/indexes/{indexName}/operation'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
1803
+ query_params = {}
1804
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1805
+ header_params = {}
1806
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1807
+
1808
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(operation_index_params)
1809
+
1810
+ new_options = request_options.merge(
1811
+ :operation => :'SearchClient.operation_index',
1812
+ :header_params => header_params,
1813
+ :query_params => query_params,
1814
+ :body => post_body,
1815
+ :use_read_transporter => false
1816
+ )
1817
+
1818
+ @api_client.call_api(:POST, path, new_options)
1819
+ end
1820
+
1821
+ # Copy, move, or rename an index.
1822
+ # This `operation`, _copy_ or _move_, will copy or move a source index's (`IndexName`) records, settings, synonyms, and rules to a `destination` index. If the destination index exists, it will be replaced, except for index-specific API keys and analytics data. If the destination index doesn't exist, it will be created. The choice between moving or copying an index depends on your needs. Choose: - **Move** to rename an index. - **Copy** to create a new index with the same records and configuration as an existing one. > **Note**: When considering copying or moving, be aware of the [rate limitations](https://www.algolia.com/doc/guides/scaling/algolia-service-limits/#application-record-and-index-limits) on these processes and the [impact on your analytics data](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/concepts/indices-analytics/).
1823
+ # @param index_name [String] Index on which to perform the request. (required)
1824
+ # @param operation_index_params [OperationIndexParams] (required)
1825
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1826
+ # @return [UpdatedAtResponse]
1827
+ def operation_index(index_name, operation_index_params, request_options = {})
1828
+ response = operation_index_with_http_info(index_name, operation_index_params, request_options)
1829
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
1830
+ end
1831
+
1832
+ # Update record attributes.
1833
+ # Add new attributes or update current ones in an existing record. You can use any first-level attribute but not nested attributes. If you specify a [nested attribute](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/creating-and-using-nested-attributes/), the engine treats it as a replacement for its first-level ancestor.
1834
+ # @param index_name [String] Index on which to perform the request. (required)
1835
+ # @param object_id [String] Unique record (object) identifier. (required)
1836
+ # @param attributes_to_update [Hash<String, AttributeToUpdate>] Object with attributes to update. (required)
1837
+ # @param create_if_not_exists [Boolean] Indicates whether to create a new record if it doesn&#39;t exist yet. (default to true)
1838
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1839
+ # @return [Http::Response] the response
1840
+ def partial_update_object_with_http_info(index_name, object_id, attributes_to_update, create_if_not_exists = nil, request_options = {})
1841
+ # verify the required parameter 'index_name' is set
1842
+ if @api_client.config.client_side_validation && index_name.nil?
1843
+ raise ArgumentError, "Parameter `index_name` is required when calling `partial_update_object`."
1844
+ end
1845
+ # verify the required parameter 'object_id' is set
1846
+ if @api_client.config.client_side_validation && object_id.nil?
1847
+ raise ArgumentError, "Parameter `object_id` is required when calling `partial_update_object`."
1848
+ end
1849
+ # verify the required parameter 'attributes_to_update' is set
1850
+ if @api_client.config.client_side_validation && attributes_to_update.nil?
1851
+ raise ArgumentError, "Parameter `attributes_to_update` is required when calling `partial_update_object`."
1852
+ end
1853
+
1854
+ path = '/1/indexes/{indexName}/{objectID}/partial'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
1855
+ @api_client.encode_uri(object_id.to_s))
1856
+ query_params = {}
1857
+ query_params[:createIfNotExists] = create_if_not_exists unless create_if_not_exists.nil?
1858
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1859
+ header_params = {}
1860
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1861
+
1862
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(attributes_to_update)
1863
+
1864
+ new_options = request_options.merge(
1865
+ :operation => :'SearchClient.partial_update_object',
1866
+ :header_params => header_params,
1867
+ :query_params => query_params,
1868
+ :body => post_body,
1869
+ :use_read_transporter => false
1870
+ )
1871
+
1872
+ @api_client.call_api(:POST, path, new_options)
1873
+ end
1874
+
1875
+ # Update record attributes.
1876
+ # Add new attributes or update current ones in an existing record. You can use any first-level attribute but not nested attributes. If you specify a [nested attribute](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/creating-and-using-nested-attributes/), the engine treats it as a replacement for its first-level ancestor.
1877
+ # @param index_name [String] Index on which to perform the request. (required)
1878
+ # @param object_id [String] Unique record (object) identifier. (required)
1879
+ # @param attributes_to_update [Hash<String, AttributeToUpdate>] Object with attributes to update. (required)
1880
+ # @param create_if_not_exists [Boolean] Indicates whether to create a new record if it doesn&#39;t exist yet. (default to true)
1881
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1882
+ # @return [UpdatedAtWithObjectIdResponse]
1883
+ def partial_update_object(index_name, object_id, attributes_to_update, create_if_not_exists = nil, request_options = {})
1884
+ response = partial_update_object_with_http_info(index_name, object_id, attributes_to_update, create_if_not_exists, request_options)
1885
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtWithObjectIdResponse')
1886
+ end
1887
+
1888
+ # Remove userID.
1889
+ # Remove a userID and its associated data from the multi-clusters.
1890
+ # @param user_id [String] userID to assign. (required)
1891
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1892
+ # @return [Http::Response] the response
1893
+ def remove_user_id_with_http_info(user_id, request_options = {})
1894
+ # verify the required parameter 'user_id' is set
1895
+ if @api_client.config.client_side_validation && user_id.nil?
1896
+ raise ArgumentError, "Parameter `user_id` is required when calling `remove_user_id`."
1897
+ end
1898
+
1899
+ pattern = /^[a-zA-Z0-9 \-*.]+$/
1900
+ if @api_client.config.client_side_validation && user_id !~ pattern
1901
+ raise ArgumentError, "invalid value for 'user_id' when calling SearchClient.remove_user_id, must conform to the pattern #{pattern}."
1902
+ end
1903
+
1904
+ path = '/1/clusters/mapping/{userID}'.sub('{' + 'userID' + '}', @api_client.encode_uri(user_id.to_s))
1905
+ query_params = {}
1906
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1907
+ header_params = {}
1908
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1909
+
1910
+ post_body = request_options[:debug_body]
1911
+
1912
+ new_options = request_options.merge(
1913
+ :operation => :'SearchClient.remove_user_id',
1914
+ :header_params => header_params,
1915
+ :query_params => query_params,
1916
+ :body => post_body,
1917
+ :use_read_transporter => false
1918
+ )
1919
+
1920
+ @api_client.call_api(:DELETE, path, new_options)
1921
+ end
1922
+
1923
+ # Remove userID.
1924
+ # Remove a userID and its associated data from the multi-clusters.
1925
+ # @param user_id [String] userID to assign. (required)
1926
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1927
+ # @return [RemoveUserIdResponse]
1928
+ def remove_user_id(user_id, request_options = {})
1929
+ response = remove_user_id_with_http_info(user_id, request_options)
1930
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::RemoveUserIdResponse')
1931
+ end
1932
+
1933
+ # Replace all sources.
1934
+ # Replace all allowed sources.
1935
+ # @param source [Array<Source>] Allowed sources. (required)
1936
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1937
+ # @return [Http::Response] the response
1938
+ def replace_sources_with_http_info(source, request_options = {})
1939
+ # verify the required parameter 'source' is set
1940
+ if @api_client.config.client_side_validation && source.nil?
1941
+ raise ArgumentError, "Parameter `source` is required when calling `replace_sources`."
1942
+ end
1943
+
1944
+ path = '/1/security/sources'
1945
+ query_params = {}
1946
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1947
+ header_params = {}
1948
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1949
+
1950
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(source)
1951
+
1952
+ new_options = request_options.merge(
1953
+ :operation => :'SearchClient.replace_sources',
1954
+ :header_params => header_params,
1955
+ :query_params => query_params,
1956
+ :body => post_body,
1957
+ :use_read_transporter => false
1958
+ )
1959
+
1960
+ @api_client.call_api(:PUT, path, new_options)
1961
+ end
1962
+
1963
+ # Replace all sources.
1964
+ # Replace all allowed sources.
1965
+ # @param source [Array<Source>] Allowed sources. (required)
1966
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1967
+ # @return [ReplaceSourceResponse]
1968
+ def replace_sources(source, request_options = {})
1969
+ response = replace_sources_with_http_info(source, request_options)
1970
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::ReplaceSourceResponse')
1971
+ end
1972
+
1973
+ # Restore API key.
1974
+ # Restore a deleted API key, along with its associated permissions. The request must be authenticated with the admin API key.
1975
+ # @param key [String] API key. (required)
1976
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1977
+ # @return [Http::Response] the response
1978
+ def restore_api_key_with_http_info(key, request_options = {})
1979
+ # verify the required parameter 'key' is set
1980
+ if @api_client.config.client_side_validation && key.nil?
1981
+ raise ArgumentError, "Parameter `key` is required when calling `restore_api_key`."
1982
+ end
1983
+
1984
+ path = '/1/keys/{key}/restore'.sub('{' + 'key' + '}', @api_client.encode_uri(key.to_s))
1985
+ query_params = {}
1986
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1987
+ header_params = {}
1988
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1989
+
1990
+ post_body = request_options[:debug_body]
1991
+
1992
+ new_options = request_options.merge(
1993
+ :operation => :'SearchClient.restore_api_key',
1994
+ :header_params => header_params,
1995
+ :query_params => query_params,
1996
+ :body => post_body,
1997
+ :use_read_transporter => false
1998
+ )
1999
+
2000
+ @api_client.call_api(:POST, path, new_options)
2001
+ end
2002
+
2003
+ # Restore API key.
2004
+ # Restore a deleted API key, along with its associated permissions. The request must be authenticated with the admin API key.
2005
+ # @param key [String] API key. (required)
2006
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2007
+ # @return [AddApiKeyResponse]
2008
+ def restore_api_key(key, request_options = {})
2009
+ response = restore_api_key_with_http_info(key, request_options)
2010
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::AddApiKeyResponse')
2011
+ end
2012
+
2013
+ # Add or update a record.
2014
+ # Add a record (object) to an index or replace it. If the record doesn&#39;t contain an &#x60;objectID&#x60;, Algolia automatically adds it. If you use an existing &#x60;objectID&#x60;, the existing record is replaced with the new one. To add multiple records to your index in a single API request, use the [&#x60;batch&#x60; operation](#tag/Records/operation/batch).
2015
+ # @param index_name [String] Index on which to perform the request. (required)
2016
+ # @param body [Object] The Algolia record. (required)
2017
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2018
+ # @return [Http::Response] the response
2019
+ def save_object_with_http_info(index_name, body, request_options = {})
2020
+ # verify the required parameter 'index_name' is set
2021
+ if @api_client.config.client_side_validation && index_name.nil?
2022
+ raise ArgumentError, "Parameter `index_name` is required when calling `save_object`."
2023
+ end
2024
+ # verify the required parameter 'body' is set
2025
+ if @api_client.config.client_side_validation && body.nil?
2026
+ raise ArgumentError, "Parameter `body` is required when calling `save_object`."
2027
+ end
2028
+
2029
+ path = '/1/indexes/{indexName}'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
2030
+ query_params = {}
2031
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2032
+ header_params = {}
2033
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2034
+
2035
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)
2036
+
2037
+ new_options = request_options.merge(
2038
+ :operation => :'SearchClient.save_object',
2039
+ :header_params => header_params,
2040
+ :query_params => query_params,
2041
+ :body => post_body,
2042
+ :use_read_transporter => false
2043
+ )
2044
+
2045
+ @api_client.call_api(:POST, path, new_options)
2046
+ end
2047
+
2048
+ # Add or update a record.
2049
+ # Add a record (object) to an index or replace it. If the record doesn't contain an `objectID`, Algolia automatically adds it. If you use an existing `objectID`, the existing record is replaced with the new one. To add multiple records to your index in a single API request, use the [`batch` operation](#tag/Records/operation/batch).
2050
+ # @param index_name [String] Index on which to perform the request. (required)
2051
+ # @param body [Object] The Algolia record. (required)
2052
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2053
+ # @return [SaveObjectResponse]
2054
+ def save_object(index_name, body, request_options = {})
2055
+ response = save_object_with_http_info(index_name, body, request_options)
2056
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::SaveObjectResponse')
2057
+ end
2058
+
2059
+ # Create or update a rule.
2060
+ # To create or update more than one rule, use the [&#x60;batch&#x60; operation](#tag/Rules/operation/saveRules).
2061
+ # @param index_name [String] Index on which to perform the request. (required)
2062
+ # @param object_id [String] Unique identifier of a rule object. (required)
2063
+ # @param rule [Rule] (required)
2064
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
2065
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2066
+ # @return [Http::Response] the response
2067
+ def save_rule_with_http_info(index_name, object_id, rule, forward_to_replicas = nil, request_options = {})
2068
+ # verify the required parameter 'index_name' is set
2069
+ if @api_client.config.client_side_validation && index_name.nil?
2070
+ raise ArgumentError, "Parameter `index_name` is required when calling `save_rule`."
2071
+ end
2072
+ # verify the required parameter 'object_id' is set
2073
+ if @api_client.config.client_side_validation && object_id.nil?
2074
+ raise ArgumentError, "Parameter `object_id` is required when calling `save_rule`."
2075
+ end
2076
+ # verify the required parameter 'rule' is set
2077
+ if @api_client.config.client_side_validation && rule.nil?
2078
+ raise ArgumentError, "Parameter `rule` is required when calling `save_rule`."
2079
+ end
2080
+
2081
+ path = '/1/indexes/{indexName}/rules/{objectID}'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
2082
+ @api_client.encode_uri(object_id.to_s))
2083
+ query_params = {}
2084
+ query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
2085
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2086
+ header_params = {}
2087
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2088
+
2089
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(rule)
2090
+
2091
+ new_options = request_options.merge(
2092
+ :operation => :'SearchClient.save_rule',
2093
+ :header_params => header_params,
2094
+ :query_params => query_params,
2095
+ :body => post_body,
2096
+ :use_read_transporter => false
2097
+ )
2098
+
2099
+ @api_client.call_api(:PUT, path, new_options)
2100
+ end
2101
+
2102
+ # Create or update a rule.
2103
+ # To create or update more than one rule, use the [`batch` operation](#tag/Rules/operation/saveRules).
2104
+ # @param index_name [String] Index on which to perform the request. (required)
2105
+ # @param object_id [String] Unique identifier of a rule object. (required)
2106
+ # @param rule [Rule] (required)
2107
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
2108
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2109
+ # @return [UpdatedRuleResponse]
2110
+ def save_rule(index_name, object_id, rule, forward_to_replicas = nil, request_options = {})
2111
+ response = save_rule_with_http_info(index_name, object_id, rule, forward_to_replicas, request_options)
2112
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedRuleResponse')
2113
+ end
2114
+
2115
+ # Save a batch of rules.
2116
+ # Create or update multiple rules.
2117
+ # @param index_name [String] Index on which to perform the request. (required)
2118
+ # @param rules [Array<Rule>] (required)
2119
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
2120
+ # @param clear_existing_rules [Boolean] Indicates whether existing rules should be deleted before adding this batch.
2121
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2122
+ # @return [Http::Response] the response
2123
+ def save_rules_with_http_info(index_name, rules, forward_to_replicas = nil, clear_existing_rules = nil, request_options = {})
2124
+ # verify the required parameter 'index_name' is set
2125
+ if @api_client.config.client_side_validation && index_name.nil?
2126
+ raise ArgumentError, "Parameter `index_name` is required when calling `save_rules`."
2127
+ end
2128
+ # verify the required parameter 'rules' is set
2129
+ if @api_client.config.client_side_validation && rules.nil?
2130
+ raise ArgumentError, "Parameter `rules` is required when calling `save_rules`."
2131
+ end
2132
+
2133
+ path = '/1/indexes/{indexName}/rules/batch'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
2134
+ query_params = {}
2135
+ query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
2136
+ query_params[:clearExistingRules] = clear_existing_rules unless clear_existing_rules.nil?
2137
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2138
+ header_params = {}
2139
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2140
+
2141
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(rules)
2142
+
2143
+ new_options = request_options.merge(
2144
+ :operation => :'SearchClient.save_rules',
2145
+ :header_params => header_params,
2146
+ :query_params => query_params,
2147
+ :body => post_body,
2148
+ :use_read_transporter => false
2149
+ )
2150
+
2151
+ @api_client.call_api(:POST, path, new_options)
2152
+ end
2153
+
2154
+ # Save a batch of rules.
2155
+ # Create or update multiple rules.
2156
+ # @param index_name [String] Index on which to perform the request. (required)
2157
+ # @param rules [Array<Rule>] (required)
2158
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
2159
+ # @param clear_existing_rules [Boolean] Indicates whether existing rules should be deleted before adding this batch.
2160
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2161
+ # @return [UpdatedAtResponse]
2162
+ def save_rules(index_name, rules, forward_to_replicas = nil, clear_existing_rules = nil, request_options = {})
2163
+ response = save_rules_with_http_info(index_name, rules, forward_to_replicas, clear_existing_rules, request_options)
2164
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
2165
+ end
2166
+
2167
+ # Save a synonym.
2168
+ # Add a [synonym](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#the-different-types-of-synonyms) to an index or replace it. If the synonym &#x60;objectID&#x60; doesn&#39;t exist, Algolia adds a new one. If you use an existing synonym &#x60;objectID&#x60;, the existing synonym is replaced with the new one. To add multiple synonyms in a single API request, use the [&#x60;batch&#x60; operation](#tag/Synonyms/operation/saveSynonyms).
2169
+ # @param index_name [String] Index on which to perform the request. (required)
2170
+ # @param object_id [String] Unique identifier of a synonym object. (required)
2171
+ # @param synonym_hit [SynonymHit] (required)
2172
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
2173
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2174
+ # @return [Http::Response] the response
2175
+ def save_synonym_with_http_info(index_name, object_id, synonym_hit, forward_to_replicas = nil, request_options = {})
2176
+ # verify the required parameter 'index_name' is set
2177
+ if @api_client.config.client_side_validation && index_name.nil?
2178
+ raise ArgumentError, "Parameter `index_name` is required when calling `save_synonym`."
2179
+ end
2180
+ # verify the required parameter 'object_id' is set
2181
+ if @api_client.config.client_side_validation && object_id.nil?
2182
+ raise ArgumentError, "Parameter `object_id` is required when calling `save_synonym`."
2183
+ end
2184
+ # verify the required parameter 'synonym_hit' is set
2185
+ if @api_client.config.client_side_validation && synonym_hit.nil?
2186
+ raise ArgumentError, "Parameter `synonym_hit` is required when calling `save_synonym`."
2187
+ end
2188
+
2189
+ path = '/1/indexes/{indexName}/synonyms/{objectID}'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
2190
+ @api_client.encode_uri(object_id.to_s))
2191
+ query_params = {}
2192
+ query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
2193
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2194
+ header_params = {}
2195
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2196
+
2197
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(synonym_hit)
2198
+
2199
+ new_options = request_options.merge(
2200
+ :operation => :'SearchClient.save_synonym',
2201
+ :header_params => header_params,
2202
+ :query_params => query_params,
2203
+ :body => post_body,
2204
+ :use_read_transporter => false
2205
+ )
2206
+
2207
+ @api_client.call_api(:PUT, path, new_options)
2208
+ end
2209
+
2210
+ # Save a synonym.
2211
+ # Add a [synonym](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#the-different-types-of-synonyms) to an index or replace it. If the synonym `objectID` doesn't exist, Algolia adds a new one. If you use an existing synonym `objectID`, the existing synonym is replaced with the new one. To add multiple synonyms in a single API request, use the [`batch` operation](#tag/Synonyms/operation/saveSynonyms).
2212
+ # @param index_name [String] Index on which to perform the request. (required)
2213
+ # @param object_id [String] Unique identifier of a synonym object. (required)
2214
+ # @param synonym_hit [SynonymHit] (required)
2215
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
2216
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2217
+ # @return [SaveSynonymResponse]
2218
+ def save_synonym(index_name, object_id, synonym_hit, forward_to_replicas = nil, request_options = {})
2219
+ response = save_synonym_with_http_info(index_name, object_id, synonym_hit, forward_to_replicas, request_options)
2220
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::SaveSynonymResponse')
2221
+ end
2222
+
2223
+ # Save a batch of synonyms.
2224
+ # Create or update multiple synonyms.
2225
+ # @param index_name [String] Index on which to perform the request. (required)
2226
+ # @param synonym_hit [Array<SynonymHit>] (required)
2227
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
2228
+ # @param replace_existing_synonyms [Boolean] Indicates whether to replace all synonyms in the index with the ones sent with this request.
2229
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2230
+ # @return [Http::Response] the response
2231
+ def save_synonyms_with_http_info(index_name, synonym_hit, forward_to_replicas = nil, replace_existing_synonyms = nil, request_options = {})
2232
+ # verify the required parameter 'index_name' is set
2233
+ if @api_client.config.client_side_validation && index_name.nil?
2234
+ raise ArgumentError, "Parameter `index_name` is required when calling `save_synonyms`."
2235
+ end
2236
+ # verify the required parameter 'synonym_hit' is set
2237
+ if @api_client.config.client_side_validation && synonym_hit.nil?
2238
+ raise ArgumentError, "Parameter `synonym_hit` is required when calling `save_synonyms`."
2239
+ end
2240
+
2241
+ path = '/1/indexes/{indexName}/synonyms/batch'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
2242
+ query_params = {}
2243
+ query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
2244
+ query_params[:replaceExistingSynonyms] = replace_existing_synonyms unless replace_existing_synonyms.nil?
2245
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2246
+ header_params = {}
2247
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2248
+
2249
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(synonym_hit)
2250
+
2251
+ new_options = request_options.merge(
2252
+ :operation => :'SearchClient.save_synonyms',
2253
+ :header_params => header_params,
2254
+ :query_params => query_params,
2255
+ :body => post_body,
2256
+ :use_read_transporter => false
2257
+ )
2258
+
2259
+ @api_client.call_api(:POST, path, new_options)
2260
+ end
2261
+
2262
+ # Save a batch of synonyms.
2263
+ # Create or update multiple synonyms.
2264
+ # @param index_name [String] Index on which to perform the request. (required)
2265
+ # @param synonym_hit [Array<SynonymHit>] (required)
2266
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
2267
+ # @param replace_existing_synonyms [Boolean] Indicates whether to replace all synonyms in the index with the ones sent with this request.
2268
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2269
+ # @return [UpdatedAtResponse]
2270
+ def save_synonyms(index_name, synonym_hit, forward_to_replicas = nil, replace_existing_synonyms = nil, request_options = {})
2271
+ response = save_synonyms_with_http_info(index_name, synonym_hit, forward_to_replicas, replace_existing_synonyms, request_options)
2272
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
2273
+ end
2274
+
2275
+ # Search multiple indices.
2276
+ # Send multiple search queries to one or more indices.
2277
+ # @param search_method_params [SearchMethodParams] Query requests and strategies. Results will be received in the same order as the queries. (required)
2278
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2279
+ # @return [Http::Response] the response
2280
+ def search_with_http_info(search_method_params, request_options = {})
2281
+ # verify the required parameter 'search_method_params' is set
2282
+ if @api_client.config.client_side_validation && search_method_params.nil?
2283
+ raise ArgumentError, "Parameter `search_method_params` is required when calling `search`."
2284
+ end
2285
+
2286
+ path = '/1/indexes/*/queries'
2287
+ query_params = {}
2288
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2289
+ header_params = {}
2290
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2291
+
2292
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(search_method_params)
2293
+
2294
+ new_options = request_options.merge(
2295
+ :operation => :'SearchClient.search',
2296
+ :header_params => header_params,
2297
+ :query_params => query_params,
2298
+ :body => post_body,
2299
+ :use_read_transporter => false
2300
+ )
2301
+
2302
+ @api_client.call_api(:POST, path, new_options)
2303
+ end
2304
+
2305
+ # Search multiple indices.
2306
+ # Send multiple search queries to one or more indices.
2307
+ # @param search_method_params [SearchMethodParams] Query requests and strategies. Results will be received in the same order as the queries. (required)
2308
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2309
+ # @return [SearchResponses]
2310
+ def search(search_method_params, request_options = {})
2311
+ response = search_with_http_info(search_method_params, request_options)
2312
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::SearchResponses')
2313
+ end
2314
+
2315
+ # Search dictionary entries.
2316
+ # Search for standard and [custom](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-stop-words/) entries in the [stop words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-stop-words/), [plurals](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-plurals-and-other-declensions/), or [segmentation (compounds)](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-segmentation/) dictionaries.
2317
+ # @param dictionary_name [DictionaryType] Dictionary to search in. (required)
2318
+ # @param search_dictionary_entries_params [SearchDictionaryEntriesParams] (required)
2319
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2320
+ # @return [Http::Response] the response
2321
+ def search_dictionary_entries_with_http_info(dictionary_name, search_dictionary_entries_params, request_options = {})
2322
+ # verify the required parameter 'dictionary_name' is set
2323
+ if @api_client.config.client_side_validation && dictionary_name.nil?
2324
+ raise ArgumentError, "Parameter `dictionary_name` is required when calling `search_dictionary_entries`."
2325
+ end
2326
+ # verify the required parameter 'search_dictionary_entries_params' is set
2327
+ if @api_client.config.client_side_validation && search_dictionary_entries_params.nil?
2328
+ raise ArgumentError, "Parameter `search_dictionary_entries_params` is required when calling `search_dictionary_entries`."
2329
+ end
2330
+
2331
+ path = '/1/dictionaries/{dictionaryName}/search'.sub('{' + 'dictionaryName' + '}', @api_client.encode_uri(dictionary_name.to_s))
2332
+ query_params = {}
2333
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2334
+ header_params = {}
2335
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2336
+
2337
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(search_dictionary_entries_params)
2338
+
2339
+ new_options = request_options.merge(
2340
+ :operation => :'SearchClient.search_dictionary_entries',
2341
+ :header_params => header_params,
2342
+ :query_params => query_params,
2343
+ :body => post_body,
2344
+ :use_read_transporter => false
2345
+ )
2346
+
2347
+ @api_client.call_api(:POST, path, new_options)
2348
+ end
2349
+
2350
+ # Search dictionary entries.
2351
+ # Search for standard and [custom](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-stop-words/) entries in the [stop words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-stop-words/), [plurals](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-plurals-and-other-declensions/), or [segmentation (compounds)](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-segmentation/) dictionaries.
2352
+ # @param dictionary_name [DictionaryType] Dictionary to search in. (required)
2353
+ # @param search_dictionary_entries_params [SearchDictionaryEntriesParams] (required)
2354
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2355
+ # @return [UpdatedAtResponse]
2356
+ def search_dictionary_entries(dictionary_name, search_dictionary_entries_params, request_options = {})
2357
+ response = search_dictionary_entries_with_http_info(dictionary_name, search_dictionary_entries_params, request_options)
2358
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
2359
+ end
2360
+
2361
+ # Search for facet values.
2362
+ # [Search for a facet&#39;s values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values), optionally restricting the returned values to those contained in records matching other search criteria. &gt; **Note**: Pagination isn&#39;t supported (&#x60;page&#x60; and &#x60;hitsPerPage&#x60; are ignored). By default, the engine returns a maximum of 10 values but you can adjust this with &#x60;maxFacetHits&#x60;.
2363
+ # @param index_name [String] Index on which to perform the request. (required)
2364
+ # @param facet_name [String] Facet name. (required)
2365
+ # @param search_for_facet_values_request [SearchForFacetValuesRequest]
2366
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2367
+ # @return [Http::Response] the response
2368
+ def search_for_facet_values_with_http_info(index_name, facet_name, search_for_facet_values_request = nil, request_options = {})
2369
+ # verify the required parameter 'index_name' is set
2370
+ if @api_client.config.client_side_validation && index_name.nil?
2371
+ raise ArgumentError, "Parameter `index_name` is required when calling `search_for_facet_values`."
2372
+ end
2373
+ # verify the required parameter 'facet_name' is set
2374
+ if @api_client.config.client_side_validation && facet_name.nil?
2375
+ raise ArgumentError, "Parameter `facet_name` is required when calling `search_for_facet_values`."
2376
+ end
2377
+
2378
+ path = '/1/indexes/{indexName}/facets/{facetName}/query'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s)).sub('{' + 'facetName' + '}',
2379
+ @api_client.encode_uri(facet_name.to_s))
2380
+ query_params = {}
2381
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2382
+ header_params = {}
2383
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2384
+
2385
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(search_for_facet_values_request)
2386
+
2387
+ new_options = request_options.merge(
2388
+ :operation => :'SearchClient.search_for_facet_values',
2389
+ :header_params => header_params,
2390
+ :query_params => query_params,
2391
+ :body => post_body,
2392
+ :use_read_transporter => false
2393
+ )
2394
+
2395
+ @api_client.call_api(:POST, path, new_options)
2396
+ end
2397
+
2398
+ # Search for facet values.
2399
+ # [Search for a facet's values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values), optionally restricting the returned values to those contained in records matching other search criteria. > **Note**: Pagination isn't supported (`page` and `hitsPerPage` are ignored). By default, the engine returns a maximum of 10 values but you can adjust this with `maxFacetHits`.
2400
+ # @param index_name [String] Index on which to perform the request. (required)
2401
+ # @param facet_name [String] Facet name. (required)
2402
+ # @param search_for_facet_values_request [SearchForFacetValuesRequest]
2403
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2404
+ # @return [SearchForFacetValuesResponse]
2405
+ def search_for_facet_values(index_name, facet_name, search_for_facet_values_request = nil, request_options = {})
2406
+ response = search_for_facet_values_with_http_info(index_name, facet_name, search_for_facet_values_request, request_options)
2407
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::SearchForFacetValuesResponse')
2408
+ end
2409
+
2410
+ # Search for rules.
2411
+ # Search for rules in your index. You can control the search with parameters. To list all rules, send an empty request body.
2412
+ # @param index_name [String] Index on which to perform the request. (required)
2413
+ # @param search_rules_params [SearchRulesParams]
2414
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2415
+ # @return [Http::Response] the response
2416
+ def search_rules_with_http_info(index_name, search_rules_params = nil, request_options = {})
2417
+ # verify the required parameter 'index_name' is set
2418
+ if @api_client.config.client_side_validation && index_name.nil?
2419
+ raise ArgumentError, "Parameter `index_name` is required when calling `search_rules`."
2420
+ end
2421
+
2422
+ path = '/1/indexes/{indexName}/rules/search'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
2423
+ query_params = {}
2424
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2425
+ header_params = {}
2426
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2427
+
2428
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(search_rules_params)
2429
+
2430
+ new_options = request_options.merge(
2431
+ :operation => :'SearchClient.search_rules',
2432
+ :header_params => header_params,
2433
+ :query_params => query_params,
2434
+ :body => post_body,
2435
+ :use_read_transporter => false
2436
+ )
2437
+
2438
+ @api_client.call_api(:POST, path, new_options)
2439
+ end
2440
+
2441
+ # Search for rules.
2442
+ # Search for rules in your index. You can control the search with parameters. To list all rules, send an empty request body.
2443
+ # @param index_name [String] Index on which to perform the request. (required)
2444
+ # @param search_rules_params [SearchRulesParams]
2445
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2446
+ # @return [SearchRulesResponse]
2447
+ def search_rules(index_name, search_rules_params = nil, request_options = {})
2448
+ response = search_rules_with_http_info(index_name, search_rules_params, request_options)
2449
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::SearchRulesResponse')
2450
+ end
2451
+
2452
+ # Search an index.
2453
+ # Return records that match the query.
2454
+ # @param index_name [String] Index on which to perform the request. (required)
2455
+ # @param search_params [SearchParams]
2456
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2457
+ # @return [Http::Response] the response
2458
+ def search_single_index_with_http_info(index_name, search_params = nil, request_options = {})
2459
+ # verify the required parameter 'index_name' is set
2460
+ if @api_client.config.client_side_validation && index_name.nil?
2461
+ raise ArgumentError, "Parameter `index_name` is required when calling `search_single_index`."
2462
+ end
2463
+
2464
+ path = '/1/indexes/{indexName}/query'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
2465
+ query_params = {}
2466
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2467
+ header_params = {}
2468
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2469
+
2470
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(search_params)
2471
+
2472
+ new_options = request_options.merge(
2473
+ :operation => :'SearchClient.search_single_index',
2474
+ :header_params => header_params,
2475
+ :query_params => query_params,
2476
+ :body => post_body,
2477
+ :use_read_transporter => false
2478
+ )
2479
+
2480
+ @api_client.call_api(:POST, path, new_options)
2481
+ end
2482
+
2483
+ # Search an index.
2484
+ # Return records that match the query.
2485
+ # @param index_name [String] Index on which to perform the request. (required)
2486
+ # @param search_params [SearchParams]
2487
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2488
+ # @return [SearchResponse]
2489
+ def search_single_index(index_name, search_params = nil, request_options = {})
2490
+ response = search_single_index_with_http_info(index_name, search_params, request_options)
2491
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::SearchResponse')
2492
+ end
2493
+
2494
+ # Search for synonyms.
2495
+ # Search for synonyms in your index. You can control and filter the search with parameters. To get all synonyms, send an empty request body.
2496
+ # @param index_name [String] Index on which to perform the request. (required)
2497
+ # @param type [SynonymType] Search for specific [types of synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#the-different-types-of-synonyms).
2498
+ # @param page [Integer] Returns the requested page number (the first page is 0). Page size is set by &#x60;hitsPerPage&#x60;. When null, there&#39;s no pagination. (default to 0)
2499
+ # @param hits_per_page [Integer] Maximum number of hits per page. (default to 100)
2500
+ # @param search_synonyms_params [SearchSynonymsParams] Body of the &#x60;searchSynonyms&#x60; operation.
2501
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2502
+ # @return [Http::Response] the response
2503
+ def search_synonyms_with_http_info(index_name, type = nil, page = nil, hits_per_page = nil, search_synonyms_params = nil, request_options = {})
2504
+ # verify the required parameter 'index_name' is set
2505
+ if @api_client.config.client_side_validation && index_name.nil?
2506
+ raise ArgumentError, "Parameter `index_name` is required when calling `search_synonyms`."
2507
+ end
2508
+ if @api_client.config.client_side_validation && !page.nil? && page < 0
2509
+ raise ArgumentError, 'invalid value for ""page"" when calling SearchClient.search_synonyms, must be greater than or equal to 0.'
2510
+ end
2511
+
2512
+ path = '/1/indexes/{indexName}/synonyms/search'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
2513
+ query_params = {}
2514
+ query_params[:type] = type unless type.nil?
2515
+ query_params[:page] = page unless page.nil?
2516
+ query_params[:hitsPerPage] = hits_per_page unless hits_per_page.nil?
2517
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2518
+ header_params = {}
2519
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2520
+
2521
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(search_synonyms_params)
2522
+
2523
+ new_options = request_options.merge(
2524
+ :operation => :'SearchClient.search_synonyms',
2525
+ :header_params => header_params,
2526
+ :query_params => query_params,
2527
+ :body => post_body,
2528
+ :use_read_transporter => false
2529
+ )
2530
+
2531
+ @api_client.call_api(:POST, path, new_options)
2532
+ end
2533
+
2534
+ # Search for synonyms.
2535
+ # Search for synonyms in your index. You can control and filter the search with parameters. To get all synonyms, send an empty request body.
2536
+ # @param index_name [String] Index on which to perform the request. (required)
2537
+ # @param type [SynonymType] Search for specific [types of synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#the-different-types-of-synonyms).
2538
+ # @param page [Integer] Returns the requested page number (the first page is 0). Page size is set by &#x60;hitsPerPage&#x60;. When null, there&#39;s no pagination. (default to 0)
2539
+ # @param hits_per_page [Integer] Maximum number of hits per page. (default to 100)
2540
+ # @param search_synonyms_params [SearchSynonymsParams] Body of the &#x60;searchSynonyms&#x60; operation.
2541
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2542
+ # @return [SearchSynonymsResponse]
2543
+ def search_synonyms(index_name, type = nil, page = nil, hits_per_page = nil, search_synonyms_params = nil, request_options = {})
2544
+ response = search_synonyms_with_http_info(index_name, type, page, hits_per_page, search_synonyms_params, request_options)
2545
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::SearchSynonymsResponse')
2546
+ end
2547
+
2548
+ # Search for a user ID.
2549
+ # Since it can take up to a few seconds to get the data from the different clusters, the response isn&#39;t real-time. To ensure rapid updates, the user IDs index isn&#39;t built at the same time as the mapping. Instead, it&#39;s built every 12 hours, at the same time as the update of user ID usage. For example, if you add or move a user ID, the search will show an old value until the next time the mapping is rebuilt (every 12 hours).
2550
+ # @param search_user_ids_params [SearchUserIdsParams] (required)
2551
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2552
+ # @return [Http::Response] the response
2553
+ def search_user_ids_with_http_info(search_user_ids_params, request_options = {})
2554
+ # verify the required parameter 'search_user_ids_params' is set
2555
+ if @api_client.config.client_side_validation && search_user_ids_params.nil?
2556
+ raise ArgumentError, "Parameter `search_user_ids_params` is required when calling `search_user_ids`."
2557
+ end
2558
+
2559
+ path = '/1/clusters/mapping/search'
2560
+ query_params = {}
2561
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2562
+ header_params = {}
2563
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2564
+
2565
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(search_user_ids_params)
2566
+
2567
+ new_options = request_options.merge(
2568
+ :operation => :'SearchClient.search_user_ids',
2569
+ :header_params => header_params,
2570
+ :query_params => query_params,
2571
+ :body => post_body,
2572
+ :use_read_transporter => false
2573
+ )
2574
+
2575
+ @api_client.call_api(:POST, path, new_options)
2576
+ end
2577
+
2578
+ # Search for a user ID.
2579
+ # Since it can take up to a few seconds to get the data from the different clusters, the response isn't real-time. To ensure rapid updates, the user IDs index isn't built at the same time as the mapping. Instead, it's built every 12 hours, at the same time as the update of user ID usage. For example, if you add or move a user ID, the search will show an old value until the next time the mapping is rebuilt (every 12 hours).
2580
+ # @param search_user_ids_params [SearchUserIdsParams] (required)
2581
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2582
+ # @return [SearchUserIdsResponse]
2583
+ def search_user_ids(search_user_ids_params, request_options = {})
2584
+ response = search_user_ids_with_http_info(search_user_ids_params, request_options)
2585
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::SearchUserIdsResponse')
2586
+ end
2587
+
2588
+ # Set stop word settings.
2589
+ # Set stop word settings for a specific language.
2590
+ # @param dictionary_settings_params [DictionarySettingsParams] (required)
2591
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2592
+ # @return [Http::Response] the response
2593
+ def set_dictionary_settings_with_http_info(dictionary_settings_params, request_options = {})
2594
+ # verify the required parameter 'dictionary_settings_params' is set
2595
+ if @api_client.config.client_side_validation && dictionary_settings_params.nil?
2596
+ raise ArgumentError, "Parameter `dictionary_settings_params` is required when calling `set_dictionary_settings`."
2597
+ end
2598
+
2599
+ path = '/1/dictionaries/*/settings'
2600
+ query_params = {}
2601
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2602
+ header_params = {}
2603
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2604
+
2605
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(dictionary_settings_params)
2606
+
2607
+ new_options = request_options.merge(
2608
+ :operation => :'SearchClient.set_dictionary_settings',
2609
+ :header_params => header_params,
2610
+ :query_params => query_params,
2611
+ :body => post_body,
2612
+ :use_read_transporter => false
2613
+ )
2614
+
2615
+ @api_client.call_api(:PUT, path, new_options)
2616
+ end
2617
+
2618
+ # Set stop word settings.
2619
+ # Set stop word settings for a specific language.
2620
+ # @param dictionary_settings_params [DictionarySettingsParams] (required)
2621
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2622
+ # @return [UpdatedAtResponse]
2623
+ def set_dictionary_settings(dictionary_settings_params, request_options = {})
2624
+ response = set_dictionary_settings_with_http_info(dictionary_settings_params, request_options)
2625
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
2626
+ end
2627
+
2628
+ # Update index settings.
2629
+ # Update the specified [index settings](https://www.algolia.com/doc/api-reference/settings-api-parameters/). Specifying null for a setting resets it to its default value.
2630
+ # @param index_name [String] Index on which to perform the request. (required)
2631
+ # @param index_settings [IndexSettings] (required)
2632
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
2633
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2634
+ # @return [Http::Response] the response
2635
+ def set_settings_with_http_info(index_name, index_settings, forward_to_replicas = nil, request_options = {})
2636
+ # verify the required parameter 'index_name' is set
2637
+ if @api_client.config.client_side_validation && index_name.nil?
2638
+ raise ArgumentError, "Parameter `index_name` is required when calling `set_settings`."
2639
+ end
2640
+ # verify the required parameter 'index_settings' is set
2641
+ if @api_client.config.client_side_validation && index_settings.nil?
2642
+ raise ArgumentError, "Parameter `index_settings` is required when calling `set_settings`."
2643
+ end
2644
+
2645
+ path = '/1/indexes/{indexName}/settings'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
2646
+ query_params = {}
2647
+ query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
2648
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2649
+ header_params = {}
2650
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2651
+
2652
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(index_settings)
2653
+
2654
+ new_options = request_options.merge(
2655
+ :operation => :'SearchClient.set_settings',
2656
+ :header_params => header_params,
2657
+ :query_params => query_params,
2658
+ :body => post_body,
2659
+ :use_read_transporter => false
2660
+ )
2661
+
2662
+ @api_client.call_api(:PUT, path, new_options)
2663
+ end
2664
+
2665
+ # Update index settings.
2666
+ # Update the specified [index settings](https://www.algolia.com/doc/api-reference/settings-api-parameters/). Specifying null for a setting resets it to its default value.
2667
+ # @param index_name [String] Index on which to perform the request. (required)
2668
+ # @param index_settings [IndexSettings] (required)
2669
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
2670
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2671
+ # @return [UpdatedAtResponse]
2672
+ def set_settings(index_name, index_settings, forward_to_replicas = nil, request_options = {})
2673
+ response = set_settings_with_http_info(index_name, index_settings, forward_to_replicas, request_options)
2674
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
2675
+ end
2676
+
2677
+ # Update an API key.
2678
+ # Replace the permissions of an existing API key. Any unspecified parameter resets that permission to its default value. The request must be authenticated with the admin API key.
2679
+ # @param key [String] API key. (required)
2680
+ # @param api_key [ApiKey] (required)
2681
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2682
+ # @return [Http::Response] the response
2683
+ def update_api_key_with_http_info(key, api_key, request_options = {})
2684
+ # verify the required parameter 'key' is set
2685
+ if @api_client.config.client_side_validation && key.nil?
2686
+ raise ArgumentError, "Parameter `key` is required when calling `update_api_key`."
2687
+ end
2688
+ # verify the required parameter 'api_key' is set
2689
+ if @api_client.config.client_side_validation && api_key.nil?
2690
+ raise ArgumentError, "Parameter `api_key` is required when calling `update_api_key`."
2691
+ end
2692
+
2693
+ path = '/1/keys/{key}'.sub('{' + 'key' + '}', @api_client.encode_uri(key.to_s))
2694
+ query_params = {}
2695
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2696
+ header_params = {}
2697
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2698
+
2699
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(api_key)
2700
+
2701
+ new_options = request_options.merge(
2702
+ :operation => :'SearchClient.update_api_key',
2703
+ :header_params => header_params,
2704
+ :query_params => query_params,
2705
+ :body => post_body,
2706
+ :use_read_transporter => false
2707
+ )
2708
+
2709
+ @api_client.call_api(:PUT, path, new_options)
2710
+ end
2711
+
2712
+ # Update an API key.
2713
+ # Replace the permissions of an existing API key. Any unspecified parameter resets that permission to its default value. The request must be authenticated with the admin API key.
2714
+ # @param key [String] API key. (required)
2715
+ # @param api_key [ApiKey] (required)
2716
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2717
+ # @return [UpdateApiKeyResponse]
2718
+ def update_api_key(key, api_key, request_options = {})
2719
+ response = update_api_key_with_http_info(key, api_key, request_options)
2720
+ deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdateApiKeyResponse')
2721
+ end
2722
+ end
2723
+ end