algolia 3.42.3 → 3.45.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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/do-not-edit-this-repository.yml +1 -1
  3. data/.github/workflows/issue.yml +7 -5
  4. data/.github/workflows/release.yml +4 -4
  5. data/CHANGELOG.md +29 -0
  6. data/Gemfile.lock +2 -2
  7. data/lib/algolia/api/abtesting_client.rb +20 -13
  8. data/lib/algolia/api/abtesting_v3_client.rb +2 -1
  9. data/lib/algolia/api/agent_studio_client.rb +2 -1
  10. data/lib/algolia/api/analytics_client.rb +223 -1
  11. data/lib/algolia/api/composition_client.rb +2 -1
  12. data/lib/algolia/api/ingestion_client.rb +2 -1
  13. data/lib/algolia/api/insights_client.rb +2 -1
  14. data/lib/algolia/api/monitoring_client.rb +2 -1
  15. data/lib/algolia/api/personalization_client.rb +2 -1
  16. data/lib/algolia/api/query_suggestions_client.rb +2 -1
  17. data/lib/algolia/api/recommend_client.rb +2 -1
  18. data/lib/algolia/api/search_client.rb +124 -20
  19. data/lib/algolia/api_client.rb +10 -2
  20. data/lib/algolia/chunked_helper_options.rb +1 -0
  21. data/lib/algolia/configuration.rb +10 -2
  22. data/lib/algolia/error.rb +20 -3
  23. data/lib/algolia/models/abtesting-v3/ab_test.rb +7 -19
  24. data/lib/algolia/models/abtesting-v3/decision.rb +219 -0
  25. data/lib/algolia/models/analytics/bin_edge.rb +109 -0
  26. data/lib/algolia/models/analytics/catalog.rb +208 -0
  27. data/lib/algolia/models/analytics/catalog_entry.rb +249 -0
  28. data/lib/algolia/models/analytics/distribution_definition.rb +243 -0
  29. data/lib/algolia/models/analytics/distribution_payload.rb +247 -0
  30. data/lib/algolia/models/analytics/domain_catalog.rb +253 -0
  31. data/lib/algolia/models/analytics/field_reference.rb +219 -0
  32. data/lib/algolia/models/analytics/filter_definition.rb +238 -0
  33. data/lib/algolia/models/analytics/order_definition.rb +230 -0
  34. data/lib/algolia/models/analytics/order_direction.rb +34 -0
  35. data/lib/algolia/models/analytics/parameter_definition.rb +230 -0
  36. data/lib/algolia/models/analytics/parameter_reference.rb +219 -0
  37. data/lib/algolia/models/analytics/parameter_value.rb +111 -0
  38. data/lib/algolia/models/analytics/scalar_payload.rb +247 -0
  39. data/lib/algolia/models/analytics/series.rb +234 -0
  40. data/lib/algolia/models/analytics/series_date.rb +223 -0
  41. data/lib/algolia/models/analytics/table_payload.rb +292 -0
  42. data/lib/algolia/models/analytics/table_response.rb +211 -0
  43. data/lib/algolia/models/analytics/timeseries_payload.rb +279 -0
  44. data/lib/algolia/models/analytics/timeseries_response.rb +213 -0
  45. data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +1 -1
  46. data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +1 -1
  47. data/lib/algolia/models/insights/converted_object_ids_after_search.rb +1 -1
  48. data/lib/algolia/models/insights/events_items.rb +1 -0
  49. data/lib/algolia/models/insights/instantsearch.rb +269 -0
  50. data/lib/algolia/models/insights/instantsearch_event.rb +33 -0
  51. data/lib/algolia/models/search/log.rb +11 -0
  52. data/lib/algolia/transport/http/http_requester.rb +2 -2
  53. data/lib/algolia/transport/request_id.rb +49 -0
  54. data/lib/algolia/transport/transport.rb +79 -8
  55. data/lib/algolia/version.rb +1 -1
  56. data/lib/algolia.rb +1 -0
  57. metadata +26 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7ee727296f4ef0f5097f1e9a17f8b76e0a2e04303aeaaa1b84a78a8cc3e899e
4
- data.tar.gz: 340f56004e8c495e8585bf43dc0b5a8cf36208c69b239b3d029e7b6b9428e8b7
3
+ metadata.gz: 131af010718e4264c9274e60d2196d44d4b2fc773c50bf2efee519882241834b
4
+ data.tar.gz: c03e511630bd7fc5eced4798c576ef1b6fb2e77325929e5f38f4e788428e83bb
5
5
  SHA512:
