hanzo-client 8.5.156

Generated client for the Hanzo API — every service, one crate.
Documentation
/*
 * Hanzo Cloud API
 *
 * 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/.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AffiliateSelf {
    /// AccruedCents is lifetime commission accrued, in cents. It only grows — a payout is recorded against paidCents and never reduces this.
    #[serde(rename = "accruedCents", skip_serializing_if = "Option::is_none")]
    pub accrued_cents: Option<i32>,
    /// Code is the minted referral code, the slug the ?aff link carries. Absent until staff approve; codes live in ONE global namespace across all affiliates.
    #[serde(rename = "code", skip_serializing_if = "Option::is_none")]
    pub code: Option<String>,
    /// DefaultRateBps is the direct rate a new affiliate starts at, in basis points of margin (2000 = 20%). Answered ONLY to a caller that has not applied, as the quote beside `schedule`.
    #[serde(rename = "defaultRateBps", skip_serializing_if = "Option::is_none")]
    pub default_rate_bps: Option<i32>,
    /// DownlineTotal counts every org in the caller's downline across the levels.
    #[serde(rename = "downlineTotal", skip_serializing_if = "Option::is_none")]
    pub downline_total: Option<i32>,
    /// Handle is the opt-in public leaderboard name. Empty means opted out: the caller keeps its rank and still sees its own row, it is just not listed.
    #[serde(rename = "handle", skip_serializing_if = "Option::is_none")]
    pub handle: Option<String>,
    /// ID is the affiliate's server-minted handle, \"aff_\"-prefixed. Absent until the org applies.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// IsAffiliate says whether the caller org has an affiliate record. On false the answer carries the rate SCHEDULE and the default rate instead of a downline, so the console can show what the caller would earn.
    #[serde(rename = "isAffiliate", skip_serializing_if = "Option::is_none")]
    pub is_affiliate: Option<bool>,
    /// Levels is the caller's downline per upline level, with the rate paid there.
    #[serde(rename = "levels", skip_serializing_if = "Option::is_none")]
    pub levels: Option<Vec<models::LevelView>>,
    /// Link is the shareable ?aff URL built from the code. Empty until a code is minted, since there is nothing to share before approval.
    #[serde(rename = "link", skip_serializing_if = "Option::is_none")]
    pub link: Option<String>,
    /// MarginBps is the platform gross-margin fraction, in basis points, that every rate here is a rate OF. Read live per request, so it is the value in force now, not the one that applied to commission already accrued.
    #[serde(rename = "marginBps", skip_serializing_if = "Option::is_none")]
    pub margin_bps: Option<i32>,
    /// PaidCents is lifetime commission already paid out, in cents — credits grants and record-only cash disbursements alike.
    #[serde(rename = "paidCents", skip_serializing_if = "Option::is_none")]
    pub paid_cents: Option<i32>,
    /// Payouts is the payout history, newest first, bounded to the last 100 rows.
    #[serde(rename = "payouts", skip_serializing_if = "Option::is_none")]
    pub payouts: Option<Vec<models::Remittance>>,
    /// PendingCents is accrued minus paid, in cents — what the platform still owes and the ceiling on the next payout. Never negative.
    #[serde(rename = "pendingCents", skip_serializing_if = "Option::is_none")]
    pub pending_cents: Option<i32>,
    /// RateBps is the caller's OWN direct (level 1) commission rate, in basis points of margin. Levels 2 and 3 are platform-wide and appear in `levels`.
    #[serde(rename = "rateBps", skip_serializing_if = "Option::is_none")]
    pub rate_bps: Option<i32>,
    /// Schedule is the rate schedule quoted to a caller that has not applied.
    #[serde(rename = "schedule", skip_serializing_if = "Option::is_none")]
    pub schedule: Option<Vec<models::LevelView>>,
    /// Status is \"applied\", \"approved\" or \"suspended\"; absent for a caller that never applied. Only \"approved\" mints links and accrues.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
}

impl AffiliateSelf {
    pub fn new() -> AffiliateSelf {
        AffiliateSelf {
            accrued_cents: None,
            code: None,
            default_rate_bps: None,
            downline_total: None,
            handle: None,
            id: None,
            is_affiliate: None,
            levels: None,
            link: None,
            margin_bps: None,
            paid_cents: None,
            payouts: None,
            pending_cents: None,
            rate_bps: None,
            schedule: None,
            status: None,
        }
    }
}