use super::ZapApiError;
use super::ZapService;
use serde_json::Value;
use std::collections::HashMap;
pub fn status(service: &ZapService, scanid: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("scanId".to_string(), scanid);
super::call(service, "spider", "view", "status", params)
}
pub fn results(service: &ZapService, scanid: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("scanId".to_string(), scanid);
super::call(service, "spider", "view", "results", params)
}
pub fn full_results(service: &ZapService, scanid: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("scanId".to_string(), scanid);
super::call(service, "spider", "view", "fullResults", params)
}
pub fn scans(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "scans", params)
}
pub fn excluded_from_scan(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "excludedFromScan", params)
}
pub fn all_urls(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "allUrls", params)
}
pub fn added_nodes(service: &ZapService, scanid: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("scanId".to_string(), scanid);
super::call(service, "spider", "view", "addedNodes", params)
}
pub fn domains_always_in_scope(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "domainsAlwaysInScope", params)
}
pub fn option_domains_always_in_scope(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(
service,
"spider",
"view",
"optionDomainsAlwaysInScope",
params,
)
}
pub fn option_domains_always_in_scope_enabled(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(
service,
"spider",
"view",
"optionDomainsAlwaysInScopeEnabled",
params,
)
}
pub fn option_handle_parameters(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionHandleParameters", params)
}
pub fn option_max_children(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionMaxChildren", params)
}
pub fn option_max_depth(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionMaxDepth", params)
}
pub fn option_max_duration(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionMaxDuration", params)
}
pub fn option_max_parse_size_bytes(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionMaxParseSizeBytes", params)
}
pub fn option_max_scans_in_ui(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionMaxScansInUI", params)
}
pub fn option_request_wait_time(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionRequestWaitTime", params)
}
pub fn option_scope(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionScope", params)
}
pub fn option_scope_text(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionScopeText", params)
}
pub fn option_skip_url_string(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionSkipURLString", params)
}
pub fn option_thread_count(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionThreadCount", params)
}
pub fn option_user_agent(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionUserAgent", params)
}
pub fn option_accept_cookies(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionAcceptCookies", params)
}
pub fn option_handle_o_data_parameters_visited(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(
service,
"spider",
"view",
"optionHandleODataParametersVisited",
params,
)
}
pub fn option_parse_comments(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionParseComments", params)
}
pub fn option_parse_git(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionParseGit", params)
}
pub fn option_parse_robots_txt(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionParseRobotsTxt", params)
}
pub fn option_parse_svn_entries(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionParseSVNEntries", params)
}
pub fn option_parse_sitemap_xml(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionParseSitemapXml", params)
}
pub fn option_post_form(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionPostForm", params)
}
pub fn option_process_form(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionProcessForm", params)
}
pub fn option_send_referer_header(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "view", "optionSendRefererHeader", params)
}
pub fn option_show_advanced_dialog(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(
service,
"spider",
"view",
"optionShowAdvancedDialog",
params,
)
}
pub fn scan(
service: &ZapService,
url: String,
maxchildren: String,
recurse: String,
contextname: String,
subtreeonly: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("url".to_string(), url);
params.insert("maxChildren".to_string(), maxchildren);
params.insert("recurse".to_string(), recurse);
params.insert("contextName".to_string(), contextname);
params.insert("subtreeOnly".to_string(), subtreeonly);
super::call(service, "spider", "action", "scan", params)
}
pub fn scan_as_user(
service: &ZapService,
contextid: String,
userid: String,
url: String,
maxchildren: String,
recurse: String,
subtreeonly: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextId".to_string(), contextid);
params.insert("userId".to_string(), userid);
params.insert("url".to_string(), url);
params.insert("maxChildren".to_string(), maxchildren);
params.insert("recurse".to_string(), recurse);
params.insert("subtreeOnly".to_string(), subtreeonly);
super::call(service, "spider", "action", "scanAsUser", params)
}
pub fn pause(service: &ZapService, scanid: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("scanId".to_string(), scanid);
super::call(service, "spider", "action", "pause", params)
}
pub fn resume(service: &ZapService, scanid: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("scanId".to_string(), scanid);
super::call(service, "spider", "action", "resume", params)
}
pub fn stop(service: &ZapService, scanid: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("scanId".to_string(), scanid);
super::call(service, "spider", "action", "stop", params)
}
pub fn remove_scan(service: &ZapService, scanid: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("scanId".to_string(), scanid);
super::call(service, "spider", "action", "removeScan", params)
}
pub fn pause_all_scans(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "action", "pauseAllScans", params)
}
pub fn resume_all_scans(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "action", "resumeAllScans", params)
}
pub fn stop_all_scans(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "action", "stopAllScans", params)
}
pub fn remove_all_scans(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "action", "removeAllScans", params)
}
pub fn clear_excluded_from_scan(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "spider", "action", "clearExcludedFromScan", params)
}
pub fn exclude_from_scan(service: &ZapService, regex: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("regex".to_string(), regex);
super::call(service, "spider", "action", "excludeFromScan", params)
}
pub fn add_domain_always_in_scope(
service: &ZapService,
value: String,
isregex: String,
isenabled: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("value".to_string(), value);
params.insert("isRegex".to_string(), isregex);
params.insert("isEnabled".to_string(), isenabled);
super::call(
service,
"spider",
"action",
"addDomainAlwaysInScope",
params,
)
}
pub fn modify_domain_always_in_scope(
service: &ZapService,
idx: String,
value: String,
isregex: String,
isenabled: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("idx".to_string(), idx);
params.insert("value".to_string(), value);
params.insert("isRegex".to_string(), isregex);
params.insert("isEnabled".to_string(), isenabled);
super::call(
service,
"spider",
"action",
"modifyDomainAlwaysInScope",
params,
)
}
pub fn remove_domain_always_in_scope(
service: &ZapService,
idx: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("idx".to_string(), idx);
super::call(
service,
"spider",
"action",
"removeDomainAlwaysInScope",
params,
)
}
pub fn enable_all_domains_always_in_scope(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(
service,
"spider",
"action",
"enableAllDomainsAlwaysInScope",
params,
)
}
pub fn disable_all_domains_always_in_scope(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(
service,
"spider",
"action",
"disableAllDomainsAlwaysInScope",
params,
)
}
pub fn set_option_handle_parameters(
service: &ZapService,
string: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("String".to_string(), string);
super::call(
service,
"spider",
"action",
"setOptionHandleParameters",
params,
)
}
pub fn set_option_scope_string(service: &ZapService, string: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("String".to_string(), string);
super::call(service, "spider", "action", "setOptionScopeString", params)
}
pub fn set_option_skip_url_string(
service: &ZapService,
string: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("String".to_string(), string);
super::call(
service,
"spider",
"action",
"setOptionSkipURLString",
params,
)
}
pub fn set_option_user_agent(service: &ZapService, string: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("String".to_string(), string);
super::call(service, "spider", "action", "setOptionUserAgent", params)
}
pub fn set_option_accept_cookies(
service: &ZapService,
boolean: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Boolean".to_string(), boolean);
super::call(
service,
"spider",
"action",
"setOptionAcceptCookies",
params,
)
}
pub fn set_option_handle_o_data_parameters_visited(
service: &ZapService,
boolean: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Boolean".to_string(), boolean);
super::call(
service,
"spider",
"action",
"setOptionHandleODataParametersVisited",
params,
)
}
pub fn set_option_max_children(
service: &ZapService,
integer: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Integer".to_string(), integer);
super::call(service, "spider", "action", "setOptionMaxChildren", params)
}
pub fn set_option_max_depth(service: &ZapService, integer: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Integer".to_string(), integer);
super::call(service, "spider", "action", "setOptionMaxDepth", params)
}
pub fn set_option_max_duration(
service: &ZapService,
integer: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Integer".to_string(), integer);
super::call(service, "spider", "action", "setOptionMaxDuration", params)
}
pub fn set_option_max_parse_size_bytes(
service: &ZapService,
integer: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Integer".to_string(), integer);
super::call(
service,
"spider",
"action",
"setOptionMaxParseSizeBytes",
params,
)
}
pub fn set_option_max_scans_in_ui(
service: &ZapService,
integer: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Integer".to_string(), integer);
super::call(service, "spider", "action", "setOptionMaxScansInUI", params)
}
pub fn set_option_parse_comments(
service: &ZapService,
boolean: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Boolean".to_string(), boolean);
super::call(
service,
"spider",
"action",
"setOptionParseComments",
params,
)
}
pub fn set_option_parse_git(service: &ZapService, boolean: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Boolean".to_string(), boolean);
super::call(service, "spider", "action", "setOptionParseGit", params)
}
pub fn set_option_parse_robots_txt(
service: &ZapService,
boolean: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Boolean".to_string(), boolean);
super::call(
service,
"spider",
"action",
"setOptionParseRobotsTxt",
params,
)
}
pub fn set_option_parse_svn_entries(
service: &ZapService,
boolean: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Boolean".to_string(), boolean);
super::call(
service,
"spider",
"action",
"setOptionParseSVNEntries",
params,
)
}
pub fn set_option_parse_sitemap_xml(
service: &ZapService,
boolean: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Boolean".to_string(), boolean);
super::call(
service,
"spider",
"action",
"setOptionParseSitemapXml",
params,
)
}
pub fn set_option_post_form(service: &ZapService, boolean: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Boolean".to_string(), boolean);
super::call(service, "spider", "action", "setOptionPostForm", params)
}
pub fn set_option_process_form(
service: &ZapService,
boolean: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Boolean".to_string(), boolean);
super::call(service, "spider", "action", "setOptionProcessForm", params)
}
pub fn set_option_request_wait_time(
service: &ZapService,
integer: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Integer".to_string(), integer);
super::call(
service,
"spider",
"action",
"setOptionRequestWaitTime",
params,
)
}
pub fn set_option_send_referer_header(
service: &ZapService,
boolean: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Boolean".to_string(), boolean);
super::call(
service,
"spider",
"action",
"setOptionSendRefererHeader",
params,
)
}
pub fn set_option_show_advanced_dialog(
service: &ZapService,
boolean: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Boolean".to_string(), boolean);
super::call(
service,
"spider",
"action",
"setOptionShowAdvancedDialog",
params,
)
}
pub fn set_option_thread_count(
service: &ZapService,
integer: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Integer".to_string(), integer);
super::call(service, "spider", "action", "setOptionThreadCount", params)
}