1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* VRChat API Documentation
*
*
* Contact: vrchatapi.lpv0t@aries.fyi
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Notification :
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Notification {
#[serde(rename = "created_at")]
pub created_at: String,
/// **NOTICE:** This is not a JSON object when received from the REST API, but it is when received from the Websocket API. When received from the REST API, this is a json **encoded** object, meaning you have to json-de-encode to get the NotificationDetail object depending on the NotificationType.
#[serde(rename = "details")]
pub details: String,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "message")]
pub message: String,
/// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed.
#[serde(rename = "receiverUserId", skip_serializing_if = "Option::is_none")]
pub receiver_user_id: Option<String>,
/// Not included in notification objects received from the Websocket API
#[serde(rename = "seen", skip_serializing_if = "Option::is_none")]
pub seen: Option<bool>,
/// A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed.
#[serde(rename = "senderUserId")]
pub sender_user_id: String,
/// -| **DEPRECATED:** VRChat API no longer return usernames of other users. [See issue by Tupper for more information](https://github.com/pypy-vrc/VRCX/issues/429).
#[serde(rename = "senderUsername", skip_serializing_if = "Option::is_none")]
pub sender_username: Option<String>,
#[serde(rename = "type")]
pub r#type: models::NotificationType,
}
impl Notification {
pub fn new(
created_at: String,
details: String,
id: String,
message: String,
sender_user_id: String,
r#type: models::NotificationType,
) -> Notification {
Notification {
created_at,
details,
id,
message,
receiver_user_id: None,
seen: None,
sender_user_id,
sender_username: None,
r#type,
}
}
}