The following example updates an existing domain's permissions:
var domainId = "";
// Fetch the entity first
var domain = harmonize.domains().get(domainId).orElseThrow();
// Then call the `.asUpdate()` method, which will return an updatable object
// Call the `.set*` methods to make the changes
var updatePermissions = domain.asPermissionsUpdate();
updatePermissions.setPermissions(Domains.Permissions.builder()
.readAccess(Domains.ReadAccess.builder()
.all("oberserver")
.users("user_admin")
.build())
.build());
// And finally, use the Actions object `.update( updateEntity, expire)` method to send the update request to Harmonize.
harmonize.domains().update(updatePermissions, Expire.hours(24))
.waitForSucceed(Timeout.minutes(1));