botx_api/api/v3/events/status/
models.rs1use chrono::{DateTime, Utc};
2use serde::{Deserialize, Serialize};
3use uuid::Uuid;
4
5
6#[derive(Debug, Serialize, Deserialize, Clone)]
8pub struct EventStatusResponse {
9 pub result: EventStatusResult,
11}
12
13
14#[derive(Debug, Serialize, Deserialize, Clone)]
16pub struct EventStatusResult {
17 pub group_chat_id: Uuid,
19
20 pub sent_to: Vec<Uuid>,
22
23 pub read_by: Vec<EventReadBy>,
25
26 pub received_by: Vec<EventReceivedBy>,
28}
29
30#[derive(Debug, Serialize, Deserialize, Clone)]
32pub struct EventReadBy {
33 pub user_huid: Uuid,
35
36 pub read_at: DateTime<Utc>,
38}
39
40#[derive(Debug, Serialize, Deserialize, Clone)]
42pub struct EventReceivedBy {
43 pub user_huid: Uuid,
45
46 pub received_at: DateTime<Utc>,
48}
49
50#[derive(Debug, Serialize, Deserialize, Clone)]
52#[serde(tag = "reason")]
53pub enum EventStatusError {
54 #[serde(rename(serialize = "event_not_found", deserialize = "event_not_found"))]
56 EventNotFound(EventNotFound),
57
58 #[serde(rename(serialize = "messaging_service_error", deserialize = "messaging_service_error"))]
60 MessagingServiceError(MessagingServiceError),
61
62 #[serde(other)]
65 Other,
66}
67
68
69#[derive(Debug, Serialize, Deserialize, Clone)]
71pub struct EventNotFound {
72 pub errors: Vec<String>,
74
75 pub error_data: EventNotFoundData,
77}
78
79#[derive(Debug, Serialize, Deserialize, Clone)]
80pub struct EventNotFoundData {
81 pub sync_id: Uuid
83}
84
85#[derive(Debug, Serialize, Deserialize, Clone)]
87pub struct MessagingServiceError {
88 pub errors: Vec<String>,
90
91 pub error_data: MessagingServiceErrorData,
93}
94
95#[derive(Debug, Serialize, Deserialize, Clone)]
96pub struct MessagingServiceErrorData {
97 pub sync_id: Uuid
99}