-
Notifications
You must be signed in to change notification settings - Fork 776
Add missing setter methods to GHTeam #2219
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -511,6 +511,58 @@ public void setPrivacy(Privacy privacy) throws IOException { | |
| root().createRequest().method("PATCH").with("privacy", privacy).withUrlPath(api("")).send(); | ||
| } | ||
|
|
||
| /** | ||
| * Sets the team's name. | ||
| * | ||
| * @param name | ||
| * the new name | ||
| * @throws IOException | ||
| * the io exception | ||
| */ | ||
| public void setName(String name) throws IOException { | ||
| root().createRequest().method("PATCH").with("name", name).withUrlPath(api("")).send(); | ||
| } | ||
|
|
||
| /** | ||
| * Sets the team's notification setting. | ||
| * | ||
| * @param notificationSetting | ||
| * the notification setting (e.g. "notifications_enabled" or "notifications_disabled") | ||
| * @throws IOException | ||
| * the io exception | ||
| */ | ||
| public void setNotificationSetting(String notificationSetting) throws IOException { | ||
|
||
| root().createRequest() | ||
| .method("PATCH") | ||
| .with("notification_setting", notificationSetting) | ||
| .withUrlPath(api("")) | ||
| .send(); | ||
| } | ||
|
|
||
| /** | ||
| * Sets the team's permission. | ||
| * | ||
| * @param permission | ||
| * the permission (e.g. "pull", "push", or "admin") | ||
| * @throws IOException | ||
| * the io exception | ||
| */ | ||
| public void setPermission(String permission) throws IOException { | ||
|
||
| root().createRequest().method("PATCH").with("permission", permission).withUrlPath(api("")).send(); | ||
| } | ||
|
|
||
| /** | ||
| * Sets the team's parent team by ID. | ||
| * | ||
| * @param parentTeamId | ||
| * the ID of the parent team, or {@code null} to remove the parent | ||
| * @throws IOException | ||
| * the io exception | ||
| */ | ||
| public void setParentTeamId(Long parentTeamId) throws IOException { | ||
| root().createRequest().method("PATCH").with("parent_team_id", parentTeamId).withUrlPath(api("")).send(); | ||
| } | ||
|
|
||
| private String api(String tail) { | ||
| if (organization == null) { | ||
| // Teams returned from pull requests to do not have an organization. Attempt to use url. | ||
|
|
||
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.
We're moving to not have set methods on objects. I don't see any on here yet...