Files
swift-sdk/Sources/Hanzo/Models/AffiliateStanding.swift
zeekay 1df3ddf6bd Regenerate against the document the deployment answers for
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.
2026-09-05 18:55:38 -07:00

104 lines
4.9 KiB
Swift

//
// AffiliateStanding.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
public struct AffiliateStanding: Sendable, Codable, ParameterConvertible, Hashable {
/** AccruedCents is lifetime commission accrued, in cents. */
public var accruedCents: Int64?
/** Code is the minted referral code; empty until staff approve. */
public var code: String?
/** DefaultRateBps is the direct rate a new affiliate would get, answered only to a caller that has not applied. */
public var defaultRateBps: Int64?
/** Handle is the opt-in public leaderboard name; empty means opted out. */
public var handle: String?
/** ID is the affiliate's server-minted handle, \"aff_\"-prefixed — what staff approve, suspend, re-rate and pay against. Absent until the org applies. */
public var id: String?
/** IsAffiliate says whether the caller org has an affiliate record at all. It is the ONE field an org that never applied gets besides defaultRateBps: on false, read nothing else here — every other field is absent, not zero. */
public var isAffiliate: Bool?
/** Link is the shareable ?aff URL; empty until a code is minted. */
public var link: String?
/** 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?
/** Payouts is the payout history, newest rows bounded. */
public var payouts: [Remittance]?
/** PendingCents is accrued minus paid — what the platform still owes. */
public var pendingCents: Int64?
/** RateBps is the affiliate's own direct commission rate, in basis points. */
public var rateBps: Int64?
/** ReferredCount is how many orgs this affiliate has referred. */
public var referredCount: Int64?
/** RequestedCode is the vanity code asked for at apply time — a request, not an allocation. Approval mints `code`, which may be a different slug if this one was already taken. */
public var requestedCode: String?
/** Status is \"applied\", \"approved\" or \"suspended\". Only an approved affiliate has a code that resolves for attribution and accrues commission; suspended keeps what it already earned but stops earning more. */
public var status: String?
public init(accruedCents: Int64? = nil, code: String? = nil, defaultRateBps: Int64? = nil, handle: String? = nil, id: String? = nil, isAffiliate: Bool? = nil, link: String? = nil, marginBps: Int64? = nil, paidCents: Int64? = nil, payouts: [Remittance]? = nil, pendingCents: Int64? = nil, rateBps: Int64? = nil, referredCount: Int64? = nil, requestedCode: String? = nil, status: String? = nil) {
self.accruedCents = accruedCents
self.code = code
self.defaultRateBps = defaultRateBps
self.handle = handle
self.id = id
self.isAffiliate = isAffiliate
self.link = link
self.marginBps = marginBps
self.paidCents = paidCents
self.payouts = payouts
self.pendingCents = pendingCents
self.rateBps = rateBps
self.referredCount = referredCount
self.requestedCode = requestedCode
self.status = status
}
public enum CodingKeys: String, CodingKey, CaseIterable {
case accruedCents
case code
case defaultRateBps
case handle
case id
case isAffiliate
case link
case marginBps
case paidCents
case payouts
case pendingCents
case rateBps
case referredCount
case requestedCode
case status
}
// 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(code, forKey: .code)
try container.encodeIfPresent(defaultRateBps, forKey: .defaultRateBps)
try container.encodeIfPresent(handle, forKey: .handle)
try container.encodeIfPresent(id, forKey: .id)
try container.encodeIfPresent(isAffiliate, forKey: .isAffiliate)
try container.encodeIfPresent(link, forKey: .link)
try container.encodeIfPresent(marginBps, forKey: .marginBps)
try container.encodeIfPresent(paidCents, forKey: .paidCents)
try container.encodeIfPresent(payouts, forKey: .payouts)
try container.encodeIfPresent(pendingCents, forKey: .pendingCents)
try container.encodeIfPresent(rateBps, forKey: .rateBps)
try container.encodeIfPresent(referredCount, forKey: .referredCount)
try container.encodeIfPresent(requestedCode, forKey: .requestedCode)
try container.encodeIfPresent(status, forKey: .status)
}
}
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
extension AffiliateStanding: Identifiable {}