Skip to content

Commit

Permalink
events: add TeamAccessGranted and TeamAccessRevoked
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenwan-opal committed Dec 7, 2022
1 parent 657f4e7 commit 7a7c3e2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions slackevents/inner_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,18 @@ func (e MessageEvent) IsEdited() bool {
e.Message.Edited != nil
}

// TeamAccessGrantedEvent is sent if access to teams was granted for your org-wide app.
type TeamAccessGrantedEvent struct {
Type string `json:"type"`
TeamIDs []string `json:"team_ids"`
}

// TeamAccessRevokedEvent is sent if access to teams was revoked for your org-wide app.
type TeamAccessRevokedEvent struct {
Type string `json:"type"`
TeamIDs []string `json:"team_ids"`
}

type EventsAPIType string

const (
Expand Down Expand Up @@ -599,6 +611,10 @@ const (
MessageMetadataUpdated = EventsAPIType("message_metadata_updated")
// MessageMetadataPosted A message with metadata was deleted
MessageMetadataDeleted = EventsAPIType("message_metadata_deleted")
// TeamAccessGranted is sent if access to teams was granted for your org-wide app.
TeamAccessGranted = EventsAPIType("team_access_granted")
// TeamAccessrevoked is sent if access to teams was revoked for your org-wide app.
TeamAccessrevoked = EventsAPIType("team_access_revoked")
)

// EventsAPIInnerEventMapping maps INNER Event API events to their corresponding struct
Expand Down Expand Up @@ -641,4 +657,6 @@ var EventsAPIInnerEventMapping = map[EventsAPIType]interface{}{
MessageMetadataPosted: MessageMetadataPostedEvent{},
MessageMetadataUpdated: MessageMetadataUpdatedEvent{},
MessageMetadataDeleted: MessageMetadataDeletedEvent{},
TeamAccessGranted: TeamAccessGrantedEvent{},
TeamAccessrevoked: TeamAccessRevokedEvent{},
}

0 comments on commit 7a7c3e2

Please sign in to comment.