Skip to content

Commit a6782c7

Browse files
chore: generated code for commit cefa6674. [skip ci]
algolia/api-clients-automation@cefa667 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent d5e6a6c commit a6782c7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Sources/Search/Extra/SearchClientExtension.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,18 +526,18 @@ public extension SearchClient {
526526
/// - returns: String?
527527
func generateSecuredApiKey(
528528
parentApiKey: String,
529-
with restriction: SecuredAPIKeyRestrictions = SecuredAPIKeyRestrictions()
529+
with restriction: SecuredApiKeyRestrictions = SecuredApiKeyRestrictions()
530530
) throws -> String? {
531531
let queryParams = try restriction.toURLEncodedString()
532532
let hash = queryParams.hmac256(withKey: parentApiKey)
533533
return "\(hash)\(queryParams)".data(using: .utf8)?.base64EncodedString()
534534
}
535535

536536
/// Get the remaining validity of a secured API key
537-
/// - parameter securedAPIKey: The secured API key
537+
/// - parameter securedApiKey: The secured API key
538538
/// - returns: TimeInterval?
539-
func getSecuredApiKeyRemainingValidity(for securedAPIKey: String) -> TimeInterval? {
540-
guard let rawDecodedAPIKey = String(data: Data(base64Encoded: securedAPIKey) ?? Data(), encoding: .utf8),
539+
func getSecuredApiKeyRemainingValidity(for securedApiKey: String) -> TimeInterval? {
540+
guard let rawDecodedAPIKey = String(data: Data(base64Encoded: securedApiKey) ?? Data(), encoding: .utf8),
541541
!rawDecodedAPIKey.isEmpty else {
542542
return nil
543543
}

Sources/Search/Extra/SecuredApiKeyRestrictionExtension.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#endif
44
import Foundation
55

6-
public extension SecuredAPIKeyRestrictions {
6+
public extension SecuredApiKeyRestrictions {
77
func toURLEncodedString() throws -> String {
88
var queryDictionary: [String: Any] = [:]
99

Sources/Search/Models/SecuredAPIKeyRestrictions.swift renamed to Sources/Search/Models/SecuredApiKeyRestrictions.swift

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

9-
public struct SecuredAPIKeyRestrictions: Codable, JSONEncodable {
9+
public struct SecuredApiKeyRestrictions: Codable, JSONEncodable {
1010
public var searchParams: SearchSearchParamsObject?
1111
/// Filters that apply to every search made with the secured API key. Extra filters added at search time will be
1212
/// combined with `AND`. For example, if you set `group:admin` as fixed filter on your generated API key, and add
@@ -65,8 +65,8 @@ public struct SecuredAPIKeyRestrictions: Codable, JSONEncodable {
6565
}
6666
}
6767

68-
extension SecuredAPIKeyRestrictions: Equatable {
69-
public static func ==(lhs: SecuredAPIKeyRestrictions, rhs: SecuredAPIKeyRestrictions) -> Bool {
68+
extension SecuredApiKeyRestrictions: Equatable {
69+
public static func ==(lhs: SecuredApiKeyRestrictions, rhs: SecuredApiKeyRestrictions) -> Bool {
7070
lhs.searchParams == rhs.searchParams &&
7171
lhs.filters == rhs.filters &&
7272
lhs.validUntil == rhs.validUntil &&
@@ -76,7 +76,7 @@ extension SecuredAPIKeyRestrictions: Equatable {
7676
}
7777
}
7878

79-
extension SecuredAPIKeyRestrictions: Hashable {
79+
extension SecuredApiKeyRestrictions: Hashable {
8080
public func hash(into hasher: inout Hasher) {
8181
hasher.combine(self.searchParams?.hashValue)
8282
hasher.combine(self.filters?.hashValue)

0 commit comments

Comments
 (0)