Skip to content

Commit

Permalink
Merge branch 'main' into chore/ci-docker
Browse files Browse the repository at this point in the history
  • Loading branch information
millotp committed Jan 12, 2024
2 parents f675901 + 124265f commit 7776d48
Show file tree
Hide file tree
Showing 353 changed files with 449 additions and 2,021 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

typealias Client = AbtestingClient

@objcMembers open class AbtestingClient: NSObject {
open class AbtestingClient {

private var configuration: Configuration
private var transporter: Transporter
Expand Down Expand Up @@ -295,33 +295,33 @@ typealias Client = AbtestingClient
/**
Delete an A/B test.

- parameter _id: (path) Unique A/B test ID.
- parameter id: (path) Unique A/B test ID.
- returns: ABTestResponse
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open func deleteABTest(_id: Int, requestOptions: RequestOptions? = nil) async throws
open func deleteABTest(id: Int, requestOptions: RequestOptions? = nil) async throws
-> ABTestResponse
{
return try await deleteABTestWithRequestBuilder(_id: _id, requestOptions: requestOptions)
return try await deleteABTestWithRequestBuilder(id: id, requestOptions: requestOptions)
.execute().body
}

/**
Delete an A/B test.

Delete an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
- parameter _id: (path) Unique A/B test ID.
- parameter id: (path) Unique A/B test ID.
- returns: RequestBuilder<ABTestResponse>
*/
open func deleteABTestWithRequestBuilder(_id: Int, requestOptions: RequestOptions? = nil)
open func deleteABTestWithRequestBuilder(id: Int, requestOptions: RequestOptions? = nil)
-> RequestBuilder<ABTestResponse>
{
var localVariablePath = "/2/abtests/{id}"
let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))"
let _idPostEscape =
_idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
let idPostEscape =
idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(
of: "{id}", with: _idPostEscape, options: .literal, range: nil)
of: "{id}", with: idPostEscape, options: .literal, range: nil)
let localVariableParameters: [String: Any?]? = nil

let localVariableQueryItems: [URLQueryItem]? = nil
Expand All @@ -342,31 +342,31 @@ typealias Client = AbtestingClient
/**
Get A/B test details.

- parameter _id: (path) Unique A/B test ID.
- parameter id: (path) Unique A/B test ID.
- returns: ABTest
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open func getABTest(_id: Int, requestOptions: RequestOptions? = nil) async throws -> ABTest {
return try await getABTestWithRequestBuilder(_id: _id, requestOptions: requestOptions).execute()
open func getABTest(id: Int, requestOptions: RequestOptions? = nil) async throws -> ABTest {
return try await getABTestWithRequestBuilder(id: id, requestOptions: requestOptions).execute()
.body
}

/**
Get A/B test details.

Get specific details for an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
- parameter _id: (path) Unique A/B test ID.
- parameter id: (path) Unique A/B test ID.
- returns: RequestBuilder<ABTest>
*/
open func getABTestWithRequestBuilder(_id: Int, requestOptions: RequestOptions? = nil)
open func getABTestWithRequestBuilder(id: Int, requestOptions: RequestOptions? = nil)
-> RequestBuilder<ABTest>
{
var localVariablePath = "/2/abtests/{id}"
let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))"
let _idPostEscape =
_idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
let idPostEscape =
idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(
of: "{id}", with: _idPostEscape, options: .literal, range: nil)
of: "{id}", with: idPostEscape, options: .literal, range: nil)
let localVariableParameters: [String: Any?]? = nil

