@SuppressWarnings("javadoc")
public class AccessControl {

    private final ClientApi api;

    public AccessControl(ClientApi api) {
        this.api = api;
    }

    /**
     * Gets the Access Control scan progress (percentage integer) for the given context ID.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse getScanProgress(String contextid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        return api.callApi("accessControl", "view", "getScanProgress", map);
    }

    /**
     * Gets the Access Control scan status (description string) for the given context ID.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse getScanStatus(String contextid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        return api.callApi("accessControl", "view", "getScanStatus", map);
    }

    /**
     * Starts an Access Control scan with the given context ID and user ID. (Optional parameters:
     * user ID for Unauthenticated user, boolean identifying whether or not Alerts are raised, and
     * the Risk level for the Alerts.) [This assumes the Access Control rules were previously
     * established via ZAP gui and the necessary Context exported/imported.]
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse scan(
            String contextid,
            String userid,
            String scanasunauthuser,
            String raisealert,
            String alertrisklevel)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("userId", userid);
        if (scanasunauthuser != null) {
            map.put("scanAsUnAuthUser", scanasunauthuser);
        }
        if (raisealert != null) {
            map.put("raiseAlert", raisealert);
        }
        if (alertrisklevel != null) {
            map.put("alertRiskLevel", alertrisklevel);
        }
        return api.callApi("accessControl", "action", "scan", map);
    }

    /**
     * Generates an Access Control report for the given context ID and saves it based on the
     * provided filename (path).
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse writeHTMLreport(String contextid, String filename)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("fileName", filename);
        return api.callApi("accessControl", "action", "writeHTMLreport", map);
    }
} @SuppressWarnings("javadoc")
public class Acsrf extends org.zaproxy.clientapi.gen.deprecated.AcsrfDeprecated {

    private final ClientApi api;

    public Acsrf(ClientApi api) {
        super(api);
        this.api = api;
    }

    /** Lists the names of all anti-CSRF tokens */
    public ApiResponse optionTokensNames() throws ClientApiException {
        return api.callApi("acsrf", "view", "optionTokensNames", null);
    }

    /** Define if ZAP should detect CSRF tokens by searching for partial matches */
    public ApiResponse optionPartialMatchingEnabled() throws ClientApiException {
        return api.callApi("acsrf", "view", "optionPartialMatchingEnabled", null);
    }

    /** Adds an anti-CSRF token with the given name, enabled by default */
    public ApiResponse addOptionToken(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("acsrf", "action", "addOptionToken", map);
    }

    /** Removes the anti-CSRF token with the given name */
    public ApiResponse removeOptionToken(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("acsrf", "action", "removeOptionToken", map);
    }

    /** Define if ZAP should detect CSRF tokens by searching for partial matches. */
    public ApiResponse setOptionPartialMatchingEnabled(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("acsrf", "action", "setOptionPartialMatchingEnabled", map);
    }

    /** Generate a form for testing lack of anti-CSRF tokens - typically invoked via ZAP */
    public byte[] genForm(String hrefid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("hrefId", hrefid);
        return api.callApiOther("acsrf", "other", "genForm", map);
    }
} @SuppressWarnings("javadoc")
public class AjaxSpider extends org.zaproxy.clientapi.gen.deprecated.AjaxSpiderDeprecated {

    private final ClientApi api;

    public AjaxSpider(ClientApi api) {
        super(api);
        this.api = api;
    }

    /**
     * Gets the allowed resources. The allowed resources are always fetched even if out of scope,
     * allowing to include necessary resources (e.g. scripts) from 3rd-parties.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse allowedResources() throws ClientApiException {
        return api.callApi("ajaxSpider", "view", "allowedResources", null);
    }

    /**
     * Gets the current status of the crawler. Actual values are Stopped and Running.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse status() throws ClientApiException {
        return api.callApi("ajaxSpider", "view", "status", null);
    }

    /**
     * Gets the current results of the crawler.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse results(String start, String count) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (start != null) {
            map.put("start", start);
        }
        if (count != null) {
            map.put("count", count);
        }
        return api.callApi("ajaxSpider", "view", "results", map);
    }

    /**
     * Gets the number of resources found.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse numberOfResults() throws ClientApiException {
        return api.callApi("ajaxSpider", "view", "numberOfResults", null);
    }

    /**
     * Gets the full crawled content detected by the AJAX Spider. Returns a set of values based on
     * 'inScope' URLs, 'outOfScope' URLs, and 'errors' encountered during the last/current run of
     * the AJAX Spider.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse fullResults() throws ClientApiException {
        return api.callApi("ajaxSpider", "view", "fullResults", null);
    }

    /**
     * Gets the configured browser to use for crawling.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse optionBrowserId() throws ClientApiException {
        return api.callApi("ajaxSpider", "view", "optionBrowserId", null);
    }

    /**
     * Gets the time to wait after an event (in milliseconds). For example: the wait delay after the
     * cursor hovers over an element, in order for a menu to display, etc.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse optionEventWait() throws ClientApiException {
        return api.callApi("ajaxSpider", "view", "optionEventWait", null);
    }

    /**
     * Gets the configured value for the max crawl depth.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse optionMaxCrawlDepth() throws ClientApiException {
        return api.callApi("ajaxSpider", "view", "optionMaxCrawlDepth", null);
    }

    /**
     * Gets the configured value for the maximum crawl states allowed.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse optionMaxCrawlStates() throws ClientApiException {
        return api.callApi("ajaxSpider", "view", "optionMaxCrawlStates", null);
    }

    /**
     * Gets the configured max duration of the crawl, the value is in minutes.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse optionMaxDuration() throws ClientApiException {
        return api.callApi("ajaxSpider", "view", "optionMaxDuration", null);
    }

    /**
     * Gets the configured number of browsers to be used.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse optionNumberOfBrowsers() throws ClientApiException {
        return api.callApi("ajaxSpider", "view", "optionNumberOfBrowsers", null);
    }

    /**
     * Gets the configured time to wait after reloading the page, this value is in milliseconds.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse optionReloadWait() throws ClientApiException {
        return api.callApi("ajaxSpider", "view", "optionReloadWait", null);
    }

    /**
     * Gets the configured value for 'Click Default Elements Only', HTML elements such as 'a',
     * 'button', 'input', all associated with some action or links on the page.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse optionClickDefaultElems() throws ClientApiException {
        return api.callApi("ajaxSpider", "view", "optionClickDefaultElems", null);
    }

    /**
     * Gets the value configured for the AJAX Spider to know if it should click on the elements only
     * once.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse optionClickElemsOnce() throws ClientApiException {
        return api.callApi("ajaxSpider", "view", "optionClickElemsOnce", null);
    }

    /**
     * Gets if the AJAX Spider will use random values in form fields when crawling, if set to true.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse optionRandomInputs() throws ClientApiException {
        return api.callApi("ajaxSpider", "view", "optionRandomInputs", null);
    }

    /**
     * Runs the AJAX Spider against a given target.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse scan(String url, String inscope, String contextname, String subtreeonly)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (url != null) {
            map.put("url", url);
        }
        if (inscope != null) {
            map.put("inScope", inscope);
        }
        if (contextname != null) {
            map.put("contextName", contextname);
        }
        if (subtreeonly != null) {
            map.put("subtreeOnly", subtreeonly);
        }
        return api.callApi("ajaxSpider", "action", "scan", map);
    }

    /**
     * Runs the AJAX Spider from the perspective of a User of the web application.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse scanAsUser(
            String contextname, String username, String url, String subtreeonly)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        map.put("userName", username);
        if (url != null) {
            map.put("url", url);
        }
        if (subtreeonly != null) {
            map.put("subtreeOnly", subtreeonly);
        }
        return api.callApi("ajaxSpider", "action", "scanAsUser", map);
    }

    /**
     * Stops the AJAX Spider.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse stop() throws ClientApiException {
        return api.callApi("ajaxSpider", "action", "stop", null);
    }

    /**
     * Adds an allowed resource.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse addAllowedResource(String regex, String enabled) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("regex", regex);
        if (enabled != null) {
            map.put("enabled", enabled);
        }
        return api.callApi("ajaxSpider", "action", "addAllowedResource", map);
    }

    /**
     * Removes an allowed resource.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse removeAllowedResource(String regex) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("regex", regex);
        return api.callApi("ajaxSpider", "action", "removeAllowedResource", map);
    }

    /**
     * Sets whether or not an allowed resource is enabled.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse setEnabledAllowedResource(String regex, String enabled)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("regex", regex);
        map.put("enabled", enabled);
        return api.callApi("ajaxSpider", "action", "setEnabledAllowedResource", map);
    }

    /**
     * Sets the configuration of the AJAX Spider to use one of the supported browsers.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse setOptionBrowserId(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("ajaxSpider", "action", "setOptionBrowserId", map);
    }

    /**
     * Sets whether or not the the AJAX Spider will only click on the default HTML elements.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse setOptionClickDefaultElems(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("ajaxSpider", "action", "setOptionClickDefaultElems", map);
    }

    /**
     * When enabled, the crawler attempts to interact with each element (e.g., by clicking) only
     * once.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse setOptionClickElemsOnce(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("ajaxSpider", "action", "setOptionClickElemsOnce", map);
    }

    /**
     * Sets the time to wait after an event (in milliseconds). For example: the wait delay after the
     * cursor hovers over an element, in order for a menu to display, etc.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse setOptionEventWait(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("ajaxSpider", "action", "setOptionEventWait", map);
    }

    /**
     * Sets the maximum depth that the crawler can reach.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse setOptionMaxCrawlDepth(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("ajaxSpider", "action", "setOptionMaxCrawlDepth", map);
    }

    /**
     * Sets the maximum number of states that the crawler should crawl.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse setOptionMaxCrawlStates(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("ajaxSpider", "action", "setOptionMaxCrawlStates", map);
    }

    /**
     * The maximum time that the crawler is allowed to run.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse setOptionMaxDuration(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("ajaxSpider", "action", "setOptionMaxDuration", map);
    }

    /**
     * Sets the number of windows to be used by AJAX Spider.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse setOptionNumberOfBrowsers(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("ajaxSpider", "action", "setOptionNumberOfBrowsers", map);
    }

    /**
     * When enabled, inserts random values into form fields.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse setOptionRandomInputs(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("ajaxSpider", "action", "setOptionRandomInputs", map);
    }

    /**
     * Sets the time to wait after the page is loaded before interacting with it.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse setOptionReloadWait(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("ajaxSpider", "action", "setOptionReloadWait", map);
    }
} @SuppressWarnings("javadoc")
public class AlertFilter {

    private final ClientApi api;

    public AlertFilter(ClientApi api) {
        this.api = api;
    }

    /**
     * Lists the alert filters of the context with the given ID.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse alertFilterList(String contextid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        return api.callApi("alertFilter", "view", "alertFilterList", map);
    }

    /**
     * Lists the global alert filters.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse globalAlertFilterList() throws ClientApiException {
        return api.callApi("alertFilter", "view", "globalAlertFilterList", null);
    }
    /**
     * Adds a new alert filter for the context with the given ID.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse addAlertFilter(
            String contextid,
            String ruleid,
            String newlevel,
            String url,
            String urlisregex,
            String parameter,
            String enabled)
            throws ClientApiException {
        return addAlertFilter(
                contextid,
                ruleid,
                newlevel,
                url,
                urlisregex,
                parameter,
                enabled,
                null,
                null,
                null,
                null,
                null);
    }

    /**
     * Adds a new alert filter for the context with the given ID.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse addAlertFilter(
            String contextid,
            String ruleid,
            String newlevel,
            String url,
            String urlisregex,
            String parameter,
            String enabled,
            String parameterisregex,
            String attack,
            String attackisregex,
            String evidence,
            String evidenceisregex)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("ruleId", ruleid);
        map.put("newLevel", newlevel);
        if (url != null) {
            map.put("url", url);
        }
        if (urlisregex != null) {
            map.put("urlIsRegex", urlisregex);
        }
        if (parameter != null) {
            map.put("parameter", parameter);
        }
        if (enabled != null) {
            map.put("enabled", enabled);
        }
        if (parameterisregex != null) {
            map.put("parameterIsRegex", parameterisregex);
        }
        if (attack != null) {
            map.put("attack", attack);
        }
        if (attackisregex != null) {
            map.put("attackIsRegex", attackisregex);
        }
        if (evidence != null) {
            map.put("evidence", evidence);
        }
        if (evidenceisregex != null) {
            map.put("evidenceIsRegex", evidenceisregex);
        }
        return api.callApi("alertFilter", "action", "addAlertFilter", map);
    }

    /**
     * Removes an alert filter from the context with the given ID.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse removeAlertFilter(
            String contextid,
            String ruleid,
            String newlevel,
            String url,
            String urlisregex,
            String parameter,
            String enabled)
            throws ClientApiException {
        return removeAlertFilter(
                contextid,
                ruleid,
                newlevel,
                url,
                urlisregex,
                parameter,
                enabled,
                null,
                null,
                null,
                null,
                null);
    }

    /**
     * Removes an alert filter from the context with the given ID.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse removeAlertFilter(
            String contextid,
            String ruleid,
            String newlevel,
            String url,
            String urlisregex,
            String parameter,
            String enabled,
            String parameterisregex,
            String attack,
            String attackisregex,
            String evidence,
            String evidenceisregex)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("ruleId", ruleid);
        map.put("newLevel", newlevel);
        if (url != null) {
            map.put("url", url);
        }
        if (urlisregex != null) {
            map.put("urlIsRegex", urlisregex);
        }
        if (parameter != null) {
            map.put("parameter", parameter);
        }
        if (enabled != null) {
            map.put("enabled", enabled);
        }
        if (parameterisregex != null) {
            map.put("parameterIsRegex", parameterisregex);
        }
        if (attack != null) {
            map.put("attack", attack);
        }
        if (attackisregex != null) {
            map.put("attackIsRegex", attackisregex);
        }
        if (evidence != null) {
            map.put("evidence", evidence);
        }
        if (evidenceisregex != null) {
            map.put("evidenceIsRegex", evidenceisregex);
        }
        return api.callApi("alertFilter", "action", "removeAlertFilter", map);
    }

    /**
     * Adds a new global alert filter.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse addGlobalAlertFilter(
            String ruleid,
            String newlevel,
            String url,
            String urlisregex,
            String parameter,
            String enabled,
            String parameterisregex,
            String attack,
            String attackisregex,
            String evidence,
            String evidenceisregex)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("ruleId", ruleid);
        map.put("newLevel", newlevel);
        if (url != null) {
            map.put("url", url);
        }
        if (urlisregex != null) {
            map.put("urlIsRegex", urlisregex);
        }
        if (parameter != null) {
            map.put("parameter", parameter);
        }
        if (enabled != null) {
            map.put("enabled", enabled);
        }
        if (parameterisregex != null) {
            map.put("parameterIsRegex", parameterisregex);
        }
        if (attack != null) {
            map.put("attack", attack);
        }
        if (attackisregex != null) {
            map.put("attackIsRegex", attackisregex);
        }
        if (evidence != null) {
            map.put("evidence", evidence);
        }
        if (evidenceisregex != null) {
            map.put("evidenceIsRegex", evidenceisregex);
        }
        return api.callApi("alertFilter", "action", "addGlobalAlertFilter", map);
    }

    /**
     * Removes a global alert filter.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse removeGlobalAlertFilter(
            String ruleid,
            String newlevel,
            String url,
            String urlisregex,
            String parameter,
            String enabled,
            String parameterisregex,
            String attack,
            String attackisregex,
            String evidence,
            String evidenceisregex)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("ruleId", ruleid);
        map.put("newLevel", newlevel);
        if (url != null) {
            map.put("url", url);
        }
        if (urlisregex != null) {
            map.put("urlIsRegex", urlisregex);
        }
        if (parameter != null) {
            map.put("parameter", parameter);
        }
        if (enabled != null) {
            map.put("enabled", enabled);
        }
        if (parameterisregex != null) {
            map.put("parameterIsRegex", parameterisregex);
        }
        if (attack != null) {
            map.put("attack", attack);
        }
        if (attackisregex != null) {
            map.put("attackIsRegex", attackisregex);
        }
        if (evidence != null) {
            map.put("evidence", evidence);
        }
        if (evidenceisregex != null) {
            map.put("evidenceIsRegex", evidenceisregex);
        }
        return api.callApi("alertFilter", "action", "removeGlobalAlertFilter", map);
    }

    /**
     * Applies all currently enabled Global and Context alert filters.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse applyAll() throws ClientApiException {
        return api.callApi("alertFilter", "action", "applyAll", null);
    }

    /**
     * Applies all currently enabled Context alert filters.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse applyContext() throws ClientApiException {
        return api.callApi("alertFilter", "action", "applyContext", null);
    }

    /**
     * Applies all currently enabled Global alert filters.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse applyGlobal() throws ClientApiException {
        return api.callApi("alertFilter", "action", "applyGlobal", null);
    }

    /**
     * Tests all currently enabled Global and Context alert filters.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse testAll() throws ClientApiException {
        return api.callApi("alertFilter", "action", "testAll", null);
    }

    /**
     * Tests all currently enabled Context alert filters.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse testContext() throws ClientApiException {
        return api.callApi("alertFilter", "action", "testContext", null);
    }

    /**
     * Tests all currently enabled Global alert filters.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse testGlobal() throws ClientApiException {
        return api.callApi("alertFilter", "action", "testGlobal", null);
    }
} @SuppressWarnings("javadoc")
public class Ascan extends org.zaproxy.clientapi.gen.deprecated.AscanDeprecated {

    private final ClientApi api;

    public Ascan(ClientApi api) {
        super(api);
        this.api = api;
    }

    public ApiResponse status(String scanid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (scanid != null) {
            map.put("scanId", scanid);
        }
        return api.callApi("ascan", "view", "status", map);
    }

    public ApiResponse scanProgress(String scanid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (scanid != null) {
            map.put("scanId", scanid);
        }
        return api.callApi("ascan", "view", "scanProgress", map);
    }

    /**
     * Gets the IDs of the messages sent during the scan with the given ID. A message can be
     * obtained with 'message' core view.
     */
    public ApiResponse messagesIds(String scanid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scanId", scanid);
        return api.callApi("ascan", "view", "messagesIds", map);
    }

