Skip to content

Commit 583eba7

Browse files
algolia-botmillotp
andcommitted
fix(specs): add getVersion parameter to getSettings (generated)
algolia/api-clients-automation#5254 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent 11796e2 commit 583eba7

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

Sources/Search/SearchClient.swift

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,11 +2038,18 @@ open class SearchClient {
20382038
}
20392039

20402040
/// - parameter indexName: (path) Name of the index on which to perform the operation.
2041+
/// - parameter getVersion: (query) When set to 2, the endpoint will not include `synonyms` in the response. This
2042+
/// parameter is here for backward compatibility. (optional, default to 1)
20412043
/// - returns: SettingsResponse
20422044
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
2043-
open func getSettings(indexName: String, requestOptions: RequestOptions? = nil) async throws -> SettingsResponse {
2045+
open func getSettings(
2046+
indexName: String,
2047+
getVersion: Int? = nil,
2048+
requestOptions: RequestOptions? = nil
2049+
) async throws -> SettingsResponse {
20442050
let response: Response<SettingsResponse> = try await getSettingsWithHTTPInfo(
20452051
indexName: indexName,
2052+
getVersion: getVersion,
20462053
requestOptions: requestOptions
20472054
)
20482055

@@ -2058,10 +2065,14 @@ open class SearchClient {
20582065
// - settings
20592066
//
20602067
// - parameter indexName: (path) Name of the index on which to perform the operation.
2068+
//
2069+
// - parameter getVersion: (query) When set to 2, the endpoint will not include `synonyms` in the response. This
2070+
// parameter is here for backward compatibility. (optional, default to 1)
20612071
// - returns: RequestBuilder<SettingsResponse>
20622072

20632073
open func getSettingsWithHTTPInfo(
20642074
indexName: String,
2075+
getVersion: Int? = nil,
20652076
requestOptions userRequestOptions: RequestOptions? = nil
20662077
) async throws -> Response<SettingsResponse> {
20672078
guard !indexName.isEmpty else {
@@ -2079,7 +2090,9 @@ open class SearchClient {
20792090
range: nil
20802091
)
20812092
let body: AnyCodable? = nil
2082-
let queryParameters: [String: Any?]? = nil
2093+
let queryParameters: [String: Any?] = [
2094+
"getVersion": getVersion?.encodeToJSON(),
2095+
]
20832096

20842097
let nillableHeaders: [String: Any?]? = nil
20852098

0 commit comments

Comments
 (0)