From 5be09cefe2c72e5e7ec911e728d187132a1e74b7 Mon Sep 17 00:00:00 2001 From: Tyler Rivera Date: Wed, 13 May 2020 17:37:18 -0400 Subject: [PATCH] Support GitHub child teams --- github/payload.go | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/github/payload.go b/github/payload.go index 67c16a5..a521280 100644 --- a/github/payload.go +++ b/github/payload.go @@ -2254,16 +2254,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"` @@ -5729,17 +5720,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"` @@ -6111,3 +6092,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"` +}