1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//! 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>,
}