File tree Expand file tree Collapse file tree
slack-api-model/src/main/java/com/slack/api/model/block Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .slack .api .model .block ;
22
3+ import com .slack .api .model .block .composition .SlackIconObject ;
34import com .slack .api .model .block .composition .TextObject ;
45import com .slack .api .model .block .element .BlockElement ;
56import com .slack .api .model .block .element .ImageElement ;
@@ -39,10 +40,10 @@ public class CardBlock implements LayoutBlock {
3940 private ImageElement icon ;
4041
4142 /**
42- * The name of a built-in Slack icon displayed next to the title and subtitle.
43+ * A built-in Slack icon displayed next to the title and subtitle.
4344 * Mutually exclusive with {@code icon}.
4445 */
45- private String slackIcon ;
46+ private SlackIconObject slackIcon ;
4647
4748 /**
4849 * The title of the card. Maximum length for the text in this field is 150 characters.
Original file line number Diff line number Diff line change @@ -87,4 +87,14 @@ public static FeedbackButtonObject feedbackButton(ModelConfigurator<FeedbackButt
8787 public static SlackFileObject slackFile (ModelConfigurator <SlackFileObject .SlackFileObjectBuilder > configurator ) {
8888 return configurator .configure (SlackFileObject .builder ()).build ();
8989 }
90+
91+ // SlackIconObject
92+
93+ public static SlackIconObject slackIcon (ModelConfigurator <SlackIconObject .SlackIconObjectBuilder > configurator ) {
94+ return configurator .configure (SlackIconObject .builder ()).build ();
95+ }
96+
97+ public static SlackIconObject slackIcon (String name ) {
98+ return SlackIconObject .builder ().name (name ).build ();
99+ }
90100}
Original file line number Diff line number Diff line change 1+ package com .slack .api .model .block .composition ;
2+
3+ import lombok .AllArgsConstructor ;
4+ import lombok .Builder ;
5+ import lombok .Data ;
6+ import lombok .NoArgsConstructor ;
7+
8+ /**
9+ * Defines a built-in Slack icon that can be displayed next to the title and subtitle of a card block.
10+ *
11+ * @see <a href="https://docs.slack.dev/reference/block-kit/composition-objects/slack-icon-object">document</a>
12+ */
13+ @ Data
14+ @ Builder
15+ @ NoArgsConstructor
16+ @ AllArgsConstructor
17+ public class SlackIconObject {
18+ public static final String TYPE = "icon" ;
19+ private final String type = TYPE ;
20+
21+ /**
22+ * The name of the built-in Slack icon.
23+ */
24+ private String name ;
25+ }
You can’t perform that action at this time.
0 commit comments