6
- metadata.gz: 0c50e49997bdfb4101478f6800ce76397c73d51e7755a1c7c425e6c6565d7c4435c04d792707fbee1c1cc3efc7a7cc8ef2fea740312d579651338c4cac953563
7
- data.tar.gz: 2d38395ca0ec5f708b0ba6a3210ff2c60d988829aac5cf80b8de2e767f408722932c899e86902555df17d064569612d9bf86ed5f115f9ee4f6bdff3c1b8a6821
6
+ metadata.gz: 21d7d96dddef5d1477718c2a29be54b607f2e182779eb7837bc279ce4cf05a3e7209584d99f61f8cf74549c928bbc07855987e70e36143d281fb226fef137dac
7
+ data.tar.gz: 444596073256d8222b5fde7e3b5172048408c487cb758243775b2c95d5fd0ec6401cff9b6fc2ba815bbcdc6db74a8cd9d9fc8b169eecba0c6d4988aa7e6270b2
@@ -14,7 +14,7 @@ jobs:
14
14
  name: Close PR
15
15
  runs-on: ubuntu-latest
16
16
  steps:
17
- - uses: actions/checkout@v7
17
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
18
18
 
19
19
  - name: Close PR
20
20
  env:
@@ -3,16 +3,18 @@ on:
3
3
  issues:
4
4
  types: [opened]
5
5
 
6
- permissions:
7
- issues: write
8
- contents: read
6
+ # the sync script only reads the event payload and calls the Jira API with its own token
7
+ permissions: {}
9
8
 
10
9
  jobs:
11
10
  sync:
12
11
  runs-on: ubuntu-latest
13
12
  steps:
14
13
  - name: Create ticket
15
- uses: actions/github-script@v9
14
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
15
+ env:
16
+ # env indirection so the secret is never materialized into the composed script
17
+ JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
16
18
  with:
17
19
  script: |
18
20
  const action = context.payload.action;
@@ -27,7 +29,7 @@ jobs:
27
29
  headers: {
28
30
  'Accept': 'application/json',
29
31
  'Content-Type': 'application/json',
30
- 'Authorization': `Basic ${{ secrets.JIRA_TOKEN }}`
32
+ 'Authorization': `Basic ${process.env.JIRA_TOKEN}`
31
33
  },
