private boolean createOrUpdate(final Credential credential,
                                   final Optional<RegisteredService> registeredService,
                                   final Principal principal,
                                   final ServerResponse<ListResponse<User>> response) {
        if (response.isSuccess()) {
            if (response.getResource().getTotalResults() > 0) {
                val user = response.getResource().getListedResources().getFirst();
                return updateUserResource(user, principal, credential, registeredService);
            }
            return createUserResource(principal, credential, registeredService);
        }
        return false;
    }
This is {@link ScimPrincipalProvisioner}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-scim-core/src/main/java/org/apereo/cas/scim/v2/provisioning/ScimPrincipalProvisioner.java