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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (421) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/VERSION +1 -1
  3. data/CHANGELOG.md +17 -0
  4. data/Gemfile.lock +12 -12
  5. data/algolia.gemspec +2 -1
  6. data/lib/algolia/api/abtesting_client.rb +50 -30
  7. data/lib/algolia/api/analytics_client.rb +132 -64
  8. data/lib/algolia/api/ingestion_client.rb +371 -131
  9. data/lib/algolia/api/insights_client.rb +18 -18
  10. data/lib/algolia/api/monitoring_client.rb +46 -53
  11. data/lib/algolia/api/personalization_client.rb +42 -26
  12. data/lib/algolia/api/query_suggestions_client.rb +66 -38
  13. data/lib/algolia/api/recommend_client.rb +57 -38
  14. data/lib/algolia/api/search_client.rb +625 -280
  15. data/lib/algolia/api_client.rb +2 -5
  16. data/lib/algolia/models/abtesting/ab_test.rb +14 -4
  17. data/lib/algolia/models/abtesting/ab_test_response.rb +7 -3
  18. data/lib/algolia/models/abtesting/ab_tests_variant.rb +7 -3
  19. data/lib/algolia/models/abtesting/ab_tests_variant_search_params.rb +7 -3
  20. data/lib/algolia/models/abtesting/add_ab_tests_request.rb +7 -3
  21. data/lib/algolia/models/abtesting/add_ab_tests_variant.rb +1 -1
  22. data/lib/algolia/models/abtesting/currencies_value.rb +7 -3
  23. data/lib/algolia/models/abtesting/custom_search_params.rb +7 -3
  24. data/lib/algolia/models/abtesting/error_base.rb +13 -4
  25. data/lib/algolia/models/abtesting/filter_effects.rb +7 -3
  26. data/lib/algolia/models/abtesting/filter_effects_empty_search.rb +7 -3
  27. data/lib/algolia/models/abtesting/filter_effects_outliers.rb +7 -3
  28. data/lib/algolia/models/abtesting/list_ab_tests_response.rb +10 -4
  29. data/lib/algolia/models/abtesting/variant.rb +46 -11
  30. data/lib/algolia/models/analytics/average_click_event.rb +7 -3
  31. data/lib/algolia/models/analytics/click_position.rb +7 -3
  32. data/lib/algolia/models/analytics/click_through_rate_event.rb +10 -4
  33. data/lib/algolia/models/analytics/conversion_rate_event.rb +10 -4
  34. data/lib/algolia/models/analytics/error_base.rb +13 -4
  35. data/lib/algolia/models/analytics/get_average_click_position_response.rb +7 -3
  36. data/lib/algolia/models/analytics/get_click_positions_response.rb +7 -3
  37. data/lib/algolia/models/analytics/get_click_through_rate_response.rb +10 -4
  38. data/lib/algolia/models/analytics/get_conversation_rate_response.rb +10 -4
  39. data/lib/algolia/models/analytics/get_no_click_rate_response.rb +7 -3
  40. data/lib/algolia/models/analytics/get_no_results_rate_response.rb +7 -3
  41. data/lib/algolia/models/analytics/get_searches_count_response.rb +7 -3
  42. data/lib/algolia/models/analytics/get_searches_no_clicks_response.rb +7 -3
  43. data/lib/algolia/models/analytics/get_searches_no_results_response.rb +7 -3
  44. data/lib/algolia/models/analytics/get_status_response.rb +7 -3
  45. data/lib/algolia/models/analytics/get_top_countries_response.rb +7 -3
  46. data/lib/algolia/models/analytics/get_top_filter_attribute.rb +7 -3
  47. data/lib/algolia/models/analytics/get_top_filter_attributes_response.rb +7 -3
  48. data/lib/algolia/models/analytics/get_top_filter_for_attribute.rb +7 -3
  49. data/lib/algolia/models/analytics/get_top_filter_for_attribute_response.rb +7 -3
  50. data/lib/algolia/models/analytics/get_top_filters_no_results_response.rb +7 -3
  51. data/lib/algolia/models/analytics/get_top_filters_no_results_value.rb +7 -3
  52. data/lib/algolia/models/analytics/get_top_filters_no_results_values.rb +7 -3
  53. data/lib/algolia/models/analytics/get_top_hits_response.rb +1 -1
  54. data/lib/algolia/models/analytics/get_top_searches_response.rb +1 -1
  55. data/lib/algolia/models/analytics/get_users_count_response.rb +7 -3
  56. data/lib/algolia/models/analytics/no_click_rate_event.rb +7 -3
  57. data/lib/algolia/models/analytics/no_results_rate_event.rb +7 -3
  58. data/lib/algolia/models/analytics/search_event.rb +7 -3
  59. data/lib/algolia/models/analytics/search_no_click_event.rb +7 -3
  60. data/lib/algolia/models/analytics/search_no_result_event.rb +7 -3
  61. data/lib/algolia/models/analytics/top_country.rb +7 -3
  62. data/lib/algolia/models/analytics/top_hit.rb +7 -3
  63. data/lib/algolia/models/analytics/top_hit_with_analytics.rb +10 -4
  64. data/lib/algolia/models/analytics/top_hits_response.rb +7 -3
  65. data/lib/algolia/models/analytics/top_hits_response_with_analytics.rb +7 -3
  66. data/lib/algolia/models/analytics/top_search.rb +7 -3
  67. data/lib/algolia/models/analytics/top_search_with_analytics.rb +10 -4
  68. data/lib/algolia/models/analytics/top_searches_response.rb +7 -3
  69. data/lib/algolia/models/analytics/top_searches_response_with_analytics.rb +7 -3
  70. data/lib/algolia/models/analytics/user_with_date.rb +7 -3
  71. data/lib/algolia/models/ingestion/auth_algolia.rb +7 -3
  72. data/lib/algolia/models/ingestion/auth_algolia_partial.rb +7 -3
  73. data/lib/algolia/models/ingestion/auth_api_key.rb +7 -3
  74. data/lib/algolia/models/ingestion/auth_api_key_partial.rb +7 -3
  75. data/lib/algolia/models/ingestion/auth_basic.rb +7 -3
  76. data/lib/algolia/models/ingestion/auth_basic_partial.rb +7 -3
  77. data/lib/algolia/models/ingestion/auth_google_service_account.rb +7 -3
  78. data/lib/algolia/models/ingestion/auth_google_service_account_partial.rb +7 -3
  79. data/lib/algolia/models/ingestion/auth_input.rb +1 -1
  80. data/lib/algolia/models/ingestion/auth_input_partial.rb +1 -1
  81. data/lib/algolia/models/ingestion/auth_o_auth.rb +7 -3
  82. data/lib/algolia/models/ingestion/auth_o_auth_partial.rb +7 -3
  83. data/lib/algolia/models/ingestion/authentication.rb +7 -3
  84. data/lib/algolia/models/ingestion/authentication_create.rb +7 -3
  85. data/lib/algolia/models/ingestion/authentication_create_response.rb +7 -3
  86. data/lib/algolia/models/ingestion/authentication_search.rb +7 -3
  87. data/lib/algolia/models/ingestion/authentication_update.rb +7 -3
  88. data/lib/algolia/models/ingestion/authentication_update_response.rb +7 -3
  89. data/lib/algolia/models/ingestion/big_commerce_channel.rb +7 -3
  90. data/lib/algolia/models/ingestion/big_commerce_metafield.rb +7 -3
  91. data/lib/algolia/models/ingestion/delete_response.rb +7 -3
  92. data/lib/algolia/models/ingestion/destination.rb +7 -3
  93. data/lib/algolia/models/ingestion/destination_create.rb +7 -3
  94. data/lib/algolia/models/ingestion/destination_create_response.rb +7 -3
  95. data/lib/algolia/models/ingestion/destination_index_name.rb +7 -3
  96. data/lib/algolia/models/ingestion/destination_index_prefix.rb +7 -3
  97. data/lib/algolia/models/ingestion/destination_input.rb +1 -1
  98. data/lib/algolia/models/ingestion/destination_search.rb +7 -3
  99. data/lib/algolia/models/ingestion/destination_update.rb +7 -3
  100. data/lib/algolia/models/ingestion/destination_update_response.rb +7 -3
  101. data/lib/algolia/models/ingestion/docker_source_discover.rb +7 -3
  102. data/lib/algolia/models/ingestion/docker_source_streams.rb +7 -3
  103. data/lib/algolia/models/ingestion/error_base.rb +13 -4
  104. data/lib/algolia/models/ingestion/event.rb +7 -3
  105. data/lib/algolia/models/ingestion/list_authentications_response.rb +7 -3
  106. data/lib/algolia/models/ingestion/list_destinations_response.rb +7 -3
  107. data/lib/algolia/models/ingestion/list_events_response.rb +7 -3
  108. data/lib/algolia/models/ingestion/list_sources_response.rb +7 -3
  109. data/lib/algolia/models/ingestion/list_tasks_response.rb +7 -3
  110. data/lib/algolia/models/ingestion/on_demand_date_utils_input.rb +7 -3
  111. data/lib/algolia/models/ingestion/on_demand_trigger.rb +7 -3
  112. data/lib/algolia/models/ingestion/on_demand_trigger_input.rb +7 -3
  113. data/lib/algolia/models/ingestion/pagination.rb +7 -3
  114. data/lib/algolia/models/ingestion/platform_with_none.rb +1 -1
  115. data/lib/algolia/models/ingestion/run.rb +7 -3
  116. data/lib/algolia/models/ingestion/run_list_response.rb +7 -3
  117. data/lib/algolia/models/ingestion/run_progress.rb +7 -3
  118. data/lib/algolia/models/ingestion/run_response.rb +7 -3
  119. data/lib/algolia/models/ingestion/schedule_date_utils_input.rb +7 -3
  120. data/lib/algolia/models/ingestion/schedule_trigger.rb +7 -3
  121. data/lib/algolia/models/ingestion/schedule_trigger_input.rb +7 -3
  122. data/lib/algolia/models/ingestion/source.rb +7 -3
  123. data/lib/algolia/models/ingestion/source_big_commerce.rb +7 -3
  124. data/lib/algolia/models/ingestion/source_big_query.rb +7 -3
  125. data/lib/algolia/models/ingestion/source_commercetools.rb +7 -3
  126. data/lib/algolia/models/ingestion/source_create.rb +7 -3
  127. data/lib/algolia/models/ingestion/source_create_response.rb +7 -3
  128. data/lib/algolia/models/ingestion/source_csv.rb +7 -3
  129. data/lib/algolia/models/ingestion/source_docker.rb +7 -3
  130. data/lib/algolia/models/ingestion/source_input.rb +1 -1
  131. data/lib/algolia/models/ingestion/source_json.rb +7 -3
  132. data/lib/algolia/models/ingestion/source_search.rb +7 -3
  133. data/lib/algolia/models/ingestion/source_update.rb +7 -3
  134. data/lib/algolia/models/ingestion/source_update_commercetools.rb +7 -3
  135. data/lib/algolia/models/ingestion/source_update_docker.rb +7 -3
  136. data/lib/algolia/models/ingestion/source_update_input.rb +1 -1
  137. data/lib/algolia/models/ingestion/source_update_response.rb +7 -3
  138. data/lib/algolia/models/ingestion/subscription_trigger.rb +7 -3
  139. data/lib/algolia/models/ingestion/task.rb +7 -3
  140. data/lib/algolia/models/ingestion/task_create.rb +7 -3
  141. data/lib/algolia/models/ingestion/task_create_response.rb +7 -3
  142. data/lib/algolia/models/ingestion/task_create_trigger.rb +1 -1
  143. data/lib/algolia/models/ingestion/task_input.rb +1 -1
  144. data/lib/algolia/models/ingestion/task_search.rb +7 -3
  145. data/lib/algolia/models/ingestion/task_update.rb +7 -3
  146. data/lib/algolia/models/ingestion/task_update_response.rb +7 -3
  147. data/lib/algolia/models/ingestion/trigger.rb +1 -1
  148. data/lib/algolia/models/ingestion/trigger_update_input.rb +7 -3
  149. data/lib/algolia/models/ingestion/window.rb +7 -3
  150. data/lib/algolia/models/insights/added_to_cart_object_ids.rb +7 -3
  151. data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +7 -3
  152. data/lib/algolia/models/insights/clicked_filters.rb +7 -3
  153. data/lib/algolia/models/insights/clicked_object_ids.rb +7 -3
  154. data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +7 -3
  155. data/lib/algolia/models/insights/converted_filters.rb +7 -3
  156. data/lib/algolia/models/insights/converted_object_ids.rb +7 -3
  157. data/lib/algolia/models/insights/converted_object_ids_after_search.rb +7 -3
  158. data/lib/algolia/models/insights/discount.rb +1 -1
  159. data/lib/algolia/models/insights/error_base.rb +13 -4
  160. data/lib/algolia/models/insights/events_items.rb +1 -1
  161. data/lib/algolia/models/insights/events_response.rb +7 -3
  162. data/lib/algolia/models/insights/insights_events.rb +7 -3
  163. data/lib/algolia/models/insights/object_data.rb +7 -3
  164. data/lib/algolia/models/insights/object_data_after_search.rb +7 -3
  165. data/lib/algolia/models/insights/price.rb +1 -1
  166. data/lib/algolia/models/insights/purchased_object_ids.rb +7 -3
  167. data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +7 -3
  168. data/lib/algolia/models/insights/value.rb +1 -1
  169. data/lib/algolia/models/insights/viewed_filters.rb +7 -3
  170. data/lib/algolia/models/insights/viewed_object_ids.rb +7 -3
  171. data/lib/algolia/models/monitoring/error_base.rb +13 -4
  172. data/lib/algolia/models/monitoring/get_inventory403_response.rb +7 -3
  173. data/lib/algolia/models/monitoring/incident.rb +7 -3
  174. data/lib/algolia/models/monitoring/incidents_inner.rb +7 -3
  175. data/lib/algolia/models/monitoring/incidents_response.rb +7 -3
  176. data/lib/algolia/models/monitoring/indexing_time_response.rb +7 -3
  177. data/lib/algolia/models/monitoring/indexing_time_response_metrics.rb +7 -3
  178. data/lib/algolia/models/monitoring/infrastructure_response.rb +7 -3
  179. data/lib/algolia/models/monitoring/infrastructure_response_metrics.rb +7 -3
  180. data/lib/algolia/models/monitoring/inventory_response.rb +7 -3
  181. data/lib/algolia/models/monitoring/latency_response.rb +7 -3
  182. data/lib/algolia/models/monitoring/latency_response_metrics.rb +7 -3
  183. data/lib/algolia/models/monitoring/probes_metric.rb +7 -3
  184. data/lib/algolia/models/monitoring/server.rb +7 -3
  185. data/lib/algolia/models/monitoring/status_response.rb +7 -3
  186. data/lib/algolia/models/monitoring/time_inner.rb +7 -3
  187. data/lib/algolia/models/personalization/delete_user_profile_response.rb +7 -3
  188. data/lib/algolia/models/personalization/error_base.rb +13 -4
  189. data/lib/algolia/models/personalization/event_scoring.rb +7 -3
  190. data/lib/algolia/models/personalization/facet_scoring.rb +7 -3
  191. data/lib/algolia/models/personalization/get_user_token_response.rb +7 -3
  192. data/lib/algolia/models/personalization/personalization_strategy_params.rb +7 -3
  193. data/lib/algolia/models/personalization/set_personalization_strategy_response.rb +7 -3
  194. data/lib/algolia/models/query-suggestions/base_query_suggestions_configuration_response.rb +8 -14
  195. data/lib/algolia/models/query-suggestions/base_query_suggestions_configuration_with_index.rb +7 -3
  196. data/lib/algolia/models/query-suggestions/base_response.rb +7 -3
  197. data/lib/algolia/models/query-suggestions/error_base.rb +13 -4
  198. data/lib/algolia/models/query-suggestions/facet.rb +7 -3
  199. data/lib/algolia/models/query-suggestions/get_config_status200_response.rb +7 -3
  200. data/lib/algolia/models/query-suggestions/get_log_file200_response.rb +7 -3
  201. data/lib/algolia/models/query-suggestions/languages.rb +1 -1
  202. data/lib/algolia/models/query-suggestions/query_suggestions_configuration.rb +7 -3
  203. data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +8 -14
  204. data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +7 -3
  205. data/lib/algolia/models/query-suggestions/source_index.rb +7 -3
  206. data/lib/algolia/models/recommend/around_precision.rb +1 -1
  207. data/lib/algolia/models/recommend/around_precision_from_value_inner.rb +7 -3
  208. data/lib/algolia/models/recommend/around_radius.rb +1 -1
  209. data/lib/algolia/models/recommend/automatic_facet_filter.rb +7 -3
  210. data/lib/algolia/models/recommend/automatic_facet_filters.rb +1 -1
  211. data/lib/algolia/models/recommend/base_recommend_request.rb +7 -3
  212. data/lib/algolia/models/recommend/base_recommendations_query.rb +7 -3
  213. data/lib/algolia/models/recommend/base_recommended_for_you_query.rb +7 -3
  214. data/lib/algolia/models/recommend/base_recommended_for_you_query_parameters.rb +7 -3
  215. data/lib/algolia/models/recommend/base_search_params.rb +7 -3
  216. data/lib/algolia/models/recommend/base_search_params_without_query.rb +7 -3
  217. data/lib/algolia/models/recommend/base_search_response.rb +13 -4
  218. data/lib/algolia/models/recommend/base_trending_facets_query.rb +7 -3
  219. data/lib/algolia/models/recommend/base_trending_items_query.rb +7 -3
  220. data/lib/algolia/models/recommend/condition.rb +7 -3
  221. data/lib/algolia/models/recommend/consequence.rb +7 -3
  222. data/lib/algolia/models/recommend/consequence_hide.rb +7 -3
  223. data/lib/algolia/models/recommend/consequence_params.rb +7 -3
  224. data/lib/algolia/models/recommend/consequence_query.rb +1 -1
  225. data/lib/algolia/models/recommend/consequence_query_object.rb +7 -3
  226. data/lib/algolia/models/recommend/deleted_at_response.rb +7 -3
  227. data/lib/algolia/models/recommend/distinct.rb +1 -1
  228. data/lib/algolia/models/recommend/edit.rb +7 -3
  229. data/lib/algolia/models/recommend/error_base.rb +13 -4
  230. data/lib/algolia/models/recommend/exhaustive.rb +7 -3
  231. data/lib/algolia/models/recommend/facet_filters.rb +1 -1
  232. data/lib/algolia/models/recommend/facet_ordering.rb +7 -3
  233. data/lib/algolia/models/recommend/facets.rb +7 -3
  234. data/lib/algolia/models/recommend/facets_stats.rb +7 -3
  235. data/lib/algolia/models/recommend/get_recommend_task_response.rb +7 -3
  236. data/lib/algolia/models/recommend/get_recommendations_params.rb +7 -3
  237. data/lib/algolia/models/recommend/get_recommendations_response.rb +7 -3
  238. data/lib/algolia/models/recommend/highlight_result.rb +2 -1
  239. data/lib/algolia/models/recommend/highlight_result_option.rb +7 -3
  240. data/lib/algolia/models/recommend/ignore_plurals.rb +1 -1
  241. data/lib/algolia/models/recommend/index_settings_as_search_params.rb +7 -3
  242. data/lib/algolia/models/recommend/matched_geo_location.rb +7 -3
  243. data/lib/algolia/models/recommend/mixed_search_filters.rb +1 -1
  244. data/lib/algolia/models/recommend/numeric_filters.rb +1 -1
  245. data/lib/algolia/models/recommend/optional_filters.rb +1 -1
  246. data/lib/algolia/models/recommend/params.rb +7 -3
  247. data/lib/algolia/models/recommend/personalization.rb +7 -3
  248. data/lib/algolia/models/recommend/promote.rb +1 -1
  249. data/lib/algolia/models/recommend/promote_object_id.rb +7 -3
  250. data/lib/algolia/models/recommend/promote_object_ids.rb +7 -3
  251. data/lib/algolia/models/recommend/ranking_info.rb +7 -3
  252. data/lib/algolia/models/recommend/re_ranking_apply_filter.rb +1 -1
  253. data/lib/algolia/models/recommend/recommend_hit.rb +13 -4
  254. data/lib/algolia/models/recommend/recommendations_hit.rb +1 -1
  255. data/lib/algolia/models/recommend/recommendations_hits.rb +7 -3
  256. data/lib/algolia/models/recommend/recommendations_query.rb +7 -3
  257. data/lib/algolia/models/recommend/recommendations_request.rb +1 -1
  258. data/lib/algolia/models/recommend/recommendations_results.rb +7 -3
  259. data/lib/algolia/models/recommend/recommended_for_you_query.rb +7 -3
  260. data/lib/algolia/models/recommend/recommended_for_you_query_parameters.rb +7 -3
  261. data/lib/algolia/models/recommend/redirect.rb +7 -3
  262. data/lib/algolia/models/recommend/redirect_rule_index_metadata.rb +7 -3
  263. data/lib/algolia/models/recommend/redirect_rule_index_metadata_data.rb +7 -3
  264. data/lib/algolia/models/recommend/remove_stop_words.rb +1 -1
  265. data/lib/algolia/models/recommend/rendering_content.rb +7 -3
  266. data/lib/algolia/models/recommend/rule_response.rb +7 -3
  267. data/lib/algolia/models/recommend/rule_response_metadata.rb +7 -3
  268. data/lib/algolia/models/recommend/search_params_object.rb +7 -3
  269. data/lib/algolia/models/recommend/search_params_query.rb +7 -3
  270. data/lib/algolia/models/recommend/search_recommend_rules_params.rb +7 -3
  271. data/lib/algolia/models/recommend/search_recommend_rules_response.rb +7 -3
  272. data/lib/algolia/models/recommend/semantic_search.rb +7 -3
  273. data/lib/algolia/models/recommend/snippet_result.rb +2 -1
  274. data/lib/algolia/models/recommend/snippet_result_option.rb +7 -3
  275. data/lib/algolia/models/recommend/tag_filters.rb +1 -1
  276. data/lib/algolia/models/recommend/trending_facet_hit.rb +7 -3
  277. data/lib/algolia/models/recommend/trending_facets_query.rb +7 -3
  278. data/lib/algolia/models/recommend/trending_items_query.rb +7 -3
  279. data/lib/algolia/models/recommend/typo_tolerance.rb +1 -1
  280. data/lib/algolia/models/recommend/value.rb +7 -3
  281. data/lib/algolia/models/search/add_api_key_response.rb +7 -3
  282. data/lib/algolia/models/search/api_key.rb +7 -3
  283. data/lib/algolia/models/search/around_precision.rb +1 -1
  284. data/lib/algolia/models/search/around_precision_from_value_inner.rb +7 -3
  285. data/lib/algolia/models/search/around_radius.rb +1 -1
  286. data/lib/algolia/models/search/assign_user_id_params.rb +7 -3
  287. data/lib/algolia/models/search/attribute_to_update.rb +1 -1
  288. data/lib/algolia/models/search/automatic_facet_filter.rb +7 -3
  289. data/lib/algolia/models/search/automatic_facet_filters.rb +1 -1
  290. data/lib/algolia/models/search/base_get_api_key_response.rb +7 -3
  291. data/lib/algolia/models/search/base_index_settings.rb +7 -3
  292. data/lib/algolia/models/search/base_search_params.rb +7 -3
  293. data/lib/algolia/models/search/base_search_params_without_query.rb +7 -3
  294. data/lib/algolia/models/search/base_search_response.rb +13 -4
  295. data/lib/algolia/models/search/batch_assign_user_ids_params.rb +7 -3
  296. data/lib/algolia/models/search/batch_dictionary_entries_params.rb +7 -3
  297. data/lib/algolia/models/search/batch_dictionary_entries_request.rb +7 -3
  298. data/lib/algolia/models/search/batch_params.rb +7 -3
  299. data/lib/algolia/models/search/batch_request.rb +7 -3
  300. data/lib/algolia/models/search/batch_response.rb +7 -3
  301. data/lib/algolia/models/search/batch_write_params.rb +7 -3
  302. data/lib/algolia/models/search/browse_params.rb +1 -1
  303. data/lib/algolia/models/search/browse_params_object.rb +7 -3
  304. data/lib/algolia/models/search/browse_response.rb +7 -3
  305. data/lib/algolia/models/search/built_in_operation.rb +7 -3
  306. data/lib/algolia/models/search/condition.rb +7 -3
  307. data/lib/algolia/models/search/consequence.rb +7 -3
  308. data/lib/algolia/models/search/consequence_hide.rb +7 -3
  309. data/lib/algolia/models/search/consequence_params.rb +7 -3
  310. data/lib/algolia/models/search/consequence_query.rb +1 -1
  311. data/lib/algolia/models/search/consequence_query_object.rb +7 -3
  312. data/lib/algolia/models/search/created_at_response.rb +7 -3
  313. data/lib/algolia/models/search/cursor.rb +7 -3
  314. data/lib/algolia/models/search/delete_api_key_response.rb +7 -3
  315. data/lib/algolia/models/search/delete_by_params.rb +7 -3
  316. data/lib/algolia/models/search/delete_source_response.rb +7 -3
  317. data/lib/algolia/models/search/deleted_at_response.rb +7 -3
  318. data/lib/algolia/models/search/dictionary_entry.rb +13 -4
  319. data/lib/algolia/models/search/dictionary_language.rb +7 -3
  320. data/lib/algolia/models/search/dictionary_settings_params.rb +7 -3
  321. data/lib/algolia/models/search/distinct.rb +1 -1
  322. data/lib/algolia/models/search/edit.rb +7 -3
  323. data/lib/algolia/models/search/error_base.rb +13 -4
  324. data/lib/algolia/models/search/exhaustive.rb +7 -3
  325. data/lib/algolia/models/search/facet_filters.rb +1 -1
  326. data/lib/algolia/models/search/facet_hits.rb +7 -3
  327. data/lib/algolia/models/search/facet_ordering.rb +7 -3
  328. data/lib/algolia/models/search/facets.rb +7 -3
  329. data/lib/algolia/models/search/facets_stats.rb +7 -3
  330. data/lib/algolia/models/search/fetched_index.rb +7 -3
  331. data/lib/algolia/models/search/get_api_key_response.rb +7 -3
  332. data/lib/algolia/models/search/get_dictionary_settings_response.rb +7 -3
  333. data/lib/algolia/models/search/get_logs_response.rb +7 -3
  334. data/lib/algolia/models/search/get_objects_params.rb +7 -3
  335. data/lib/algolia/models/search/get_objects_request.rb +7 -3
  336. data/lib/algolia/models/search/get_objects_response.rb +7 -3
  337. data/lib/algolia/models/search/get_task_response.rb +7 -3
  338. data/lib/algolia/models/search/get_top_user_ids_response.rb +7 -3
  339. data/lib/algolia/models/search/has_pending_mappings_response.rb +7 -3
  340. data/lib/algolia/models/search/highlight_result.rb +2 -1
  341. data/lib/algolia/models/search/highlight_result_option.rb +7 -3
  342. data/lib/algolia/models/search/hit.rb +13 -4
  343. data/lib/algolia/models/search/ignore_plurals.rb +1 -1
  344. data/lib/algolia/models/search/index_settings.rb +7 -3
  345. data/lib/algolia/models/search/index_settings_as_search_params.rb +7 -3
  346. data/lib/algolia/models/search/languages.rb +7 -3
  347. data/lib/algolia/models/search/list_api_keys_response.rb +7 -3
  348. data/lib/algolia/models/search/list_clusters_response.rb +7 -3
  349. data/lib/algolia/models/search/list_indices_response.rb +7 -3
  350. data/lib/algolia/models/search/list_user_ids_response.rb +7 -3
  351. data/lib/algolia/models/search/log.rb +7 -3
  352. data/lib/algolia/models/search/log_query.rb +7 -3
  353. data/lib/algolia/models/search/matched_geo_location.rb +7 -3
  354. data/lib/algolia/models/search/mixed_search_filters.rb +1 -1
  355. data/lib/algolia/models/search/multiple_batch_request.rb +7 -3
  356. data/lib/algolia/models/search/multiple_batch_response.rb +7 -3
  357. data/lib/algolia/models/search/numeric_filters.rb +1 -1
  358. data/lib/algolia/models/search/operation_index_params.rb +7 -3
  359. data/lib/algolia/models/search/optional_filters.rb +1 -1
  360. data/lib/algolia/models/search/params.rb +7 -3
  361. data/lib/algolia/models/search/personalization.rb +7 -3
  362. data/lib/algolia/models/search/promote.rb +1 -1
  363. data/lib/algolia/models/search/promote_object_id.rb +7 -3
  364. data/lib/algolia/models/search/promote_object_ids.rb +7 -3
  365. data/lib/algolia/models/search/ranking_info.rb +7 -3
  366. data/lib/algolia/models/search/re_ranking_apply_filter.rb +1 -1
  367. data/lib/algolia/models/search/redirect.rb +7 -3
  368. data/lib/algolia/models/search/redirect_rule_index_metadata.rb +7 -3
  369. data/lib/algolia/models/search/redirect_rule_index_metadata_data.rb +7 -3
  370. data/lib/algolia/models/search/remove_stop_words.rb +1 -1
  371. data/lib/algolia/models/search/remove_user_id_response.rb +7 -3
  372. data/lib/algolia/models/search/rendering_content.rb +7 -3
  373. data/lib/algolia/models/search/replace_source_response.rb +7 -3
  374. data/lib/algolia/models/search/rule.rb +7 -3
  375. data/lib/algolia/models/search/save_object_response.rb +7 -3
  376. data/lib/algolia/models/search/save_synonym_response.rb +7 -3
  377. data/lib/algolia/models/search/search_dictionary_entries_params.rb +7 -3
  378. data/lib/algolia/models/search/search_for_facet_values_request.rb +7 -3
  379. data/lib/algolia/models/search/search_for_facet_values_response.rb +7 -3
  380. data/lib/algolia/models/search/search_for_facets.rb +7 -3
  381. data/lib/algolia/models/search/search_for_facets_options.rb +7 -3
  382. data/lib/algolia/models/search/search_for_hits.rb +7 -3
  383. data/lib/algolia/models/search/search_for_hits_options.rb +7 -3
  384. data/lib/algolia/models/search/search_hits.rb +13 -4
  385. data/lib/algolia/models/search/search_method_params.rb +7 -3
  386. data/lib/algolia/models/search/search_params.rb +1 -1
  387. data/lib/algolia/models/search/search_params_object.rb +7 -3
  388. data/lib/algolia/models/search/search_params_query.rb +7 -3
  389. data/lib/algolia/models/search/search_params_string.rb +7 -3
  390. data/lib/algolia/models/search/search_query.rb +1 -1
  391. data/lib/algolia/models/search/search_response.rb +13 -4
  392. data/lib/algolia/models/search/search_responses.rb +7 -3
  393. data/lib/algolia/models/search/search_result.rb +1 -1
  394. data/lib/algolia/models/search/search_rules_params.rb +7 -3
  395. data/lib/algolia/models/search/search_rules_response.rb +7 -3
  396. data/lib/algolia/models/search/search_synonyms_params.rb +80 -7
  397. data/lib/algolia/models/search/search_synonyms_response.rb +13 -4
  398. data/lib/algolia/models/search/search_user_ids_params.rb +7 -3
  399. data/lib/algolia/models/search/search_user_ids_response.rb +7 -3
  400. data/lib/algolia/models/search/semantic_search.rb +7 -3
  401. data/lib/algolia/models/search/snippet_result.rb +2 -1
  402. data/lib/algolia/models/search/snippet_result_option.rb +7 -3
  403. data/lib/algolia/models/search/source.rb +7 -3
  404. data/lib/algolia/models/search/standard_entries.rb +7 -3
  405. data/lib/algolia/models/search/synonym_hit.rb +7 -3
  406. data/lib/algolia/models/search/tag_filters.rb +1 -1
  407. data/lib/algolia/models/search/time_range.rb +7 -3
  408. data/lib/algolia/models/search/typo_tolerance.rb +1 -1
  409. data/lib/algolia/models/search/update_api_key_response.rb +7 -3
  410. data/lib/algolia/models/search/updated_at_response.rb +7 -3
  411. data/lib/algolia/models/search/updated_at_with_object_id_response.rb +7 -3
  412. data/lib/algolia/models/search/updated_rule_response.rb +7 -3
  413. data/lib/algolia/models/search/user_highlight_result.rb +7 -3
  414. data/lib/algolia/models/search/user_hit.rb +7 -3
  415. data/lib/algolia/models/search/user_id.rb +7 -3
  416. data/lib/algolia/models/search/value.rb +7 -3
  417. data/lib/algolia/transport/http/http_requester.rb +2 -2
  418. data/lib/algolia/transport/stateful_host.rb +2 -1
  419. data/lib/algolia/transport/transport.rb +9 -6
  420. data/lib/algolia/version.rb +1 -1
  421. metadata +2 -2