32
34
  body: JSON.stringify({
33
35
  fields: {
@@ -16,14 +16,14 @@ jobs:
16
16
  id-token: write
17
17
  contents: write
18
18
  steps:
19
- - uses: actions/checkout@v7
19
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
20
20
 
21
21
  - name: Install Ruby
22
- uses: ruby/setup-ruby@v1
22
+ uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
23
23
  with:
24
- ruby-version: 4.0.5
24
+ ruby-version: 4.0.6
25
25
  bundler-cache: true
26
26
 
27
- - uses: rubygems/release-gem@e9a6361a0b14562539327c2a02373edc56dd3169
27
+ - uses: rubygems/release-gem@7f9650160c1a4e7989fdc9855807bdbd421d8b6b # v1.4.1
28
28
  with:
29
29
  await-release: false
data/CHANGELOG.md CHANGED
@@ -1,3 +1,32 @@
1
+ ## [3.45.0](https://github.com/algolia/algoliasearch-client-ruby/compare/3.44.0...3.45.0)
2
+
3
+ BREAKING CHANGES: this minor version includes breaking changes in the A/B Testing V3 API. See below for more details.
4
+
5
+ - [c974374aff](https://github.com/algolia/api-clients-automation/commit/c974374aff) feat(ruby): Request-ID and Correlation-ID support ([#6877](https://github.com/algolia/api-clients-automation/pull/6877)) by [@MarioAlexandruDan](https://github.com/MarioAlexandruDan/)
6
+ - [e4a6ab510a](https://github.com/algolia/api-clients-automation/commit/e4a6ab510a) chore(ci): fail CI if a personal access token secret is referenced ([#6919](https://github.com/algolia/api-clients-automation/pull/6919)) by [@eric-zaharia](https://github.com/eric-zaharia/)
7
+ - [085364de00](https://github.com/algolia/api-clients-automation/commit/085364de00) feat(specs): deprecates /2 abtests endpoints ([#6921](https://github.com/algolia/api-clients-automation/pull/6921)) by [@Niamsy](https://github.com/Niamsy/)
8
+ - [32c1aaa192](https://github.com/algolia/api-clients-automation/commit/32c1aaa192) chore(deps): dependencies 2026-08-24 ([#6922](https://github.com/algolia/api-clients-automation/pull/6922)) by [@algolia-api-clients-automation-bot[bot]](https://github.com/apps/algolia-api-clients-automation-bot)
9
+ - [28aa13de2e](https://github.com/algolia/api-clients-automation/commit/28aa13de2e) fix(clients): support guzzlehttp/psr7 v3 ([#6945](https://github.com/algolia/api-clients-automation/pull/6945)) by [@eric-zaharia](https://github.com/eric-zaharia/)
10
+ - [b4c4109163](https://github.com/algolia/api-clients-automation/commit/b4c4109163) fix(specs): flag analytics patterns endpoints with x-beta ([#6954](https://github.com/algolia/api-clients-automation/pull/6954)) by [@cdhawke](https://github.com/cdhawke/)
11
+ - [8317b3a8ef](https://github.com/algolia/api-clients-automation/commit/8317b3a8ef) feat(specs): BREAKING CHANGE – remove migratedAbTestID from abtesting-v3 ([#6883](https://github.com/algolia/api-clients-automation/pull/6883)) by [@cdhawke](https://github.com/cdhawke/)
12
+ - [808f5ebcea](https://github.com/algolia/api-clients-automation/commit/808f5ebcea) fix(ruby): keep millisecond precision when converting timeouts to seconds ([#6946](https://github.com/algolia/api-clients-automation/pull/6946)) by [@MarioAlexandruDan](https://github.com/MarioAlexandruDan/)
13
+
14
+ ## [3.44.0](https://github.com/algolia/algoliasearch-client-ruby/compare/3.43.0...3.44.0)
15
+
16
+ - [c974374aff](https://github.com/algolia/api-clients-automation/commit/c974374aff) feat(ruby): Request-ID and Correlation-ID support ([#6877](https://github.com/algolia/api-clients-automation/pull/6877)) by [@MarioAlexandruDan](https://github.com/MarioAlexandruDan/)
17
+ - [e4a6ab510a](https://github.com/algolia/api-clients-automation/commit/e4a6ab510a) chore(ci): fail CI if a personal access token secret is referenced ([#6919](https://github.com/algolia/api-clients-automation/pull/6919)) by [@eric-zaharia](https://github.com/eric-zaharia/)
18
+ - [085364de00](https://github.com/algolia/api-clients-automation/commit/085364de00) feat(specs): deprecates /2 abtests endpoints ([#6921](https://github.com/algolia/api-clients-automation/pull/6921)) by [@Niamsy](https://github.com/Niamsy/)
19
+ - [32c1aaa192](https://github.com/algolia/api-clients-automation/commit/32c1aaa192) chore(deps): dependencies 2026-08-24 ([#6922](https://github.com/algolia/api-clients-automation/pull/6922)) by [@algolia-api-clients-automation-bot[bot]](https://github.com/apps/algolia-api-clients-automation-bot)
20
+
21
+ ## [3.43.0](https://github.com/algolia/algoliasearch-client-ruby/compare/3.42.3...3.43.0)
22
+
23
+ - [3bee6d1dee](https://github.com/algolia/api-clients-automation/commit/3bee6d1dee) chore(ci): pin all GitHub Action refs to commit SHAs (API-475) ([#6819](https://github.com/algolia/api-clients-automation/pull/6819)) by [@MarioAlexandruDan](https://github.com/MarioAlexandruDan/)
24
+ - [22af756864](https://github.com/algolia/api-clients-automation/commit/22af756864) chore(deps): dependencies 2026-07-20 ([#6733](https://github.com/algolia/api-clients-automation/pull/6733)) by [@algolia-api-clients-automation-bot[bot]](https://github.com/apps/algolia-api-clients-automation-bot)
25
+ - [1f389d1f7f](https://github.com/algolia/api-clients-automation/commit/1f389d1f7f) feat(specs): add agentic analytics support to insights spec ([#6876](https://github.com/algolia/api-clients-automation/pull/6876)) by [@sirockin](https://github.com/sirockin/)
26
+ - [65cc642811](https://github.com/algolia/api-clients-automation/commit/65cc642811) feat(specs): add decision (declared winner) to abtesting-v3 ABTest ([#6732](https://github.com/algolia/api-clients-automation/pull/6732)) by [@cdhawke](https://github.com/cdhawke/)
27
+ - [637defc23a](https://github.com/algolia/api-clients-automation/commit/637defc23a) feat(specs): add analytics v3 pattern endpoints ([#6795](https://github.com/algolia/api-clients-automation/pull/6795)) by [@Niamsy](https://github.com/Niamsy/)
28
+ - [bed536e149](https://github.com/algolia/api-clients-automation/commit/bed536e149) chore(deps): dependencies 2026-08-10 ([#6835](https://github.com/algolia/api-clients-automation/pull/6835)) by [@algolia-api-clients-automation-bot[bot]](https://github.com/apps/algolia-api-clients-automation-bot)
29
+
1
30
  ## [3.42.3](https://github.com/algolia/algoliasearch-client-ruby/compare/3.42.2...3.42.3)
2
31
 
3
32
  - [772f7055cc](https://github.com/algolia/api-clients-automation/commit/772f7055cc) fix(clients): add warning in replace_all_objects for empty objects ([#6610](https://github.com/algolia/api-clients-automation/pull/6610)) by [@eric-zaharia](https://github.com/eric-zaharia/)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- algolia (3.42.3)
4
+ algolia (3.45.0)
5
5
  base64 (>= 0.2.0, < 1)
6
6
  faraday (>= 1.0.1, < 3.0)
7
7
  faraday-net_http_persistent (>= 0.15, < 3)
@@ -21,7 +21,7 @@ GEM
21
21
  faraday-net_http_persistent (2.3.1)
22
22
  faraday (~> 2.5)
23
23
  net-http-persistent (>= 4.0.4, < 5)
24
- json (2.20.0)
24
+ json (2.21.2)
25
25
  logger (1.7.0)
26
26
  net-http (0.9.1)
27
27
  uri (>= 0.11.1)
@@ -23,7 +23,8 @@ module Algolia
23
23
  config.write_timeout = 30000
24
24
  end
25
25
 
26
- @api_client = Algolia::ApiClient.new(config)
26
+ # Per-client capability; an explicit config.request_id_enabled always wins.
27
+ @api_client = Algolia::ApiClient.new(config, request_id_support: false)
27
28
  end
28
29
 
29
30
  def self.create(app_id, api_key, region = nil, opts = {})
@@ -69,10 +70,11 @@ module Algolia
69
70
  self
70
71
  end
71
72
 
72
- # Creates a new A/B test.
73
+ # This endpoint is deprecated. Use the A/B Testing API v3 instead. Replaced by `POST /3/abtests`. Creates a new A/B test.
73
74
  #
74
75
  # Required API Key ACLs:
75
76
  # - editSettings
77
+ # THIS OPERATION IS DEPRECATED
76
78
  # @param add_ab_tests_request [AddABTestsRequest] (required)
77
79
  # @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)
78
80
  # @return [Http::Response] the response
@@ -101,7 +103,7 @@ module Algolia
101
103
  @api_client.call_api(:POST, path, new_options)
102
104
  end
103
105
 
104
- # Creates a new A/B test.
106
+ # This endpoint is deprecated. Use the A/B Testing API v3 instead. Replaced by `POST /3/abtests`. Creates a new A/B test.
105
107
  #
106
108
  # Required API Key ACLs:
107
109
  # - editSettings
@@ -305,10 +307,11 @@ module Algolia
305
307
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
306
308
  end
307
309
 
308
- # Deletes an A/B test by its ID.
310
+ # This endpoint is deprecated. Use the A/B Testing API v3 instead. Replaced by `DELETE /3/abtests/{id}`. Deletes an A/B test by its ID.
309
311
  #
310
312
  # Required API Key ACLs:
311
313
  # - editSettings
314
+ # THIS OPERATION IS DEPRECATED
312
315
  # @param id [Integer] Unique A/B test identifier. (required)
313
316
  # @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)
314
317
  # @return [Http::Response] the response
@@ -337,7 +340,7 @@ module Algolia
337
340
  @api_client.call_api(:DELETE, path, new_options)
338
341
  end
339
342
 
340
- # Deletes an A/B test by its ID.
343
+ # This endpoint is deprecated. Use the A/B Testing API v3 instead. Replaced by `DELETE /3/abtests/{id}`. Deletes an A/B test by its ID.
341
344
  #
342
345
  # Required API Key ACLs:
343
346
  # - editSettings
@@ -349,10 +352,11 @@ module Algolia
349
352
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Abtesting::ABTestResponse")
350
353
  end
351
354
 
352
- # Given the traffic percentage and the expected effect size, this endpoint estimates the sample size and duration of an A/B test based on historical traffic.
355
+ # This endpoint is deprecated. Use the A/B Testing API v3 instead. Replaced by `POST /3/abtests/estimate`. Given the traffic percentage and the expected effect size, this endpoint estimates the sample size and duration of an A/B test based on historical traffic.
353
356
  #
354
357
  # Required API Key ACLs:
355
358
  # - analytics
359
+ # THIS OPERATION IS DEPRECATED
356
360
  # @param estimate_ab_test_request [EstimateABTestRequest] (required)
357
361
  # @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
362
  # @return [Http::Response] the response
@@ -381,7 +385,7 @@ module Algolia
381
385
  @api_client.call_api(:POST, path, new_options)
382
386
  end
383
387
 
384
- # Given the traffic percentage and the expected effect size, this endpoint estimates the sample size and duration of an A/B test based on historical traffic.
388
+ # This endpoint is deprecated. Use the A/B Testing API v3 instead. Replaced by `POST /3/abtests/estimate`. Given the traffic percentage and the expected effect size, this endpoint estimates the sample size and duration of an A/B test based on historical traffic.
385
389
  #
386
390
  # Required API Key ACLs:
387
391
  # - analytics
@@ -393,10 +397,11 @@ module Algolia
393
397
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Abtesting::EstimateABTestResponse")
394
398
  end
395
399
 
396
- # Retrieves the details for an A/B test by its ID.
400
+ # This endpoint is deprecated. Use the A/B Testing API v3 instead. Replaced by `GET /3/abtests/{id}`. Retrieves the details for an A/B test by its ID.
397
401
  #
398
402
  # Required API Key ACLs:
399
403
  # - analytics
404
+ # THIS OPERATION IS DEPRECATED
400
405
  # @param id [Integer] Unique A/B test identifier. (required)
401
406
  # @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)
402
407
  # @return [Http::Response] the response
@@ -425,7 +430,7 @@ module Algolia
425
430
  @api_client.call_api(:GET, path, new_options)
426
431
  end
427
432
 
428
- # Retrieves the details for an A/B test by its ID.
433
+ # This endpoint is deprecated. Use the A/B Testing API v3 instead. Replaced by `GET /3/abtests/{id}`. Retrieves the details for an A/B test by its ID.
429
434
  #
430
435
  # Required API Key ACLs:
431
436
  # - analytics
@@ -437,10 +442,11 @@ module Algolia
437
442
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Abtesting::ABTest")
438
443
  end
439
444
 
440
- # Lists all A/B tests you configured for this application.
445
+ # This endpoint is deprecated. Use the A/B Testing API v3 instead. Replaced by `GET /3/abtests`. Lists all A/B tests you configured for this application.
441
446
  #
442
447
  # Required API Key ACLs:
443
448
  # - analytics
449
+ # THIS OPERATION IS DEPRECATED
444
450
  # @param offset [Integer] Position of the first item to return. (default to 0)
445
451
  # @param limit [Integer] Number of items to return. (default to 10)
446
452
  # @param index_prefix [String] Index name prefix. Only A/B tests for indices starting with this string are included in the response.
@@ -477,7 +483,7 @@ module Algolia
477
483
  @api_client.call_api(:GET, path, new_options)
478
484
  end
479
485
 
480
- # Lists all A/B tests you configured for this application.
486
+ # This endpoint is deprecated. Use the A/B Testing API v3 instead. Replaced by `GET /3/abtests`. Lists all A/B tests you configured for this application.
481
487
  #
482
488
  # Required API Key ACLs:
483
489
  # - analytics
@@ -492,10 +498,11 @@ module Algolia
492
498
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Abtesting::ListABTestsResponse")
493
499
  end
494
500
 
495
- # Stops an A/B test by its ID. You can't restart stopped A/B tests.
501
+ # This endpoint is deprecated. Use the A/B Testing API v3 instead. Replaced by `POST /3/abtests/{id}/stop`. Stops an A/B test by its ID. You can't restart stopped A/B tests.
496
502
  #
497
503
  # Required API Key ACLs:
498
504
  # - editSettings
505
+ # THIS OPERATION IS DEPRECATED
499
506
  # @param id [Integer] Unique A/B test identifier. (required)
500
507
  # @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)
501
508
  # @return [Http::Response] the response
@@ -524,7 +531,7 @@ module Algolia
524
531
  @api_client.call_api(:POST, path, new_options)
525
532
  end
526
533
 
527
- # Stops an A/B test by its ID. You can't restart stopped A/B tests.
534
+ # This endpoint is deprecated. Use the A/B Testing API v3 instead. Replaced by `POST /3/abtests/{id}/stop`. Stops an A/B test by its ID. You can't restart stopped A/B tests.
528
535
  #
529
536
  # Required API Key ACLs:
530
537
  # - editSettings
@@ -23,7 +23,8 @@ module Algolia
23
23
  config.write_timeout = 30000
24
24
  end
25
25
 
26
- @api_client = Algolia::ApiClient.new(config)
26
+ # Per-client capability; an explicit config.request_id_enabled always wins.
27
+ @api_client = Algolia::ApiClient.new(config, request_id_support: false)
27
28
  end
28
29
 
29
30
  def self.create(app_id, api_key, region = nil, opts = {})
@@ -26,7 +26,8 @@ module Algolia
26
26
  config.write_timeout = 25000
27
27
  end
28
28
 
29
- @api_client = Algolia::ApiClient.new(config)
29
+ # Per-client capability; an explicit config.request_id_enabled always wins.
30
+ @api_client = Algolia::ApiClient.new(config, request_id_support: false)
30
31
  end
31
32
 
32
33
  def self.create(app_id, api_key, opts = {})
@@ -23,7 +23,8 @@ module Algolia
23
23
  config.write_timeout = 30000
24
24
  end
25
25
 
26
- @api_client = Algolia::ApiClient.new(config)
26
+ # Per-client capability; an explicit config.request_id_enabled always wins.
27
+ @api_client = Algolia::ApiClient.new(config, request_id_support: false)
27
28
  end
28
29
 
29
30
  def self.create(app_id, api_key, region = nil, opts = {})
@@ -691,6 +692,39 @@ module Algolia
691
692
  )
692
693
  end
693
694
 
695
+ # Returns the static catalog of analytics fields, grouped by domain and usage (metrics, filters, groups, distributions). No authentication is required. Use it to discover valid `(domain, kind)` pairs before building the other `/3/patterns/*` queries; two fields are combinable in one query only when their `roots` intersect. Each entry's `requires` lists the ACLs needed when that field is actually used in a query.
696
+
697
+ # @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)
698
+ # @return [Http::Response] the response
699
+ def get_patterns_fields_with_http_info(request_options = {})
700
+ path = "/3/patterns/fields"
701
+ query_params = {}
702
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
703
+ header_params = {}
704
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
705
+
706
+ post_body = request_options[:debug_body]
707
+
708
+ new_options = request_options.merge(
709
+ :operation => :"AnalyticsClient.get_patterns_fields",
710
+ :header_params => header_params,
711
+ :query_params => query_params,
712
+ :body => post_body,
713
+ :use_read_transporter => false
714
+ )
715
+
716
+ @api_client.call_api(:GET, path, new_options)
717
+ end
718
+
719
+ # Returns the static catalog of analytics fields, grouped by domain and usage (metrics, filters, groups, distributions). No authentication is required. Use it to discover valid `(domain, kind)` pairs before building the other `/3/patterns/*` queries; two fields are combinable in one query only when their `roots` intersect. Each entry's `requires` lists the ACLs needed when that field is actually used in a query.
720
+
721
+ # @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)
722
+ # @return [Catalog]
723
+ def get_patterns_fields(request_options = {})
724
+ response = get_patterns_fields_with_http_info(request_options)
725
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Analytics::Catalog")
726
+ end
727
+
694
728
  # Retrieves the purchase rate for all your searches with at least one purchase event, including a daily breakdown. By default, the analyzed period includes the last eight days, including the current day. The rate is purchase conversion events divided by tracked searches. A search is tracked if it returns a query ID (`clickAnalytics` is `true`). This differs from the response's `count`, which includes searches where `clickAnalytics` is `false`. **There's a difference between a 0 and null purchase rate when `clickAnalytics` is enabled:** - **Null** means there were no queries. Algolia didn't receive any events, so the purchase rate is null. - **0** means there were queries but no [purchase conversion events](https://www.algolia.com/doc/guides/sending-events/getting-started) were received.
695
729
  #
696
730
  # Required API Key ACLs:
@@ -1765,5 +1799,193 @@ module Algolia
1765
1799
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Analytics::GetUsersCountResponse")
1766
1800
  end
1767
1801
 
1802
+ # Buckets one or more numeric fields into histograms and returns an object keyed by `histogram<Field>`, each mapping a bin label to a count. `distributions` and `parameters` are required; `filters` is optional. Discover valid field kinds per domain with `/3/patterns/fields`.
1803
+ #
1804
+ # Required API Key ACLs:
1805
+ # - analytics
1806
+ # @param distribution_payload [DistributionPayload] (required)
1807
+ # @param index [String] Comma-separated list of indices the request runs on, used for authorization. Required for index-restricted API keys and must match the indices supplied in the request body's `indices` parameter; optional for unrestricted keys.
1808
+ # @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)
1809
+ # @return [Http::Response] the response
1810
+ def query_patterns_distribution_with_http_info(distribution_payload, index = nil, request_options = {})
1811
+ # verify the required parameter 'distribution_payload' is set
1812
+ if @api_client.config.client_side_validation && distribution_payload.nil?
1813
+ raise ArgumentError, "Parameter `distribution_payload` is required when calling `query_patterns_distribution`."
1814
+ end
1815
+
1816
+ path = "/3/patterns/distribution"
1817
+ query_params = {}
1818
+ query_params[:index] = index unless index.nil?
1819
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1820
+ header_params = {}
1821
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1822
+
1823
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(distribution_payload)
1824
+
1825
+ new_options = request_options.merge(
1826
+ :operation => :"AnalyticsClient.query_patterns_distribution",
1827
+ :header_params => header_params,
1828
+ :query_params => query_params,
1829
+ :body => post_body,
1830
+ :use_read_transporter => false
1831
+ )
1832
+
1833
+ @api_client.call_api(:POST, path, new_options)
1834
+ end
1835
+
1836
+ # Buckets one or more numeric fields into histograms and returns an object keyed by `histogram<Field>`, each mapping a bin label to a count. `distributions` and `parameters` are required; `filters` is optional. Discover valid field kinds per domain with `/3/patterns/fields`.
1837
+ #
1838
+ # Required API Key ACLs:
1839
+ # - analytics
1840
+ # @param distribution_payload [DistributionPayload] (required)
1841
+ # @param index [String] Comma-separated list of indices the request runs on, used for authorization. Required for index-restricted API keys and must match the indices supplied in the request body's `indices` parameter; optional for unrestricted keys.
1842
+ # @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)
1843
+ # @return [Hash<String, Object>]
1844
+ def query_patterns_distribution(distribution_payload, index = nil, request_options = {})
1845
+ response = query_patterns_distribution_with_http_info(distribution_payload, index, request_options)
1846
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Hash<String, Object>")
1847
+ end
1848
+
1849
+ # Aggregates the requested `metrics` over the whole period and returns a single object keyed by metric kind. `metrics` and `parameters` are required; `filters` is optional. Discover valid field kinds per domain with `/3/patterns/fields`.
1850
+ #
1851
+ # Required API Key ACLs:
1852
+ # - analytics
1853
+ # @param scalar_payload [ScalarPayload] (required)
1854
+ # @param index [String] Comma-separated list of indices the request runs on, used for authorization. Required for index-restricted API keys and must match the indices supplied in the request body's `indices` parameter; optional for unrestricted keys.
1855
+ # @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)
1856
+ # @return [Http::Response] the response
1857
+ def query_patterns_scalar_with_http_info(scalar_payload, index = nil, request_options = {})
1858
+ # verify the required parameter 'scalar_payload' is set
1859
+ if @api_client.config.client_side_validation && scalar_payload.nil?
1860
+ raise ArgumentError, "Parameter `scalar_payload` is required when calling `query_patterns_scalar`."
1861
+ end
1862
+
1863
+ path = "/3/patterns/scalar"
1864
+ query_params = {}
1865
+ query_params[:index] = index unless index.nil?
1866
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1867
+ header_params = {}
1868
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1869
+
1870
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(scalar_payload)
1871
+
1872
+ new_options = request_options.merge(
1873
+ :operation => :"AnalyticsClient.query_patterns_scalar",
1874
+ :header_params => header_params,
1875
+ :query_params => query_params,
1876
+ :body => post_body,
1877
+ :use_read_transporter => false
1878
+ )
1879
+
1880
+ @api_client.call_api(:POST, path, new_options)
1881
+ end
1882
+
1883
+ # Aggregates the requested `metrics` over the whole period and returns a single object keyed by metric kind. `metrics` and `parameters` are required; `filters` is optional. Discover valid field kinds per domain with `/3/patterns/fields`.
1884
+ #
1885
+ # Required API Key ACLs:
1886
+ # - analytics
1887
+ # @param scalar_payload [ScalarPayload] (required)
1888
+ # @param index [String] Comma-separated list of indices the request runs on, used for authorization. Required for index-restricted API keys and must match the indices supplied in the request body's `indices` parameter; optional for unrestricted keys.
1889
+ # @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)
1890
+ # @return [Hash<String, Object>]
1891
+ def query_patterns_scalar(scalar_payload, index = nil, request_options = {})
1892
+ response = query_patterns_scalar_with_http_info(scalar_payload, index, request_options)
1893
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Hash<String, Object>")
1894
+ end
1895
+
1896
+ # Returns `rows`, each a flat object of the requested fields. `metrics` and `parameters` are required; `groupBy`, `filters`, and `orderBy` are optional, though `orderBy` is required when `groupBy` is set. Discover valid field kinds per domain with `/3/patterns/fields`.
1897
+ #
1898
+ # Required API Key ACLs:
1899
+ # - analytics
1900
+ # @param table_payload [TablePayload] (required)
1901
+ # @param index [String] Comma-separated list of indices the request runs on, used for authorization. Required for index-restricted API keys and must match the indices supplied in the request body's `indices` parameter; optional for unrestricted keys.
1902
+ # @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)
1903
+ # @return [Http::Response] the response
1904
+ def query_patterns_table_with_http_info(table_payload, index = nil, request_options = {})
1905
+ # verify the required parameter 'table_payload' is set
1906
+ if @api_client.config.client_side_validation && table_payload.nil?
1907
+ raise ArgumentError, "Parameter `table_payload` is required when calling `query_patterns_table`."
1908
+ end
1909
+
1910
+ path = "/3/patterns/table"
1911
+ query_params = {}
1912
+ query_params[:index] = index unless index.nil?
1913
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1914
+ header_params = {}
1915
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1916
+
1917
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(table_payload)
1918
+
1919
+ new_options = request_options.merge(
1920
+ :operation => :"AnalyticsClient.query_patterns_table",
1921
+ :header_params => header_params,
1922
+ :query_params => query_params,
1923
+ :body => post_body,
1924
+ :use_read_transporter => false
1925
+ )
1926
+
1927
+ @api_client.call_api(:POST, path, new_options)
1928
+ end
1929
+
1930
+ # Returns `rows`, each a flat object of the requested fields. `metrics` and `parameters` are required; `groupBy`, `filters`, and `orderBy` are optional, though `orderBy` is required when `groupBy` is set. Discover valid field kinds per domain with `/3/patterns/fields`.
1931
+ #
1932
+ # Required API Key ACLs:
1933
+ # - analytics
1934
+ # @param table_payload [TablePayload] (required)
1935
+ # @param index [String] Comma-separated list of indices the request runs on, used for authorization. Required for index-restricted API keys and must match the indices supplied in the request body's `indices` parameter; optional for unrestricted keys.
1936
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1937
+ # @return [TableResponse]
1938
+ def query_patterns_table(table_payload, index = nil, request_options = {})
1939
+ response = query_patterns_table_with_http_info(table_payload, index, request_options)
1940
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Analytics::TableResponse")
1941
+ end
1942
+
1943
+ # Returns one time series per `groupBy` combination, each with period `totals` and a per-day metric breakdown. `metrics` and `parameters` are required; `groupBy` and `filters` are optional. Discover valid field kinds per domain with `/3/patterns/fields`.
1944
+ #
1945
+ # Required API Key ACLs:
1946
+ # - analytics
1947
+ # @param timeseries_payload [TimeseriesPayload] (required)
1948
+ # @param index [String] Comma-separated list of indices the request runs on, used for authorization. Required for index-restricted API keys and must match the indices supplied in the request body's `indices` parameter; optional for unrestricted keys.
1949
+ # @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)
1950
+ # @return [Http::Response] the response
1951
+ def query_patterns_timeseries_with_http_info(timeseries_payload, index = nil, request_options = {})
1952
+ # verify the required parameter 'timeseries_payload' is set
1953
+ if @api_client.config.client_side_validation && timeseries_payload.nil?
1954
+ raise ArgumentError, "Parameter `timeseries_payload` is required when calling `query_patterns_timeseries`."
1955
+ end
1956
+
1957
+ path = "/3/patterns/timeseries"
1958
+ query_params = {}
1959
+ query_params[:index] = index unless index.nil?
1960
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
1961
+ header_params = {}
1962
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
1963
+
1964
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(timeseries_payload)
1965
+
1966
+ new_options = request_options.merge(
1967
+ :operation => :"AnalyticsClient.query_patterns_timeseries",
1968
+ :header_params => header_params,
1969
+ :query_params => query_params,
1970
+ :body => post_body,
1971
+ :use_read_transporter => false
1972
+ )
1973
+
1974
+ @api_client.call_api(:POST, path, new_options)
1975
+ end
1976
+
1977
+ # Returns one time series per `groupBy` combination, each with period `totals` and a per-day metric breakdown. `metrics` and `parameters` are required; `groupBy` and `filters` are optional. Discover valid field kinds per domain with `/3/patterns/fields`.
1978
+ #
1979
+ # Required API Key ACLs:
1980
+ # - analytics
1981
+ # @param timeseries_payload [TimeseriesPayload] (required)
1982
+ # @param index [String] Comma-separated list of indices the request runs on, used for authorization. Required for index-restricted API keys and must match the indices supplied in the request body's `indices` parameter; optional for unrestricted keys.
1983
+ # @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)
1984
+ # @return [TimeseriesResponse]
1985
+ def query_patterns_timeseries(timeseries_payload, index = nil, request_options = {})
1986
+ response = query_patterns_timeseries_with_http_info(timeseries_payload, index, request_options)
1987
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Analytics::TimeseriesResponse")
1988
+ end
1989
+
1768
1990
  end
1769
1991
  end
@@ -23,7 +23,8 @@ module Algolia
23
23
  config.write_timeout = 30000
24
24
  end
25
25
 
26
- @api_client = Algolia::ApiClient.new(config)
26
+ # Per-client capability; an explicit config.request_id_enabled always wins.
27
+ @api_client = Algolia::ApiClient.new(config, request_id_support: true)
27
28
  end
28
29
 
29
30
  def self.create(app_id, api_key, opts = {})
@@ -23,7 +23,8 @@ module Algolia
23
23
  config.write_timeout = 25000
24
24
  end
25
25
 
26
- @api_client = Algolia::ApiClient.new(config)
26
+ # Per-client capability; an explicit config.request_id_enabled always wins.
27
+ @api_client = Algolia::ApiClient.new(config, request_id_support: false)
27
28
  end
28
29
 
29
30
  def self.create(app_id, api_key, region = nil, opts = {})
@@ -23,7 +23,8 @@ module Algolia
23
23
  config.write_timeout = 30000
24
24
  end
25
25
 
26
- @api_client = Algolia::ApiClient.new(config)
26
+ # Per-client capability; an explicit config.request_id_enabled always wins.
27
+ @api_client = Algolia::ApiClient.new(config, request_id_support: false)
27
28
  end
28
29
 
29
30
  def self.create(app_id, api_key, region = nil, opts = {})
@@ -23,7 +23,8 @@ module Algolia
23
23
  config.write_timeout = 30000
24
24
  end
25
25
 
26
- @api_client = Algolia::ApiClient.new(config)
26
+ # Per-client capability; an explicit config.request_id_enabled always wins.
27
+ @api_client = Algolia::ApiClient.new(config, request_id_support: false)
27
28
  end
28
29
 
29
30
  def self.create(app_id, api_key, opts = {})
@@ -23,7 +23,8 @@ module Algolia
23
23
  config.write_timeout = 30000
24
24
  end
25
25
 
26
- @api_client = Algolia::ApiClient.new(config)
26
+ # Per-client capability; an explicit config.request_id_enabled always wins.
27
+ @api_client = Algolia::ApiClient.new(config, request_id_support: false)
27
28
  end
28
29
 
29
30
  def self.create(app_id, api_key, region = nil, opts = {})
@@ -23,7 +23,8 @@ module Algolia
23
23
  config.write_timeout = 30000
24
24
  end
25
25
 
26
- @api_client = Algolia::ApiClient.new(config)
26
+ # Per-client capability; an explicit config.request_id_enabled always wins.
27
+ @api_client = Algolia::ApiClient.new(config, request_id_support: false)
27
28
  end
28
29
 
29
30
  def self.create(app_id, api_key, region = nil, opts = {})
@@ -23,7 +23,8 @@ module Algolia
23
23
  config.write_timeout = 30000
24
24
  end
25
25
 
26
- @api_client = Algolia::ApiClient.new(config)
26
+ # Per-client capability; an explicit config.request_id_enabled always wins.
27
+ @api_client = Algolia::ApiClient.new(config, request_id_support: true)
27
28
  end
28
29
 
29
30
  def self.create(app_id, api_key, opts = {})