mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The forge tree held the package scaffolding and none of the generated sources — 2,435 files of APIs, Models and Infrastructure, including BaseAPI, were simply absent, so anything depending on this copy had a package that compiled to nothing usable. Generated from the current API document rather than reconciled with the other copy: a client is a function of the spec, so regenerating answers "which history wins" without anyone having to choose. .spec-lock records which document, so the next reader can tell.
81 lines
3.8 KiB
Swift
81 lines
3.8 KiB
Swift
//
|
|
// Answer.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Answer: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Cold reports that this request paid to PREPARE the revision — the tree write, the dependency fetch and the language server's first index. It is the billed event, surfaced so a caller can see what it was charged for. */
|
|
public var cold: Bool?
|
|
/** Completions is complete's answer: the candidates at the position, typed and resolved through the repository's dependencies rather than guessed from text. */
|
|
public var completions: [Completion]?
|
|
/** Diagnostics is diagnostics' answer: every problem the server finds in the whole file, position ignored. Empty means it found none. */
|
|
public var diagnostics: [Diagnostic]?
|
|
/** Hover is hover's answer: the type and documentation as the language server itself renders them, so it is prose meant to be shown, not parsed. */
|
|
public var hover: String?
|
|
/** Lang is the language the server that answered speaks (\"go\"), as the daemon reports it. Empty when the daemon named none. */
|
|
public var lang: String?
|
|
/** Locations is locate's answer: where the symbol is defined, referenced, typed or implemented, per the relation asked for. Empty means the server resolved nothing there, which is an answer. */
|
|
public var locations: [Location]?
|
|
/** Op is the question that was asked: hover, locate, symbols, diagnostics or complete. It names which result field below is the populated one. */
|
|
public var op: String?
|
|
/** Path is the repo-relative file the question was about, echoed back. */
|
|
public var path: String?
|
|
/** Repo is the repository the question was about, echoed back. */
|
|
public var repo: String?
|
|
/** Rev is the RESOLVED commit sha, never the branch or tag that was asked for. It is what makes an answer re-askable: a branch moves, this does not. */
|
|
public var rev: String?
|
|
/** Symbols is symbols' answer: the file's whole outline, position ignored. */
|
|
public var symbols: [Symbol]?
|
|
|
|
public init(cold: Bool? = nil, completions: [Completion]? = nil, diagnostics: [Diagnostic]? = nil, hover: String? = nil, lang: String? = nil, locations: [Location]? = nil, op: String? = nil, path: String? = nil, repo: String? = nil, rev: String? = nil, symbols: [Symbol]? = nil) {
|
|
self.cold = cold
|
|
self.completions = completions
|
|
self.diagnostics = diagnostics
|
|
self.hover = hover
|
|
self.lang = lang
|
|
self.locations = locations
|
|
self.op = op
|
|
self.path = path
|
|
self.repo = repo
|
|
self.rev = rev
|
|
self.symbols = symbols
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case cold
|
|
case completions
|
|
case diagnostics
|
|
case hover
|
|
case lang
|
|
case locations
|
|
case op
|
|
case path
|
|
case repo
|
|
case rev
|
|
case symbols
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(cold, forKey: .cold)
|
|
try container.encodeIfPresent(completions, forKey: .completions)
|
|
try container.encodeIfPresent(diagnostics, forKey: .diagnostics)
|
|
try container.encodeIfPresent(hover, forKey: .hover)
|
|
try container.encodeIfPresent(lang, forKey: .lang)
|
|
try container.encodeIfPresent(locations, forKey: .locations)
|
|
try container.encodeIfPresent(op, forKey: .op)
|
|
try container.encodeIfPresent(path, forKey: .path)
|
|
try container.encodeIfPresent(repo, forKey: .repo)
|
|
try container.encodeIfPresent(rev, forKey: .rev)
|
|
try container.encodeIfPresent(symbols, forKey: .symbols)
|
|
}
|
|
}
|
|
|