@@ -14,7 +14,6 @@ module Algolia
14
14
 
15
15
  def self.create(app_id, api_key, opts = {})
16
16
  hosts = []
17
-
18
17
  hosts << Transport::StatefulHost.new("#{app_id}-dsn.algolia.net", accept: CallType::READ)
19
18
  hosts << Transport::StatefulHost.new("#{app_id}.algolia.net", accept: CallType::WRITE)
20
19
 
@@ -30,8 +29,10 @@ module Algolia
30
29
  new(config)
31
30
  end
32
31
 
33
- # Add API key.
34
32
  # 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.
33
+ #
34
+ # Required API Key ACLs:
35
+ # - admin
35
36
  # @param api_key [ApiKey] (required)
36
37
  # @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
38
  # @return [Http::Response] the response
@@ -60,18 +61,22 @@ module Algolia
60
61
  @api_client.call_api(:POST, path, new_options)
61
62
  end
62
63
 
63
- # Add API key.
64
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
+ #
66
+ # Required API Key ACLs:
67
+ # - admin
65
68
  # @param api_key [ApiKey] (required)
66
69
  # @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
70
  # @return [AddApiKeyResponse]
68
71
  def add_api_key(api_key, request_options = {})
69
72
  response = add_api_key_with_http_info(api_key, request_options)
