firefly_iii/models/autocomplete_currency_code.rs
1/*
2 * Firefly III API v6.4.14
3 *
4 * 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>
5 *
6 * The version of the OpenAPI document: v6.4.14
7 * Contact: james@firefly-iii.org
8 * Generated by: https://openapi-generator.tech
9 */
10
11#![allow(unused_imports)]
12
13use crate::models::{self, *};
14use std::fmt;
15
16#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
17pub struct AutocompleteCurrencyCode {
18 #[serde(rename = "id")]
19 pub id: String,
20 /// Currency name with the code between brackets.
21 #[serde(rename = "name")]
22 pub name: String,
23 /// Currency code.
24 #[serde(rename = "code")]
25 pub code: String,
26 #[serde(rename = "symbol")]
27 pub symbol: String,
28 #[serde(rename = "decimal_places")]
29 pub decimal_places: i32,
30}
31
32impl AutocompleteCurrencyCode {
33 pub fn new(
34 id: String,
35 name: String,
36 code: String,
37 symbol: String,
38 decimal_places: i32,
39 ) -> AutocompleteCurrencyCode {
40 AutocompleteCurrencyCode {
41 id,
42 name,
43 code,
44 symbol,
45 decimal_places,
46 }
47 }
48}
49
50impl fmt::Display for AutocompleteCurrencyCode {
51 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
52 match serde_json::to_string(self) {
53 Ok(json) => write!(f, "{}", json),
54 Err(_) => write!(f, "{{{{}}}}"),
55 }
56 }
57}