Skip to main content

firefly_iii/models/
webhook_message.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 WebhookMessage {
18    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
19    pub created_at: Option<String>,
20    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
21    pub updated_at: Option<String>,
22    /// If this message is sent yet.
23    #[serde(rename = "sent", skip_serializing_if = "Option::is_none")]
24    pub sent: Option<bool>,
25    /// If this message has errored out.
26    #[serde(rename = "errored", skip_serializing_if = "Option::is_none")]
27    pub errored: Option<bool>,
28    /// The ID of the webhook this message belongs to.
29    #[serde(rename = "webhook_id", skip_serializing_if = "Option::is_none")]
30    pub webhook_id: Option<String>,
31    /// Long UUID string for identification of this webhook message.
32    #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")]
33    pub uuid: Option<String>,
34    /// The actual message that is sent or will be sent as JSON string.
35    #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
36    pub message: Option<String>,
37}
38
39impl WebhookMessage {
40    pub fn new() -> WebhookMessage {
41        WebhookMessage {
42            created_at: None,
43            updated_at: None,
44            sent: None,
45            errored: None,
46            webhook_id: None,
47            uuid: None,
48            message: None,
49        }
50    }
51}
52
53impl fmt::Display for WebhookMessage {
54    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
55        match serde_json::to_string(self) {
56            Ok(json) => write!(f, "{}", json),
57            Err(_) => write!(f, "{{{{}}}}"),
58        }
59    }
60}