Skip to main content

firefly_iii/models/
recurrence_update.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 RecurrenceUpdate {
18    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
19    pub title: Option<String>,
20    /// Not to be confused with the description of the actual transaction(s) being created.
21    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
22    pub description: Option<String>,
23    /// First time the recurring transaction will fire.
24    #[serde(rename = "first_date", skip_serializing_if = "Option::is_none")]
25    pub first_date: Option<String>,
26    /// Date until when the recurring transaction can fire. After that date, it's basically inactive. Use either this field or repetitions.
27    #[serde(rename = "repeat_until", skip_serializing_if = "Option::is_none")]
28    pub repeat_until: Option<String>,
29    /// Max number of created transactions. Use either this field or repeat_until.
30    #[serde(rename = "nr_of_repetitions", skip_serializing_if = "Option::is_none")]
31    pub nr_of_repetitions: Option<i32>,
32    /// Whether or not to fire the rules after the creation of a transaction.
33    #[serde(rename = "apply_rules", skip_serializing_if = "Option::is_none")]
34    pub apply_rules: Option<bool>,
35    /// If the recurrence is even active.
36    #[serde(rename = "active", skip_serializing_if = "Option::is_none")]
37    pub active: Option<bool>,
38    #[serde(rename = "notes", skip_serializing_if = "Option::is_none")]
39    pub notes: Option<String>,
40    #[serde(rename = "repetitions", skip_serializing_if = "Option::is_none")]
41    pub repetitions: Option<Vec<models::RecurrenceRepetitionUpdate>>,
42    #[serde(rename = "transactions", skip_serializing_if = "Option::is_none")]
43    pub transactions: Option<Vec<models::RecurrenceTransactionUpdate>>,
44}
45
46impl RecurrenceUpdate {
47    pub fn new() -> RecurrenceUpdate {
48        RecurrenceUpdate {
49            title: None,
50            description: None,
51            first_date: None,
52            repeat_until: None,
53            nr_of_repetitions: None,
54            apply_rules: None,
55            active: None,
56            notes: None,
57            repetitions: None,
58            transactions: None,
59        }
60    }
61}
62
63impl fmt::Display for RecurrenceUpdate {
64    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
65        match serde_json::to_string(self) {
66            Ok(json) => write!(f, "{}", json),
67            Err(_) => write!(f, "{{{{}}}}"),
68        }
69    }
70}