Skip to main content

firefly_iii/models/
webhook_read.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 WebhookRead {
18    /// Immutable value
19    #[serde(rename = "type")]
20    pub r#type: String,
21    #[serde(rename = "id")]
22    pub id: String,
23    #[serde(rename = "attributes")]
24    pub attributes: models::WebhookProperties,
25    #[serde(rename = "links")]
26    pub links: models::ObjectLink,
27}
28
29impl WebhookRead {
30    pub fn new(
31        r#type: String,
32        id: String,
33        attributes: models::WebhookProperties,
34        links: models::ObjectLink,
35    ) -> WebhookRead {
36        WebhookRead {
37            r#type,
38            id,
39            attributes: attributes,
40            links: links,
41        }
42    }
43}
44
45impl fmt::Display for WebhookRead {
46    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
47        match serde_json::to_string(self) {
48            Ok(json) => write!(f, "{}", json),
49            Err(_) => write!(f, "{{{{}}}}"),
50        }
51    }
52}