-
Notifications
You must be signed in to change notification settings - Fork 713
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 support for all create team parameters #683
Add support for all create team parameters #683
Conversation
a7135f7
to
64aae75
Compare
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public class GHCreateTeamBuilder { | |
public class GHTeamBuilder { |
Then we could also have a GHTeamUpdater
.
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.
Done
* 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the other createTeam
methods should be marked as @Deprecated
. Do you agree?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a link to the github api documentation for create team
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.
Done
* @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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -5,16 +5,18 @@ | |||
|
|||
/** | |||
* Creates a team. | |||
* | |||
* https://developer.github.com/v3/teams/#parameters |
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.
* https://developer.github.com/v3/teams/#parameters | |
* https://developer.github.com/v3/teams/#create-team |
* | ||
* @param privacy | ||
* the privacy | ||
* @throws IOException | ||
* the io exception | ||
*/ | ||
public void setPrivacy(Privacy privacy) throws IOException { | ||
public void updatePrivacy(Privacy privacy) throws IOException { |
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.
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 site
locally. This may reformat your code, commit those changes. If this command doesn't succeed, your change will not pass CI.