1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
pub mod elements;
mod actions;
mod context;
mod divider;
mod header;
mod image;
mod input;
mod section;
mod video;
use serde::Serialize;
pub use actions::{Actions, ActionsElement};
pub use context::{Context, ContextElement};
pub use divider::Divider;
pub use header::Header;
pub use image::Image;
pub use input::{Input, InputElement};
pub use section::{Accessory, Section};
pub use video::Video;
#[derive(Debug, Clone, Serialize)]
#[serde(untagged)]
pub enum Block {
Actions(Box<Actions>),
Context(Box<Context>),
Divider(Box<Divider>),
Header(Box<Header>),
Image(Box<Image>),
Input(Box<Input>),
Section(Box<Section>),
Video(Box<Video>),
}
impl From<Actions> for Block {
fn from(value: Actions) -> Self {
Self::Actions(Box::new(value))
}
}
impl From<Context> for Block {
fn from(value: Context) -> Self {
Self::Context(Box::new(value))
}
}
impl From<Divider> for Block {
fn from(value: Divider) -> Self {
Self::Divider(Box::new(value))
}
}
impl From<Header> for Block {
fn from(value: Header) -> Self {
Self::Header(Box::new(value))
}
}
impl From<Image> for Block {
fn from(value: Image) -> Self {
Self::Image(Box::new(value))
}
}
impl From<Input> for Block {
fn from(value: Input) -> Self {
Self::Input(Box::new(value))
}
}
impl From<Section> for Block {
fn from(value: Section) -> Self {
Self::Section(Box::new(value))
}
}
impl From<Video> for Block {
fn from(value: Video) -> Self {
Self::Video(Box::new(value))
}
}