Repository: google/go-github
Pull request #2244 (2021-12-30 19:24:02)

add team.html_url
When performing an edit of a team, the html_url is required `invalid: [status.html_url: Required value]`

However, that field is missing from the struct, so the previous GET does not marshal this data (even though it is included in the response)
```
gh api orgs/testing-org/teams/test-secret-team
{
  "name": "test-secret-team",
  "id": 152,
  "node_id": "hmmm==",
  "slug": "test-secret-team",
  "description": "",
  "privacy": "secret",
  "url": "https://github.myorg.com/api/v3/organizations/63/team/152",
  "html_url": "https://github.myorg.com/orgs/testing-org/teams/test-secret-team",
  "members_url": "https://github.myorg.com/api/v3/organizations/63/team/152/members{/member}",
  "repositories_url": "https://github.myorg.com/api/v3/organizations/63/team/152/repos",
}
```

Signed-off-by: Jake Plimack <jplimack@tesla.com>

gmlewis: Thank you, @jplimack !
Please run `go generate ./...` and push the results to the PR, and then tests should pass.
See CONTRIBUTING.md for more info.
jplimack: Thanks for your help @gmlewis !  Ive pushed up the generated files
codecov[bot]: # [Codecov](https://codecov.io/gh/google/go-github/pull/2244?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) Report
> Merging [#2244](https://codecov.io/gh/google/go-github/pull/2244?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (80c6c2f) into [master](https://codecov.io/gh/google/go-github/commit/a899e0fadbec05084dfdec2348894072025e4d42?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (a899e0f) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/google/go-github/pull/2244/graphs/tree.svg?width=650&height=150&src=pr&token=EgYjGjZlI0&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)](https://codecov.io/gh/google/go-github/pull/2244?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)

```diff
@@           Coverage Diff           @@
##           master    #2244   +/-   ##
=======================================
  Coverage   97.80%   97.80%           
=======================================
  Files         113      113           
  Lines       10205    10205           
=======================================
  Hits         9981     9981           
  Misses        156      156           
  Partials       68       68           
```


| [Impacted Files](https://codecov.io/gh/google/go-github/pull/2244?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) | Coverage Δ | |
|---|---|---|
| [github/teams.go](https://codecov.io/gh/google/go-github/pull/2244/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-Z2l0aHViL3RlYW1zLmdv) | `98.14% <ø> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/google/go-github/pull/2244?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/google/go-github/pull/2244?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google). Last update [a899e0f...80c6c2f](https://codecov.io/gh/google/go-github/pull/2244?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).


Patch:
diff --git a/github/github-accessors.go b/github/github-accessors.go
index 7ed9610d..aa246668 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/teams.go b/github/teams.go
index 71cbbab6..82d4093b 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"`


Test patch:
diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go
index 2dfed628..215b22a9 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 41228378..86fa0ece 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)
 	}