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