Skip to main content

firefly_iii/models/
rule_trigger_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 RuleTriggerUpdate {
18    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
19    pub r#type: Option<models::RuleTriggerKeyword>,
20    /// The accompanying value the trigger responds to. This value is often mandatory, but this depends on the trigger. If the rule trigger is something like 'has any tag', submit the string 'true'.
21    #[serde(rename = "value", skip_serializing_if = "Option::is_none")]
22    pub value: Option<String>,
23    /// Order of the trigger
24    #[serde(rename = "order", skip_serializing_if = "Option::is_none")]
25    pub order: Option<i32>,
26    /// If the trigger is active.
27    #[serde(rename = "active", skip_serializing_if = "Option::is_none")]
28    pub active: Option<bool>,
29    /// When true, other triggers will not be checked if this trigger was triggered.
30    #[serde(rename = "stop_processing", skip_serializing_if = "Option::is_none")]
31    pub stop_processing: Option<bool>,
32}
33
34impl RuleTriggerUpdate {
35    pub fn new() -> RuleTriggerUpdate {
36        RuleTriggerUpdate {
37            r#type: None,
38            value: None,
39            order: None,
40            active: None,
41            stop_processing: None,
42        }
43    }
44}
45
46impl fmt::Display for RuleTriggerUpdate {
47    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
48        match serde_json::to_string(self) {
49            Ok(json) => write!(f, "{}", json),
50            Err(_) => write!(f, "{{{{}}}}"),
51        }
52    }
53}