algolia 3.22.1 → 3.23.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 (39) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +1 -1
  3. data/CHANGELOG.md +5 -0
  4. data/Gemfile.lock +1 -1
  5. data/lib/algolia/api/abtesting_v3_client.rb +638 -0
  6. data/lib/algolia/models/abtesting-v3/ab_test.rb +300 -0
  7. data/lib/algolia/models/abtesting-v3/ab_test_configuration.rb +230 -0
  8. data/lib/algolia/models/abtesting-v3/ab_test_response.rb +235 -0
  9. data/lib/algolia/models/abtesting-v3/ab_tests_variant.rb +233 -0
  10. data/lib/algolia/models/abtesting-v3/ab_tests_variant_search_params.rb +259 -0
  11. data/lib/algolia/models/abtesting-v3/add_ab_tests_request.rb +260 -0
  12. data/lib/algolia/models/abtesting-v3/add_ab_tests_variant.rb +109 -0
  13. data/lib/algolia/models/abtesting-v3/create_metric.rb +222 -0
  14. data/lib/algolia/models/abtesting-v3/direction.rb +34 -0
  15. data/lib/algolia/models/abtesting-v3/effect_metric.rb +37 -0
  16. data/lib/algolia/models/abtesting-v3/empty_search_filter.rb +220 -0
  17. data/lib/algolia/models/abtesting-v3/error_base.rb +209 -0
  18. data/lib/algolia/models/abtesting-v3/error_correction_type.rb +34 -0
  19. data/lib/algolia/models/abtesting-v3/estimate_ab_test_request.rb +224 -0
  20. data/lib/algolia/models/abtesting-v3/estimate_ab_test_response.rb +221 -0
  21. data/lib/algolia/models/abtesting-v3/estimate_configuration.rb +223 -0
  22. data/lib/algolia/models/abtesting-v3/filter_effects.rb +218 -0
  23. data/lib/algolia/models/abtesting-v3/list_ab_tests_response.rb +239 -0
  24. data/lib/algolia/models/abtesting-v3/metric_date.rb +221 -0
  25. data/lib/algolia/models/abtesting-v3/metric_metadata.rb +220 -0
  26. data/lib/algolia/models/abtesting-v3/metric_name.rb +63 -0
  27. data/lib/algolia/models/abtesting-v3/metric_result.rb +315 -0
  28. data/lib/algolia/models/abtesting-v3/metrics_filter.rb +244 -0
  29. data/lib/algolia/models/abtesting-v3/minimum_detectable_effect.rb +223 -0
  30. data/lib/algolia/models/abtesting-v3/outliers_filter.rb +220 -0
  31. data/lib/algolia/models/abtesting-v3/schedule_ab_test_response.rb +211 -0
  32. data/lib/algolia/models/abtesting-v3/schedule_ab_tests_request.rb +272 -0
  33. data/lib/algolia/models/abtesting-v3/status.rb +36 -0
  34. data/lib/algolia/models/abtesting-v3/timeseries.rb +225 -0
  35. data/lib/algolia/models/abtesting-v3/timeseries_variant.rb +210 -0
  36. data/lib/algolia/models/abtesting-v3/variant.rb +275 -0
  37. data/lib/algolia/models/abtesting-v3/variant_metadata.rb +209 -0
  38. data/lib/algolia/version.rb +1 -1
  39. metadata +34 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31c57dd38d31a525efb169f39ee223c30334d1f17f4e2e31288e3d47a9385ca0
4
- data.tar.gz: 1d8c171978f9ac404996faf0bd3464a9aae3ad89e415c9a1c5d55d06d85ec732
3
+ metadata.gz: 9fff1502a30fce45ad42d7166299524a573e06053f830fa1f18651e541e4dbdb
4
+ data.tar.gz: 76b07e570220ca1cb5afd4ce7c82d103f83cc40dbb0a52aeccfdfa341689d4bf
5
5
  SHA512:
6
- metadata.gz: 23275035d3a2904e2c604ab70e4551b642d78c2f620baf4681454195b95015c72e8e67b2d129965a28d7f6aef33f5d2a6a26dec3e497d83e1bcda1766c6590a9
7
- data.tar.gz: 18c62b811bb45a9ed586ed5e0ecff98aedd4d7704ec6dab4fad9b9a5ce73da4893bc8f5bc5f6af9ef8df34ae216fff1f2dcb835e4a504a310b8d6e84f9d59558
6
+ metadata.gz: c423ef6ca5a1b550eb3f54668e42df002f9e4355e0db592274814e21ea1670660c24a64cce4352580877cd0ace43d623aba790efaacec671e4a5ac3ee9abdb83
7
+ data.tar.gz: 017a0a4378f8d441486bc6fc9a94b254a0a02d692362bf89c063e4f3f4df1f8e00bf3a4aa4080307477f8444a1760a2d55d65335b8786c2cc80356390f85355d
@@ -24,6 +24,6 @@ jobs:
24
24
  ruby-version: 3.4.5
25
25
  bundler-cache: true
26
26
 
27
- - uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32
27
+ - uses: rubygems/release-gem@ebe1ec66bd8d2c709ac29aa2b43438d450e7a0a6
28
28
  with:
29
29
  await-release: false
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [3.23.0](https://github.com/algolia/algoliasearch-client-ruby/compare/3.22.1...3.23.0)
2
+
3
+ - [050aacef17](https://github.com/algolia/api-clients-automation/commit/050aacef17) chore(deps): dependencies 2025-07-28 ([#5161](https://github.com/algolia/api-clients-automation/pull/5161)) by [@algolia-bot](https://github.com/algolia-bot/)
4
+ - [66bc4eee9e](https://github.com/algolia/api-clients-automation/commit/66bc4eee9e) feat(clients): add new abtesting-v3 package to clients + stabilize alpha js package ([#5157](https://github.com/algolia/api-clients-automation/pull/5157)) by [@leonardogavaudan](https://github.com/leonardogavaudan/)
5
+
1
6
  ## [3.22.1](https://github.com/algolia/algoliasearch-client-ruby/compare/3.22.0...3.22.1)
2
7
 
3
8
  - [84a1f4e422](https://github.com/algolia/api-clients-automation/commit/84a1f4e422) refactor(specs): add interface to manipulate query parameter between composition API & Search API ([#5123](https://github.com/algolia/api-clients-automation/pull/5123)) by [@ClaraMuller](https://github.com/ClaraMuller/)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- algolia (3.22.1)
4
+ algolia (3.23.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)
@@ -0,0 +1,638 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
4
+
5
+ module Algolia
6
+ class AbtestingV3Client
7
+ attr_accessor :api_client
8
+
9
+ def initialize(config = nil)
10
+ raise "`config` is missing." if config.nil?
11
+ raise "`app_id` is missing." if config.app_id.nil? || config.app_id == ""
12
+ raise "`api_key` is missing." if config.api_key.nil? || config.api_key == ""
13
+
14
+ @api_client = Algolia::ApiClient.new(config)
15
+ end
16
+
17
+ def self.create(app_id, api_key, region = nil, opts = {})
18
+ hosts = []
19
+ regions = ["de", "us"]
20
+
21
+ if region.is_a?(Hash) && (opts.nil? || opts.empty?)
22
+ opts = region
23
+ region = nil
24
+ end
25
+
26
+ if !region.nil? && (!region.is_a?(String) || !regions.include?(region))
27
+ raise "`region` must be one of the following: #{regions.join(", ")}"
28
+ end
29
+
30
+ hosts <<
31
+ Transport::StatefulHost.new(
32
+ region.nil? ? "analytics.algolia.com" : "analytics.{region}.algolia.com".sub("{region}", region),
33
+ accept: CallType::READ | CallType::WRITE
34
+ )
35
+
36
+ config = Algolia::Configuration.new(app_id, api_key, hosts, "AbtestingV3", opts)
37
+ create_with_config(config)
38
+ end
39
+
40
+ def self.create_with_config(config)
41
+ if config.connect_timeout.nil?
42
+ config.connect_timeout = 2000
43
+ end
44
+
45
+ if config.read_timeout.nil?
46
+ config.read_timeout = 5000
47
+ end
48
+
49
+ if config.write_timeout.nil?
50
+ config.write_timeout = 30000
51
+ end
52
+
53
+ new(config)
54
+ end
55
+
56
+ # Helper method to switch the API key used to authenticate the requests.
57
+ #
58
+ # @param api_key [String] the new API key to use.
59
+ # @return [void]
60
+ def set_client_api_key(api_key)
61
+ @api_client.set_client_api_key(api_key)
62
+
63
+ self
64
+ end
65
+
66
+ def add_user_agent_segment(segment, version = nil)
67
+ @api_client.config.add_user_agent_segment(segment, version)
68
+
69
+ self
70
+ end
71
+
72
+ # Creates a new A/B test.
73
+ #
74
+ # Required API Key ACLs:
75
+ # - editSettings
76
+ # @param add_ab_tests_request [AddABTestsRequest] (required)
77
+ # @param request_options: 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
+ # @return [Http::Response] the response
79
+ def add_ab_tests_with_http_info(add_ab_tests_request, request_options = {})
80
+ # verify the required parameter 'add_ab_tests_request' is set
81
+ if @api_client.config.client_side_validation && add_ab_tests_request.nil?
82
+ raise ArgumentError, "Parameter `add_ab_tests_request` is required when calling `add_ab_tests`."
83
+ end
84
+
85
+ path = "/3/abtests"
86
+ query_params = {}
87
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
88
+ header_params = {}
89
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
90
+
91
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(add_ab_tests_request)
92
+
93
+ new_options = request_options.merge(
94
+ :operation => :"AbtestingV3Client.add_ab_tests",
95
+ :header_params => header_params,
96
+ :query_params => query_params,
97
+ :body => post_body,
98
+ :use_read_transporter => false
99
+ )
100
+
101
+ @api_client.call_api(:POST, path, new_options)
102
+ end
103
+
104
+ # Creates a new A/B test.
105
+ #
106
+ # Required API Key ACLs:
107
+ # - editSettings
108
+ # @param add_ab_tests_request [AddABTestsRequest] (required)
109
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
110
+ # @return [ABTestResponse]
111
+ def add_ab_tests(add_ab_tests_request, request_options = {})
112
+ response = add_ab_tests_with_http_info(add_ab_tests_request, request_options)
113
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "AbtestingV3::ABTestResponse")
114
+ end
115
+
116
+ # This method lets you send requests to the Algolia REST API.
117
+
118
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
119
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
120
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
121
+ # @return [Http::Response] the response
122
+ def custom_delete_with_http_info(path, parameters = nil, request_options = {})
123
+ # verify the required parameter 'path' is set
124
+ if @api_client.config.client_side_validation && path.nil?
125
+ raise ArgumentError, "Parameter `path` is required when calling `custom_delete`."
126
+ end
127
+
128
+ path = "/{path}".sub("{" + "path" + "}", path.to_s)
129
+ query_params = {}
130
+ query_params = query_params.merge(parameters) unless parameters.nil?
131
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
132
+ header_params = {}
133
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
134
+
135
+ post_body = request_options[:debug_body]
136
+
137
+ new_options = request_options.merge(
138
+ :operation => :"AbtestingV3Client.custom_delete",
139
+ :header_params => header_params,
140
+ :query_params => query_params,
141
+ :body => post_body,
142
+ :use_read_transporter => false
143
+ )
144
+
145
+ @api_client.call_api(:DELETE, path, new_options)
146
+ end
147
+
148
+ # This method lets you send requests to the Algolia REST API.
149
+
150
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
151
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
152
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
153
+ # @return [Object]
154
+ def custom_delete(path, parameters = nil, request_options = {})
155
+ response = custom_delete_with_http_info(path, parameters, request_options)
156
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
157
+ end
158
+
159
+ # This method lets you send requests to the Algolia REST API.
160
+
161
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
162
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
163
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
164
+ # @return [Http::Response] the response
165
+ def custom_get_with_http_info(path, parameters = nil, request_options = {})
166
+ # verify the required parameter 'path' is set
167
+ if @api_client.config.client_side_validation && path.nil?
168
+ raise ArgumentError, "Parameter `path` is required when calling `custom_get`."
169
+ end
170
+
171
+ path = "/{path}".sub("{" + "path" + "}", path.to_s)
172
+ query_params = {}
173
+ query_params = query_params.merge(parameters) unless parameters.nil?
174
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
175
+ header_params = {}
176
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
177
+
178
+ post_body = request_options[:debug_body]
179
+
180
+ new_options = request_options.merge(
181
+ :operation => :"AbtestingV3Client.custom_get",
182
+ :header_params => header_params,
183
+ :query_params => query_params,
184
+ :body => post_body,
185
+ :use_read_transporter => false
186
+ )
187
+
188
+ @api_client.call_api(:GET, path, new_options)
189
+ end
190
+
191
+ # This method lets you send requests to the Algolia REST API.
192
+
193
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
194
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
195
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
196
+ # @return [Object]
197
+ def custom_get(path, parameters = nil, request_options = {})
198
+ response = custom_get_with_http_info(path, parameters, request_options)
199
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
200
+ end
201
+
202
+ # This method lets you send requests to the Algolia REST API.
203
+
204
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
205
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
206
+ # @param body [Object] Parameters to send with the custom request.
207
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
208
+ # @return [Http::Response] the response
209
+ def custom_post_with_http_info(path, parameters = nil, body = nil, request_options = {})
210
+ # verify the required parameter 'path' is set
211
+ if @api_client.config.client_side_validation && path.nil?
212
+ raise ArgumentError, "Parameter `path` is required when calling `custom_post`."
213
+ end
214
+
215
+ path = "/{path}".sub("{" + "path" + "}", path.to_s)
216
+ query_params = {}
217
+ query_params = query_params.merge(parameters) unless parameters.nil?
218
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
219
+ header_params = {}
220
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
221
+
222
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)
223
+
224
+ new_options = request_options.merge(
225
+ :operation => :"AbtestingV3Client.custom_post",
226
+ :header_params => header_params,
227
+ :query_params => query_params,
228
+ :body => post_body,
229
+ :use_read_transporter => false
230
+ )
231
+
232
+ @api_client.call_api(:POST, path, new_options)
233
+ end
234
+
235
+ # This method lets you send requests to the Algolia REST API.
236
+
237
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
238
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
239
+ # @param body [Object] Parameters to send with the custom request.
240
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
241
+ # @return [Object]
242
+ def custom_post(path, parameters = nil, body = nil, request_options = {})
243
+ response = custom_post_with_http_info(path, parameters, body, request_options)
244
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
245
+ end
246
+
247
+ # This method lets you send requests to the Algolia REST API.
248
+
249
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
250
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
251
+ # @param body [Object] Parameters to send with the custom request.
252
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
253
+ # @return [Http::Response] the response
254
+ def custom_put_with_http_info(path, parameters = nil, body = nil, request_options = {})
255
+ # verify the required parameter 'path' is set
256
+ if @api_client.config.client_side_validation && path.nil?
257
+ raise ArgumentError, "Parameter `path` is required when calling `custom_put`."
258
+ end
259
+
260
+ path = "/{path}".sub("{" + "path" + "}", path.to_s)
261
+ query_params = {}
262
+ query_params = query_params.merge(parameters) unless parameters.nil?
263
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
264
+ header_params = {}
265
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
266
+
267
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)
268
+
269
+ new_options = request_options.merge(
270
+ :operation => :"AbtestingV3Client.custom_put",
271
+ :header_params => header_params,
272
+ :query_params => query_params,
273
+ :body => post_body,
274
+ :use_read_transporter => false
275
+ )
276
+
277
+ @api_client.call_api(:PUT, path, new_options)
278
+ end
279
+
280
+ # This method lets you send requests to the Algolia REST API.
281
+
282
+ # @param path [String] Path of the endpoint, for example `1/newFeature`. (required)
283
+ # @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
284
+ # @param body [Object] Parameters to send with the custom request.
285
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
286
+ # @return [Object]
287
+ def custom_put(path, parameters = nil, body = nil, request_options = {})
288
+ response = custom_put_with_http_info(path, parameters, body, request_options)
289
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
290
+ end
291
+
292
+ # Deletes an A/B test by its ID.
293
+ #
294
+ # Required API Key ACLs:
295
+ # - editSettings
296
+ # @param id [Integer] Unique A/B test identifier. (required)
297
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
298
+ # @return [Http::Response] the response
299
+ def delete_ab_test_with_http_info(id, request_options = {})
300
+ # verify the required parameter 'id' is set
301
+ if @api_client.config.client_side_validation && id.nil?
302
+ raise ArgumentError, "Parameter `id` is required when calling `delete_ab_test`."
303
+ end
304
+
305
+ path = "/3/abtests/{id}".sub("{" + "id" + "}", Transport.encode_uri(id.to_s))
306
+ query_params = {}
307
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
308
+ header_params = {}
309
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
310
+
311
+ post_body = request_options[:debug_body]
312
+
313
+ new_options = request_options.merge(
314
+ :operation => :"AbtestingV3Client.delete_ab_test",
315
+ :header_params => header_params,
316
+ :query_params => query_params,
317
+ :body => post_body,
318
+ :use_read_transporter => false
319
+ )
320
+
321
+ @api_client.call_api(:DELETE, path, new_options)
322
+ end
323
+
324
+ # Deletes an A/B test by its ID.
325
+ #
326
+ # Required API Key ACLs:
327
+ # - editSettings
328
+ # @param id [Integer] Unique A/B test identifier. (required)
329
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
330
+ # @return [ABTestResponse]
331
+ def delete_ab_test(id, request_options = {})
332
+ response = delete_ab_test_with_http_info(id, request_options)
333
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "AbtestingV3::ABTestResponse")
334
+ end
335
+
336
+ # 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.
337
+ #
338
+ # Required API Key ACLs:
339
+ # - analytics
340
+ # @param estimate_ab_test_request [EstimateABTestRequest] (required)
341
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
342
+ # @return [Http::Response] the response
343
+ def estimate_ab_test_with_http_info(estimate_ab_test_request, request_options = {})
344
+ # verify the required parameter 'estimate_ab_test_request' is set
345
+ if @api_client.config.client_side_validation && estimate_ab_test_request.nil?
346
+ raise ArgumentError, "Parameter `estimate_ab_test_request` is required when calling `estimate_ab_test`."
347
+ end
348
+
349
+ path = "/3/abtests/estimate"
350
+ query_params = {}
351
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
352
+ header_params = {}
353
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
354
+
355
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(estimate_ab_test_request)
356
+
357
+ new_options = request_options.merge(
358
+ :operation => :"AbtestingV3Client.estimate_ab_test",
359
+ :header_params => header_params,
360
+ :query_params => query_params,
361
+ :body => post_body,
362
+ :use_read_transporter => false
363
+ )
364
+
365
+ @api_client.call_api(:POST, path, new_options)
366
+ end
367
+
368
+ # 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.
369
+ #
370
+ # Required API Key ACLs:
371
+ # - analytics
372
+ # @param estimate_ab_test_request [EstimateABTestRequest] (required)
373
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
374
+ # @return [EstimateABTestResponse]
375
+ def estimate_ab_test(estimate_ab_test_request, request_options = {})
376
+ response = estimate_ab_test_with_http_info(estimate_ab_test_request, request_options)
377
+ @api_client.deserialize(
378
+ response.body,
379
+ request_options[:debug_return_type] || "AbtestingV3::EstimateABTestResponse"
380
+ )
381
+ end
382
+
383
+ # Retrieves the details for an A/B test by its ID.
384
+ #
385
+ # Required API Key ACLs:
386
+ # - analytics
387
+ # @param id [Integer] Unique A/B test identifier. (required)
388
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
389
+ # @return [Http::Response] the response
390
+ def get_ab_test_with_http_info(id, request_options = {})
391
+ # verify the required parameter 'id' is set
392
+ if @api_client.config.client_side_validation && id.nil?
393
+ raise ArgumentError, "Parameter `id` is required when calling `get_ab_test`."
394
+ end
395
+
396
+ path = "/3/abtests/{id}".sub("{" + "id" + "}", Transport.encode_uri(id.to_s))
397
+ query_params = {}
398
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
399
+ header_params = {}
400
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
401
+
402
+ post_body = request_options[:debug_body]
403
+
404
+ new_options = request_options.merge(
405
+ :operation => :"AbtestingV3Client.get_ab_test",
406
+ :header_params => header_params,
407
+ :query_params => query_params,
408
+ :body => post_body,
409
+ :use_read_transporter => false
410
+ )
411
+
412
+ @api_client.call_api(:GET, path, new_options)
413
+ end
414
+
415
+ # Retrieves the details for an A/B test by its ID.
416
+ #
417
+ # Required API Key ACLs:
418
+ # - analytics
419
+ # @param id [Integer] Unique A/B test identifier. (required)
420
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
421
+ # @return [ABTest]
422
+ def get_ab_test(id, request_options = {})
423
+ response = get_ab_test_with_http_info(id, request_options)
424
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "AbtestingV3::ABTest")
425
+ end
426
+
427
+ # Retrieves timeseries for an A/B test by its ID.
428
+ #
429
+ # Required API Key ACLs:
430
+ # - analytics
431
+ # @param id [Integer] Unique A/B test identifier. (required)
432
+ # @param start_date [String] Start date of the period to analyze, in `YYYY-MM-DD` format.
433
+ # @param end_date [String] End date of the period to analyze, in `YYYY-MM-DD` format.
434
+ # @param metric [Array<MetricName>] List of metrics to retrieve. If not specified, all metrics are returned.
435
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
436
+ # @return [Http::Response] the response
437
+ def get_timeseries_with_http_info(id, start_date = nil, end_date = nil, metric = nil, request_options = {})
438
+ # verify the required parameter 'id' is set
439
+ if @api_client.config.client_side_validation && id.nil?
440
+ raise ArgumentError, "Parameter `id` is required when calling `get_timeseries`."
441
+ end
442
+
443
+ path = "/3/abtests/{id}/timeseries".sub("{" + "id" + "}", Transport.encode_uri(id.to_s))
444
+ query_params = {}
445
+ query_params[:startDate] = start_date unless start_date.nil?
446
+ query_params[:endDate] = end_date unless end_date.nil?
447
+ query_params[:metric] = @api_client.build_collection_param(metric, :multi) unless metric.nil?
448
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
449
+ header_params = {}
450
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
451
+
452
+ post_body = request_options[:debug_body]
453
+
454
+ new_options = request_options.merge(
455
+ :operation => :"AbtestingV3Client.get_timeseries",
456
+ :header_params => header_params,
457
+ :query_params => query_params,
458
+ :body => post_body,
459
+ :use_read_transporter => false
460
+ )
461
+
462
+ @api_client.call_api(:GET, path, new_options)
463
+ end
464
+
465
+ # Retrieves timeseries for an A/B test by its ID.
466
+ #
467
+ # Required API Key ACLs:
468
+ # - analytics
469
+ # @param id [Integer] Unique A/B test identifier. (required)
470
+ # @param start_date [String] Start date of the period to analyze, in `YYYY-MM-DD` format.
471
+ # @param end_date [String] End date of the period to analyze, in `YYYY-MM-DD` format.
472
+ # @param metric [Array<MetricName>] List of metrics to retrieve. If not specified, all metrics are returned.
473
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
474
+ # @return [Timeseries]
475
+ def get_timeseries(id, start_date = nil, end_date = nil, metric = nil, request_options = {})
476
+ response = get_timeseries_with_http_info(id, start_date, end_date, metric, request_options)
477
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "AbtestingV3::Timeseries")
478
+ end
479
+
480
+ # Lists all A/B tests you configured for this application.
481
+ #
482
+ # Required API Key ACLs:
483
+ # - analytics
484
+ # @param offset [Integer] Position of the first item to return. (default to 0)
485
+ # @param limit [Integer] Number of items to return. (default to 10)
486
+ # @param index_prefix [String] Index name prefix. Only A/B tests for indices starting with this string are included in the response.
487
+ # @param index_suffix [String] Index name suffix. Only A/B tests for indices ending with this string are included in the response.
488
+ # @param direction [Direction] Sort order for A/B tests by start date. Use 'asc' for ascending or 'desc' for descending. Active A/B tests are always listed first.
489
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
490
+ # @return [Http::Response] the response
491
+ def list_ab_tests_with_http_info(
492
+ offset = nil,
493
+ limit = nil,
494
+ index_prefix = nil,
495
+ index_suffix = nil,
496
+ direction = nil,
497
+ request_options = {}
498
+ )
499
+ path = "/3/abtests"
500
+ query_params = {}
501
+ query_params[:offset] = offset unless offset.nil?
502
+ query_params[:limit] = limit unless limit.nil?
503
+ query_params[:indexPrefix] = index_prefix unless index_prefix.nil?
504
+ query_params[:indexSuffix] = index_suffix unless index_suffix.nil?
505
+ query_params[:direction] = direction unless direction.nil?
506
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
507
+ header_params = {}
508
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
509
+
510
+ post_body = request_options[:debug_body]
511
+
512
+ new_options = request_options.merge(
513
+ :operation => :"AbtestingV3Client.list_ab_tests",
514
+ :header_params => header_params,
515
+ :query_params => query_params,
516
+ :body => post_body,
517
+ :use_read_transporter => false
518
+ )
519
+
520
+ @api_client.call_api(:GET, path, new_options)
521
+ end
522
+
523
+ # Lists all A/B tests you configured for this application.
524
+ #
525
+ # Required API Key ACLs:
526
+ # - analytics
527
+ # @param offset [Integer] Position of the first item to return. (default to 0)
528
+ # @param limit [Integer] Number of items to return. (default to 10)
529
+ # @param index_prefix [String] Index name prefix. Only A/B tests for indices starting with this string are included in the response.
530
+ # @param index_suffix [String] Index name suffix. Only A/B tests for indices ending with this string are included in the response.
531
+ # @param direction [Direction] Sort order for A/B tests by start date. Use 'asc' for ascending or 'desc' for descending. Active A/B tests are always listed first.
532
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
533
+ # @return [ListABTestsResponse]
534
+ def list_ab_tests(
535
+ offset = nil,
536
+ limit = nil,
537
+ index_prefix = nil,
538
+ index_suffix = nil,
539
+ direction = nil,
540
+ request_options = {}
541
+ )
542
+ response = list_ab_tests_with_http_info(offset, limit, index_prefix, index_suffix, direction, request_options)
543
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "AbtestingV3::ListABTestsResponse")
544
+ end
545
+
546
+ # Schedule an A/B test to be started at a later time.
547
+ #
548
+ # Required API Key ACLs:
549
+ # - editSettings
550
+ # @param schedule_ab_tests_request [ScheduleABTestsRequest] (required)
551
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
552
+ # @return [Http::Response] the response
553
+ def schedule_ab_test_with_http_info(schedule_ab_tests_request, request_options = {})
554
+ # verify the required parameter 'schedule_ab_tests_request' is set
555
+ if @api_client.config.client_side_validation && schedule_ab_tests_request.nil?
556
+ raise ArgumentError, "Parameter `schedule_ab_tests_request` is required when calling `schedule_ab_test`."
557
+ end
558
+
559
+ path = "/3/abtests/schedule"
560
+ query_params = {}
561
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
562
+ header_params = {}
563
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
564
+
565
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(schedule_ab_tests_request)
566
+
567
+ new_options = request_options.merge(
568
+ :operation => :"AbtestingV3Client.schedule_ab_test",
569
+ :header_params => header_params,
570
+ :query_params => query_params,
571
+ :body => post_body,
572
+ :use_read_transporter => false
573
+ )
574
+
575
+ @api_client.call_api(:POST, path, new_options)
576
+ end
577
+
578
+ # Schedule an A/B test to be started at a later time.
579
+ #
580
+ # Required API Key ACLs:
581
+ # - editSettings
582
+ # @param schedule_ab_tests_request [ScheduleABTestsRequest] (required)
583
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
584
+ # @return [ScheduleABTestResponse]
585
+ def schedule_ab_test(schedule_ab_tests_request, request_options = {})
586
+ response = schedule_ab_test_with_http_info(schedule_ab_tests_request, request_options)
587
+ @api_client.deserialize(
588
+ response.body,
589
+ request_options[:debug_return_type] || "AbtestingV3::ScheduleABTestResponse"
590
+ )
591
+ end
592
+
593
+ # Stops an A/B test by its ID. You can't restart stopped A/B tests.
594
+ #
595
+ # Required API Key ACLs:
596
+ # - editSettings
597
+ # @param id [Integer] Unique A/B test identifier. (required)
598
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
599
+ # @return [Http::Response] the response
600
+ def stop_ab_test_with_http_info(id, request_options = {})
601
+ # verify the required parameter 'id' is set
602
+ if @api_client.config.client_side_validation && id.nil?
603
+ raise ArgumentError, "Parameter `id` is required when calling `stop_ab_test`."
604
+ end
605
+
606
+ path = "/3/abtests/{id}/stop".sub("{" + "id" + "}", Transport.encode_uri(id.to_s))
607
+ query_params = {}
608
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
609
+ header_params = {}
610
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
611
+
612
+ post_body = request_options[:debug_body]
613
+
614
+ new_options = request_options.merge(
615
+ :operation => :"AbtestingV3Client.stop_ab_test",
616
+ :header_params => header_params,
617
+ :query_params => query_params,
618
+ :body => post_body,
619
+ :use_read_transporter => false
620
+ )
621
+
622
+ @api_client.call_api(:POST, path, new_options)
623
+ end
624
+
625
+ # Stops an A/B test by its ID. You can't restart stopped A/B tests.
626
+ #
627
+ # Required API Key ACLs:
628
+ # - editSettings
629
+ # @param id [Integer] Unique A/B test identifier. (required)
630
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
631
+ # @return [ABTestResponse]
632
+ def stop_ab_test(id, request_options = {})
633
+ response = stop_ab_test_with_http_info(id, request_options)
634
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "AbtestingV3::ABTestResponse")
635
+ end
636
+
637
+ end
638
+ end