    /**
     * Gets the IDs of the alerts raised during the scan with the given ID. An alert can be obtained
     * with 'alert' core view.
     */
    public ApiResponse alertsIds(String scanid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scanId", scanid);
        return api.callApi("ascan", "view", "alertsIds", map);
    }

    public ApiResponse scans() throws ClientApiException {
        return api.callApi("ascan", "view", "scans", null);
    }

    public ApiResponse scanPolicyNames() throws ClientApiException {
        return api.callApi("ascan", "view", "scanPolicyNames", null);
    }

    /** Gets the regexes of URLs excluded from the active scans. */
    public ApiResponse excludedFromScan() throws ClientApiException {
        return api.callApi("ascan", "view", "excludedFromScan", null);
    }

    /**
     * Gets the scanners, optionally, of the given scan policy and/or scanner policy/category ID.
     */
    public ApiResponse scanners(String scanpolicyname, String policyid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (scanpolicyname != null) {
            map.put("scanPolicyName", scanpolicyname);
        }
        if (policyid != null) {
            map.put("policyId", policyid);
        }
        return api.callApi("ascan", "view", "scanners", map);
    }

    public ApiResponse policies(String scanpolicyname, String policyid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (scanpolicyname != null) {
            map.put("scanPolicyName", scanpolicyname);
        }
        if (policyid != null) {
            map.put("policyId", policyid);
        }
        return api.callApi("ascan", "view", "policies", map);
    }

    public ApiResponse attackModeQueue() throws ClientApiException {
        return api.callApi("ascan", "view", "attackModeQueue", null);
    }

    /**
     * Gets all the parameters that are excluded. For each parameter the following are shown: the
     * name, the URL, and the parameter type.
     */
    public ApiResponse excludedParams() throws ClientApiException {
        return api.callApi("ascan", "view", "excludedParams", null);
    }

    /**
     * Use view excludedParams instead.
     *
     * @deprecated
     */
    @Deprecated
    public ApiResponse optionExcludedParamList() throws ClientApiException {
        return api.callApi("ascan", "view", "optionExcludedParamList", null);
    }

    /**
     * Gets all the types of excluded parameters. For each type the following are shown: the ID and
     * the name.
     */
    public ApiResponse excludedParamTypes() throws ClientApiException {
        return api.callApi("ascan", "view", "excludedParamTypes", null);
    }

    public ApiResponse optionAttackPolicy() throws ClientApiException {
        return api.callApi("ascan", "view", "optionAttackPolicy", null);
    }

    public ApiResponse optionDefaultPolicy() throws ClientApiException {
        return api.callApi("ascan", "view", "optionDefaultPolicy", null);
    }

    public ApiResponse optionDelayInMs() throws ClientApiException {
        return api.callApi("ascan", "view", "optionDelayInMs", null);
    }

    public ApiResponse optionHandleAntiCSRFTokens() throws ClientApiException {
        return api.callApi("ascan", "view", "optionHandleAntiCSRFTokens", null);
    }

    public ApiResponse optionHostPerScan() throws ClientApiException {
        return api.callApi("ascan", "view", "optionHostPerScan", null);
    }

    public ApiResponse optionMaxChartTimeInMins() throws ClientApiException {
        return api.callApi("ascan", "view", "optionMaxChartTimeInMins", null);
    }

    public ApiResponse optionMaxResultsToList() throws ClientApiException {
        return api.callApi("ascan", "view", "optionMaxResultsToList", null);
    }

    public ApiResponse optionMaxRuleDurationInMins() throws ClientApiException {
        return api.callApi("ascan", "view", "optionMaxRuleDurationInMins", null);
    }

    public ApiResponse optionMaxScanDurationInMins() throws ClientApiException {
        return api.callApi("ascan", "view", "optionMaxScanDurationInMins", null);
    }

    public ApiResponse optionMaxScansInUI() throws ClientApiException {
        return api.callApi("ascan", "view", "optionMaxScansInUI", null);
    }

    public ApiResponse optionTargetParamsEnabledRPC() throws ClientApiException {
        return api.callApi("ascan", "view", "optionTargetParamsEnabledRPC", null);
    }

    public ApiResponse optionTargetParamsInjectable() throws ClientApiException {
        return api.callApi("ascan", "view", "optionTargetParamsInjectable", null);
    }

    public ApiResponse optionThreadPerHost() throws ClientApiException {
        return api.callApi("ascan", "view", "optionThreadPerHost", null);
    }

    /**
     * Tells whether or not the active scanner should add a query parameter to GET request that
     * don't have parameters to start with.
     */
    public ApiResponse optionAddQueryParam() throws ClientApiException {
        return api.callApi("ascan", "view", "optionAddQueryParam", null);
    }

    public ApiResponse optionAllowAttackOnStart() throws ClientApiException {
        return api.callApi("ascan", "view", "optionAllowAttackOnStart", null);
    }

    /**
     * Tells whether or not the active scanner should inject the HTTP request header X-ZAP-Scan-ID,
     * with the ID of the scanner that's sending the requests.
     */
    public ApiResponse optionInjectPluginIdInHeader() throws ClientApiException {
        return api.callApi("ascan", "view", "optionInjectPluginIdInHeader", null);
    }

    public ApiResponse optionPromptInAttackMode() throws ClientApiException {
        return api.callApi("ascan", "view", "optionPromptInAttackMode", null);
    }

    public ApiResponse optionPromptToClearFinishedScans() throws ClientApiException {
        return api.callApi("ascan", "view", "optionPromptToClearFinishedScans", null);
    }

    public ApiResponse optionRescanInAttackMode() throws ClientApiException {
        return api.callApi("ascan", "view", "optionRescanInAttackMode", null);
    }

    /**
     * Tells whether or not the HTTP Headers of all requests should be scanned. Not just requests
     * that send parameters, through the query or request body.
     */
    public ApiResponse optionScanHeadersAllRequests() throws ClientApiException {
        return api.callApi("ascan", "view", "optionScanHeadersAllRequests", null);
    }

    /** Tells whether or not the active scanner should scan null JSON values. */
    public ApiResponse optionScanNullJsonValues() throws ClientApiException {
        return api.callApi("ascan", "view", "optionScanNullJsonValues", null);
    }

    public ApiResponse optionShowAdvancedDialog() throws ClientApiException {
        return api.callApi("ascan", "view", "optionShowAdvancedDialog", null);
    }

    public ApiResponse scan(
            String url,
            String recurse,
            String inscopeonly,
            String scanpolicyname,
            String method,
            String postdata)
            throws ClientApiException {
        return scan(url, recurse, inscopeonly, scanpolicyname, method, postdata, (Integer) null);
    }

    /**
     * Runs the active scanner against the given URL and/or Context. Optionally, the 'recurse'
     * parameter can be used to scan URLs under the given URL, the parameter 'inScopeOnly' can be
     * used to constrain the scan to URLs that are in scope (ignored if a Context is specified), the
     * parameter 'scanPolicyName' allows to specify the scan policy (if none is given it uses the
     * default scan policy), the parameters 'method' and 'postData' allow to select a given request
     * in conjunction with the given URL.
     */
    public ApiResponse scan(
            String url,
            String recurse,
            String inscopeonly,
            String scanpolicyname,
            String method,
            String postdata,
            Integer contextid)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (url != null) {
            map.put("url", url);
        }
        if (recurse != null) {
            map.put("recurse", recurse);
        }
        if (inscopeonly != null) {
            map.put("inScopeOnly", inscopeonly);
        }
        if (scanpolicyname != null) {
            map.put("scanPolicyName", scanpolicyname);
        }
        if (method != null) {
            map.put("method", method);
        }
        if (postdata != null) {
            map.put("postData", postdata);
        }
        if (contextid != null) {
            map.put("contextId", contextid.toString());
        }
        return api.callApi("ascan", "action", "scan", map);
    }

    /**
     * Active Scans from the perspective of a User, obtained using the given Context ID and User ID.
     * See 'scan' action for more details.
     */
    public ApiResponse scanAsUser(
            String url,
            String contextid,
            String userid,
            String recurse,
            String scanpolicyname,
            String method,
            String postdata)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (url != null) {
            map.put("url", url);
        }
        if (contextid != null) {
            map.put("contextId", contextid);
        }
        if (userid != null) {
            map.put("userId", userid);
        }
        if (recurse != null) {
            map.put("recurse", recurse);
        }
        if (scanpolicyname != null) {
            map.put("scanPolicyName", scanpolicyname);
        }
        if (method != null) {
            map.put("method", method);
        }
        if (postdata != null) {
            map.put("postData", postdata);
        }
        return api.callApi("ascan", "action", "scanAsUser", map);
    }

    public ApiResponse pause(String scanid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scanId", scanid);
        return api.callApi("ascan", "action", "pause", map);
    }

    public ApiResponse resume(String scanid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scanId", scanid);
        return api.callApi("ascan", "action", "resume", map);
    }

    public ApiResponse stop(String scanid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scanId", scanid);
        return api.callApi("ascan", "action", "stop", map);
    }

    public ApiResponse removeScan(String scanid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scanId", scanid);
        return api.callApi("ascan", "action", "removeScan", map);
    }

    public ApiResponse pauseAllScans() throws ClientApiException {
        return api.callApi("ascan", "action", "pauseAllScans", null);
    }

    public ApiResponse resumeAllScans() throws ClientApiException {
        return api.callApi("ascan", "action", "resumeAllScans", null);
    }

    public ApiResponse stopAllScans() throws ClientApiException {
        return api.callApi("ascan", "action", "stopAllScans", null);
    }

    public ApiResponse removeAllScans() throws ClientApiException {
        return api.callApi("ascan", "action", "removeAllScans", null);
    }

    /** Clears the regexes of URLs excluded from the active scans. */
    public ApiResponse clearExcludedFromScan() throws ClientApiException {
        return api.callApi("ascan", "action", "clearExcludedFromScan", null);
    }

    /** Adds a regex of URLs that should be excluded from the active scans. */
    public ApiResponse excludeFromScan(String regex) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("regex", regex);
        return api.callApi("ascan", "action", "excludeFromScan", map);
    }

    /**
     * Enables all scanners of the scan policy with the given name, or the default if none given.
     */
    public ApiResponse enableAllScanners(String scanpolicyname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (scanpolicyname != null) {
            map.put("scanPolicyName", scanpolicyname);
        }
        return api.callApi("ascan", "action", "enableAllScanners", map);
    }

    /**
     * Disables all scanners of the scan policy with the given name, or the default if none given.
     */
    public ApiResponse disableAllScanners(String scanpolicyname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (scanpolicyname != null) {
            map.put("scanPolicyName", scanpolicyname);
        }
        return api.callApi("ascan", "action", "disableAllScanners", map);
    }

    /**
     * Enables the scanners with the given IDs (comma separated list of IDs) of the scan policy with
     * the given name, or the default if none given.
     */
    public ApiResponse enableScanners(String ids, String scanpolicyname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("ids", ids);
        if (scanpolicyname != null) {
            map.put("scanPolicyName", scanpolicyname);
        }
        return api.callApi("ascan", "action", "enableScanners", map);
    }

    /**
     * Disables the scanners with the given IDs (comma separated list of IDs) of the scan policy
     * with the given name, or the default if none given.
     */
    public ApiResponse disableScanners(String ids, String scanpolicyname)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("ids", ids);
        if (scanpolicyname != null) {
            map.put("scanPolicyName", scanpolicyname);
        }
        return api.callApi("ascan", "action", "disableScanners", map);
    }

    public ApiResponse setEnabledPolicies(String ids, String scanpolicyname)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("ids", ids);
        if (scanpolicyname != null) {
            map.put("scanPolicyName", scanpolicyname);
        }
        return api.callApi("ascan", "action", "setEnabledPolicies", map);
    }

    public ApiResponse setPolicyAttackStrength(
            String id, String attackstrength, String scanpolicyname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("id", id);
        map.put("attackStrength", attackstrength);
        if (scanpolicyname != null) {
            map.put("scanPolicyName", scanpolicyname);
        }
        return api.callApi("ascan", "action", "setPolicyAttackStrength", map);
    }

    public ApiResponse setPolicyAlertThreshold(
            String id, String alertthreshold, String scanpolicyname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("id", id);
        map.put("alertThreshold", alertthreshold);
        if (scanpolicyname != null) {
            map.put("scanPolicyName", scanpolicyname);
        }
        return api.callApi("ascan", "action", "setPolicyAlertThreshold", map);
    }

    public ApiResponse setScannerAttackStrength(
            String id, String attackstrength, String scanpolicyname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("id", id);
        map.put("attackStrength", attackstrength);
        if (scanpolicyname != null) {
            map.put("scanPolicyName", scanpolicyname);
        }
        return api.callApi("ascan", "action", "setScannerAttackStrength", map);
    }

    public ApiResponse setScannerAlertThreshold(
            String id, String alertthreshold, String scanpolicyname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("id", id);
        map.put("alertThreshold", alertthreshold);
        if (scanpolicyname != null) {
            map.put("scanPolicyName", scanpolicyname);
        }
        return api.callApi("ascan", "action", "setScannerAlertThreshold", map);
    }

    public ApiResponse addScanPolicy(String scanpolicyname) throws ClientApiException {
        return addScanPolicy(scanpolicyname, null, null);
    }

    public ApiResponse addScanPolicy(
            String scanpolicyname, String alertthreshold, String attackstrength)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scanPolicyName", scanpolicyname);
        if (alertthreshold != null) {
            map.put("alertThreshold", alertthreshold);
        }
        if (attackstrength != null) {
            map.put("attackStrength", attackstrength);
        }
        return api.callApi("ascan", "action", "addScanPolicy", map);
    }

    public ApiResponse removeScanPolicy(String scanpolicyname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scanPolicyName", scanpolicyname);
        return api.callApi("ascan", "action", "removeScanPolicy", map);
    }

    public ApiResponse updateScanPolicy(
            String scanpolicyname, String alertthreshold, String attackstrength)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scanPolicyName", scanpolicyname);
        if (alertthreshold != null) {
            map.put("alertThreshold", alertthreshold);
        }
        if (attackstrength != null) {
            map.put("attackStrength", attackstrength);
        }
        return api.callApi("ascan", "action", "updateScanPolicy", map);
    }

    /** Imports a Scan Policy using the given file system path. */
    public ApiResponse importScanPolicy(String path) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("path", path);
        return api.callApi("ascan", "action", "importScanPolicy", map);
    }

    /**
     * Adds a new parameter excluded from the scan, using the specified name. Optionally sets if the
     * new entry applies to a specific URL (default, all URLs) and sets the ID of the type of the
     * parameter (default, ID of any type). The type IDs can be obtained with the view
     * excludedParamTypes.
     */
    public ApiResponse addExcludedParam(String name, String type, String url)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("name", name);
        if (type != null) {
            map.put("type", type);
        }
        if (url != null) {
            map.put("url", url);
        }
        return api.callApi("ascan", "action", "addExcludedParam", map);
    }

    /**
     * Modifies a parameter excluded from the scan. Allows to modify the name, the URL and the type
     * of parameter. The parameter is selected with its index, which can be obtained with the view
     * excludedParams.
     */
    public ApiResponse modifyExcludedParam(String idx, String name, String type, String url)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("idx", idx);
        if (name != null) {
            map.put("name", name);
        }
        if (type != null) {
            map.put("type", type);
        }
        if (url != null) {
            map.put("url", url);
        }
        return api.callApi("ascan", "action", "modifyExcludedParam", map);
    }

    /**
     * Removes a parameter excluded from the scan, with the given index. The index can be obtained
     * with the view excludedParams.
     */
    public ApiResponse removeExcludedParam(String idx) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("idx", idx);
        return api.callApi("ascan", "action", "removeExcludedParam", map);
    }

    /** Skips the scanner using the given IDs of the scan and the scanner. */
    public ApiResponse skipScanner(String scanid, String scannerid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scanId", scanid);
        map.put("scannerId", scannerid);
        return api.callApi("ascan", "action", "skipScanner", map);
    }

    public ApiResponse setOptionAttackPolicy(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("ascan", "action", "setOptionAttackPolicy", map);
    }

    public ApiResponse setOptionDefaultPolicy(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("ascan", "action", "setOptionDefaultPolicy", map);
    }

    /**
     * Sets whether or not the active scanner should add a query param to GET requests which do not
     * have parameters to start with.
     */
    public ApiResponse setOptionAddQueryParam(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("ascan", "action", "setOptionAddQueryParam", map);
    }

    public ApiResponse setOptionAllowAttackOnStart(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("ascan", "action", "setOptionAllowAttackOnStart", map);
    }

    public ApiResponse setOptionDelayInMs(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("ascan", "action", "setOptionDelayInMs", map);
    }

    public ApiResponse setOptionHandleAntiCSRFTokens(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("ascan", "action", "setOptionHandleAntiCSRFTokens", map);
    }

    public ApiResponse setOptionHostPerScan(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("ascan", "action", "setOptionHostPerScan", map);
    }

    /**
     * Sets whether or not the active scanner should inject the HTTP request header X-ZAP-Scan-ID,
     * with the ID of the scanner that's sending the requests.
     */
    public ApiResponse setOptionInjectPluginIdInHeader(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("ascan", "action", "setOptionInjectPluginIdInHeader", map);
    }

    public ApiResponse setOptionMaxChartTimeInMins(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("ascan", "action", "setOptionMaxChartTimeInMins", map);
    }

    public ApiResponse setOptionMaxResultsToList(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("ascan", "action", "setOptionMaxResultsToList", map);
    }

    public ApiResponse setOptionMaxRuleDurationInMins(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("ascan", "action", "setOptionMaxRuleDurationInMins", map);
    }

    public ApiResponse setOptionMaxScanDurationInMins(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("ascan", "action", "setOptionMaxScanDurationInMins", map);
    }

    public ApiResponse setOptionMaxScansInUI(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("ascan", "action", "setOptionMaxScansInUI", map);
    }

    public ApiResponse setOptionPromptInAttackMode(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("ascan", "action", "setOptionPromptInAttackMode", map);
    }

    public ApiResponse setOptionPromptToClearFinishedScans(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("ascan", "action", "setOptionPromptToClearFinishedScans", map);
    }

    public ApiResponse setOptionRescanInAttackMode(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("ascan", "action", "setOptionRescanInAttackMode", map);
    }

    /**
     * Sets whether or not the HTTP Headers of all requests should be scanned. Not just requests
     * that send parameters, through the query or request body.
     */
    public ApiResponse setOptionScanHeadersAllRequests(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("ascan", "action", "setOptionScanHeadersAllRequests", map);
    }

    /** Sets whether or not the active scanner should scan null JSON values. */
    public ApiResponse setOptionScanNullJsonValues(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("ascan", "action", "setOptionScanNullJsonValues", map);
    }

    public ApiResponse setOptionShowAdvancedDialog(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("ascan", "action", "setOptionShowAdvancedDialog", map);
    }

    public ApiResponse setOptionTargetParamsEnabledRPC(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("ascan", "action", "setOptionTargetParamsEnabledRPC", map);
    }

    public ApiResponse setOptionTargetParamsInjectable(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("ascan", "action", "setOptionTargetParamsInjectable", map);
    }

    public ApiResponse setOptionThreadPerHost(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("ascan", "action", "setOptionThreadPerHost", map);
    }
} @SuppressWarnings("javadoc")
public class Authentication extends org.zaproxy.clientapi.gen.deprecated.AuthenticationDeprecated {

