code: public void updateSpaceMembership(int spaceId, int userId, Role role) {
  		getResourceFactory()
  				.getApiResource("/space/" + spaceId + "/member/" + userId)
  				.entity(new SpaceMemberUpdate(role),
  						MediaType.APPLICATION_JSON_TYPE).put();
  	}
docs: Updates a space membership with another role
  
  @param spaceId
  The id of the space
  @param userId
  The id of the user
  @param role
  The new role for the membership