-
Notifications
You must be signed in to change notification settings - Fork 237
Expand file tree
/
Copy pathBlock.cs
More file actions
236 lines (220 loc) · 7.75 KB
/
Copy pathBlock.cs
File metadata and controls
236 lines (220 loc) · 7.75 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
namespace SlackAPI
{
//see https://api.slack.com/reference/messaging/blocks
public class Block : IBlock
{
public string type { get; set; }
public string block_id { get; set; }
public Text text { get; set; }
public Element accessory { get; set; }
public Element[] elements { get; set; }
public Text title { get; set; }
public string image_url { get; set; }
public string alt_text { get; set; }
public Text[] fields { get; set; }
}
public class SectionBlock : IBlock
{
public string type { get; } = BlockTypes.Section;
public string block_id { get; set; }
public Text text { get; set; }
public IElement accessory { get; set; }
public Text[] fields { get; set; }
}
public class DividerBlock : IBlock
{
public string type { get; } = BlockTypes.Divider;
public string block_id { get; set; }
}
public class ImageBlock : IBlock
{
public string type { get; } = BlockTypes.Image;
public string block_id { get; set; }
public Text title { get; set; }
public string image_url { get; set; }
public string alt_text { get; set; }
}
public class ActionsBlock : IBlock
{
public string type { get; } = BlockTypes.Actions;
public string block_id { get; set; }
public IElement[] elements { get; set; }
}
public class ContextBlock : IBlock
{
public string type { get; } = BlockTypes.Context;
public string block_id { get; set; }
public IElement[] elements { get; set; }
}
public class HeaderBlock : IBlock
{
public string type { get; } = BlockTypes.Header;
public Text text { get; set; }
public string block_id { get; set; }
}
public class Text : IElement
{
public string type { get; set; } = TextTypes.PlainText;
public string text { get; set; }
public bool? emoji { get; set; }
public bool? verbatim { get; set; }
}
public class Option
{
public Text text { get; set; }
public string value { get; set; }
}
public class OptionGroups
{
public Text label { get; set; }
public Option[] options { get; set; }
}
public class Confirm
{
public Text title { get; set; }
public Text text { get; set; }
public Text confirm { get; set; }
public Text deny { get; set; }
}
public class Element : IElement
{
public string type { get; set; }
public string action_id { get; set; }
public Text text { get; set; }
public string value { get; set; }
public Text placeholder { get; set; }
public Option[] options { get; set; }
public OptionGroups[] option_groups { get; set; }
public string image_url { get; set; }
public string alt_text { get; set; }
public string url { get; set; }
public string initial_date { get; set; }
public string initial_user { get; set; }
public string initial_channel { get; set; }
public string initial_conversation { get; set; }
public string initial_option { get; set; }
public int? min_query_length { get; set; }
public Confirm confirm { get; set; }
public string style { get; set; }
}
public class ImageElement : IElement
{
public string type { get; } = ElementTypes.Image;
public string image_url { get; set; }
public string alt_text { get; set; }
}
public class ButtonElement : IElement
{
public string type { get; } = ElementTypes.Button;
public string action_id { get; set; }
public Text text { get; set; }
public string value { get; set; }
public Text placeholder { get; set; }
public Option[] options { get; set; }
public OptionGroups[] option_groups { get; set; }
public string url { get; set; }
public Confirm confirm { get; set; }
public string style { get; set; }
}
public class StaticSelectElement : IElement
{
public string type { get; } = ElementTypes.StaticSelect;
public string action_id { get; set; }
public Text placeholder { get; set; }
public Option[] options { get; set; }
public OptionGroups[] option_groups { get; set; }
public string initial_option { get; set; }
public Confirm confirm { get; set; }
}
public class ExternalSelectElement : IElement
{
public string type { get; } = ElementTypes.ExternalSelect;
public string action_id { get; set; }
public Text placeholder { get; set; }
public string initial_option { get; set; }
public int min_query_length { get; set; }
public Confirm confirm { get; set; }
}
public class UserSelectElement : IElement
{
public string type { get; } = ElementTypes.UserSelect;
public string action_id { get; set; }
public Text placeholder { get; set; }
public string initial_user { get; set; }
public Confirm confirm { get; set; }
}
public class ConversationSelectElement : IElement
{
public string type { get; } = ElementTypes.ChannelSelect;
public string action_id { get; set; }
public Text placeholder { get; set; }
public string initial_conversation { get; set; }
public Confirm confirm { get; set; }
}
public class ChannelSelectElement : IElement
{
public string type { get; } = ElementTypes.ChannelSelect;
public string action_id { get; set; }
public Text placeholder { get; set; }
public string initial_channel { get; set; }
public Confirm confirm { get; set; }
}
public class OverflowElement : IElement
{
public string type { get; } = ElementTypes.Overflow;
public string action_id { get; set; }
public Option[] options { get; set; }
public Confirm confirm { get; set; }
}
public class DatePickerElement : IElement
{
public string type { get; } = ElementTypes.DatePicker;
public string action_id { get; set; }
public Text placeholder { get; set; }
public string initial_date { get; set; }
public Confirm confirm { get; set; }
}
public class View
{
public string type { get; set; }
public IBlock[] blocks { get; set; }
}
public static class ButtonStyles
{
public const string Primary = "primary";
public const string Danger = "danger";
}
public static class BlockTypes
{
public const string Section = "section";
public const string Divider = "divider";
public const string Actions = "actions";
public const string Context = "context";
public const string Image = "image";
public const string Header = "header";
}
public static class ViewTypes
{
public const string Home = "home";
public const string Modal = "modal";
}
public static class TextTypes
{
public const string Markdown = "mrkdwn";
public const string PlainText = "plain_text";
}
public static class ElementTypes
{
public const string Image = "image";
public const string Button = "button";
public const string StaticSelect = "static_select";
public const string ExternalSelect = "external_select";
public const string UserSelect = "users_select";
public const string ChannelSelect = "channel_select";
public const string ConversationSelect = "conversation_select";
public const string Overflow = "overflow";
public const string DatePicker = "datepicker";
}
public interface IElement { }
public interface IBlock { }
}