70
- deserialize(response.body, request_options[:debug_return_type] || 'Search::AddApiKeyResponse')
73
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::AddApiKeyResponse')
71
74
  end
72
75
 
73
- # Add or update a record (using objectID).
74
76
  # 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).
77
+ #
78
+ # Required API Key ACLs:
79
+ # - addObject
75
80
  # @param index_name [String] Index on which to perform the request. (required)
76
81
  # @param object_id [String] Unique record (object) identifier. (required)
77
82
  # @param body [Object] Algolia record. (required)
@@ -91,8 +96,8 @@ module Algolia
91
96
  raise ArgumentError, "Parameter `body` is required when calling `add_or_update_object`."
92
97
  end
93
98
 
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))
99
+ path = '/1/indexes/{indexName}/{objectID}'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
100
+ Transport.encode_uri(object_id.to_s))
96
101
  query_params = {}
97
102
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
98
103
  header_params = {}
@@ -111,8 +116,10 @@ module Algolia
111
116
  @api_client.call_api(:PUT, path, new_options)
112
117
  end
113
118
 
114
- # Add or update a record (using objectID).
115
119
  # 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).
120
+ #
121
+ # Required API Key ACLs:
122
+ # - addObject
116
123
  # @param index_name [String] Index on which to perform the request. (required)
117
124
  # @param object_id [String] Unique record (object) identifier. (required)
118
125
  # @param body [Object] Algolia record. (required)
@@ -120,11 +127,13 @@ module Algolia
120
127
  # @return [UpdatedAtWithObjectIdResponse]
121
128
  def add_or_update_object(index_name, object_id, body, request_options = {})
122
129
  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')
130
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtWithObjectIdResponse')
124
131
  end
125
132
 
126
- # Add a source.
127
133
  # Add a source to the list of allowed sources.
134
+ #
135
+ # Required API Key ACLs:
136
+ # - admin
128
137
  # @param source [Source] Source to add. (required)
129
138
  # @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
139
  # @return [Http::Response] the response
@@ -153,18 +162,22 @@ module Algolia
153
162
  @api_client.call_api(:POST, path, new_options)
154
163
  end
155
164
 
156
- # Add a source.
157
165
  # Add a source to the list of allowed sources.
166
+ #
167
+ # Required API Key ACLs:
168
+ # - admin
158
169
  # @param source [Source] Source to add. (required)
159
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)
160
171
  # @return [CreatedAtResponse]
161
172
  def append_source(source, request_options = {})
162
173
  response = append_source_with_http_info(source, request_options)
163
- deserialize(response.body, request_options[:debug_return_type] || 'Search::CreatedAtResponse')
174
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::CreatedAtResponse')
164
175
  end
165
176
 
166
- # Assign or move a user ID.
167
177
  # 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.
178
+ #
179
+ # Required API Key ACLs:
180
+ # - admin
168
181
  # @param x_algolia_user_id [String] userID to assign. (required)
169
182
  # @param assign_user_id_params [AssignUserIdParams] (required)
170
183
  # @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)
@@ -205,19 +218,21 @@ module Algolia
205
218
  @api_client.call_api(:POST, path, new_options)
206
219
  end
207
220
 
208
- # Assign or move a user ID.
209
221
  # 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.
222
+ #
223
+ # Required API Key ACLs:
224
+ # - admin
210
225
  # @param x_algolia_user_id [String] userID to assign. (required)
211
226
  # @param assign_user_id_params [AssignUserIdParams] (required)
212
227
  # @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
228
  # @return [CreatedAtResponse]
214
229
  def assign_user_id(x_algolia_user_id, assign_user_id_params, request_options = {})
215
230
  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')
231
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::CreatedAtResponse')
217
232
  end
218
233
 
219
- # Batch write operations on one index.
220
234
  # 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.
235
+
221
236
  # @param index_name [String] Index on which to perform the request. (required)
222
237
  # @param batch_write_params [BatchWriteParams] (required)
223
238
  # @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)
@@ -232,7 +247,7 @@ module Algolia
232
247
  raise ArgumentError, "Parameter `batch_write_params` is required when calling `batch`."
233
248
  end
234
249
 
235
- path = '/1/indexes/{indexName}/batch'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
250
+ path = '/1/indexes/{indexName}/batch'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s))
236
251
  query_params = {}
237
252
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
238
253
  header_params = {}
@@ -251,19 +266,21 @@ module Algolia
251
266
  @api_client.call_api(:POST, path, new_options)
252
267
  end
253
268
 
254
- # Batch write operations on one index.
255
269
  # 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.
270
+
256
271
  # @param index_name [String] Index on which to perform the request. (required)
257
272
  # @param batch_write_params [BatchWriteParams] (required)
258
273
  # @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
274
  # @return [BatchResponse]
260
275
  def batch(index_name, batch_write_params, request_options = {})
261
276
  response = batch_with_http_info(index_name, batch_write_params, request_options)
262
- deserialize(response.body, request_options[:debug_return_type] || 'Search::BatchResponse')
277
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::BatchResponse')
263
278
  end
264
279
 
265
- # Batch assign userIDs.
266
280
  # Assign multiple user IDs to a cluster. **You can&#39;t _move_ users with this operation.**.
281
+ #
282
+ # Required API Key ACLs:
283
+ # - admin
267
284
  # @param x_algolia_user_id [String] userID to assign. (required)
268
285
  # @param batch_assign_user_ids_params [BatchAssignUserIdsParams] (required)
269
286
  # @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)
@@ -304,19 +321,23 @@ module Algolia
304
321
  @api_client.call_api(:POST, path, new_options)
305
322
  end
306
323
 
307
- # Batch assign userIDs.
308
324
  # Assign multiple user IDs to a cluster. **You can't _move_ users with this operation.**.
325
+ #
326
+ # Required API Key ACLs:
327
+ # - admin
309
328
  # @param x_algolia_user_id [String] userID to assign. (required)
310
329
  # @param batch_assign_user_ids_params [BatchAssignUserIdsParams] (required)
311
330
  # @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
331
  # @return [CreatedAtResponse]
313
332
  def batch_assign_user_ids(x_algolia_user_id, batch_assign_user_ids_params, request_options = {})
314
333
  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')
334
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::CreatedAtResponse')
316
335
  end
317
336
 
318
- # Batch dictionary entries.
319
337
  # Add or remove a batch of dictionary entries.
338
+ #
339
+ # Required API Key ACLs:
340
+ # - editSettings
320
341
  # @param dictionary_name [DictionaryType] Dictionary to search in. (required)
321
342
  # @param batch_dictionary_entries_params [BatchDictionaryEntriesParams] (required)
322
343
  # @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)
@@ -331,7 +352,7 @@ module Algolia
331
352
  raise ArgumentError, "Parameter `batch_dictionary_entries_params` is required when calling `batch_dictionary_entries`."
332
353
  end
333
354
 
334
- path = '/1/dictionaries/{dictionaryName}/batch'.sub('{' + 'dictionaryName' + '}', @api_client.encode_uri(dictionary_name.to_s))
355
+ path = '/1/dictionaries/{dictionaryName}/batch'.sub('{' + 'dictionaryName' + '}', Transport.encode_uri(dictionary_name.to_s))
335
356
  query_params = {}
336
357
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
337
358
  header_params = {}
@@ -350,19 +371,23 @@ module Algolia
350
371
  @api_client.call_api(:POST, path, new_options)
351
372
  end
352
373
 
353
- # Batch dictionary entries.
354
374
  # Add or remove a batch of dictionary entries.
375
+ #
376
+ # Required API Key ACLs:
377
+ # - editSettings
355
378
  # @param dictionary_name [DictionaryType] Dictionary to search in. (required)
356
379
  # @param batch_dictionary_entries_params [BatchDictionaryEntriesParams] (required)
357
380
  # @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
381
  # @return [UpdatedAtResponse]
359
382
  def batch_dictionary_entries(dictionary_name, batch_dictionary_entries_params, request_options = {})
360
383
  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')
384
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
362
385
  end
363
386
 
364
- # Get all records from an index.
365
387
  # 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.
388
+ #
389
+ # Required API Key ACLs:
390
+ # - browse
366
391
  # @param index_name [String] Index on which to perform the request. (required)
367
392
  # @param browse_params [BrowseParams]
368
393
  # @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)
@@ -373,7 +398,7 @@ module Algolia
373
398
  raise ArgumentError, "Parameter `index_name` is required when calling `browse`."
374
399
  end
375
400
 
376
- path = '/1/indexes/{indexName}/browse'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
401
+ path = '/1/indexes/{indexName}/browse'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s))
377
402
  query_params = {}
378
403
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
379
404
  header_params = {}
@@ -392,32 +417,34 @@ module Algolia
392
417
  @api_client.call_api(:POST, path, new_options)
393
418
  end
394
419
 
395
- # Get all records from an index.
396
420
  # 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.
421
+ #
422
+ # Required API Key ACLs:
423
+ # - browse
397
424
  # @param index_name [String] Index on which to perform the request. (required)
398
425
  # @param browse_params [BrowseParams]
399
426
  # @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
427
  # @return [BrowseResponse]
401
428
  def browse(index_name, browse_params = nil, request_options = {})
402
429
  response = browse_with_http_info(index_name, browse_params, request_options)
403
- deserialize(response.body, request_options[:debug_return_type] || 'Search::BrowseResponse')
430
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::BrowseResponse')
404
431
  end
405
432
 
406
- # Delete all synonyms.
407
- # Delete all synonyms in the index.
433
+ # Delete the records but leave settings and index-specific API keys untouched.
434
+ #
435
+ # Required API Key ACLs:
436
+ # - deleteIndex
408
437
  # @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
438
  # @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
439
  # @return [Http::Response] the response
412
- def clear_all_synonyms_with_http_info(index_name, forward_to_replicas = nil, request_options = {})
440
+ def clear_objects_with_http_info(index_name, request_options = {})
413
441
  # verify the required parameter 'index_name' is set
414
442
  if @api_client.config.client_side_validation && index_name.nil?
415
- raise ArgumentError, "Parameter `index_name` is required when calling `clear_all_synonyms`."
443
+ raise ArgumentError, "Parameter `index_name` is required when calling `clear_objects`."
416
444
  end
417
445
 
418
- path = '/1/indexes/{indexName}/synonyms/clear'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
446
+ path = '/1/indexes/{indexName}/clear'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s))
419
447
  query_params = {}
420
- query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
421
448
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
422
449
  header_params = {}
423
450
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
@@ -425,7 +452,7 @@ module Algolia
425
452
  post_body = request_options[:debug_body]
426
453
 
427
454
  new_options = request_options.merge(
428
- :operation => :'SearchClient.clear_all_synonyms',
455
+ :operation => :'SearchClient.clear_objects',
429
456
  :header_params => header_params,
430
457
  :query_params => query_params,
431
458
  :body => post_body,
@@ -435,30 +462,35 @@ module Algolia
435
462
  @api_client.call_api(:POST, path, new_options)
436
463
  end
437
464
 
438
- # Delete all synonyms.
439
- # Delete all synonyms in the index.
465
+ # Delete the records but leave settings and index-specific API keys untouched.
466
+ #
467
+ # Required API Key ACLs:
468
+ # - deleteIndex
440
469
  # @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
470
  # @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
471
  # @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')
472
+ def clear_objects(index_name, request_options = {})
473
+ response = clear_objects_with_http_info(index_name, request_options)
474
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
447
475
  end
448
476
 
449
- # Delete all records from an index.
450
- # Delete the records but leave settings and index-specific API keys untouched.
477
+ # Delete all rules in the index.
478
+ #
479
+ # Required API Key ACLs:
480
+ # - editSettings
451
481
  # @param index_name [String] Index on which to perform the request. (required)
482
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
452
483
  # @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
484
  # @return [Http::Response] the response
454
- def clear_objects_with_http_info(index_name, request_options = {})
485
+ def clear_rules_with_http_info(index_name, forward_to_replicas = nil, request_options = {})
455
486
  # verify the required parameter 'index_name' is set
456
487
  if @api_client.config.client_side_validation && index_name.nil?
457
- raise ArgumentError, "Parameter `index_name` is required when calling `clear_objects`."
488
+ raise ArgumentError, "Parameter `index_name` is required when calling `clear_rules`."
458
489
  end
459
490
 
460
- path = '/1/indexes/{indexName}/clear'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
491
+ path = '/1/indexes/{indexName}/rules/clear'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s))
461
492
  query_params = {}
493
+ query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
462
494
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
463
495
  header_params = {}
464
496
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
@@ -466,7 +498,7 @@ module Algolia
466
498
  post_body = request_options[:debug_body]
467
499
 
468
500
  new_options = request_options.merge(
469
- :operation => :'SearchClient.clear_objects',
501
+ :operation => :'SearchClient.clear_rules',
470
502
  :header_params => header_params,
471
503
  :query_params => query_params,
472
504
  :body => post_body,
@@ -476,29 +508,34 @@ module Algolia
476
508
  @api_client.call_api(:POST, path, new_options)
477
509
  end
478
510
 
479
- # Delete all records from an index.
480
- # Delete the records but leave settings and index-specific API keys untouched.
511
+ # Delete all rules in the index.
512
+ #
513
+ # Required API Key ACLs:
514
+ # - editSettings
481
515
  # @param index_name [String] Index on which to perform the request. (required)
516
+ # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
482
517
  # @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
518
  # @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')
519
+ def clear_rules(index_name, forward_to_replicas = nil, request_options = {})
520
+ response = clear_rules_with_http_info(index_name, forward_to_replicas, request_options)
521
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
487
522
  end
488
523
 
489
- # Delete all rules.
490
- # Delete all rules in the index.
524
+ # Delete all synonyms in the index.
525
+ #
526
+ # Required API Key ACLs:
527
+ # - editSettings
491
528
  # @param index_name [String] Index on which to perform the request. (required)
492
529
  # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
493
530
  # @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
531
  # @return [Http::Response] the response
495
- def clear_rules_with_http_info(index_name, forward_to_replicas = nil, request_options = {})
532
+ def clear_synonyms_with_http_info(index_name, forward_to_replicas = nil, request_options = {})
496
533
  # verify the required parameter 'index_name' is set
497
534
  if @api_client.config.client_side_validation && index_name.nil?
498
- raise ArgumentError, "Parameter `index_name` is required when calling `clear_rules`."
535
+ raise ArgumentError, "Parameter `index_name` is required when calling `clear_synonyms`."
499
536
  end
500
537
 
501
- path = '/1/indexes/{indexName}/rules/clear'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
538
+ path = '/1/indexes/{indexName}/synonyms/clear'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s))
502
539
  query_params = {}
503
540
  query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
504
541
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
@@ -508,7 +545,7 @@ module Algolia
508
545
  post_body = request_options[:debug_body]
