Skip to main content

hanzo_client/models/
spend.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 Spend {
16    /// Available is false when the commerce ledger was unconfigured or unreachable. Every number below is then an honest zero, NOT a measured one.
17    #[serde(rename = "available", skip_serializing_if = "Option::is_none")]
18    pub available: Option<bool>,
19    /// AvailableCents is what of that balance is still spendable.
20    #[serde(rename = "availableCents", skip_serializing_if = "Option::is_none")]
21    pub available_cents: Option<i32>,
22    /// BalanceCents is the prepaid wallet's balance, in US cents.
23    #[serde(rename = "balanceCents", skip_serializing_if = "Option::is_none")]
24    pub balance_cents: Option<i32>,
25    /// ByCategory is the window's spend split by ledger category, largest first.
26    #[serde(rename = "byCategory", skip_serializing_if = "Option::is_none")]
27    pub by_category: Option<Vec<models::CategorySpend>>,
28    /// MTDCents is commerce's authoritative month-to-date consumed figure, which is a different period from the window and is not derived from it.
29    #[serde(rename = "mtdCents", skip_serializing_if = "Option::is_none")]
30    pub mtd_cents: Option<i32>,
31    /// OverageCents is month-to-date consumption beyond the plan's allowance.
32    #[serde(rename = "overageCents", skip_serializing_if = "Option::is_none")]
33    pub overage_cents: Option<i32>,
34    /// Series is the window's spend over time, gap-filled at the window's interval.
35    #[serde(rename = "series", skip_serializing_if = "Option::is_none")]
36    pub series: Option<Vec<models::SpendPoint>>,
37    /// Source names where the roll-up came from.
38    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
39    pub source: Option<String>,
40    /// TotalCents is consumption over the requested window, in US cents. It is self-consistent with ByCategory and Series.
41    #[serde(rename = "totalCents", skip_serializing_if = "Option::is_none")]
42    pub total_cents: Option<i32>,
43}
44
45impl Spend {
46    pub fn new() -> Spend {
47        Spend {
48            available: None,
49            available_cents: None,
50            balance_cents: None,
51            by_category: None,
52            mtd_cents: None,
53            overage_cents: None,
54            series: None,
55            source: None,
56            total_cents: None,
57        }
58    }
59}
60