//! Header block.
//!
//! <https://api.slack.com/reference/block-kit/blocks#header>

use crate::BlockId;
use crate::TextObject;
use serde::Serialize;

/// Header block.
///
/// <https://api.slack.com/reference/block-kit/blocks#header>
#[derive(Serialize, Debug, Clone)]
#[serde(rename_all = "snake_case")]
pub struct HeaderBlock {
    /// The text for the block, in the form of a [`plain_text` text object](https://api.slack.com/reference/messaging/composition-objects#text).
    pub text: TextObject,

    /// A unique identifier for a block.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub block_id: Option<BlockId>,
}
