sfr_types/block/
context.rs

1//! Context block.
2//!
3//! <https://api.slack.com/reference/block-kit/blocks#context>
4
5use crate::{BlockId, Element};
6use serde::Serialize;
7
8/// Context block.
9///
10/// <https://api.slack.com/reference/block-kit/blocks#context>
11#[derive(Serialize, Debug, Clone)]
12#[serde(rename_all = "snake_case")]
13pub struct ContextBlock {
14    /// 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).
15    pub elements: Vec<Element>,
16
17    /// A unique identifier for a block.
18    #[serde(skip_serializing_if = "Option::is_none")]
19    pub block_id: Option<BlockId>,
20}