ynab_api/models/
budget_detail.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.0
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 BudgetDetail {
16    #[serde(rename = "id")]
17    pub id: uuid::Uuid,
18    #[serde(rename = "name")]
19    pub name: String,
20    /// The last time any changes were made to the budget from either a web or mobile client
21    #[serde(rename = "last_modified_on", skip_serializing_if = "Option::is_none")]
22    pub last_modified_on: Option<String>,
23    /// The earliest budget month
24    #[serde(rename = "first_month", skip_serializing_if = "Option::is_none")]
25    pub first_month: Option<String>,
26    /// The latest budget month
27    #[serde(rename = "last_month", skip_serializing_if = "Option::is_none")]
28    pub last_month: Option<String>,
29    #[serde(rename = "date_format", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub date_format: Option<Option<Box<models::DateFormat>>>,
31    #[serde(rename = "currency_format", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub currency_format: Option<Option<Box<models::CurrencyFormat>>>,
33    #[serde(rename = "accounts", skip_serializing_if = "Option::is_none")]
34    pub accounts: Option<Vec<models::Account>>,
35    #[serde(rename = "payees", skip_serializing_if = "Option::is_none")]
36    pub payees: Option<Vec<models::Payee>>,
37    #[serde(rename = "payee_locations", skip_serializing_if = "Option::is_none")]
38    pub payee_locations: Option<Vec<models::PayeeLocation>>,
39    #[serde(rename = "category_groups", skip_serializing_if = "Option::is_none")]
40    pub category_groups: Option<Vec<models::CategoryGroup>>,
41    #[serde(rename = "categories", skip_serializing_if = "Option::is_none")]
42    pub categories: Option<Vec<models::Category>>,
43    #[serde(rename = "months", skip_serializing_if = "Option::is_none")]
44    pub months: Option<Vec<models::MonthDetail>>,
45    #[serde(rename = "transactions", skip_serializing_if = "Option::is_none")]
46    pub transactions: Option<Vec<models::TransactionSummary>>,
47    #[serde(rename = "subtransactions", skip_serializing_if = "Option::is_none")]
48    pub subtransactions: Option<Vec<models::SubTransaction>>,
49    #[serde(rename = "scheduled_transactions", skip_serializing_if = "Option::is_none")]
50    pub scheduled_transactions: Option<Vec<models::ScheduledTransactionSummary>>,
51    #[serde(rename = "scheduled_subtransactions", skip_serializing_if = "Option::is_none")]
52    pub scheduled_subtransactions: Option<Vec<models::ScheduledSubTransaction>>,
53}
54
55impl BudgetDetail {
56    pub fn new(id: uuid::Uuid, name: String) -> BudgetDetail {
57        BudgetDetail {
58            id,
59            name,
60            last_modified_on: None,
61            first_month: None,
62            last_month: None,
63            date_format: None,
64            currency_format: None,
65            accounts: None,
66            payees: None,
67            payee_locations: None,
68            category_groups: None,
69            categories: None,
70            months: None,
71            transactions: None,
72            subtransactions: None,
73            scheduled_transactions: None,
74            scheduled_subtransactions: None,
75        }
76    }
77}
78