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.
61 lines
2.6 KiB
Swift
61 lines
2.6 KiB
Swift
//
|
|
// AffiliateEarnings.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct AffiliateEarnings: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** AccruedCents is lifetime commission accrued, in cents. */
|
|
public var accruedCents: Int64?
|
|
/** ByPeriod is the per-period ledger: the margin earned against and the commission taken from it. */
|
|
public var byPeriod: [PeriodEarningView]?
|
|
/** ByReferredOrg is each referral's aggregate contribution — the affiliate's OWN share, never the referred org's spend. */
|
|
public var byReferredOrg: [OrgEarningView]?
|
|
/** IsAffiliate says whether the caller org has an affiliate record. On false it is the ONLY field present — there is no ledger to report, and the zeros you might expect are absent rather than reported as earnings of nothing. */
|
|
public var isAffiliate: Bool?
|
|
/** MarginBps is the platform gross-margin fraction commission is a rate OF. */
|
|
public var marginBps: Int64?
|
|
/** PaidCents is lifetime commission already paid out, in cents. */
|
|
public var paidCents: Int64?
|
|
/** PendingCents is accrued minus paid — what the platform still owes. */
|
|
public var pendingCents: Int64?
|
|
|
|
public init(accruedCents: Int64? = nil, byPeriod: [PeriodEarningView]? = nil, byReferredOrg: [OrgEarningView]? = nil, isAffiliate: Bool? = nil, marginBps: Int64? = nil, paidCents: Int64? = nil, pendingCents: Int64? = nil) {
|
|
self.accruedCents = accruedCents
|
|
self.byPeriod = byPeriod
|
|
self.byReferredOrg = byReferredOrg
|
|
self.isAffiliate = isAffiliate
|
|
self.marginBps = marginBps
|
|
self.paidCents = paidCents
|
|
self.pendingCents = pendingCents
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case accruedCents
|
|
case byPeriod
|
|
case byReferredOrg
|
|
case isAffiliate
|
|
case marginBps
|
|
case paidCents
|
|
case pendingCents
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(accruedCents, forKey: .accruedCents)
|
|
try container.encodeIfPresent(byPeriod, forKey: .byPeriod)
|
|
try container.encodeIfPresent(byReferredOrg, forKey: .byReferredOrg)
|
|
try container.encodeIfPresent(isAffiliate, forKey: .isAffiliate)
|
|
try container.encodeIfPresent(marginBps, forKey: .marginBps)
|
|
try container.encodeIfPresent(paidCents, forKey: .paidCents)
|
|
try container.encodeIfPresent(pendingCents, forKey: .pendingCents)
|
|
}
|
|
}
|
|
|