    private final ClientApi api;

    public Authentication(ClientApi api) {
        super(api);
        this.api = api;
    }

    /** Gets the name of the authentication methods. */
    public ApiResponse getSupportedAuthenticationMethods() throws ClientApiException {
        return api.callApi("authentication", "view", "getSupportedAuthenticationMethods", null);
    }

    /** Gets the configuration parameters for the authentication method with the given name. */
    public ApiResponse getAuthenticationMethodConfigParams(String authmethodname)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("authMethodName", authmethodname);
        return api.callApi("authentication", "view", "getAuthenticationMethodConfigParams", map);
    }

    /** Gets the name of the authentication method for the context with the given ID. */
    public ApiResponse getAuthenticationMethod(String contextid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        return api.callApi("authentication", "view", "getAuthenticationMethod", map);
    }

    /** Gets the logged in indicator for the context with the given ID. */
    public ApiResponse getLoggedInIndicator(String contextid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        return api.callApi("authentication", "view", "getLoggedInIndicator", map);
    }

    /** Gets the logged out indicator for the context with the given ID. */
    public ApiResponse getLoggedOutIndicator(String contextid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        return api.callApi("authentication", "view", "getLoggedOutIndicator", map);
    }

    /** Sets the authentication method for the context with the given ID. */
    public ApiResponse setAuthenticationMethod(
            String contextid, String authmethodname, String authmethodconfigparams)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("authMethodName", authmethodname);
        if (authmethodconfigparams != null) {
            map.put("authMethodConfigParams", authmethodconfigparams);
        }
        return api.callApi("authentication", "action", "setAuthenticationMethod", map);
    }

    /** Sets the logged in indicator for the context with the given ID. */
    public ApiResponse setLoggedInIndicator(String contextid, String loggedinindicatorregex)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("loggedInIndicatorRegex", loggedinindicatorregex);
        return api.callApi("authentication", "action", "setLoggedInIndicator", map);
    }

    /** Sets the logged out indicator for the context with the given ID. */
    public ApiResponse setLoggedOutIndicator(String contextid, String loggedoutindicatorregex)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("loggedOutIndicatorRegex", loggedoutindicatorregex);
        return api.callApi("authentication", "action", "setLoggedOutIndicator", map);
    }
} @SuppressWarnings("javadoc")
public class Authorization extends org.zaproxy.clientapi.gen.deprecated.AuthorizationDeprecated {

    private final ClientApi api;

    public Authorization(ClientApi api) {
        super(api);
        this.api = api;
    }

    /**
     * Obtains all the configuration of the authorization detection method that is currently set for
     * a context.
     */
    public ApiResponse getAuthorizationDetectionMethod(String contextid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        return api.callApi("authorization", "view", "getAuthorizationDetectionMethod", map);
    }

    /**
     * Sets the authorization detection method for a context as one that identifies un-authorized
     * messages based on: the message's status code or a regex pattern in the response's header or
     * body. Also, whether all conditions must match or just some can be specified via the
     * logicalOperator parameter, which accepts two values: "AND" (default), "OR".
     */
    public ApiResponse setBasicAuthorizationDetectionMethod(
            String contextid,
            String headerregex,
            String bodyregex,
            String statuscode,
            String logicaloperator)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        if (headerregex != null) {
            map.put("headerRegex", headerregex);
        }
        if (bodyregex != null) {
            map.put("bodyRegex", bodyregex);
        }
        if (statuscode != null) {
            map.put("statusCode", statuscode);
        }
        if (logicaloperator != null) {
            map.put("logicalOperator", logicaloperator);
        }
        return api.callApi("authorization", "action", "setBasicAuthorizationDetectionMethod", map);
    }
} @SuppressWarnings("javadoc")
public class Automation {

    private final ClientApi api;

    public Automation(ClientApi api) {
        this.api = api;
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public ApiResponse planProgress(String planid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("planId", planid);
        return api.callApi("automation", "view", "planProgress", map);
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public ApiResponse runPlan(String filepath) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("filePath", filepath);
        return api.callApi("automation", "action", "runPlan", map);
    }
} @SuppressWarnings("javadoc")
public class Autoupdate extends org.zaproxy.clientapi.gen.deprecated.AutoupdateDeprecated {

    private final ClientApi api;

    public Autoupdate(ClientApi api) {
        super(api);
        this.api = api;
    }

    /** Returns the latest version number */
    public ApiResponse latestVersionNumber() throws ClientApiException {
        return api.callApi("autoupdate", "view", "latestVersionNumber", null);
    }

    /** Returns 'true' if ZAP is on the latest version */
    public ApiResponse isLatestVersion() throws ClientApiException {
        return api.callApi("autoupdate", "view", "isLatestVersion", null);
    }

    /** Return a list of all of the installed add-ons */
    public ApiResponse installedAddons() throws ClientApiException {
        return api.callApi("autoupdate", "view", "installedAddons", null);
    }

    /** Returns a list with all local add-ons, installed or not. */
    public ApiResponse localAddons() throws ClientApiException {
        return api.callApi("autoupdate", "view", "localAddons", null);
    }

    /**
     * Return a list of any add-ons that have been added to the Marketplace since the last check for
     * updates
     */
    public ApiResponse newAddons() throws ClientApiException {
        return api.callApi("autoupdate", "view", "newAddons", null);
    }

    /**
     * Return a list of any add-ons that have been changed in the Marketplace since the last check
     * for updates
     */
    public ApiResponse updatedAddons() throws ClientApiException {
        return api.callApi("autoupdate", "view", "updatedAddons", null);
    }

    /**
     * Return a list of all of the add-ons on the ZAP Marketplace (this information is read once and
     * then cached)
     */
    public ApiResponse marketplaceAddons() throws ClientApiException {
        return api.callApi("autoupdate", "view", "marketplaceAddons", null);
    }

    public ApiResponse optionAddonDirectories() throws ClientApiException {
        return api.callApi("autoupdate", "view", "optionAddonDirectories", null);
    }

    public ApiResponse optionDayLastChecked() throws ClientApiException {
        return api.callApi("autoupdate", "view", "optionDayLastChecked", null);
    }

    public ApiResponse optionDayLastInstallWarned() throws ClientApiException {
        return api.callApi("autoupdate", "view", "optionDayLastInstallWarned", null);
    }

    public ApiResponse optionDayLastUpdateWarned() throws ClientApiException {
        return api.callApi("autoupdate", "view", "optionDayLastUpdateWarned", null);
    }

    public ApiResponse optionDownloadDirectory() throws ClientApiException {
        return api.callApi("autoupdate", "view", "optionDownloadDirectory", null);
    }

    public ApiResponse optionCheckAddonUpdates() throws ClientApiException {
        return api.callApi("autoupdate", "view", "optionCheckAddonUpdates", null);
    }

    public ApiResponse optionCheckOnStart() throws ClientApiException {
        return api.callApi("autoupdate", "view", "optionCheckOnStart", null);
    }

    public ApiResponse optionDownloadNewRelease() throws ClientApiException {
        return api.callApi("autoupdate", "view", "optionDownloadNewRelease", null);
    }

    public ApiResponse optionInstallAddonUpdates() throws ClientApiException {
        return api.callApi("autoupdate", "view", "optionInstallAddonUpdates", null);
    }

    public ApiResponse optionInstallScannerRules() throws ClientApiException {
        return api.callApi("autoupdate", "view", "optionInstallScannerRules", null);
    }

    public ApiResponse optionReportAlphaAddons() throws ClientApiException {
        return api.callApi("autoupdate", "view", "optionReportAlphaAddons", null);
    }

    public ApiResponse optionReportBetaAddons() throws ClientApiException {
        return api.callApi("autoupdate", "view", "optionReportBetaAddons", null);
    }

    public ApiResponse optionReportReleaseAddons() throws ClientApiException {
        return api.callApi("autoupdate", "view", "optionReportReleaseAddons", null);
    }

    /** Downloads the latest release, if any */
    public ApiResponse downloadLatestRelease() throws ClientApiException {
        return api.callApi("autoupdate", "action", "downloadLatestRelease", null);
    }

    /**
     * Installs or updates the specified add-on, returning when complete (i.e. not asynchronously)
     */
    public ApiResponse installAddon(String id) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("id", id);
        return api.callApi("autoupdate", "action", "installAddon", map);
    }

    public ApiResponse installLocalAddon(String file) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("file", file);
        return api.callApi("autoupdate", "action", "installLocalAddon", map);
    }

    /** Uninstalls the specified add-on */
    public ApiResponse uninstallAddon(String id) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("id", id);
        return api.callApi("autoupdate", "action", "uninstallAddon", map);
    }

    public ApiResponse setOptionCheckAddonUpdates(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("autoupdate", "action", "setOptionCheckAddonUpdates", map);
    }

    public ApiResponse setOptionCheckOnStart(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("autoupdate", "action", "setOptionCheckOnStart", map);
    }

    public ApiResponse setOptionDownloadNewRelease(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("autoupdate", "action", "setOptionDownloadNewRelease", map);
    }

    public ApiResponse setOptionInstallAddonUpdates(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("autoupdate", "action", "setOptionInstallAddonUpdates", map);
    }

    public ApiResponse setOptionInstallScannerRules(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("autoupdate", "action", "setOptionInstallScannerRules", map);
    }

    public ApiResponse setOptionReportAlphaAddons(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("autoupdate", "action", "setOptionReportAlphaAddons", map);
    }

    public ApiResponse setOptionReportBetaAddons(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("autoupdate", "action", "setOptionReportBetaAddons", map);
    }

    public ApiResponse setOptionReportReleaseAddons(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("autoupdate", "action", "setOptionReportReleaseAddons", map);
    }
} @SuppressWarnings("javadoc")
public class Break extends org.zaproxy.clientapi.gen.deprecated.BreakDeprecated {

    private final ClientApi api;

    public Break(ClientApi api) {
        super(api);
        this.api = api;
    }

    /** Returns True if ZAP will break on both requests and responses */
    public ApiResponse isBreakAll() throws ClientApiException {
        return api.callApi("break", "view", "isBreakAll", null);
    }

    /** Returns True if ZAP will break on requests */
    public ApiResponse isBreakRequest() throws ClientApiException {
        return api.callApi("break", "view", "isBreakRequest", null);
    }

    /** Returns True if ZAP will break on responses */
    public ApiResponse isBreakResponse() throws ClientApiException {
        return api.callApi("break", "view", "isBreakResponse", null);
    }

    /** Returns the HTTP message currently intercepted (if any) */
    public ApiResponse httpMessage() throws ClientApiException {
        return api.callApi("break", "view", "httpMessage", null);
    }

    /**
     * Controls the global break functionality. The type may be one of: http-all, http-request or
     * http-response. The state may be true (for turning break on for the specified type) or false
     * (for turning break off). Scope is not currently used.
     */
    public ApiResponse brk(String type, String state, String scope) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("type", type);
        map.put("state", state);
        if (scope != null) {
            map.put("scope", scope);
        }
        return api.callApi("break", "action", "break", map);
    }

    /** Overwrites the currently intercepted message with the data provided */
    public ApiResponse setHttpMessage(String httpheader, String httpbody)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("httpHeader", httpheader);
        if (httpbody != null) {
            map.put("httpBody", httpbody);
        }
        return api.callApi("break", "action", "setHttpMessage", map);
    }

    /**
     * Submits the currently intercepted message and unsets the global request/response breakpoints
     */
    public ApiResponse cont() throws ClientApiException {
        return api.callApi("break", "action", "continue", null);
    }

    /**
     * Submits the currently intercepted message, the next request or response will automatically be
     * intercepted
     */
    public ApiResponse step() throws ClientApiException {
        return api.callApi("break", "action", "step", null);
    }

    /** Drops the currently intercepted message */
    public ApiResponse drop() throws ClientApiException {
        return api.callApi("break", "action", "drop", null);
    }

    /**
     * Adds a custom HTTP breakpoint. The string is the string to match. Location may be one of:
     * url, request_header, request_body, response_header or response_body. Match may be: contains
     * or regex. Inverse (match) may be true or false. Lastly, ignorecase (when matching the string)
     * may be true or false.
     */
    public ApiResponse addHttpBreakpoint(
            String string, String location, String match, String inverse, String ignorecase)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("string", string);
        map.put("location", location);
        map.put("match", match);
        map.put("inverse", inverse);
        map.put("ignorecase", ignorecase);
        return api.callApi("break", "action", "addHttpBreakpoint", map);
    }

    /** Removes the specified breakpoint */
    public ApiResponse removeHttpBreakpoint(
            String string, String location, String match, String inverse, String ignorecase)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("string", string);
        map.put("location", location);
        map.put("match", match);
        map.put("inverse", inverse);
        map.put("ignorecase", ignorecase);
        return api.callApi("break", "action", "removeHttpBreakpoint", map);
    }
} @SuppressWarnings("javadoc")
public class Context extends org.zaproxy.clientapi.gen.deprecated.ContextDeprecated {

    private final ClientApi api;

    public Context(ClientApi api) {
        super(api);
        this.api = api;
    }

    /** List context names of current session */
    public ApiResponse contextList() throws ClientApiException {
        return api.callApi("context", "view", "contextList", null);
    }

    /** List excluded regexs for context */
    public ApiResponse excludeRegexs(String contextname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        return api.callApi("context", "view", "excludeRegexs", map);
    }

    /** List included regexs for context */
    public ApiResponse includeRegexs(String contextname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        return api.callApi("context", "view", "includeRegexs", map);
    }

    /** List the information about the named context */
    public ApiResponse context(String contextname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        return api.callApi("context", "view", "context", map);
    }

    /** Lists the names of all built in technologies */
    public ApiResponse technologyList() throws ClientApiException {
        return api.callApi("context", "view", "technologyList", null);
    }

    /** Lists the names of all technologies included in a context */
    public ApiResponse includedTechnologyList(String contextname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        return api.callApi("context", "view", "includedTechnologyList", map);
    }

    /** Lists the names of all technologies excluded from a context */
    public ApiResponse excludedTechnologyList(String contextname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        return api.callApi("context", "view", "excludedTechnologyList", map);
    }

    /** Lists the URLs accessed through/by ZAP, that belong to the context with the given name. */
    public ApiResponse urls(String contextname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        return api.callApi("context", "view", "urls", map);
    }

    /** Add exclude regex to context */
    public ApiResponse excludeFromContext(String contextname, String regex)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        map.put("regex", regex);
        return api.callApi("context", "action", "excludeFromContext", map);
    }

    /** Add include regex to context */
    public ApiResponse includeInContext(String contextname, String regex)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        map.put("regex", regex);
        return api.callApi("context", "action", "includeInContext", map);
    }

    /** Set the regexs to include and exclude for a context, both supplied as JSON string arrays */
    public ApiResponse setContextRegexs(String contextname, String incregexs, String excregexs)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        map.put("incRegexs", incregexs);
        map.put("excRegexs", excregexs);
        return api.callApi("context", "action", "setContextRegexs", map);
    }

    /**
     * Set the checking strategy for a context - this defines how ZAP checks that a request is
     * authenticated
     */
    public ApiResponse setContextCheckingStrategy(
            String contextname,
            String checkingstrategy,
            String pollurl,
            String polldata,
            String pollheaders,
            String pollfrequency,
            String pollfrequencyunits)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        map.put("checkingStrategy", checkingstrategy);
        if (pollurl != null) {
            map.put("pollUrl", pollurl);
        }
        if (polldata != null) {
            map.put("pollData", polldata);
        }
        if (pollheaders != null) {
            map.put("pollHeaders", pollheaders);
        }
        if (pollfrequency != null) {
            map.put("pollFrequency", pollfrequency);
        }
        if (pollfrequencyunits != null) {
            map.put("pollFrequencyUnits", pollfrequencyunits);
        }
        return api.callApi("context", "action", "setContextCheckingStrategy", map);
    }

    /** Creates a new context with the given name in the current session */
    public ApiResponse newContext(String contextname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        return api.callApi("context", "action", "newContext", map);
    }

    /** Removes a context in the current session */
    public ApiResponse removeContext(String contextname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        return api.callApi("context", "action", "removeContext", map);
    }

    /**
     * Exports the context with the given name to a file. If a relative file path is specified it
     * will be resolved against the "contexts" directory in ZAP "home" dir.
     */
    public ApiResponse exportContext(String contextname, String contextfile)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        map.put("contextFile", contextfile);
        return api.callApi("context", "action", "exportContext", map);
    }

    /**
     * Imports a context from a file. If a relative file path is specified it will be resolved
     * against the "contexts" directory in ZAP "home" dir.
     */
    public ApiResponse importContext(String contextfile) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextFile", contextfile);
        return api.callApi("context", "action", "importContext", map);
    }

    /** Includes technologies with the given names, separated by a comma, to a context */
    public ApiResponse includeContextTechnologies(String contextname, String technologynames)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        map.put("technologyNames", technologynames);
        return api.callApi("context", "action", "includeContextTechnologies", map);
    }

    /** Includes all built in technologies in to a context */
    public ApiResponse includeAllContextTechnologies(String contextname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        return api.callApi("context", "action", "includeAllContextTechnologies", map);
    }

    /** Excludes technologies with the given names, separated by a comma, from a context */
    public ApiResponse excludeContextTechnologies(String contextname, String technologynames)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        map.put("technologyNames", technologynames);
        return api.callApi("context", "action", "excludeContextTechnologies", map);
    }

    /** Excludes all built in technologies from a context */
    public ApiResponse excludeAllContextTechnologies(String contextname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        return api.callApi("context", "action", "excludeAllContextTechnologies", map);
    }

    /** Sets a context to in scope (contexts are in scope by default) */
    public ApiResponse setContextInScope(String contextname, String booleaninscope)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextName", contextname);
        map.put("booleanInScope", booleaninscope);
        return api.callApi("context", "action", "setContextInScope", map);
    }
} @SuppressWarnings("javadoc")
public class Core extends org.zaproxy.clientapi.gen.deprecated.CoreDeprecated {

