From 9fb389541d3759d474e9478ad064c0828b3eb975 Mon Sep 17 00:00:00 2001 From: Jake Plimack Date: Thu, 30 Dec 2021 10:27:13 -0800 Subject: [PATCH 1/3] add team.html_url Signed-off-by: Jake Plimack --- github/teams.go | 1 + 1 file changed, 1 insertion(+) diff --git a/github/teams.go b/github/teams.go index 71cbbab6a9a..82d4093b474 100644 --- a/github/teams.go +++ b/github/teams.go @@ -46,6 +46,7 @@ type Team struct { MembersCount *int `json:"members_count,omitempty"` ReposCount *int `json:"repos_count,omitempty"` Organization *Organization `json:"organization,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` MembersURL *string `json:"members_url,omitempty"` RepositoriesURL *string `json:"repositories_url,omitempty"` Parent *Team `json:"parent,omitempty"` From 49a7ffaf7fa85952f8aab61d150883a78ec8b0b8 Mon Sep 17 00:00:00 2001 From: Jake Plimack Date: Thu, 30 Dec 2021 11:29:04 -0800 Subject: [PATCH 2/3] signed-cla From 80c6c2f8f46ea5cdc31d019136923c53a07907d3 Mon Sep 17 00:00:00 2001 From: Jake Plimack Date: Thu, 30 Dec 2021 15:15:37 -0800 Subject: [PATCH 3/3] go-generate Signed-off-by: Jake Plimack --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/github-stringify_test.go | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 7ed9610d412..aa246668006 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -16156,6 +16156,14 @@ func (t *Team) GetDescription() string { return *t.Description } +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (t *Team) GetHTMLURL() string { + if t == nil || t.HTMLURL == nil { + return "" + } + return *t.HTMLURL +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (t *Team) GetID() int64 { if t == nil || t.ID == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 2dfed628c2e..215b22a97b4 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -18900,6 +18900,16 @@ func TestTeam_GetDescription(tt *testing.T) { t.GetDescription() } +func TestTeam_GetHTMLURL(tt *testing.T) { + var zeroValue string + t := &Team{HTMLURL: &zeroValue} + t.GetHTMLURL() + t = &Team{} + t.GetHTMLURL() + t = nil + t.GetHTMLURL() +} + func TestTeam_GetID(tt *testing.T) { var zeroValue int64 t := &Team{ID: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 41228378e1c..86fa0ece619 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1672,12 +1672,13 @@ func TestTeam_String(t *testing.T) { MembersCount: Int(0), ReposCount: Int(0), Organization: &Organization{}, + HTMLURL: String(""), MembersURL: String(""), RepositoriesURL: String(""), Parent: &Team{}, LDAPDN: String(""), } - want := `github.Team{ID:0, NodeID:"", Name:"", Description:"", URL:"", Slug:"", Permission:"", Privacy:"", MembersCount:0, ReposCount:0, Organization:github.Organization{}, MembersURL:"", RepositoriesURL:"", Parent:github.Team{}, LDAPDN:""}` + want := `github.Team{ID:0, NodeID:"", Name:"", Description:"", URL:"", Slug:"", Permission:"", Privacy:"", MembersCount:0, ReposCount:0, Organization:github.Organization{}, HTMLURL:"", MembersURL:"", RepositoriesURL:"", Parent:github.Team{}, LDAPDN:""}` if got := v.String(); got != want { t.Errorf("Team.String = %v, want %v", got, want) }