Files
zeekay 1df3ddf6bd Regenerate against the document the deployment answers for
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.
2026-09-05 18:55:38 -07:00

56 lines
2.2 KiB
Swift

//
// Allowance.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
public struct Allowance: Sendable, Codable, ParameterConvertible, Hashable {
/** calls the plan allows per period; 0 = unbounded */
public var limit: Int64?
/** the tier the limit came from */
public var plan: String?
/** unix seconds; when THAT window starts again */
public var resets: Int64?
/** the subject is at the limit */
public var spent: Bool?
/** Used is how many zero-priced calls this subject has been SERVED in the period ending at Resets — the UTC calendar day. Only a served call counts, so an admission check, a refusal, or a vendor that never answered leaves it where it stood. It stops AT Limit rather than climbing past it, so Limit-Used is what remains and never goes negative. */
public var used: Int64?
/** Window is which ceiling these numbers describe — \"hour\" or \"day\" — because a caller is held to both and only one of them is the answer. It is the window that REFUSED where one did, and otherwise the one with least left, so Limit-Used is always the number that will actually stop them next. Empty where no window bounds the subject at all. */
public var window: String?
public init(limit: Int64? = nil, plan: String? = nil, resets: Int64? = nil, spent: Bool? = nil, used: Int64? = nil, window: String? = nil) {
self.limit = limit
self.plan = plan
self.resets = resets
self.spent = spent
self.used = used
self.window = window
}
public enum CodingKeys: String, CodingKey, CaseIterable {
case limit
case plan
case resets
case spent
case used
case window
}
// Encodable protocol methods
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(limit, forKey: .limit)
try container.encodeIfPresent(plan, forKey: .plan)
try container.encodeIfPresent(resets, forKey: .resets)
try container.encodeIfPresent(spent, forKey: .spent)
try container.encodeIfPresent(used, forKey: .used)
try container.encodeIfPresent(window, forKey: .window)
}
}