    private final ClientApi api;

    public Core(ClientApi api) {
        super(api);
        this.api = api;
    }

    /** Gets the name of the hosts accessed through/by ZAP */
    public ApiResponse hosts() throws ClientApiException {
        return api.callApi("core", "view", "hosts", null);
    }

    /** Gets the sites accessed through/by ZAP (scheme and domain) */
    public ApiResponse sites() throws ClientApiException {
        return api.callApi("core", "view", "sites", null);
    }

    /** Gets the URLs accessed through/by ZAP, optionally filtering by (base) URL. */
    public ApiResponse urls(String baseurl) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        return api.callApi("core", "view", "urls", map);
    }

    /** Gets the child nodes underneath the specified URL in the Sites tree */
    public ApiResponse childNodes(String url) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (url != null) {
            map.put("url", url);
        }
        return api.callApi("core", "view", "childNodes", map);
    }

    /**
     * Gets the HTTP message with the given ID. Returns the ID, request/response headers and bodies,
     * cookies, note, type, RTT, and timestamp.
     */
    public ApiResponse message(String id) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("id", id);
        return api.callApi("core", "view", "message", map);
    }

    /**
     * Gets the HTTP messages sent by ZAP, request and response, optionally filtered by URL and
     * paginated with 'start' position and 'count' of messages
     */
    public ApiResponse messages(String baseurl, String start, String count)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        if (start != null) {
            map.put("start", start);
        }
        if (count != null) {
            map.put("count", count);
        }
        return api.callApi("core", "view", "messages", map);
    }

    /** Gets the HTTP messages with the given IDs. */
    public ApiResponse messagesById(String ids) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("ids", ids);
        return api.callApi("core", "view", "messagesById", map);
    }

    /** Gets the number of messages, optionally filtering by URL */
    public ApiResponse numberOfMessages(String baseurl) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        return api.callApi("core", "view", "numberOfMessages", map);
    }

    /** Gets the mode */
    public ApiResponse mode() throws ClientApiException {
        return api.callApi("core", "view", "mode", null);
    }

    /** Gets ZAP version */
    public ApiResponse version() throws ClientApiException {
        return api.callApi("core", "view", "version", null);
    }

    /** Gets the regular expressions, applied to URLs, to exclude from the local proxies. */
    public ApiResponse excludedFromProxy() throws ClientApiException {
        return api.callApi("core", "view", "excludedFromProxy", null);
    }

    /** Gets the location of the current session file */
    public ApiResponse sessionLocation() throws ClientApiException {
        return api.callApi("core", "view", "sessionLocation", null);
    }

    /**
     * Gets all the domains that are excluded from the outgoing proxy. For each domain the following
     * are shown: the index, the value (domain), if enabled, and if specified as a regex.
     */
    public ApiResponse proxyChainExcludedDomains() throws ClientApiException {
        return api.callApi("core", "view", "proxyChainExcludedDomains", null);
    }

    /** Gets the path to ZAP's home directory. */
    public ApiResponse zapHomePath() throws ClientApiException {
        return api.callApi("core", "view", "zapHomePath", null);
    }

    /** Gets the maximum number of alert instances to include in a report. */
    public ApiResponse optionMaximumAlertInstances() throws ClientApiException {
        return api.callApi("core", "view", "optionMaximumAlertInstances", null);
    }

    /** Gets whether or not related alerts will be merged in any reports generated. */
    public ApiResponse optionMergeRelatedAlerts() throws ClientApiException {
        return api.callApi("core", "view", "optionMergeRelatedAlerts", null);
    }

    /** Gets the path to the file with alert overrides. */
    public ApiResponse optionAlertOverridesFilePath() throws ClientApiException {
        return api.callApi("core", "view", "optionAlertOverridesFilePath", null);
    }

    /** @deprecated */
    @Deprecated
    public ApiResponse homeDirectory() throws ClientApiException {
        return api.callApi("core", "view", "homeDirectory", null);
    }

    /**
     * Use view proxyChainExcludedDomains instead.
     *
     * @deprecated
     */
    @Deprecated
    public ApiResponse optionProxyChainSkipName() throws ClientApiException {
        return api.callApi("core", "view", "optionProxyChainSkipName", null);
    }

    /**
     * Use view proxyChainExcludedDomains instead.
     *
     * @deprecated
     */
    @Deprecated
    public ApiResponse optionProxyExcludedDomains() throws ClientApiException {
        return api.callApi("core", "view", "optionProxyExcludedDomains", null);
    }

    /**
     * Use view proxyChainExcludedDomains instead.
     *
     * @deprecated
     */
    @Deprecated
    public ApiResponse optionProxyExcludedDomainsEnabled() throws ClientApiException {
        return api.callApi("core", "view", "optionProxyExcludedDomainsEnabled", null);
    }

    /**
     * Gets the alert with the given ID, the corresponding HTTP message can be obtained with the
     * 'messageId' field and 'message' API method
     *
     * @deprecated Use the API endpoint with the same name in the 'alert' component instead.
     */
    @Deprecated
    public ApiResponse alert(String id) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("id", id);
        return api.callApi("core", "view", "alert", map);
    }

    /**
     * Gets the alerts raised by ZAP, optionally filtering by URL or riskId, and paginating with
     * 'start' position and 'count' of alerts
     *
     * @deprecated Use the API endpoint with the same name in the 'alert' component instead.
     */
    @Deprecated
    public ApiResponse alerts(String baseurl, String start, String count, String riskid)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        if (start != null) {
            map.put("start", start);
        }
        if (count != null) {
            map.put("count", count);
        }
        if (riskid != null) {
            map.put("riskId", riskid);
        }
        return api.callApi("core", "view", "alerts", map);
    }

    /**
     * Gets number of alerts grouped by each risk level, optionally filtering by URL
     *
     * @deprecated Use the API endpoint with the same name in the 'alert' component instead.
     */
    @Deprecated
    public ApiResponse alertsSummary(String baseurl) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        return api.callApi("core", "view", "alertsSummary", map);
    }

    /**
     * Gets the number of alerts, optionally filtering by URL or riskId
     *
     * @deprecated Use the API endpoint with the same name in the 'alert' component instead.
     */
    @Deprecated
    public ApiResponse numberOfAlerts(String baseurl, String riskid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        if (riskid != null) {
            map.put("riskId", riskid);
        }
        return api.callApi("core", "view", "numberOfAlerts", map);
    }

    /**
     * Gets the user agent that ZAP should use when creating HTTP messages (for example, spider
     * messages or CONNECT requests to outgoing proxy).
     */
    public ApiResponse optionDefaultUserAgent() throws ClientApiException {
        return api.callApi("core", "view", "optionDefaultUserAgent", null);
    }

    /** Gets the TTL (in seconds) of successful DNS queries. */
    public ApiResponse optionDnsTtlSuccessfulQueries() throws ClientApiException {
        return api.callApi("core", "view", "optionDnsTtlSuccessfulQueries", null);
    }

    public ApiResponse optionHttpState() throws ClientApiException {
        return api.callApi("core", "view", "optionHttpState", null);
    }

    public ApiResponse optionProxyChainName() throws ClientApiException {
        return api.callApi("core", "view", "optionProxyChainName", null);
    }

    public ApiResponse optionProxyChainPassword() throws ClientApiException {
        return api.callApi("core", "view", "optionProxyChainPassword", null);
    }

    public ApiResponse optionProxyChainPort() throws ClientApiException {
        return api.callApi("core", "view", "optionProxyChainPort", null);
    }

    public ApiResponse optionProxyChainRealm() throws ClientApiException {
        return api.callApi("core", "view", "optionProxyChainRealm", null);
    }

    public ApiResponse optionProxyChainUserName() throws ClientApiException {
        return api.callApi("core", "view", "optionProxyChainUserName", null);
    }

    /** Gets the connection time out (in seconds). */
    public ApiResponse optionTimeoutInSecs() throws ClientApiException {
        return api.callApi("core", "view", "optionTimeoutInSecs", null);
    }

    public ApiResponse optionHttpStateEnabled() throws ClientApiException {
        return api.callApi("core", "view", "optionHttpStateEnabled", null);
    }

    public ApiResponse optionProxyChainPrompt() throws ClientApiException {
        return api.callApi("core", "view", "optionProxyChainPrompt", null);
    }

    public ApiResponse optionSingleCookieRequestHeader() throws ClientApiException {
        return api.callApi("core", "view", "optionSingleCookieRequestHeader", null);
    }

    public ApiResponse optionUseProxyChain() throws ClientApiException {
        return api.callApi("core", "view", "optionUseProxyChain", null);
    }

    public ApiResponse optionUseProxyChainAuth() throws ClientApiException {
        return api.callApi("core", "view", "optionUseProxyChainAuth", null);
    }

    /** Gets whether or not the SOCKS proxy should be used. */
    public ApiResponse optionUseSocksProxy() throws ClientApiException {
        return api.callApi("core", "view", "optionUseSocksProxy", null);
    }

    /**
     * Convenient and simple action to access a URL, optionally following redirections. Returns the
     * request sent and response received and followed redirections, if any. Other actions are
     * available which offer more control on what is sent, like, 'sendRequest' or 'sendHarRequest'.
     */
    public ApiResponse accessUrl(String url, String followredirects) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("url", url);
        if (followredirects != null) {
            map.put("followRedirects", followredirects);
        }
        return api.callApi("core", "action", "accessUrl", map);
    }

    /** Shuts down ZAP */
    public ApiResponse shutdown() throws ClientApiException {
        return api.callApi("core", "action", "shutdown", null);
    }

    /**
     * Creates a new session, optionally overwriting existing files. If a relative path is specified
     * it will be resolved against the "session" directory in ZAP "home" dir.
     */
    public ApiResponse newSession(String name, String overwrite) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (name != null) {
            map.put("name", name);
        }
        if (overwrite != null) {
            map.put("overwrite", overwrite);
        }
        return api.callApi("core", "action", "newSession", map);
    }

    /**
     * Loads the session with the given name. If a relative path is specified it will be resolved
     * against the "session" directory in ZAP "home" dir.
     */
    public ApiResponse loadSession(String name) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("name", name);
        return api.callApi("core", "action", "loadSession", map);
    }

    /** Saves the session. */
    public ApiResponse saveSession(String name, String overwrite) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("name", name);
        if (overwrite != null) {
            map.put("overwrite", overwrite);
        }
        return api.callApi("core", "action", "saveSession", map);
    }

    /**
     * Snapshots the session, optionally with the given name, and overwriting existing files. If no
     * name is specified the name of the current session with a timestamp appended is used. If a
     * relative path is specified it will be resolved against the "session" directory in ZAP "home"
     * dir.
     */
    public ApiResponse snapshotSession(String name, String overwrite) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (name != null) {
            map.put("name", name);
        }
        if (overwrite != null) {
            map.put("overwrite", overwrite);
        }
        return api.callApi("core", "action", "snapshotSession", map);
    }

    /** Clears the regexes of URLs excluded from the local proxies. */
    public ApiResponse clearExcludedFromProxy() throws ClientApiException {
        return api.callApi("core", "action", "clearExcludedFromProxy", null);
    }

    /** Adds a regex of URLs that should be excluded from the local proxies. */
    public ApiResponse excludeFromProxy(String regex) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("regex", regex);
        return api.callApi("core", "action", "excludeFromProxy", map);
    }

    public ApiResponse setHomeDirectory(String dir) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("dir", dir);
        return api.callApi("core", "action", "setHomeDirectory", map);
    }

    /** Sets the mode, which may be one of [safe, protect, standard, attack] */
    public ApiResponse setMode(String mode) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("mode", mode);
        return api.callApi("core", "action", "setMode", map);
    }

    /** Generates a new Root CA certificate for the local proxies. */
    public ApiResponse generateRootCA() throws ClientApiException {
        return api.callApi("core", "action", "generateRootCA", null);
    }

    /**
     * Sends the HTTP request, optionally following redirections. Returns the request sent and
     * response received and followed redirections, if any. The Mode is enforced when sending the
     * request (and following redirections), custom manual requests are not allowed in 'Safe' mode
     * nor in 'Protected' mode if out of scope.
     */
    public ApiResponse sendRequest(String request, String followredirects)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("request", request);
        if (followredirects != null) {
            map.put("followRedirects", followredirects);
        }
        return api.callApi("core", "action", "sendRequest", map);
    }

    public ApiResponse runGarbageCollection() throws ClientApiException {
        return api.callApi("core", "action", "runGarbageCollection", null);
    }

    /**
     * Deletes the site node found in the Sites Tree on the basis of the URL, HTTP method, and post
     * data (if applicable and specified).
     */
    public ApiResponse deleteSiteNode(String url, String method, String postdata)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("url", url);
        if (method != null) {
            map.put("method", method);
        }
        if (postdata != null) {
            map.put("postData", postdata);
        }
        return api.callApi("core", "action", "deleteSiteNode", map);
    }

    /**
     * Adds a domain to be excluded from the outgoing proxy, using the specified value. Optionally
     * sets if the new entry is enabled (default, true) and whether or not the new value is
     * specified as a regex (default, false).
     */
    public ApiResponse addProxyChainExcludedDomain(String value, String isregex, String isenabled)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("value", value);
        if (isregex != null) {
            map.put("isRegex", isregex);
        }
        if (isenabled != null) {
            map.put("isEnabled", isenabled);
        }
        return api.callApi("core", "action", "addProxyChainExcludedDomain", map);
    }

    /**
     * Modifies a domain excluded from the outgoing proxy. Allows to modify the value, if enabled or
     * if a regex. The domain is selected with its index, which can be obtained with the view
     * proxyChainExcludedDomains.
     */
    public ApiResponse modifyProxyChainExcludedDomain(
            String idx, String value, String isregex, String isenabled) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("idx", idx);
        if (value != null) {
            map.put("value", value);
        }
        if (isregex != null) {
            map.put("isRegex", isregex);
        }
        if (isenabled != null) {
            map.put("isEnabled", isenabled);
        }
        return api.callApi("core", "action", "modifyProxyChainExcludedDomain", map);
    }

    /**
     * Removes a domain excluded from the outgoing proxy, with the given index. The index can be
     * obtained with the view proxyChainExcludedDomains.
     */
    public ApiResponse removeProxyChainExcludedDomain(String idx) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("idx", idx);
        return api.callApi("core", "action", "removeProxyChainExcludedDomain", map);
    }

    /** Enables all domains excluded from the outgoing proxy. */
    public ApiResponse enableAllProxyChainExcludedDomains() throws ClientApiException {
        return api.callApi("core", "action", "enableAllProxyChainExcludedDomains", null);
    }

    /** Disables all domains excluded from the outgoing proxy. */
    public ApiResponse disableAllProxyChainExcludedDomains() throws ClientApiException {
        return api.callApi("core", "action", "disableAllProxyChainExcludedDomains", null);
    }

    /**
     * Sets the maximum number of alert instances to include in a report. A value of zero is treated
     * as unlimited.
     */
    public ApiResponse setOptionMaximumAlertInstances(String numberofinstances)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("numberOfInstances", numberofinstances);
        return api.callApi("core", "action", "setOptionMaximumAlertInstances", map);
    }

    /** Sets whether or not related alerts will be merged in any reports generated. */
    public ApiResponse setOptionMergeRelatedAlerts(String enabled) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("enabled", enabled);
        return api.callApi("core", "action", "setOptionMergeRelatedAlerts", map);
    }

    /** Sets (or clears, if empty) the path to the file with alert overrides. */
    public ApiResponse setOptionAlertOverridesFilePath(String filepath) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (filepath != null) {
            map.put("filePath", filepath);
        }
        return api.callApi("core", "action", "setOptionAlertOverridesFilePath", map);
    }

    /**
     * Enables use of a PKCS12 client certificate for the certificate with the given file system
     * path, password, and optional index.
     */
    public ApiResponse enablePKCS12ClientCertificate(String filepath, String password, String index)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("filePath", filepath);
        map.put("password", password);
        if (index != null) {
            map.put("index", index);
        }
        return api.callApi("core", "action", "enablePKCS12ClientCertificate", map);
    }

    /** Disables the option for use of client certificates. */
    public ApiResponse disableClientCertificate() throws ClientApiException {
        return api.callApi("core", "action", "disableClientCertificate", null);
    }

    /**
     * Deletes all alerts of the current session.
     *
     * @deprecated Use the API endpoint with the same name in the 'alert' component instead.
     */
    @Deprecated
    public ApiResponse deleteAllAlerts() throws ClientApiException {
        return api.callApi("core", "action", "deleteAllAlerts", null);
    }

    /**
     * Deletes the alert with the given ID.
     *
     * @deprecated Use the API endpoint with the same name in the 'alert' component instead.
     */
    @Deprecated
    public ApiResponse deleteAlert(String id) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("id", id);
        return api.callApi("core", "action", "deleteAlert", map);
    }

    /**
     * Sets the user agent that ZAP should use when creating HTTP messages (for example, spider
     * messages or CONNECT requests to outgoing proxy).
     */
    public ApiResponse setOptionDefaultUserAgent(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("core", "action", "setOptionDefaultUserAgent", map);
    }

    public ApiResponse setOptionProxyChainName(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("core", "action", "setOptionProxyChainName", map);
    }

    public ApiResponse setOptionProxyChainPassword(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("core", "action", "setOptionProxyChainPassword", map);
    }

    public ApiResponse setOptionProxyChainRealm(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("core", "action", "setOptionProxyChainRealm", map);
    }

    /**
     * Use actions [add|modify|remove]ProxyChainExcludedDomain instead.
     *
     * @deprecated Option no longer in effective use.
     */
    @Deprecated
    public ApiResponse setOptionProxyChainSkipName(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("core", "action", "setOptionProxyChainSkipName", map);
    }

    public ApiResponse setOptionProxyChainUserName(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("core", "action", "setOptionProxyChainUserName", map);
    }

    /** Sets the TTL (in seconds) of successful DNS queries (applies after ZAP restart). */
    public ApiResponse setOptionDnsTtlSuccessfulQueries(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("core", "action", "setOptionDnsTtlSuccessfulQueries", map);
    }

    public ApiResponse setOptionHttpStateEnabled(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("core", "action", "setOptionHttpStateEnabled", map);
    }

    public ApiResponse setOptionProxyChainPort(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("core", "action", "setOptionProxyChainPort", map);
    }

    public ApiResponse setOptionProxyChainPrompt(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("core", "action", "setOptionProxyChainPrompt", map);
    }

    public ApiResponse setOptionSingleCookieRequestHeader(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("core", "action", "setOptionSingleCookieRequestHeader", map);
    }

    /** Sets the connection time out (in seconds). */
    public ApiResponse setOptionTimeoutInSecs(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("core", "action", "setOptionTimeoutInSecs", map);
    }

    /**
     * Sets whether or not the outgoing proxy should be used. The address/hostname of the outgoing
     * proxy must be set to enable this option.
     */
    public ApiResponse setOptionUseProxyChain(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("core", "action", "setOptionUseProxyChain", map);
    }

    public ApiResponse setOptionUseProxyChainAuth(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("core", "action", "setOptionUseProxyChainAuth", map);
    }

    /** Sets whether or not the SOCKS proxy should be used. */
    public ApiResponse setOptionUseSocksProxy(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("core", "action", "setOptionUseSocksProxy", map);
    }

    public byte[] proxypac() throws ClientApiException {
        return api.callApiOther("core", "other", "proxy.pac", null);
    }

    /** Gets the Root CA certificate used by the local proxies. */
    public byte[] rootcert() throws ClientApiException {
        return api.callApiOther("core", "other", "rootcert", null);
    }

    public byte[] setproxy(String proxy) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("proxy", proxy);
        return api.callApiOther("core", "other", "setproxy", map);
    }

    /**
     * Generates a report in XML format
     *
     * @deprecated Use the 'generate' API endpoint the 'reports' component instead.
     */
    @Deprecated
    public byte[] xmlreport() throws ClientApiException {
        return api.callApiOther("core", "other", "xmlreport", null);
    }

    /**
     * Generates a report in HTML format
     *
     * @deprecated Use the 'generate' API endpoint the 'reports' component instead.
     */
    @Deprecated
    public byte[] htmlreport() throws ClientApiException {
        return api.callApiOther("core", "other", "htmlreport", null);
    }

    /**
     * Generates a report in JSON format
     *
     * @deprecated Use the 'generate' API endpoint the 'reports' component instead.
     */
    @Deprecated
    public byte[] jsonreport() throws ClientApiException {
        return api.callApiOther("core", "other", "jsonreport", null);
    }

    /**
     * Generates a report in Markdown format
     *
     * @deprecated Use the 'generate' API endpoint the 'reports' component instead.
     */
    @Deprecated
    public byte[] mdreport() throws ClientApiException {
        return api.callApiOther("core", "other", "mdreport", null);
    }

    /** Gets the message with the given ID in HAR format */
    public byte[] messageHar(String id) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("id", id);
        return api.callApiOther("core", "other", "messageHar", map);
    }

    /**
     * Gets the HTTP messages sent through/by ZAP, in HAR format, optionally filtered by URL and
     * paginated with 'start' position and 'count' of messages
     */
    public byte[] messagesHar(String baseurl, String start, String count)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        if (start != null) {
            map.put("start", start);
        }
        if (count != null) {
            map.put("count", count);
        }
        return api.callApiOther("core", "other", "messagesHar", map);
    }

    /** Gets the HTTP messages with the given IDs, in HAR format. */
    public byte[] messagesHarById(String ids) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("ids", ids);
        return api.callApiOther("core", "other", "messagesHarById", map);
    }

    /**
     * Sends the first HAR request entry, optionally following redirections. Returns, in HAR format,
     * the request sent and response received and followed redirections, if any. The Mode is
     * enforced when sending the request (and following redirections), custom manual requests are
     * not allowed in 'Safe' mode nor in 'Protected' mode if out of scope.
     */
    public byte[] sendHarRequest(String request, String followredirects) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("request", request);
        if (followredirects != null) {
            map.put("followRedirects", followredirects);
        }
        return api.callApiOther("core", "other", "sendHarRequest", map);
    }
} @SuppressWarnings("javadoc")
public class Exportreport {

