Repository: google/go-github
Pull request #2738 (2023-04-05 14:53:25)

Change PrivateRepos from int to int64
Fixes: #2736.

codecov[bot]: ## [Codecov](https://codecov.io/gh/google/go-github/pull/2738?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) Report
> Merging [#2738](https://codecov.io/gh/google/go-github/pull/2738?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (413dc46) into [master](https://codecov.io/gh/google/go-github/commit/5090d28a91592765a0471ce9c72821b7d97e03f5?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (5090d28) will **not change** coverage.
> The diff coverage is `n/a`.

```diff
@@           Coverage Diff           @@
##           master    #2738   +/-   ##
=======================================
  Coverage   98.05%   98.05%           
=======================================
  Files         132      132           
  Lines       11611    11611           
=======================================
  Hits        11385    11385           
  Misses        154      154           
  Partials       72       72           
```


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

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)

shaines1: Thank you @gmlewis 

LGTM!

Patch:
diff --git a/github/github-accessors.go b/github/github-accessors.go
index ca5cda6c..92a952ef 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -10879,7 +10879,7 @@ func (o *Organization) GetNodeID() string {
 }
 
 // GetOwnedPrivateRepos returns the OwnedPrivateRepos field if it's non-nil, zero value otherwise.
-func (o *Organization) GetOwnedPrivateRepos() int {
+func (o *Organization) GetOwnedPrivateRepos() int64 {
 	if o == nil || o.OwnedPrivateRepos == nil {
 		return 0
 	}
@@ -10951,7 +10951,7 @@ func (o *Organization) GetSecretScanningPushProtectionEnabledForNewRepos() bool
 }
 
 // GetTotalPrivateRepos returns the TotalPrivateRepos field if it's non-nil, zero value otherwise.
-func (o *Organization) GetTotalPrivateRepos() int {
+func (o *Organization) GetTotalPrivateRepos() int64 {
 	if o == nil || o.TotalPrivateRepos == nil {
 		return 0
 	}
@@ -12223,7 +12223,7 @@ func (p *Plan) GetName() string {
 }
 
 // GetPrivateRepos returns the PrivateRepos field if it's non-nil, zero value otherwise.
-func (p *Plan) GetPrivateRepos() int {
+func (p *Plan) GetPrivateRepos() int64 {
 	if p == nil || p.PrivateRepos == nil {
 		return 0
 	}
@@ -20655,7 +20655,7 @@ func (u *User) GetOrganizationsURL() string {
 }
 
 // GetOwnedPrivateRepos returns the OwnedPrivateRepos field if it's non-nil, zero value otherwise.
-func (u *User) GetOwnedPrivateRepos() int {
+func (u *User) GetOwnedPrivateRepos() int64 {
 	if u == nil || u.OwnedPrivateRepos == nil {
 		return 0
 	}
@@ -20759,7 +20759,7 @@ func (u *User) GetSuspendedAt() Timestamp {
 }
 
 // GetTotalPrivateRepos returns the TotalPrivateRepos field if it's non-nil, zero value otherwise.
-func (u *User) GetTotalPrivateRepos() int {
+func (u *User) GetTotalPrivateRepos() int64 {
 	if u == nil || u.TotalPrivateRepos == nil {
 		return 0
 	}
diff --git a/github/orgs.go b/github/orgs.go
index 837dda89..0c7e361b 100644
--- a/github/orgs.go
+++ b/github/orgs.go
@@ -36,8 +36,8 @@ type Organization struct {
 	Following                   *int       `json:"following,omitempty"`
 	CreatedAt                   *Timestamp `json:"created_at,omitempty"`
 	UpdatedAt                   *Timestamp `json:"updated_at,omitempty"`
-	TotalPrivateRepos           *int       `json:"total_private_repos,omitempty"`
-	OwnedPrivateRepos           *int       `json:"owned_private_repos,omitempty"`
+	TotalPrivateRepos           *int64     `json:"total_private_repos,omitempty"`
+	OwnedPrivateRepos           *int64     `json:"owned_private_repos,omitempty"`
 	PrivateGists                *int       `json:"private_gists,omitempty"`
 	DiskUsage                   *int       `json:"disk_usage,omitempty"`
 	Collaborators               *int       `json:"collaborators,omitempty"`
@@ -121,7 +121,7 @@ type Plan struct {
 	Name          *string `json:"name,omitempty"`
 	Space         *int    `json:"space,omitempty"`
 	Collaborators *int    `json:"collaborators,omitempty"`
-	PrivateRepos  *int    `json:"private_repos,omitempty"`
+	PrivateRepos  *int64  `json:"private_repos,omitempty"`
 	FilledSeats   *int    `json:"filled_seats,omitempty"`
 	Seats         *int    `json:"seats,omitempty"`
 }
diff --git a/github/users.go b/github/users.go
index d40d23e9..1b067010 100644
--- a/github/users.go
+++ b/github/users.go
@@ -41,8 +41,8 @@ type User struct {
 	SuspendedAt             *Timestamp `json:"suspended_at,omitempty"`
 	Type                    *string    `json:"type,omitempty"`
 	SiteAdmin               *bool      `json:"site_admin,omitempty"`
-	TotalPrivateRepos       *int       `json:"total_private_repos,omitempty"`
-	OwnedPrivateRepos       *int       `json:"owned_private_repos,omitempty"`
+	TotalPrivateRepos       *int64     `json:"total_private_repos,omitempty"`
+	OwnedPrivateRepos       *int64     `json:"owned_private_repos,omitempty"`
 	PrivateGists            *int       `json:"private_gists,omitempty"`
 	DiskUsage               *int       `json:"disk_usage,omitempty"`
 	Collaborators           *int       `json:"collaborators,omitempty"`


Test patch:
diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go
index bcf8ee1f..fae13c0e 100644
--- a/github/github-accessors_test.go
+++ b/github/github-accessors_test.go
@@ -12771,7 +12771,7 @@ func TestOrganization_GetNodeID(tt *testing.T) {
 }
 
 func TestOrganization_GetOwnedPrivateRepos(tt *testing.T) {
-	var zeroValue int
+	var zeroValue int64
 	o := &Organization{OwnedPrivateRepos: &zeroValue}
 	o.GetOwnedPrivateRepos()
 	o = &Organization{}
@@ -12858,7 +12858,7 @@ func TestOrganization_GetSecretScanningPushProtectionEnabledForNewRepos(tt *test
 }
 
 func TestOrganization_GetTotalPrivateRepos(tt *testing.T) {
-	var zeroValue int
+	var zeroValue int64
 	o := &Organization{TotalPrivateRepos: &zeroValue}
 	o.GetTotalPrivateRepos()
 	o = &Organization{}
@@ -14331,7 +14331,7 @@ func TestPlan_GetName(tt *testing.T) {
 }
 
 func TestPlan_GetPrivateRepos(tt *testing.T) {
-	var zeroValue int
+	var zeroValue int64
 	p := &Plan{PrivateRepos: &zeroValue}
 	p.GetPrivateRepos()
 	p = &Plan{}
@@ -24112,7 +24112,7 @@ func TestUser_GetOrganizationsURL(tt *testing.T) {
 }
 
 func TestUser_GetOwnedPrivateRepos(tt *testing.T) {
-	var zeroValue int
+	var zeroValue int64
 	u := &User{OwnedPrivateRepos: &zeroValue}
 	u.GetOwnedPrivateRepos()
 	u = &User{}
@@ -24239,7 +24239,7 @@ func TestUser_GetSuspendedAt(tt *testing.T) {
 }
 
 func TestUser_GetTotalPrivateRepos(tt *testing.T) {
-	var zeroValue int
+	var zeroValue int64
 	u := &User{TotalPrivateRepos: &zeroValue}
 	u.GetTotalPrivateRepos()
 	u = &User{}
diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go
index 60052554..8a78fb02 100644
--- a/github/github-stringify_test.go
+++ b/github/github-stringify_test.go
@@ -998,8 +998,8 @@ func TestOrganization_String(t *testing.T) {
 		Following:                            Int(0),
 		CreatedAt:                            &Timestamp{},
 		UpdatedAt:                            &Timestamp{},
-		TotalPrivateRepos:                    Int(0),
-		OwnedPrivateRepos:                    Int(0),
+		TotalPrivateRepos:                    Int64(0),
+		OwnedPrivateRepos:                    Int64(0),
 		PrivateGists:                         Int(0),
 		DiskUsage:                            Int(0),
 		Collaborators:                        Int(0),
@@ -1185,7 +1185,7 @@ func TestPlan_String(t *testing.T) {
 		Name:          String(""),
 		Space:         Int(0),
 		Collaborators: Int(0),
-		PrivateRepos:  Int(0),
+		PrivateRepos:  Int64(0),
 		FilledSeats:   Int(0),
 		Seats:         Int(0),
 	}
@@ -1951,8 +1951,8 @@ func TestUser_String(t *testing.T) {
 		SuspendedAt:             &Timestamp{},
 		Type:                    String(""),
 		SiteAdmin:               Bool(false),
-		TotalPrivateRepos:       Int(0),
-		OwnedPrivateRepos:       Int(0),
+		TotalPrivateRepos:       Int64(0),
+		OwnedPrivateRepos:       Int64(0),
 		PrivateGists:            Int(0),
 		DiskUsage:               Int(0),
 		Collaborators:           Int(0),
diff --git a/github/orgs_test.go b/github/orgs_test.go
index 1205ad00..ca85af25 100644
--- a/github/orgs_test.go
+++ b/github/orgs_test.go
@@ -452,7 +452,7 @@ func TestPlan_Marshal(t *testing.T) {
 		Name:          String("name"),
 		Space:         Int(1),
 		Collaborators: Int(1),
-		PrivateRepos:  Int(1),
+		PrivateRepos:  Int64(1),
 		FilledSeats:   Int(1),
 		Seats:         Int(1),
 	}
diff --git a/github/users_test.go b/github/users_test.go
index 96b2e926..f71df5cf 100644
--- a/github/users_test.go
+++ b/github/users_test.go
@@ -84,8 +84,8 @@ func TestUser_Marshal(t *testing.T) {
 		SuspendedAt:             &Timestamp{referenceTime},
 		Type:                    String("test type"),
 		SiteAdmin:               Bool(false),
-		TotalPrivateRepos:       Int(2),
-		OwnedPrivateRepos:       Int(1),
+		TotalPrivateRepos:       Int64(2),
+		OwnedPrivateRepos:       Int64(1),
 		PrivateGists:            Int(1),
 		DiskUsage:               Int(1),
 		Collaborators:           Int(1),
@@ -94,7 +94,7 @@ func TestUser_Marshal(t *testing.T) {
 			Name:          String("silver"),
 			Space:         Int(1024),
 			Collaborators: Int(10),
-			PrivateRepos:  Int(4),
+			PrivateRepos:  Int64(4),
 			FilledSeats:   Int(24),
 			Seats:         Int(1),
 		},