revolt_api/models/
invite_join_response_one_of_server.rs

1/*
2 * Revolt API
3 *
4 * Open source user-first chat platform.
5 *
6 * The version of the OpenAPI document: 0.6.5
7 * Contact: contact@revolt.chat
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// InviteJoinResponseOneOfServer : Server we are joining
12
13
14
15#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
16pub struct InviteJoinResponseOneOfServer {
17    /// Unique Id
18    #[serde(rename = "_id")]
19    pub _id: String,
20    /// User id of the owner
21    #[serde(rename = "owner")]
22    pub owner: String,
23    /// Name of the server
24    #[serde(rename = "name")]
25    pub name: String,
26    /// Description for the server
27    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub description: Option<Option<String>>,
29    /// Channels within this server
30    #[serde(rename = "channels")]
31    pub channels: Vec<String>,
32    /// Categories for this server
33    #[serde(rename = "categories", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub categories: Option<Option<Vec<crate::models::Category>>>,
35    #[serde(rename = "system_messages", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub system_messages: Option<Option<Box<crate::models::ServerSystemMessages>>>,
37    /// Roles for this server
38    #[serde(rename = "roles", skip_serializing_if = "Option::is_none")]
39    pub roles: Option<::std::collections::HashMap<String, crate::models::Role>>,
40    /// Default set of server and channel permissions
41    #[serde(rename = "default_permissions")]
42    pub default_permissions: i64,
43    #[serde(rename = "icon", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
44    pub icon: Option<Option<Box<crate::models::ServerIcon>>>,
45    #[serde(rename = "banner", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
46    pub banner: Option<Option<Box<crate::models::ServerBanner>>>,
47    /// Bitfield of server flags
48    #[serde(rename = "flags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
49    pub flags: Option<Option<i32>>,
50    /// Whether this server is flagged as not safe for work
51    #[serde(rename = "nsfw", skip_serializing_if = "Option::is_none")]
52    pub nsfw: Option<bool>,
53    /// Whether to enable analytics
54    #[serde(rename = "analytics", skip_serializing_if = "Option::is_none")]
55    pub analytics: Option<bool>,
56    /// Whether this server should be publicly discoverable
57    #[serde(rename = "discoverable", skip_serializing_if = "Option::is_none")]
58    pub discoverable: Option<bool>,
59}
60
61impl InviteJoinResponseOneOfServer {
62    /// Server we are joining
63    pub fn new(_id: String, owner: String, name: String, channels: Vec<String>, default_permissions: i64) -> InviteJoinResponseOneOfServer {
64        InviteJoinResponseOneOfServer {
65            _id,
66            owner,
67            name,
68            description: None,
69            channels,
70            categories: None,
71            system_messages: None,
72            roles: None,
73            default_permissions,
74            icon: None,
75            banner: None,
76            flags: None,
77            nsfw: None,
78            analytics: None,
79            discoverable: None,
80        }
81    }
82}
83
84