    private final ClientApi api;

    public Exportreport(ClientApi api) {
        this.api = api;
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public ApiResponse formats() throws ClientApiException {
        return api.callApi("exportreport", "view", "formats", null);
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public ApiResponse generate(
            String absolutepath,
            String fileextension,
            String sourcedetails,
            String alertseverity,
            String alertdetails,
            String scanid,
            String includepassivealerts)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("absolutePath", absolutepath);
        map.put("fileExtension", fileextension);
        map.put("sourceDetails", sourcedetails);
        map.put("alertSeverity", alertseverity);
        map.put("alertDetails", alertdetails);
        if (scanid != null) {
            map.put("scanId", scanid);
        }
        if (includepassivealerts != null) {
            map.put("includePassiveAlerts", includepassivealerts);
        }
        return api.callApi("exportreport", "action", "generate", map);
    }
} @SuppressWarnings("javadoc")
public class ForcedUser extends org.zaproxy.clientapi.gen.deprecated.ForcedUserDeprecated {

    private final ClientApi api;

    public ForcedUser(ClientApi api) {
        super(api);
        this.api = api;
    }

    /** Returns 'true' if 'forced user' mode is enabled, 'false' otherwise */
    public ApiResponse isForcedUserModeEnabled() throws ClientApiException {
        return api.callApi("forcedUser", "view", "isForcedUserModeEnabled", null);
    }

    /** Gets the user (ID) set as 'forced user' for the given context (ID) */
    public ApiResponse getForcedUser(String contextid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        return api.callApi("forcedUser", "view", "getForcedUser", map);
    }

    /** Sets the user (ID) that should be used in 'forced user' mode for the given context (ID) */
    public ApiResponse setForcedUser(String contextid, String userid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("userId", userid);
        return api.callApi("forcedUser", "action", "setForcedUser", map);
    }

    /** Sets if 'forced user' mode should be enabled or not */
    public ApiResponse setForcedUserModeEnabled(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("boolean", Boolean.toString(bool));
        return api.callApi("forcedUser", "action", "setForcedUserModeEnabled", map);
    }
} @SuppressWarnings("javadoc")
public class HttpSessions extends org.zaproxy.clientapi.gen.deprecated.HttpSessionsDeprecated {

    private final ClientApi api;

    public HttpSessions(ClientApi api) {
        super(api);
        this.api = api;
    }

    /** Gets all of the sites that have sessions. */
    public ApiResponse sites() throws ClientApiException {
        return api.callApi("httpSessions", "view", "sites", null);
    }

    /**
     * Gets the sessions for the given site. Optionally returning just the session with the given
     * name.
     */
    public ApiResponse sessions(String site, String session) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("site", site);
        if (session != null) {
            map.put("session", session);
        }
        return api.callApi("httpSessions", "view", "sessions", map);
    }

    /** Gets the name of the active session for the given site. */
    public ApiResponse activeSession(String site) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("site", site);
        return api.callApi("httpSessions", "view", "activeSession", map);
    }

    /** Gets the names of the session tokens for the given site. */
    public ApiResponse sessionTokens(String site) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("site", site);
        return api.callApi("httpSessions", "view", "sessionTokens", map);
    }

    /** Gets the default session tokens. */
    public ApiResponse defaultSessionTokens() throws ClientApiException {
        return api.callApi("httpSessions", "view", "defaultSessionTokens", null);
    }

    /** Creates an empty session for the given site. Optionally with the given name. */
    public ApiResponse createEmptySession(String site, String session) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("site", site);
        if (session != null) {
            map.put("session", session);
        }
        return api.callApi("httpSessions", "action", "createEmptySession", map);
    }

    /** Removes the session from the given site. */
    public ApiResponse removeSession(String site, String session) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("site", site);
        map.put("session", session);
        return api.callApi("httpSessions", "action", "removeSession", map);
    }

    /** Sets the given session as active for the given site. */
    public ApiResponse setActiveSession(String site, String session) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("site", site);
        map.put("session", session);
        return api.callApi("httpSessions", "action", "setActiveSession", map);
    }

    /** Unsets the active session of the given site. */
    public ApiResponse unsetActiveSession(String site) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("site", site);
        return api.callApi("httpSessions", "action", "unsetActiveSession", map);
    }

    /** Adds the session token to the given site. */
    public ApiResponse addSessionToken(String site, String sessiontoken) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("site", site);
        map.put("sessionToken", sessiontoken);
        return api.callApi("httpSessions", "action", "addSessionToken", map);
    }

    /** Removes the session token from the given site. */
    public ApiResponse removeSessionToken(String site, String sessiontoken)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("site", site);
        map.put("sessionToken", sessiontoken);
        return api.callApi("httpSessions", "action", "removeSessionToken", map);
    }

    /** Sets the value of the session token of the given session for the given site. */
    public ApiResponse setSessionTokenValue(
            String site, String session, String sessiontoken, String tokenvalue)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("site", site);
        map.put("session", session);
        map.put("sessionToken", sessiontoken);
        map.put("tokenValue", tokenvalue);
        return api.callApi("httpSessions", "action", "setSessionTokenValue", map);
    }

    /** Renames the session of the given site. */
    public ApiResponse renameSession(String site, String oldsessionname, String newsessionname)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("site", site);
        map.put("oldSessionName", oldsessionname);
        map.put("newSessionName", newsessionname);
        return api.callApi("httpSessions", "action", "renameSession", map);
    }

    /** Adds a default session token with the given name and enabled state. */
    public ApiResponse addDefaultSessionToken(String sessiontoken, String tokenenabled)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("sessionToken", sessiontoken);
        if (tokenenabled != null) {
            map.put("tokenEnabled", tokenenabled);
        }
        return api.callApi("httpSessions", "action", "addDefaultSessionToken", map);
    }

    /** Sets whether or not the default session token with the given name is enabled. */
    public ApiResponse setDefaultSessionTokenEnabled(String sessiontoken, String tokenenabled)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("sessionToken", sessiontoken);
        map.put("tokenEnabled", tokenenabled);
        return api.callApi("httpSessions", "action", "setDefaultSessionTokenEnabled", map);
    }

    /** Removes the default session token with the given name. */
    public ApiResponse removeDefaultSessionToken(String sessiontoken) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("sessionToken", sessiontoken);
        return api.callApi("httpSessions", "action", "removeDefaultSessionToken", map);
    }
} @SuppressWarnings("javadoc")
public class ImportLogFiles extends org.zaproxy.clientapi.gen.deprecated.ImportLogFilesDeprecated {

    private final ClientApi api;

    public ImportLogFiles(ClientApi api) {
        super(api);
        this.api = api;
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public ApiResponse ImportZAPLogFromFile(String filepath) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("FilePath", filepath);
        return api.callApi("importLogFiles", "action", "ImportZAPLogFromFile", map);
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public ApiResponse ImportModSecurityLogFromFile(String filepath) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("FilePath", filepath);
        return api.callApi("importLogFiles", "action", "ImportModSecurityLogFromFile", map);
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public ApiResponse ImportZAPHttpRequestResponsePair(String httprequest, String httpresponse)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("HTTPRequest", httprequest);
        map.put("HTTPResponse", httpresponse);
        return api.callApi("importLogFiles", "action", "ImportZAPHttpRequestResponsePair", map);
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public ApiResponse PostModSecurityAuditEvent(String auditeventstring)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (auditeventstring != null) {
            map.put("AuditEventString", auditeventstring);
        }
        return api.callApi("importLogFiles", "action", "PostModSecurityAuditEvent", map);
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public byte[] OtherPostModSecurityAuditEvent(String auditeventstring)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("AuditEventString", auditeventstring);
        return api.callApiOther("importLogFiles", "other", "OtherPostModSecurityAuditEvent", map);
    }
} @SuppressWarnings("javadoc")
public class Importurls {

    private final ClientApi api;

    public Importurls(ClientApi api) {
        this.api = api;
    }

    /**
     * Imports URLs (one per line) from the file with the given file system path.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse importurls(String filepath) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("filePath", filepath);
        return api.callApi("importurls", "action", "importurls", map);
    }
} @SuppressWarnings("javadoc")
public class LocalProxies {

    private final ClientApi api;

    public LocalProxies(ClientApi api) {
        this.api = api;
    }

    /** Gets all of the additional proxies that have been configured. */
    public ApiResponse additionalProxies() throws ClientApiException {
        return api.callApi("localProxies", "view", "additionalProxies", null);
    }

    /** Adds an new proxy using the details supplied. */
    public ApiResponse addAdditionalProxy(
            String address,
            String port,
            String behindnat,
            String alwaysdecodezip,
            String removeunsupportedencodings)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("address", address);
        map.put("port", port);
        if (behindnat != null) {
            map.put("behindNat", behindnat);
        }
        if (alwaysdecodezip != null) {
            map.put("alwaysDecodeZip", alwaysdecodezip);
        }
        if (removeunsupportedencodings != null) {
            map.put("removeUnsupportedEncodings", removeunsupportedencodings);
        }
        return api.callApi("localProxies", "action", "addAdditionalProxy", map);
    }

    /** Removes the additional proxy with the specified address and port. */
    public ApiResponse removeAdditionalProxy(String address, String port)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("address", address);
        map.put("port", port);
        return api.callApi("localProxies", "action", "removeAdditionalProxy", map);
    }
} @SuppressWarnings("javadoc")
public class Openapi extends org.zaproxy.clientapi.gen.deprecated.OpenapiDeprecated {

    private final ClientApi api;

    public Openapi(ClientApi api) {
        super(api);
        this.api = api;
    }

    /**
     * Imports an OpenAPI definition from a local file.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse importFile(String file, String target, String contextid)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("file", file);
        if (target != null) {
            map.put("target", target);
        }
        if (contextid != null) {
            map.put("contextId", contextid);
        }
        return api.callApi("openapi", "action", "importFile", map);
    }

    /**
     * Imports an OpenAPI definition from a URL.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse importUrl(String url, String hostoverride, String contextid)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("url", url);
        if (hostoverride != null) {
            map.put("hostOverride", hostoverride);
        }
        if (contextid != null) {
            map.put("contextId", contextid);
        }
        return api.callApi("openapi", "action", "importUrl", map);
    }
} @SuppressWarnings("javadoc")
public class Params {

    private final ClientApi api;

    public Params(ClientApi api) {
        this.api = api;
    }

    /**
     * Shows the parameters for the specified site, or for all sites if the site is not specified
     */
    public ApiResponse params(String site) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (site != null) {
            map.put("site", site);
        }
        return api.callApi("params", "view", "params", map);
    }
} @SuppressWarnings("javadoc")
public class Pnh extends org.zaproxy.clientapi.gen.deprecated.PnhDeprecated {

    private final ClientApi api;

    public Pnh(ClientApi api) {
        super(api);
        this.api = api;
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public ApiResponse monitor(String id, String message) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("id", id);
        map.put("message", message);
        return api.callApi("pnh", "action", "monitor", map);
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public ApiResponse oracle(String id) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("id", id);
        return api.callApi("pnh", "action", "oracle", map);
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public ApiResponse startMonitoring(String url) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("url", url);
        return api.callApi("pnh", "action", "startMonitoring", map);
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public ApiResponse stopMonitoring(String id) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("id", id);
        return api.callApi("pnh", "action", "stopMonitoring", map);
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public byte[] pnh() throws ClientApiException {
        return api.callApiOther("pnh", "other", "pnh", null);
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public byte[] manifest() throws ClientApiException {
        return api.callApiOther("pnh", "other", "manifest", null);
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public byte[] service() throws ClientApiException {
        return api.callApiOther("pnh", "other", "service", null);
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public byte[] fx_pnhxpi() throws ClientApiException {
        return api.callApiOther("pnh", "other", "fx_pnh.xpi", null);
    }
} @SuppressWarnings("javadoc")
public class Pscan extends org.zaproxy.clientapi.gen.deprecated.PscanDeprecated {

    private final ClientApi api;

    public Pscan(ClientApi api) {
        super(api);
        this.api = api;
    }

    /**
     * Tells whether or not the passive scan should be performed only on messages that are in scope.
     */
    public ApiResponse scanOnlyInScope() throws ClientApiException {
        return api.callApi("pscan", "view", "scanOnlyInScope", null);
    }

    /** The number of records the passive scanner still has to scan */
    public ApiResponse recordsToScan() throws ClientApiException {
        return api.callApi("pscan", "view", "recordsToScan", null);
    }

    /** Lists all passive scanners with its ID, name, enabled state and alert threshold. */
    public ApiResponse scanners() throws ClientApiException {
        return api.callApi("pscan", "view", "scanners", null);
    }

    /** Show information about the passive scan rule currently being run (if any). */
    public ApiResponse currentRule() throws ClientApiException {
        return api.callApi("pscan", "view", "currentRule", null);
    }

    /** Gets the maximum number of alerts a passive scan rule should raise. */
    public ApiResponse maxAlertsPerRule() throws ClientApiException {
        return api.callApi("pscan", "view", "maxAlertsPerRule", null);
    }

    /**
     * Sets whether or not the passive scanning is enabled (Note: the enabled state is not
     * persisted).
     */
    public ApiResponse setEnabled(String enabled) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("enabled", enabled);
        return api.callApi("pscan", "action", "setEnabled", map);
    }

    /**
     * Sets whether or not the passive scan should be performed only on messages that are in scope.
     */
    public ApiResponse setScanOnlyInScope(String onlyinscope) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("onlyInScope", onlyinscope);
        return api.callApi("pscan", "action", "setScanOnlyInScope", map);
    }

    /** Enables all passive scanners */
    public ApiResponse enableAllScanners() throws ClientApiException {
        return api.callApi("pscan", "action", "enableAllScanners", null);
    }

    /** Disables all passive scanners */
    public ApiResponse disableAllScanners() throws ClientApiException {
        return api.callApi("pscan", "action", "disableAllScanners", null);
    }

    /** Enables all passive scanners with the given IDs (comma separated list of IDs) */
    public ApiResponse enableScanners(String ids) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("ids", ids);
        return api.callApi("pscan", "action", "enableScanners", map);
    }

    /** Disables all passive scanners with the given IDs (comma separated list of IDs) */
    public ApiResponse disableScanners(String ids) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("ids", ids);
        return api.callApi("pscan", "action", "disableScanners", map);
    }

    /**
     * Sets the alert threshold of the passive scanner with the given ID, accepted values for alert
     * threshold: OFF, DEFAULT, LOW, MEDIUM and HIGH
     */
    public ApiResponse setScannerAlertThreshold(String id, String alertthreshold)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("id", id);
        map.put("alertThreshold", alertthreshold);
        return api.callApi("pscan", "action", "setScannerAlertThreshold", map);
    }

    /** Sets the maximum number of alerts a passive scan rule should raise. */
    public ApiResponse setMaxAlertsPerRule(String maxalerts) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("maxAlerts", maxalerts);
        return api.callApi("pscan", "action", "setMaxAlertsPerRule", map);
    }

    /** Disables all passive scan tags. */
    public ApiResponse disableAllTags() throws ClientApiException {
        return api.callApi("pscan", "action", "disableAllTags", null);
    }

    /** Enables all passive scan tags. */
    public ApiResponse enableAllTags() throws ClientApiException {
        return api.callApi("pscan", "action", "enableAllTags", null);
    }
} @SuppressWarnings("javadoc")
public class Replacer {

    private final ClientApi api;

    public Replacer(ClientApi api) {
        this.api = api;
    }

    /**
     * Returns full details of all of the rules
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse rules() throws ClientApiException {
        return api.callApi("replacer", "view", "rules", null);
    }

    /**
     * Adds a replacer rule. For the parameters: desc is a user friendly description, enabled is
     * true or false, matchType is one of [REQ_HEADER, REQ_HEADER_STR, REQ_BODY_STR, RESP_HEADER,
     * RESP_HEADER_STR, RESP_BODY_STR], matchRegex should be true if the matchString should be
     * treated as a regex otherwise false, matchString is the string that will be matched against,
     * replacement is the replacement string, initiators may be blank (for all initiators) or a
     * comma separated list of integers as defined in <a
     * href="https://github.com/zaproxy/zaproxy/blob/main/zap/src/main/java/org/parosproxy/paros/network/HttpSender.java">HttpSender</a>
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse addRule(
            String description,
            String enabled,
            String matchtype,
            String matchregex,
            String matchstring,
            String replacement,
            String initiators)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("description", description);
        map.put("enabled", enabled);
        map.put("matchType", matchtype);
        map.put("matchRegex", matchregex);
        map.put("matchString", matchstring);
        if (replacement != null) {
            map.put("replacement", replacement);
        }
        if (initiators != null) {
            map.put("initiators", initiators);
        }
        return api.callApi("replacer", "action", "addRule", map);
    }

    /**
     * Removes the rule with the given description
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse removeRule(String description) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("description", description);
        return api.callApi("replacer", "action", "removeRule", map);
    }

    /**
     * Enables or disables the rule with the given description based on the bool parameter
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse setEnabled(String description, String bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("description", description);
        map.put("bool", bool);
        return api.callApi("replacer", "action", "setEnabled", map);
    }
} @SuppressWarnings("javadoc")
public class Reports {

    private final ClientApi api;

    public Reports(ClientApi api) {
        this.api = api;
    }

    /**
     * View available templates.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse templates() throws ClientApiException {
        return api.callApi("reports", "view", "templates", null);
    }

    /**
     * View details of the specified template.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse templateDetails(String template) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("template", template);
        return api.callApi("reports", "view", "templateDetails", map);
    }

    /**
     * Generate a report with the supplied parameters.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse generate(
            String title,
            String template,
            String theme,
            String description,
            String contexts,
            String sites,
            String sections,
            String includedconfidences,
            String includedrisks,
            String reportfilename,
            String reportfilenamepattern,
            String reportdir,
            String display)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("title", title);
        map.put("template", template);
        if (theme != null) {
            map.put("theme", theme);
        }
        if (description != null) {
            map.put("description", description);
        }
        if (contexts != null) {
            map.put("contexts", contexts);
        }
        if (sites != null) {
            map.put("sites", sites);
        }
        if (sections != null) {
            map.put("sections", sections);
        }
        if (includedconfidences != null) {
            map.put("includedConfidences", includedconfidences);
        }
        if (includedrisks != null) {
            map.put("includedRisks", includedrisks);
        }
        if (reportfilename != null) {
            map.put("reportFileName", reportfilename);
        }
        if (reportfilenamepattern != null) {
            map.put("reportFileNamePattern", reportfilenamepattern);
        }
        if (reportdir != null) {
            map.put("reportDir", reportdir);
        }
        if (display != null) {
            map.put("display", display);
        }
        return api.callApi("reports", "action", "generate", map);
    }
} @SuppressWarnings("javadoc")
public class Retest {

    private final ClientApi api;

    public Retest(ClientApi api) {
        this.api = api;
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public ApiResponse retest(String alertids) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("alertIds", alertids);
        return api.callApi("retest", "action", "retest", map);
    }
} @SuppressWarnings("javadoc")
public class Reveal extends org.zaproxy.clientapi.gen.deprecated.RevealDeprecated {

    private final ClientApi api;

    public Reveal(ClientApi api) {
        super(api);
        this.api = api;
    }

    /**
     * Tells if shows hidden fields and enables disabled fields
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse reveal() throws ClientApiException {
        return api.callApi("reveal", "view", "reveal", null);
    }

    /**
     * Sets if shows hidden fields and enables disabled fields
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse setReveal(String reveal) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("reveal", reveal);
        return api.callApi("reveal", "action", "setReveal", map);
    }
} @SuppressWarnings("javadoc")
public class Revisit {

    private final ClientApi api;

    public Revisit(ClientApi api) {
        this.api = api;
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public ApiResponse revisitList() throws ClientApiException {
        return api.callApi("revisit", "view", "revisitList", null);
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public ApiResponse revisitSiteOn(String site, String starttime, String endtime)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("site", site);
        map.put("startTime", starttime);
        map.put("endTime", endtime);
        return api.callApi("revisit", "action", "revisitSiteOn", map);
    }

    /** This component is optional and therefore the API will only work if it is installed */
    public ApiResponse revisitSiteOff(String site) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("site", site);
        return api.callApi("revisit", "action", "revisitSiteOff", map);
    }
} @SuppressWarnings("javadoc")
public class RuleConfig {

    private final ClientApi api;

    public RuleConfig(ClientApi api) {
        this.api = api;
    }

    /** Show the specified rule configuration */
    public ApiResponse ruleConfigValue(String key) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("key", key);
        return api.callApi("ruleConfig", "view", "ruleConfigValue", map);
    }

    /** Show all of the rule configurations */
    public ApiResponse allRuleConfigs() throws ClientApiException {
        return api.callApi("ruleConfig", "view", "allRuleConfigs", null);
    }

    /** Reset the specified rule configuration, which must already exist */
    public ApiResponse resetRuleConfigValue(String key) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("key", key);
        return api.callApi("ruleConfig", "action", "resetRuleConfigValue", map);
    }

    /** Reset all of the rule configurations */
    public ApiResponse resetAllRuleConfigValues() throws ClientApiException {
        return api.callApi("ruleConfig", "action", "resetAllRuleConfigValues", null);
    }

    /** Set the specified rule configuration, which must already exist */
    public ApiResponse setRuleConfigValue(String key, String value) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("key", key);
        if (value != null) {
            map.put("value", value);
        }
        return api.callApi("ruleConfig", "action", "setRuleConfigValue", map);
    }
} @SuppressWarnings("javadoc")
public class Script extends org.zaproxy.clientapi.gen.deprecated.ScriptDeprecated {

    private final ClientApi api;

    public Script(ClientApi api) {
        super(api);
        this.api = api;
    }

    /** Lists the script engines available */
    public ApiResponse listEngines() throws ClientApiException {
        return api.callApi("script", "view", "listEngines", null);
    }

    /** Lists the script types available. */
    public ApiResponse listTypes() throws ClientApiException {
        return api.callApi("script", "view", "listTypes", null);
    }

    /** Lists the scripts available, with its engine, name, description, type and error state. */
    public ApiResponse listScripts() throws ClientApiException {
        return api.callApi("script", "view", "listScripts", null);
    }

    /**
     * Gets the value of the global variable with the given key. Returns an API error
     * (DOES_NOT_EXIST) if no value was previously set.
     */
    public ApiResponse globalVar(String varkey) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("varKey", varkey);
        return api.callApi("script", "view", "globalVar", map);
    }

    /**
     * Gets the value (string representation) of a global custom variable. Returns an API error
     * (DOES_NOT_EXIST) if no value was previously set.
     */
    public ApiResponse globalCustomVar(String varkey) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("varKey", varkey);
        return api.callApi("script", "view", "globalCustomVar", map);
    }

    /** Gets all the global variables (key/value pairs). */
    public ApiResponse globalVars() throws ClientApiException {
        return api.callApi("script", "view", "globalVars", null);
    }

    /**
     * Gets all the global custom variables (key/value pairs, the value is the string
     * representation).
     */
    public ApiResponse globalCustomVars() throws ClientApiException {
        return api.callApi("script", "view", "globalCustomVars", null);
    }

    /**
     * Gets the value of the variable with the given key for the given script. Returns an API error
     * (DOES_NOT_EXIST) if no script with the given name exists or if no value was previously set.
     */
    public ApiResponse scriptVar(String scriptname, String varkey) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scriptName", scriptname);
        map.put("varKey", varkey);
        return api.callApi("script", "view", "scriptVar", map);
    }

    /**
     * Gets the value (string representation) of a custom variable. Returns an API error
     * (DOES_NOT_EXIST) if no script with the given name exists or if no value was previously set.
     */
    public ApiResponse scriptCustomVar(String scriptname, String varkey) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scriptName", scriptname);
        map.put("varKey", varkey);
        return api.callApi("script", "view", "scriptCustomVar", map);
    }

    /**
     * Gets all the variables (key/value pairs) of the given script. Returns an API error
     * (DOES_NOT_EXIST) if no script with the given name exists.
     */
    public ApiResponse scriptVars(String scriptname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scriptName", scriptname);
        return api.callApi("script", "view", "scriptVars", map);
    }

    /**
     * Gets all the custom variables (key/value pairs, the value is the string representation) of a
     * script. Returns an API error (DOES_NOT_EXIST) if no script with the given name exists.
     */
    public ApiResponse scriptCustomVars(String scriptname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scriptName", scriptname);
        return api.callApi("script", "view", "scriptCustomVars", map);
    }

    /** Enables the script with the given name */
    public ApiResponse enable(String scriptname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scriptName", scriptname);
        return api.callApi("script", "action", "enable", map);
    }

    /** Disables the script with the given name */
    public ApiResponse disable(String scriptname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scriptName", scriptname);
        return api.callApi("script", "action", "disable", map);
    }

    /**
     * Loads a script into ZAP from the given local file, with the given name, type and engine,
     * optionally with a description, and a charset name to read the script (the charset name is
     * required if the script is not in UTF-8, for example, in ISO-8859-1).
     */
    public ApiResponse load(
            String scriptname,
            String scripttype,
            String scriptengine,
            String filename,
            String scriptdescription,
            Charset charset)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scriptName", scriptname);
        map.put("scriptType", scripttype);
        map.put("scriptEngine", scriptengine);
        map.put("fileName", filename);
        if (scriptdescription != null) {
            map.put("scriptDescription", scriptdescription);
        }
        if (charset != null) {
            map.put("charset", charset.name());
        }
        return api.callApi("script", "action", "load", map);
    }

    /** Removes the script with the given name */
    public ApiResponse remove(String scriptname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scriptName", scriptname);
        return api.callApi("script", "action", "remove", map);
    }

    /** Runs the stand alone script with the given name */
    public ApiResponse runStandAloneScript(String scriptname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scriptName", scriptname);
        return api.callApi("script", "action", "runStandAloneScript", map);
    }

    /** Clears the global variable with the given key. */
    public ApiResponse clearGlobalVar(String varkey) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("varKey", varkey);
        return api.callApi("script", "action", "clearGlobalVar", map);
    }

    /** Clears a global custom variable. */
    public ApiResponse clearGlobalCustomVar(String varkey) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("varKey", varkey);
        return api.callApi("script", "action", "clearGlobalCustomVar", map);
    }

    /** Clears the global variables. */
    public ApiResponse clearGlobalVars() throws ClientApiException {
        return api.callApi("script", "action", "clearGlobalVars", null);
    }

    /**
     * Clears the variable with the given key of the given script. Returns an API error
     * (DOES_NOT_EXIST) if no script with the given name exists.
     */
    public ApiResponse clearScriptVar(String scriptname, String varkey) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scriptName", scriptname);
        map.put("varKey", varkey);
        return api.callApi("script", "action", "clearScriptVar", map);
    }

    /** Clears a script custom variable. */
    public ApiResponse clearScriptCustomVar(String scriptname, String varkey)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scriptName", scriptname);
        map.put("varKey", varkey);
        return api.callApi("script", "action", "clearScriptCustomVar", map);
    }

    /**
     * Clears the variables of the given script. Returns an API error (DOES_NOT_EXIST) if no script
     * with the given name exists.
     */
    public ApiResponse clearScriptVars(String scriptname) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scriptName", scriptname);
        return api.callApi("script", "action", "clearScriptVars", map);
    }

    /**
     * Sets the value of the variable with the given key of the given script. Returns an API error
     * (DOES_NOT_EXIST) if no script with the given name exists.
     */
    public ApiResponse setScriptVar(String scriptname, String varkey, String varvalue)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scriptName", scriptname);
        map.put("varKey", varkey);
        if (varvalue != null) {
            map.put("varValue", varvalue);
        }
        return api.callApi("script", "action", "setScriptVar", map);
    }

    /** Sets the value of the global variable with the given key. */
    public ApiResponse setGlobalVar(String varkey, String varvalue) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("varKey", varkey);
        if (varvalue != null) {
            map.put("varValue", varvalue);
        }
        return api.callApi("script", "action", "setGlobalVar", map);
    }
} @SuppressWarnings("javadoc")
public class Search extends org.zaproxy.clientapi.gen.deprecated.SearchDeprecated {

    private final ClientApi api;

    public Search(ClientApi api) {
        super(api);
        this.api = api;
    }