let localVariableQueryItems: [URLQueryItem]? = nil
Expand Down Expand Up @@ -444,33 +444,33 @@ typealias Client = AbtestingClient
/**
Stop an A/B test.

- parameter _id: (path) Unique A/B test ID.
- parameter id: (path) Unique A/B test ID.
- returns: ABTestResponse
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open func stopABTest(_id: Int, requestOptions: RequestOptions? = nil) async throws
open func stopABTest(id: Int, requestOptions: RequestOptions? = nil) async throws
-> ABTestResponse
{
return try await stopABTestWithRequestBuilder(_id: _id, requestOptions: requestOptions)
.execute().body
return try await stopABTestWithRequestBuilder(id: id, requestOptions: requestOptions).execute()
.body
}

/**
Stop an A/B test.

If stopped, the test is over and can't be restarted. There is now only one index, receiving 100% of all search requests. The data gathered for stopped A/B tests is retained. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
- parameter _id: (path) Unique A/B test ID.
- parameter id: (path) Unique A/B test ID.
- returns: RequestBuilder<ABTestResponse>
*/
open func stopABTestWithRequestBuilder(_id: Int, requestOptions: RequestOptions? = nil)
open func stopABTestWithRequestBuilder(id: Int, requestOptions: RequestOptions? = nil)
-> RequestBuilder<ABTestResponse>
{
var localVariablePath = "/2/abtests/{id}/stop"
let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))"
let _idPostEscape =
_idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
let idPostEscape =
idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(
of: "{id}", with: _idPostEscape, options: .literal, range: nil)
of: "{id}", with: idPostEscape, options: .literal, range: nil)
let localVariableParameters: [String: Any?]? = nil

let localVariableQueryItems: [URLQueryItem]? = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation
import AnyCodable
#endif

