@@ -1133,12 +1133,25 @@ pub struct SlackRichTextSection {
11331133#[ derive( Debug , PartialEq , Clone , Serialize , Deserialize , Builder ) ]
11341134pub struct SlackRichTextList {
11351135 pub style : SlackRichTextListStyle ,
1136- pub elements : Vec < SlackRichTextSection > ,
1136+ pub elements : Vec < SlackRichTextListElement > ,
11371137 pub indent : Option < u64 > ,
11381138 pub offset : Option < u64 > ,
11391139 pub border : Option < u64 > ,
11401140}
11411141
1142+ #[ derive( Debug , PartialEq , Clone , Serialize , Deserialize ) ]
1143+ #[ serde( tag = "type" ) ]
1144+ pub enum SlackRichTextListElement {
1145+ #[ serde( rename = "rich_text_section" ) ]
1146+ Section ( SlackRichTextSection ) ,
1147+ }
1148+
1149+ impl From < SlackRichTextSection > for SlackRichTextListElement {
1150+ fn from ( element : SlackRichTextSection ) -> Self {
1151+ SlackRichTextListElement :: Section ( element)
1152+ }
1153+ }
1154+
11421155#[ derive( Debug , PartialEq , Clone , Serialize , Deserialize ) ]
11431156#[ serde( rename_all = "snake_case" ) ]
11441157pub enum SlackRichTextListStyle {
@@ -1492,6 +1505,16 @@ mod test {
14921505 assert_eq ! ( list. style, SlackRichTextListStyle :: Bullet ) ;
14931506 assert_eq ! ( list. elements. len( ) , 2 ) ;
14941507
1508+ // list items are SlackRichTextElement::Section
1509+ assert ! ( matches!(
1510+ & list. elements[ 0 ] ,
1511+ SlackRichTextListElement :: Section ( _)
1512+ ) ) ;
1513+ assert ! ( matches!(
1514+ & list. elements[ 1 ] ,
1515+ SlackRichTextListElement :: Section ( _)
1516+ ) ) ;
1517+
14951518 // preformatted
14961519 assert ! ( matches!(
14971520 & rich. elements[ 2 ] ,
0 commit comments