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.9 KiB
Swift
61 lines
2.9 KiB
Swift
//
|
||
// CodeView.swift
|
||
//
|
||
// Generated by openapi-generator
|
||
// https://openapi-generator.tech
|
||
//
|
||
|
||
import Foundation
|
||
|
||
public struct CodeView: Sendable, Codable, ParameterConvertible, Hashable {
|
||
|
||
/** Clicks is how many pings this code has taken. The one STORED counter here and pure vanity: no accrual or payout reads it, pings are coalesced in memory and flushed in batches, and a dropped tally is accepted rather than contending with the money write path. Do not reconcile it against anything. */
|
||
public var clicks: Int64?
|
||
/** Code is the link's slug — 3–32 chars of a–z, 0–9 and hyphen — unique across the WHOLE directory, so any affiliate's code resolves an attribution. */
|
||
public var code: String?
|
||
/** Conversions is how many of those signups have actually produced positive commission for the caller. Also derived, from the accrual rows, so it is ≤ signups and lags a referral until the first sweep after it spends. */
|
||
public var conversions: Int64?
|
||
/** CreatedAt is when the link was minted, Unix seconds UTC. */
|
||
public var createdAt: Int64?
|
||
/** Label is the caller's own note for the link (\"twitter\", \"newsletter\"). Cosmetic: trimmed, stripped of control characters, capped at 48 bytes, and never part of the code. \"primary\" on the link mirrored at approval. */
|
||
public var label: String?
|
||
/** Signups is how many orgs were attributed with this code — DERIVED by counting attribution edges, never stored, so it cannot drift from the ledger. */
|
||
public var signups: Int64?
|
||
/** URL is the full shareable link, the brand host plus ?aff=<code>. The host is the deployment's own brand, so a Lux or Zoo install never mints a hanzo.ai link. */
|
||
public var url: String?
|
||
|
||
public init(clicks: Int64? = nil, code: String? = nil, conversions: Int64? = nil, createdAt: Int64? = nil, label: String? = nil, signups: Int64? = nil, url: String? = nil) {
|
||
self.clicks = clicks
|
||
self.code = code
|
||
self.conversions = conversions
|
||
self.createdAt = createdAt
|
||
self.label = label
|
||
self.signups = signups
|
||
self.url = url
|
||
}
|
||
|
||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||
case clicks
|
||
case code
|
||
case conversions
|
||
case createdAt
|
||
case label
|
||
case signups
|
||
case url
|
||
}
|
||
|
||
// Encodable protocol methods
|
||
|
||
public func encode(to encoder: Encoder) throws {
|
||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||
try container.encodeIfPresent(clicks, forKey: .clicks)
|
||
try container.encodeIfPresent(code, forKey: .code)
|
||
try container.encodeIfPresent(conversions, forKey: .conversions)
|
||
try container.encodeIfPresent(createdAt, forKey: .createdAt)
|
||
try container.encodeIfPresent(label, forKey: .label)
|
||
try container.encodeIfPresent(signups, forKey: .signups)
|
||
try container.encodeIfPresent(url, forKey: .url)
|
||
}
|
||
}
|
||
|