mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The projection these were generated from predated the compute migration, so they described /v1/visor — which the API serves at zero paths now. No /v1/visor path survives here.
121 lines
5.6 KiB
Swift
121 lines
5.6 KiB
Swift
//
|
||
// UsageWindowView.swift
|
||
//
|
||
// Generated by openapi-generator
|
||
// https://openapi-generator.tech
|
||
//
|
||
|
||
import Foundation
|
||
|
||
public struct UsageWindowView: Sendable, Codable, ParameterConvertible, Hashable {
|
||
|
||
/** Account is the linked provider account the window belongs to. */
|
||
public var account: String?
|
||
/** CachedInputTokens is the prompt tokens served from the provider's cache; omitted when unknown. */
|
||
public var cachedInputTokens: Int64?
|
||
/** Confidence says how much the counters beside it mean — a meter that reported only a percentage leaves them at zero, and this is how a reader tells that from a true zero. */
|
||
public var confidence: String?
|
||
/** CostCents is what the window cost on the PROVIDER's own plan, in US cents. It is not a Hanzo charge. */
|
||
public var costCents: Int64?
|
||
/** CostLimitCents is the plan's spend ceiling for the window, in US cents. */
|
||
public var costLimitCents: Int64?
|
||
/** Currency is the provider's currency when it is not US cents. */
|
||
public var currency: String?
|
||
/** InputTokens is prompt tokens consumed in the window; omitted when unknown. */
|
||
public var inputTokens: Int64?
|
||
/** Lane is the meter lane this instance belongs to, e.g. a provider's own rolling-window meter. */
|
||
public var lane: String?
|
||
/** Machine is the host whose meter reported the window. */
|
||
public var machine: String?
|
||
/** OutputTokens is completion tokens produced in the window; omitted when unknown. */
|
||
public var outputTokens: Int64?
|
||
/** Plan is the subscription plan the account is on, as the provider names it. */
|
||
public var plan: String?
|
||
/** Requests is how many requests were made in the window; omitted when the meter did not report it. */
|
||
public var requests: Int64?
|
||
/** ResetsAt is when this window rolls over, RFC3339 UTC; omitted when unknown. */
|
||
public var resetsAt: String?
|
||
/** Synthetic marks an instance the meter inferred rather than read. */
|
||
public var synthetic: Bool?
|
||
/** TotalTokens is the window's total tokens; omitted when unknown. */
|
||
public var totalTokens: Int64?
|
||
/** UsedPct is how much of the window's allowance is consumed, 0–100. */
|
||
public var usedPct: Double?
|
||
/** Window is the window class: 6h, day, week or month. */
|
||
public var window: String?
|
||
/** WindowMinutes is the window's real length in minutes when the meter reported one; omitted when it did not. */
|
||
public var windowMinutes: Int?
|
||
/** WindowStart is when this window opened, RFC3339 UTC; omitted when unknown. */
|
||
public var windowStart: String?
|
||
|
||
public init(account: String? = nil, cachedInputTokens: Int64? = nil, confidence: String? = nil, costCents: Int64? = nil, costLimitCents: Int64? = nil, currency: String? = nil, inputTokens: Int64? = nil, lane: String? = nil, machine: String? = nil, outputTokens: Int64? = nil, plan: String? = nil, requests: Int64? = nil, resetsAt: String? = nil, synthetic: Bool? = nil, totalTokens: Int64? = nil, usedPct: Double? = nil, window: String? = nil, windowMinutes: Int? = nil, windowStart: String? = nil) {
|
||
self.account = account
|
||
self.cachedInputTokens = cachedInputTokens
|
||
self.confidence = confidence
|
||
self.costCents = costCents
|
||
self.costLimitCents = costLimitCents
|
||
self.currency = currency
|
||
self.inputTokens = inputTokens
|
||
self.lane = lane
|
||
self.machine = machine
|
||
self.outputTokens = outputTokens
|
||
self.plan = plan
|
||
self.requests = requests
|
||
self.resetsAt = resetsAt
|
||
self.synthetic = synthetic
|
||
self.totalTokens = totalTokens
|
||
self.usedPct = usedPct
|
||
self.window = window
|
||
self.windowMinutes = windowMinutes
|
||
self.windowStart = windowStart
|
||
}
|
||
|
||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||
case account
|
||
case cachedInputTokens
|
||
case confidence
|
||
case costCents
|
||
case costLimitCents
|
||
case currency
|
||
case inputTokens
|
||
case lane
|
||
case machine
|
||
case outputTokens
|
||
case plan
|
||
case requests
|
||
case resetsAt
|
||
case synthetic
|
||
case totalTokens
|
||
case usedPct
|
||
case window
|
||
case windowMinutes
|
||
case windowStart
|
||
}
|
||
|
||
// 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(cachedInputTokens, forKey: .cachedInputTokens)
|
||
try container.encodeIfPresent(confidence, forKey: .confidence)
|
||
try container.encodeIfPresent(costCents, forKey: .costCents)
|
||
try container.encodeIfPresent(costLimitCents, forKey: .costLimitCents)
|
||
try container.encodeIfPresent(currency, forKey: .currency)
|
||
try container.encodeIfPresent(inputTokens, forKey: .inputTokens)
|
||
try container.encodeIfPresent(lane, forKey: .lane)
|
||
try container.encodeIfPresent(machine, forKey: .machine)
|
||
try container.encodeIfPresent(outputTokens, forKey: .outputTokens)
|
||
try container.encodeIfPresent(plan, forKey: .plan)
|
||
try container.encodeIfPresent(requests, forKey: .requests)
|
||
try container.encodeIfPresent(resetsAt, forKey: .resetsAt)
|
||
try container.encodeIfPresent(synthetic, forKey: .synthetic)
|
||
try container.encodeIfPresent(totalTokens, forKey: .totalTokens)
|
||
try container.encodeIfPresent(usedPct, forKey: .usedPct)
|
||
try container.encodeIfPresent(window, forKey: .window)
|
||
try container.encodeIfPresent(windowMinutes, forKey: .windowMinutes)
|
||
try container.encodeIfPresent(windowStart, forKey: .windowStart)
|
||
}
|
||
}
|
||
|