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
 */

/// InviteResponseOneOf1 : Group channel invite



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct InviteResponseOneOf1 {
    #[serde(rename = "type")]
    pub _type: Type,
    /// Invite code
    #[serde(rename = "code")]
    pub code: String,
    /// 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>>,
}

impl InviteResponseOneOf1 {
    /// Group channel invite
    pub fn new(_type: Type, code: String, channel_id: String, channel_name: String, user_name: String) -> InviteResponseOneOf1 {
        InviteResponseOneOf1 {
            _type,
            code,
            channel_id,
            channel_name,
            channel_description: None,
            user_name,
            user_avatar: None,
        }
    }
}

/// 
#[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
    }
}