Skip to content

Commit aeeb7e3

Browse files
algolia-botkai687shortcuts
committed
chore: generated code for commit dabdd029. [skip ci]
algolia/api-clients-automation@dabdd02 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Kai Welke <[email protected]> Co-authored-by: shortcuts <[email protected]>
1 parent da185a9 commit aeeb7e3

File tree

61 files changed

+934
-1056
lines changed

Some content is hidden

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

61 files changed

+934
-1056
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
/// Facet attribute. Only recommendations with the same value (or only recommendations with a different value) as the
10+
/// original viewed item are included.
11+
public struct AutoFacetFilter: Codable, JSONEncodable {
12+
/// Facet attribute.
13+
public var facet: String?
14+
/// Whether the filter is negative. If true, recommendations must not have the same value for the `facet` attribute.
15+
/// If false, recommendations must have the same value for the `facet` attribute.
16+
public var negative: Bool?
17+
18+
public init(facet: String? = nil, negative: Bool? = nil) {
19+
self.facet = facet
20+
self.negative = negative
21+
}
22+
23+
public enum CodingKeys: String, CodingKey, CaseIterable {
24+
case facet
25+
case negative
26+
}
27+
28+
// Encodable protocol methods
29+
30+
public func encode(to encoder: Encoder) throws {
31+
var container = encoder.container(keyedBy: CodingKeys.self)
32+
try container.encodeIfPresent(self.facet, forKey: .facet)
33+
try container.encodeIfPresent(self.negative, forKey: .negative)
34+
}
35+
}
36+
37+
extension AutoFacetFilter: Equatable {
38+
public static func ==(lhs: AutoFacetFilter, rhs: AutoFacetFilter) -> Bool {
39+
lhs.facet == rhs.facet &&
40+
lhs.negative == rhs.negative
41+
}
42+
}
43+
44+
extension AutoFacetFilter: Hashable {
45+
public func hash(into hasher: inout Hasher) {
46+
hasher.combine(self.facet?.hashValue)
47+
hasher.combine(self.negative?.hashValue)
48+
}
49+
}

