Skip to content
8 changes: 8 additions & 0 deletions Sources/MeiliSearch/Model/KeyParams.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ public struct KeyParams: Codable, Equatable {
public let indexes: [String]
/// Date and time when the key will expire, represented in RFC 3339 format.
public let expiresAt: String?
public init(description: String? = nil, name: String? = nil, uid: String? = nil, actions: [String], indexes: [String], expiresAt: String?) {
self.description = description
self.name = name
self.uid = uid
self.actions = actions
self.indexes = indexes
self.expiresAt = expiresAt
}

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
Expand Down
2 changes: 1 addition & 1 deletion Sources/MeiliSearch/QueryParameters/KeysQuery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class KeysQuery: Queryable {
/// Offset the number of indexes that were skipped in the current response.
private var offset: Int?

init(limit: Int? = nil, offset: Int? = nil) {
public init(limit: Int? = nil, offset: Int? = nil) {
self.offset = offset
self.limit = limit
}
Expand Down