Skip to content

Commit 75e1ae0

Browse files
algolia-botkai687shortcuts
committed
chore: generated code for commit 10e08c9e. [skip ci]
algolia/api-clients-automation@10e08c9 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Kai Welke <[email protected]> Co-authored-by: shortcuts <[email protected]>
1 parent b62a428 commit 75e1ae0

11 files changed

+56
-120
lines changed

Sources/QuerySuggestions/Models/BaseQuerySuggestionsConfigurationWithIndex.swift renamed to Sources/QuerySuggestions/Models/AppID.swift

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

9-
public struct BaseQuerySuggestionsConfigurationWithIndex: Codable, JSONEncodable {
10-
/// Query Suggestions index name.
11-
public var indexName: String
9+
public struct AppID: Codable, JSONEncodable {
10+
/// Algolia application ID to which this Query Suggestions configuration belongs.
11+
public var appID: String?
1212

13-
public init(indexName: String) {
14-
self.indexName = indexName
13+
public init(appID: String? = nil) {
14+
self.appID = appID
1515
}
1616

1717
public enum CodingKeys: String, CodingKey, CaseIterable {
18-
case indexName
18+
case appID
1919
}
2020

2121
// Encodable protocol methods
2222

2323
public func encode(to encoder: Encoder) throws {
2424
var container = encoder.container(keyedBy: CodingKeys.self)
25-
try container.encode(self.indexName, forKey: .indexName)
25+
try container.encodeIfPresent(self.appID, forKey: .appID)
2626
}
2727
}

Sources/QuerySuggestions/Models/BaseQuerySuggestionsConfigurationResponse.swift

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

Sources/QuerySuggestions/Models/GetConfigStatus200Response.swift

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

99
public struct GetConfigStatus200Response: Codable, JSONEncodable {
10-
/// Query Suggestions index name.
10+
/// Name of the Query Suggestions index.
1111
public var indexName: String?
12-
/// Indicates whether the creation or update of the Query Suggestions is in progress.
12+
/// Whether the creation or update of the Query Suggestions index is in progress.
1313
public var isRunning: Bool?
1414
/// Timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format when the Query Suggestions index was last
1515
/// built.

Sources/QuerySuggestions/Models/GetLogFile200Response.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public struct GetLogFile200Response: Codable, JSONEncodable {
1212
public var level: ModelLogLevel?
1313
/// Details about this log entry.
1414
public var message: String?
15-
/// Level indicating the position of a suggestion in a hierarchy of records. For example, a `contextLevel` of 1
15+
/// Level indicating the position of a suggestion in a hierarchy of records. For example, a `contextLevel` of 1
1616
/// indicates that this suggestion belongs to a previous suggestion with `contextLevel` 0.
1717
public var contextLevel: Int?
1818

Sources/QuerySuggestions/Models/ModelLogLevel.swift

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

9-
/// The type of log entry. - &#x60;SKIP&#x60;. A query is skipped because it doesn&#39;t match the conditions for
9+
/// Type of log entry. - &#x60;SKIP&#x60;. A query is skipped because it doesn&#39;t match the conditions for
1010
/// successful inclusion. For example, when a query doesn&#39;t generate enough search results. - &#x60;INFO&#x60;. An
1111
/// informative log entry. - &#x60;ERROR&#x60;. The Query Suggestions process encountered an error.
1212
public enum ModelLogLevel: String, Codable, CaseIterable {

Sources/QuerySuggestions/Models/QuerySuggestionsConfiguration.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ public struct QuerySuggestionsConfiguration: Codable, JSONEncodable {
1111
/// Algolia indices from which to get the popular searches for query suggestions.
1212
public var sourceIndices: [SourceIndex]
1313
public var languages: QuerySuggestionsLanguages?
14-
/// Patterns to exclude from query suggestions.
1514
public var exclude: [String]?
16-
/// Turn on personalized query suggestions.
15+
/// Whether to turn on personalized query suggestions.
1716
public var enablePersonalization: Bool?
18-
/// Allow suggestions with special characters.
17+
/// Whether to include suggestions with special characters.
1918
public var allowSpecialCharacters: Bool?
2019

2120
public init(

Sources/QuerySuggestions/Models/QuerySuggestionsConfigurationResponse.swift

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,31 @@ import Foundation
66
import Core
77
#endif
88

9+
/// API response for retrieving Query Suggestions configurations.
910
public struct QuerySuggestionsConfigurationResponse: Codable, JSONEncodable {
10-
/// API key used to read from your source index.
11-
public var sourceIndicesAPIKey: String?
12-
/// API key used to write and configure your Query Suggestions index.
13-
public var suggestionsIndicesAPIKey: String?
14-
/// API key used to read from external Algolia indices.
15-
public var externalIndicesAPIKey: String?
16-
/// Query Suggestions index name.
11+
/// Algolia application ID to which this Query Suggestions configuration belongs.
12+
public var appID: String
13+
/// Name of the Query Suggestions index.
1714
public var indexName: String
1815
/// Algolia indices from which to get the popular searches for query suggestions.
1916
public var sourceIndices: [SourceIndex]
20-
public var languages: QuerySuggestionsLanguages?
21-
/// Patterns to exclude from query suggestions.
17+
public var languages: QuerySuggestionsLanguages
2218
public var exclude: [String]?
23-
/// Turn on personalized query suggestions.
24-
public var enablePersonalization: Bool?
25-
/// Allow suggestions with special characters.
26-
public var allowSpecialCharacters: Bool?
19+
/// Whether to turn on personalized query suggestions.
20+
public var enablePersonalization: Bool
21+
/// Whether to include suggestions with special characters.
22+
public var allowSpecialCharacters: Bool
2723

2824
public init(
29-
sourceIndicesAPIKey: String? = nil,
30-
suggestionsIndicesAPIKey: String? = nil,
31-
externalIndicesAPIKey: String? = nil,
25+
appID: String,
3226
indexName: String,
3327
sourceIndices: [SourceIndex],
34-
languages: QuerySuggestionsLanguages? = nil,
35-
exclude: [String]? = nil,
36-
enablePersonalization: Bool? = nil,
37-
allowSpecialCharacters: Bool? = nil
28+
languages: QuerySuggestionsLanguages,
29+
exclude: [String]?,
30+
enablePersonalization: Bool,
31+
allowSpecialCharacters: Bool
3832
) {
39-
self.sourceIndicesAPIKey = sourceIndicesAPIKey
40-
self.suggestionsIndicesAPIKey = suggestionsIndicesAPIKey
41-
self.externalIndicesAPIKey = externalIndicesAPIKey
33+
self.appID = appID
4234
self.indexName = indexName
4335
self.sourceIndices = sourceIndices
4436
self.languages = languages
@@ -48,9 +40,7 @@ public struct QuerySuggestionsConfigurationResponse: Codable, JSONEncodable {
4840
}
4941

5042
public enum CodingKeys: String, CodingKey, CaseIterable {
51-
case sourceIndicesAPIKey
52-
case suggestionsIndicesAPIKey
53-
case externalIndicesAPIKey
43+
case appID
5444
case indexName
5545
case sourceIndices
5646
case languages
@@ -63,14 +53,12 @@ public struct QuerySuggestionsConfigurationResponse: Codable, JSONEncodable {
6353

6454
public func encode(to encoder: Encoder) throws {
6555
var container = encoder.container(keyedBy: CodingKeys.self)
66-
try container.encodeIfPresent(self.sourceIndicesAPIKey, forKey: .sourceIndicesAPIKey)
67-
try container.encodeIfPresent(self.suggestionsIndicesAPIKey, forKey: .suggestionsIndicesAPIKey)
68-
try container.encodeIfPresent(self.externalIndicesAPIKey, forKey: .externalIndicesAPIKey)
56+
try container.encode(self.appID, forKey: .appID)
6957
try container.encode(self.indexName, forKey: .indexName)
7058
try container.encode(self.sourceIndices, forKey: .sourceIndices)
71-
try container.encodeIfPresent(self.languages, forKey: .languages)
72-
try container.encodeIfPresent(self.exclude, forKey: .exclude)
73-
try container.encodeIfPresent(self.enablePersonalization, forKey: .enablePersonalization)
74-
try container.encodeIfPresent(self.allowSpecialCharacters, forKey: .allowSpecialCharacters)
59+
try container.encode(self.languages, forKey: .languages)
60+
try container.encode(self.exclude, forKey: .exclude)
61+
try container.encode(self.enablePersonalization, forKey: .enablePersonalization)
62+
try container.encode(self.allowSpecialCharacters, forKey: .allowSpecialCharacters)
7563
}
7664
}

Sources/QuerySuggestions/Models/QuerySuggestionsConfigurationWithIndex.swift

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,52 +8,51 @@ import Foundation
88

99
/// Query Suggestions configuration.
1010
public struct QuerySuggestionsConfigurationWithIndex: Codable, JSONEncodable {
11-
/// Query Suggestions index name.
12-
public var indexName: String
1311
/// Algolia indices from which to get the popular searches for query suggestions.
1412
public var sourceIndices: [SourceIndex]
1513
public var languages: QuerySuggestionsLanguages?
16-
/// Patterns to exclude from query suggestions.
1714
public var exclude: [String]?
18-
/// Turn on personalized query suggestions.
15+
/// Whether to turn on personalized query suggestions.
1916
public var enablePersonalization: Bool?
20-
/// Allow suggestions with special characters.
17+
/// Whether to include suggestions with special characters.
2118
public var allowSpecialCharacters: Bool?
19+
/// Name of the Query Suggestions index.
20+
public var indexName: String
2221

2322
public init(
24-
indexName: String,
2523
sourceIndices: [SourceIndex],
2624
languages: QuerySuggestionsLanguages? = nil,
2725
exclude: [String]? = nil,
2826
enablePersonalization: Bool? = nil,
29-
allowSpecialCharacters: Bool? = nil
27+
allowSpecialCharacters: Bool? = nil,
28+
indexName: String
3029
) {
31-
self.indexName = indexName
3230
self.sourceIndices = sourceIndices
3331
self.languages = languages
3432
self.exclude = exclude
3533
self.enablePersonalization = enablePersonalization
3634
self.allowSpecialCharacters = allowSpecialCharacters
35+
self.indexName = indexName
3736
}
3837

3938
public enum CodingKeys: String, CodingKey, CaseIterable {
40-
case indexName
4139
case sourceIndices
4240
case languages
4341
case exclude
4442
case enablePersonalization
4543
case allowSpecialCharacters
44+
case indexName
4645
}
4746

4847
// Encodable protocol methods
4948

5049
public func encode(to encoder: Encoder) throws {
5150
var container = encoder.container(keyedBy: CodingKeys.self)
52-
try container.encode(self.indexName, forKey: .indexName)
5351
try container.encode(self.sourceIndices, forKey: .sourceIndices)
5452
try container.encodeIfPresent(self.languages, forKey: .languages)
5553
try container.encodeIfPresent(self.exclude, forKey: .exclude)
5654
try container.encodeIfPresent(self.enablePersonalization, forKey: .enablePersonalization)
5755
try container.encodeIfPresent(self.allowSpecialCharacters, forKey: .allowSpecialCharacters)
56+
try container.encode(self.indexName, forKey: .indexName)
5857
}
5958
}

Sources/QuerySuggestions/Models/QuerySuggestionsLanguages.swift

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

9-
/// Set the language for deduplicating singular and plural suggestions. If specified, only the more popular form is
10-
/// included.
9+
/// Languages for deduplicating singular and plural suggestions. If specified, only the more popular form is included.
1110
public enum QuerySuggestionsLanguages: Codable, JSONEncodable, AbstractEncodable {
1211
case arrayOfString([String])
1312
case bool(Bool)

Sources/QuerySuggestions/Models/SourceIndex.swift

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,18 @@ import Foundation
1010
public struct SourceIndex: Codable, JSONEncodable {
1111
/// Name of the Algolia index to use as source for query suggestions.
1212
public var indexName: String
13-
/// If true, Query Suggestions uses all replicas of the primary index to find popular searches. If false, only the
14-
/// primary index is used.
13+
/// If true, Query Suggestions uses all replica indices to find popular searches. If false, only the primary index
14+
/// is used.
1515
public var replicas: Bool?
16-
/// [Analytics tags](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) for filtering the
17-
/// popular searches.
1816
public var analyticsTags: [String]?
19-
/// Facets to use as top categories with your suggestions. If provided, Query Suggestions adds the top facet values
20-
/// to each suggestion.
2117
public var facets: [Facet]?
2218
/// Minimum number of hits required to be included as a suggestion. A search query must at least generate `minHits`
23-
/// hits to be included in the Query Suggestions index.
19+
/// search results to be included in the Query Suggestions index.
2420
public var minHits: Int?
2521
/// Minimum letters required to be included as a suggestion. A search query must be at least `minLetters` long to
2622
/// be included in the Query Suggestions index.
2723
public var minLetters: Int?
2824
public var generate: [[String]]?
29-
/// Algolia indices with popular searches to use as query suggestions. Records of these indices must have these
30-
/// attributes: - `query`: search query which will be added as a suggestion - `count`: measure of popularity of
31-
/// that search query For example, you can export popular searches from an external analytics tool, such as Google
32-
/// Analytics or Adobe Analytics, and feed this data into an external Algolia index. You can use this external index
33-
/// to generate query suggestions until your Algolia analytics has collected enough data.
3425
public var external: [String]?
3526

3627
public init(

0 commit comments

Comments
 (0)