509
546
 
510
547
  new_options = request_options.merge(
511
- :operation => :'SearchClient.clear_rules',
548
+ :operation => :'SearchClient.clear_synonyms',
512
549
  :header_params => header_params,
513
550
  :query_params => query_params,
514
551
  :body => post_body,
@@ -518,19 +555,21 @@ module Algolia
518
555
  @api_client.call_api(:POST, path, new_options)
519
556
  end
520
557
 
521
- # Delete all rules.
522
- # Delete all rules in the index.
558
+ # Delete all synonyms in the index.
559
+ #
560
+ # Required API Key ACLs:
561
+ # - editSettings
523
562
  # @param index_name [String] Index on which to perform the request. (required)
524
563
  # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
525
564
  # @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
565
  # @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')
566
+ def clear_synonyms(index_name, forward_to_replicas = nil, request_options = {})
567
+ response = clear_synonyms_with_http_info(index_name, forward_to_replicas, request_options)
568
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
530
569
  end
531
570
 
532
- # Send requests to the Algolia REST API.
533
571
  # This method allow you to send requests to the Algolia REST API.
572
+
534
573
  # @param path [String] Path of the endpoint, anything after \&quot;/1\&quot; must be specified. (required)
535
574
  # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
536
575
  # @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)
@@ -561,19 +600,19 @@ module Algolia
561
600
  @api_client.call_api(:DELETE, path, new_options)
562
601
  end
563
602
 
564
- # Send requests to the Algolia REST API.
565
603
  # This method allow you to send requests to the Algolia REST API.
604
+
566
605
  # @param path [String] Path of the endpoint, anything after \&quot;/1\&quot; must be specified. (required)
567
606
  # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
568
607
  # @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
608
  # @return [Object]
570
609
  def custom_delete(path, parameters = nil, request_options = {})
571
610
  response = custom_delete_with_http_info(path, parameters, request_options)
572
- deserialize(response.body, request_options[:debug_return_type] || 'Object')
611
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Object')
573
612
  end
574
613
 
575
- # Send requests to the Algolia REST API.
576
614
  # This method allow you to send requests to the Algolia REST API.
615
+
577
616
  # @param path [String] Path of the endpoint, anything after \&quot;/1\&quot; must be specified. (required)
578
617
  # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
579
618
  # @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)
@@ -604,19 +643,19 @@ module Algolia
604
643
  @api_client.call_api(:GET, path, new_options)
605
644
  end
606
645
 
607
- # Send requests to the Algolia REST API.
608
646
  # This method allow you to send requests to the Algolia REST API.
647
+
609
648
  # @param path [String] Path of the endpoint, anything after \&quot;/1\&quot; must be specified. (required)
610
649
  # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
611
650
  # @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
651
  # @return [Object]
613
652
  def custom_get(path, parameters = nil, request_options = {})
614
653
  response = custom_get_with_http_info(path, parameters, request_options)
615
- deserialize(response.body, request_options[:debug_return_type] || 'Object')
654
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Object')
616
655
  end
617
656
 
618
- # Send requests to the Algolia REST API.
619
657
  # This method allow you to send requests to the Algolia REST API.
658
+
620
659
  # @param path [String] Path of the endpoint, anything after \&quot;/1\&quot; must be specified. (required)
621
660
  # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
622
661
  # @param body [Object] Parameters to send with the custom request.
@@ -648,8 +687,8 @@ module Algolia
648
687
  @api_client.call_api(:POST, path, new_options)
649
688
  end
650
689
 
651
- # Send requests to the Algolia REST API.
652
690
  # This method allow you to send requests to the Algolia REST API.
691
+
653
692
  # @param path [String] Path of the endpoint, anything after \&quot;/1\&quot; must be specified. (required)
654
693
  # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
655
694
  # @param body [Object] Parameters to send with the custom request.
@@ -657,11 +696,11 @@ module Algolia
657
696
  # @return [Object]
658
697
  def custom_post(path, parameters = nil, body = nil, request_options = {})
659
698
  response = custom_post_with_http_info(path, parameters, body, request_options)
660
- deserialize(response.body, request_options[:debug_return_type] || 'Object')
699
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Object')
661
700
  end
662
701
 
663
- # Send requests to the Algolia REST API.
664
702
  # This method allow you to send requests to the Algolia REST API.
703
+
665
704
  # @param path [String] Path of the endpoint, anything after \&quot;/1\&quot; must be specified. (required)
666
705
  # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
667
706
  # @param body [Object] Parameters to send with the custom request.
@@ -693,8 +732,8 @@ module Algolia
693
732
  @api_client.call_api(:PUT, path, new_options)
694
733
  end
695
734
 
696
- # Send requests to the Algolia REST API.
697
735
  # This method allow you to send requests to the Algolia REST API.
736
+
698
737
  # @param path [String] Path of the endpoint, anything after \&quot;/1\&quot; must be specified. (required)
699
738
  # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
700
739
  # @param body [Object] Parameters to send with the custom request.
@@ -702,11 +741,13 @@ module Algolia
702
741
  # @return [Object]
703
742
  def custom_put(path, parameters = nil, body = nil, request_options = {})
704
743
  response = custom_put_with_http_info(path, parameters, body, request_options)
705
- deserialize(response.body, request_options[:debug_return_type] || 'Object')
744
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Object')
706
745
  end
707
746
 
708
- # Delete API key.
709
747
  # Delete an existing API key. The request must be authenticated with the admin API key.
748
+ #
749
+ # Required API Key ACLs:
750
+ # - admin
710
751
  # @param key [String] API key. (required)
711
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)
712
753
  # @return [Http::Response] the response
@@ -716,7 +757,7 @@ module Algolia
716
757
  raise ArgumentError, "Parameter `key` is required when calling `delete_api_key`."
717
758
  end
718
759
 
719
- path = '/1/keys/{key}'.sub('{' + 'key' + '}', @api_client.encode_uri(key.to_s))
760
+ path = '/1/keys/{key}'.sub('{' + 'key' + '}', Transport.encode_uri(key.to_s))
720
761
  query_params = {}
721
762
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
722
763
  header_params = {}
@@ -735,18 +776,22 @@ module Algolia
735
776
  @api_client.call_api(:DELETE, path, new_options)
736
777
  end
737
778
 
738
- # Delete API key.
739
779
  # Delete an existing API key. The request must be authenticated with the admin API key.
780
+ #
781
+ # Required API Key ACLs:
782
+ # - admin
740
783
  # @param key [String] API key. (required)
741
784
  # @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
785
  # @return [DeleteApiKeyResponse]
743
786
  def delete_api_key(key, request_options = {})
744
787
  response = delete_api_key_with_http_info(key, request_options)
745
- deserialize(response.body, request_options[:debug_return_type] || 'Search::DeleteApiKeyResponse')
788
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::DeleteApiKeyResponse')
746
789
  end
747
790
 
748
- # Delete all records matching a query.
749
791
  # 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.
792
+ #
793
+ # Required API Key ACLs:
794
+ # - deleteIndex
750
795
  # @param index_name [String] Index on which to perform the request. (required)
751
796
  # @param delete_by_params [DeleteByParams] (required)
752
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)
@@ -761,7 +806,7 @@ module Algolia
761
806
  raise ArgumentError, "Parameter `delete_by_params` is required when calling `delete_by`."
762
807
  end
763
808
 
764
- path = '/1/indexes/{indexName}/deleteByQuery'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
809
+ path = '/1/indexes/{indexName}/deleteByQuery'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s))
765
810
  query_params = {}
766
811
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
767
812
  header_params = {}
@@ -780,19 +825,23 @@ module Algolia
780
825
  @api_client.call_api(:POST, path, new_options)
781
826
  end
782
827
 
783
- # Delete all records matching a query.
784
828
  # 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.
829
+ #
830
+ # Required API Key ACLs:
831
+ # - deleteIndex
785
832
  # @param index_name [String] Index on which to perform the request. (required)
786
833
  # @param delete_by_params [DeleteByParams] (required)
787
834
  # @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
835
  # @return [DeletedAtResponse]
789
836
  def delete_by(index_name, delete_by_params, request_options = {})
790
837
  response = delete_by_with_http_info(index_name, delete_by_params, request_options)
791
- deserialize(response.body, request_options[:debug_return_type] || 'Search::DeletedAtResponse')
838
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::DeletedAtResponse')
792
839
  end
793
840
 
794
- # Delete index.
795
841
  # Delete an existing index.
842
+ #
843
+ # Required API Key ACLs:
844
+ # - deleteIndex
796
845
  # @param index_name [String] Index on which to perform the request. (required)
797
846
  # @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
847
  # @return [Http::Response] the response
@@ -802,7 +851,7 @@ module Algolia
802
851
  raise ArgumentError, "Parameter `index_name` is required when calling `delete_index`."
803
852
  end
804
853
 
805
- path = '/1/indexes/{indexName}'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
854
+ path = '/1/indexes/{indexName}'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s))
806
855
  query_params = {}
807
856
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
808
857
  header_params = {}
@@ -821,18 +870,22 @@ module Algolia
821
870
  @api_client.call_api(:DELETE, path, new_options)
822
871
  end
823
872
 
824
- # Delete index.
825
873
  # Delete an existing index.
874
+ #
875
+ # Required API Key ACLs:
876
+ # - deleteIndex
826
877
  # @param index_name [String] Index on which to perform the request. (required)
827
878
  # @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
879
  # @return [DeletedAtResponse]
829
880
  def delete_index(index_name, request_options = {})
830
881
  response = delete_index_with_http_info(index_name, request_options)
831
- deserialize(response.body, request_options[:debug_return_type] || 'Search::DeletedAtResponse')
882
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::DeletedAtResponse')
832
883
  end
833
884
 
834
- # Delete a record.
835
885
  # To delete a set of records matching a query, use the [&#x60;deleteByQuery&#x60; operation](#tag/Records/operation/deleteBy) instead.
886
+ #
887
+ # Required API Key ACLs:
888
+ # - deleteObject
836
889
  # @param index_name [String] Index on which to perform the request. (required)
837
890
  # @param object_id [String] Unique record (object) identifier. (required)
838
891
  # @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)
@@ -847,8 +900,8 @@ module Algolia
847
900
  raise ArgumentError, "Parameter `object_id` is required when calling `delete_object`."
848
901
  end
849
902
 
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))
903
+ path = '/1/indexes/{indexName}/{objectID}'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
904
+ Transport.encode_uri(object_id.to_s))
852
905
  query_params = {}
853
906
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
854
907
  header_params = {}
@@ -867,19 +920,23 @@ module Algolia
867
920
  @api_client.call_api(:DELETE, path, new_options)
868
921
  end
869
922
 
870
- # Delete a record.
871
923
  # To delete a set of records matching a query, use the [`deleteByQuery` operation](#tag/Records/operation/deleteBy) instead.
924
+ #
925
+ # Required API Key ACLs:
926
+ # - deleteObject
872
927
  # @param index_name [String] Index on which to perform the request. (required)
873
928
  # @param object_id [String] Unique record (object) identifier. (required)
874
929
  # @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
930
  # @return [DeletedAtResponse]
876
931
  def delete_object(index_name, object_id, request_options = {})
877
932
  response = delete_object_with_http_info(index_name, object_id, request_options)
878
- deserialize(response.body, request_options[:debug_return_type] || 'Search::DeletedAtResponse')
933
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::DeletedAtResponse')
879
934
  end
880
935
 
881
- # Delete a rule.
882
936
  # 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).
937
+ #
938
+ # Required API Key ACLs:
939
+ # - editSettings
883
940
  # @param index_name [String] Index on which to perform the request. (required)
884
941
  # @param object_id [String] Unique identifier of a rule object. (required)
885
942
  # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
@@ -895,8 +952,8 @@ module Algolia
895
952
  raise ArgumentError, "Parameter `object_id` is required when calling `delete_rule`."
896
953
  end
897
954
 
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))
955
+ path = '/1/indexes/{indexName}/rules/{objectID}'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
956
+ Transport.encode_uri(object_id.to_s))
900
957
  query_params = {}
901
958
  query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
902
959
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
@@ -916,8 +973,10 @@ module Algolia
916
973
  @api_client.call_api(:DELETE, path, new_options)
917
974
  end
918
975
 
919
- # Delete a rule.
920
976
  # Delete a rule by its `objectID`. To find the `objectID` for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
977
+ #
978
+ # Required API Key ACLs:
979
+ # - editSettings
921
980
  # @param index_name [String] Index on which to perform the request. (required)
922
981
  # @param object_id [String] Unique identifier of a rule object. (required)
923
982
  # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
@@ -925,11 +984,13 @@ module Algolia
925
984
  # @return [UpdatedAtResponse]
926
985
  def delete_rule(index_name, object_id, forward_to_replicas = nil, request_options = {})
927
986
  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')
987
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
929
988
  end
930
989
 
931
- # Remove a source.
932
990
  # Remove a source from the list of allowed sources.
991
+ #
992
+ # Required API Key ACLs:
993
+ # - admin
933
994
  # @param source [String] IP address range of the source. (required)
934
995
  # @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
996
  # @return [Http::Response] the response
@@ -939,7 +1000,7 @@ module Algolia
939
1000
  raise ArgumentError, "Parameter `source` is required when calling `delete_source`."
940
1001
  end
941
1002
 
942
- path = '/1/security/sources/{source}'.sub('{' + 'source' + '}', @api_client.encode_uri(source.to_s))
1003
+ path = '/1/security/sources/{source}'.sub('{' + 'source' + '}', Transport.encode_uri(source.to_s))
943
1004
  query_params = {}
944
1005
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
945
1006
  header_params = {}
@@ -958,18 +1019,22 @@ module Algolia
958
1019
  @api_client.call_api(:DELETE, path, new_options)
959
1020
  end
960
1021
 
961
- # Remove a source.
962
1022
  # Remove a source from the list of allowed sources.
1023
+ #
1024
+ # Required API Key ACLs:
1025
+ # - admin
963
1026
  # @param source [String] IP address range of the source. (required)
964
1027
  # @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
1028
  # @return [DeleteSourceResponse]
966
1029
  def delete_source(source, request_options = {})
967
1030
  response = delete_source_with_http_info(source, request_options)
968
- deserialize(response.body, request_options[:debug_return_type] || 'Search::DeleteSourceResponse')
1031
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::DeleteSourceResponse')
969
1032
  end
970
1033
 
971
- # Delete a synonym.
972
1034
  # 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).
1035
+ #
1036
+ # Required API Key ACLs:
1037
+ # - editSettings
973
1038
  # @param index_name [String] Index on which to perform the request. (required)
974
1039
  # @param object_id [String] Unique identifier of a synonym object. (required)
975
1040
  # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
@@ -985,8 +1050,8 @@ module Algolia
985
1050
  raise ArgumentError, "Parameter `object_id` is required when calling `delete_synonym`."
986
1051
  end
987
1052
 
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))
1053
+ path = '/1/indexes/{indexName}/synonyms/{objectID}'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
1054
+ Transport.encode_uri(object_id.to_s))
990
1055
  query_params = {}
991
1056
  query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
992
1057
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
@@ -1006,8 +1071,10 @@ module Algolia
1006
1071
  @api_client.call_api(:DELETE, path, new_options)
1007
1072
  end
1008
1073
 
1009
- # Delete a synonym.
1010
1074
  # Delete a synonym by its `objectID`. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
1075
+ #
1076
+ # Required API Key ACLs:
1077
+ # - editSettings
1011
1078
  # @param index_name [String] Index on which to perform the request. (required)
1012
1079
  # @param object_id [String] Unique identifier of a synonym object. (required)
1013
1080
  # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
@@ -1015,11 +1082,11 @@ module Algolia
1015
1082
  # @return [DeletedAtResponse]
1016
1083
  def delete_synonym(index_name, object_id, forward_to_replicas = nil, request_options = {})
1017
1084
  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')
1085
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::DeletedAtResponse')
1019
1086
  end
1020
1087
 
1021
- # Get API key permissions.
1022
1088
  # 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.
1089
+
1023
1090
  # @param key [String] API key. (required)
1024
1091
  # @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
1092
  # @return [Http::Response] the response
@@ -1029,7 +1096,7 @@ module Algolia
1029
1096
  raise ArgumentError, "Parameter `key` is required when calling `get_api_key`."
1030
1097
  end
1031
1098
 
