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.
78 lines
3.0 KiB
Swift
78 lines
3.0 KiB
Swift
//
|
|
// InvoiceLineItem.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct InvoiceLineItem: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
public var amount: Int64?
|
|
public var currency: String?
|
|
public var description: String?
|
|
public var id: String?
|
|
public var meterId: String?
|
|
public var periodEnd: String?
|
|
/** The billed period. Both carry omitempty and neither is ever empty, which looks contradictory and is not: the shape they reproduce is a time value, and omitempty does nothing to a struct — so those keys render even for the zero instant. The adapter formats the zero instant rather than skipping it, which is what keeps the two wires the same. */
|
|
public var periodStart: String?
|
|
public var planId: String?
|
|
public var planName: String?
|
|
public var quantity: Int64?
|
|
public var type: String?
|
|
public var unitPrice: Int64?
|
|
|
|
public init(amount: Int64? = nil, currency: String? = nil, description: String? = nil, id: String? = nil, meterId: String? = nil, periodEnd: String? = nil, periodStart: String? = nil, planId: String? = nil, planName: String? = nil, quantity: Int64? = nil, type: String? = nil, unitPrice: Int64? = nil) {
|
|
self.amount = amount
|
|
self.currency = currency
|
|
self.description = description
|
|
self.id = id
|
|
self.meterId = meterId
|
|
self.periodEnd = periodEnd
|
|
self.periodStart = periodStart
|
|
self.planId = planId
|
|
self.planName = planName
|
|
self.quantity = quantity
|
|
self.type = type
|
|
self.unitPrice = unitPrice
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case amount
|
|
case currency
|
|
case description
|
|
case id
|
|
case meterId
|
|
case periodEnd
|
|
case periodStart
|
|
case planId
|
|
case planName
|
|
case quantity
|
|
case type
|
|
case unitPrice
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(amount, forKey: .amount)
|
|
try container.encodeIfPresent(currency, forKey: .currency)
|
|
try container.encodeIfPresent(description, forKey: .description)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(meterId, forKey: .meterId)
|
|
try container.encodeIfPresent(periodEnd, forKey: .periodEnd)
|
|
try container.encodeIfPresent(periodStart, forKey: .periodStart)
|
|
try container.encodeIfPresent(planId, forKey: .planId)
|
|
try container.encodeIfPresent(planName, forKey: .planName)
|
|
try container.encodeIfPresent(quantity, forKey: .quantity)
|
|
try container.encodeIfPresent(type, forKey: .type)
|
|
try container.encodeIfPresent(unitPrice, forKey: .unitPrice)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension InvoiceLineItem: Identifiable {}
|