Skip to content

Commit

Permalink
Merge pull request #119 from tjrivera/child-team-payload-support
Browse files Browse the repository at this point in the history
GitHub child team payload support
  • Loading branch information
Toshik1978 authored Jan 6, 2021
2 parents 8a87033 + c31b743 commit e6bb8aa
Showing 1 changed file with 17 additions and 34 deletions.
51 changes: 17 additions & 34 deletions github/payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -2267,16 +2267,7 @@ type MembershipPayload struct {
Type string `json:"type"`
SiteAdmin bool `json:"site_admin"`
} `json:"sender"`
Team struct {
Name string `json:"name"`
ID int64 `json:"id"`
NodeID string `json:"node_id"`
Slug string `json:"slug"`
Permission string `json:"permission"`
URL string `json:"url"`
MembersURL string `json:"members_url"`
RepositoriesURL string `json:"repositories_url"`
} `json:"team"`
Team *Team `json:"team"`
Organization struct {
Login string `json:"login"`
ID int64 `json:"id"`
Expand Down Expand Up @@ -5693,19 +5684,8 @@ type StatusPayload struct {

// TeamPayload contains the information for GitHub's team hook event
type TeamPayload struct {
Action string `json:"action"`
Team struct {
Name string `json:"name"`
ID int64 `json:"id"`
NodeID string `json:"node_id"`
Slug string `json:"slug"`
Description string `json:"description"`
Privacy string `json:"privacy"`
URL string `json:"url"`
MembersURL string `json:"members_url"`
RepositoriesURL string `json:"repositories_url"`
Permission string `json:"permission"`
} `json:"team"`
Action string `json:"action"`
Team *Team `json:"team"`
Organization struct {
Login string `json:"login"`
ID int64 `json:"id"`
Expand Down Expand Up @@ -5744,17 +5724,7 @@ type TeamPayload struct {

// TeamAddPayload contains the information for GitHub's team_add hook event
type TeamAddPayload struct {
Team struct {
Name string `json:"name"`
ID int64 `json:"id"`
NodeID string `json:"node_id"`
Slug string `json:"slug"`
Description string `json:"description"`
Permission string `json:"permission"`
URL string `json:"url"`
MembersURL string `json:"members_url"`
RepositoriesURL string `json:"repositories_url"`
} `json:"team"`
Team *Team `json:"team"`
Repository struct {
ID int64 `json:"id"`
NodeID string `json:"node_id"`
Expand Down Expand Up @@ -6126,3 +6096,16 @@ type Label struct {
Color string `json:"color"`
Default bool `json:"default"`
}

// Team contains GitHub's Team information
type Team struct {
Name string `json:"name"`
ID int64 `json:"id"`
NodeID string `json:"node_id"`
Slug string `json:"slug"`
Permission string `json:"permission"`
URL string `json:"url"`
MembersURL string `json:"members_url"`
RepositoriesURL string `json:"repositories_url"`
Parent *Team `json:"parent,omitempty"`
}

0 comments on commit e6bb8aa

Please sign in to comment.