revolt_api 0.5.5

Rust typings for the Revolt API.
Documentation
/*
 * Revolt API
 *
 * Open source user-first chat platform.
 *
 * The version of the OpenAPI document: 0.5.5
 * Contact: contact@revolt.chat
 * Generated by: https://openapi-generator.tech
 */




#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct InviteResponse {
    #[serde(rename = "type")]
    pub _type: Type,
    /// Invite code
    #[serde(rename = "code")]
    pub code: String,
    /// Id of the server
    #[serde(rename = "server_id")]
    pub server_id: String,
    /// Name of the server
    #[serde(rename = "server_name")]
    pub server_name: String,
    /// Attachment for server icon
    #[serde(rename = "server_icon", skip_serializing_if = "Option::is_none")]
    pub server_icon: Option<Box<crate::models::File>>,
    /// Attachment for server banner
    #[serde(rename = "server_banner", skip_serializing_if = "Option::is_none")]
    pub server_banner: Option<Box<crate::models::File>>,
    /// Id of group channel
    #[serde(rename = "channel_id")]
    pub channel_id: String,
    /// Name of group channel
    #[serde(rename = "channel_name")]
    pub channel_name: String,
    /// Description of group channel
    #[serde(rename = "channel_description", skip_serializing_if = "Option::is_none")]
    pub channel_description: Option<String>,
    /// Name of user who created the invite
    #[serde(rename = "user_name")]
    pub user_name: String,
    /// Avatar of the user who created the invite
    #[serde(rename = "user_avatar", skip_serializing_if = "Option::is_none")]
    pub user_avatar: Option<Box<crate::models::File>>,
    /// Number of members in this server
    #[serde(rename = "member_count")]
    pub member_count: i64,
}

impl InviteResponse {
    pub fn new(_type: Type, code: String, server_id: String, server_name: String, channel_id: String, channel_name: String, user_name: String, member_count: i64) -> InviteResponse {
        InviteResponse {
            _type,
            code,
            server_id,
            server_name,
            server_icon: None,
            server_banner: None,
            channel_id,
            channel_name,
            channel_description: None,
            user_name,
            user_avatar: None,
            member_count,
        }
    }
}

/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "Group")]
    Group,
}

impl Default for Type {
    fn default() -> Type {
        Self::Group
    }
}