fcm_service/domain/
fmc_notification.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Serialize, Deserialize, Default)]
5pub struct FcmNotification {
6 title: String,
7 body: String,
8 image: Option<String>,
9}
10
11impl FcmNotification {
12 pub fn new() -> Self {
13 Self {
14 ..Default::default()
15 }
16 }
17
18 pub fn title(&self) -> &str {
19 &self.title
20 }
21
22 pub fn body(&self) -> &str {
23 &self.body
24 }
25
26 pub fn image(&self) -> Option<&String> {
27 self.image.as_ref()
28 }
29
30 pub fn set_title(&mut self, title: String) {
31 self.title = title;
32 }
33
34 pub fn set_body(&mut self, body: String) {
35 self.body = body;
36 }
37
38 pub fn set_image(&mut self, image: Option<String>) {
39 self.image = image;
40 }
41}