algolia 3.25.0 → 3.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/issue.yml +1 -1
  3. data/.github/workflows/release.yml +1 -1
  4. data/CHANGELOG.md +10 -0
  5. data/Gemfile.lock +1 -1
  6. data/lib/algolia/api/composition_client.rb +765 -0
  7. data/lib/algolia/api/ingestion_client.rb +15 -4
  8. data/lib/algolia/api/search_client.rb +4 -2
  9. data/lib/algolia/models/composition/action.rb +34 -0
  10. data/lib/algolia/models/composition/advanced_syntax_features.rb +34 -0
  11. data/lib/algolia/models/composition/alternatives_as_exact.rb +36 -0
  12. data/lib/algolia/models/composition/anchoring.rb +36 -0
  13. data/lib/algolia/models/composition/base_injection_query_parameters.rb +732 -0
  14. data/lib/algolia/models/composition/batch_composition_action.rb +109 -0
  15. data/lib/algolia/models/composition/batch_params.rb +213 -0
  16. data/lib/algolia/models/composition/boolean_string.rb +34 -0
  17. data/lib/algolia/models/composition/composition.rb +244 -0
  18. data/lib/algolia/models/composition/composition_behavior.rb +210 -0
  19. data/lib/algolia/models/composition/composition_rule.rb +280 -0
  20. data/lib/algolia/models/composition/composition_rule_consequence.rb +211 -0
  21. data/lib/algolia/models/composition/composition_rules_batch_params.rb +211 -0
  22. data/lib/algolia/models/composition/composition_source.rb +210 -0
  23. data/lib/algolia/models/composition/composition_source_search.rb +220 -0
  24. data/lib/algolia/models/composition/condition.rb +238 -0
  25. data/lib/algolia/models/composition/delete_composition_action.rb +212 -0
  26. data/lib/algolia/models/composition/delete_composition_rule_action.rb +212 -0
  27. data/lib/algolia/models/composition/distinct.rb +110 -0
  28. data/lib/algolia/models/composition/exact_on_single_word_query.rb +35 -0
  29. data/lib/algolia/models/composition/external.rb +226 -0
  30. data/lib/algolia/models/composition/external_ordering.rb +34 -0
  31. data/lib/algolia/models/composition/external_source.rb +211 -0
  32. data/lib/algolia/models/composition/get_task_response.rb +210 -0
  33. data/lib/algolia/models/composition/ignore_plurals.rb +111 -0
  34. data/lib/algolia/models/composition/injected_item.rb +253 -0
  35. data/lib/algolia/models/composition/injected_item_hits_metadata.rb +222 -0
  36. data/lib/algolia/models/composition/injected_item_metadata.rb +209 -0
  37. data/lib/algolia/models/composition/injected_item_source.rb +109 -0
  38. data/lib/algolia/models/composition/injection.rb +222 -0
  39. data/lib/algolia/models/composition/list_compositions_response.rb +261 -0
  40. data/lib/algolia/models/composition/main.rb +207 -0
  41. data/lib/algolia/models/composition/main_injection_query_parameters.rb +807 -0
  42. data/lib/algolia/models/composition/multiple_batch_request.rb +221 -0
  43. data/lib/algolia/models/composition/multiple_batch_response.rb +213 -0
  44. data/lib/algolia/models/composition/optional_words.rb +110 -0
  45. data/lib/algolia/models/composition/query_type.rb +35 -0
  46. data/lib/algolia/models/composition/remove_stop_words.rb +110 -0
  47. data/lib/algolia/models/composition/remove_words_if_no_results.rb +36 -0
  48. data/lib/algolia/models/composition/rules_batch_composition_action.rb +109 -0
  49. data/lib/algolia/models/composition/rules_multiple_batch_request.rb +221 -0
  50. data/lib/algolia/models/composition/rules_multiple_batch_response.rb +211 -0
  51. data/lib/algolia/models/composition/search.rb +217 -0
  52. data/lib/algolia/models/composition/search_composition_rules_params.rb +261 -0
  53. data/lib/algolia/models/composition/search_composition_rules_response.rb +249 -0
  54. data/lib/algolia/models/composition/search_source.rb +211 -0
  55. data/lib/algolia/models/composition/task_id_response.rb +211 -0
  56. data/lib/algolia/models/composition/task_status.rb +34 -0
  57. data/lib/algolia/models/composition/time_range.rb +219 -0
  58. data/lib/algolia/models/composition/typo_tolerance.rb +110 -0
  59. data/lib/algolia/models/composition/typo_tolerance_enum.rb +36 -0
  60. data/lib/algolia/version.rb +1 -1
  61. metadata +52 -1
