use serde::{Deserialize, Serialize}; use crate::model::{instance::Instance, user::User}; #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct UserMessage { pub instance: Instance, pub message: UserMessageKind, } #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub enum UserMessageKind { Request(UserMessageRequest), Response(UserMessageResponse), } #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub enum UserMessageRequest { DisplayName(UserDisplayNameRequest), DisplayImage(UserDisplayImageRequest), Bio(UserBioRequest), } #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub enum UserMessageResponse { DisplayName(UserDisplayImageResponse), DisplayImage(UserDisplayImageResponse), Bio(UserBioResponse), } #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct UserDisplayNameRequest { pub user: User, } #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct UserDisplayNameResponse { pub display_name: String, } #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct UserDisplayImageRequest { pub user: User, } #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct UserDisplayImageResponse { pub image_url: String, } #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct UserBioRequest { pub user: User, } #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct UserBioResponse { pub bio: String, }