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

/// Webhook : Webhook



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Webhook {
    /// Webhook Id
    #[serde(rename = "id")]
    pub id: String,
    /// The name of the webhook
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "avatar", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub avatar: Option<Option<Box<crate::models::WebhookAvatar>>>,
    /// The channel this webhook belongs to
    #[serde(rename = "channel_id")]
    pub channel_id: String,
    /// The permissions for the webhook
    #[serde(rename = "permissions")]
    pub permissions: i32,
    /// The private token for the webhook
    #[serde(rename = "token", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub token: Option<Option<String>>,
}

impl Webhook {
    /// Webhook
    pub fn new(id: String, name: String, channel_id: String, permissions: i32) -> Webhook {
        Webhook {
            id,
            name,
            avatar: None,
            channel_id,
            permissions,
            token: None,
        }
    }
}