@objcMembers public class ABTest: NSObject, Codable, JSONEncodable {
public struct ABTest: Codable, JSONEncodable, Hashable {

/** Unique A/B test ID. */
public var abTestID: Int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation
import AnyCodable
#endif

@objcMembers public class ABTestResponse: NSObject, Codable, JSONEncodable {
public struct ABTestResponse: Codable, JSONEncodable, Hashable {

/** A/B test index. */
public var index: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ import Foundation
import AnyCodable
#endif

@objcMembers public class AbTestsVariant: NSObject, Codable, JSONEncodable {
public struct AbTestsVariant: Codable, JSONEncodable, Hashable {

/** A/B test index. */
public var index: String
/** A/B test traffic percentage. */
public var trafficPercentage: Int
/** A/B test description. */
public var _description: String?
public var description: String?

public init(index: String, trafficPercentage: Int, _description: String? = nil) {
public init(index: String, trafficPercentage: Int, description: String? = nil) {
self.index = index
self.trafficPercentage = trafficPercentage
self._description = _description
self.description = description
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case index
case trafficPercentage
case _description = "description"
case description
}

// Encodable protocol methods
Expand All @@ -34,6 +34,6 @@ import Foundation
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(index, forKey: .index)
try container.encode(trafficPercentage, forKey: .trafficPercentage)
try container.encodeIfPresent(_description, forKey: ._description)
try container.encodeIfPresent(description, forKey: .description)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@ import Foundation
import AnyCodable
#endif

@objcMembers public class AbTestsVariantSearchParams: NSObject, Codable, JSONEncodable {
public struct AbTestsVariantSearchParams: Codable, JSONEncodable, Hashable {

/** A/B test index. */
public var index: String
/** A/B test traffic percentage. */
public var trafficPercentage: Int
/** A/B test description. */
public var _description: String?
public var description: String?
public var customSearchParameters: AnyCodable

public init(
index: String, trafficPercentage: Int, _description: String? = nil,
index: String, trafficPercentage: Int, description: String? = nil,
customSearchParameters: AnyCodable
) {
self.index = index
self.trafficPercentage = trafficPercentage
self._description = _description
self.description = description
self.customSearchParameters = customSearchParameters
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case index
case trafficPercentage
case _description = "description"
case description
case customSearchParameters
}

Expand All @@ -40,7 +40,7 @@ import Foundation
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(index, forKey: .index)
try container.encode(trafficPercentage, forKey: .trafficPercentage)
try container.encodeIfPresent(_description, forKey: ._description)
try container.encodeIfPresent(description, forKey: .description)
try container.encode(customSearchParameters, forKey: .customSearchParameters)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation
import AnyCodable
#endif

@objcMembers public class AddABTestsRequest: NSObject, Codable, JSONEncodable {
public struct AddABTestsRequest: Codable, JSONEncodable, Hashable {

/** A/B test name. */
public var name: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,16 @@ import Foundation
import AnyCodable
#endif

@objcMembers public class CurrenciesValue: NSObject, Codable, JSONEncodable {
public struct CurrenciesValue: Codable, JSONEncodable, Hashable {

/** Currency code. */
public var currency: String?
/** Revenue for this currency. */
public var revenue: Double?
public var revenueNum: NSNumber? {
return revenue as NSNumber?
}
/** Mean for this currency. */
public var mean: Double?
public var meanNum: NSNumber? {
return mean as NSNumber?
}
/** Standard deviation for this currency. */
public var standardDeviation: Double?
public var standardDeviationNum: NSNumber? {
return standardDeviation as NSNumber?
}

public init(
currency: String? = nil, revenue: Double? = nil, mean: Double? = nil,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Foundation
#endif

/// Applies search parameters from [a restricted set of options](https://www.algolia.com/doc/api-reference/api-methods/add-ab-test/#method-param-customsearchparameters). Only use this parameter if the two variants use the same index.
@objcMembers public class CustomSearchParams: NSObject, Codable, JSONEncodable {
public struct CustomSearchParams: Codable, JSONEncodable, Hashable {

public var customSearchParameters: AnyCodable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Foundation
#endif

/// Error.
@objcMembers public class ErrorBase: NSObject, Codable, JSONEncodable {
public struct ErrorBase: Codable, JSONEncodable, Hashable {

public var message: String?

Expand Down Expand Up @@ -46,7 +46,7 @@ import Foundation

// Decodable protocol methods

public required init(from decoder: Decoder) throws {
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)

message = try container.decodeIfPresent(String.self, forKey: .message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Foundation
#endif

/// A/B test filter effects resulting from configuration settings.
@objcMembers public class FilterEffects: NSObject, Codable, JSONEncodable {
public struct FilterEffects: Codable, JSONEncodable, Hashable {

public var outliers: FilterEffectsOutliers?
public var emptySearch: FilterEffectsEmptySearch?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@ import Foundation
#endif

/// Empty searches removed from the A/B test as a result of configuration settings.
@objcMembers public class FilterEffectsEmptySearch: NSObject, Codable, JSONEncodable {
public struct FilterEffectsEmptySearch: Codable, JSONEncodable, Hashable {

/** Number of users removed from the A/B test. */
public var usersCount: Int?
public var usersCountNum: NSNumber? {
return usersCount as NSNumber?
}
/** Number of tracked searches removed from the A/B test. */
public var trackedSearchesCount: Int?
public var trackedSearchesCountNum: NSNumber? {
return trackedSearchesCount as NSNumber?
}

public init(usersCount: Int? = nil, trackedSearchesCount: Int? = nil) {
self.usersCount = usersCount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@ import Foundation
#endif

/// Outliers removed from the A/B test as a result of configuration settings.
@objcMembers public class FilterEffectsOutliers: NSObject, Codable, JSONEncodable {
public struct FilterEffectsOutliers: Codable, JSONEncodable, Hashable {

/** Number of users removed from the A/B test. */
public var usersCount: Int?
public var usersCountNum: NSNumber? {
return usersCount as NSNumber?
}
/** Number of tracked searches removed from the A/B test. */
public var trackedSearchesCount: Int?
public var trackedSearchesCountNum: NSNumber? {
return trackedSearchesCount as NSNumber?
}

public init(usersCount: Int? = nil, trackedSearchesCount: Int? = nil) {
self.usersCount = usersCount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation
import AnyCodable
#endif

@objcMembers public class ListABTestsResponse: NSObject, Codable, JSONEncodable {
public struct ListABTestsResponse: Codable, JSONEncodable, Hashable {

/** A/B tests. */
public var abtests: [ABTest]
Expand Down
Loading

0 comments on commit 7776d48

Please sign in to comment.