1032
- path = '/1/keys/{key}'.sub('{' + 'key' + '}', @api_client.encode_uri(key.to_s))
1099
+ path = '/1/keys/{key}'.sub('{' + 'key' + '}', Transport.encode_uri(key.to_s))
1033
1100
  query_params = {}
1034
1101
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1035
1102
  header_params = {}
@@ -1048,18 +1115,20 @@ module Algolia
1048
1115
  @api_client.call_api(:GET, path, new_options)
1049
1116
  end
1050
1117
 
1051
- # Get API key permissions.
1052
1118
  # 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.
1119
+
1053
1120
  # @param key [String] API key. (required)
1054
1121
  # @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
1122
  # @return [GetApiKeyResponse]
1056
1123
  def get_api_key(key, request_options = {})
1057
1124
  response = get_api_key_with_http_info(key, request_options)
1058
- deserialize(response.body, request_options[:debug_return_type] || 'Search::GetApiKeyResponse')
1125
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::GetApiKeyResponse')
1059
1126
  end
1060
1127
 
1061
- # List available languages.
1062
1128
  # 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.
1129
+ #
1130
+ # Required API Key ACLs:
1131
+ # - settings
1063
1132
  # @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
1133
  # @return [Http::Response] the response
1065
1134
  def get_dictionary_languages_with_http_info(request_options = {})
@@ -1082,17 +1151,21 @@ module Algolia
1082
1151
  @api_client.call_api(:GET, path, new_options)
1083
1152
  end
1084
1153
 
1085
- # List available languages.
1086
1154
  # 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.
1155
+ #
1156
+ # Required API Key ACLs:
1157
+ # - settings
1087
1158
  # @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
1159
  # @return [Hash<String, Languages>]
1089
1160
  def get_dictionary_languages(request_options = {})
1090
1161
  response = get_dictionary_languages_with_http_info(request_options)
1091
- deserialize(response.body, request_options[:debug_return_type] || 'Search::Hash<String, Languages>')
1162
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::Hash<String, Languages>')
1092
1163
  end
1093
1164
 
1094
- # Get stop word settings.
1095
1165
  # Get the languages for which [stop words are turned off](#tag/Dictionaries/operation/setDictionarySettings).
1166
+ #
1167
+ # Required API Key ACLs:
1168
+ # - settings
1096
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)
1097
1170
  # @return [Http::Response] the response
1098
1171
  def get_dictionary_settings_with_http_info(request_options = {})
@@ -1115,17 +1188,21 @@ module Algolia
1115
1188
  @api_client.call_api(:GET, path, new_options)
1116
1189
  end
1117
1190
 
1118
- # Get stop word settings.
1119
1191
  # Get the languages for which [stop words are turned off](#tag/Dictionaries/operation/setDictionarySettings).
1192
+ #
1193
+ # Required API Key ACLs:
1194
+ # - settings
1120
1195
  # @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
1196
  # @return [GetDictionarySettingsResponse]
1122
1197
  def get_dictionary_settings(request_options = {})
1123
1198
  response = get_dictionary_settings_with_http_info(request_options)
1124
- deserialize(response.body, request_options[:debug_return_type] || 'Search::GetDictionarySettingsResponse')
1199
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::GetDictionarySettingsResponse')
1125
1200
  end
1126
1201
 
1127
- # Return the latest log entries.
1128
1202
  # 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).
1203
+ #
1204
+ # Required API Key ACLs:
1205
+ # - logs
1129
1206
  # @param offset [Integer] First log entry to retrieve. Sorted by decreasing date with 0 being the most recent. (default to 0)
1130
1207
  # @param length [Integer] Maximum number of entries to retrieve. (default to 10)
1131
1208
  # @param index_name [String] Index for which log entries should be retrieved. When omitted, log entries are retrieved for all indices.
@@ -1160,8 +1237,10 @@ module Algolia
1160
1237
  @api_client.call_api(:GET, path, new_options)
1161
1238
  end
1162
1239
 
1163
- # Return the latest log entries.
1164
1240
  # 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).
1241
+ #
1242
+ # Required API Key ACLs:
1243
+ # - logs
1165
1244
  # @param offset [Integer] First log entry to retrieve. Sorted by decreasing date with 0 being the most recent. (default to 0)
1166
1245
  # @param length [Integer] Maximum number of entries to retrieve. (default to 10)
1167
1246
  # @param index_name [String] Index for which log entries should be retrieved. When omitted, log entries are retrieved for all indices.
@@ -1170,11 +1249,13 @@ module Algolia
1170
1249
  # @return [GetLogsResponse]
1171
1250
  def get_logs(offset = nil, length = nil, index_name = nil, type = nil, request_options = {})
1172
1251
  response = get_logs_with_http_info(offset, length, index_name, type, request_options)
1173
- deserialize(response.body, request_options[:debug_return_type] || 'Search::GetLogsResponse')
1252
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::GetLogsResponse')
1174
1253
  end
1175
1254
 
1176
- # Get a record.
1177
1255
  # To get more than one record, use the [&#x60;objects&#x60; operation](#tag/Records/operation/getObjects).
1256
+ #
1257
+ # Required API Key ACLs:
1258
+ # - search
1178
1259
  # @param index_name [String] Index on which to perform the request. (required)
1179
1260
  # @param object_id [String] Unique record (object) identifier. (required)
1180
1261
  # @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.
@@ -1190,8 +1271,8 @@ module Algolia
1190
1271
  raise ArgumentError, "Parameter `object_id` is required when calling `get_object`."
1191
1272
  end
1192
1273
 
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))
1274
+ path = '/1/indexes/{indexName}/{objectID}'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
1275
+ Transport.encode_uri(object_id.to_s))
1195
1276
  query_params = {}
1196
1277
  query_params[:attributesToRetrieve] = @api_client.build_collection_param(attributes_to_retrieve, :multi) unless attributes_to_retrieve.nil?
1197
1278
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
@@ -1211,8 +1292,10 @@ module Algolia
1211
1292
  @api_client.call_api(:GET, path, new_options)
1212
1293
  end
1213
1294
 
1214
- # Get a record.
1215
1295
  # To get more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
1296
+ #
1297
+ # Required API Key ACLs:
1298
+ # - search
1216
1299
  # @param index_name [String] Index on which to perform the request. (required)
1217
1300
  # @param object_id [String] Unique record (object) identifier. (required)
1218
1301
  # @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.
@@ -1220,11 +1303,13 @@ module Algolia
1220
1303
  # @return [Hash<String, String>]
1221
1304
  def get_object(index_name, object_id, attributes_to_retrieve = nil, request_options = {})
1222
1305
  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>')
1306
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::Hash<String, String>')
1224
1307
  end
1225
1308
 
1226
- # Get multiple records.
1227
1309
  # 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.
1310
+ #
1311
+ # Required API Key ACLs:
1312
+ # - search
1228
1313
  # @param get_objects_params [GetObjectsParams] Request object. (required)
1229
1314
  # @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
1315
  # @return [Http::Response] the response
@@ -1247,24 +1332,28 @@ module Algolia
1247
1332
  :header_params => header_params,
1248
1333
  :query_params => query_params,
1249
1334
  :body => post_body,
1250
- :use_read_transporter => false
1335
+ :use_read_transporter => true
1251
1336
  )
1252
1337
 
1253
1338
  @api_client.call_api(:POST, path, new_options)
1254
1339
  end
1255
1340
 
1256
- # Get multiple records.
1257
1341
  # 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.
1342
+ #
1343
+ # Required API Key ACLs:
1344
+ # - search
1258
1345
  # @param get_objects_params [GetObjectsParams] Request object. (required)
1259
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)
1260
1347
  # @return [GetObjectsResponse]
1261
1348
  def get_objects(get_objects_params, request_options = {})
1262
1349
  response = get_objects_with_http_info(get_objects_params, request_options)
1263
- deserialize(response.body, request_options[:debug_return_type] || 'Search::GetObjectsResponse')
1350
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::GetObjectsResponse')
1264
1351
  end
1265
1352
 
1266
- # Get a rule.
1267
1353
  # 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).
1354
+ #
1355
+ # Required API Key ACLs:
1356
+ # - settings
1268
1357
  # @param index_name [String] Index on which to perform the request. (required)
1269
1358
  # @param object_id [String] Unique identifier of a rule object. (required)
1270
1359
  # @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)
@@ -1279,8 +1368,8 @@ module Algolia
1279
1368
  raise ArgumentError, "Parameter `object_id` is required when calling `get_rule`."
1280
1369
  end
1281
1370
 
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))
1371
+ path = '/1/indexes/{indexName}/rules/{objectID}'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
1372
+ Transport.encode_uri(object_id.to_s))
1284
1373
  query_params = {}
1285
1374
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1286
1375
  header_params = {}
@@ -1299,19 +1388,23 @@ module Algolia
1299
1388
  @api_client.call_api(:GET, path, new_options)
1300
1389
  end
1301
1390
 
1302
- # Get a rule.
1303
1391
  # Get a rule by its `objectID`. To find the `objectID` for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
1392
+ #
1393
+ # Required API Key ACLs:
1394
+ # - settings
1304
1395
  # @param index_name [String] Index on which to perform the request. (required)
1305
1396
  # @param object_id [String] Unique identifier of a rule object. (required)
1306
1397
  # @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
1398
  # @return [Rule]
1308
1399
  def get_rule(index_name, object_id, request_options = {})
1309
1400
  response = get_rule_with_http_info(index_name, object_id, request_options)
1310
- deserialize(response.body, request_options[:debug_return_type] || 'Search::Rule')
1401
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::Rule')
1311
1402
  end
1312
1403
 
1313
- # Get index settings.
1314
1404
  # Return an object containing an index&#39;s [configuration settings](https://www.algolia.com/doc/api-reference/settings-api-parameters/).
1405
+ #
1406
+ # Required API Key ACLs:
1407
+ # - search
1315
1408
  # @param index_name [String] Index on which to perform the request. (required)
1316
1409
  # @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
1410
  # @return [Http::Response] the response
@@ -1321,7 +1414,7 @@ module Algolia
1321
1414
  raise ArgumentError, "Parameter `index_name` is required when calling `get_settings`."
1322
1415
  end
1323
1416
 
1324
- path = '/1/indexes/{indexName}/settings'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
1417
+ path = '/1/indexes/{indexName}/settings'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s))
1325
1418
  query_params = {}
1326
1419
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1327
1420
  header_params = {}
@@ -1340,18 +1433,22 @@ module Algolia
1340
1433
  @api_client.call_api(:GET, path, new_options)
1341
1434
  end
1342
1435
 
1343
- # Get index settings.
1344
1436
  # Return an object containing an index's [configuration settings](https://www.algolia.com/doc/api-reference/settings-api-parameters/).
1437
+ #
1438
+ # Required API Key ACLs:
1439
+ # - search
1345
1440
  # @param index_name [String] Index on which to perform the request. (required)
1346
1441
  # @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
1442
  # @return [IndexSettings]
1348
1443
  def get_settings(index_name, request_options = {})
1349
1444
  response = get_settings_with_http_info(index_name, request_options)
1350
- deserialize(response.body, request_options[:debug_return_type] || 'Search::IndexSettings')
1445
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::IndexSettings')
1351
1446
  end
1352
1447
 
1353
- # Get all allowed IP addresses.
1354
1448
  # Get all allowed sources (IP addresses).
1449
+ #
1450
+ # Required API Key ACLs:
1451
+ # - admin
1355
1452
  # @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
1453
  # @return [Http::Response] the response
1357
1454
  def get_sources_with_http_info(request_options = {})
@@ -1374,17 +1471,21 @@ module Algolia
1374
1471
  @api_client.call_api(:GET, path, new_options)
1375
1472
  end
1376
1473
 
1377
- # Get all allowed IP addresses.
1378
1474
  # Get all allowed sources (IP addresses).
1475
+ #
1476
+ # Required API Key ACLs:
1477
+ # - admin
1379
1478
  # @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
1479
  # @return [Array<Source>]
1381
1480
  def get_sources(request_options = {})
1382
1481
  response = get_sources_with_http_info(request_options)
1383
- deserialize(response.body, request_options[:debug_return_type] || 'Array<Search::Source>')
1482
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Array<Search::Source>')
1384
1483
  end
1385
1484
 
1386
- # Get a synonym object.
1387
1485
  # 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).
1486
+ #
1487
+ # Required API Key ACLs:
1488
+ # - settings
1388
1489
  # @param index_name [String] Index on which to perform the request. (required)
1389
1490
  # @param object_id [String] Unique identifier of a synonym object. (required)
1390
1491
  # @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)
@@ -1399,8 +1500,8 @@ module Algolia
1399
1500
  raise ArgumentError, "Parameter `object_id` is required when calling `get_synonym`."
1400
1501
  end
1401
1502
 
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))
1503
+ path = '/1/indexes/{indexName}/synonyms/{objectID}'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
1504
+ Transport.encode_uri(object_id.to_s))
1404
1505
  query_params = {}
1405
1506
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1406
1507
  header_params = {}
@@ -1419,19 +1520,23 @@ module Algolia
1419
1520
  @api_client.call_api(:GET, path, new_options)
1420
1521
  end
1421
1522
 
1422
- # Get a synonym object.
1423
1523
  # Get a syonym by its `objectID`. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
1524
+ #
1525
+ # Required API Key ACLs:
1526
+ # - settings
1424
1527
  # @param index_name [String] Index on which to perform the request. (required)
1425
1528
  # @param object_id [String] Unique identifier of a synonym object. (required)
1426
1529
  # @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
1530
  # @return [SynonymHit]
1428
1531
  def get_synonym(index_name, object_id, request_options = {})
1429
1532
  response = get_synonym_with_http_info(index_name, object_id, request_options)
1430
- deserialize(response.body, request_options[:debug_return_type] || 'Search::SynonymHit')
1533
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::SynonymHit')
1431
1534
  end
1432
1535
 
1433
- # Check a task&#39;s status.
1434
1536
  # 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.
1537
+ #
1538
+ # Required API Key ACLs:
1539
+ # - addObject
1435
1540
  # @param index_name [String] Index on which to perform the request. (required)
1436
1541
  # @param task_id [Integer] Unique task identifier. (required)
1437
1542
  # @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)
@@ -1446,8 +1551,8 @@ module Algolia
1446
1551
  raise ArgumentError, "Parameter `task_id` is required when calling `get_task`."
1447
1552
  end
1448
1553
 
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))
1554
+ path = '/1/indexes/{indexName}/task/{taskID}'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s)).sub('{' + 'taskID' + '}',
1555
+ Transport.encode_uri(task_id.to_s))
1451
1556
  query_params = {}
1452
1557
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1453
1558
  header_params = {}
@@ -1466,19 +1571,23 @@ module Algolia
1466
1571
  @api_client.call_api(:GET, path, new_options)
1467
1572
  end
1468
1573
 
1469
- # Check a task's status.
1470
1574
  # Some operations, such as copying an index, will respond with a `taskID` value. Use this value here to check the status of that task.
1575
+ #
1576
+ # Required API Key ACLs:
1577
+ # - addObject
1471
1578
  # @param index_name [String] Index on which to perform the request. (required)
1472
1579
  # @param task_id [Integer] Unique task identifier. (required)
1473
1580
  # @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
1581
  # @return [GetTaskResponse]
1475
1582
  def get_task(index_name, task_id, request_options = {})
1476
1583
  response = get_task_with_http_info(index_name, task_id, request_options)
1477
- deserialize(response.body, request_options[:debug_return_type] || 'Search::GetTaskResponse')
1584
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::GetTaskResponse')
1478
1585
  end
1479
1586
 
1480
- # Get top userID.
1481
1587
  # 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.
1588
+ #
1589
+ # Required API Key ACLs:
1590
+ # - admin
1482
1591
  # @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
1592
  # @return [Http::Response] the response
1484
1593
  def get_top_user_ids_with_http_info(request_options = {})
@@ -1501,17 +1610,21 @@ module Algolia
1501
1610
  @api_client.call_api(:GET, path, new_options)
1502
1611
  end
1503
1612
 
1504
- # Get top userID.
1505
1613
  # 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.
1614
+ #
1615
+ # Required API Key ACLs:
1616
+ # - admin
1506
1617
  # @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
1618
  # @return [GetTopUserIdsResponse]
1508
1619
  def get_top_user_ids(request_options = {})
1509
1620
  response = get_top_user_ids_with_http_info(request_options)
