Skip to main content

firefly_iii/models/
chart_data_set.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 ChartDataSet {
18    /// This is the title of the current set. It can refer to an account, a budget or another object (by name).
19    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
20    pub label: Option<String>,
21    /// The currency ID of the currency associated with this object.
22    #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")]
23    pub currency_id: Option<String>,
24    /// The currency name of the currency associated with this object.
25    #[serde(rename = "currency_name", skip_serializing_if = "Option::is_none")]
26    pub currency_name: Option<String>,
27    /// The currency code of the currency associated with this object.
28    #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")]
29    pub currency_code: Option<String>,
30    #[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")]
31    pub currency_symbol: Option<String>,
32    #[serde(
33        rename = "currency_decimal_places",
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub currency_decimal_places: Option<i32>,
37    /// The currency ID of the administration's primary currency.
38    #[serde(
39        rename = "primary_currency_id",
40        skip_serializing_if = "Option::is_none"
41    )]
42    pub primary_currency_id: Option<String>,
43    /// The currency name of the administration's primary currency.
44    #[serde(
45        rename = "primary_currency_name",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub primary_currency_name: Option<String>,
49    /// The currency code of the administration's primary currency.
50    #[serde(
51        rename = "primary_currency_code",
52        skip_serializing_if = "Option::is_none"
53    )]
54    pub primary_currency_code: Option<String>,
55    /// The currency symbol of the administration's primary currency.
56    #[serde(
57        rename = "primary_currency_symbol",
58        skip_serializing_if = "Option::is_none"
59    )]
60    pub primary_currency_symbol: Option<String>,
61    /// The currency decimal places of the administration's primary currency.
62    #[serde(
63        rename = "primary_currency_decimal_places",
64        skip_serializing_if = "Option::is_none"
65    )]
66    pub primary_currency_decimal_places: Option<i32>,
67    #[serde(rename = "date", skip_serializing_if = "Option::is_none")]
68    pub date: Option<String>,
69    #[serde(rename = "start_date", skip_serializing_if = "Option::is_none")]
70    pub start_date: Option<String>,
71    #[serde(rename = "end_date", skip_serializing_if = "Option::is_none")]
72    pub end_date: Option<String>,
73    /// Indicated the type of chart that is expected to be rendered. You can safely ignore this if you want.
74    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
75    pub r#type: Option<String>,
76    #[serde(rename = "period", skip_serializing_if = "Option::is_none")]
77    pub period: Option<models::ChartDatasetPeriodProperty>,
78    /// Used to indicate the Y axis for this data set. Is usually between 0 and 1 (left and right side of the chart).
79    #[serde(rename = "yAxisID", skip_serializing_if = "Option::is_none")]
80    pub y_axis_id: Option<i32>,
81    /// The actual entries for this data set. They 'key' value is the label for the data point. The value is the actual (numerical) value.
82    #[serde(rename = "entries", skip_serializing_if = "Option::is_none")]
83    pub entries: Option<Vec<models::ChartDataPoint>>,
84    /// The actual entries for this data set. They 'key' value is the label for the data point. The value is the actual (numerical) value.
85    #[serde(rename = "pc_entries", skip_serializing_if = "Option::is_none")]
86    pub pc_entries: Option<Vec<models::ChartDataPoint>>,
87}
88
89impl ChartDataSet {
90    pub fn new() -> ChartDataSet {
91        ChartDataSet {
92            label: None,
93            currency_id: None,
94            currency_name: None,
95            currency_code: None,
96            currency_symbol: None,
97            currency_decimal_places: None,
98            primary_currency_id: None,
99            primary_currency_name: None,
100            primary_currency_code: None,
101            primary_currency_symbol: None,
102            primary_currency_decimal_places: None,
103            date: None,
104            start_date: None,
105            end_date: None,
106            r#type: None,
107            period: None,
108            y_axis_id: None,
109            entries: None,
110            pc_entries: None,
111        }
112    }
113}
114
115impl fmt::Display for ChartDataSet {
116    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
117        match serde_json::to_string(self) {
118            Ok(json) => write!(f, "{}", json),
119            Err(_) => write!(f, "{{{{}}}}"),
120        }
121    }
122}