vrchatapi/models/
sent_notification.rs

1/*
2 * VRChat API Documentation
3 *
4 *
5 * Contact: vrchatapi.lpv0t@aries.fyi
6 * Generated by: https://openapi-generator.tech
7 */
8
9use crate::models;
10use serde::{Deserialize, Serialize};
11
12/// SentNotification :
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
14pub struct SentNotification {
15    #[serde(rename = "created_at")]
16    pub created_at: String,
17    #[serde(rename = "details")]
18    pub details: models::SentNotificationDetails,
19    #[serde(rename = "id")]
20    pub id: String,
21    #[serde(rename = "message")]
22    pub message: String,
23    /// 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.
24    #[serde(rename = "receiverUserId")]
25    pub receiver_user_id: String,
26    /// 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.
27    #[serde(rename = "senderUserId")]
28    pub sender_user_id: String,
29    /// -| **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).
30    #[serde(rename = "senderUsername", skip_serializing_if = "Option::is_none")]
31    pub sender_username: Option<String>,
32    #[serde(rename = "type")]
33    pub r#type: models::NotificationType,
34}
35
36impl SentNotification {
37    pub fn new(
38        created_at: String,
39        details: models::SentNotificationDetails,
40        id: String,
41        message: String,
42        receiver_user_id: String,
43        sender_user_id: String,
44        r#type: models::NotificationType,
45    ) -> SentNotification {
46        SentNotification {
47            created_at,
48            details,
49            id,
50            message,
51            receiver_user_id,
52            sender_user_id,
53            sender_username: None,
54            r#type,
55        }
56    }
57}