1510
- deserialize(response.body, request_options[:debug_return_type] || 'Search::GetTopUserIdsResponse')
1621
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::GetTopUserIdsResponse')
1511
1622
  end
1512
1623
 
1513
- # Get userID.
1514
1624
  # 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.
1625
+ #
1626
+ # Required API Key ACLs:
1627
+ # - admin
1515
1628
  # @param user_id [String] userID to assign. (required)
1516
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)
1517
1630
  # @return [Http::Response] the response
@@ -1526,7 +1639,7 @@ module Algolia
1526
1639
  raise ArgumentError, "invalid value for 'user_id' when calling SearchClient.get_user_id, must conform to the pattern #{pattern}."
1527
1640
  end
1528
1641
 
1529
- path = '/1/clusters/mapping/{userID}'.sub('{' + 'userID' + '}', @api_client.encode_uri(user_id.to_s))
1642
+ path = '/1/clusters/mapping/{userID}'.sub('{' + 'userID' + '}', Transport.encode_uri(user_id.to_s))
1530
1643
  query_params = {}
1531
1644
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1532
1645
  header_params = {}
@@ -1545,18 +1658,22 @@ module Algolia
1545
1658
  @api_client.call_api(:GET, path, new_options)
1546
1659
  end
1547
1660
 
1548
- # Get userID.
1549
1661
  # 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.
1662
+ #
1663
+ # Required API Key ACLs:
1664
+ # - admin
1550
1665
  # @param user_id [String] userID to assign. (required)
1551
1666
  # @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
1667
  # @return [UserId]
1553
1668
  def get_user_id(user_id, request_options = {})
1554
1669
  response = get_user_id_with_http_info(user_id, request_options)
1555
- deserialize(response.body, request_options[:debug_return_type] || 'Search::UserId')
1670
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::UserId')
1556
1671
  end
1557
1672
 
1558
- # Get migration and user mapping status.
1559
1673
  # 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.
1674
+ #
1675
+ # Required API Key ACLs:
1676
+ # - admin
1560
1677
  # @param get_clusters [Boolean] Indicates whether to include the cluster&#39;s pending mapping state in the response.
1561
1678
  # @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
1679
  # @return [Http::Response] the response
@@ -1581,18 +1698,22 @@ module Algolia
1581
1698
  @api_client.call_api(:GET, path, new_options)
1582
1699
  end
1583
1700
 
1584
- # Get migration and user mapping status.
1585
1701
  # 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.
1702
+ #
1703
+ # Required API Key ACLs:
1704
+ # - admin
1586
1705
  # @param get_clusters [Boolean] Indicates whether to include the cluster&#39;s pending mapping state in the response.
1587
1706
  # @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
1707
  # @return [HasPendingMappingsResponse]
1589
1708
  def has_pending_mappings(get_clusters = nil, request_options = {})
1590
1709
  response = has_pending_mappings_with_http_info(get_clusters, request_options)
1591
- deserialize(response.body, request_options[:debug_return_type] || 'Search::HasPendingMappingsResponse')
1710
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::HasPendingMappingsResponse')
1592
1711
  end
1593
1712
 
1594
- # List API keys.
1595
1713
  # List all API keys associated with your Algolia application, including their permissions and restrictions.
1714
+ #
1715
+ # Required API Key ACLs:
1716
+ # - admin
1596
1717
  # @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
1718
  # @return [Http::Response] the response
1598
1719
  def list_api_keys_with_http_info(request_options = {})
@@ -1615,17 +1736,21 @@ module Algolia
1615
1736
  @api_client.call_api(:GET, path, new_options)
1616
1737
  end
1617
1738
 
1618
- # List API keys.
1619
1739
  # List all API keys associated with your Algolia application, including their permissions and restrictions.
1740
+ #
1741
+ # Required API Key ACLs:
1742
+ # - admin
1620
1743
  # @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
1744
  # @return [ListApiKeysResponse]
1622
1745
  def list_api_keys(request_options = {})
1623
1746
  response = list_api_keys_with_http_info(request_options)
1624
- deserialize(response.body, request_options[:debug_return_type] || 'Search::ListApiKeysResponse')
1747
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::ListApiKeysResponse')
1625
1748
  end
1626
1749
 
1627
- # List clusters.
1628
1750
  # List the available clusters in a multi-cluster setup.
1751
+ #
1752
+ # Required API Key ACLs:
1753
+ # - admin
1629
1754
  # @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
1755
  # @return [Http::Response] the response
1631
1756
  def list_clusters_with_http_info(request_options = {})
@@ -1648,17 +1773,21 @@ module Algolia
1648
1773
  @api_client.call_api(:GET, path, new_options)
1649
1774
  end
1650
1775
 
1651
- # List clusters.
1652
1776
  # List the available clusters in a multi-cluster setup.
1777
+ #
1778
+ # Required API Key ACLs:
1779
+ # - admin
1653
1780
  # @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
1781
  # @return [ListClustersResponse]
1655
1782
  def list_clusters(request_options = {})
1656
1783
  response = list_clusters_with_http_info(request_options)
1657
- deserialize(response.body, request_options[:debug_return_type] || 'Search::ListClustersResponse')
1784
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::ListClustersResponse')
1658
1785
  end
1659
1786
 
1660
- # List indices.
1661
1787
  # List indices in an Algolia application.
1788
+ #
1789
+ # Required API Key ACLs:
1790
+ # - listIndexes
1662
1791
  # @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
1792
  # @param hits_per_page [Integer] Maximum number of hits per page. (default to 100)
1664
1793
  # @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)
@@ -1689,19 +1818,23 @@ module Algolia
1689
1818
  @api_client.call_api(:GET, path, new_options)
1690
1819
  end
1691
1820
 
1692
- # List indices.
1693
1821
  # List indices in an Algolia application.
1822
+ #
1823
+ # Required API Key ACLs:
1824
+ # - listIndexes
1694
1825
  # @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
1826
  # @param hits_per_page [Integer] Maximum number of hits per page. (default to 100)
1696
1827
  # @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
1828
  # @return [ListIndicesResponse]
1698
1829
  def list_indices(page = nil, hits_per_page = nil, request_options = {})
1699
1830
  response = list_indices_with_http_info(page, hits_per_page, request_options)
1700
- deserialize(response.body, request_options[:debug_return_type] || 'Search::ListIndicesResponse')
1831
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::ListIndicesResponse')
1701
1832
  end
1702
1833
 
1703
- # List userIDs.
1704
1834
  # 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.
1835
+ #
1836
+ # Required API Key ACLs:
1837
+ # - admin
1705
1838
  # @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
1839
  # @param hits_per_page [Integer] Maximum number of hits per page. (default to 100)
1707
1840
  # @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)
@@ -1732,19 +1865,21 @@ module Algolia
1732
1865
  @api_client.call_api(:GET, path, new_options)
1733
1866
  end
1734
1867
 
1735
- # List userIDs.
1736
1868
  # 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.
1869
+ #
1870
+ # Required API Key ACLs:
1871
+ # - admin
1737
1872
  # @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
1873
  # @param hits_per_page [Integer] Maximum number of hits per page. (default to 100)
1739
1874
  # @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
1875
  # @return [ListUserIdsResponse]
1741
1876
  def list_user_ids(page = nil, hits_per_page = nil, request_options = {})
1742
1877
  response = list_user_ids_with_http_info(page, hits_per_page, request_options)
1743
- deserialize(response.body, request_options[:debug_return_type] || 'Search::ListUserIdsResponse')
1878
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::ListUserIdsResponse')
1744
1879
  end
1745
1880
 
1746
- # Batch write operations on multiple indices.
1747
1881
  # 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.
1882
+
1748
1883
  # @param batch_params [BatchParams] (required)
1749
1884
  # @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
1885
  # @return [Http::Response] the response
@@ -1773,18 +1908,20 @@ module Algolia
1773
1908
  @api_client.call_api(:POST, path, new_options)
1774
1909
  end
1775
1910
 
1776
- # Batch write operations on multiple indices.
1777
1911
  # 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.
1912
+
1778
1913
  # @param batch_params [BatchParams] (required)
1779
1914
  # @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
1915
  # @return [MultipleBatchResponse]
1781
1916
  def multiple_batch(batch_params, request_options = {})
1782
1917
  response = multiple_batch_with_http_info(batch_params, request_options)
1783
- deserialize(response.body, request_options[:debug_return_type] || 'Search::MultipleBatchResponse')
1918
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::MultipleBatchResponse')
1784
1919
  end
1785
1920
 
1786
- # Copy, move, or rename an index.
1787
1921
  # 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/).
1922
+ #
1923
+ # Required API Key ACLs:
1924
+ # - addObject
1788
1925
  # @param index_name [String] Index on which to perform the request. (required)
1789
1926
  # @param operation_index_params [OperationIndexParams] (required)
1790
1927
  # @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)
@@ -1799,7 +1936,7 @@ module Algolia
1799
1936
  raise ArgumentError, "Parameter `operation_index_params` is required when calling `operation_index`."
1800
1937
  end
1801
1938
 
1802
- path = '/1/indexes/{indexName}/operation'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
1939
+ path = '/1/indexes/{indexName}/operation'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s))
1803
1940
  query_params = {}
1804
1941
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1805
1942
  header_params = {}
@@ -1818,19 +1955,23 @@ module Algolia
1818
1955
  @api_client.call_api(:POST, path, new_options)
1819
1956
  end
1820
1957
 
1821
- # Copy, move, or rename an index.
1822
1958
  # 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/).
1959
+ #
1960
+ # Required API Key ACLs:
1961
+ # - addObject
1823
1962
  # @param index_name [String] Index on which to perform the request. (required)
1824
1963
  # @param operation_index_params [OperationIndexParams] (required)
1825
1964
  # @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
1965
  # @return [UpdatedAtResponse]
1827
1966
  def operation_index(index_name, operation_index_params, request_options = {})
1828
1967
  response = operation_index_with_http_info(index_name, operation_index_params, request_options)
1829
- deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
1968
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
1830
1969
  end
1831
1970
 
1832
- # Update record attributes.
1833
1971
  # 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.
1972
+ #
1973
+ # Required API Key ACLs:
1974
+ # - addObject
1834
1975
  # @param index_name [String] Index on which to perform the request. (required)
1835
1976
  # @param object_id [String] Unique record (object) identifier. (required)
1836
1977
  # @param attributes_to_update [Hash<String, AttributeToUpdate>] Object with attributes to update. (required)
@@ -1851,8 +1992,8 @@ module Algolia
1851
1992
  raise ArgumentError, "Parameter `attributes_to_update` is required when calling `partial_update_object`."
1852
1993
  end
1853
1994
 
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))
1995
+ path = '/1/indexes/{indexName}/{objectID}/partial'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
1996
+ Transport.encode_uri(object_id.to_s))
1856
1997
  query_params = {}
1857
1998
  query_params[:createIfNotExists] = create_if_not_exists unless create_if_not_exists.nil?
1858
1999
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
@@ -1872,8 +2013,10 @@ module Algolia
1872
2013
  @api_client.call_api(:POST, path, new_options)
1873
2014
  end
1874
2015
 
1875
- # Update record attributes.
1876
2016
  # 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.
2017
+ #
2018
+ # Required API Key ACLs:
2019
+ # - addObject
1877
2020
  # @param index_name [String] Index on which to perform the request. (required)
1878
2021
  # @param object_id [String] Unique record (object) identifier. (required)
1879
2022
  # @param attributes_to_update [Hash<String, AttributeToUpdate>] Object with attributes to update. (required)
@@ -1882,11 +2025,13 @@ module Algolia
1882
2025
  # @return [UpdatedAtWithObjectIdResponse]
1883
2026
  def partial_update_object(index_name, object_id, attributes_to_update, create_if_not_exists = nil, request_options = {})
1884
2027
  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')
2028
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtWithObjectIdResponse')
1886
2029
  end
1887
2030
 
1888
- # Remove userID.
1889
2031
  # Remove a userID and its associated data from the multi-clusters.
2032
+ #
2033
+ # Required API Key ACLs:
2034
+ # - admin
1890
2035
  # @param user_id [String] userID to assign. (required)
1891
2036
  # @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
2037
  # @return [Http::Response] the response
@@ -1901,7 +2046,7 @@ module Algolia
1901
2046
  raise ArgumentError, "invalid value for 'user_id' when calling SearchClient.remove_user_id, must conform to the pattern #{pattern}."
1902
2047
  end
1903
2048
 
1904
- path = '/1/clusters/mapping/{userID}'.sub('{' + 'userID' + '}', @api_client.encode_uri(user_id.to_s))
2049
+ path = '/1/clusters/mapping/{userID}'.sub('{' + 'userID' + '}', Transport.encode_uri(user_id.to_s))
1905
2050
  query_params = {}
1906
2051
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1907
2052
  header_params = {}
@@ -1920,18 +2065,22 @@ module Algolia
1920
2065
  @api_client.call_api(:DELETE, path, new_options)
1921
2066
  end
1922
2067
 
1923
- # Remove userID.
1924
2068
  # Remove a userID and its associated data from the multi-clusters.
2069
+ #
2070
+ # Required API Key ACLs:
2071
+ # - admin
1925
2072
  # @param user_id [String] userID to assign. (required)
1926
2073
  # @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
2074
  # @return [RemoveUserIdResponse]
1928
2075
  def remove_user_id(user_id, request_options = {})
1929
2076
  response = remove_user_id_with_http_info(user_id, request_options)
1930
- deserialize(response.body, request_options[:debug_return_type] || 'Search::RemoveUserIdResponse')
2077
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::RemoveUserIdResponse')
1931
2078
  end
1932
2079
 
1933
- # Replace all sources.
1934
2080
  # Replace all allowed sources.
2081
+ #
2082
+ # Required API Key ACLs:
2083
+ # - admin
1935
2084
  # @param source [Array<Source>] Allowed sources. (required)
1936
2085
  # @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
2086
  # @return [Http::Response] the response
@@ -1960,18 +2109,22 @@ module Algolia
1960
2109
  @api_client.call_api(:PUT, path, new_options)
1961
2110
  end
1962
2111
 
1963
- # Replace all sources.
1964
2112
  # Replace all allowed sources.
2113
+ #
2114
+ # Required API Key ACLs:
2115
+ # - admin
1965
2116
  # @param source [Array<Source>] Allowed sources. (required)
1966
2117
  # @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
2118
  # @return [ReplaceSourceResponse]
1968
2119
  def replace_sources(source, request_options = {})
1969
2120
  response = replace_sources_with_http_info(source, request_options)
1970
- deserialize(response.body, request_options[:debug_return_type] || 'Search::ReplaceSourceResponse')
2121
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::ReplaceSourceResponse')
1971
2122
  end
1972
2123
 
1973
- # Restore API key.
1974
2124
  # Restore a deleted API key, along with its associated permissions. The request must be authenticated with the admin API key.
2125
+ #
2126
+ # Required API Key ACLs:
2127
+ # - admin
1975
2128
  # @param key [String] API key. (required)
1976
2129
  # @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
2130
  # @return [Http::Response] the response
@@ -1981,7 +2134,7 @@ module Algolia
1981
2134
  raise ArgumentError, "Parameter `key` is required when calling `restore_api_key`."
1982
2135
  end
1983
2136
 
1984
- path = '/1/keys/{key}/restore'.sub('{' + 'key' + '}', @api_client.encode_uri(key.to_s))
2137
+ path = '/1/keys/{key}/restore'.sub('{' + 'key' + '}', Transport.encode_uri(key.to_s))
1985
2138
  query_params = {}
1986
2139
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1987
2140
  header_params = {}
@@ -2000,18 +2153,22 @@ module Algolia
2000
2153
  @api_client.call_api(:POST, path, new_options)
2001
2154
  end
2002
2155
 
2003
- # Restore API key.
2004
2156
  # Restore a deleted API key, along with its associated permissions. The request must be authenticated with the admin API key.
2157
+ #
2158
+ # Required API Key ACLs:
2159
+ # - admin
2005
2160
  # @param key [String] API key. (required)
2006
2161
  # @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
2162
  # @return [AddApiKeyResponse]
2008
2163
  def restore_api_key(key, request_options = {})
2009
2164
  response = restore_api_key_with_http_info(key, request_options)
2010
- deserialize(response.body, request_options[:debug_return_type] || 'Search::AddApiKeyResponse')
2165
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::AddApiKeyResponse')
2011
2166
  end
