rive_models/invite.rs
1use crate::{attachment::Attachment, channel::Channel, server::Server};
2use serde::Deserialize;
3
4/// Invite
5#[allow(clippy::large_enum_variant)]
6#[derive(Deserialize, Debug, Clone)]
7#[serde(tag = "type")]
8pub enum Invite {
9 /// Server channel invite
10 Server {
11 /// Invite code
12 code: String,
13 /// Id of the server
14 server_id: String,
15 /// Name of the server
16 server_name: String,
17 /// Attachment for server icon
18 server_icon: Option<Attachment>,
19 /// Attachment for server banner
20 server_banner: Option<Attachment>,
21 /// Enum of server flags
22 server_flags: Option<i32>,
23 /// Id of server channel
24 channel_id: String,
25 /// Name of server channel
26 channel_name: String,
27 /// Description of server channel
28 channel_description: Option<String>,
29 /// Name of user who created the invite
30 user_name: String,
31 /// Avatar of the user who created the invite
32 user_avatar: Option<Attachment>,
33 /// Number of members in this server
34 member_count: i64,
35 },
36 /// Group channel invite
37 Group {
38 /// Invite code
39 code: String,
40 /// Id of group channel
41 channel_id: String,
42 /// Name of group channel
43 channel_name: String,
44 /// Description of group channel
45 channel_description: Option<String>,
46 /// Name of user who created the invite
47 user_name: String,
48 /// Avatar of the user who created the invite
49 user_avatar: Option<Attachment>,
50 },
51}
52
53/// Invite join response
54#[derive(Deserialize, Debug, Clone)]
55#[serde(tag = "type")]
56pub enum InviteJoin {
57 Server {
58 /// Channels in the server
59 channels: Vec<Channel>,
60 /// Server we are joining
61 server: Server,
62 },
63}