use models::space::{AllowJoinLevel, MemberStatus, MessageNotifications}; use serde::{Deserialize, Serialize}; use time::OffsetDateTime; use utoipa::{IntoParams, ToSchema}; use uuid::Uuid; pub const RESERVED_SPACE_NAMES: [&str; 1] = ["explore"]; pub use api::users::UserDto; pub use api::{resolve_space_image_url, resolve_user_avatar_url}; #[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] pub struct SpaceDto { pub id: Uuid, pub lower_name: String, pub name: String, pub description: Option, pub owner: Option, pub avatar_url: Option, pub is_private: bool, pub is_active: bool, pub allow_join: bool, pub allow_invite: bool, pub members_count: i64, pub welcome_message: Option, pub allow_join_level: AllowJoinLevel, pub member_must_enable_2fa: bool, pub welcome_object: Option, pub created_at: OffsetDateTime, pub updated_at: OffsetDateTime, } pub use api::pagination::PageQuery; #[derive(Debug, Clone, Deserialize, IntoParams, ToSchema)] pub struct SpacePath { pub space_name: String, } #[derive(Debug, Clone, Deserialize, IntoParams, ToSchema)] pub struct MemberPath { pub space_name: String, pub user_id: i64, } #[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] pub struct MemberDto { pub space_id: Uuid, pub user: Option, pub alias_name: Option, pub alias_avatar_url: Option, pub status: MemberStatus, pub last_active_at: Option, pub left_at: Option, pub invited_at: Option, pub invited_by: Option, pub joined_at: OffsetDateTime, pub created_at: OffsetDateTime, pub updated_at: Option, pub message_notifications: MessageNotifications, pub muted: bool, pub mute_until: Option, pub mobile_push: bool, pub suppress_everyone: bool, pub suppress_roles: bool, pub hide_muted_channels: bool, }