Skip to content

Commit b58e764

Browse files
algolia-botFluf22
andcommitted
chore(website): exclude schema from generated variables file (generated)
algolia/api-clients-automation#5306 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Thomas Raffray <[email protected]>
1 parent 583eba7 commit b58e764

File tree

3 files changed

+95
-2
lines changed

3 files changed

+95
-2
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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 CompositionExternalInjectedItem: Codable, JSONEncodable {
10+
public var items: [CompositionExternalInjection]
11+
12+
public init(items: [CompositionExternalInjection]) {
13+
self.items = items
14+
}
15+
16+
public enum CodingKeys: String, CodingKey, CaseIterable {
17+
case items
18+
}
19+
20+
// Encodable protocol methods
21+
22+
public func encode(to encoder: Encoder) throws {
23+
var container = encoder.container(keyedBy: CodingKeys.self)
24+
try container.encode(self.items, forKey: .items)
25+
}
26+
}
27+
28+
extension CompositionExternalInjectedItem: Equatable {
29+
public static func ==(lhs: CompositionExternalInjectedItem, rhs: CompositionExternalInjectedItem) -> Bool {
30+
lhs.items == rhs.items
31+
}
32+
}
33+
34+
extension CompositionExternalInjectedItem: Hashable {
35+
public func hash(into hasher: inout Hasher) {
36+
hasher.combine(self.items.hashValue)
37+
}
38+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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 CompositionExternalInjection: Codable, JSONEncodable {
10+
/// An objectID injected into an external source.
11+
public var objectID: String
12+
/// User-defined key-values that will be added to the injected item in the response. This is identical to Hits
13+
/// metadata defined in Composition or Composition Rule, with the benefit of being set at runtime.
14+
public var metadata: [String: AnyCodable]?
15+
16+
public init(objectID: String, metadata: [String: AnyCodable]? = nil) {
17+
self.objectID = objectID
18+
self.metadata = metadata
19+
}
20+
21+
public enum CodingKeys: String, CodingKey, CaseIterable {
22+
case objectID
23+
case metadata
24+
}
25+
26+
// Encodable protocol methods
27+
28+
public func encode(to encoder: Encoder) throws {
29+
var container = encoder.container(keyedBy: CodingKeys.self)
30+
try container.encode(self.objectID, forKey: .objectID)
31+
try container.encodeIfPresent(self.metadata, forKey: .metadata)
32+
}
33+
}
34+
35+
extension CompositionExternalInjection: Equatable {
36+
public static func ==(lhs: CompositionExternalInjection, rhs: CompositionExternalInjection) -> Bool {
37+
lhs.objectID == rhs.objectID &&
38+
lhs.metadata == rhs.metadata
39+
}
40+
}
41+
42+
extension CompositionExternalInjection: Hashable {
43+
public func hash(into hasher: inout Hasher) {
44+
hasher.combine(self.objectID.hashValue)
45+
hasher.combine(self.metadata?.hashValue)
46+
}
47+
}

Sources/Composition/Models/CompositionParams.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ public struct CompositionParams: Codable, JSONEncodable {
8989
/// Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/)
9090
/// This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard.
9191
public var enableReRanking: Bool?
92+
/// A list of extenrally injected objectID groups into from an external source.
93+
public var injectedItems: [String: CompositionExternalInjectedItem]?
9294

9395
public init(
9496
query: String? = nil,
@@ -116,7 +118,8 @@ public struct CompositionParams: Codable, JSONEncodable {
116118
analytics: Bool? = nil,
117119
analyticsTags: [String]? = nil,
118120
enableABTest: Bool? = nil,
119-
enableReRanking: Bool? = nil
121+
enableReRanking: Bool? = nil,
122+
injectedItems: [String: CompositionExternalInjectedItem]? = nil
120123
) {
121124
self.query = query
122125
self.filters = filters
@@ -144,6 +147,7 @@ public struct CompositionParams: Codable, JSONEncodable {
144147
self.analyticsTags = analyticsTags
145148
self.enableABTest = enableABTest
146149
self.enableReRanking = enableReRanking
150+
self.injectedItems = injectedItems
147151
}
148152

149153
public enum CodingKeys: String, CodingKey, CaseIterable {
@@ -173,6 +177,7 @@ public struct CompositionParams: Codable, JSONEncodable {
173177
case analyticsTags
174178
case enableABTest
175179
case enableReRanking
180+
case injectedItems
176181
}
177182

178183
// Encodable protocol methods
@@ -205,6 +210,7 @@ public struct CompositionParams: Codable, JSONEncodable {
205210
try container.encodeIfPresent(self.analyticsTags, forKey: .analyticsTags)
206211
try container.encodeIfPresent(self.enableABTest, forKey: .enableABTest)
207212
try container.encodeIfPresent(self.enableReRanking, forKey: .enableReRanking)
213+
try container.encodeIfPresent(self.injectedItems, forKey: .injectedItems)
208214
}
209215
}
210216

@@ -235,7 +241,8 @@ extension CompositionParams: Equatable {
235241
lhs.analytics == rhs.analytics &&
236242
lhs.analyticsTags == rhs.analyticsTags &&
237243
lhs.enableABTest == rhs.enableABTest &&
238-
lhs.enableReRanking == rhs.enableReRanking
244+
lhs.enableReRanking == rhs.enableReRanking &&
245+
lhs.injectedItems == rhs.injectedItems
239246
}
240247
}
241248

@@ -267,5 +274,6 @@ extension CompositionParams: Hashable {
267274
hasher.combine(self.analyticsTags?.hashValue)
268275
hasher.combine(self.enableABTest?.hashValue)
269276
hasher.combine(self.enableReRanking?.hashValue)
277+
hasher.combine(self.injectedItems?.hashValue)
270278
}
271279
}

0 commit comments

Comments
 (0)