    /**
     * Returns the URLs of the HTTP messages that match the given regular expression in the URL
     * optionally filtered by URL and paginated with 'start' position and 'count' of messages.
     */
    public ApiResponse urlsByUrlRegex(String regex, String baseurl, String start, String count)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("regex", regex);
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        if (start != null) {
            map.put("start", start);
        }
        if (count != null) {
            map.put("count", count);
        }
        return api.callApi("search", "view", "urlsByUrlRegex", map);
    }

    /**
     * Returns the URLs of the HTTP messages that match the given regular expression in the request
     * optionally filtered by URL and paginated with 'start' position and 'count' of messages.
     */
    public ApiResponse urlsByRequestRegex(String regex, String baseurl, String start, String count)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("regex", regex);
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        if (start != null) {
            map.put("start", start);
        }
        if (count != null) {
            map.put("count", count);
        }
        return api.callApi("search", "view", "urlsByRequestRegex", map);
    }

    /**
     * Returns the URLs of the HTTP messages that match the given regular expression in the response
     * optionally filtered by URL and paginated with 'start' position and 'count' of messages.
     */
    public ApiResponse urlsByResponseRegex(String regex, String baseurl, String start, String count)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("regex", regex);
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        if (start != null) {
            map.put("start", start);
        }
        if (count != null) {
            map.put("count", count);
        }
        return api.callApi("search", "view", "urlsByResponseRegex", map);
    }

    /**
     * Returns the URLs of the HTTP messages that match the given regular expression in the
     * header(s) optionally filtered by URL and paginated with 'start' position and 'count' of
     * messages.
     */
    public ApiResponse urlsByHeaderRegex(String regex, String baseurl, String start, String count)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("regex", regex);
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        if (start != null) {
            map.put("start", start);
        }
        if (count != null) {
            map.put("count", count);
        }
        return api.callApi("search", "view", "urlsByHeaderRegex", map);
    }

    /**
     * Returns the HTTP messages that match the given regular expression in the URL optionally
     * filtered by URL and paginated with 'start' position and 'count' of messages.
     */
    public ApiResponse messagesByUrlRegex(String regex, String baseurl, String start, String count)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("regex", regex);
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        if (start != null) {
            map.put("start", start);
        }
        if (count != null) {
            map.put("count", count);
        }
        return api.callApi("search", "view", "messagesByUrlRegex", map);
    }

    /**
     * Returns the HTTP messages that match the given regular expression in the request optionally
     * filtered by URL and paginated with 'start' position and 'count' of messages.
     */
    public ApiResponse messagesByRequestRegex(
            String regex, String baseurl, String start, String count) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("regex", regex);
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        if (start != null) {
            map.put("start", start);
        }
        if (count != null) {
            map.put("count", count);
        }
        return api.callApi("search", "view", "messagesByRequestRegex", map);
    }

    /**
     * Returns the HTTP messages that match the given regular expression in the response optionally
     * filtered by URL and paginated with 'start' position and 'count' of messages.
     */
    public ApiResponse messagesByResponseRegex(
            String regex, String baseurl, String start, String count) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("regex", regex);
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        if (start != null) {
            map.put("start", start);
        }
        if (count != null) {
            map.put("count", count);
        }
        return api.callApi("search", "view", "messagesByResponseRegex", map);
    }

    /**
     * Returns the HTTP messages that match the given regular expression in the header(s) optionally
     * filtered by URL and paginated with 'start' position and 'count' of messages.
     */
    public ApiResponse messagesByHeaderRegex(
            String regex, String baseurl, String start, String count) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("regex", regex);
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        if (start != null) {
            map.put("start", start);
        }
        if (count != null) {
            map.put("count", count);
        }
        return api.callApi("search", "view", "messagesByHeaderRegex", map);
    }

    /**
     * Returns the HTTP messages, in HAR format, that match the given regular expression in the URL
     * optionally filtered by URL and paginated with 'start' position and 'count' of messages.
     */
    public byte[] harByUrlRegex(String regex, String baseurl, String start, String count)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("regex", regex);
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        if (start != null) {
            map.put("start", start);
        }
        if (count != null) {
            map.put("count", count);
        }
        return api.callApiOther("search", "other", "harByUrlRegex", map);
    }

    /**
     * Returns the HTTP messages, in HAR format, that match the given regular expression in the
     * request optionally filtered by URL and paginated with 'start' position and 'count' of
     * messages.
     */
    public byte[] harByRequestRegex(String regex, String baseurl, String start, String count)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("regex", regex);
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        if (start != null) {
            map.put("start", start);
        }
        if (count != null) {
            map.put("count", count);
        }
        return api.callApiOther("search", "other", "harByRequestRegex", map);
    }

    /**
     * Returns the HTTP messages, in HAR format, that match the given regular expression in the
     * response optionally filtered by URL and paginated with 'start' position and 'count' of
     * messages.
     */
    public byte[] harByResponseRegex(String regex, String baseurl, String start, String count)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("regex", regex);
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        if (start != null) {
            map.put("start", start);
        }
        if (count != null) {
            map.put("count", count);
        }
        return api.callApiOther("search", "other", "harByResponseRegex", map);
    }

    /**
     * Returns the HTTP messages, in HAR format, that match the given regular expression in the
     * header(s) optionally filtered by URL and paginated with 'start' position and 'count' of
     * messages.
     */
    public byte[] harByHeaderRegex(String regex, String baseurl, String start, String count)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("regex", regex);
        if (baseurl != null) {
            map.put("baseurl", baseurl);
        }
        if (start != null) {
            map.put("start", start);
        }
        if (count != null) {
            map.put("count", count);
        }
        return api.callApiOther("search", "other", "harByHeaderRegex", map);
    }
} @SuppressWarnings("javadoc")
public class Selenium extends org.zaproxy.clientapi.gen.deprecated.SeleniumDeprecated {

    private final ClientApi api;

    public Selenium(ClientApi api) {
        super(api);
        this.api = api;
    }

    /**
     * Returns the current path to ChromeDriver
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse optionChromeDriverPath() throws ClientApiException {
        return api.callApi("selenium", "view", "optionChromeDriverPath", null);
    }

    /**
     * Returns the current path to Firefox binary
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse optionFirefoxBinaryPath() throws ClientApiException {
        return api.callApi("selenium", "view", "optionFirefoxBinaryPath", null);
    }

    /**
     * Returns the current path to Firefox driver (geckodriver)
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse optionFirefoxDriverPath() throws ClientApiException {
        return api.callApi("selenium", "view", "optionFirefoxDriverPath", null);
    }

    /** This component is optional and therefore the API will only work if it is installed */
    @Deprecated
    public ApiResponse optionIeDriverPath() throws ClientApiException {
        return api.callApi("selenium", "view", "optionIeDriverPath", null);
    }

    /**
     * Returns the current path to PhantomJS binary
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse optionPhantomJsBinaryPath() throws ClientApiException {
        return api.callApi("selenium", "view", "optionPhantomJsBinaryPath", null);
    }

    /**
     * Sets the current path to ChromeDriver
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse setOptionChromeDriverPath(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("selenium", "action", "setOptionChromeDriverPath", map);
    }

    /**
     * Sets the current path to Firefox binary
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse setOptionFirefoxBinaryPath(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("selenium", "action", "setOptionFirefoxBinaryPath", map);
    }

    /**
     * Sets the current path to Firefox driver (geckodriver)
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse setOptionFirefoxDriverPath(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("selenium", "action", "setOptionFirefoxDriverPath", map);
    }

    /** This component is optional and therefore the API will only work if it is installed */
    @Deprecated
    public ApiResponse setOptionIeDriverPath(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("selenium", "action", "setOptionIeDriverPath", map);
    }

    /**
     * Sets the current path to PhantomJS binary
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse setOptionPhantomJsBinaryPath(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("selenium", "action", "setOptionPhantomJsBinaryPath", map);
    }
} @SuppressWarnings("javadoc")
public class SessionManagement
        extends org.zaproxy.clientapi.gen.deprecated.SessionManagementDeprecated {

    private final ClientApi api;

    public SessionManagement(ClientApi api) {
        super(api);
        this.api = api;
    }

    /** Gets the name of the session management methods. */
    public ApiResponse getSupportedSessionManagementMethods() throws ClientApiException {
        return api.callApi(
                "sessionManagement", "view", "getSupportedSessionManagementMethods", null);
    }

    /** Gets the configuration parameters for the session management method with the given name. */
    public ApiResponse getSessionManagementMethodConfigParams(String methodname)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("methodName", methodname);
        return api.callApi(
                "sessionManagement", "view", "getSessionManagementMethodConfigParams", map);
    }

    /** Gets the name of the session management method for the context with the given ID. */
    public ApiResponse getSessionManagementMethod(String contextid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        return api.callApi("sessionManagement", "view", "getSessionManagementMethod", map);
    }

    /** Sets the session management method for the context with the given ID. */
    public ApiResponse setSessionManagementMethod(
            String contextid, String methodname, String methodconfigparams)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("methodName", methodname);
        if (methodconfigparams != null) {
            map.put("methodConfigParams", methodconfigparams);
        }
        return api.callApi("sessionManagement", "action", "setSessionManagementMethod", map);
    }
} @SuppressWarnings("javadoc")
public class Soap {

    private final ClientApi api;

    public Soap(ClientApi api) {
        this.api = api;
    }

    /**
     * Import a WSDL definition from local file.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse importFile(String file) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("file", file);
        return api.callApi("soap", "action", "importFile", map);
    }

    /**
     * Import a WSDL definition from a URL.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse importUrl(String url) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("url", url);
        return api.callApi("soap", "action", "importUrl", map);
    }
} @SuppressWarnings("javadoc")
public class Spider extends org.zaproxy.clientapi.gen.deprecated.SpiderDeprecated {

    private final ClientApi api;

    public Spider(ClientApi api) {
        super(api);
        this.api = api;
    }

    public ApiResponse status(String scanid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (scanid != null) {
            map.put("scanId", scanid);
        }
        return api.callApi("spider", "view", "status", map);
    }

    public ApiResponse results(String scanid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (scanid != null) {
            map.put("scanId", scanid);
        }
        return api.callApi("spider", "view", "results", map);
    }

    public ApiResponse fullResults(String scanid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scanId", scanid);
        return api.callApi("spider", "view", "fullResults", map);
    }

    public ApiResponse scans() throws ClientApiException {
        return api.callApi("spider", "view", "scans", null);
    }

    /** Gets the regexes of URLs excluded from the spider scans. */
    public ApiResponse excludedFromScan() throws ClientApiException {
        return api.callApi("spider", "view", "excludedFromScan", null);
    }

    /**
     * Returns a list of unique URLs from the history table based on HTTP messages added by the
     * Spider.
     */
    public ApiResponse allUrls() throws ClientApiException {
        return api.callApi("spider", "view", "allUrls", null);
    }

    /** Returns a list of the names of the nodes added to the Sites tree by the specified scan. */
    public ApiResponse addedNodes(String scanid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (scanid != null) {
            map.put("scanId", scanid);
        }
        return api.callApi("spider", "view", "addedNodes", map);
    }

    /**
     * Gets all the domains that are always in scope. For each domain the following are shown: the
     * index, the value (domain), if enabled, and if specified as a regex.
     */
    public ApiResponse domainsAlwaysInScope() throws ClientApiException {
        return api.callApi("spider", "view", "domainsAlwaysInScope", null);
    }

    /**
     * Use view domainsAlwaysInScope instead.
     *
     * @deprecated
     */
    @Deprecated
    public ApiResponse optionDomainsAlwaysInScope() throws ClientApiException {
        return api.callApi("spider", "view", "optionDomainsAlwaysInScope", null);
    }

    /**
     * Use view domainsAlwaysInScope instead.
     *
     * @deprecated
     */
    @Deprecated
    public ApiResponse optionDomainsAlwaysInScopeEnabled() throws ClientApiException {
        return api.callApi("spider", "view", "optionDomainsAlwaysInScopeEnabled", null);
    }

    public ApiResponse optionHandleParameters() throws ClientApiException {
        return api.callApi("spider", "view", "optionHandleParameters", null);
    }

    /** Gets the maximum number of child nodes (per node) that can be crawled, 0 means no limit. */
    public ApiResponse optionMaxChildren() throws ClientApiException {
        return api.callApi("spider", "view", "optionMaxChildren", null);
    }

    /** Gets the maximum depth the spider can crawl, 0 if unlimited. */
    public ApiResponse optionMaxDepth() throws ClientApiException {
        return api.callApi("spider", "view", "optionMaxDepth", null);
    }

    public ApiResponse optionMaxDuration() throws ClientApiException {
        return api.callApi("spider", "view", "optionMaxDuration", null);
    }

    /** Gets the maximum size, in bytes, that a response might have to be parsed. */
    public ApiResponse optionMaxParseSizeBytes() throws ClientApiException {
        return api.callApi("spider", "view", "optionMaxParseSizeBytes", null);
    }

    public ApiResponse optionMaxScansInUI() throws ClientApiException {
        return api.callApi("spider", "view", "optionMaxScansInUI", null);
    }

    public ApiResponse optionRequestWaitTime() throws ClientApiException {
        return api.callApi("spider", "view", "optionRequestWaitTime", null);
    }

    /** @deprecated Option no longer in effective use. */
    @Deprecated
    public ApiResponse optionScope() throws ClientApiException {
        return api.callApi("spider", "view", "optionScope", null);
    }

    /** @deprecated Option no longer in effective use. */
    @Deprecated
    public ApiResponse optionScopeText() throws ClientApiException {
        return api.callApi("spider", "view", "optionScopeText", null);
    }

    public ApiResponse optionSkipURLString() throws ClientApiException {
        return api.callApi("spider", "view", "optionSkipURLString", null);
    }

    public ApiResponse optionThreadCount() throws ClientApiException {
        return api.callApi("spider", "view", "optionThreadCount", null);
    }

    public ApiResponse optionUserAgent() throws ClientApiException {
        return api.callApi("spider", "view", "optionUserAgent", null);
    }

    /** Gets whether or not a spider process should accept cookies while spidering. */
    public ApiResponse optionAcceptCookies() throws ClientApiException {
        return api.callApi("spider", "view", "optionAcceptCookies", null);
    }

    public ApiResponse optionHandleODataParametersVisited() throws ClientApiException {
        return api.callApi("spider", "view", "optionHandleODataParametersVisited", null);
    }

    public ApiResponse optionParseComments() throws ClientApiException {
        return api.callApi("spider", "view", "optionParseComments", null);
    }

    public ApiResponse optionParseGit() throws ClientApiException {
        return api.callApi("spider", "view", "optionParseGit", null);
    }

    public ApiResponse optionParseRobotsTxt() throws ClientApiException {
        return api.callApi("spider", "view", "optionParseRobotsTxt", null);
    }

    public ApiResponse optionParseSVNEntries() throws ClientApiException {
        return api.callApi("spider", "view", "optionParseSVNEntries", null);
    }

    public ApiResponse optionParseSitemapXml() throws ClientApiException {
        return api.callApi("spider", "view", "optionParseSitemapXml", null);
    }

    public ApiResponse optionPostForm() throws ClientApiException {
        return api.callApi("spider", "view", "optionPostForm", null);
    }

    public ApiResponse optionProcessForm() throws ClientApiException {
        return api.callApi("spider", "view", "optionProcessForm", null);
    }

    /** Gets whether or not the 'Referer' header should be sent while spidering. */
    public ApiResponse optionSendRefererHeader() throws ClientApiException {
        return api.callApi("spider", "view", "optionSendRefererHeader", null);
    }

    public ApiResponse optionShowAdvancedDialog() throws ClientApiException {
        return api.callApi("spider", "view", "optionShowAdvancedDialog", null);
    }

    /**
     * Runs the spider against the given URL (or context). Optionally, the 'maxChildren' parameter
     * can be set to limit the number of children scanned, the 'recurse' parameter can be used to
     * prevent the spider from seeding recursively, the parameter 'contextName' can be used to
     * constrain the scan to a Context and the parameter 'subtreeOnly' allows to restrict the spider
     * under a site's subtree (using the specified 'url').
     */
    public ApiResponse scan(
            String url, String maxchildren, String recurse, String contextname, String subtreeonly)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (url != null) {
            map.put("url", url);
        }
        if (maxchildren != null) {
            map.put("maxChildren", maxchildren);
        }
        if (recurse != null) {
            map.put("recurse", recurse);
        }
        if (contextname != null) {
            map.put("contextName", contextname);
        }
        if (subtreeonly != null) {
            map.put("subtreeOnly", subtreeonly);
        }
        return api.callApi("spider", "action", "scan", map);
    }

    /**
     * Runs the spider from the perspective of a User, obtained using the given Context ID and User
     * ID. See 'scan' action for more details.
     */
    public ApiResponse scanAsUser(
            String contextid,
            String userid,
            String url,
            String maxchildren,
            String recurse,
            String subtreeonly)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("userId", userid);
        if (url != null) {
            map.put("url", url);
        }
        if (maxchildren != null) {
            map.put("maxChildren", maxchildren);
        }
        if (recurse != null) {
            map.put("recurse", recurse);
        }
        if (subtreeonly != null) {
            map.put("subtreeOnly", subtreeonly);
        }
        return api.callApi("spider", "action", "scanAsUser", map);
    }

    public ApiResponse pause(String scanid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scanId", scanid);
        return api.callApi("spider", "action", "pause", map);
    }

    public ApiResponse resume(String scanid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scanId", scanid);
        return api.callApi("spider", "action", "resume", map);
    }

    public ApiResponse stop(String scanid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (scanid != null) {
            map.put("scanId", scanid);
        }
        return api.callApi("spider", "action", "stop", map);
    }

    public ApiResponse removeScan(String scanid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("scanId", scanid);
        return api.callApi("spider", "action", "removeScan", map);
    }

    public ApiResponse pauseAllScans() throws ClientApiException {
        return api.callApi("spider", "action", "pauseAllScans", null);
    }

    public ApiResponse resumeAllScans() throws ClientApiException {
        return api.callApi("spider", "action", "resumeAllScans", null);
    }

    public ApiResponse stopAllScans() throws ClientApiException {
        return api.callApi("spider", "action", "stopAllScans", null);
    }

    public ApiResponse removeAllScans() throws ClientApiException {
        return api.callApi("spider", "action", "removeAllScans", null);
    }

    /** Clears the regexes of URLs excluded from the spider scans. */
    public ApiResponse clearExcludedFromScan() throws ClientApiException {
        return api.callApi("spider", "action", "clearExcludedFromScan", null);
    }

    /** Adds a regex of URLs that should be excluded from the spider scans. */
    public ApiResponse excludeFromScan(String regex) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("regex", regex);
        return api.callApi("spider", "action", "excludeFromScan", map);
    }

    /**
     * Adds a new domain that's always in scope, using the specified value. Optionally sets if the
     * new entry is enabled (default, true) and whether or not the new value is specified as a regex
     * (default, false).
     */
    public ApiResponse addDomainAlwaysInScope(String value, String isregex, String isenabled)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("value", value);
        if (isregex != null) {
            map.put("isRegex", isregex);
        }
        if (isenabled != null) {
            map.put("isEnabled", isenabled);
        }
        return api.callApi("spider", "action", "addDomainAlwaysInScope", map);
    }

    /**
     * Modifies a domain that's always in scope. Allows to modify the value, if enabled or if a
     * regex. The domain is selected with its index, which can be obtained with the view
     * domainsAlwaysInScope.
     */
    public ApiResponse modifyDomainAlwaysInScope(
            String idx, String value, String isregex, String isenabled) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("idx", idx);
        if (value != null) {
            map.put("value", value);
        }
        if (isregex != null) {
            map.put("isRegex", isregex);
        }
        if (isenabled != null) {
            map.put("isEnabled", isenabled);
        }
        return api.callApi("spider", "action", "modifyDomainAlwaysInScope", map);
    }

    /**
     * Removes a domain that's always in scope, with the given index. The index can be obtained with
     * the view domainsAlwaysInScope.
     */
    public ApiResponse removeDomainAlwaysInScope(String idx) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("idx", idx);
        return api.callApi("spider", "action", "removeDomainAlwaysInScope", map);
    }

    /** Enables all domains that are always in scope. */
    public ApiResponse enableAllDomainsAlwaysInScope() throws ClientApiException {
        return api.callApi("spider", "action", "enableAllDomainsAlwaysInScope", null);
    }

    /** Disables all domains that are always in scope. */
    public ApiResponse disableAllDomainsAlwaysInScope() throws ClientApiException {
        return api.callApi("spider", "action", "disableAllDomainsAlwaysInScope", null);
    }

    public ApiResponse setOptionHandleParameters(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("spider", "action", "setOptionHandleParameters", map);
    }

    /**
     * Use actions [add|modify|remove]DomainAlwaysInScope instead.
     *
     * @deprecated Option no longer in effective use.
     */
    @Deprecated
    public ApiResponse setOptionScopeString(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("spider", "action", "setOptionScopeString", map);
    }

    public ApiResponse setOptionSkipURLString(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("spider", "action", "setOptionSkipURLString", map);
    }

    public ApiResponse setOptionUserAgent(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("spider", "action", "setOptionUserAgent", map);
    }

    /** Sets whether or not a spider process should accept cookies while spidering. */
    public ApiResponse setOptionAcceptCookies(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("spider", "action", "setOptionAcceptCookies", map);
    }

    public ApiResponse setOptionHandleODataParametersVisited(boolean bool)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("spider", "action", "setOptionHandleODataParametersVisited", map);
    }

    /** Sets the maximum number of child nodes (per node) that can be crawled, 0 means no limit. */
    public ApiResponse setOptionMaxChildren(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("spider", "action", "setOptionMaxChildren", map);
    }

    /** Sets the maximum depth the spider can crawl, 0 for unlimited depth. */
    public ApiResponse setOptionMaxDepth(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("spider", "action", "setOptionMaxDepth", map);
    }

    public ApiResponse setOptionMaxDuration(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("spider", "action", "setOptionMaxDuration", map);
    }

    /**
     * Sets the maximum size, in bytes, that a response might have to be parsed. This allows the
     * spider to skip big responses/files.
     */
    public ApiResponse setOptionMaxParseSizeBytes(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("spider", "action", "setOptionMaxParseSizeBytes", map);
    }

    public ApiResponse setOptionMaxScansInUI(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("spider", "action", "setOptionMaxScansInUI", map);
    }

    public ApiResponse setOptionParseComments(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("spider", "action", "setOptionParseComments", map);
    }

    public ApiResponse setOptionParseGit(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("spider", "action", "setOptionParseGit", map);
    }

    public ApiResponse setOptionParseRobotsTxt(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("spider", "action", "setOptionParseRobotsTxt", map);
    }

    public ApiResponse setOptionParseSVNEntries(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("spider", "action", "setOptionParseSVNEntries", map);
    }

    public ApiResponse setOptionParseSitemapXml(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("spider", "action", "setOptionParseSitemapXml", map);
    }

    public ApiResponse setOptionPostForm(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("spider", "action", "setOptionPostForm", map);
    }

    public ApiResponse setOptionProcessForm(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("spider", "action", "setOptionProcessForm", map);
    }

    public ApiResponse setOptionRequestWaitTime(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("spider", "action", "setOptionRequestWaitTime", map);
    }

    /** Sets whether or not the 'Referer' header should be sent while spidering. */
    public ApiResponse setOptionSendRefererHeader(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("spider", "action", "setOptionSendRefererHeader", map);
    }

    public ApiResponse setOptionShowAdvancedDialog(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("spider", "action", "setOptionShowAdvancedDialog", map);
    }

    public ApiResponse setOptionThreadCount(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("spider", "action", "setOptionThreadCount", map);
    }
} @SuppressWarnings("javadoc")
public class Stats extends org.zaproxy.clientapi.gen.deprecated.StatsDeprecated {

