package com.atlassian.stash.internal.web.soy.functions.nav;

import com.atlassian.stash.internal.web.soy.functions.SoyArgumentUtils;
import com.atlassian.bitbucket.nav.NavBuilder;
import com.atlassian.soy.renderer.JsExpression;

public class AdminUserDeleteNavFunction extends BaseNavFunction {

    public AdminUserDeleteNavFunction(NavBuilder navBuilder) {
        super(navBuilder, "nav_admin_user_delete", 1);
    }

    @Override
    protected JsNavBuilder initJsBuilder(JsExpression... jsExpressions) {
        return new JsNavBuilder().admin().users().callMethod("deleteUser", jsExpressions[0]);
    }

    @Override
    protected NavBuilder.Builder initBuilder(Object... args) {
        return navBuilder.admin().users().withParam("name", SoyArgumentUtils.getStringArgument(args, 0));
    }

}