@@ -62,6 +62,711 @@ module Algolia
62
62
  self
63
63
  end
64
64
 
65
+ # This method lets you send requests to the Algolia REST API.
66
+
67
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
68
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
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)
70
+ # @return [Http::Response] the response
71
+ def custom_delete_with_http_info(path, parameters = nil, request_options = {})
72
+ # verify the required parameter 'path' is set
73
+ if @api_client.config.client_side_validation && path.nil?
74
+ raise ArgumentError, "Parameter `path` is required when calling `custom_delete`."
75
+ end
76
+
77
+ path = "/{path}".sub("{" + "path" + "}", path.to_s)
78
+ query_params = {}
79
+ query_params = query_params.merge(parameters) unless parameters.nil?
80
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
81
+ header_params = {}
82
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
83
+
84
+ post_body = request_options[:debug_body]
85
+
86
+ new_options = request_options.merge(
87
+ :operation => :"CompositionClient.custom_delete",
88
+ :header_params => header_params,
89
+ :query_params => query_params,
90
+ :body => post_body,
91
+ :use_read_transporter => false
92
+ )
93
+
94
+ @api_client.call_api(:DELETE, path, new_options)
95
+ end
96
+
97
+ # This method lets you send requests to the Algolia REST API.
98
+
99
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
100
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
101
+ # @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)
102
+ # @return [Object]
103
+ def custom_delete(path, parameters = nil, request_options = {})
104
+ response = custom_delete_with_http_info(path, parameters, request_options)
105
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
106
+ end
107
+
108
+ # This method lets you send requests to the Algolia REST API.
109
+
110
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
111
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
112
+ # @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)
113
+ # @return [Http::Response] the response
114
+ def custom_get_with_http_info(path, parameters = nil, request_options = {})
115
+ # verify the required parameter 'path' is set
116
+ if @api_client.config.client_side_validation && path.nil?
117
+ raise ArgumentError, "Parameter `path` is required when calling `custom_get`."
118
+ end
119
+
120
+ path = "/{path}".sub("{" + "path" + "}", path.to_s)
121
+ query_params = {}
122
+ query_params = query_params.merge(parameters) unless parameters.nil?
123
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
124
+ header_params = {}
125
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
126
+
127
+ post_body = request_options[:debug_body]
128
+
129
+ new_options = request_options.merge(
130
+ :operation => :"CompositionClient.custom_get",
131
+ :header_params => header_params,
132
+ :query_params => query_params,
133
+ :body => post_body,
134
+ :use_read_transporter => false
135
+ )
136
+
137
+ @api_client.call_api(:GET, path, new_options)
138
+ end
139
+
140
+ # This method lets you send requests to the Algolia REST API.
141
+
142
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
143
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
144
+ # @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)
145
+ # @return [Object]
146
+ def custom_get(path, parameters = nil, request_options = {})
147
+ response = custom_get_with_http_info(path, parameters, request_options)
148
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
149
+ end
150
+
151
+ # This method lets you send requests to the Algolia REST API.
152
+
153
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
154
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
155
+ # @param body [Object] Parameters to send with the custom request.
156
+ # @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)
157
+ # @return [Http::Response] the response
158
+ def custom_post_with_http_info(path, parameters = nil, body = nil, request_options = {})
159
+ # verify the required parameter 'path' is set
160
+ if @api_client.config.client_side_validation && path.nil?
161
+ raise ArgumentError, "Parameter `path` is required when calling `custom_post`."
162
+ end
163
+
164
+ path = "/{path}".sub("{" + "path" + "}", path.to_s)
165
+ query_params = {}
166
+ query_params = query_params.merge(parameters) unless parameters.nil?
167
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
168
+ header_params = {}
169
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
170
+
171
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)
172
+
173
+ new_options = request_options.merge(
174
+ :operation => :"CompositionClient.custom_post",
175
+ :header_params => header_params,
176
+ :query_params => query_params,
177
+ :body => post_body,
178
+ :use_read_transporter => false
179
+ )
180
+
181
+ @api_client.call_api(:POST, path, new_options)
182
+ end
183
+
184
+ # This method lets you send requests to the Algolia REST API.
185
+
186
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
187
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
188
+ # @param body [Object] Parameters to send with the custom request.
189
+ # @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)
190
+ # @return [Object]
191
+ def custom_post(path, parameters = nil, body = nil, request_options = {})
192
+ response = custom_post_with_http_info(path, parameters, body, request_options)
193
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
194
+ end
195
+
196
+ # This method lets you send requests to the Algolia REST API.
197
+
198
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
199
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
200
+ # @param body [Object] Parameters to send with the custom request.
201
+ # @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)
202
+ # @return [Http::Response] the response
203
+ def custom_put_with_http_info(path, parameters = nil, body = nil, request_options = {})
204
+ # verify the required parameter 'path' is set
205
+ if @api_client.config.client_side_validation && path.nil?
206
+ raise ArgumentError, "Parameter `path` is required when calling `custom_put`."
207
+ end
208
+
209
+ path = "/{path}".sub("{" + "path" + "}", path.to_s)
210
+ query_params = {}
211
+ query_params = query_params.merge(parameters) unless parameters.nil?
212
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
213
+ header_params = {}
214
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
215
+
216
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)
217
+
218
+ new_options = request_options.merge(
219
+ :operation => :"CompositionClient.custom_put",
220
+ :header_params => header_params,
221
+ :query_params => query_params,
222
+ :body => post_body,
223
+ :use_read_transporter => false
224
+ )
225
+
226
+ @api_client.call_api(:PUT, path, new_options)
227
+ end
228
+
229
+ # This method lets you send requests to the Algolia REST API.
230
+
231
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
232
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
233
+ # @param body [Object] Parameters to send with the custom request.
234
+ # @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)
235
+ # @return [Object]
236
+ def custom_put(path, parameters = nil, body = nil, request_options = {})
237
+ response = custom_put_with_http_info(path, parameters, body, request_options)
238
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
239
+ end
240
+
241
+ # Delete a composition from the current Algolia application.
242
+ #
243
+ # Required API Key ACLs:
244
+ # - editSettings
245
+ # @param composition_id [String] Unique Composition ObjectID. (required)
246
+ # @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)
247
+ # @return [Http::Response] the response
248
+ def delete_composition_with_http_info(composition_id, request_options = {})
249
+ # verify the required parameter 'composition_id' is set
250
+ if @api_client.config.client_side_validation && composition_id.nil?
251
+ raise ArgumentError, "Parameter `composition_id` is required when calling `delete_composition`."
252
+ end
253
+
254
+ path = "/1/compositions/{compositionID}".sub(
255
+ "{" + "compositionID" + "}",
256
+ Transport.encode_uri(composition_id.to_s)
257
+ )
258
+ query_params = {}
259
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
260
+ header_params = {}
261
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
262
+
263
+ post_body = request_options[:debug_body]
264
+
265
+ new_options = request_options.merge(
266
+ :operation => :"CompositionClient.delete_composition",
267
+ :header_params => header_params,
268
+ :query_params => query_params,
269
+ :body => post_body,
270
+ :use_read_transporter => false
271
+ )
272
+
273
+ @api_client.call_api(:DELETE, path, new_options)
274
+ end
275
+
276
+ # Delete a composition from the current Algolia application.
277
+ #
278
+ # Required API Key ACLs:
279
+ # - editSettings
280
+ # @param composition_id [String] Unique Composition ObjectID. (required)
281
+ # @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)
282
+ # @return [TaskIDResponse]
283
+ def delete_composition(composition_id, request_options = {})
284
+ response = delete_composition_with_http_info(composition_id, request_options)
285
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Composition::TaskIDResponse")
286
+ end
287
+
288
+ # Delete a Composition Rule from the specified Composition ID.
289
+ #
290
+ # Required API Key ACLs:
291
+ # - editSettings
292
+ # @param composition_id [String] Unique Composition ObjectID. (required)
293
+ # @param algolia_object_id [String] Unique identifier of a rule object. (required)
294
+ # @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)
295
+ # @return [Http::Response] the response
296
+ def delete_composition_rule_with_http_info(composition_id, algolia_object_id, request_options = {})
297
+ # verify the required parameter 'composition_id' is set
298
+ if @api_client.config.client_side_validation && composition_id.nil?
299
+ raise ArgumentError, "Parameter `composition_id` is required when calling `delete_composition_rule`."
300
+ end
301
+ # verify the required parameter 'algolia_object_id' is set
302
+ if @api_client.config.client_side_validation && algolia_object_id.nil?
303
+ raise ArgumentError, "Parameter `algolia_object_id` is required when calling `delete_composition_rule`."
304
+ end
305
+
306
+ path = "/1/compositions/{compositionID}/rules/{objectID}"
307
+ .sub("{" + "compositionID" + "}", Transport.encode_uri(composition_id.to_s))
308
+ .sub("{" + "objectID" + "}", Transport.encode_uri(algolia_object_id.to_s))
309
+ query_params = {}
310
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
311
+ header_params = {}
312
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
313
+
314
+ post_body = request_options[:debug_body]
315
+
316
+ new_options = request_options.merge(
317
+ :operation => :"CompositionClient.delete_composition_rule",
318
+ :header_params => header_params,
319
+ :query_params => query_params,
320
+ :body => post_body,
321
+ :use_read_transporter => false
322
+ )
323
+
324
+ @api_client.call_api(:DELETE, path, new_options)
325
+ end
326
+
327
+ # Delete a Composition Rule from the specified Composition ID.
328
+ #
329
+ # Required API Key ACLs:
330
+ # - editSettings
331
+ # @param composition_id [String] Unique Composition ObjectID. (required)
332
+ # @param algolia_object_id [String] Unique identifier of a rule object. (required)
333
+ # @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)
334
+ # @return [TaskIDResponse]
335
+ def delete_composition_rule(composition_id, algolia_object_id, request_options = {})
336
+ response = delete_composition_rule_with_http_info(composition_id, algolia_object_id, request_options)
337
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Composition::TaskIDResponse")
338
+ end
339
+
340
+ # Retrieve a single composition in the current Algolia application.
341
+ #
342
+ # Required API Key ACLs:
343
+ # - editSettings
344
+ # - settings
345
+ # @param composition_id [String] Unique Composition ObjectID. (required)
346
+ # @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)
347
+ # @return [Http::Response] the response
348
+ def get_composition_with_http_info(composition_id, request_options = {})
349
+ # verify the required parameter 'composition_id' is set
350
+ if @api_client.config.client_side_validation && composition_id.nil?
351
+ raise ArgumentError, "Parameter `composition_id` is required when calling `get_composition`."
352
+ end
353
+
354
+ path = "/1/compositions/{compositionID}".sub(
355
+ "{" + "compositionID" + "}",
356
+ Transport.encode_uri(composition_id.to_s)
357
+ )
358
+ query_params = {}
359
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
360
+ header_params = {}
361
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
362
+
363
+ post_body = request_options[:debug_body]
364
+
365
+ new_options = request_options.merge(
366
+ :operation => :"CompositionClient.get_composition",
367
+ :header_params => header_params,
368
+ :query_params => query_params,
369
+ :body => post_body,
370
+ :use_read_transporter => false
371
+ )
372
+
373
+ @api_client.call_api(:GET, path, new_options)
374
+ end
375
+
376
+ # Retrieve a single composition in the current Algolia application.
377
+ #
378
+ # Required API Key ACLs:
379
+ # - editSettings
380
+ # - settings
381
+ # @param composition_id [String] Unique Composition ObjectID. (required)
382
+ # @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)
383
+ # @return [Composition]
384
+ def get_composition(composition_id, request_options = {})
385
+ response = get_composition_with_http_info(composition_id, request_options)
386
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Composition::Composition")
387
+ end
388
+
389
+ # Retrieves a rule by its ID. To find the object ID of rules, use the [`search` operation](#tag/Rules/operation/searchRules).
390
+ #
391
+ # Required API Key ACLs:
392
+ # - editSettings
393
+ # - settings
394
+ # @param composition_id [String] Unique Composition ObjectID. (required)
395
+ # @param algolia_object_id [String] Unique identifier of a rule object. (required)
396
+ # @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)
397
+ # @return [Http::Response] the response
398
+ def get_rule_with_http_info(composition_id, algolia_object_id, request_options = {})
399
+ # verify the required parameter 'composition_id' is set
400
+ if @api_client.config.client_side_validation && composition_id.nil?
401
+ raise ArgumentError, "Parameter `composition_id` is required when calling `get_rule`."
402
+ end
403
+ # verify the required parameter 'algolia_object_id' is set
404
+ if @api_client.config.client_side_validation && algolia_object_id.nil?
405
+ raise ArgumentError, "Parameter `algolia_object_id` is required when calling `get_rule`."
406
+ end
407
+
408
+ path = "/1/compositions/{compositionID}/rules/{objectID}"
409
+ .sub("{" + "compositionID" + "}", Transport.encode_uri(composition_id.to_s))
410
+ .sub("{" + "objectID" + "}", Transport.encode_uri(algolia_object_id.to_s))
411
+ query_params = {}
412
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
413
+ header_params = {}
414
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
415
+
416
+ post_body = request_options[:debug_body]
417
+
418
+ new_options = request_options.merge(
419
+ :operation => :"CompositionClient.get_rule",
420
+ :header_params => header_params,
421
+ :query_params => query_params,
422
+ :body => post_body,
423
+ :use_read_transporter => false
424
+ )
425
+
426
+ @api_client.call_api(:GET, path, new_options)
427
+ end
428
+
429
+ # Retrieves a rule by its ID. To find the object ID of rules, use the [`search` operation](#tag/Rules/operation/searchRules).
430
+ #
431
+ # Required API Key ACLs:
432
+ # - editSettings
433
+ # - settings
434
+ # @param composition_id [String] Unique Composition ObjectID. (required)
435
+ # @param algolia_object_id [String] Unique identifier of a rule object. (required)
436
+ # @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)
437
+ # @return [CompositionRule]
438
+ def get_rule(composition_id, algolia_object_id, request_options = {})
439
+ response = get_rule_with_http_info(composition_id, algolia_object_id, request_options)
440
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Composition::CompositionRule")
441
+ end
442
+
443
+ # Checks the status of a given task.
444
+ #
445
+ # Required API Key ACLs:
446
+ # - editSettings
447
+ # - settings
448
+ # - addObject
449
+ # - deleteObject
450
+ # - deleteIndex
451
+ # @param composition_id [String] Unique Composition ObjectID. (required)
452
+ # @param task_id [Integer] Unique task identifier. (required)
453
+ # @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)
454
+ # @return [Http::Response] the response
455
+ def get_task_with_http_info(composition_id, task_id, request_options = {})
456
+ # verify the required parameter 'composition_id' is set
457
+ if @api_client.config.client_side_validation && composition_id.nil?
458
+ raise ArgumentError, "Parameter `composition_id` is required when calling `get_task`."
459
+ end
460
+ # verify the required parameter 'task_id' is set
461
+ if @api_client.config.client_side_validation && task_id.nil?
462
+ raise ArgumentError, "Parameter `task_id` is required when calling `get_task`."
463
+ end
464
+
465
+ path = "/1/compositions/{compositionID}/task/{taskID}"
466
+ .sub("{" + "compositionID" + "}", Transport.encode_uri(composition_id.to_s))
467
+ .sub("{" + "taskID" + "}", Transport.encode_uri(task_id.to_s))
468
+ query_params = {}
469
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
470
+ header_params = {}
471
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
472
+
473
+ post_body = request_options[:debug_body]
474
+
475
+ new_options = request_options.merge(
476
+ :operation => :"CompositionClient.get_task",
477
+ :header_params => header_params,
478
+ :query_params => query_params,
479
+ :body => post_body,
480
+ :use_read_transporter => false
481
+ )
482
+
483
+ @api_client.call_api(:GET, path, new_options)
484
+ end
485
+
486
+ # Checks the status of a given task.
487
+ #
488
+ # Required API Key ACLs:
489
+ # - editSettings
490
+ # - settings
491
+ # - addObject
492
+ # - deleteObject
493
+ # - deleteIndex
494
+ # @param composition_id [String] Unique Composition ObjectID. (required)
495
+ # @param task_id [Integer] Unique task identifier. (required)
496
+ # @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)
497
+ # @return [GetTaskResponse]
498
+ def get_task(composition_id, task_id, request_options = {})
499
+ response = get_task_with_http_info(composition_id, task_id, request_options)
500
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Composition::GetTaskResponse")
501
+ end
502
+
503
+ # Lists all compositions in the current Algolia application.
504
+ #
505
+ # Required API Key ACLs:
506
+ # - editSettings
507
+ # - settings
508
+ # @param page [Integer] Requested page of the API response. If `null`, the API response is not paginated.
509
+ # @param hits_per_page [Integer] Number of hits per page. (default to 100)
510
+ # @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)
511
+ # @return [Http::Response] the response
512
+ def list_compositions_with_http_info(page = nil, hits_per_page = nil, request_options = {})
513
+ path = "/1/compositions"
514
+ query_params = {}
515
+ query_params[:page] = page unless page.nil?
516
+ query_params[:hitsPerPage] = hits_per_page unless hits_per_page.nil?
517
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
518
+ header_params = {}
519
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
520
+
521
+ post_body = request_options[:debug_body]
522
+
523
+ new_options = request_options.merge(
524
+ :operation => :"CompositionClient.list_compositions",
525
+ :header_params => header_params,
526
+ :query_params => query_params,
527
+ :body => post_body,
528
+ :use_read_transporter => false
529
+ )
530
+
531
+ @api_client.call_api(:GET, path, new_options)
532
+ end
533
+
534
+ # Lists all compositions in the current Algolia application.
535
+ #
536
+ # Required API Key ACLs:
537
+ # - editSettings
538
+ # - settings
539
+ # @param page [Integer] Requested page of the API response. If `null`, the API response is not paginated.
540
+ # @param hits_per_page [Integer] Number of hits per page. (default to 100)
541
+ # @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)
542
+ # @return [ListCompositionsResponse]
543
+ def list_compositions(page = nil, hits_per_page = nil, request_options = {})
544
+ response = list_compositions_with_http_info(page, hits_per_page, request_options)
545
+ @api_client.deserialize(
546
+ response.body,
547
+ request_options[:debug_return_type] || "Composition::ListCompositionsResponse"
548
+ )
549
+ end
550
+
551
+ # Adds, updates, or deletes compositions with a single API request.
552
+ #
553
+ # Required API Key ACLs:
554
+ # - editSettings
555
+ # @param batch_params [BatchParams] (required)
556
+ # @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)
557
+ # @return [Http::Response] the response
558
+ def multiple_batch_with_http_info(batch_params, request_options = {})
559
+ # verify the required parameter 'batch_params' is set
560
+ if @api_client.config.client_side_validation && batch_params.nil?
561
+ raise ArgumentError, "Parameter `batch_params` is required when calling `multiple_batch`."
562
+ end
563
+
564
+ path = "/1/compositions/*/batch"
565
+ query_params = {}
566
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
567
+ header_params = {}
568
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
569
+
570
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(batch_params)
571
+
572
+ new_options = request_options.merge(
573
+ :operation => :"CompositionClient.multiple_batch",
574
+ :header_params => header_params,
575
+ :query_params => query_params,
576
+ :body => post_body,
577
+ :use_read_transporter => false
578
+ )
579
+
580
+ @api_client.call_api(:POST, path, new_options)
581
+ end
582
+
583
+ # Adds, updates, or deletes compositions with a single API request.
584
+ #
585
+ # Required API Key ACLs:
586
+ # - editSettings
587
+ # @param batch_params [BatchParams] (required)
588
+ # @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)
589
+ # @return [MultipleBatchResponse]
590
+ def multiple_batch(batch_params, request_options = {})
591
+ response = multiple_batch_with_http_info(batch_params, request_options)
592
+ @api_client.deserialize(
593
+ response.body,
594
+ request_options[:debug_return_type] || "Composition::MultipleBatchResponse"
595
+ )
596
+ end
597
+
598
+ # Upsert a composition in the current Algolia application.
599
+ #
600
+ # Required API Key ACLs:
601
+ # - editSettings
602
+ # @param composition_id [String] Unique Composition ObjectID. (required)
603
+ # @param composition [Composition] (required)
604
+ # @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)
605
+ # @return [Http::Response] the response
606
+ def put_composition_with_http_info(composition_id, composition, request_options = {})
607
+ # verify the required parameter 'composition_id' is set
608
+ if @api_client.config.client_side_validation && composition_id.nil?
609
+ raise ArgumentError, "Parameter `composition_id` is required when calling `put_composition`."
610
+ end
611
+ # verify the required parameter 'composition' is set
612
+ if @api_client.config.client_side_validation && composition.nil?
613
+ raise ArgumentError, "Parameter `composition` is required when calling `put_composition`."
614
+ end
615
+
616
+ path = "/1/compositions/{compositionID}".sub(
617
+ "{" + "compositionID" + "}",
618
+ Transport.encode_uri(composition_id.to_s)
619
+ )
620
+ query_params = {}
621
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
622
+ header_params = {}
623
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
624
+
625
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(composition)
626
+
627
+ new_options = request_options.merge(
628
+ :operation => :"CompositionClient.put_composition",
629
+ :header_params => header_params,
630
+ :query_params => query_params,
631
+ :body => post_body,
632
+ :use_read_transporter => false
633
+ )
634
+
635
+ @api_client.call_api(:PUT, path, new_options)
636
+ end
637
+
638
+ # Upsert a composition in the current Algolia application.
639
+ #
640
+ # Required API Key ACLs:
641
+ # - editSettings
642
+ # @param composition_id [String] Unique Composition ObjectID. (required)
643
+ # @param composition [Composition] (required)
644
+ # @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)
645
+ # @return [TaskIDResponse]
646
+ def put_composition(composition_id, composition, request_options = {})
647
+ response = put_composition_with_http_info(composition_id, composition, request_options)
648
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Composition::TaskIDResponse")
649
+ end
650
+
651
+ # Upsert a Composition Rule for the specified composition ID.
652
+ #
653
+ # Required API Key ACLs:
654
+ # - editSettings
655
+ # @param composition_id [String] Unique Composition ObjectID. (required)
656
+ # @param algolia_object_id [String] Unique identifier of a rule object. (required)
657
+ # @param composition_rule [CompositionRule] (required)
658
+ # @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)
659
+ # @return [Http::Response] the response
660
+ def put_composition_rule_with_http_info(composition_id, algolia_object_id, composition_rule, request_options = {})
661
+ # verify the required parameter 'composition_id' is set
662
+ if @api_client.config.client_side_validation && composition_id.nil?
663
+ raise ArgumentError, "Parameter `composition_id` is required when calling `put_composition_rule`."
664
+ end
665
+ # verify the required parameter 'algolia_object_id' is set
666
+ if @api_client.config.client_side_validation && algolia_object_id.nil?
667
+ raise ArgumentError, "Parameter `algolia_object_id` is required when calling `put_composition_rule`."
668
+ end
669
+ # verify the required parameter 'composition_rule' is set
670
+ if @api_client.config.client_side_validation && composition_rule.nil?
671
+ raise ArgumentError, "Parameter `composition_rule` is required when calling `put_composition_rule`."
672
+ end
673
+
674
+ path = "/1/compositions/{compositionID}/rules/{objectID}"
675
+ .sub("{" + "compositionID" + "}", Transport.encode_uri(composition_id.to_s))
676
+ .sub("{" + "objectID" + "}", Transport.encode_uri(algolia_object_id.to_s))
677
+ query_params = {}
678
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
679
+ header_params = {}
680
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
681
+
682
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(composition_rule)
683
+
684
+ new_options = request_options.merge(
685
+ :operation => :"CompositionClient.put_composition_rule",
686
+ :header_params => header_params,
687
+ :query_params => query_params,
688
+ :body => post_body,
689
+ :use_read_transporter => false
690
+ )
691
+
692
+ @api_client.call_api(:PUT, path, new_options)
693
+ end
694
+
695
+ # Upsert a Composition Rule for the specified composition ID.
696
+ #
697
+ # Required API Key ACLs:
698
+ # - editSettings
699
+ # @param composition_id [String] Unique Composition ObjectID. (required)
700
+ # @param algolia_object_id [String] Unique identifier of a rule object. (required)
701
+ # @param composition_rule [CompositionRule] (required)
702
+ # @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)
703
+ # @return [TaskIDResponse]
704
+ def put_composition_rule(composition_id, algolia_object_id, composition_rule, request_options = {})
705
+ response = put_composition_rule_with_http_info(
706
+ composition_id,
707
+ algolia_object_id,
708
+ composition_rule,
709
+ request_options
710
+ )
711
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Composition::TaskIDResponse")
712
+ end
713
+
714
+ # Create or update or delete multiple composition rules.
715
+ #
716
+ # Required API Key ACLs:
717
+ # - editSettings
718
+ # @param composition_id [String] Unique Composition ObjectID. (required)
719
+ # @param rules [CompositionRulesBatchParams] (required)
720
+ # @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)
721
+ # @return [Http::Response] the response
722
+ def save_rules_with_http_info(composition_id, rules, request_options = {})
723
+ # verify the required parameter 'composition_id' is set
724
+ if @api_client.config.client_side_validation && composition_id.nil?
725
+ raise ArgumentError, "Parameter `composition_id` is required when calling `save_rules`."
726
+ end
727
+ # verify the required parameter 'rules' is set
728
+ if @api_client.config.client_side_validation && rules.nil?
729
+ raise ArgumentError, "Parameter `rules` is required when calling `save_rules`."
730
+ end
731
+
732
+ path = "/1/compositions/{compositionID}/rules/batch".sub(
733
+ "{" + "compositionID" + "}",
734
+ Transport.encode_uri(composition_id.to_s)
735
+ )
736
+ query_params = {}
737
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
738
+ header_params = {}
739
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
740
+
741
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(rules)
742
+
743
+ new_options = request_options.merge(
744
+ :operation => :"CompositionClient.save_rules",
745
+ :header_params => header_params,
746
+ :query_params => query_params,
747
+ :body => post_body,
748
+ :use_read_transporter => false
749
+ )
750
+
751
+ @api_client.call_api(:POST, path, new_options)
752
+ end
753
+
754
+ # Create or update or delete multiple composition rules.
755
+ #
756
+ # Required API Key ACLs:
757
+ # - editSettings
758
+ # @param composition_id [String] Unique Composition ObjectID. (required)
759
+ # @param rules [CompositionRulesBatchParams] (required)
760
+ # @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
+ # @return [RulesMultipleBatchResponse]
762
+ def save_rules(composition_id, rules, request_options = {})
763
+ response = save_rules_with_http_info(composition_id, rules, request_options)
764
+ @api_client.deserialize(
765
+ response.body,
766
+ request_options[:debug_return_type] || "Composition::RulesMultipleBatchResponse"
767
+ )
768
+ end
769
+
65
770
  # Runs a query on a single composition and returns matching results.
