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
1.9 KiB
Swift
46 lines
1.9 KiB
Swift
//
|
|
// ResourceUsage.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct ResourceUsage: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** CostCents would be the window's spend in cents. Always null here — the money a run costs is the metering ledger's, joined by the run id, and repeating it from this side would be a second number that could disagree with the bill. */
|
|
public var costCents: Double?
|
|
/** CPUVcpuHours would be vCPU-hours over the window. Always null: this store holds agent definitions and run I/O, and nothing here meters a CPU. Null is the honest answer and 0 would be a claim. */
|
|
public var cpuVcpuHours: Double?
|
|
/** MemGbHours would be gigabyte-hours of memory. Always null, same reason. */
|
|
public var memGbHours: Double?
|
|
/** StorageIoBytes would be bytes moved to and from storage. Always null, same reason. */
|
|
public var storageIoBytes: Double?
|
|
|
|
public init(costCents: Double? = nil, cpuVcpuHours: Double? = nil, memGbHours: Double? = nil, storageIoBytes: Double? = nil) {
|
|
self.costCents = costCents
|
|
self.cpuVcpuHours = cpuVcpuHours
|
|
self.memGbHours = memGbHours
|
|
self.storageIoBytes = storageIoBytes
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case costCents
|
|
case cpuVcpuHours
|
|
case memGbHours
|
|
case storageIoBytes
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(costCents, forKey: .costCents)
|
|
try container.encodeIfPresent(cpuVcpuHours, forKey: .cpuVcpuHours)
|
|
try container.encodeIfPresent(memGbHours, forKey: .memGbHours)
|
|
try container.encodeIfPresent(storageIoBytes, forKey: .storageIoBytes)
|
|
}
|
|
}
|
|
|