Skip to content

Commit

Permalink
chore: generated code for commit 9451edc. [skip ci]
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Raffray <[email protected]>
  • Loading branch information
algolia-bot and Fluf22 committed Jul 9, 2024
1 parent 9451edc commit 5761ef5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,23 +126,24 @@ public extension SearchClient {
try await self.getApiKey(key: key, requestOptions: requestOptions)
},
validate: { response in
if apiKey.description != nil && apiKey.description != response.description {
if apiKey.description != nil, apiKey.description != response.description {
return false
}

if apiKey.queryParameters != nil && apiKey.queryParameters != response.queryParameters {
if apiKey.queryParameters != nil, apiKey.queryParameters != response.queryParameters {
return false
}

if apiKey.maxHitsPerQuery != nil && apiKey.maxHitsPerQuery != response.maxHitsPerQuery {
if apiKey.maxHitsPerQuery != nil, apiKey.maxHitsPerQuery != response.maxHitsPerQuery {
return false
}

if apiKey.maxQueriesPerIPPerHour != nil && apiKey.maxQueriesPerIPPerHour != response.maxQueriesPerIPPerHour {
if apiKey.maxQueriesPerIPPerHour != nil,
apiKey.maxQueriesPerIPPerHour != response.maxQueriesPerIPPerHour {
return false
}

if apiKey.validity != nil && apiKey.validity != response.validity {
if apiKey.validity != nil, apiKey.validity != response.validity {
return false
}

Expand Down Expand Up @@ -191,11 +192,11 @@ public extension SearchClient {
execute: { _ in
do {
return try await self.getApiKey(key: key, requestOptions: requestOptions)
} catch AlgoliaError.httpError(let error) {
} catch let AlgoliaError.httpError(error) {
if error.statusCode == 404 {
return nil
}

throw error
}
},
Expand Down
9 changes: 0 additions & 9 deletions tests/output/swift/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,5 @@ let package = Package(
.target(name: "Utils"),
] + libraries
),
.testTarget(
name: "handwritten",
dependencies: [
.product(name: "DotEnv", package: "DotEnv"),
.target(name: "Utils"),
.product(name: "Core", package: "algoliasearch-client-swift"),
.product(name: "Search", package: "algoliasearch-client-swift"),
]
),
]
)

0 comments on commit 5761ef5

Please sign in to comment.