Skip to content

Add missing setter methods to GHTeam#2219

Open
mvanhorn wants to merge 1 commit intohub4j:mainfrom
mvanhorn:feat/ghteam-update-methods
Open

Add missing setter methods to GHTeam#2219
mvanhorn wants to merge 1 commit intohub4j:mainfrom
mvanhorn:feat/ghteam-update-methods

Conversation

@mvanhorn
Copy link
Copy Markdown

@mvanhorn mvanhorn commented Apr 8, 2026

GHTeam currently only has setDescription and setPrivacy. The GitHub API supports updating several more properties.

This adds 4 missing setters, all following the same PATCH pattern as the existing ones:

  • setName(String name)
  • setNotificationSetting(String notificationSetting)
  • setPermission(String permission)
  • setParentTeamId(Long parentTeamId) (nullable, to support removing parent)

Each is a single PATCH call to the team endpoint. An atomic multi-property update builder could follow as a separate enhancement if maintainers want one.

Fixes #2218

This contribution was developed with AI assistance (Codex).

Add setName, setNotificationSetting, setPermission, and
setParentTeamId methods following the existing setDescription
and setPrivacy pattern. Each uses PATCH to the team API endpoint.

Fixes hub4j#2218
Copy link
Copy Markdown

@rozza-sb rozza-sb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some notes on notifications and permissions

* @throws IOException
* the io exception
*/
public void setNotificationSetting(String notificationSetting) throws IOException {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at GHTeamBuilder, this doesn't already exist in this repo as a concept under a team. However, I think this would work better as an enum so that we can only provide valid values to the request

* @throws IOException
* the io exception
*/
public void setPermission(String permission) throws IOException {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GHOrganization.Permission exists for this already, so should be reused here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GHTeam object missing ways to update some attributes, both singularly and together atomically

2 participants