New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing fields to user and org types #1548
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1548 +/- ##
=======================================
Coverage 67.92% 67.92%
=======================================
Files 94 94
Lines 8670 8670
=======================================
Hits 5889 5889
Misses 1880 1880
Partials 901 901
Continue to review full report at Codecov.
|
github/orgs.go
Outdated
@@ -45,6 +46,9 @@ type Organization struct { | |||
Type *string `json:"type,omitempty"` | |||
Plan *Plan `json:"plan,omitempty"` | |||
TwoFactorRequirementEnabled *bool `json:"two_factor_requirement_enabled,omitempty"` | |||
IsVerified *bool `json:"is_verified,omitempty"` | |||
HasOrgProjects *bool `json:"has_organization_projects,omitempty"` | |||
HasRepoProjects *bool `json:"has_repository_projects,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this repo, we have tried to keep a 1:1 transliteration of the JSON field names to the Go field names, (despite taking the liberty of shortening the API endpoint names)... so if you don't mind, could we please make these fields:
HasOrganizationProjects
HasRepositoryProjects
respectively?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expanded the abbreviations. The naming was following the shortening used for the MemberCan*
permissions (which are already much longer even without shortening).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not finding MemberCan...
in this repo, but if they are not a 1:1 transliteration of the JSON field names, then I probably made a mistake in allowing them in.
Thanks for the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, missed an s. This struct has several fields starting with MembersCan
and DefaultRepo
that are shortened.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Merging.
I noticed that there were a few fields in the
User
andOrganization
responses from GitHub that weren't in the types defined here.https://developer.github.com/v3/users/
https://developer.github.com/v3/orgs/
For both: twitter_username
For orgs: is_verified, has_organization_projects, has_repository_projects