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.
51 lines
2.2 KiB
Swift
51 lines
2.2 KiB
Swift
//
|
|
// Redemption.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Redemption: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Code is the promo redeemed. */
|
|
public var code: String?
|
|
/** DiscountCents is the month-one discount this redemption CLAIMS, in USD cents. It is a recorded figure, NOT a balance: nothing was credited and no wallet moved. An admin granting against this claim is what would make it money, and that decision happens on the admin surface, not here. */
|
|
public var discountCents: Int64?
|
|
/** Plan is the tier redeemed against: pro, max or team. It is DERIVED from the org's live ACTIVE/TRIALING subscription, never read from the request, so it is what the org actually holds rather than what it claimed. */
|
|
public var plan: String?
|
|
/** RedeemedAt is unix seconds. */
|
|
public var redeemedAt: Int64?
|
|
/** Seats is the seat count the claim was priced at, and it is ALWAYS 1. No server-side authority on this surface answers \"how many seats\", and the caller's own number is exactly the input that once inflated these claims, so a redemption records the single-seat floor and an admin resolves the real count against subscription data at grant time. */
|
|
public var seats: Int64?
|
|
|
|
public init(code: String? = nil, discountCents: Int64? = nil, plan: String? = nil, redeemedAt: Int64? = nil, seats: Int64? = nil) {
|
|
self.code = code
|
|
self.discountCents = discountCents
|
|
self.plan = plan
|
|
self.redeemedAt = redeemedAt
|
|
self.seats = seats
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case code
|
|
case discountCents
|
|
case plan
|
|
case redeemedAt
|
|
case seats
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(code, forKey: .code)
|
|
try container.encodeIfPresent(discountCents, forKey: .discountCents)
|
|
try container.encodeIfPresent(plan, forKey: .plan)
|
|
try container.encodeIfPresent(redeemedAt, forKey: .redeemedAt)
|
|
try container.encodeIfPresent(seats, forKey: .seats)
|
|
}
|
|
}
|
|
|