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.
76 lines
2.9 KiB
Swift
76 lines
2.9 KiB
Swift
//
|
|
// DashResp.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct DashResp: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Account is the linked account that was asked about, when one was named. */
|
|
public var account: String?
|
|
/** Available is false when the warehouse could not be read. That means \"no answer\", NOT \"no usage\" — the two lists below are then empty for a reason. */
|
|
public var available: Bool?
|
|
/** Current is the newest window instance of each lane — the dash headline. */
|
|
public var current: [UsageWindowView]?
|
|
/** From is the inclusive start of that window, RFC3339 UTC. */
|
|
public var from: String?
|
|
/** Provider is the upstream that was asked about, echoed back. */
|
|
public var provider: String?
|
|
/** Range is the window that was served: 1h, 24h, 7d or 30d. */
|
|
public var range: String?
|
|
/** Scope says whose rows these are: the caller's own linked accounts. */
|
|
public var scope: String?
|
|
/** Source names the meter of record — the provider's own login, not Hanzo. */
|
|
public var source: String?
|
|
/** To is the exclusive end of that window, RFC3339 UTC. */
|
|
public var to: String?
|
|
/** Windows is every instance in range, newest first — the history behind it. */
|
|
public var windows: [UsageWindowView]?
|
|
|
|
public init(account: String? = nil, available: Bool? = nil, current: [UsageWindowView]? = nil, from: String? = nil, provider: String? = nil, range: String? = nil, scope: String? = nil, source: String? = nil, to: String? = nil, windows: [UsageWindowView]? = nil) {
|
|
self.account = account
|
|
self.available = available
|
|
self.current = current
|
|
self.from = from
|
|
self.provider = provider
|
|
self.range = range
|
|
self.scope = scope
|
|
self.source = source
|
|
self.to = to
|
|
self.windows = windows
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case account
|
|
case available
|
|
case current
|
|
case from
|
|
case provider
|
|
case range
|
|
case scope
|
|
case source
|
|
case to
|
|
case windows
|
|
}
|
|
|
|
// 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(available, forKey: .available)
|
|
try container.encodeIfPresent(current, forKey: .current)
|
|
try container.encodeIfPresent(from, forKey: .from)
|
|
try container.encodeIfPresent(provider, forKey: .provider)
|
|
try container.encodeIfPresent(range, forKey: .range)
|
|
try container.encodeIfPresent(scope, forKey: .scope)
|
|
try container.encodeIfPresent(source, forKey: .source)
|
|
try container.encodeIfPresent(to, forKey: .to)
|
|
try container.encodeIfPresent(windows, forKey: .windows)
|
|
}
|
|
}
|
|
|