metaculus/models/
notification.rs

1/*
2 * Metaculus API
3 *
4 * Welcome to the unofficial Rust client for the Metaculus API
5 *
6 * The version of the OpenAPI document: 1.0
7 * Contact: Benjamin Manns <opensource@benmanns.com>
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12pub struct Notification {
13    #[serde(rename = "user")]
14    pub user: i32,
15    #[serde(rename = "created_time", skip_serializing_if = "Option::is_none")]
16    pub created_time: Option<String>,
17    #[serde(rename = "read", skip_serializing_if = "Option::is_none")]
18    pub read: Option<bool>,
19    #[serde(rename = "type")]
20    pub r#type: crate::models::NotificationTypeEnum,
21    #[serde(rename = "data", skip_serializing_if = "Option::is_none")]
22    pub data: Option<::std::collections::HashMap<String, serde_json::Value>>,
23}
24
25impl Notification {
26    #[must_use]
27    pub fn new(user: i32, r#type: crate::models::NotificationTypeEnum) -> Notification {
28        Notification {
29            user,
30            created_time: None,
31            read: None,
32            r#type,
33            data: None,
34        }
35    }
36}