Skip to main content

hanzo_client/models/
code_view.rs

1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CodeView {
16    /// 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.
17    #[serde(rename = "clicks", skip_serializing_if = "Option::is_none")]
18    pub clicks: Option<i32>,
19    /// 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.
20    #[serde(rename = "code", skip_serializing_if = "Option::is_none")]
21    pub code: Option<String>,
22    /// 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.
23    #[serde(rename = "conversions", skip_serializing_if = "Option::is_none")]
24    pub conversions: Option<i32>,
25    /// CreatedAt is when the link was minted, Unix seconds UTC.
26    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
27    pub created_at: Option<i32>,
28    /// 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.
29    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
30    pub label: Option<String>,
31    /// Signups is how many orgs were attributed with this code — DERIVED by counting attribution edges, never stored, so it cannot drift from the ledger.
32    #[serde(rename = "signups", skip_serializing_if = "Option::is_none")]
33    pub signups: Option<i32>,
34    /// 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.
35    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
36    pub url: Option<String>,
37}
38
39impl CodeView {
40    pub fn new() -> CodeView {
41        CodeView {
42            clicks: None,
43            code: None,
44            conversions: None,
45            created_at: None,
46            label: None,
47            signups: None,
48            url: None,
49        }
50    }
51}
52