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.
61 lines
2.5 KiB
Swift
61 lines
2.5 KiB
Swift
//
|
|
// PnL.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct PnL: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Expense is the cost lines that moved in the period, one per account. */
|
|
public var expense: [PnLLine]?
|
|
/** From opens the period and is EXCLUSIVE — movement strictly after it, matching the trial balance's opening boundary so the two reports agree on what belongs to a period. Absent means from the beginning of the ledger. */
|
|
public var from: String?
|
|
/** Income is the revenue lines that moved in the period, one per account. Accounts that did not move are omitted rather than listed at zero. */
|
|
public var income: [PnLLine]?
|
|
/** NetIncome is totalIncome minus totalExpense, in cents. Negative is a loss. */
|
|
public var netIncome: Int64?
|
|
/** To closes the period and is inclusive. Absent means up to now. */
|
|
public var to: String?
|
|
/** TotalExpense is cost MATCHED to that revenue, in cents, including accrued infrastructure that has not been billed yet. */
|
|
public var totalExpense: Int64?
|
|
/** TotalIncome is revenue RECOGNIZED in the period, in cents — accrual, not cash, so a prepaid top-up is not in it until the credit is consumed. */
|
|
public var totalIncome: Int64?
|
|
|
|
public init(expense: [PnLLine]? = nil, from: String? = nil, income: [PnLLine]? = nil, netIncome: Int64? = nil, to: String? = nil, totalExpense: Int64? = nil, totalIncome: Int64? = nil) {
|
|
self.expense = expense
|
|
self.from = from
|
|
self.income = income
|
|
self.netIncome = netIncome
|
|
self.to = to
|
|
self.totalExpense = totalExpense
|
|
self.totalIncome = totalIncome
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case expense
|
|
case from
|
|
case income
|
|
case netIncome
|
|
case to
|
|
case totalExpense
|
|
case totalIncome
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(expense, forKey: .expense)
|
|
try container.encodeIfPresent(from, forKey: .from)
|
|
try container.encodeIfPresent(income, forKey: .income)
|
|
try container.encodeIfPresent(netIncome, forKey: .netIncome)
|
|
try container.encodeIfPresent(to, forKey: .to)
|
|
try container.encodeIfPresent(totalExpense, forKey: .totalExpense)
|
|
try container.encodeIfPresent(totalIncome, forKey: .totalIncome)
|
|
}
|
|
}
|
|
|