66
771
  #
67
772
  # Required API Key ACLs:
@@ -115,6 +820,66 @@ module Algolia
115
820
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Composition::SearchResponse")
116
821
  end
117
822
 
823
+ # Searches for composition rules in your index.
824
+ #
825
+ # Required API Key ACLs:
826
+ # - settings
827
+ # @param composition_id [String] Unique Composition ObjectID. (required)
828
+ # @param search_composition_rules_params [SearchCompositionRulesParams]
829
+ # @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)
830
+ # @return [Http::Response] the response
831
+ def search_composition_rules_with_http_info(
832
+ composition_id,
833
+ search_composition_rules_params = nil,
834
+ request_options = {}
835
+ )
836
+ # verify the required parameter 'composition_id' is set
837
+ if @api_client.config.client_side_validation && composition_id.nil?
838
+ raise ArgumentError, "Parameter `composition_id` is required when calling `search_composition_rules`."
839
+ end
840
+
841
+ path = "/1/compositions/{compositionID}/rules/search".sub(
842
+ "{" + "compositionID" + "}",
843
+ Transport.encode_uri(composition_id.to_s)
844
+ )
845
+ query_params = {}
846
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
847
+ header_params = {}
848
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
849
+
850
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(search_composition_rules_params)
851
+
852
+ new_options = request_options.merge(
853
+ :operation => :"CompositionClient.search_composition_rules",
854
+ :header_params => header_params,
855
+ :query_params => query_params,
856
+ :body => post_body,
857
+ :use_read_transporter => false
858
+ )
859
+
860
+ @api_client.call_api(:POST, path, new_options)
861
+ end
862
+
863
+ # Searches for composition rules in your index.
864
+ #
865
+ # Required API Key ACLs:
866
+ # - settings
867
+ # @param composition_id [String] Unique Composition ObjectID. (required)
868
+ # @param search_composition_rules_params [SearchCompositionRulesParams]
869
+ # @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)
870
+ # @return [SearchCompositionRulesResponse]
871
+ def search_composition_rules(composition_id, search_composition_rules_params = nil, request_options = {})
872
+ response = search_composition_rules_with_http_info(
873
+ composition_id,
874
+ search_composition_rules_params,
875
+ request_options
876
+ )
877
+ @api_client.deserialize(
878
+ response.body,
879
+ request_options[:debug_return_type] || "Composition::SearchCompositionRulesResponse"
880
+ )
881
+ end
882
+
118
883
  # Searches for values of a specified facet attribute on the composition's main source's index. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn't work if you have **more than 65 searchable facets and searchable attributes combined**.
119
884
  #
120
885
  # Required API Key ACLs: