1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//! Context block.
//!
//! <https://api.slack.com/reference/block-kit/blocks#context>

use crate::{BlockId, Element};
use serde::Serialize;

/// Context block.
///
/// <https://api.slack.com/reference/block-kit/blocks#context>
#[derive(Serialize, Debug, Clone)]
#[serde(rename_all = "snake_case")]
pub struct ContextBlock {
    /// An array of [image elements](https://api.slack.com/reference/messaging/block-elements#image) and [text objects](https://api.slack.com/reference/messaging/composition-objects#text).
    pub elements: Vec<Element>,

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