| 1 | // outer_events.go provides EventsAPI particular outer events |
| 2 | |
| 3 | package slackeventsscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/ |
| 4 | |
| 5 | import ( |
| 6 | "encoding/jsonscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/" |
| 7 | ) |
| 8 | |
| 9 | // EventsAPIEvent is the base EventsAPIEvent |
| 10 | type EventsAPIEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIEvent# struct { |
| 11 | Tokenscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIEvent#Token. string `json:"token"` |
| 12 | TeamIDscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIEvent#TeamID. string `json:"team_id"` |
| 13 | Typescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIEvent#Type. string `json:"type"` |
| 14 | APIAppIDscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIEvent#APIAppID. string `json:"api_app_id"` |
| 15 | EnterpriseIDscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIEvent#EnterpriseID. string `json:"enterprise_id"` |
| 16 | Datascip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIEvent#Data. interface{} |
| 17 | InnerEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIEvent#InnerEvent. EventsAPIInnerEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIInnerEvent# |
| 18 | } |
| 19 | |
| 20 | // EventsAPIURLVerificationEvent received when configuring a EventsAPI driven app |
| 21 | type EventsAPIURLVerificationEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIURLVerificationEvent# struct { |
| 22 | Tokenscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIURLVerificationEvent#Token. string `json:"token"` |
| 23 | Challengescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIURLVerificationEvent#Challenge. string `json:"challenge"` |
| 24 | Typescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIURLVerificationEvent#Type. string `json:"type"` |
| 25 | } |
| 26 | |
| 27 | // ChallengeResponse is a response to a EventsAPIEvent URLVerification challenge |
| 28 | type ChallengeResponsescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/ChallengeResponse# struct { |
| 29 | Challengescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/ChallengeResponse#Challenge. string |
| 30 | } |
| 31 | |
| 32 | // EventsAPICallbackEvent is the main (outer) EventsAPI event. |
| 33 | type EventsAPICallbackEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPICallbackEvent# struct { |
| 34 | Typescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPICallbackEvent#Type. string `json:"type"` |
| 35 | Tokenscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPICallbackEvent#Token. string `json:"token"` |
| 36 | TeamIDscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPICallbackEvent#TeamID. string `json:"team_id"` |
| 37 | APIAppIDscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPICallbackEvent#APIAppID. string `json:"api_app_id"` |
| 38 | InnerEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPICallbackEvent#InnerEvent. *jsonscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/.RawMessagescip-go gomod github.com/golang/go/src go1.16 `encoding/json`/RawMessage# `json:"event"` |
| 39 | AuthedUsersscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPICallbackEvent#AuthedUsers. []string `json:"authed_users"` |
| 40 | AuthedTeamsscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPICallbackEvent#AuthedTeams. []string `json:"authed_teams"` |
| 41 | EventIDscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPICallbackEvent#EventID. string `json:"event_id"` |
| 42 | EventTimescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPICallbackEvent#EventTime. int `json:"event_time"` |
| 43 | EventContextscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPICallbackEvent#EventContext. string `json:"event_context"` |
| 44 | } |
| 45 | |
| 46 | // EventsAPIAppRateLimited indicates your app's event subscriptions are being rate limited |
| 47 | type EventsAPIAppRateLimitedscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIAppRateLimited# struct { |
| 48 | Typescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIAppRateLimited#Type. string `json:"type"` |
| 49 | Tokenscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIAppRateLimited#Token. string `json:"token"` |
| 50 | TeamIDscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIAppRateLimited#TeamID. string `json:"team_id"` |
| 51 | MinuteRateLimitedscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIAppRateLimited#MinuteRateLimited. int `json:"minute_rate_limited"` |
| 52 | APIAppIDscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIAppRateLimited#APIAppID. string `json:"api_app_id"` |
| 53 | } |
| 54 | |
| 55 | const ( |
| 56 | // CallbackEvent is the "outer" event of an EventsAPI event. |
| 57 | CallbackEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/CallbackEvent. = "event_callback" |
| 58 | // URLVerification is an event used when configuring your EventsAPI app |
| 59 | URLVerificationscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/URLVerification. = "url_verification" |
| 60 | // AppRateLimited indicates your app's event subscriptions are being rate limited |
| 61 | AppRateLimitedscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/AppRateLimited. = "app_rate_limited" |
| 62 | ) |
| 63 | |
| 64 | // EventsAPIEventMap maps OUTER Event API events to their corresponding struct |
| 65 | // implementations. The structs should be instances of the unmarshalling |
| 66 | // target for the matching event type. |
| 67 | var EventsAPIEventMapscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIEventMap. = map[string]interface{}{ |
| 68 | CallbackEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/CallbackEvent.: EventsAPICallbackEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPICallbackEvent#{}, |
| 69 | URLVerificationscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/URLVerification.: EventsAPIURLVerificationEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIURLVerificationEvent#{}, |
| 70 | AppRateLimitedscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/AppRateLimited.: EventsAPIAppRateLimitedscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack/slackevents`/EventsAPIAppRateLimited#{}, |
| 71 | } |