2012
2167
 
2013
- # Add or update a record.
2014
2168
  # 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).
2169
+ #
2170
+ # Required API Key ACLs:
2171
+ # - addObject
2015
2172
  # @param index_name [String] Index on which to perform the request. (required)
2016
2173
  # @param body [Object] The Algolia record. (required)
2017
2174
  # @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)
@@ -2026,7 +2183,7 @@ module Algolia
2026
2183
  raise ArgumentError, "Parameter `body` is required when calling `save_object`."
2027
2184
  end
2028
2185
 
2029
- path = '/1/indexes/{indexName}'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
2186
+ path = '/1/indexes/{indexName}'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s))
2030
2187
  query_params = {}
2031
2188
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2032
2189
  header_params = {}
@@ -2045,19 +2202,23 @@ module Algolia
2045
2202
  @api_client.call_api(:POST, path, new_options)
2046
2203
  end
2047
2204
 
2048
- # Add or update a record.
2049
2205
  # 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).
2206
+ #
2207
+ # Required API Key ACLs:
2208
+ # - addObject
2050
2209
  # @param index_name [String] Index on which to perform the request. (required)
2051
2210
  # @param body [Object] The Algolia record. (required)
2052
2211
  # @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
2212
  # @return [SaveObjectResponse]
2054
2213
  def save_object(index_name, body, request_options = {})
2055
2214
  response = save_object_with_http_info(index_name, body, request_options)
2056
- deserialize(response.body, request_options[:debug_return_type] || 'Search::SaveObjectResponse')
2215
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::SaveObjectResponse')
2057
2216
  end
2058
2217
 
2059
- # Create or update a rule.
2060
2218
  # To create or update more than one rule, use the [&#x60;batch&#x60; operation](#tag/Rules/operation/saveRules).
2219
+ #
2220
+ # Required API Key ACLs:
2221
+ # - editSettings
2061
2222
  # @param index_name [String] Index on which to perform the request. (required)
2062
2223
  # @param object_id [String] Unique identifier of a rule object. (required)
2063
2224
  # @param rule [Rule] (required)
@@ -2078,8 +2239,8 @@ module Algolia
2078
2239
  raise ArgumentError, "Parameter `rule` is required when calling `save_rule`."
2079
2240
  end
2080
2241
 
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))
2242
+ path = '/1/indexes/{indexName}/rules/{objectID}'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
2243
+ Transport.encode_uri(object_id.to_s))
2083
2244
  query_params = {}
2084
2245
  query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
2085
2246
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
@@ -2099,8 +2260,10 @@ module Algolia
2099
2260
  @api_client.call_api(:PUT, path, new_options)
2100
2261
  end
2101
2262
 
2102
- # Create or update a rule.
2103
2263
  # To create or update more than one rule, use the [`batch` operation](#tag/Rules/operation/saveRules).
2264
+ #
2265
+ # Required API Key ACLs:
2266
+ # - editSettings
2104
2267
  # @param index_name [String] Index on which to perform the request. (required)
2105
2268
  # @param object_id [String] Unique identifier of a rule object. (required)
2106
2269
  # @param rule [Rule] (required)
@@ -2109,11 +2272,13 @@ module Algolia
2109
2272
  # @return [UpdatedRuleResponse]
2110
2273
  def save_rule(index_name, object_id, rule, forward_to_replicas = nil, request_options = {})
2111
2274
  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')
2275
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedRuleResponse')
2113
2276
  end
2114
2277
 
2115
- # Save a batch of rules.
2116
2278
  # Create or update multiple rules.
2279
+ #
2280
+ # Required API Key ACLs:
2281
+ # - editSettings
2117
2282
  # @param index_name [String] Index on which to perform the request. (required)
2118
2283
  # @param rules [Array<Rule>] (required)
2119
2284
  # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
@@ -2130,7 +2295,7 @@ module Algolia
2130
2295
  raise ArgumentError, "Parameter `rules` is required when calling `save_rules`."
2131
2296
  end
2132
2297
 
2133
- path = '/1/indexes/{indexName}/rules/batch'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
2298
+ path = '/1/indexes/{indexName}/rules/batch'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s))
2134
2299
  query_params = {}
2135
2300
  query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
2136
2301
  query_params[:clearExistingRules] = clear_existing_rules unless clear_existing_rules.nil?
@@ -2151,8 +2316,10 @@ module Algolia
2151
2316
  @api_client.call_api(:POST, path, new_options)
2152
2317
  end
2153
2318
 
2154
- # Save a batch of rules.
2155
2319
  # Create or update multiple rules.
2320
+ #
2321
+ # Required API Key ACLs:
2322
+ # - editSettings
2156
2323
  # @param index_name [String] Index on which to perform the request. (required)
2157
2324
  # @param rules [Array<Rule>] (required)
2158
2325
  # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
@@ -2161,11 +2328,13 @@ module Algolia
2161
2328
  # @return [UpdatedAtResponse]
2162
2329
  def save_rules(index_name, rules, forward_to_replicas = nil, clear_existing_rules = nil, request_options = {})
2163
2330
  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')
2331
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
2165
2332
  end
2166
2333
 
2167
- # Save a synonym.
2168
2334
  # 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).
2335
+ #
2336
+ # Required API Key ACLs:
2337
+ # - editSettings
2169
2338
  # @param index_name [String] Index on which to perform the request. (required)
2170
2339
  # @param object_id [String] Unique identifier of a synonym object. (required)
2171
2340
  # @param synonym_hit [SynonymHit] (required)
@@ -2186,8 +2355,8 @@ module Algolia
2186
2355
  raise ArgumentError, "Parameter `synonym_hit` is required when calling `save_synonym`."
2187
2356
  end
2188
2357
 
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))
2358
+ path = '/1/indexes/{indexName}/synonyms/{objectID}'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s)).sub('{' + 'objectID' + '}',
2359
+ Transport.encode_uri(object_id.to_s))
2191
2360
  query_params = {}
2192
2361
  query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
2193
2362
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
@@ -2207,8 +2376,10 @@ module Algolia
2207
2376
  @api_client.call_api(:PUT, path, new_options)
2208
2377
  end
2209
2378
 
2210
- # Save a synonym.
2211
2379
  # 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).
2380
+ #
2381
+ # Required API Key ACLs:
2382
+ # - editSettings
2212
2383
  # @param index_name [String] Index on which to perform the request. (required)
2213
2384
  # @param object_id [String] Unique identifier of a synonym object. (required)
2214
2385
  # @param synonym_hit [SynonymHit] (required)
@@ -2217,11 +2388,13 @@ module Algolia
2217
2388
  # @return [SaveSynonymResponse]
2218
2389
  def save_synonym(index_name, object_id, synonym_hit, forward_to_replicas = nil, request_options = {})
2219
2390
  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')
2391
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::SaveSynonymResponse')
2221
2392
  end
2222
2393
 
2223
- # Save a batch of synonyms.
2224
2394
  # Create or update multiple synonyms.
2395
+ #
2396
+ # Required API Key ACLs:
2397
+ # - editSettings
2225
2398
  # @param index_name [String] Index on which to perform the request. (required)
2226
2399
  # @param synonym_hit [Array<SynonymHit>] (required)
2227
2400
  # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
@@ -2238,7 +2411,7 @@ module Algolia
2238
2411
  raise ArgumentError, "Parameter `synonym_hit` is required when calling `save_synonyms`."
2239
2412
  end
2240
2413
 
2241
- path = '/1/indexes/{indexName}/synonyms/batch'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
2414
+ path = '/1/indexes/{indexName}/synonyms/batch'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s))
2242
2415
  query_params = {}
2243
2416
  query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
2244
2417
  query_params[:replaceExistingSynonyms] = replace_existing_synonyms unless replace_existing_synonyms.nil?
@@ -2259,8 +2432,10 @@ module Algolia
2259
2432
  @api_client.call_api(:POST, path, new_options)
2260
2433
  end
2261
2434
 
2262
- # Save a batch of synonyms.
2263
2435
  # Create or update multiple synonyms.
2436
+ #
2437
+ # Required API Key ACLs:
2438
+ # - editSettings
2264
2439
  # @param index_name [String] Index on which to perform the request. (required)
2265
2440
  # @param synonym_hit [Array<SynonymHit>] (required)
2266
2441
  # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
@@ -2269,11 +2444,13 @@ module Algolia
2269
2444
  # @return [UpdatedAtResponse]
2270
2445
  def save_synonyms(index_name, synonym_hit, forward_to_replicas = nil, replace_existing_synonyms = nil, request_options = {})
2271
2446
  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')
2447
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
2273
2448
  end
2274
2449
 
2275
- # Search multiple indices.
2276
2450
  # Send multiple search queries to one or more indices.
2451
+ #
2452
+ # Required API Key ACLs:
2453
+ # - search
2277
2454
  # @param search_method_params [SearchMethodParams] Query requests and strategies. Results will be received in the same order as the queries. (required)
2278
2455
  # @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
2456
  # @return [Http::Response] the response
@@ -2296,24 +2473,28 @@ module Algolia
2296
2473
  :header_params => header_params,
2297
2474
  :query_params => query_params,
2298
2475
  :body => post_body,
2299
- :use_read_transporter => false
2476
+ :use_read_transporter => true
2300
2477
  )
2301
2478
 
2302
2479
  @api_client.call_api(:POST, path, new_options)
2303
2480
  end
2304
2481
 
2305
- # Search multiple indices.
2306
2482
  # Send multiple search queries to one or more indices.
2483
+ #
2484
+ # Required API Key ACLs:
2485
+ # - search
2307
2486
  # @param search_method_params [SearchMethodParams] Query requests and strategies. Results will be received in the same order as the queries. (required)
2308
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)
2309
2488
  # @return [SearchResponses]
2310
2489
  def search(search_method_params, request_options = {})
2311
2490
  response = search_with_http_info(search_method_params, request_options)
2312
- deserialize(response.body, request_options[:debug_return_type] || 'Search::SearchResponses')
2491
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::SearchResponses')
2313
2492
  end
2314
2493
 
2315
- # Search dictionary entries.
2316
2494
  # 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.
2495
+ #
2496
+ # Required API Key ACLs:
2497
+ # - settings
2317
2498
  # @param dictionary_name [DictionaryType] Dictionary to search in. (required)
2318
2499
  # @param search_dictionary_entries_params [SearchDictionaryEntriesParams] (required)
2319
2500
  # @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)
@@ -2328,7 +2509,7 @@ module Algolia
2328
2509
  raise ArgumentError, "Parameter `search_dictionary_entries_params` is required when calling `search_dictionary_entries`."
2329
2510
  end
2330
2511
 
2331
- path = '/1/dictionaries/{dictionaryName}/search'.sub('{' + 'dictionaryName' + '}', @api_client.encode_uri(dictionary_name.to_s))
2512
+ path = '/1/dictionaries/{dictionaryName}/search'.sub('{' + 'dictionaryName' + '}', Transport.encode_uri(dictionary_name.to_s))
2332
2513
  query_params = {}
2333
2514
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2334
2515
  header_params = {}
@@ -2341,25 +2522,29 @@ module Algolia
2341
2522
  :header_params => header_params,
2342
2523
  :query_params => query_params,
2343
2524
  :body => post_body,
2344
- :use_read_transporter => false
2525
+ :use_read_transporter => true
2345
2526
  )
2346
2527
 
2347
2528
  @api_client.call_api(:POST, path, new_options)
2348
2529
  end
2349
2530
 
2350
- # Search dictionary entries.
2351
2531
  # 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.
2532
+ #
2533
+ # Required API Key ACLs:
2534
+ # - settings
2352
2535
  # @param dictionary_name [DictionaryType] Dictionary to search in. (required)
2353
2536
  # @param search_dictionary_entries_params [SearchDictionaryEntriesParams] (required)
2354
2537
  # @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
2538
  # @return [UpdatedAtResponse]
2356
2539
  def search_dictionary_entries(dictionary_name, search_dictionary_entries_params, request_options = {})
2357
2540
  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')
2541
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
2359
2542
  end
2360
2543
 
2361
- # Search for facet values.
2362
2544
  # [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;.
2545
+ #
2546
+ # Required API Key ACLs:
2547
+ # - search
2363
2548
  # @param index_name [String] Index on which to perform the request. (required)
2364
2549
  # @param facet_name [String] Facet name. (required)
2365
2550
  # @param search_for_facet_values_request [SearchForFacetValuesRequest]
@@ -2375,8 +2560,8 @@ module Algolia
2375
2560
  raise ArgumentError, "Parameter `facet_name` is required when calling `search_for_facet_values`."
2376
2561
  end
2377
2562
 
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))
2563
+ path = '/1/indexes/{indexName}/facets/{facetName}/query'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s)).sub('{' + 'facetName' + '}',
2564
+ Transport.encode_uri(facet_name.to_s))
2380
2565
  query_params = {}
2381
2566
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2382
2567
  header_params = {}
@@ -2389,14 +2574,16 @@ module Algolia
2389
2574
  :header_params => header_params,
2390
2575
  :query_params => query_params,
2391
2576
  :body => post_body,
2392
- :use_read_transporter => false
2577
+ :use_read_transporter => true
2393
2578
  )
2394
2579
 
2395
2580
  @api_client.call_api(:POST, path, new_options)
2396
2581
  end
2397
2582
 
2398
- # Search for facet values.
2399
2583
  # [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`.
2584
+ #
2585
+ # Required API Key ACLs:
2586
+ # - search
2400
2587
  # @param index_name [String] Index on which to perform the request. (required)
2401
2588
  # @param facet_name [String] Facet name. (required)
2402
2589
  # @param search_for_facet_values_request [SearchForFacetValuesRequest]
@@ -2404,11 +2591,13 @@ module Algolia
2404
2591
  # @return [SearchForFacetValuesResponse]
2405
2592
  def search_for_facet_values(index_name, facet_name, search_for_facet_values_request = nil, request_options = {})
2406
2593
  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')
2594
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::SearchForFacetValuesResponse')
2408
2595
  end
2409
2596
 
2410
- # Search for rules.
2411
2597
  # Search for rules in your index. You can control the search with parameters. To list all rules, send an empty request body.
2598
+ #
2599
+ # Required API Key ACLs:
2600
+ # - settings
2412
2601
  # @param index_name [String] Index on which to perform the request. (required)
2413
2602
  # @param search_rules_params [SearchRulesParams]
2414
2603
  # @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)
@@ -2419,7 +2608,7 @@ module Algolia
2419
2608
  raise ArgumentError, "Parameter `index_name` is required when calling `search_rules`."
2420
2609
  end
2421
2610
 
2422
- path = '/1/indexes/{indexName}/rules/search'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
2611
+ path = '/1/indexes/{indexName}/rules/search'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s))
2423
2612
  query_params = {}
2424
2613
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2425
2614
  header_params = {}
@@ -2432,25 +2621,29 @@ module Algolia
2432
2621
  :header_params => header_params,
2433
2622
  :query_params => query_params,
2434
2623
  :body => post_body,
2435
- :use_read_transporter => false
2624
+ :use_read_transporter => true
2436
2625
  )
2437
2626
 
2438
2627
  @api_client.call_api(:POST, path, new_options)
2439
2628
  end
2440
2629
 
2441
- # Search for rules.
2442
2630
  # Search for rules in your index. You can control the search with parameters. To list all rules, send an empty request body.
2631
+ #
2632
+ # Required API Key ACLs:
2633
+ # - settings
2443
2634
  # @param index_name [String] Index on which to perform the request. (required)
2444
2635
  # @param search_rules_params [SearchRulesParams]
2445
2636
  # @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
2637
  # @return [SearchRulesResponse]
2447
2638
  def search_rules(index_name, search_rules_params = nil, request_options = {})
2448
2639
  response = search_rules_with_http_info(index_name, search_rules_params, request_options)
2449
- deserialize(response.body, request_options[:debug_return_type] || 'Search::SearchRulesResponse')
2640
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::SearchRulesResponse')
2450
2641
  end
2451
2642
 
2452
- # Search an index.
2453
2643
  # Return records that match the query.
2644
+ #
2645
+ # Required API Key ACLs:
2646
+ # - search
2454
2647
  # @param index_name [String] Index on which to perform the request. (required)
2455
2648
  # @param search_params [SearchParams]
2456
2649
  # @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)
@@ -2461,7 +2654,7 @@ module Algolia
2461
2654
  raise ArgumentError, "Parameter `index_name` is required when calling `search_single_index`."
