public Response apply()

in src/main/java/com/gerritforge/gerrit/plugins/account/DeleteAccount.java [59:73]


  public Response<Object> apply(AccountResource resource, DeleteAccount.Input input)
      throws AuthException, BadRequestException, ResourceConflictException, Exception {
    boolean removed = false;

    IdentifiedUser user = resource.getUser();
    int accountId = user.getAccountId().get();
    assertDeletePermission(accountId);

    if (input != null && input.accountName != null && user.getName().equals(input.accountName)) {
      remover.removeAccount(accountId);
      removed = true;
    }

    return Response.ok(new DeleteAccountResponse(removed));
  }