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.
51 lines
1.9 KiB
Swift
51 lines
1.9 KiB
Swift
//
|
|
// Fusion.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Fusion: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Backends is the per-leg report. Always populated. */
|
|
public var backends: [BackendStatus]?
|
|
/** Hits is the fused, ranked result set. */
|
|
public var hits: [Hit]?
|
|
/** Mode is the mode actually used after `auto` resolution. */
|
|
public var mode: String?
|
|
/** Status is the query's overall honesty signal: ok every consulted leg answered. partial at least one leg failed; Hits holds the survivors' results. unavailable every consulted leg failed; Hits is empty AND that is stated. */
|
|
public var status: String?
|
|
/** TookMS is the whole query's wall time in milliseconds — every leg it consulted, plus fusion and paging. Each leg's own share is in Backends[].TookMS; the legs run in sequence, so this is at least their sum. */
|
|
public var tookMs: Int64?
|
|
|
|
public init(backends: [BackendStatus]? = nil, hits: [Hit]? = nil, mode: String? = nil, status: String? = nil, tookMs: Int64? = nil) {
|
|
self.backends = backends
|
|
self.hits = hits
|
|
self.mode = mode
|
|
self.status = status
|
|
self.tookMs = tookMs
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case backends
|
|
case hits
|
|
case mode
|
|
case status
|
|
case tookMs = "took_ms"
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(backends, forKey: .backends)
|
|
try container.encodeIfPresent(hits, forKey: .hits)
|
|
try container.encodeIfPresent(mode, forKey: .mode)
|
|
try container.encodeIfPresent(status, forKey: .status)
|
|
try container.encodeIfPresent(tookMs, forKey: .tookMs)
|
|
}
|
|
}
|
|
|