ynab_api/models/
budget_settings.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct BudgetSettings {
16 #[serde(rename = "date_format", deserialize_with = "Option::deserialize")]
17 pub date_format: Option<Box<models::DateFormat>>,
18 #[serde(rename = "currency_format", deserialize_with = "Option::deserialize")]
19 pub currency_format: Option<Box<models::CurrencyFormat>>,
20}
21
22impl BudgetSettings {
23 pub fn new(date_format: Option<models::DateFormat>, currency_format: Option<models::CurrencyFormat>) -> BudgetSettings {
24 BudgetSettings {
25 date_format: if let Some(x) = date_format {Some(Box::new(x))} else {None},
26 currency_format: if let Some(x) = currency_format {Some(Box::new(x))} else {None},
27 }
28 }
29}
30