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 AffiliateStanding {
    /// AccruedCents is lifetime commission accrued, in cents.
    #[serde(rename = "accruedCents", skip_serializing_if = "Option::is_none")]
    pub accrued_cents: Option<i32>,
    /// Code is the minted referral code; empty until staff approve.
    #[serde(rename = "code", skip_serializing_if = "Option::is_none")]
    pub code: Option<String>,
    /// DefaultRateBps is the direct rate a new affiliate would get, answered only to a caller that has not applied.
    #[serde(rename = "defaultRateBps", skip_serializing_if = "Option::is_none")]
    pub default_rate_bps: Option<i32>,
    /// Handle is the opt-in public leaderboard name; empty means opted out.
    #[serde(rename = "handle", skip_serializing_if = "Option::is_none")]
    pub handle: Option<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.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<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.
    #[serde(rename = "isAffiliate", skip_serializing_if = "Option::is_none")]
    pub is_affiliate: Option<bool>,
    /// Link is the shareable ?aff URL; empty until a code is minted.
    #[serde(rename = "link", skip_serializing_if = "Option::is_none")]
    pub link: Option<String>,
    /// MarginBps is the platform gross-margin fraction commission is a rate OF.
    #[serde(rename = "marginBps", skip_serializing_if = "Option::is_none")]
    pub margin_bps: Option<i32>,
    /// PaidCents is lifetime commission already paid out, in cents.
    #[serde(rename = "paidCents", skip_serializing_if = "Option::is_none")]
    pub paid_cents: Option<i32>,
    /// Payouts is the payout history, newest rows bounded.
    #[serde(rename = "payouts", skip_serializing_if = "Option::is_none")]
    pub payouts: Option<Vec<models::Remittance>>,
    /// PendingCents is accrued minus paid — what the platform still owes.
    #[serde(rename = "pendingCents", skip_serializing_if = "Option::is_none")]
    pub pending_cents: Option<i32>,
    /// RateBps is the affiliate's own direct commission rate, in basis points.
    #[serde(rename = "rateBps", skip_serializing_if = "Option::is_none")]
    pub rate_bps: Option<i32>,
    /// ReferredCount is how many orgs this affiliate has referred.
    #[serde(rename = "referredCount", skip_serializing_if = "Option::is_none")]
    pub referred_count: Option<i32>,
    /// 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.
    #[serde(rename = "requestedCode", skip_serializing_if = "Option::is_none")]
    pub requested_code: Option<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.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
}

impl AffiliateStanding {
    pub fn new() -> AffiliateStanding {
        AffiliateStanding {
            accrued_cents: None,
            code: None,
            default_rate_bps: None,
            handle: None,
            id: None,
            is_affiliate: None,
            link: None,
            margin_bps: None,
            paid_cents: None,
            payouts: None,
            pending_cents: None,
            rate_bps: None,
            referred_count: None,
            requested_code: None,
            status: None,
        }
    }
}