use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum UserIdType {
#[serde(rename = "user_id")]
UserId,
#[serde(rename = "union_id")]
UnionId,
#[serde(rename = "open_id")]
OpenId,
}
impl UserIdType {
pub fn as_str(&self) -> &'static str {
match self {
UserIdType::UserId => "user_id",
UserIdType::UnionId => "union_id",
UserIdType::OpenId => "open_id",
}
}
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum RoomIdType {
#[serde(rename = "room_id")]
RoomId,
#[serde(rename = "omm_room_id")]
OmmRoomId,
}
impl RoomIdType {
pub fn as_str(&self) -> &'static str {
match self {
RoomIdType::RoomId => "room_id",
RoomIdType::OmmRoomId => "omm_room_id",
}
}
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum MeetingStatus {
#[serde(rename = "not_started")]
NotStarted,
#[serde(rename = "in_progress")]
InProgress,
#[serde(rename = "ended")]
Ended,
#[serde(rename = "cancelled")]
Cancelled,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum MeetingType {
#[serde(rename = "instant")]
Instant,
#[serde(rename = "scheduled")]
Scheduled,
#[serde(rename = "recurring")]
Recurring,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Reserve {
pub id: String,
pub topic: String,
pub meeting_no: String,
pub password: Option<String>,
pub start_time: String,
pub end_time: String,
pub host_user: Option<UserInfo>,
pub status: MeetingStatus,
pub meeting_type: MeetingType,
pub create_time: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Meeting {
pub id: String,
pub topic: String,
pub meeting_no: String,
pub password: Option<String>,
pub start_time: String,
pub end_time: Option<String>,
pub host_user: Option<UserInfo>,
pub status: MeetingStatus,
pub participant_count: Option<i32>,
pub create_time: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct UserInfo {
pub id: String,
pub name: Option<String>,
pub avatar_url: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Room {
pub room_id: String,
pub name: String,
pub description: Option<String>,
pub capacity: Option<i32>,
pub location: Option<String>,
pub status: Option<String>,
pub create_time: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Recording {
pub recording_id: String,
pub meeting_id: String,
pub title: Option<String>,
pub duration: Option<i32>,
pub size: Option<i64>,
pub status: Option<String>,
pub start_time: Option<String>,
pub end_time: Option<String>,
}