Files
zeekay 1df3ddf6bd Regenerate against the document the deployment answers for
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.
2026-09-05 18:55:38 -07:00

59 lines
3.1 KiB
Swift

//
// Leased.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
public struct Leased: Sendable, Codable, ParameterConvertible, Hashable {
/** Class is what was actually leased, from the closed set LeaseIn.Class names: exec | dev | desktop | android. A request that named none leased an `exec`, so this is where a caller learns which kind of computer it is holding, and it is what Workdir below follows from. */
public var _class: String?
/** Cluster is the attached cluster this sandbox runs on, when one was named. Empty is the home cluster. */
public var cluster: String?
/** ID names this computer for every later call — run, read, write, stop and end all take it, and a LeaseIn carrying it resumes THIS sandbox instead of leasing a second one. Minted here; a caller cannot choose it, and a resumed lease that had expired comes back under a new one. */
public var id: String?
/** Runtime is the boundary this sandbox GOT, which need not be the one asked for — carried for the same reason Workdir is, that it is a fact only the owner knows and a caller assuming it would be holding a second copy. Empty is the node's default runtime, and a real answer. */
public var runtime: String?
/** Status is where the pod stands, from the store's three: pending | running | error. A lease that ANSWERS has already waited for the pod, so this reads `running` — a start that failed is a 503 and no sandbox at all. Read it anyway: exec refuses a sandbox that is not running, so anything else here is the reason the next call will not work. */
public var status: String?
/** Workdir is the absolute directory this sandbox keeps files in, and what a relative path in a later read, write or run resolves against — /work for dev, desktop and android (the project volume's mount point), /mnt/data for exec (the artifact directory the code tool tells the model to write to). A path that climbs above it is refused rather than rewritten. */
public var workdir: String?
public init(_class: String? = nil, cluster: String? = nil, id: String? = nil, runtime: String? = nil, status: String? = nil, workdir: String? = nil) {
self._class = _class
self.cluster = cluster
self.id = id
self.runtime = runtime
self.status = status
self.workdir = workdir
}
public enum CodingKeys: String, CodingKey, CaseIterable {
case _class = "class"
case cluster
case id
case runtime
case status
case workdir
}
// Encodable protocol methods
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(_class, forKey: ._class)
try container.encodeIfPresent(cluster, forKey: .cluster)
try container.encodeIfPresent(id, forKey: .id)
try container.encodeIfPresent(runtime, forKey: .runtime)
try container.encodeIfPresent(status, forKey: .status)
try container.encodeIfPresent(workdir, forKey: .workdir)
}
}
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
extension Leased: Identifiable {}