    private final ClientApi api;

    public Stats(ClientApi api) {
        super(api);
        this.api = api;
    }

    /** Statistics */
    public ApiResponse stats(String keyprefix) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (keyprefix != null) {
            map.put("keyPrefix", keyprefix);
        }
        return api.callApi("stats", "view", "stats", map);
    }

    /** Gets all of the site based statistics, optionally filtered by a key prefix */
    public ApiResponse allSitesStats(String keyprefix) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (keyprefix != null) {
            map.put("keyPrefix", keyprefix);
        }
        return api.callApi("stats", "view", "allSitesStats", map);
    }

    /** Gets all of the global statistics, optionally filtered by a key prefix */
    public ApiResponse siteStats(String site, String keyprefix) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("site", site);
        if (keyprefix != null) {
            map.put("keyPrefix", keyprefix);
        }
        return api.callApi("stats", "view", "siteStats", map);
    }

    /** Gets the Statsd service hostname */
    public ApiResponse optionStatsdHost() throws ClientApiException {
        return api.callApi("stats", "view", "optionStatsdHost", null);
    }

    /** Gets the Statsd service port */
    public ApiResponse optionStatsdPort() throws ClientApiException {
        return api.callApi("stats", "view", "optionStatsdPort", null);
    }

    /** Gets the prefix to be applied to all stats sent to the configured Statsd service */
    public ApiResponse optionStatsdPrefix() throws ClientApiException {
        return api.callApi("stats", "view", "optionStatsdPrefix", null);
    }

    /** Returns 'true' if in memory statistics are enabled, otherwise returns 'false' */
    public ApiResponse optionInMemoryEnabled() throws ClientApiException {
        return api.callApi("stats", "view", "optionInMemoryEnabled", null);
    }

    /**
     * Returns 'true' if a Statsd server has been correctly configured, otherwise returns 'false'
     */
    public ApiResponse optionStatsdEnabled() throws ClientApiException {
        return api.callApi("stats", "view", "optionStatsdEnabled", null);
    }

    /** Clears all of the statistics */
    public ApiResponse clearStats(String keyprefix) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (keyprefix != null) {
            map.put("keyPrefix", keyprefix);
        }
        return api.callApi("stats", "action", "clearStats", map);
    }

    /** Sets the Statsd service hostname, supply an empty string to stop using a Statsd service */
    public ApiResponse setOptionStatsdHost(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("stats", "action", "setOptionStatsdHost", map);
    }

    /** Sets the prefix to be applied to all stats sent to the configured Statsd service */
    public ApiResponse setOptionStatsdPrefix(String string) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("String", string);
        return api.callApi("stats", "action", "setOptionStatsdPrefix", map);
    }

    /** Sets whether in memory statistics are enabled */
    public ApiResponse setOptionInMemoryEnabled(boolean bool) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Boolean", Boolean.toString(bool));
        return api.callApi("stats", "action", "setOptionInMemoryEnabled", map);
    }

    /** Sets the Statsd service port */
    public ApiResponse setOptionStatsdPort(int i) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("Integer", Integer.toString(i));
        return api.callApi("stats", "action", "setOptionStatsdPort", map);
    }
} @SuppressWarnings("javadoc")
public class Users extends org.zaproxy.clientapi.gen.deprecated.UsersDeprecated {

    private final ClientApi api;

    public Users(ClientApi api) {
        super(api);
        this.api = api;
    }

    /**
     * Gets a list of users that belong to the context with the given ID, or all users if none
     * provided.
     */
    public ApiResponse usersList(String contextid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (contextid != null) {
            map.put("contextId", contextid);
        }
        return api.callApi("users", "view", "usersList", map);
    }

    /**
     * Gets the data of the user with the given ID that belongs to the context with the given ID.
     */
    public ApiResponse getUserById(String contextid, String userid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("userId", userid);
        return api.callApi("users", "view", "getUserById", map);
    }

    /** Gets the configuration parameters for the credentials of the context with the given ID. */
    public ApiResponse getAuthenticationCredentialsConfigParams(String contextid)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        return api.callApi("users", "view", "getAuthenticationCredentialsConfigParams", map);
    }

    /**
     * Gets the authentication credentials of the user with given ID that belongs to the context
     * with the given ID.
     */
    public ApiResponse getAuthenticationCredentials(String contextid, String userid)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("userId", userid);
        return api.callApi("users", "view", "getAuthenticationCredentials", map);
    }

    /**
     * Gets the authentication state information for the user identified by the Context and User
     * Ids.
     */
    public ApiResponse getAuthenticationState(String contextid, String userid)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("userId", userid);
        return api.callApi("users", "view", "getAuthenticationState", map);
    }

    /**
     * Gets the authentication session information for the user identified by the Context and User
     * Ids, e.g. cookies and realm credentials.
     */
    public ApiResponse getAuthenticationSession(String contextid, String userid)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("userId", userid);
        return api.callApi("users", "view", "getAuthenticationSession", map);
    }

    /** Creates a new user with the given name for the context with the given ID. */
    public ApiResponse newUser(String contextid, String name) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("name", name);
        return api.callApi("users", "action", "newUser", map);
    }

    /** Removes the user with the given ID that belongs to the context with the given ID. */
    public ApiResponse removeUser(String contextid, String userid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("userId", userid);
        return api.callApi("users", "action", "removeUser", map);
    }

    /**
     * Sets whether or not the user, with the given ID that belongs to the context with the given
     * ID, should be enabled.
     */
    public ApiResponse setUserEnabled(String contextid, String userid, String enabled)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("userId", userid);
        map.put("enabled", enabled);
        return api.callApi("users", "action", "setUserEnabled", map);
    }

    /** Renames the user with the given ID that belongs to the context with the given ID. */
    public ApiResponse setUserName(String contextid, String userid, String name)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("userId", userid);
        map.put("name", name);
        return api.callApi("users", "action", "setUserName", map);
    }

    /**
     * Sets the authentication credentials for the user with the given ID that belongs to the
     * context with the given ID.
     */
    public ApiResponse setAuthenticationCredentials(
            String contextid, String userid, String authcredentialsconfigparams)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("userId", userid);
        if (authcredentialsconfigparams != null) {
            map.put("authCredentialsConfigParams", authcredentialsconfigparams);
        }
        return api.callApi("users", "action", "setAuthenticationCredentials", map);
    }

    /**
     * Tries to authenticate as the identified user, returning the authentication request and
     * whether it appears to have succeeded.
     */
    public ApiResponse authenticateAsUser(String contextid, String userid)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("userId", userid);
        return api.callApi("users", "action", "authenticateAsUser", map);
    }

    /**
     * Tries to poll as the identified user, returning the authentication request and whether it
     * appears to have succeeded. This will only work if the polling verification strategy has been
     * configured.
     */
    public ApiResponse pollAsUser(String contextid, String userid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("userId", userid);
        return api.callApi("users", "action", "pollAsUser", map);
    }

    /**
     * Sets fields in the authentication state for the user identified by the Context and User Ids.
     */
    public ApiResponse setAuthenticationState(
            String contextid,
            String userid,
            String lastpollresult,
            String lastpolltimeinms,
            String requestssincelastpoll)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("userId", userid);
        if (lastpollresult != null) {
            map.put("lastPollResult", lastpollresult);
        }
        if (lastpolltimeinms != null) {
            map.put("lastPollTimeInMs", lastpolltimeinms);
        }
        if (requestssincelastpoll != null) {
            map.put("requestsSinceLastPoll", requestssincelastpoll);
        }
        return api.callApi("users", "action", "setAuthenticationState", map);
    }

    /** Sets the specified cookie for the user identified by the Context and User Ids. */
    public ApiResponse setCookie(
            String contextid,
            String userid,
            String domain,
            String name,
            String value,
            String path,
            String secure)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("contextId", contextid);
        map.put("userId", userid);
        map.put("domain", domain);
        map.put("name", name);
        map.put("value", value);
        if (path != null) {
            map.put("path", path);
        }
        if (secure != null) {
            map.put("secure", secure);
        }
        return api.callApi("users", "action", "setCookie", map);
    }
} @SuppressWarnings("javadoc")
public class Wappalyzer {

    private final ClientApi api;

    public Wappalyzer(ClientApi api) {
        this.api = api;
    }

    /**
     * Lists all the sites recognized by the wappalyzer addon.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse listSites() throws ClientApiException {
        return api.callApi("wappalyzer", "view", "listSites", null);
    }

    /**
     * Lists all sites and their associated applications (technologies).
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse listAll() throws ClientApiException {
        return api.callApi("wappalyzer", "view", "listAll", null);
    }

    /**
     * Lists all the applications (technologies) associated with a specific site.
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse listSite(String site) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("site", site);
        return api.callApi("wappalyzer", "view", "listSite", map);
    }
} @SuppressWarnings("javadoc")
public class Websocket {

    private final ClientApi api;

    public Websocket(ClientApi api) {
        this.api = api;
    }

    /**
     * Returns all of the registered web socket channels
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse channels() throws ClientApiException {
        return api.callApi("websocket", "view", "channels", null);
    }

    /**
     * Returns full details of the message specified by the channelId and messageId
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse message(String channelid, String messageid) throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("channelId", channelid);
        map.put("messageId", messageid);
        return api.callApi("websocket", "view", "message", map);
    }

    /**
     * Returns a list of all of the messages that meet the given criteria (all optional), where
     * channelId is a channel identifier, start is the offset to start returning messages from
     * (starting from 0), count is the number of messages to return (default no limit) and
     * payloadPreviewLength is the maximum number bytes to return for the payload contents
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse messages(
            String channelid, String start, String count, String payloadpreviewlength)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        if (channelid != null) {
            map.put("channelId", channelid);
        }
        if (start != null) {
            map.put("start", start);
        }
        if (count != null) {
            map.put("count", count);
        }
        if (payloadpreviewlength != null) {
            map.put("payloadPreviewLength", payloadpreviewlength);
        }
        return api.callApi("websocket", "view", "messages", map);
    }

    /**
     * Returns a text representation of an intercepted websockets message
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse breakTextMessage() throws ClientApiException {
        return api.callApi("websocket", "view", "breakTextMessage", null);
    }

    /**
     * Sends the specified message on the channel specified by channelId, if outgoing is 'True' then
     * the message will be sent to the server and if it is 'False' then it will be sent to the
     * client
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse sendTextMessage(String channelid, String outgoing, String message)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("channelId", channelid);
        map.put("outgoing", outgoing);
        map.put("message", message);
        return api.callApi("websocket", "action", "sendTextMessage", map);
    }

    /**
     * Sets the text message for an intercepted websockets message
     *
     * <p>This component is optional and therefore the API will only work if it is installed
     */
    public ApiResponse setBreakTextMessage(String message, String outgoing)
            throws ClientApiException {
        Map<String, String> map = new HashMap<>();
        map.put("message", message);
        map.put("outgoing", outgoing);
        return api.callApi("websocket", "action", "setBreakTextMessage", map);
    }
}
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.MalformedURLException;
import java.net.Proxy;
import java.net.Socket;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.zaproxy.clientapi.gen.AccessControl;
import org.zaproxy.clientapi.gen.Acsrf;
import org.zaproxy.clientapi.gen.AjaxSpider;
import org.zaproxy.clientapi.gen.AlertFilter;
import org.zaproxy.clientapi.gen.Ascan;
import org.zaproxy.clientapi.gen.Authentication;
import org.zaproxy.clientapi.gen.Authorization;
import org.zaproxy.clientapi.gen.Automation;
import org.zaproxy.clientapi.gen.Autoupdate;
import org.zaproxy.clientapi.gen.Break;
import org.zaproxy.clientapi.gen.Context;
import org.zaproxy.clientapi.gen.Core;
import org.zaproxy.clientapi.gen.Exportreport;
import org.zaproxy.clientapi.gen.ForcedUser;
import org.zaproxy.clientapi.gen.HttpSessions;
import org.zaproxy.clientapi.gen.ImportLogFiles;
import org.zaproxy.clientapi.gen.Importurls;
import org.zaproxy.clientapi.gen.LocalProxies;
import org.zaproxy.clientapi.gen.Openapi;
import org.zaproxy.clientapi.gen.Params;
import org.zaproxy.clientapi.gen.Pnh;
import org.zaproxy.clientapi.gen.Pscan;
import org.zaproxy.clientapi.gen.Replacer;
import org.zaproxy.clientapi.gen.Reports;
import org.zaproxy.clientapi.gen.Retest;
import org.zaproxy.clientapi.gen.Reveal;
import org.zaproxy.clientapi.gen.Revisit;
import org.zaproxy.clientapi.gen.RuleConfig;
import org.zaproxy.clientapi.gen.Script;
import org.zaproxy.clientapi.gen.Search;
import org.zaproxy.clientapi.gen.Selenium;
import org.zaproxy.clientapi.gen.SessionManagement;
import org.zaproxy.clientapi.gen.Soap;
import org.zaproxy.clientapi.gen.Spider;
import org.zaproxy.clientapi.gen.Stats;
import org.zaproxy.clientapi.gen.Users;
import org.zaproxy.clientapi.gen.Wappalyzer;
import org.zaproxy.clientapi.gen.Websocket;
/*
 * Zed Attack Proxy (ZAP) and its related class files.
 *
 * ZAP is an HTTP/HTTPS proxy for assessing web application security.
 *
 * Copyright 2011 The ZAP Development Team
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.zaproxy.clientapi.core;


public class ClientApi {

    private static final int DEFAULT_CONNECTION_POOLING_IN_MS = 1000;

    private static final String ZAP_API_KEY_HEADER = "X-ZAP-API-Key";
    private static final String ZAP_API_KEY_PARAM = "apikey";

    private Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("localhost", 8090));
    private boolean debug = false;
    private PrintStream debugStream = System.out;

    private final String zapAddress;
    private final int zapPort;

    private final String apiKey;

    private DocumentBuilderFactory docBuilderFactory;

    // Note that any new API implementations added have to be added here manually
    public AccessControl accessControl = new AccessControl(this);
    public Acsrf acsrf = new Acsrf(this);
    public AjaxSpider ajaxSpider = new AjaxSpider(this);
    public AlertFilter alertFilter = new AlertFilter(this);
    public org.zaproxy.clientapi.gen.Alert alert = new org.zaproxy.clientapi.gen.Alert(this);
    public Ascan ascan = new Ascan(this);
    public Authentication authentication = new Authentication(this);
    public Authorization authorization = new Authorization(this);
    public Automation automation = new Automation(this);
    public Autoupdate autoupdate = new Autoupdate(this);
    public Break brk = new Break(this);
    public Context context = new Context(this);
    public Core core = new Core(this);
    public Exportreport exportreport = new Exportreport(this);
    public ForcedUser forcedUser = new ForcedUser(this);
    public HttpSessions httpSessions = new HttpSessions(this);
    public ImportLogFiles logImportFiles = new ImportLogFiles(this);
    public Importurls importurls = new Importurls(this);
    public LocalProxies localProxies = new LocalProxies(this);