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 PnL {
    /// Expense is the cost lines that moved in the period, one per account.
    #[serde(rename = "expense", skip_serializing_if = "Option::is_none")]
    pub expense: Option<Vec<models::PnLLine>>,
    /// From opens the period and is EXCLUSIVE — movement strictly after it, matching the trial balance's opening boundary so the two reports agree on what belongs to a period. Absent means from the beginning of the ledger.
    #[serde(rename = "from", skip_serializing_if = "Option::is_none")]
    pub from: Option<String>,
    /// Income is the revenue lines that moved in the period, one per account. Accounts that did not move are omitted rather than listed at zero.
    #[serde(rename = "income", skip_serializing_if = "Option::is_none")]
    pub income: Option<Vec<models::PnLLine>>,
    /// NetIncome is totalIncome minus totalExpense, in cents. Negative is a loss.
    #[serde(rename = "netIncome", skip_serializing_if = "Option::is_none")]
    pub net_income: Option<i32>,
    /// To closes the period and is inclusive. Absent means up to now.
    #[serde(rename = "to", skip_serializing_if = "Option::is_none")]
    pub to: Option<String>,
    /// TotalExpense is cost MATCHED to that revenue, in cents, including accrued infrastructure that has not been billed yet.
    #[serde(rename = "totalExpense", skip_serializing_if = "Option::is_none")]
    pub total_expense: Option<i32>,
    /// TotalIncome is revenue RECOGNIZED in the period, in cents — accrual, not cash, so a prepaid top-up is not in it until the credit is consumed.
    #[serde(rename = "totalIncome", skip_serializing_if = "Option::is_none")]
    pub total_income: Option<i32>,
}

impl PnL {
    pub fn new() -> PnL {
        PnL {
            expense: None,
            from: None,
            income: None,
            net_income: None,
            to: None,
            total_expense: None,
            total_income: None,
        }
    }
}