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.
56 lines
2.4 KiB
Swift
56 lines
2.4 KiB
Swift
//
|
|
// SummaryResp.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct SummaryResp: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Account reports the linked-accounts ledger's own availability, so a partial answer never fabricates this half. It is scoped to the CALLER: the accounts they linked, metered from each provider's own login. */
|
|
public var account: SourceState?
|
|
/** From is when the window opens, RFC 3339 UTC. ONE resolver fixes it for both ledgers, so the account rows and the Hanzo rows always cover the same period — two resolvers could drift and turn the union into a lie. */
|
|
public var from: String?
|
|
/** Hanzo reports the same for the Hanzo-routed ledger, which is scoped to the ORG rather than the caller — a different question over the same window. The two are independent: either can be unavailable while the other answers, and Rows then carries only the half that did. */
|
|
public var hanzo: SourceState?
|
|
/** Range is the resolved period label. */
|
|
public var range: String?
|
|
/** Rows is the union of both ledgers, each row labelled by source and scope — concatenated, NEVER summed: a plan's percentage is not money. */
|
|
public var rows: [TotalView]?
|
|
/** To is where the window closes, EXCLUSIVE, RFC 3339 UTC — the instant the read was served. Shared by both ledgers, for the reason From gives. */
|
|
public var to: String?
|
|
|
|
public init(account: SourceState? = nil, from: String? = nil, hanzo: SourceState? = nil, range: String? = nil, rows: [TotalView]? = nil, to: String? = nil) {
|
|
self.account = account
|
|
self.from = from
|
|
self.hanzo = hanzo
|
|
self.range = range
|
|
self.rows = rows
|
|
self.to = to
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case account
|
|
case from
|
|
case hanzo
|
|
case range
|
|
case rows
|
|
case to
|
|
}
|
|
|
|
// 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(from, forKey: .from)
|
|
try container.encodeIfPresent(hanzo, forKey: .hanzo)
|
|
try container.encodeIfPresent(range, forKey: .range)
|
|
try container.encodeIfPresent(rows, forKey: .rows)
|
|
try container.encodeIfPresent(to, forKey: .to)
|
|
}
|
|
}
|
|
|