use of com.google.gerrit.extensions.api.accounts.StatusInput in project gerrit by GerritCodeReview.
the class PutStatus method apply.
public Response<String> apply(IdentifiedUser user, StatusInput input) throws ResourceNotFoundException, IOException, ConfigInvalidException {
if (input == null) {
input = new StatusInput();
}
String newStatus = input.status;
AccountState accountState = accountsUpdateProvider.get().update("Set Status via API", user.getAccountId(), u -> u.setStatus(newStatus)).orElseThrow(() -> new ResourceNotFoundException("account not found"));
return Strings.isNullOrEmpty(accountState.account().status()) ? Response.none() : Response.ok(accountState.account().status());
}
Aggregations