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.
61 lines
3.0 KiB
Swift
61 lines
3.0 KiB
Swift
//
|
|
// TargetReq.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct TargetReq: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Capacity is a human summary of the machine's size, up to 256 characters. Prose only; a scheduler reads Spec. */
|
|
public var capacity: String?
|
|
/** Host is the hostname sessions on this machine will report. It is what makes a re-link IDEMPOTENT: the same (org, host, owner) refreshes the existing row and answers 200, while a request with no host always creates a new target and answers 201. It never adopts a row owned by somebody else. */
|
|
public var host: String?
|
|
/** Kind is laptop | cloud | gpu | cluster | machine. Empty registers a `machine`; anything outside the five is a 400. */
|
|
public var kind: String?
|
|
/** Label is the name to show for this machine, up to 128 characters. REQUIRED — it is the only field here a person reads. */
|
|
public var label: String?
|
|
/** Metrics is a live sample, and sending one IS A HEARTBEAT: it refreshes the row and starts the 90-second liveness window, and it is appended to the fleet series as one point. Its own `at` is ignored — the server stamps the time, so a client can never age or backdate its own machine. Omit it to register a machine without claiming it is alive. */
|
|
public var metrics: Metrics?
|
|
/** Spec is the machine's static capability — os, arch, cores, RAM, accelerators. Every field is bounded on write and at most 32 accelerators are accepted, so what comes back may be clamped. Omit it for a destination nothing probes. */
|
|
public var spec: Spec?
|
|
/** Status is online | offline | draining. Empty registers `online`. It states INTENT — a heartbeat is what decides whether an online machine is actually reachable, so declaring online does not make it so. */
|
|
public var status: String?
|
|
|
|
public init(capacity: String? = nil, host: String? = nil, kind: String? = nil, label: String? = nil, metrics: Metrics? = nil, spec: Spec? = nil, status: String? = nil) {
|
|
self.capacity = capacity
|
|
self.host = host
|
|
self.kind = kind
|
|
self.label = label
|
|
self.metrics = metrics
|
|
self.spec = spec
|
|
self.status = status
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case capacity
|
|
case host
|
|
case kind
|
|
case label
|
|
case metrics
|
|
case spec
|
|
case status
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(capacity, forKey: .capacity)
|
|
try container.encodeIfPresent(host, forKey: .host)
|
|
try container.encodeIfPresent(kind, forKey: .kind)
|
|
try container.encodeIfPresent(label, forKey: .label)
|
|
try container.encodeIfPresent(metrics, forKey: .metrics)
|
|
try container.encodeIfPresent(spec, forKey: .spec)
|
|
try container.encodeIfPresent(status, forKey: .status)
|
|
}
|
|
}
|
|
|