use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct EventStatusResponse {
pub result: EventStatusResult,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct EventStatusResult {
pub group_chat_id: Uuid,
pub sent_to: Vec<Uuid>,
pub read_by: Vec<EventReadBy>,
pub received_by: Vec<EventReceivedBy>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct EventReadBy {
pub user_huid: Uuid,
pub read_at: DateTime<Utc>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct EventReceivedBy {
pub user_huid: Uuid,
pub received_at: DateTime<Utc>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(tag = "reason")]
pub enum EventStatusError {
#[serde(rename(serialize = "event_not_found", deserialize = "event_not_found"))]
EventNotFound(EventNotFound),
#[serde(rename(serialize = "messaging_service_error", deserialize = "messaging_service_error"))]
MessagingServiceError(MessagingServiceError),
#[serde(other)]
Other,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct EventNotFound {
pub errors: Vec<String>,
pub error_data: EventNotFoundData,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct EventNotFoundData {
pub sync_id: Uuid
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct MessagingServiceError {
pub errors: Vec<String>,
pub error_data: MessagingServiceErrorData,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct MessagingServiceErrorData {
pub sync_id: Uuid
}