-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Request parent team when endpoints return a team #723
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
Request parent team when endpoints return a team #723
Conversation
As @shurcooL mentioned, another side effect of this PR is stated in the docs:
Those fields are a part of the Team struct. The endpoints that have the application/vnd.github.hellcat-preview+json header set will return different numbers than other endpoints where application/vnd.github.hellcat-preview+json isn't yet set. |
@e-beach, this PR is currently targeting |
@shurcooL Fixed. |
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. Thanks!
Create mediaTypeNestedTeamsPreview const for https://developer.github.com/changes/2017-08-30-preview-nested-teams/. Add parent field to the Team struct. Set preview API media type in endpoints that return a team, so that the new parent field gets populated. Helps google#714.
Create mediaTypeNestedTeamsPreview const for https://developer.github.com/changes/2017-08-30-preview-nested-teams/. Add parent field to the Team struct. Set preview API media type in endpoints that return a team, so that the new parent field gets populated. Helps #714.
* Add support for fetching parent team (for nested teams). (#723) Create mediaTypeNestedTeamsPreview const for https://developer.github.com/changes/2017-08-30-preview-nested-teams/. Add parent field to the Team struct. Set preview API media type in endpoints that return a team, so that the new parent field gets populated. Helps #714. * Add NewTeam struct. (#724) This replaces Team with NewTeam in function that accept a team for creating or editing a team. The NewTeam struct is similar to the existing NewPullRequest for creating pull requests. We need a new struct because the set of parameters for creating or editing a team contains some parameters that are not in the parameter for teams, and most properties of teams cannot be used for editing. The specific change is that Teams are returned with a parent field, but are created/edited with a parent_id field. Helps #714. * Add NestedTeamsPreview header to remaining endpoints Fixes #714. * Change ParentTeamID field to int (from string). (#748) Using the code as written in the `NestedTeamsPreview` branch produces an error when talking to the GitHub API: panic: PATCH https://github.com/api/teams/2514825: 422 Invalid request. For 'properties/parent_team_id', "2514824" is not a number or null. [] The documentation at https://developer.github.com/v3/orgs/teams/#create-team states that this parameter is an id type which appears to mean an integer, not a string. Also, id is an integer in the sample responses for Get team endpoint, etc. * Bump libraryVersion * NestedTeamsPreview: Add the ListChildTeams endpoint (#758)
* Add support for fetching parent team (for nested teams). (google#723) Create mediaTypeNestedTeamsPreview const for https://developer.github.com/changes/2017-08-30-preview-nested-teams/. Add parent field to the Team struct. Set preview API media type in endpoints that return a team, so that the new parent field gets populated. Helps google#714. * Add NewTeam struct. (google#724) This replaces Team with NewTeam in function that accept a team for creating or editing a team. The NewTeam struct is similar to the existing NewPullRequest for creating pull requests. We need a new struct because the set of parameters for creating or editing a team contains some parameters that are not in the parameter for teams, and most properties of teams cannot be used for editing. The specific change is that Teams are returned with a parent field, but are created/edited with a parent_id field. Helps google#714. * Add NestedTeamsPreview header to remaining endpoints Fixes google#714. * Change ParentTeamID field to int (from string). (google#748) Using the code as written in the `NestedTeamsPreview` branch produces an error when talking to the GitHub API: panic: PATCH https://github.com/api/teams/2514825: 422 Invalid request. For 'properties/parent_team_id', "2514824" is not a number or null. [] The documentation at https://developer.github.com/v3/orgs/teams/#create-team states that this parameter is an id type which appears to mean an integer, not a string. Also, id is an integer in the sample responses for Get team endpoint, etc. * Bump libraryVersion * NestedTeamsPreview: Add the ListChildTeams endpoint (google#758)
Re-submit of #718.
This PR address part of #714 by