use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SentNotification {
#[serde(rename = "created_at")]
pub created_at: String,
#[serde(rename = "details")]
pub details: models::SentNotificationDetails,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "message")]
pub message: String,
#[serde(rename = "receiverUserId")]
pub receiver_user_id: String,
#[serde(rename = "senderUserId")]
pub sender_user_id: String,
#[serde(rename = "senderUsername", skip_serializing_if = "Option::is_none")]
pub sender_username: Option<String>,
#[serde(rename = "type")]
pub r#type: models::NotificationType,
}
impl SentNotification {
pub fn new(
created_at: String,
details: models::SentNotificationDetails,
id: String,
message: String,
receiver_user_id: String,
sender_user_id: String,
r#type: models::NotificationType,
) -> SentNotification {
SentNotification {
created_at,
details,
id,
message,
receiver_user_id,
sender_user_id,
sender_username: None,
r#type,
}
}
}