revolt_api 0.6.5

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

/// ChannelOneOf3 : Text channel belonging to a server



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ChannelOneOf3 {
    #[serde(rename = "channel_type")]
    pub channel_type: ChannelType,
    /// Unique Id
    #[serde(rename = "_id")]
    pub _id: String,
    /// Id of the server this channel belongs to
    #[serde(rename = "server")]
    pub server: String,
    /// Display name of the channel
    #[serde(rename = "name")]
    pub name: String,
    /// Channel description
    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub description: Option<Option<String>>,
    #[serde(rename = "icon", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub icon: Option<Option<Box<crate::models::ChannelOneOf2Icon>>>,
    /// Id of the last message sent in this channel
    #[serde(rename = "last_message_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub last_message_id: Option<Option<String>>,
    #[serde(rename = "default_permissions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub default_permissions: Option<Option<Box<crate::models::ChannelOneOf3DefaultPermissions>>>,
    /// Permissions assigned based on role to this channel
    #[serde(rename = "role_permissions", skip_serializing_if = "Option::is_none")]
    pub role_permissions: Option<::std::collections::HashMap<String, crate::models::OverrideField>>,
    /// Whether this channel is marked as not safe for work
    #[serde(rename = "nsfw", skip_serializing_if = "Option::is_none")]
    pub nsfw: Option<bool>,
}

impl ChannelOneOf3 {
    /// Text channel belonging to a server
    pub fn new(channel_type: ChannelType, _id: String, server: String, name: String) -> ChannelOneOf3 {
        ChannelOneOf3 {
            channel_type,
            _id,
            server,
            name,
            description: None,
            icon: None,
            last_message_id: None,
            default_permissions: None,
            role_permissions: None,
            nsfw: None,
        }
    }
}

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

impl Default for ChannelType {
    fn default() -> ChannelType {
        Self::TextChannel
    }
}