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.
102 lines
4.1 KiB
Swift
102 lines
4.1 KiB
Swift
//
|
|
// Subscription.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Subscription: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
public var cancelAtPeriodEnd: Bool?
|
|
public var canceledAt: String?
|
|
public var createdAt: String?
|
|
public var currentPeriodEnd: String?
|
|
public var currentPeriodStart: String?
|
|
public var defaultPaymentMethod: String?
|
|
public var endedAt: String?
|
|
public var id: String?
|
|
/** MRRCents is what this subscription contributes per month — commerce's own figure, interval-normalized and multiplied by its seats, so no reader re-derives it from price and interval. */
|
|
public var mrrCents: Int64?
|
|
public var plan: SubscriptionPlan?
|
|
public var planId: String?
|
|
public var providerType: String?
|
|
public var quantity: Int64?
|
|
public var status: String?
|
|
public var trialEnd: String?
|
|
public var trialStart: String?
|
|
public var updatedAt: String?
|
|
public var userId: String?
|
|
|
|
public init(cancelAtPeriodEnd: Bool? = nil, canceledAt: String? = nil, createdAt: String? = nil, currentPeriodEnd: String? = nil, currentPeriodStart: String? = nil, defaultPaymentMethod: String? = nil, endedAt: String? = nil, id: String? = nil, mrrCents: Int64? = nil, plan: SubscriptionPlan? = nil, planId: String? = nil, providerType: String? = nil, quantity: Int64? = nil, status: String? = nil, trialEnd: String? = nil, trialStart: String? = nil, updatedAt: String? = nil, userId: String? = nil) {
|
|
self.cancelAtPeriodEnd = cancelAtPeriodEnd
|
|
self.canceledAt = canceledAt
|
|
self.createdAt = createdAt
|
|
self.currentPeriodEnd = currentPeriodEnd
|
|
self.currentPeriodStart = currentPeriodStart
|
|
self.defaultPaymentMethod = defaultPaymentMethod
|
|
self.endedAt = endedAt
|
|
self.id = id
|
|
self.mrrCents = mrrCents
|
|
self.plan = plan
|
|
self.planId = planId
|
|
self.providerType = providerType
|
|
self.quantity = quantity
|
|
self.status = status
|
|
self.trialEnd = trialEnd
|
|
self.trialStart = trialStart
|
|
self.updatedAt = updatedAt
|
|
self.userId = userId
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case cancelAtPeriodEnd
|
|
case canceledAt
|
|
case createdAt
|
|
case currentPeriodEnd
|
|
case currentPeriodStart
|
|
case defaultPaymentMethod
|
|
case endedAt
|
|
case id
|
|
case mrrCents
|
|
case plan
|
|
case planId
|
|
case providerType
|
|
case quantity
|
|
case status
|
|
case trialEnd
|
|
case trialStart
|
|
case updatedAt
|
|
case userId
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(cancelAtPeriodEnd, forKey: .cancelAtPeriodEnd)
|
|
try container.encodeIfPresent(canceledAt, forKey: .canceledAt)
|
|
try container.encodeIfPresent(createdAt, forKey: .createdAt)
|
|
try container.encodeIfPresent(currentPeriodEnd, forKey: .currentPeriodEnd)
|
|
try container.encodeIfPresent(currentPeriodStart, forKey: .currentPeriodStart)
|
|
try container.encodeIfPresent(defaultPaymentMethod, forKey: .defaultPaymentMethod)
|
|
try container.encodeIfPresent(endedAt, forKey: .endedAt)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(mrrCents, forKey: .mrrCents)
|
|
try container.encodeIfPresent(plan, forKey: .plan)
|
|
try container.encodeIfPresent(planId, forKey: .planId)
|
|
try container.encodeIfPresent(providerType, forKey: .providerType)
|
|
try container.encodeIfPresent(quantity, forKey: .quantity)
|
|
try container.encodeIfPresent(status, forKey: .status)
|
|
try container.encodeIfPresent(trialEnd, forKey: .trialEnd)
|
|
try container.encodeIfPresent(trialStart, forKey: .trialStart)
|
|
try container.encodeIfPresent(updatedAt, forKey: .updatedAt)
|
|
try container.encodeIfPresent(userId, forKey: .userId)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension Subscription: Identifiable {}
|