ynab-api 4.0.0

OpenAPI-generated API bindings for the YNAB API
Documentation
/*
 * YNAB API Endpoints
 *
 * 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
 *
 * The version of the OpenAPI document: 1.72.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct MonthSummary {
    #[serde(rename = "month")]
    pub month: String,
    #[serde(rename = "note", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub note: Option<Option<String>>,
    /// The total amount of transactions categorized to 'Inflow: Ready to Assign' in the month
    #[serde(rename = "income")]
    pub income: i64,
    /// The total amount budgeted in the month
    #[serde(rename = "budgeted")]
    pub budgeted: i64,
    /// The total amount of transactions in the month, excluding those categorized to 'Inflow: Ready to Assign'
    #[serde(rename = "activity")]
    pub activity: i64,
    /// The available amount for 'Ready to Assign'
    #[serde(rename = "to_be_budgeted")]
    pub to_be_budgeted: i64,
    /// The Age of Money as of the month
    #[serde(rename = "age_of_money", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub age_of_money: Option<Option<i32>>,
    /// Whether or not the month has been deleted.  Deleted months will only be included in delta requests.
    #[serde(rename = "deleted")]
    pub deleted: bool,
}

impl MonthSummary {
    pub fn new(month: String, income: i64, budgeted: i64, activity: i64, to_be_budgeted: i64, deleted: bool) -> MonthSummary {
        MonthSummary {
            month,
            note: None,
            income,
            budgeted,
            activity,
            to_be_budgeted,
            age_of_money: None,
            deleted,
        }
    }
}