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.
89 lines
3.5 KiB
Swift
89 lines
3.5 KiB
Swift
//
|
|
// Invoice.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Invoice: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** AmountDueCents is what remains collectible. */
|
|
public var amountDueCents: Int64?
|
|
/** AmountPaidCents is what has been collected so far. */
|
|
public var amountPaidCents: Int64?
|
|
/** CreatedAt is when the draft was raised, RFC3339. */
|
|
public var createdAt: String?
|
|
/** Currency is the ISO 4217 code. */
|
|
public var currency: String?
|
|
/** CustomerEmail is where it is sent. */
|
|
public var customerEmail: String?
|
|
/** ID is the invoice id — what the issue, collect and void ops address. */
|
|
public var id: String?
|
|
/** Lines are the charges on the invoice. */
|
|
public var lines: [InvoiceLine]?
|
|
/** Number is the human-facing invoice number, e.g. \"INV-0042\". A draft has none; issuing assigns it. */
|
|
public var number: String?
|
|
/** PaymentRef is the processor reference for the collection, once paid. */
|
|
public var paymentRef: String?
|
|
/** Status is draft, open, paid, void or uncollectible. A draft is not collectible; issuing moves it to open. */
|
|
public var status: String?
|
|
/** SubtotalCents is the sum of the lines. */
|
|
public var subtotalCents: Int64?
|
|
/** UserID is the customer billed. */
|
|
public var userId: String?
|
|
|
|
public init(amountDueCents: Int64? = nil, amountPaidCents: Int64? = nil, createdAt: String? = nil, currency: String? = nil, customerEmail: String? = nil, id: String? = nil, lines: [InvoiceLine]? = nil, number: String? = nil, paymentRef: String? = nil, status: String? = nil, subtotalCents: Int64? = nil, userId: String? = nil) {
|
|
self.amountDueCents = amountDueCents
|
|
self.amountPaidCents = amountPaidCents
|
|
self.createdAt = createdAt
|
|
self.currency = currency
|
|
self.customerEmail = customerEmail
|
|
self.id = id
|
|
self.lines = lines
|
|
self.number = number
|
|
self.paymentRef = paymentRef
|
|
self.status = status
|
|
self.subtotalCents = subtotalCents
|
|
self.userId = userId
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case amountDueCents
|
|
case amountPaidCents
|
|
case createdAt
|
|
case currency
|
|
case customerEmail
|
|
case id
|
|
case lines
|
|
case number
|
|
case paymentRef
|
|
case status
|
|
case subtotalCents
|
|
case userId
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(amountDueCents, forKey: .amountDueCents)
|
|
try container.encodeIfPresent(amountPaidCents, forKey: .amountPaidCents)
|
|
try container.encodeIfPresent(createdAt, forKey: .createdAt)
|
|
try container.encodeIfPresent(currency, forKey: .currency)
|
|
try container.encodeIfPresent(customerEmail, forKey: .customerEmail)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(lines, forKey: .lines)
|
|
try container.encodeIfPresent(number, forKey: .number)
|
|
try container.encodeIfPresent(paymentRef, forKey: .paymentRef)
|
|
try container.encodeIfPresent(status, forKey: .status)
|
|
try container.encodeIfPresent(subtotalCents, forKey: .subtotalCents)
|
|
try container.encodeIfPresent(userId, forKey: .userId)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension Invoice: Identifiable {}
|