Skip to content

Commit 5761ef5

Browse files
algolia-botFluf22
andcommitted
chore: generated code for commit 9451edc. [skip ci]
Co-authored-by: Thomas Raffray <[email protected]>
1 parent 9451edc commit 5761ef5

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

clients/algoliasearch-client-swift/Sources/Search/Extra/SearchClientExtension.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,23 +126,24 @@ public extension SearchClient {
126126
try await self.getApiKey(key: key, requestOptions: requestOptions)
127127
},
128128
validate: { response in
129-
if apiKey.description != nil && apiKey.description != response.description {
129+
if apiKey.description != nil, apiKey.description != response.description {
130130
return false
131131
}
132132

133-
if apiKey.queryParameters != nil && apiKey.queryParameters != response.queryParameters {
133+
if apiKey.queryParameters != nil, apiKey.queryParameters != response.queryParameters {
134134
return false
135135
}
136136

137-
if apiKey.maxHitsPerQuery != nil && apiKey.maxHitsPerQuery != response.maxHitsPerQuery {
137+
if apiKey.maxHitsPerQuery != nil, apiKey.maxHitsPerQuery != response.maxHitsPerQuery {
138138
return false
139139
}
140140

141-
if apiKey.maxQueriesPerIPPerHour != nil && apiKey.maxQueriesPerIPPerHour != response.maxQueriesPerIPPerHour {
141+
if apiKey.maxQueriesPerIPPerHour != nil,
142+
apiKey.maxQueriesPerIPPerHour != response.maxQueriesPerIPPerHour {
142143
return false
143144
}
144145

145-
if apiKey.validity != nil && apiKey.validity != response.validity {
146+
if apiKey.validity != nil, apiKey.validity != response.validity {
146147
return false
147148
}
148149

@@ -191,11 +192,11 @@ public extension SearchClient {
191192
execute: { _ in
192193
do {
193194
return try await self.getApiKey(key: key, requestOptions: requestOptions)
194-
} catch AlgoliaError.httpError(let error) {
195+
} catch let AlgoliaError.httpError(error) {
195196
if error.statusCode == 404 {
196197
return nil
197198
}
198-
199+
199200
throw error
200201
}
201202
},

tests/output/swift/Package.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,5 @@ let package = Package(
7676
.target(name: "Utils"),
7777
] + libraries
7878
),
79-
.testTarget(
80-
name: "handwritten",
81-
dependencies: [
82-
.product(name: "DotEnv", package: "DotEnv"),
83-
.target(name: "Utils"),
84-
.product(name: "Core", package: "algoliasearch-client-swift"),
85-
.product(name: "Search", package: "algoliasearch-client-swift"),
86-
]
87-
),
8879
]
8980
)

0 commit comments

Comments
 (0)