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.6 KiB
Swift
51 lines
1.6 KiB
Swift
//
|
|
// Spec.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Spec: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** amd64 | arm64 | ... */
|
|
public var arch: String?
|
|
/** logical cores */
|
|
public var cpus: Int64?
|
|
/** GPUs is every accelerator the machine advertises, one entry each, capped at 32 on write. Empty means the probe found none — and that is the answer a Need is checked against, so a machine with no entry here clears no accelerator floor. The list is not vendor-filtered: what satisfies a job is counts and VRAM, never a brand (see Need). */
|
|
public var gpus: [GPU]?
|
|
/** total RAM, bytes */
|
|
public var memory: Int64?
|
|
/** linux | darwin | windows */
|
|
public var os: String?
|
|
|
|
public init(arch: String? = nil, cpus: Int64? = nil, gpus: [GPU]? = nil, memory: Int64? = nil, os: String? = nil) {
|
|
self.arch = arch
|
|
self.cpus = cpus
|
|
self.gpus = gpus
|
|
self.memory = memory
|
|
self.os = os
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case arch
|
|
case cpus
|
|
case gpus
|
|
case memory
|
|
case os
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(arch, forKey: .arch)
|
|
try container.encodeIfPresent(cpus, forKey: .cpus)
|
|
try container.encodeIfPresent(gpus, forKey: .gpus)
|
|
try container.encodeIfPresent(memory, forKey: .memory)
|
|
try container.encodeIfPresent(os, forKey: .os)
|
|
}
|
|
}
|
|
|