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.
51 lines
1.9 KiB
Swift
51 lines
1.9 KiB
Swift
//
|
|
// Voucher.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Voucher: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Description is the human line for the event, e.g. the vendor a bill came from. */
|
|
public var description: String?
|
|
/** Legs are the sides of the posting. They must balance: Σdebit == Σcredit, give or take the 2¢ round-off allowance. */
|
|
public var legs: [Leg]?
|
|
/** PostingAt is the RFC3339 instant the event posts at — the time every statement window filters on. */
|
|
public var postingAt: String?
|
|
/** SourceID is the source event's own id within that namespace. Together with SourceKind it is the key that makes a repeat posting a no-op. */
|
|
public var sourceId: String?
|
|
/** SourceKind is the idempotency namespace naming what booked this, e.g. \"scan\". */
|
|
public var sourceKind: String?
|
|
|
|
public init(description: String? = nil, legs: [Leg]? = nil, postingAt: String? = nil, sourceId: String? = nil, sourceKind: String? = nil) {
|
|
self.description = description
|
|
self.legs = legs
|
|
self.postingAt = postingAt
|
|
self.sourceId = sourceId
|
|
self.sourceKind = sourceKind
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case description
|
|
case legs
|
|
case postingAt
|
|
case sourceId
|
|
case sourceKind
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(description, forKey: .description)
|
|
try container.encodeIfPresent(legs, forKey: .legs)
|
|
try container.encodeIfPresent(postingAt, forKey: .postingAt)
|
|
try container.encodeIfPresent(sourceId, forKey: .sourceId)
|
|
try container.encodeIfPresent(sourceKind, forKey: .sourceKind)
|
|
}
|
|
}
|
|
|