Sources/Recommend/Models/BaseRecommendRequest.swift

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,47 +9,58 @@ import Foundation
99
public struct BaseRecommendRequest: Codable, JSONEncodable {
1010
/// Index name.
1111
public var indexName: String
12-
/// Recommendations with a confidence score lower than `threshold` won't appear in results. > **Note**: Each
13-
/// recommendation has a confidence score of 0 to 100. The closer the score is to 100, the more relevant the
14-
/// recommendations are.
15-
public var threshold: Int?
16-
/// Maximum number of recommendations to retrieve. If 0, all recommendations will be returned.
12+
/// Minimum score a recommendation must have to be included in the response.
13+
public var threshold: Double
14+
/// Maximum number of recommendations to retrieve. By default, all recommendations are returned and no fallback
15+
/// request is made. Depending on the available recommendations and the other request parameters, the actual number
16+
/// of recommendations may be lower than this value.
1717
public var maxRecommendations: Int?
18+
public var queryParameters: RecommendSearchParams?
1819

19-
public init(indexName: String, threshold: Int? = nil, maxRecommendations: Int? = nil) {
20+
public init(
21+
indexName: String,
22+
threshold: Double,
23+
maxRecommendations: Int? = nil,
24+
queryParameters: RecommendSearchParams? = nil
25+
) {
2026
self.indexName = indexName
2127
self.threshold = threshold
2228
self.maxRecommendations = maxRecommendations
29+
self.queryParameters = queryParameters
2330
}
2431

2532
public enum CodingKeys: String, CodingKey, CaseIterable {
2633
case indexName
2734
case threshold
2835
case maxRecommendations
36+
case queryParameters
2937
}
3038

3139
// Encodable protocol methods
3240

3341
public func encode(to encoder: Encoder) throws {
3442
var container = encoder.container(keyedBy: CodingKeys.self)
3543
try container.encode(self.indexName, forKey: .indexName)
36-
try container.encodeIfPresent(self.threshold, forKey: .threshold)
44+
try container.encode(self.threshold, forKey: .threshold)
3745
try container.encodeIfPresent(self.maxRecommendations, forKey: .maxRecommendations)
46+
try container.encodeIfPresent(self.queryParameters, forKey: .queryParameters)
3847
}
3948
}
4049

4150
extension BaseRecommendRequest: Equatable {
4251
public static func ==(lhs: BaseRecommendRequest, rhs: BaseRecommendRequest) -> Bool {
4352
lhs.indexName == rhs.indexName &&
4453
lhs.threshold == rhs.threshold &&
45-
lhs.maxRecommendations == rhs.maxRecommendations
54+
lhs.maxRecommendations == rhs.maxRecommendations &&
55+
lhs.queryParameters == rhs.queryParameters
4656
}
4757
}
4858

4959
extension BaseRecommendRequest: Hashable {
5060
public func hash(into hasher: inout Hasher) {
5161
hasher.combine(self.indexName.hashValue)
52-
hasher.combine(self.threshold?.hashValue)
62+
hasher.combine(self.threshold.hashValue)
5363
hasher.combine(self.maxRecommendations?.hashValue)
64+
hasher.combine(self.queryParameters?.hashValue)
5465
}
5566
}

Sources/Recommend/Models/BaseRecommendedForYouQueryParameters.swift

Lines changed: 0 additions & 43 deletions
This file was deleted.

Sources/Recommend/Models/BaseTrendingFacetsQuery.swift

Lines changed: 0 additions & 45 deletions
This file was deleted.

Sources/Recommend/Models/BaseTrendingItemsQuery.swift

Lines changed: 0 additions & 70 deletions
This file was deleted.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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+
public struct BoughtTogetherQuery: Codable, JSONEncodable {
10+
/// Index name.
11+
public var indexName: String
12+
/// Minimum score a recommendation must have to be included in the response.
13+
public var threshold: Double
14+
/// Maximum number of recommendations to retrieve. By default, all recommendations are returned and no fallback
15+
/// request is made. Depending on the available recommendations and the other request parameters, the actual number
16+
/// of recommendations may be lower than this value.
17+
public var maxRecommendations: Int?
18+
public var queryParameters: RecommendSearchParams?
19+
public var model: FbtModel
20+
/// Unique record identifier.
21+
public var objectID: String
22+
23+
public init(
24+
indexName: String,
25+
threshold: Double,
26+
maxRecommendations: Int? = nil,
27+
queryParameters: RecommendSearchParams? = nil,
28+
model: FbtModel,
29+
objectID: String
30+
) {
31+
self.indexName = indexName
32+
self.threshold = threshold
33+
self.maxRecommendations = maxRecommendations
34+
self.queryParameters = queryParameters
35+
self.model = model
36+
self.objectID = objectID
37+
}
38+
39+
public enum CodingKeys: String, CodingKey, CaseIterable {
40+
case indexName
41+
case threshold
42+
case maxRecommendations
43+
case queryParameters
44+
case model
45+
case objectID
46+
}
47+
48+
// Encodable protocol methods
49+
50+
public func encode(to encoder: Encoder) throws {
51+
var container = encoder.container(keyedBy: CodingKeys.self)
52+
try container.encode(self.indexName, forKey: .indexName)
53+
try container.encode(self.threshold, forKey: .threshold)
54+
try container.encodeIfPresent(self.maxRecommendations, forKey: .maxRecommendations)
55+
try container.encodeIfPresent(self.queryParameters, forKey: .queryParameters)
56+
try container.encode(self.model, forKey: .model)
57+
try container.encode(self.objectID, forKey: .objectID)
58+
}
59+
}
60+
61+
extension BoughtTogetherQuery: Equatable {
62+
public static func ==(lhs: BoughtTogetherQuery, rhs: BoughtTogetherQuery) -> Bool {
63+
lhs.indexName == rhs.indexName &&
64+
lhs.threshold == rhs.threshold &&
65+
lhs.maxRecommendations == rhs.maxRecommendations &&
66+
lhs.queryParameters == rhs.queryParameters &&
67+
lhs.model == rhs.model &&
68+
lhs.objectID == rhs.objectID
69+
}
70+
}
71+
72+
extension BoughtTogetherQuery: Hashable {
73+
public func hash(into hasher: inout Hasher) {
74+
hasher.combine(self.indexName.hashValue)
75+
hasher.combine(self.threshold.hashValue)
76+
hasher.combine(self.maxRecommendations?.hashValue)
77+
hasher.combine(self.queryParameters?.hashValue)
78+
hasher.combine(self.model.hashValue)
79+
hasher.combine(self.objectID.hashValue)
80+
}
81+
}

0 commit comments

Comments
 (0)