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

/// SnapshotWithContextContent : Snapshot of content



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct SnapshotWithContextContent {
    #[serde(rename = "_type")]
    pub _type: Type,
    /// Context before the message
    #[serde(rename = "_prior_context", skip_serializing_if = "Option::is_none")]
    pub _prior_context: Option<Vec<crate::models::Message>>,
    /// Context after the message
    #[serde(rename = "_leading_context", skip_serializing_if = "Option::is_none")]
    pub _leading_context: Option<Vec<crate::models::Message>>,
    /// Unique Id
    #[serde(rename = "_id")]
    pub _id: String,
    /// Unique value generated by client sending this message
    #[serde(rename = "nonce", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub nonce: Option<Option<String>>,
    /// Id of the channel this message was sent in
    #[serde(rename = "channel")]
    pub channel: String,
    /// Id of the user or webhook that sent this message
    #[serde(rename = "author")]
    pub author: String,
    #[serde(rename = "webhook", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub webhook: Option<Option<Box<crate::models::MessageWebhook>>>,
    /// Message content
    #[serde(rename = "content", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub content: Option<Option<String>>,
    #[serde(rename = "system", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub system: Option<Option<Box<crate::models::MessageSystem>>>,
    /// Array of attachments
    #[serde(rename = "attachments", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub attachments: Option<Option<Vec<crate::models::File>>>,
    /// ISO8601 formatted timestamp
    #[serde(rename = "edited", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub edited: Option<Option<String>>,
    /// Attached embeds to this message
    #[serde(rename = "embeds", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub embeds: Option<Option<Vec<crate::models::Embed>>>,
    /// Array of user ids mentioned in this message
    #[serde(rename = "mentions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub mentions: Option<Option<Vec<String>>>,
    /// Array of message ids this message is replying to
    #[serde(rename = "replies", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub replies: Option<Option<Vec<String>>>,
    /// Hashmap of emoji IDs to array of user IDs
    #[serde(rename = "reactions", skip_serializing_if = "Option::is_none")]
    pub reactions: Option<::std::collections::HashMap<String, Vec<String>>>,
    #[serde(rename = "interactions", skip_serializing_if = "Option::is_none")]
    pub interactions: Option<Box<crate::models::MessageInteractions>>,
    #[serde(rename = "masquerade", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub masquerade: Option<Option<Box<crate::models::MessageMasquerade>>>,
    /// User id of the owner
    #[serde(rename = "owner")]
    pub owner: String,
    /// Name of the server
    #[serde(rename = "name")]
    pub name: String,
    /// Description for the server
    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub description: Option<Option<String>>,
    /// Channels within this server
    #[serde(rename = "channels")]
    pub channels: Vec<String>,
    /// Categories for this server
    #[serde(rename = "categories", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub categories: Option<Option<Vec<crate::models::Category>>>,
    #[serde(rename = "system_messages", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub system_messages: Option<Option<Box<crate::models::ServerSystemMessages>>>,
    /// Roles for this server
    #[serde(rename = "roles", skip_serializing_if = "Option::is_none")]
    pub roles: Option<::std::collections::HashMap<String, crate::models::Role>>,
    /// Default set of server and channel permissions
    #[serde(rename = "default_permissions")]
    pub default_permissions: i64,
    #[serde(rename = "icon", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub icon: Option<Option<Box<crate::models::ServerIcon>>>,
    #[serde(rename = "banner", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub banner: Option<Option<Box<crate::models::ServerBanner>>>,
    /// Enum of user flags
    #[serde(rename = "flags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub flags: Option<Option<i32>>,
    /// Whether this server is flagged as not safe for work
    #[serde(rename = "nsfw", skip_serializing_if = "Option::is_none")]
    pub nsfw: Option<bool>,
    /// Whether to enable analytics
    #[serde(rename = "analytics", skip_serializing_if = "Option::is_none")]
    pub analytics: Option<bool>,
    /// Whether this server should be publicly discoverable
    #[serde(rename = "discoverable", skip_serializing_if = "Option::is_none")]
    pub discoverable: Option<bool>,
    /// Username
    #[serde(rename = "username")]
    pub username: String,
    /// Discriminator
    #[serde(rename = "discriminator")]
    pub discriminator: String,
    /// Display name
    #[serde(rename = "display_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub display_name: Option<Option<String>>,
    #[serde(rename = "avatar", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub avatar: Option<Option<Box<crate::models::UserAvatar>>>,
    /// Relationships with other users
    #[serde(rename = "relations", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub relations: Option<Option<Vec<crate::models::Relationship>>>,
    /// Bitfield of user badges
    #[serde(rename = "badges", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub badges: Option<Option<i32>>,
    #[serde(rename = "status", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub status: Option<Option<Box<crate::models::UserStatus>>>,
    #[serde(rename = "profile", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub profile: Option<Option<Box<crate::models::UserProfile>>>,
    /// Whether this user is privileged
    #[serde(rename = "privileged", skip_serializing_if = "Option::is_none")]
    pub privileged: Option<bool>,
    #[serde(rename = "bot", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub bot: Option<Option<Box<crate::models::UserBot>>>,
    #[serde(rename = "relationship", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub relationship: Option<Option<crate::models::RelationshipStatus>>,
    /// Whether this user is currently online
    #[serde(rename = "online", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub online: Option<Option<bool>>,
}

impl SnapshotWithContextContent {
    /// Snapshot of content
    pub fn new(_type: Type, _id: String, channel: String, author: String, owner: String, name: String, channels: Vec<String>, default_permissions: i64, username: String, discriminator: String) -> SnapshotWithContextContent {
        SnapshotWithContextContent {
            _type,
            _prior_context: None,
            _leading_context: None,
            _id,
            nonce: None,
            channel,
            author,
            webhook: None,
            content: None,
            system: None,
            attachments: None,
            edited: None,
            embeds: None,
            mentions: None,
            replies: None,
            reactions: None,
            interactions: None,
            masquerade: None,
            owner,
            name,
            description: None,
            channels,
            categories: None,
            system_messages: None,
            roles: None,
            default_permissions,
            icon: None,
            banner: None,
            flags: None,
            nsfw: None,
            analytics: None,
            discoverable: None,
            username,
            discriminator,
            display_name: None,
            avatar: None,
            relations: None,
            badges: None,
            status: None,
            profile: None,
            privileged: None,
            bot: None,
            relationship: None,
            online: None,
        }
    }
}

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

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