dapnet_api/types/
news.rs

1use chrono::{DateTime, Utc};
2use derive_builder::Builder;
3use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Serialize, Builder)]
6pub struct OutgoingNews {
7    /// Name of the rubric to send to
8    #[serde(rename = "rubricName")]
9    pub(crate) rubric: String,
10
11    /// Message text of the news item
12    pub(crate) text: String,
13
14    /// News position (1-10) for Skyper pagers
15    #[builder(default = "1")]
16    pub(crate) number: i8,
17}
18
19#[derive(Debug, Deserialize)]
20pub struct News {
21    /// Name of the rubric to send to
22    #[serde(rename = "rubricName")]
23    pub rubric: String,
24
25    /// Message text of the news item
26    pub text: String,
27
28    /// News position (1-10) for Skyper pagers
29    pub number: Option<i8>,
30
31    /// Time at which the news was sent
32    pub timestamp: DateTime<Utc>,
33
34    /// User who submitted the news
35    #[serde(rename = "ownerName")]
36    pub sender: String,
37}