Skip to content

Commit 34faa1d

Browse files
algolia-botmillotp
andcommitted
chore: generated code for commit c67ca468. [skip ci]
algolia/api-clients-automation@c67ca46 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent 2f2fbc0 commit 34faa1d

File tree

352 files changed

+449
-2015
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

352 files changed

+449
-2015
lines changed

Sources/Abtesting/AbtestingClient.swift

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Foundation
99

1010
typealias Client = AbtestingClient
1111

12-
@objcMembers open class AbtestingClient: NSObject {
12+
open class AbtestingClient {
1313

1414
private var configuration: Configuration
1515
private var transporter: Transporter
@@ -295,33 +295,33 @@ typealias Client = AbtestingClient
295295
/**
296296
Delete an A/B test.
297297

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

309309
/**
310310
Delete an A/B test.
311311

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

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

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

354354
/**
355355
Get A/B test details.
356356

357357
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).
358-
- parameter _id: (path) Unique A/B test ID.
358+
- parameter id: (path) Unique A/B test ID.
359359
- returns: RequestBuilder<ABTest>
360360
*/
361-
open func getABTestWithRequestBuilder(_id: Int, requestOptions: RequestOptions? = nil)
361+
open func getABTestWithRequestBuilder(id: Int, requestOptions: RequestOptions? = nil)
362362
-> RequestBuilder<ABTest>
363363
{
364364
var localVariablePath = "/2/abtests/{id}"
365-
let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))"
366-
let _idPostEscape =
367-
_idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
365+
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
366+
let idPostEscape =
367+
idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
368368
localVariablePath = localVariablePath.replacingOccurrences(
369-
of: "{id}", with: _idPostEscape, options: .literal, range: nil)
369+
of: "{id}", with: idPostEscape, options: .literal, range: nil)
370370
let localVariableParameters: [String: Any?]? = nil
371371

372372
let localVariableQueryItems: [URLQueryItem]? = nil
@@ -444,33 +444,33 @@ typealias Client = AbtestingClient
444444
/**
445445
Stop an A/B test.
446446

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

458458
/**
459459
Stop an A/B test.
460460

461461
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).
462-
- parameter _id: (path) Unique A/B test ID.
462+
- parameter id: (path) Unique A/B test ID.
463463
- returns: RequestBuilder<ABTestResponse>
464464
*/
465-
open func stopABTestWithRequestBuilder(_id: Int, requestOptions: RequestOptions? = nil)
465+
open func stopABTestWithRequestBuilder(id: Int, requestOptions: RequestOptions? = nil)
466466
-> RequestBuilder<ABTestResponse>
467467
{
468468
var localVariablePath = "/2/abtests/{id}/stop"
469-
let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))"
470-
let _idPostEscape =
471-
_idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
469+
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
470+
let idPostEscape =
471+
idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
472472
localVariablePath = localVariablePath.replacingOccurrences(
473-
of: "{id}", with: _idPostEscape, options: .literal, range: nil)
473+
of: "{id}", with: idPostEscape, options: .literal, range: nil)
474474
let localVariableParameters: [String: Any?]? = nil
475475

476476
let localVariableQueryItems: [URLQueryItem]? = nil

Sources/Abtesting/Models/ABTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Foundation
77
import AnyCodable
88
#endif
99

