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.
46 lines
2.0 KiB
Swift
46 lines
2.0 KiB
Swift
//
|
|
// StateGraph.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct StateGraph: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Initial is the state a fresh document starts in — \"draft\". A stored document with no status at all is read as this too. */
|
|
public var initial: String?
|
|
/** Live is the ONE state that is publicly readable — \"published\". The site pulls only documents in it, so reaching Live IS site-publish; every other state is invisible to a reader. */
|
|
public var live: String?
|
|
/** States is every lifecycle state in canonical order: draft, in_review, approved, queued, published, archived. The console lays its board columns out in exactly this order, so the order is part of the answer. */
|
|
public var states: [String]?
|
|
/** Transitions maps each state to the states it may move to. A target absent from a state's list is REFUSED, at the endpoint and again at the storage boundary — this is the whole rule, not a hint for the UI. A state never lists itself; a move that changes nothing is always legal. */
|
|
public var transitions: [String: [String]]?
|
|
|
|
public init(initial: String? = nil, live: String? = nil, states: [String]? = nil, transitions: [String: [String]]? = nil) {
|
|
self.initial = initial
|
|
self.live = live
|
|
self.states = states
|
|
self.transitions = transitions
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case initial
|
|
case live
|
|
case states
|
|
case transitions
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(initial, forKey: .initial)
|
|
try container.encodeIfPresent(live, forKey: .live)
|
|
try container.encodeIfPresent(states, forKey: .states)
|
|
try container.encodeIfPresent(transitions, forKey: .transitions)
|
|
}
|
|
}
|
|
|