mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The projection these were generated from predated the compute migration, so they described /v1/visor — which the API serves at zero paths now. No /v1/visor path survives here.
56 lines
2.0 KiB
Swift
56 lines
2.0 KiB
Swift
//
|
|
// IndexHits.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct IndexHits: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** EstimatedTotalHits is the dialect's name for the match count. Every hit is materialised here, so for this page it is exact rather than estimated. */
|
|
public var estimatedTotalHits: Int64?
|
|
/** Hits are the matching documents, most relevant first, exactly as stored. */
|
|
public var hits: [JSONValue]?
|
|
/** Limit is how many hits this page could hold. */
|
|
public var limit: Int64?
|
|
/** Offset is where this page starts. */
|
|
public var offset: Int64?
|
|
/** ProcessingTimeMs is how long the query took, in milliseconds. */
|
|
public var processingTimeMs: Int64?
|
|
/** Query echoes the search terms, which is what a client renders above the results. */
|
|
public var query: String?
|
|
|
|
public init(estimatedTotalHits: Int64? = nil, hits: [JSONValue]? = nil, limit: Int64? = nil, offset: Int64? = nil, processingTimeMs: Int64? = nil, query: String? = nil) {
|
|
self.estimatedTotalHits = estimatedTotalHits
|
|
self.hits = hits
|
|
self.limit = limit
|
|
self.offset = offset
|
|
self.processingTimeMs = processingTimeMs
|
|
self.query = query
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case estimatedTotalHits
|
|
case hits
|
|
case limit
|
|
case offset
|
|
case processingTimeMs
|
|
case query
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(estimatedTotalHits, forKey: .estimatedTotalHits)
|
|
try container.encodeIfPresent(hits, forKey: .hits)
|
|
try container.encodeIfPresent(limit, forKey: .limit)
|
|
try container.encodeIfPresent(offset, forKey: .offset)
|
|
try container.encodeIfPresent(processingTimeMs, forKey: .processingTimeMs)
|
|
try container.encodeIfPresent(query, forKey: .query)
|
|
}
|
|
}
|
|
|