Skip to content

Commit 2905d3e

Browse files
algolia-botkai687shortcutsFluf22
committed
chore: generated code for commit 60322c0b. [skip ci]
algolia/api-clients-automation@60322c0 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Kai Welke <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]> Co-authored-by: Thomas Raffray <[email protected]>
1 parent 8c1667c commit 2905d3e

18 files changed

+287
-72
lines changed

Sources/Abtesting/AbtestingClient.swift

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ open class AbtestingClient {
4646
return body
4747
}
4848

49-
// Creates an A/B test.
49+
// Creates a new A/B test.
5050
// Required API Key ACLs:
5151
// - editSettings
5252
//
@@ -333,7 +333,7 @@ open class AbtestingClient {
333333
)
334334
}
335335

336-
/// - parameter id: (path) Unique A/B test ID.
336+
/// - parameter id: (path) Unique A/B test identifier.
337337
/// - returns: ABTestResponse
338338
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
339339
open func deleteABTest(id: Int, requestOptions: RequestOptions? = nil) async throws -> ABTestResponse {
@@ -349,12 +349,11 @@ open class AbtestingClient {
349349
return body
350350
}
351351

352-
// Delete an A/B test. To determine the `id` for an A/B test, use the [`listABTests`
353-
// operation](#tag/abtest/operation/listABTests).
352+
// Deletes an A/B test by its ID.
354353
// Required API Key ACLs:
355354
// - editSettings
356355
//
357-
// - parameter id: (path) Unique A/B test ID.
356+
// - parameter id: (path) Unique A/B test identifier.
358357
// - returns: RequestBuilder<ABTestResponse>
359358

360359
open func deleteABTestWithHTTPInfo(
@@ -380,7 +379,7 @@ open class AbtestingClient {
380379
)
381380
}
382381

383-
/// - parameter id: (path) Unique A/B test ID.
382+
/// - parameter id: (path) Unique A/B test identifier.
384383
/// - returns: ABTest
385384
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
386385
open func getABTest(id: Int, requestOptions: RequestOptions? = nil) async throws -> ABTest {
@@ -393,12 +392,11 @@ open class AbtestingClient {
393392
return body
394393
}
395394

396-
// Get specific details for an A/B test. To determine the `id` for an A/B test, use the [`listABTests`
397-
// operation](#tag/abtest/operation/listABTests).
395+
// Retrieves the details for an A/B test by its ID.
398396
// Required API Key ACLs:
399397
// - analytics
400398
//
401-
// - parameter id: (path) Unique A/B test ID.
399+
// - parameter id: (path) Unique A/B test identifier.
402400
// - returns: RequestBuilder<ABTest>
403401

404402
open func getABTestWithHTTPInfo(
@@ -426,8 +424,10 @@ open class AbtestingClient {
426424

427425
/// - parameter offset: (query) Position of the first item to return. (optional, default to 0)
428426
/// - parameter limit: (query) Number of items to return. (optional, default to 10)
429-
/// - parameter indexPrefix: (query) Only return A/B tests for indices starting with this prefix. (optional)
430-
/// - parameter indexSuffix: (query) Only return A/B tests for indices ending with this suffix. (optional)
427+
/// - parameter indexPrefix: (query) Index name prefix. Only A/B tests for indices starting with this string are
428+
/// included in the response. (optional)
429+
/// - parameter indexSuffix: (query) Index name suffix. Only A/B tests for indices ending with this string are
430+
/// included in the response. (optional)
431431
/// - returns: ListABTestsResponse
432432
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
433433
open func listABTests(
@@ -452,17 +452,19 @@ open class AbtestingClient {
452452
return body
453453
}
454454

455-
// List all A/B tests.
455+
// Lists all A/B tests you configured for this application.
456456
// Required API Key ACLs:
457457
// - analytics
458458
//
459459
// - parameter offset: (query) Position of the first item to return. (optional, default to 0)
460460
//
461461
// - parameter limit: (query) Number of items to return. (optional, default to 10)
462462
//
463-
// - parameter indexPrefix: (query) Only return A/B tests for indices starting with this prefix. (optional)
463+
// - parameter indexPrefix: (query) Index name prefix. Only A/B tests for indices starting with this string are
464+
// included in the response. (optional)
464465
//
465-
// - parameter indexSuffix: (query) Only return A/B tests for indices ending with this suffix. (optional)
466+
// - parameter indexSuffix: (query) Index name suffix. Only A/B tests for indices ending with this string are
467+
// included in the response. (optional)
466468
// - returns: RequestBuilder<ListABTestsResponse>
467469

468470
open func listABTestsWithHTTPInfo(
@@ -493,7 +495,7 @@ open class AbtestingClient {
493495
)
494496
}
495497

496-
/// - parameter id: (path) Unique A/B test ID.
498+
/// - parameter id: (path) Unique A/B test identifier.
497499
/// - returns: ABTestResponse
498500
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
499501
open func stopABTest(id: Int, requestOptions: RequestOptions? = nil) async throws -> ABTestResponse {
@@ -509,13 +511,11 @@ open class AbtestingClient {
509511
return body
510512
}
511513

512-
// If stopped, the test is over and can't be restarted. There is now only one index, receiving 100% of all search
513-
// requests. The data gathered for stopped A/B tests is retained. To determine the `id` for an A/B test, use the
514-
// [`listABTests` operation](#tag/abtest/operation/listABTests).
514+
// Stops an A/B test by its ID. You can't restart stopped A/B tests.
515515
// Required API Key ACLs:
516516
// - editSettings
517517
//
518-
// - parameter id: (path) Unique A/B test ID.
518+
// - parameter id: (path) Unique A/B test identifier.
519519
// - returns: RequestBuilder<ABTestResponse>
520520

521521
open func stopABTestWithHTTPInfo(

Sources/Abtesting/Models/ABTest.swift

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,26 @@ import Foundation
77
#endif
88

99
public struct ABTest: Codable, JSONEncodable {
10-
/// Unique A/B test ID.
10+
/// Unique A/B test identifier.
1111
public var abTestID: Int
12-
/// [A/B test significance](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/in-depth/how-ab-test-scores-are-calculated/#statistical-significance-or-chance)
13-
/// based on click data. A value of 0.95 or over is considered to be _significant_.
1412
public var clickSignificance: Double?
15-
/// [A/B test significance](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/in-depth/how-ab-test-scores-are-calculated/#statistical-significance-or-chance)
16-
/// based on conversion. A value of 0.95 or over is considered to be _significant_.
1713
public var conversionSignificance: Double?
18-
/// [A/B test significance](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/in-depth/how-ab-test-scores-are-calculated/#statistical-significance-or-chance)
19-
/// based on add-to-cart data. A value of 0.95 or over is considered to be _significant_.
2014
public var addToCartSignificance: Double?
21-
/// [A/B test significance](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/in-depth/how-ab-test-scores-are-calculated/#statistical-significance-or-chance)
22-
/// based on purchase data. A value of 0.95 or over is considered to be _significant_.
2315
public var purchaseSignificance: Double?
24-
/// [A/B test significance](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/in-depth/how-ab-test-scores-are-calculated/#statistical-significance-or-chance)
25-
/// based on revenue data. A value of 0.95 or over is considered to be _significant_.
2616
public var revenueSignificance: [String: Double]?
27-
/// Update date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
17+
/// Date and time when the A/B test was last updated, in RFC 3339 format.
2818
public var updatedAt: String
29-
/// Creation date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
19+
/// Date and time when the A/B test was created, in RFC 3339 format.
3020
public var createdAt: String
31-
/// End date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
21+
/// End date and time of the A/B test, in RFC 3339 format.
3222
public var endAt: String
3323
/// A/B test name.
3424
public var name: String
35-
/// A/B test status.
36-
public var status: String
37-
/// A/B test variants.
25+
public var status: AbtestingStatus
26+
/// A/B test variants. The first variant is your _control_ index, typically your production index. The second
27+
/// variant is an index with changed settings that you want to test against the control.
3828
public var variants: [Variant]
29+
public var configuration: ABTestConfiguration?
3930

4031
public init(
4132
abTestID: Int,
@@ -48,8 +39,9 @@ public struct ABTest: Codable, JSONEncodable {
4839
createdAt: String,
4940
endAt: String,
5041
name: String,
51-
status: String,
52-
variants: [Variant]
42+
status: AbtestingStatus,
43+
variants: [Variant],
44+
configuration: ABTestConfiguration? = nil
5345
) {
5446
self.abTestID = abTestID
5547
self.clickSignificance = clickSignificance
@@ -63,6 +55,7 @@ public struct ABTest: Codable, JSONEncodable {
6355
self.name = name
6456
self.status = status
6557
self.variants = variants
58+
self.configuration = configuration
6659
}
6760

6861
public enum CodingKeys: String, CodingKey, CaseIterable {
@@ -78,6 +71,7 @@ public struct ABTest: Codable, JSONEncodable {
7871
case name
7972
case status
8073
case variants
74+
case configuration
8175
}
8276

8377
// Encodable protocol methods
@@ -96,6 +90,7 @@ public struct ABTest: Codable, JSONEncodable {
9690
try container.encode(self.name, forKey: .name)
9791
try container.encode(self.status, forKey: .status)
9892
try container.encode(self.variants, forKey: .variants)
93+
try container.encodeIfPresent(self.configuration, forKey: .configuration)
9994
}
10095
}
10196

@@ -112,7 +107,8 @@ extension ABTest: Equatable {
112107
lhs.endAt == rhs.endAt &&
113108
lhs.name == rhs.name &&
114109
lhs.status == rhs.status &&
115-
lhs.variants == rhs.variants
110+
lhs.variants == rhs.variants &&
111+
lhs.configuration == rhs.configuration
116112
}
117113
}
118114

@@ -130,5 +126,6 @@ extension ABTest: Hashable {
130126
hasher.combine(self.name.hashValue)
131127
hasher.combine(self.status.hashValue)
132128
hasher.combine(self.variants.hashValue)
129+
hasher.combine(self.configuration?.hashValue)
133130
}
134131
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on
2+
// https://github.com/algolia/api-clients-automation. DO NOT EDIT.
3+
4+
import Foundation
5+
#if canImport(Core)
6+
import Core
7+
#endif
8+
9+
/// A/B test configuration.
10+
public struct ABTestConfiguration: Codable, JSONEncodable {
11+
public var outliers: Outliers
12+
public var emptySearch: EmptySearch?
13+
public var minimumDetectableEffect: MinimumDetectableEffect?
14+
15+
public init(
16+
outliers: Outliers,
17+
emptySearch: EmptySearch? = nil,
18+
minimumDetectableEffect: MinimumDetectableEffect? = nil
19+
) {
20+
self.outliers = outliers
21+
self.emptySearch = emptySearch
22+
self.minimumDetectableEffect = minimumDetectableEffect
23+
}
24+
25+
public enum CodingKeys: String, CodingKey, CaseIterable {
26+
case outliers
27+
case emptySearch
28+
case minimumDetectableEffect
29+
}
30+
31+
// Encodable protocol methods
32+
33+
public func encode(to encoder: Encoder) throws {
34+
var container = encoder.container(keyedBy: CodingKeys.self)
35+
try container.encode(self.outliers, forKey: .outliers)
36+
try container.encodeIfPresent(self.emptySearch, forKey: .emptySearch)
37+
try container.encodeIfPresent(self.minimumDetectableEffect, forKey: .minimumDetectableEffect)
38+
}
39+
}
40+
41+
extension ABTestConfiguration: Equatable {
42+
public static func ==(lhs: ABTestConfiguration, rhs: ABTestConfiguration) -> Bool {
43+
lhs.outliers == rhs.outliers &&
44+
lhs.emptySearch == rhs.emptySearch &&
45+
lhs.minimumDetectableEffect == rhs.minimumDetectableEffect
46+
}
47+
}
48+
49+
extension ABTestConfiguration: Hashable {
50+
public func hash(into hasher: inout Hasher) {
51+
hasher.combine(self.outliers.hashValue)
52+
hasher.combine(self.emptySearch?.hashValue)
53+
hasher.combine(self.minimumDetectableEffect?.hashValue)
54+
}
55+
}

Sources/Abtesting/Models/ABTestResponse.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Foundation
99
public struct ABTestResponse: Codable, JSONEncodable {
1010
/// A/B test index.
1111
public var index: String
12-
/// Unique A/B test ID.
12+
/// Unique A/B test identifier.
1313
public var abTestID: Int
1414
/// Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run
1515
/// immediately. You can check the task's progress with the [`task` operation](#tag/Indices/operation/getTask) and

Sources/Abtesting/Models/AbTestsVariant.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import Foundation
99
public struct AbTestsVariant: Codable, JSONEncodable {
1010
/// A/B test index.
1111
public var index: String
12-
/// A/B test traffic percentage.
12+
/// Percentage of search requests each variant receives.
1313
public var trafficPercentage: Int
14-
/// A/B test description.
14+
/// Description for this variant.
1515
public var description: String?
1616

1717
public init(index: String, trafficPercentage: Int, description: String? = nil) {

Sources/Abtesting/Models/AbTestsVariantSearchParams.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import Foundation
99
public struct AbTestsVariantSearchParams: Codable, JSONEncodable {
1010
/// A/B test index.
1111
public var index: String
12-
/// A/B test traffic percentage.
12+
/// Percentage of search requests each variant receives.
1313
public var trafficPercentage: Int
14-
/// A/B test description.
14+
/// Description for this variant.
1515
public var description: String?
1616
public var customSearchParameters: AnyCodable
1717

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on
2+
// https://github.com/algolia/api-clients-automation. DO NOT EDIT.
3+
4+
import Foundation
5+
#if canImport(Core)
6+
import Core
7+
#endif
8+
9+
/// A/B test status. - &#x60;active&#x60;. The A/B test is live and search traffic is split between the two variants. -
10+
/// &#x60;stopped&#x60;. You stopped the A/B test. The A/B test data is still available for analysis. -
11+
/// &#x60;expired&#x60;. The A/B test was automatically stopped after reaching its end date. - &#x60;failed&#x60;.
12+
/// Creating the A/B test failed.
13+
public enum AbtestingStatus: String, Codable, CaseIterable {
14+
case active
15+
case stopped
16+
case expired
17+
case failed
18+
}
19+
20+
extension AbtestingStatus: Hashable {}

Sources/Abtesting/Models/AddABTestsRequest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public struct AddABTestsRequest: Codable, JSONEncodable {
1111
public var name: String
1212
/// A/B test variants.
1313
public var variants: [AddABTestsVariant]
14-
/// End date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
14+
/// End date and time of the A/B test, in RFC 3339 format.
1515
public var endAt: String
1616

1717
public init(name: String, variants: [AddABTestsVariant], endAt: String) {

Sources/Abtesting/Models/CustomSearchParams.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import Foundation
66
import Core
77
#endif
88

9-
/// Applies search parameters from [a restricted set of
10-
/// options](https://www.algolia.com/doc/api-reference/api-methods/add-ab-test/#method-param-customsearchparameters).
11-
/// Only use this parameter if the two variants use the same index.
9+
/// Search parameters to add to the test variant. Only use this parameter if the two variants use the same index.
1210
public struct CustomSearchParams: Codable, JSONEncodable {
1311
public var customSearchParameters: AnyCodable
1412

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on
2+
// https://github.com/algolia/api-clients-automation. DO NOT EDIT.
3+
4+
import Foundation
5+
#if canImport(Core)
6+
import Core
7+
#endif
8+
9+
/// Metric for which you want to detect the smallest relative difference.
10+
public enum Effect: String, Codable, CaseIterable {
11+
case addToCartRate
12+
case clickThroughRate
13+
case conversionRate
14+
case purchaseRate
15+
}
16+
17+
extension Effect: Hashable {}

0 commit comments

Comments
 (0)