sfr_types/block/image.rs
1//! Image block.
2//!
3//! <https://api.slack.com/reference/block-kit/blocks#image>
4
5use crate::BlockId;
6use crate::TextObject;
7use serde::Serialize;
8
9/// Image block.
10///
11/// <https://api.slack.com/reference/block-kit/blocks#image>
12#[derive(Serialize, Debug, Clone)]
13#[serde(rename_all = "snake_case")]
14pub struct ImageBlock {
15 /// A plain-text summary of the image.
16 pub alt_text: String,
17
18 /// The URL for a publicly hosted image.
19 #[serde(skip_serializing_if = "Option::is_none")]
20 pub image_url: Option<url::Url>,
21
22 // /// Slack file object.
23 // ///
24 // /// <https://api.slack.com/reference/block-kit/composition-objects#slack_file>
25 // #[serde(skip_serializing_if = "Option::is_none")]
26 // pub slack_file: Option<>,
27 /// An optional title for the image in the form of a [text object](https://api.slack.com/reference/messaging/composition-objects#text) that can only be of `type: plain_text`.
28 #[serde(skip_serializing_if = "Option::is_none")]
29 pub title: Option<TextObject>,
30
31 /// A unique identifier for a block.
32 #[serde(skip_serializing_if = "Option::is_none")]
33 pub block_id: Option<BlockId>,
34}