To update an Group you need to create an specific Group. For more details how an update Group has to look please see at the SCIM specification.
The classs UpdateGroup was created to make this process more easy and secure.
You can create an UpdateGroup with his builder like:
UpdateGroup updateGroup = new UpdateGroup.Builder()
//...
.build();
If you are using the connector4java you can directly use this UpdateGroup object.
osiamConnector.updateGroup(group_id, updateGroup, accessToken);
In case you want to use the scim group directly you can call
Group group = updateUser.getScimConformUpdateGroup();
The following actions can be done with single attributes
updateGroupBuilder.updateDisplayName("newDisplayName")
.updateExternalId("newExternalId");
updateGroupBuilder.deleteExternalId();
The main attribute displayName can't be deleted.
The following actions can be done with Members
updateGroupBuilder.addMember(user.getId());
updateGroupBuilder.addMember(group.getId());
updateGroupBuilder.deleteMembers()
updateGroupBuilder.deleteMember(user.getId());
updateGroupBuilder.deleteMember(group.getId());