Skip to content

Commit ffd18dc

Browse files
authored
fix: Add missing User fields (#4146)
1 parent 9ad687d commit ffd18dc

5 files changed

Lines changed: 88 additions & 19 deletions

File tree

github/github-accessors.go

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-stringify_test.go

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/users.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ type UsersService service
2020
type User struct {
2121
Login *string `json:"login,omitempty"`
2222
ID *int64 `json:"id,omitempty"`
23+
UserViewType *string `json:"user_view_type,omitempty"`
2324
NodeID *string `json:"node_id,omitempty"`
2425
AvatarURL *string `json:"avatar_url,omitempty"`
2526
HTMLURL *string `json:"html_url,omitempty"`
@@ -29,6 +30,7 @@ type User struct {
2930
Blog *string `json:"blog,omitempty"`
3031
Location *string `json:"location,omitempty"`
3132
Email *string `json:"email,omitempty"`
33+
NotificationEmail *string `json:"notification_email,omitempty"`
3234
Hireable *bool `json:"hireable,omitempty"`
3335
Bio *string `json:"bio,omitempty"`
3436
TwitterUsername *string `json:"twitter_username,omitempty"`
@@ -48,6 +50,7 @@ type User struct {
4850
Collaborators *int `json:"collaborators,omitempty"`
4951
TwoFactorAuthentication *bool `json:"two_factor_authentication,omitempty"`
5052
Plan *Plan `json:"plan,omitempty"`
53+
BusinessPlus *bool `json:"business_plus,omitempty"`
5154
LdapDn *string `json:"ldap_dn,omitempty"`
5255

5356
// API URLs

github/users_test.go

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,40 @@ func TestUser_Marshal(t *testing.T) {
1919
testJSONMarshal(t, &User{}, "{}")
2020

2121
u := &User{
22-
Login: Ptr("l"),
23-
ID: Ptr(int64(1)),
24-
URL: Ptr("u"),
25-
AvatarURL: Ptr("a"),
26-
GravatarID: Ptr("g"),
27-
Name: Ptr("n"),
28-
Company: Ptr("c"),
29-
Blog: Ptr("b"),
30-
Location: Ptr("l"),
31-
Email: Ptr("e"),
32-
Hireable: Ptr(true),
33-
Bio: Ptr("b"),
34-
TwitterUsername: Ptr("t"),
35-
PublicRepos: Ptr(1),
36-
Followers: Ptr(1),
37-
Following: Ptr(1),
38-
CreatedAt: &Timestamp{referenceTime},
39-
SuspendedAt: &Timestamp{referenceTime},
22+
Login: Ptr("l"),
23+
ID: Ptr(int64(1)),
24+
UserViewType: Ptr("public"),
25+
URL: Ptr("u"),
26+
AvatarURL: Ptr("a"),
27+
GravatarID: Ptr("g"),
28+
Name: Ptr("n"),
29+
Company: Ptr("c"),
30+
Blog: Ptr("b"),
31+
Location: Ptr("l"),
32+
Email: Ptr("e"),
33+
NotificationEmail: Ptr("ne"),
34+
Hireable: Ptr(true),
35+
Bio: Ptr("b"),
36+
TwitterUsername: Ptr("t"),
37+
PublicRepos: Ptr(1),
38+
Followers: Ptr(1),
39+
Following: Ptr(1),
40+
CreatedAt: &Timestamp{referenceTime},
41+
SuspendedAt: &Timestamp{referenceTime},
42+
BusinessPlus: Ptr(true),
4043
}
4144
want := `{
4245
"login": "l",
4346
"id": 1,
47+
"user_view_type": "public",
4448
"avatar_url": "a",
4549
"gravatar_id": "g",
4650
"name": "n",
4751
"company": "c",
4852
"blog": "b",
4953
"location": "l",
5054
"email": "e",
55+
"notification_email": "ne",
5156
"hireable": true,
5257
"bio": "b",
5358
"twitter_username": "t",
@@ -56,6 +61,7 @@ func TestUser_Marshal(t *testing.T) {
5661
"following": 1,
5762
"created_at": ` + referenceTimeStr + `,
5863
"suspended_at": ` + referenceTimeStr + `,
64+
"business_plus": true,
5965
"url": "u"
6066
}`
6167
testJSONMarshal(t, u, want)

0 commit comments

Comments
 (0)