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.
71 lines
3.5 KiB
Swift
71 lines
3.5 KiB
Swift
//
|
|
// GraphFact.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct GraphFact: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** At is when the thing was so, RFC 3339. Required, and refused when it sits more than five minutes ahead of the server clock — an assertion dated further out would never mature and would skew every read until it did. */
|
|
public var at: String?
|
|
/** Confidence in [0,1]. A tie-breaker within the order, never a substitute for it. Absent is 0, the weakest an assertion can be. */
|
|
public var confidence: Double?
|
|
/** Entity is the thing being described, in the organization's own namespace. It is not created: an entity exists because something was asserted about it. Required, 512 bytes at most. */
|
|
public var entity: String?
|
|
/** Evidence points at the record this claim came from, 512 bytes at most. An assertion without one is admitted and carries no defence. */
|
|
public var evidence: String?
|
|
/** Names says the value is an entity. A walk reads only the edges, so this is a declaration and never a guess about the value's shape. */
|
|
public var names: Bool?
|
|
/** Relation is what is being asserted — `depends`, `owner`, `same`, `title`. It is open: this plane holds no vocabulary of its own. Required, 128 bytes at most. */
|
|
public var relation: String?
|
|
/** Seen is when this assertion became knowable, RFC 3339. Defaults to At and may not precede it. It is provenance and it decides nothing: the instant every read uses is derived as the later of Seen and the server's own clock. */
|
|
public var seen: String?
|
|
/** Source names who asserted. Required, because an assertion nobody is named for cannot be weighed against one that is. Open text: this plane ranks no source above another. */
|
|
public var source: String?
|
|
/** Value is what the relation points at. When Names is true it is another entity's key and the assertion is an EDGE; otherwise it is a scalar and the assertion is a property. 2048 bytes at most, or 512 when it names an entity. */
|
|
public var value: String?
|
|
|
|
public init(at: String? = nil, confidence: Double? = nil, entity: String? = nil, evidence: String? = nil, names: Bool? = nil, relation: String? = nil, seen: String? = nil, source: String? = nil, value: String? = nil) {
|
|
self.at = at
|
|
self.confidence = confidence
|
|
self.entity = entity
|
|
self.evidence = evidence
|
|
self.names = names
|
|
self.relation = relation
|
|
self.seen = seen
|
|
self.source = source
|
|
self.value = value
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case at
|
|
case confidence
|
|
case entity
|
|
case evidence
|
|
case names
|
|
case relation
|
|
case seen
|
|
case source
|
|
case value
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(at, forKey: .at)
|
|
try container.encodeIfPresent(confidence, forKey: .confidence)
|
|
try container.encodeIfPresent(entity, forKey: .entity)
|
|
try container.encodeIfPresent(evidence, forKey: .evidence)
|
|
try container.encodeIfPresent(names, forKey: .names)
|
|
try container.encodeIfPresent(relation, forKey: .relation)
|
|
try container.encodeIfPresent(seen, forKey: .seen)
|
|
try container.encodeIfPresent(source, forKey: .source)
|
|
try container.encodeIfPresent(value, forKey: .value)
|
|
}
|
|
}
|
|
|