ynab_api_async_fork/models/
month_summary.rs

1/*
2 * YNAB API Endpoints
3 *
4 * Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body.  API Documentation is at https://api.ynab.com
5 *
6 * The version of the OpenAPI document: 1.72.1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
15pub struct MonthSummary {
16    #[serde(rename = "month")]
17    pub month: String,
18    #[serde(rename = "note", skip_serializing_if = "Option::is_none")]
19    pub note: Option<String>,
20    /// The total amount of transactions categorized to 'Inflow: Ready to Assign' in the month
21    #[serde(rename = "income")]
22    pub income: i64,
23    /// The total amount budgeted in the month
24    #[serde(rename = "budgeted")]
25    pub budgeted: i64,
26    /// The total amount of transactions in the month, excluding those categorized to 'Inflow: Ready to Assign'
27    #[serde(rename = "activity")]
28    pub activity: i64,
29    /// The available amount for 'Ready to Assign'
30    #[serde(rename = "to_be_budgeted")]
31    pub to_be_budgeted: i64,
32    /// The Age of Money as of the month
33    #[serde(rename = "age_of_money", skip_serializing_if = "Option::is_none")]
34    pub age_of_money: Option<i32>,
35    /// Whether or not the month has been deleted.  Deleted months will only be included in delta requests.
36    #[serde(rename = "deleted")]
37    pub deleted: bool,
38}
39
40impl MonthSummary {
41    pub fn new(month: String, income: i64, budgeted: i64, activity: i64, to_be_budgeted: i64, deleted: bool) -> MonthSummary {
42        MonthSummary {
43            month,
44            note: None,
45            income,
46            budgeted,
47            activity,
48            to_be_budgeted,
49            age_of_money: None,
50            deleted,
51        }
52    }
53}
54
55