10-
@objcMembers public class ABTest: NSObject, Codable, JSONEncodable {
10+
public struct ABTest: Codable, JSONEncodable, Hashable {
1111

1212
/** Unique A/B test ID. */
1313
public var abTestID: Int

Sources/Abtesting/Models/ABTestResponse.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Foundation
77
import AnyCodable
88
#endif
99

10-
@objcMembers public class ABTestResponse: NSObject, Codable, JSONEncodable {
10+
public struct ABTestResponse: Codable, JSONEncodable, Hashable {
1111

1212
/** A/B test index. */
1313
public var index: String

Sources/Abtesting/Models/AbTestsVariant.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@ import Foundation
77
import AnyCodable
88
#endif
99

10-
@objcMembers public class AbTestsVariant: NSObject, Codable, JSONEncodable {
10+
public struct AbTestsVariant: Codable, JSONEncodable, Hashable {
1111

1212
/** A/B test index. */
1313
public var index: String
1414
/** A/B test traffic percentage. */
1515
public var trafficPercentage: Int
1616
/** A/B test description. */
17-
public var _description: String?
17+
public var description: String?
1818

19-
public init(index: String, trafficPercentage: Int, _description: String? = nil) {
19+
public init(index: String, trafficPercentage: Int, description: String? = nil) {
2020
self.index = index
2121
self.trafficPercentage = trafficPercentage
22-
self._description = _description
22+
self.description = description
2323
}
2424

2525
public enum CodingKeys: String, CodingKey, CaseIterable {
2626
case index
2727
case trafficPercentage
28-
case _description = "description"
28+
case description
2929
}
3030

3131
// Encodable protocol methods
@@ -34,6 +34,6 @@ import Foundation
3434
var container = encoder.container(keyedBy: CodingKeys.self)
3535
try container.encode(index, forKey: .index)
3636
try container.encode(trafficPercentage, forKey: .trafficPercentage)
37-
try container.encodeIfPresent(_description, forKey: ._description)
37+
try container.encodeIfPresent(description, forKey: .description)
3838
}
3939
}

Sources/Abtesting/Models/AbTestsVariantSearchParams.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,30 @@ import Foundation
77
import AnyCodable
88
#endif
99

10-
@objcMembers public class AbTestsVariantSearchParams: NSObject, Codable, JSONEncodable {
10+
public struct AbTestsVariantSearchParams: Codable, JSONEncodable, Hashable {
1111

1212
/** A/B test index. */
1313
public var index: String
1414
/** A/B test traffic percentage. */
1515
public var trafficPercentage: Int
1616
/** A/B test description. */
17-
public var _description: String?
17+
public var description: String?
1818
public var customSearchParameters: AnyCodable
1919

2020
public init(
21-
index: String, trafficPercentage: Int, _description: String? = nil,
21+
index: String, trafficPercentage: Int, description: String? = nil,
2222
customSearchParameters: AnyCodable
2323
) {
2424
self.index = index
2525
self.trafficPercentage = trafficPercentage
26-
self._description = _description
26+
self.description = description
2727
self.customSearchParameters = customSearchParameters
2828
}
2929

3030
public enum CodingKeys: String, CodingKey, CaseIterable {
3131
case index
3232
case trafficPercentage
33-
case _description = "description"
33+
case description
3434
case customSearchParameters
3535
}
3636

@@ -40,7 +40,7 @@ import Foundation
4040
var container = encoder.container(keyedBy: CodingKeys.self)
4141
try container.encode(index, forKey: .index)
4242
try container.encode(trafficPercentage, forKey: .trafficPercentage)
43-
try container.encodeIfPresent(_description, forKey: ._description)
43+
try container.encodeIfPresent(description, forKey: .description)
4444
try container.encode(customSearchParameters, forKey: .customSearchParameters)
4545
}
4646
}

Sources/Abtesting/Models/AddABTestsRequest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Foundation
77
import AnyCodable
88
#endif
99

10-
@objcMembers public class AddABTestsRequest: NSObject, Codable, JSONEncodable {
10+
public struct AddABTestsRequest: Codable, JSONEncodable, Hashable {
1111

1212
/** A/B test name. */
1313
public var name: String

Sources/Abtesting/Models/CurrenciesValue.swift

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,16 @@ import Foundation
77
import AnyCodable
88
#endif
99

10-
@objcMembers public class CurrenciesValue: NSObject, Codable, JSONEncodable {
10+
public struct CurrenciesValue: Codable, JSONEncodable, Hashable {
1111

1212
/** Currency code. */
1313
public var currency: String?
1414
/** Revenue for this currency. */
1515
public var revenue: Double?
16-
public var revenueNum: NSNumber? {
17-
return revenue as NSNumber?
18-
}
1916
/** Mean for this currency. */
2017
public var mean: Double?
21-
public var meanNum: NSNumber? {
22-
return mean as NSNumber?
23-
}
2418
/** Standard deviation for this currency. */
2519
public var standardDeviation: Double?
26-
public var standardDeviationNum: NSNumber? {
27-
return standardDeviation as NSNumber?
28-
}
2920

3021
public init(
3122
currency: String? = nil, revenue: Double? = nil, mean: Double? = nil,

Sources/Abtesting/Models/CustomSearchParams.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Foundation
88
#endif
99

1010
/// 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.
11-
@objcMembers public class CustomSearchParams: NSObject, Codable, JSONEncodable {
11+
public struct CustomSearchParams: Codable, JSONEncodable, Hashable {
1212

1313
public var customSearchParameters: AnyCodable
1414

Sources/Abtesting/Models/ErrorBase.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Foundation
88
#endif
99

1010
/// Error.
11-
@objcMembers public class ErrorBase: NSObject, Codable, JSONEncodable {
11+
public struct ErrorBase: Codable, JSONEncodable, Hashable {
1212

1313
public var message: String?
1414

@@ -46,7 +46,7 @@ import Foundation
4646

4747
// Decodable protocol methods
4848

49-
public required init(from decoder: Decoder) throws {
49+
public init(from decoder: Decoder) throws {
5050
let container = try decoder.container(keyedBy: CodingKeys.self)
5151

5252
message = try container.decodeIfPresent(String.self, forKey: .message)

Sources/Abtesting/Models/FilterEffects.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Foundation
88
#endif
99

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

1313
public var outliers: FilterEffectsOutliers?
1414
public var emptySearch: FilterEffectsEmptySearch?

0 commit comments

Comments
 (0)