Add support for all create team parameters - #683
Conversation
a7135f7 to
64aae75
Compare
bitwiseman
left a comment
There was a problem hiding this comment.
This looks really good.
Some name changes, tweaks, and questions. But high quality PR, thanks!
| /** | ||
| * Creates a team. | ||
| */ | ||
| public class GHCreateTeamBuilder { |
There was a problem hiding this comment.
| public class GHCreateTeamBuilder { | |
| public class GHTeamBuilder { |
Then we could also have a GHTeamUpdater.
| * the io exception | ||
| */ | ||
| public void setPrivacy(Privacy privacy) throws IOException { | ||
| root.createRequest().method("PATCH").with("privacy", privacy).withUrlPath(api("")).send(); |
There was a problem hiding this comment.
agree, changed to update.
I didn't like the name but I followed the other method for consistency in the class
There was a problem hiding this comment.
Glad you agree. But leave this for now. I don't want to do this unevenly (some update some set). 😄
| * the name | ||
| * @return the gh create repository builder | ||
| */ | ||
| public GHCreateTeamBuilder createTeam(String name) { |
There was a problem hiding this comment.
I think the other createTeam methods should be marked as @Deprecated. Do you agree?
There was a problem hiding this comment.
Yes, wanted your input on it first before I did it, done.
| import java.util.List; | ||
|
|
||
| /** | ||
| * Creates a team. |
There was a problem hiding this comment.
Add a link to the github api documentation for create team
| * @return the gh create repository builder | ||
| */ | ||
| public GHCreateTeamBuilder createTeam(String name) { | ||
| return new GHCreateTeamBuilder(root, "/orgs/" + login + "/teams", name); |
There was a problem hiding this comment.
| return new GHCreateTeamBuilder(root, "/orgs/" + login + "/teams", name); | |
| return new GHCreateTeamBuilder(root, login, name); |
Or maybe even this (and add name to builder):
| return new GHCreateTeamBuilder(root, "/orgs/" + login + "/teams", name); | |
| return new GHCreateTeamBuilder(root); |
Is a team always created attached to a login? As me, could I create a team that your login owns?
There was a problem hiding this comment.
I did this for consistency with the create repo builder, I've made it take an org name now and not the 'apiTailUrl'.
I've kept the name as it's the only mandatory parameter for the builder
| /** | ||
| * Creates a team. | ||
| * | ||
| * https://developer.github.com/v3/teams/#parameters |
There was a problem hiding this comment.
| * https://developer.github.com/v3/teams/#parameters | |
| * https://developer.github.com/v3/teams/#create-team |
| * the io exception | ||
| */ | ||
| public void setPrivacy(Privacy privacy) throws IOException { | ||
| public void updatePrivacy(Privacy privacy) throws IOException { |
There was a problem hiding this comment.
| public void updatePrivacy(Privacy privacy) throws IOException { | |
| public void setPrivacy(Privacy privacy) throws IOException { |
…thub-api into add-full-create-team-parameters
Description
Add support for all create team parameters
Fixes #455
Implements all parameters from here: https://developer.github.com/v3/teams/#parameters
Before submitting a PR:
We love getting PRs, but we hate asking people for the same basic changes every time.
master. Create your PR from that branch.mvn -P ci install sitelocally. This may reformat your code, commit those changes. If this command doesn't succeed, your change will not pass CI.