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 AffiliateEarnings {
    /// AccruedCents is lifetime commission accrued, in cents.
    #[serde(rename = "accruedCents", skip_serializing_if = "Option::is_none")]
    pub accrued_cents: Option<i32>,
    /// ByPeriod is the per-period ledger: the margin earned against and the commission taken from it.
    #[serde(rename = "byPeriod", skip_serializing_if = "Option::is_none")]
    pub by_period: Option<Vec<models::PeriodEarningView>>,
    /// ByReferredOrg is each referral's aggregate contribution — the affiliate's OWN share, never the referred org's spend.
    #[serde(rename = "byReferredOrg", skip_serializing_if = "Option::is_none")]
    pub by_referred_org: Option<Vec<models::OrgEarningView>>,
    /// IsAffiliate says whether the caller org has an affiliate record. On false it is the ONLY field present — there is no ledger to report, and the zeros you might expect are absent rather than reported as earnings of nothing.
    #[serde(rename = "isAffiliate", skip_serializing_if = "Option::is_none")]
    pub is_affiliate: Option<bool>,
    /// 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>,
    /// PendingCents is accrued minus paid — what the platform still owes.
    #[serde(rename = "pendingCents", skip_serializing_if = "Option::is_none")]
    pub pending_cents: Option<i32>,
}

impl AffiliateEarnings {
    pub fn new() -> AffiliateEarnings {
        AffiliateEarnings {
            accrued_cents: None,
            by_period: None,
            by_referred_org: None,
            is_affiliate: None,
            margin_bps: None,
            paid_cents: None,
            pending_cents: None,
        }
    }
}