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

71 lines
3.0 KiB
Swift

//
// Spend.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
public struct Spend: Sendable, Codable, ParameterConvertible, Hashable {
/** Available is false when the commerce ledger was unconfigured or unreachable. Every number below is then an honest zero, NOT a measured one. */
public var available: Bool?
/** AvailableCents is what of that balance is still spendable. */
public var availableCents: Int64?
/** BalanceCents is the prepaid wallet's balance, in US cents. */
public var balanceCents: Int64?
/** ByCategory is the window's spend split by ledger category, largest first. */
public var byCategory: [CategorySpend]?
/** MTDCents is commerce's authoritative month-to-date consumed figure, which is a different period from the window and is not derived from it. */
public var mtdCents: Int64?
/** OverageCents is month-to-date consumption beyond the plan's allowance. */
public var overageCents: Int64?
/** Series is the window's spend over time, gap-filled at the window's interval. */
public var series: [SpendPoint]?
/** Source names where the roll-up came from. */
public var source: String?
/** TotalCents is consumption over the requested window, in US cents. It is self-consistent with ByCategory and Series. */
public var totalCents: Int64?
public init(available: Bool? = nil, availableCents: Int64? = nil, balanceCents: Int64? = nil, byCategory: [CategorySpend]? = nil, mtdCents: Int64? = nil, overageCents: Int64? = nil, series: [SpendPoint]? = nil, source: String? = nil, totalCents: Int64? = nil) {
self.available = available
self.availableCents = availableCents
self.balanceCents = balanceCents
self.byCategory = byCategory
self.mtdCents = mtdCents
self.overageCents = overageCents
self.series = series
self.source = source
self.totalCents = totalCents
}
public enum CodingKeys: String, CodingKey, CaseIterable {
case available
case availableCents
case balanceCents
case byCategory
case mtdCents
case overageCents
case series
case source
case totalCents
}
// Encodable protocol methods
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(available, forKey: .available)
try container.encodeIfPresent(availableCents, forKey: .availableCents)
try container.encodeIfPresent(balanceCents, forKey: .balanceCents)
try container.encodeIfPresent(byCategory, forKey: .byCategory)
try container.encodeIfPresent(mtdCents, forKey: .mtdCents)
try container.encodeIfPresent(overageCents, forKey: .overageCents)
try container.encodeIfPresent(series, forKey: .series)
try container.encodeIfPresent(source, forKey: .source)
try container.encodeIfPresent(totalCents, forKey: .totalCents)
}
}