twilight-model 0.17.1

Discord API models for the Twilight ecosystem.
Documentation
use serde::{Deserialize, Serialize};

use super::Component;

/// Top-level layout [`Component`].
///
/// Labels wrap modal components with text as a label and an optional description.
#[derive(Clone, Debug, Eq, Hash, PartialEq, Deserialize, Serialize)]
pub struct Label {
    /// Optional identifier for the label.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<i32>,
    /// The label text; max 45 characters.
    #[allow(clippy::struct_field_names)]
    pub label: String,
    /// An optional description text for the label; max 100 characters.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// The component within the label.
    pub component: Box<Component>,
}