| 1 | // inner_events.go provides EventsAPI particular inner events |
| 2 | |
| 3 | package slackevents |
| 4 | |
| 5 | import ( |
| 6 | "github.com/slack-go/slack" |
| 7 | ) |
| 8 | |
| 9 | // EventsAPIInnerEvent the inner event of a EventsAPI event_callback Event. |
| 10 | type EventsAPIInnerEvent struct { |
| 11 | Type string `json:"type"` |
| 12 | Data interface{} |
| 13 | } |
| 14 | |
| 15 | // AppMentionEvent is an (inner) EventsAPI subscribable event. |
| 16 | type AppMentionEvent struct { |
| 17 | Type string `json:"type"` |
| 18 | User string `json:"user"` |
| 19 | Text string `json:"text"` |
| 20 | TimeStamp string `json:"ts"` |
| 21 | ThreadTimeStamp string `json:"thread_ts"` |
| 22 | Channel string `json:"channel"` |
| 23 | EventTimeStamp string `json:"event_ts"` |
| 24 | |
| 25 | // When Message comes from a channel that is shared between workspaces |
| 26 | UserTeam string `json:"user_team,omitempty"` |
| 27 | SourceTeam string `json:"source_team,omitempty"` |
| 28 | |
| 29 | // BotID is filled out when a bot triggers the app_mention event |
| 30 | BotID string `json:"bot_id,omitempty"` |
| 31 | } |
| 32 | |
| 33 | // AppHomeOpenedEvent Your Slack app home was opened. |
| 34 | type AppHomeOpenedEvent struct { |
| 35 | Type string `json:"type"` |
| 36 | User string `json:"user"` |
| 37 | Channel string `json:"channel"` |
| 38 | EventTimeStamp string `json:"event_ts"` |
| 39 | Tab string `json:"tab"` |
| 40 | View slack.View `json:"view"` |
| 41 | } |
| 42 | |
| 43 | // AppUninstalledEvent Your Slack app was uninstalled. |
| 44 | type AppUninstalledEvent struct { |
| 45 | Type string `json:"type"` |
| 46 | } |
| 47 | |
| 48 | // ChannelCreatedEvent represents the Channel created event |
| 49 | type ChannelCreatedEvent struct { |
| 50 | Type string `json:"type"` |
| 51 | Channel ChannelCreatedInfo `json:"channel"` |
| 52 | EventTimestamp string `json:"event_ts"` |
| 53 | } |
| 54 | |
| 55 | // ChannelDeletedEvent represents the Channel deleted event |
| 56 | type ChannelDeletedEvent struct { |
| 57 | Type string `json:"type"` |
| 58 | Channel string `json:"channel"` |
| 59 | EventTimestamp string `json:"event_ts"` |
| 60 | } |
| 61 | |
| 62 | // ChannelArchiveEvent represents the Channel archive event |
| 63 | type ChannelArchiveEvent struct { |
| 64 | Type string `json:"type"` |
| 65 | Channel string `json:"channel"` |
| 66 | User string `json:"user"` |
| 67 | EventTimestamp string `json:"event_ts"` |
| 68 | } |
| 69 | |
| 70 | // ChannelUnarchiveEvent represents the Channel unarchive event |
| 71 | type ChannelUnarchiveEvent struct { |
| 72 | Type string `json:"type"` |
| 73 | Channel string `json:"channel"` |
| 74 | User string `json:"user"` |
| 75 | EventTimestamp string `json:"event_ts"` |
| 76 | } |
| 77 | |
| 78 | // ChannelLeftEvent represents the Channel left event |
| 79 | type ChannelLeftEvent struct { |
| 80 | Type string `json:"type"` |
| 81 | Channel string `json:"channel"` |
| 82 | EventTimestamp string `json:"event_ts"` |
| 83 | } |
| 84 | |
| 85 | // ChannelRenameEvent represents the Channel rename event |
| 86 | type ChannelRenameEvent struct { |
| 87 | Type string `json:"type"` |
| 88 | Channel ChannelRenameInfo `json:"channel"` |
| 89 | EventTimestamp string `json:"event_ts"` |
| 90 | } |
| 91 | |
| 92 | // ChannelIDChangedEvent represents the Channel identifier changed event |
| 93 | type ChannelIDChangedEvent struct { |
| 94 | Type string `json:"type"` |
| 95 | OldChannelID string `json:"old_channel_id"` |
| 96 | NewChannelID string `json:"new_channel_id"` |
| 97 | EventTimestamp string `json:"event_ts"` |
| 98 | } |
| 99 | |
| 100 | // ChannelCreatedInfo represents the information associated with the Channel created event |
| 101 | type ChannelCreatedInfo struct { |
| 102 | ID string `json:"id"` |
| 103 | IsChannel bool `json:"is_channel"` |
| 104 | Name string `json:"name"` |
| 105 | Created int `json:"created"` |
| 106 | Creator string `json:"creator"` |
| 107 | } |
| 108 | |
| 109 | // ChannelRenameInfo represents the information associated with the Channel rename event |
| 110 | type ChannelRenameInfo struct { |
| 111 | ID string `json:"id"` |
| 112 | Name string `json:"name"` |
| 113 | Created int `json:"created"` |
| 114 | } |
| 115 | |
| 116 | // GroupDeletedEvent represents the Group deleted event |
| 117 | type GroupDeletedEvent struct { |
| 118 | Type string `json:"type"` |
| 119 | Channel string `json:"channel"` |
| 120 | EventTimestamp string `json:"event_ts"` |
| 121 | } |
| 122 | |
| 123 | // GroupArchiveEvent represents the Group archive event |
| 124 | type GroupArchiveEvent struct { |
| 125 | Type string `json:"type"` |
| 126 | Channel string `json:"channel"` |
| 127 | EventTimestamp string `json:"event_ts"` |
| 128 | } |
| 129 | |
| 130 | // GroupUnarchiveEvent represents the Group unarchive event |
| 131 | type GroupUnarchiveEvent struct { |
| 132 | Type string `json:"type"` |
| 133 | Channel string `json:"channel"` |
| 134 | EventTimestamp string `json:"event_ts"` |
| 135 | } |
| 136 | |
| 137 | // GroupLeftEvent represents the Group left event |
| 138 | type GroupLeftEvent struct { |
| 139 | Type string `json:"type"` |
| 140 | Channel string `json:"channel"` |
| 141 | EventTimestamp string `json:"event_ts"` |
| 142 | } |
| 143 | |
| 144 | // GroupRenameEvent represents the Group rename event |
| 145 | type GroupRenameEvent struct { |
| 146 | Type string `json:"type"` |
| 147 | Channel GroupRenameInfo `json:"channel"` |
| 148 | EventTimestamp string `json:"event_ts"` |
| 149 | } |
| 150 | |
| 151 | // GroupRenameInfo represents the information associated with the Group rename event |
| 152 | type GroupRenameInfo struct { |
| 153 | ID string `json:"id"` |
| 154 | Name string `json:"name"` |
| 155 | Created int `json:"created"` |
| 156 | } |
| 157 | |
| 158 | // GridMigrationFinishedEvent An enterprise grid migration has finished on this workspace. |
| 159 | type GridMigrationFinishedEvent struct { |
| 160 | Type string `json:"type"` |
| 161 | EnterpriseID string `json:"enterprise_id"` |
| 162 | } |
| 163 | |
| 164 | // GridMigrationStartedEvent An enterprise grid migration has started on this workspace. |
| 165 | type GridMigrationStartedEvent struct { |
| 166 | Type string `json:"type"` |
| 167 | EnterpriseID string `json:"enterprise_id"` |
| 168 | } |
| 169 | |
| 170 | // LinkSharedEvent A message was posted containing one or more links relevant to your application |
| 171 | type LinkSharedEvent struct { |
| 172 | Type string `json:"type"` |
| 173 | User string `json:"user"` |
| 174 | TimeStamp string `json:"ts"` |
| 175 | Channel string `json:"channel"` |
| 176 | // MessageTimeStamp can be both a numeric timestamp if the LinkSharedEvent corresponds to a sent |
| 177 | // message and (contrary to the field name) a uuid if the LinkSharedEvent is generated in the |
| 178 | // compose text area. |
| 179 | MessageTimeStamp string `json:"message_ts"` |
| 180 | ThreadTimeStamp string `json:"thread_ts"` |
| 181 | Links []sharedLinks `json:"links"` |
| 182 | EventTimestamp string `json:"event_ts"` |
| 183 | } |
| 184 | |
| 185 | type sharedLinks struct { |
| 186 | Domain string `json:"domain"` |
| 187 | URL string `json:"url"` |
| 188 | } |
| 189 | |
| 190 | // MessageEvent occurs when a variety of types of messages has been posted. |
| 191 | // Parse ChannelType to see which |
| 192 | // if ChannelType = "group", this is a private channel message |
| 193 | // if ChannelType = "channel", this message was sent to a channel |
| 194 | // if ChannelType = "im", this is a private message |
| 195 | // if ChannelType = "mim", A message was posted in a multiparty direct message channel |
| 196 | // TODO: Improve this so that it is not required to manually parse ChannelType |
| 197 | type MessageEvent struct { |
| 198 | // Basic Message Event - https://api.slack.com/events/message |
| 199 | ClientMsgID string `json:"client_msg_id"` |
| 200 | Type string `json:"type"` |
| 201 | User string `json:"user"` |
| 202 | Text string `json:"text"` |
| 203 | ThreadTimeStamp string `json:"thread_ts"` |
| 204 | TimeStamp string `json:"ts"` |
| 205 | Channel string `json:"channel"` |
| 206 | ChannelType string `json:"channel_type"` |
| 207 | EventTimeStamp string `json:"event_ts"` |
| 208 | |
| 209 | // When Message comes from a channel that is shared between workspaces |
| 210 | UserTeam string `json:"user_team,omitempty"` |
| 211 | SourceTeam string `json:"source_team,omitempty"` |
| 212 | |
| 213 | // Edited Message |
| 214 | Message *MessageEvent `json:"message,omitempty"` |
| 215 | PreviousMessage *MessageEvent `json:"previous_message,omitempty"` |
| 216 | Edited *Edited `json:"edited,omitempty"` |
| 217 | |
| 218 | // Message Subtypes |
| 219 | SubType string `json:"subtype,omitempty"` |
| 220 | |
| 221 | // bot_message (https://api.slack.com/events/message/bot_message) |
| 222 | BotID string `json:"bot_id,omitempty"` |
| 223 | Username string `json:"username,omitempty"` |
| 224 | Icons *Icon `json:"icons,omitempty"` |
| 225 | |
| 226 | Upload bool `json:"upload"` |
| 227 | Files []File `json:"files"` |
| 228 | |
| 229 | Attachments []slack.Attachment `json:"attachments,omitempty"` |
| 230 | |
| 231 | // Root is the message that was broadcast to the channel when the SubType is |
| 232 | // thread_broadcast. If this is not a thread_broadcast message event, this |
| 233 | // value is nil. |
| 234 | Root *MessageEvent `json:"root"` |
| 235 | } |
| 236 | |
| 237 | // MemberJoinedChannelEvent A member joined a public or private channel |
| 238 | type MemberJoinedChannelEvent struct { |
| 239 | Type string `json:"type"` |
| 240 | User string `json:"user"` |
| 241 | Channel string `json:"channel"` |
| 242 | ChannelType string `json:"channel_type"` |
| 243 | Team string `json:"team"` |
| 244 | Inviter string `json:"inviter"` |
| 245 | EventTimestamp string `json:"event_ts"` |
| 246 | } |
| 247 | |
| 248 | // MemberLeftChannelEvent A member left a public or private channel |
| 249 | type MemberLeftChannelEvent struct { |
| 250 | Type string `json:"type"` |
| 251 | User string `json:"user"` |
| 252 | Channel string `json:"channel"` |
| 253 | ChannelType string `json:"channel_type"` |
| 254 | Team string `json:"team"` |
| 255 | EventTimestamp string `json:"event_ts"` |
| 256 | } |
| 257 | |
| 258 | type pinEvent struct { |
| 259 | Type string `json:"type"` |
| 260 | User string `json:"user"` |
| 261 | Item Item `json:"item"` |
| 262 | Channel string `json:"channel_id"` |
| 263 | EventTimestamp string `json:"event_ts"` |
| 264 | HasPins bool `json:"has_pins,omitempty"` |
| 265 | } |
| 266 | |
| 267 | type reactionEvent struct { |
| 268 | Type string `json:"type"` |
| 269 | User string `json:"user"` |
| 270 | Reaction string `json:"reaction"` |
| 271 | ItemUser string `json:"item_user"` |
| 272 | Item Item `json:"item"` |
| 273 | EventTimestamp string `json:"event_ts"` |
| 274 | } |
| 275 | |
| 276 | // ReactionAddedEvent An reaction was added to a message - https://api.slack.com/events/reaction_added |
| 277 | type ReactionAddedEvent reactionEvent |
| 278 | |
| 279 | // ReactionRemovedEvent An reaction was removed from a message - https://api.slack.com/events/reaction_removed |
| 280 | type ReactionRemovedEvent reactionEvent |
| 281 | |
| 282 | // PinAddedEvent An item was pinned to a channel - https://api.slack.com/events/pin_added |
| 283 | type PinAddedEvent pinEvent |
| 284 | |
| 285 | // PinRemovedEvent An item was unpinned from a channel - https://api.slack.com/events/pin_removed |
| 286 | type PinRemovedEvent pinEvent |
| 287 | |
| 288 | type tokens struct { |
| 289 | Oauth []string `json:"oauth"` |
| 290 | Bot []string `json:"bot"` |
| 291 | } |
| 292 | |
| 293 | // TeamJoinEvent A new member joined a workspace - https://api.slack.com/events/team_join |
| 294 | type TeamJoinEvent struct { |
| 295 | Type string `json:"type"` |
| 296 | User *slack.User `json:"user"` |
| 297 | EventTimestamp string `json:"event_ts"` |
| 298 | } |
| 299 | |
| 300 | // TokensRevokedEvent APP's API tokens are revoked - https://api.slack.com/events/tokens_revoked |
| 301 | type TokensRevokedEvent struct { |
| 302 | Type string `json:"type"` |
| 303 | Tokens tokens `json:"tokens"` |
| 304 | EventTimestamp string `json:"event_ts"` |
| 305 | } |
| 306 | |
| 307 | // EmojiChangedEvent is the event of custom emoji has been added or changed |
| 308 | type EmojiChangedEvent struct { |
| 309 | Type string `json:"type"` |
| 310 | Subtype string `json:"subtype"` |
| 311 | EventTimeStamp string `json:"event_ts"` |
| 312 | |
| 313 | // filled out when custom emoji added |
| 314 | Name string `json:"name,omitempty"` |
| 315 | |
| 316 | // filled out when custom emoji removed |
| 317 | Names []string `json:"names,omitempty"` |
| 318 | |
| 319 | // filled out when custom emoji renamed |
| 320 | OldName string `json:"old_name,omitempty"` |
| 321 | NewName string `json:"new_name,omitempty"` |
| 322 | |
| 323 | // filled out when custom emoji added or renamed |
| 324 | Value string `json:"value,omitempty"` |
| 325 | } |
| 326 | |
| 327 | // WorkflowStepExecuteEvent is fired, if a workflow step of your app is invoked |
| 328 | type WorkflowStepExecuteEvent struct { |
| 329 | Type string `json:"type"` |
| 330 | CallbackID string `json:"callback_id"` |
| 331 | WorkflowStep EventWorkflowStep `json:"workflow_step"` |
| 332 | EventTimestamp string `json:"event_ts"` |
| 333 | } |
| 334 | |
| 335 | // MessageMetadataPostedEvent is sent, if a message with metadata is posted |
| 336 | type MessageMetadataPostedEvent struct { |
| 337 | Type string `json:"type"` |
| 338 | AppId string `json:"app_id"` |
| 339 | BotId string `json:"bot_id"` |
| 340 | UserId string `json:"user_id"` |
| 341 | TeamId string `json:"team_id"` |
| 342 | ChannelId string `json:"channel_id"` |
| 343 | Metadata *slack.SlackMetadata `json:"metadata"` |
| 344 | MessageTimestamp string `json:"message_ts"` |
| 345 | EventTimestamp string `json:"event_ts"` |
| 346 | } |
| 347 | |
| 348 | // MessageMetadataUpdatedEvent is sent, if a message with metadata is deleted |
| 349 | type MessageMetadataUpdatedEvent struct { |
| 350 | Type string `json:"type"` |
| 351 | ChannelId string `json:"channel_id"` |
| 352 | EventTimestamp string `json:"event_ts"` |
| 353 | PreviousMetadata *slack.SlackMetadata `json:"previous_metadata"` |
| 354 | AppId string `json:"app_id"` |
| 355 | BotId string `json:"bot_id"` |
| 356 | UserId string `json:"user_id"` |
| 357 | TeamId string `json:"team_id"` |
| 358 | MessageTimestamp string `json:"message_ts"` |
| 359 | Metadata *slack.SlackMetadata `json:"metadata"` |
| 360 | } |
| 361 | |
| 362 | // MessageMetadataDeletedEvent is sent, if a message with metadata is deleted |
| 363 | type MessageMetadataDeletedEvent struct { |
| 364 | Type string `json:"type"` |
| 365 | ChannelId string `json:"channel_id"` |
| 366 | EventTimestamp string `json:"event_ts"` |
| 367 | PreviousMetadata *slack.SlackMetadata `json:"previous_metadata"` |
| 368 | AppId string `json:"app_id"` |
| 369 | BotId string `json:"bot_id"` |
| 370 | UserId string `json:"user_id"` |
| 371 | TeamId string `json:"team_id"` |
| 372 | MessageTimestamp string `json:"message_ts"` |
| 373 | DeletedTimestamp string `json:"deleted_ts"` |
| 374 | } |
| 375 | |
| 376 | type EventWorkflowStep struct { |
| 377 | WorkflowStepExecuteID string `json:"workflow_step_execute_id"` |
| 378 | WorkflowID string `json:"workflow_id"` |
| 379 | WorkflowInstanceID string `json:"workflow_instance_id"` |
| 380 | StepID string `json:"step_id"` |
| 381 | Inputs *slack.WorkflowStepInputs `json:"inputs,omitempty"` |
| 382 | Outputs *[]slack.WorkflowStepOutput `json:"outputs,omitempty"` |
| 383 | } |
| 384 | |
| 385 | // JSONTime exists so that we can have a String method converting the date |
| 386 | type JSONTime int64 |
| 387 | |
| 388 | // Comment contains all the information relative to a comment |
| 389 | type Comment struct { |
| 390 | ID string `json:"id,omitempty"` |
| 391 | Created JSONTime `json:"created,omitempty"` |
| 392 | Timestamp JSONTime `json:"timestamp,omitempty"` |
| 393 | User string `json:"user,omitempty"` |
| 394 | Comment string `json:"comment,omitempty"` |
| 395 | } |
| 396 | |
| 397 | // File is a file upload |
| 398 | type File struct { |
| 399 | ID string `json:"id"` |
| 400 | Created int `json:"created"` |
| 401 | Timestamp int `json:"timestamp"` |
| 402 | Name string `json:"name"` |
| 403 | Title string `json:"title"` |
| 404 | Mimetype string `json:"mimetype"` |
| 405 | Filetype string `json:"filetype"` |
| 406 | PrettyType string `json:"pretty_type"` |
| 407 | User string `json:"user"` |
| 408 | Editable bool `json:"editable"` |
| 409 | Size int `json:"size"` |
| 410 | Mode string `json:"mode"` |
| 411 | IsExternal bool `json:"is_external"` |
| 412 | ExternalType string `json:"external_type"` |
| 413 | IsPublic bool `json:"is_public"` |
| 414 | PublicURLShared bool `json:"public_url_shared"` |
| 415 | DisplayAsBot bool `json:"display_as_bot"` |
| 416 | Username string `json:"username"` |
| 417 | URLPrivate string `json:"url_private"` |
| 418 | URLPrivateDownload string `json:"url_private_download"` |
| 419 | Thumb64 string `json:"thumb_64"` |
| 420 | Thumb80 string `json:"thumb_80"` |
| 421 | Thumb360 string `json:"thumb_360"` |
| 422 | Thumb360W int `json:"thumb_360_w"` |
| 423 | Thumb360H int `json:"thumb_360_h"` |
| 424 | Thumb480 string `json:"thumb_480"` |
| 425 | Thumb480W int `json:"thumb_480_w"` |
| 426 | Thumb480H int `json:"thumb_480_h"` |
| 427 | Thumb160 string `json:"thumb_160"` |
| 428 | Thumb720 string `json:"thumb_720"` |
| 429 | Thumb720W int `json:"thumb_720_w"` |
| 430 | Thumb720H int `json:"thumb_720_h"` |
| 431 | Thumb800 string `json:"thumb_800"` |
| 432 | Thumb800W int `json:"thumb_800_w"` |
| 433 | Thumb800H int `json:"thumb_800_h"` |
| 434 | Thumb960 string `json:"thumb_960"` |
| 435 | Thumb960W int `json:"thumb_960_w"` |
| 436 | Thumb960H int `json:"thumb_960_h"` |
| 437 | Thumb1024 string `json:"thumb_1024"` |
| 438 | Thumb1024W int `json:"thumb_1024_w"` |
| 439 | Thumb1024H int `json:"thumb_1024_h"` |
| 440 | ImageExifRotation int `json:"image_exif_rotation"` |
| 441 | OriginalW int `json:"original_w"` |
| 442 | OriginalH int `json:"original_h"` |
| 443 | Permalink string `json:"permalink"` |
| 444 | PermalinkPublic string `json:"permalink_public"` |
| 445 | } |
| 446 | |
| 447 | // Edited is included when a Message is edited |
| 448 | type Edited struct { |
| 449 | User string `json:"user"` |
| 450 | TimeStamp string `json:"ts"` |
| 451 | } |
| 452 | |
| 453 | // Icon is used for bot messages |
| 454 | type Icon struct { |
| 455 | IconURL string `json:"icon_url,omitempty"` |
| 456 | IconEmoji string `json:"icon_emoji,omitempty"` |
| 457 | } |
| 458 | |
| 459 | // Item is any type of slack message - message, file, or file comment. |
| 460 | type Item struct { |
| 461 | Type string `json:"type"` |
| 462 | Channel string `json:"channel,omitempty"` |
| 463 | Message *ItemMessage `json:"message,omitempty"` |
| 464 | File *File `json:"file,omitempty"` |
| 465 | Comment *Comment `json:"comment,omitempty"` |
| 466 | Timestamp string `json:"ts,omitempty"` |
| 467 | } |
| 468 | |
| 469 | // ItemMessage is the event message |
| 470 | type ItemMessage struct { |
| 471 | Type string `json:"type"` |
| 472 | User string `json:"user"` |
| 473 | Text string `json:"text"` |
| 474 | Timestamp string `json:"ts"` |
| 475 | PinnedTo []string `json:"pinned_to"` |
| 476 | ReplaceOriginal bool `json:"replace_original"` |
| 477 | DeleteOriginal bool `json:"delete_original"` |
| 478 | } |
| 479 | |
| 480 | // IsEdited checks if the MessageEvent is caused by an edit |
| 481 | func (e MessageEvent) IsEdited() bool { |
| 482 | return e.Message != nil && |
| 483 | e.Message.Edited != nil |
| 484 | } |
| 485 | |
| 486 | type EventsAPIType string |
| 487 | |
| 488 | const ( |
| 489 | // AppMention is an Events API subscribable event |
| 490 | AppMention = EventsAPIType("app_mention") |
| 491 | // AppHomeOpened Your Slack app home was opened |
| 492 | AppHomeOpened = EventsAPIType("app_home_opened") |
| 493 | // AppUninstalled Your Slack app was uninstalled. |
| 494 | AppUninstalled = EventsAPIType("app_uninstalled") |
| 495 | // ChannelCreated is sent when a new channel is created. |
| 496 | ChannelCreated = EventsAPIType("channel_created") |
| 497 | // ChannelDeleted is sent when a channel is deleted. |
| 498 | ChannelDeleted = EventsAPIType("channel_deleted") |
| 499 | // ChannelArchive is sent when a channel is archived. |
| 500 | ChannelArchive = EventsAPIType("channel_archive") |
| 501 | // ChannelUnarchive is sent when a channel is unarchived. |
| 502 | ChannelUnarchive = EventsAPIType("channel_unarchive") |
| 503 | // ChannelLeft is sent when a channel is left. |
| 504 | ChannelLeft = EventsAPIType("channel_left") |
| 505 | // ChannelRename is sent when a channel is rename. |
| 506 | ChannelRename = EventsAPIType("channel_rename") |
| 507 | // ChannelIDChanged is sent when a channel identifier is changed. |
| 508 | ChannelIDChanged = EventsAPIType("channel_id_changed") |
| 509 | // GroupDeleted is sent when a group is deleted. |
| 510 | GroupDeleted = EventsAPIType("group_deleted") |
| 511 | // GroupArchive is sent when a group is archived. |
| 512 | GroupArchive = EventsAPIType("group_archive") |
| 513 | // GroupUnarchive is sent when a group is unarchived. |
| 514 | GroupUnarchive = EventsAPIType("group_unarchive") |
| 515 | // GroupLeft is sent when a group is left. |
| 516 | GroupLeft = EventsAPIType("group_left") |
| 517 | // GroupRename is sent when a group is renamed. |
| 518 | GroupRename = EventsAPIType("group_rename") |
| 519 | // GridMigrationFinished An enterprise grid migration has finished on this workspace. |
| 520 | GridMigrationFinished = EventsAPIType("grid_migration_finished") |
| 521 | // GridMigrationStarted An enterprise grid migration has started on this workspace. |
| 522 | GridMigrationStarted = EventsAPIType("grid_migration_started") |
| 523 | // LinkShared A message was posted containing one or more links relevant to your application |
| 524 | LinkShared = EventsAPIType("link_shared") |
| 525 | // Message A message was posted to a channel, private channel (group), im, or mim |
| 526 | Message = EventsAPIType("message") |
| 527 | // Member Joined Channel |
| 528 | MemberJoinedChannel = EventsAPIType("member_joined_channel") |
| 529 | // Member Left Channel |
| 530 | MemberLeftChannel = EventsAPIType("member_left_channel") |
| 531 | // PinAdded An item was pinned to a channel |
| 532 | PinAdded = EventsAPIType("pin_added") |
| 533 | // PinRemoved An item was unpinned from a channel |
| 534 | PinRemoved = EventsAPIType("pin_removed") |
| 535 | // ReactionAdded An reaction was added to a message |
| 536 | ReactionAdded = EventsAPIType("reaction_added") |
| 537 | // ReactionRemoved An reaction was removed from a message |
| 538 | ReactionRemoved = EventsAPIType("reaction_removed") |
| 539 | // TeamJoin A new user joined the workspace |
| 540 | TeamJoin = EventsAPIType("team_join") |
| 541 | // TokensRevoked APP's API tokes are revoked |
| 542 | TokensRevoked = EventsAPIType("tokens_revoked") |
| 543 | // EmojiChanged A custom emoji has been added or changed |
| 544 | EmojiChanged = EventsAPIType("emoji_changed") |
| 545 | // WorkflowStepExecute Happens, if a workflow step of your app is invoked |
| 546 | WorkflowStepExecute = EventsAPIType("workflow_step_execute") |
| 547 | // MessageMetadataPosted A message with metadata was posted |
| 548 | MessageMetadataPosted = EventsAPIType("message_metadata_posted") |
| 549 | // MessageMetadataPosted A message with metadata was updated |
| 550 | MessageMetadataUpdated = EventsAPIType("message_metadata_updated") |
| 551 | // MessageMetadataPosted A message with metadata was deleted |
| 552 | MessageMetadataDeleted = EventsAPIType("message_metadata_deleted") |
| 553 | ) |
| 554 | |
| 555 | // EventsAPIInnerEventMapping maps INNER Event API events to their corresponding struct |
| 556 | // implementations. The structs should be instances of the unmarshalling |
| 557 | // target for the matching event type. |
| 558 | var EventsAPIInnerEventMapping = map[EventsAPIType]interface{}{ |
| 559 | AppMention: AppMentionEvent{}, |
| 560 | AppHomeOpened: AppHomeOpenedEvent{}, |
| 561 | AppUninstalled: AppUninstalledEvent{}, |
| 562 | ChannelCreated: ChannelCreatedEvent{}, |
| 563 | ChannelDeleted: ChannelDeletedEvent{}, |
| 564 | ChannelArchive: ChannelArchiveEvent{}, |
| 565 | ChannelUnarchive: ChannelUnarchiveEvent{}, |
| 566 | ChannelLeft: ChannelLeftEvent{}, |
| 567 | ChannelRename: ChannelRenameEvent{}, |
| 568 | ChannelIDChanged: ChannelIDChangedEvent{}, |
| 569 | GroupDeleted: GroupDeletedEvent{}, |
| 570 | GroupArchive: GroupArchiveEvent{}, |
| 571 | GroupUnarchive: GroupUnarchiveEvent{}, |
| 572 | GroupLeft: GroupLeftEvent{}, |
| 573 | GroupRename: GroupRenameEvent{}, |
| 574 | GridMigrationFinished: GridMigrationFinishedEvent{}, |
| 575 | GridMigrationStarted: GridMigrationStartedEvent{}, |
| 576 | LinkShared: LinkSharedEvent{}, |
| 577 | Message: MessageEvent{}, |
| 578 | MemberJoinedChannel: MemberJoinedChannelEvent{}, |
| 579 | MemberLeftChannel: MemberLeftChannelEvent{}, |
| 580 | PinAdded: PinAddedEvent{}, |
| 581 | PinRemoved: PinRemovedEvent{}, |
| 582 | ReactionAdded: ReactionAddedEvent{}, |
| 583 | ReactionRemoved: ReactionRemovedEvent{}, |
| 584 | TeamJoin: TeamJoinEvent{}, |
| 585 | TokensRevoked: TokensRevokedEvent{}, |
| 586 | EmojiChanged: EmojiChangedEvent{}, |
| 587 | WorkflowStepExecute: WorkflowStepExecuteEvent{}, |
| 588 | MessageMetadataPosted: MessageMetadataPostedEvent{}, |
| 589 | MessageMetadataUpdated: MessageMetadataUpdatedEvent{}, |
| 590 | MessageMetadataDeleted: MessageMetadataDeletedEvent{}, |
| 591 | } |