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.
103 lines
4.1 KiB
Swift
103 lines
4.1 KiB
Swift
//
|
|
// LinkView.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct LinkView: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Account is the provider-side account identifier, when the collector knows it. */
|
|
public var account: String?
|
|
/** Billing is how this account's inference bills — plan (the user's own subscription, metered here for visibility only) or commerce (the gateway path). Derived from Kind, never stored. */
|
|
public var billing: String?
|
|
/** CreatedAt is when the link was first registered, RFC 3339 UTC. */
|
|
public var createdAt: String?
|
|
/** Host is the machine's human hostname label, from its most recent report. */
|
|
public var host: String?
|
|
/** ID is the link's opaque handle (\"link_\" + 32 hex chars). */
|
|
public var id: String?
|
|
/** Kind is how the account authenticates: subscription or apikey. */
|
|
public var kind: String?
|
|
/** LastSeen is when the account last reported, RFC 3339 UTC. */
|
|
public var lastSeen: String?
|
|
/** Machine is the stable machine identifier the collector reports. */
|
|
public var machine: String?
|
|
/** OS is the machine's operating system label. */
|
|
public var os: String?
|
|
/** Plan is the provider plan label (e.g. \"Claude Max\"). */
|
|
public var plan: String?
|
|
/** Provider is the AI provider this account belongs to (claude, openai, hanzo…). */
|
|
public var provider: String?
|
|
/** Status is linked or revoked. Revoked rows are retained for history. */
|
|
public var status: String?
|
|
/** UpdatedAt is when the link was last refreshed, RFC 3339 UTC. */
|
|
public var updatedAt: String?
|
|
public var usage: JSONValue?
|
|
/** User is the owning subject — the validated caller who registered the link. */
|
|
public var user: String?
|
|
|
|
public init(account: String? = nil, billing: String? = nil, createdAt: String? = nil, host: String? = nil, id: String? = nil, kind: String? = nil, lastSeen: String? = nil, machine: String? = nil, os: String? = nil, plan: String? = nil, provider: String? = nil, status: String? = nil, updatedAt: String? = nil, usage: JSONValue? = nil, user: String? = nil) {
|
|
self.account = account
|
|
self.billing = billing
|
|
self.createdAt = createdAt
|
|
self.host = host
|
|
self.id = id
|
|
self.kind = kind
|
|
self.lastSeen = lastSeen
|
|
self.machine = machine
|
|
self.os = os
|
|
self.plan = plan
|
|
self.provider = provider
|
|
self.status = status
|
|
self.updatedAt = updatedAt
|
|
self.usage = usage
|
|
self.user = user
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case account
|
|
case billing
|
|
case createdAt
|
|
case host
|
|
case id
|
|
case kind
|
|
case lastSeen
|
|
case machine
|
|
case os
|
|
case plan
|
|
case provider
|
|
case status
|
|
case updatedAt
|
|
case usage
|
|
case user
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(account, forKey: .account)
|
|
try container.encodeIfPresent(billing, forKey: .billing)
|
|
try container.encodeIfPresent(createdAt, forKey: .createdAt)
|
|
try container.encodeIfPresent(host, forKey: .host)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(kind, forKey: .kind)
|
|
try container.encodeIfPresent(lastSeen, forKey: .lastSeen)
|
|
try container.encodeIfPresent(machine, forKey: .machine)
|
|
try container.encodeIfPresent(os, forKey: .os)
|
|
try container.encodeIfPresent(plan, forKey: .plan)
|
|
try container.encodeIfPresent(provider, forKey: .provider)
|
|
try container.encodeIfPresent(status, forKey: .status)
|
|
try container.encodeIfPresent(updatedAt, forKey: .updatedAt)
|
|
try container.encodeIfPresent(usage, forKey: .usage)
|
|
try container.encodeIfPresent(user, forKey: .user)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension LinkView: Identifiable {}
|