//! 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>,
}