2462
2655
  end
2463
2656
 
2464
- path = '/1/indexes/{indexName}/query'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
2657
+ path = '/1/indexes/{indexName}/query'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s))
2465
2658
  query_params = {}
2466
2659
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2467
2660
  header_params = {}
@@ -2474,46 +2667,41 @@ module Algolia
2474
2667
  :header_params => header_params,
2475
2668
  :query_params => query_params,
2476
2669
  :body => post_body,
2477
- :use_read_transporter => false
2670
+ :use_read_transporter => true
2478
2671
  )
2479
2672
 
2480
2673
  @api_client.call_api(:POST, path, new_options)
2481
2674
  end
2482
2675
 
2483
- # Search an index.
2484
2676
  # Return records that match the query.
2677
+ #
2678
+ # Required API Key ACLs:
2679
+ # - search
2485
2680
  # @param index_name [String] Index on which to perform the request. (required)
2486
2681
  # @param search_params [SearchParams]
2487
2682
  # @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
2683
  # @return [SearchResponse]
2489
2684
  def search_single_index(index_name, search_params = nil, request_options = {})
2490
2685
  response = search_single_index_with_http_info(index_name, search_params, request_options)
2491
- deserialize(response.body, request_options[:debug_return_type] || 'Search::SearchResponse')
2686
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::SearchResponse')
2492
2687
  end
2493
2688
 
2494
- # Search for synonyms.
2495
2689
  # Search for synonyms in your index. You can control and filter the search with parameters. To get all synonyms, send an empty request body.
2690
+ #
2691
+ # Required API Key ACLs:
2692
+ # - settings
2496
2693
  # @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
2694
  # @param search_synonyms_params [SearchSynonymsParams] Body of the &#x60;searchSynonyms&#x60; operation.
2501
2695
  # @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
2696
  # @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 = {})
2697
+ def search_synonyms_with_http_info(index_name, search_synonyms_params = nil, request_options = {})
2504
2698
  # verify the required parameter 'index_name' is set
2505
2699
  if @api_client.config.client_side_validation && index_name.nil?
2506
2700
  raise ArgumentError, "Parameter `index_name` is required when calling `search_synonyms`."
2507
2701
  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
2702
 
2512
- path = '/1/indexes/{indexName}/synonyms/search'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
2703
+ path = '/1/indexes/{indexName}/synonyms/search'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s))
2513
2704
  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
2705
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2518
2706
  header_params = {}
2519
2707
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
@@ -2525,28 +2713,29 @@ module Algolia
2525
2713
  :header_params => header_params,
2526
2714
  :query_params => query_params,
2527
2715
  :body => post_body,
2528
- :use_read_transporter => false
2716
+ :use_read_transporter => true
2529
2717
  )
2530
2718
 
2531
2719
  @api_client.call_api(:POST, path, new_options)
2532
2720
  end
2533
2721
 
2534
- # Search for synonyms.
2535
2722
  # Search for synonyms in your index. You can control and filter the search with parameters. To get all synonyms, send an empty request body.
2723
+ #
2724
+ # Required API Key ACLs:
2725
+ # - settings
2536
2726
  # @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
2727
  # @param search_synonyms_params [SearchSynonymsParams] Body of the &#x60;searchSynonyms&#x60; operation.
2541
2728
  # @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
2729
  # @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')
2730
+ def search_synonyms(index_name, search_synonyms_params = nil, request_options = {})
2731
+ response = search_synonyms_with_http_info(index_name, search_synonyms_params, request_options)
2732
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::SearchSynonymsResponse')
2546
2733
  end
2547
2734
 
2548
- # Search for a user ID.
2549
2735
  # 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).
2736
+ #
2737
+ # Required API Key ACLs:
2738
+ # - admin
2550
2739
  # @param search_user_ids_params [SearchUserIdsParams] (required)
2551
2740
  # @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
2741
  # @return [Http::Response] the response
@@ -2569,24 +2758,28 @@ module Algolia
2569
2758
  :header_params => header_params,
2570
2759
  :query_params => query_params,
2571
2760
  :body => post_body,
2572
- :use_read_transporter => false
2761
+ :use_read_transporter => true
2573
2762
  )
2574
2763
 
2575
2764
  @api_client.call_api(:POST, path, new_options)
2576
2765
  end
2577
2766
 
2578
- # Search for a user ID.
2579
2767
  # 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).
2768
+ #
2769
+ # Required API Key ACLs:
2770
+ # - admin
2580
2771
  # @param search_user_ids_params [SearchUserIdsParams] (required)
2581
2772
  # @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
2773
  # @return [SearchUserIdsResponse]
2583
2774
  def search_user_ids(search_user_ids_params, request_options = {})
2584
2775
  response = search_user_ids_with_http_info(search_user_ids_params, request_options)
2585
- deserialize(response.body, request_options[:debug_return_type] || 'Search::SearchUserIdsResponse')
2776
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::SearchUserIdsResponse')
2586
2777
  end
2587
2778
 
2588
- # Set stop word settings.
2589
2779
  # Set stop word settings for a specific language.
2780
+ #
2781
+ # Required API Key ACLs:
2782
+ # - editSettings
2590
2783
  # @param dictionary_settings_params [DictionarySettingsParams] (required)
2591
2784
  # @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
2785
  # @return [Http::Response] the response
@@ -2615,18 +2808,22 @@ module Algolia
2615
2808
  @api_client.call_api(:PUT, path, new_options)
2616
2809
  end
2617
2810
 
2618
- # Set stop word settings.
2619
2811
  # Set stop word settings for a specific language.
2812
+ #
2813
+ # Required API Key ACLs:
2814
+ # - editSettings
2620
2815
  # @param dictionary_settings_params [DictionarySettingsParams] (required)
2621
2816
  # @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
2817
  # @return [UpdatedAtResponse]
2623
2818
  def set_dictionary_settings(dictionary_settings_params, request_options = {})
2624
2819
  response = set_dictionary_settings_with_http_info(dictionary_settings_params, request_options)
2625
- deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
2820
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
2626
2821
  end
2627
2822
 
2628
- # Update index settings.
2629
2823
  # 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.
2824
+ #
2825
+ # Required API Key ACLs:
2826
+ # - editSettings
2630
2827
  # @param index_name [String] Index on which to perform the request. (required)
2631
2828
  # @param index_settings [IndexSettings] (required)
2632
2829
  # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
@@ -2642,7 +2839,7 @@ module Algolia
2642
2839
  raise ArgumentError, "Parameter `index_settings` is required when calling `set_settings`."
2643
2840
  end
2644
2841
 
2645
- path = '/1/indexes/{indexName}/settings'.sub('{' + 'indexName' + '}', @api_client.encode_uri(index_name.to_s))
2842
+ path = '/1/indexes/{indexName}/settings'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s))
2646
2843
  query_params = {}
2647
2844
  query_params[:forwardToReplicas] = forward_to_replicas unless forward_to_replicas.nil?
2648
2845
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
@@ -2662,8 +2859,10 @@ module Algolia
2662
2859
  @api_client.call_api(:PUT, path, new_options)
2663
2860
  end
2664
2861
 
2665
- # Update index settings.
2666
2862
  # 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.
2863
+ #
2864
+ # Required API Key ACLs:
2865
+ # - editSettings
2667
2866
  # @param index_name [String] Index on which to perform the request. (required)
2668
2867
  # @param index_settings [IndexSettings] (required)
2669
2868
  # @param forward_to_replicas [Boolean] Indicates whether changed index settings are forwarded to the replica indices.
@@ -2671,11 +2870,13 @@ module Algolia
2671
2870
  # @return [UpdatedAtResponse]
2672
2871
  def set_settings(index_name, index_settings, forward_to_replicas = nil, request_options = {})
2673
2872
  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')
2873
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdatedAtResponse')
2675
2874
  end
2676
2875
 
2677
- # Update an API key.
2678
2876
  # 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.
2877
+ #
2878
+ # Required API Key ACLs:
2879
+ # - admin
2679
2880
  # @param key [String] API key. (required)
2680
2881
  # @param api_key [ApiKey] (required)
2681
2882
  # @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)
@@ -2690,7 +2891,7 @@ module Algolia
2690
2891
  raise ArgumentError, "Parameter `api_key` is required when calling `update_api_key`."
2691
2892
  end
2692
2893
 
2693
- path = '/1/keys/{key}'.sub('{' + 'key' + '}', @api_client.encode_uri(key.to_s))
2894
+ path = '/1/keys/{key}'.sub('{' + 'key' + '}', Transport.encode_uri(key.to_s))
2694
2895
  query_params = {}
2695
2896
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2696
2897
  header_params = {}
@@ -2709,15 +2910,159 @@ module Algolia
2709
2910
  @api_client.call_api(:PUT, path, new_options)
2710
2911
  end
2711
2912
 
2712
- # Update an API key.
2713
2913
  # 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.
2914
+ #
2915
+ # Required API Key ACLs:
2916
+ # - admin
2714
2917
  # @param key [String] API key. (required)
2715
2918
  # @param api_key [ApiKey] (required)
2716
2919
  # @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
2920
  # @return [UpdateApiKeyResponse]
2718
2921
  def update_api_key(key, api_key, request_options = {})
2719
2922
  response = update_api_key_with_http_info(key, api_key, request_options)
2720
- deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdateApiKeyResponse')
2923
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Search::UpdateApiKeyResponse')
2924
+ end
2925
+
2926
+ # Helper: Wait for a task to be published (completed) for a given `index_name` and `task_id`.
2927
+ #
2928
+ # @param index_name [String] the `index_name` where the operation was performed. (required)
2929
+ # @param task_id [Integer] the `task_id` returned in the method response. (required)
2930
+ # @param max_retries [Integer] the maximum number of retries. (optional, default to 50)
2931
+ # @param timeout [Proc] the function to decide how long to wait between retries. (optional)
2932
+ # @param request_options [Hash] the requestOptions to send along with the query, they will be forwarded to the `get_task` method.
2933
+ # @return [Http::Response] the last get_task response
2934
+ def wait_for_task(index_name, task_id, max_retries = 50, timeout = ->(retry_count) { [retry_count * 200, 5000].min }, request_options = {})
2935
+ retries = 0
2936
+ while retries < max_retries
2937
+ res = get_task(index_name, task_id, request_options)
2938
+ if res.status == 'published'
2939
+ return res
2940
+ end
2941
+
2942
+ retries += 1
2943
+ sleep(timeout.call(retries) / 1000.0)
2944
+ end
2945
+ raise ApiError, "The maximum number of retries exceeded. (#{max_retries})"
2946
+ end
2947
+
2948
+ # Helper: Wait for an API key to be added, updated or deleted based on a given `operation`.
2949
+ #
2950
+ # @param operation [String] the `operation` that was done on a `key`.
2951
+ # @param key [String] the `key` that has been added, deleted or updated.
2952
+ # @param api_key [Hash] necessary to know if an `update` operation has been processed, compare fields of the response with it.
2953
+ # @param max_retries [Integer] the maximum number of retries.
2954
+ # @param timeout [Proc] the function to decide how long to wait between retries.
2955
+ # @param request_options [Hash] the requestOptions to send along with the query, they will be forwarded to the `getApikey` method and merged with the transporter requestOptions.
2956
+ # @return [Http::Response] the last get_api_key response
2957
+ def wait_for_api_key(operation, key, api_key = {}, max_retries = 50, timeout = ->(retry_count) { [retry_count * 200, 5000].min }, request_options = {})
2958
+ retries = 0
2959
+ if operation == 'update'
2960
+ raise ArgumentError, '`api_key` is required when waiting for an `update` operation.' if api_key.nil?
2961
+
2962
+ while retries < max_retries
2963
+ begin
2964
+ updatad_key = get_api_key(key, request_options)
2965
+ updated_key_hash = updatad_key.to_hash
2966
+ equals = true
2967
+ api_key.to_hash.each do |k, v|
2968
+ equals &&= updated_key_hash[k] == v
2969
+ end
2970
+
2971
+ return updatad_key if equals
2972
+ rescue AlgoliaError => e
2973
+ raise e unless e.code == 404
2974
+ end
2975
+
2976
+ retries += 1
2977
+ sleep(timeout.call(retries) / 1000.0)
2978
+ end
2979
+
2980
+ raise ApiError, "The maximum number of retries exceeded. (#{max_retries})"
2981
+ end
2982
+
2983
+ while retries < max_retries
2984
+ begin
2985
+ res = get_api_key(key, request_options)
2986
+ return res if operation == 'add'
2987
+ rescue AlgoliaError => e
2988
+ return res if operation == 'delete' && e.code == 404
2989
+ end
2990
+ retries += 1
2991
+ sleep(timeout.call(retries) / 1000.0)
2992
+ end
2993
+ raise ApiError, "The maximum number of retries exceeded. (#{max_retries})"
2994
+ end
2995
+
2996
+ # Helper: Iterate on the `browse` method of the client to allow aggregating objects of an index.
2997
+ #
2998
+ # @param index_name [String] the `index_name` to browse. (required)
2999
+ # @param browse_params [BrowseParamsObject] the `browse_params` to send along with the query, they will be forwarded to the `browse` method.
3000
+ # @param request_options [Hash] the requestOptions to send along with the query, they will be forwarded to the `browse` method.
3001
+ # @param block [Proc] the block to execute on each object of the index.
3002
+ def browse_objects(index_name, browse_params = Search::BrowseParamsObject.new, request_options = {}, &block)
3003
+ hits = []
3004
+ loop do
3005
+ res = browse(index_name, browse_params, request_options)
3006
+ if block_given?
3007
+ res.hits.each do |hit|
3008
+ block.call(hit)
3009
+ end
3010
+ else
3011
+ hits.concat(res.hits)
3012
+ end
3013
+ browse_params.cursor = res.cursor
3014
+ break if browse_params.cursor.nil?
3015
+ end
3016
+
3017
+ hits unless block_given?
3018
+ end
3019
+
3020
+ # Helper: Iterate on the `searchRules` method of the client to allow aggregating rules of an index.
3021
+ #
3022
+ # @param index_name [String] the `index_name` to browse rules from. (required)
3023
+ # @param search_rules_params [SearchRulesParams] the parameters to send along with the query, they will be forwarded to the `searchRules` method.
3024
+ # @param request_options [Hash] the requestOptions to send along with the query, they will be forwarded to the `searchRules` method.
3025
+ # @param block [Proc] the block to execute on each rule of the index.
3026
+ def browse_rules(index_name, search_rules_params = Search::SearchRulesParams.new(hits_per_page: 1000, page: 0), request_options = {}, &block)
3027
+ rules = []
3028
+ loop do
3029
+ res = search_rules(index_name, search_rules_params, request_options)
3030
+ if block_given?
3031
+ res.hits.each do |rule|
3032
+ block.call(rule)
3033
+ end
3034
+ else
3035
+ rules.concat(res.hits)
3036
+ end
3037
+ search_rules_params.page += 1
3038
+ break if res.nb_hits < search_rules_params.hits_per_page
3039
+ end
3040
+
3041
+ rules unless block_given?
3042
+ end
3043
+
3044
+ # Helper: Iterate on the `searchSynonyms` method of the client to allow aggregating synonyms of an index.
3045
+ #
3046
+ # @param index_name [String] the `index_name` to browse synonyms from. (required)
3047
+ # @param search_synonyms_params [SearchSynonymsParams] the parameters to send along with the query, they will be forwarded to the `searchSynonyms` method.
3048
+ # @param request_options [Hash] the requestOptions to send along with the query, they will be forwarded to the `searchSynonyms` method.
3049
+ # @param block [Proc] the block to execute on each synonym of the index.
3050
+ def browse_synonyms(index_name, search_synonyms_params = Search::SearchSynonymsParams.new(hits_per_page: 1000, page: 0), request_options = {}, &block)
3051
+ synonyms = []
3052
+ loop do
3053
+ res = search_synonyms(index_name, search_synonyms_params, request_options)
3054
+ if block_given?
3055
+ res.hits.each do |synonym|
3056
+ block.call(synonym)
3057
+ end
3058
+ else
3059
+ synonyms.concat(res.hits)
3060
+ end
3061
+ search_synonyms_params.page += 1
3062
+ break if res.nb_hits < search_synonyms_params.hits_per_page
3063
+ end
3064
+
3065
+ synonyms unless block_given?
2721
3066
  end
2722
3067
  end
2723
3068
  end