/*
* Firefly III API v6.4.14
*
* This is the documentation of the Firefly III API. Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. <br><br> Please keep in mind that the demo site does **not** accept requests from `curl`, `colly`, `wget`, etc. You must use a browser or a tool like Insomnia to make your test requests. <br><br> To learn more about the idiosyncrasies of this API, please read about the API in the [Firefly III API documentation](https://docs.firefly-iii.org/references/firefly-iii/api/). <br><br> <small>This file was last generated on 2025-12-26 @ 15:17:41 (Europe/Amsterdam)</small>
*
* The version of the OpenAPI document: v6.4.14
* Contact: james@firefly-iii.org
* Generated by: https://openapi-generator.tech
*/
#![allow(unused_imports)]
use crate::models::{self, *};
use std::fmt;
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct CurrencyUpdate {
/// If the currency is enabled
#[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
/// If the currency must be the primary for the user. You can only submit TRUE. Submitting FALSE will not drop this currency as the primary currency, because then the system would be without one.
#[serde(rename = "primary", skip_serializing_if = "Option::is_none")]
pub primary: Option<bool>,
/// The currency code
#[serde(rename = "code", skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
/// The currency name
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// The currency symbol
#[serde(rename = "symbol", skip_serializing_if = "Option::is_none")]
pub symbol: Option<String>,
/// How many decimals to use when displaying this currency. Between 0 and 16.
#[serde(rename = "decimal_places", skip_serializing_if = "Option::is_none")]
pub decimal_places: Option<i32>,
}
impl CurrencyUpdate {
pub fn new() -> CurrencyUpdate {
CurrencyUpdate {
enabled: None,
primary: None,
code: None,
name: None,
symbol: None,
decimal_places: None,
}
}
}
impl fmt::Display for CurrencyUpdate {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match serde_json::to_string(self) {
Ok(json) => write!(f, "{}", json),
Err(_) => write!(f, "{{{{}}}}"),
}
}
}