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
61
62
63
64
use serde::{Deserialize, Serialize};
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct AvailableBudget {
#[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
#[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")]
pub currency_id: Option<i32>,
#[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")]
pub currency_code: Option<String>,
#[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")]
pub currency_symbol: Option<String>,
#[serde(rename = "currency_decimal_places", skip_serializing_if = "Option::is_none")]
pub currency_decimal_places: Option<i32>,
#[serde(rename = "amount")]
pub amount: f64,
#[serde(rename = "start")]
pub start: String,
#[serde(rename = "end")]
pub end: String,
#[serde(rename = "spent_in_budgets", skip_serializing_if = "Option::is_none")]
pub spent_in_budgets: Option<Vec<crate::models::BudgetSpent>>,
#[serde(rename = "spent_outside_budget", skip_serializing_if = "Option::is_none")]
pub spent_outside_budget: Option<Vec<crate::models::BudgetSpent>>,
}
impl AvailableBudget {
pub fn new(amount: f64, start: String, end: String) -> AvailableBudget {
AvailableBudget {
created_at: None,
updated_at: None,
currency_id: None,
currency_code: None,
currency_symbol: None,
currency_decimal_places: None,
amount,
start,
end,
spent_in_budgets: None,
spent_outside_budget: None,
}
}
}