fcm_service/domain/
fmc_notification.rs

1use serde::{Deserialize, Serialize};
2
3/// Represents the notification content of an FCM message.
4#[derive(Clone, Debug, Serialize, Deserialize, Default)]
5pub struct FcmNotification {
6    title: String,
7    body: String,
8    image: Option<String>,
9}
10
11impl FcmNotification {
12    #[must_use]
13    pub fn new() -> Self {
14        Self {
15            ..Default::default()
16        }
17    }
18
19    #[must_use]
20    pub fn title(&self) -> &str {
21        &self.title
22    }
23
24    #[must_use]
25    pub fn body(&self) -> &str {
26        &self.body
27    }
28
29    #[must_use]
30    pub fn image(&self) -> Option<&String> {
31        self.image.as_ref()
32    }
33
34    pub fn set_title(&mut self, title: String) {
35        self.title = title;
36    }
37
38    pub fn set_body(&mut self, body: String) {
39        self.body = body;
40    }
41
42    pub fn set_image(&mut self, image: Option<String>) {
43        self.image = image;
44    }
45}