use super::ZapApiError;
use super::ZapService;
use serde_json::Value;
use std::collections::HashMap;
pub fn hosts(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "hosts", params)
}
pub fn sites(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "sites", params)
}
pub fn urls(service: &ZapService, baseurl: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("baseurl".to_string(), baseurl);
super::call(service, "core", "view", "urls", params)
}
pub fn child_nodes(service: &ZapService, url: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("url".to_string(), url);
super::call(service, "core", "view", "childNodes", params)
}
pub fn message(service: &ZapService, id: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("id".to_string(), id);
super::call(service, "core", "view", "message", params)
}
pub fn messages(
service: &ZapService,
baseurl: String,
start: String,
count: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("baseurl".to_string(), baseurl);
params.insert("start".to_string(), start);
params.insert("count".to_string(), count);
super::call(service, "core", "view", "messages", params)
}
pub fn messages_by_id(service: &ZapService, ids: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("ids".to_string(), ids);
super::call(service, "core", "view", "messagesById", params)
}
pub fn number_of_messages(service: &ZapService, baseurl: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("baseurl".to_string(), baseurl);
super::call(service, "core", "view", "numberOfMessages", params)
}
pub fn mode(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "mode", params)
}
pub fn version(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "version", params)
}
pub fn excluded_from_proxy(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "excludedFromProxy", params)
}
pub fn home_directory(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "homeDirectory", params)
}
pub fn session_location(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "sessionLocation", params)
}
pub fn proxy_chain_excluded_domains(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "proxyChainExcludedDomains", params)
}
pub fn option_proxy_chain_skip_name(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "optionProxyChainSkipName", params)
}
pub fn option_proxy_excluded_domains(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(
service,
"core",
"view",
"optionProxyExcludedDomains",
params,
)
}
pub fn option_proxy_excluded_domains_enabled(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(
service,
"core",
"view",
"optionProxyExcludedDomainsEnabled",
params,
)
}
pub fn zap_home_path(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "zapHomePath", params)
}
pub fn option_maximum_alert_instances(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(
service,
"core",
"view",
"optionMaximumAlertInstances",
params,
)
}
pub fn option_merge_related_alerts(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "optionMergeRelatedAlerts", params)
}
pub fn option_alert_overrides_file_path(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(
service,
"core",
"view",
"optionAlertOverridesFilePath",
params,
)
}
pub fn alert(service: &ZapService, id: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("id".to_string(), id);
super::call(service, "core", "view", "alert", params)
}
pub fn alerts(
service: &ZapService,
baseurl: String,
start: String,
count: String,
riskid: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("baseurl".to_string(), baseurl);
params.insert("start".to_string(), start);
params.insert("count".to_string(), count);
params.insert("riskId".to_string(), riskid);
super::call(service, "core", "view", "alerts", params)
}
pub fn alerts_summary(service: &ZapService, baseurl: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("baseurl".to_string(), baseurl);
super::call(service, "core", "view", "alertsSummary", params)
}
pub fn number_of_alerts(
service: &ZapService,
baseurl: String,
riskid: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("baseurl".to_string(), baseurl);
params.insert("riskId".to_string(), riskid);
super::call(service, "core", "view", "numberOfAlerts", params)
}
pub fn option_default_user_agent(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "optionDefaultUserAgent", params)
}
pub fn option_dns_ttl_successful_queries(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(
service,
"core",
"view",
"optionDnsTtlSuccessfulQueries",
params,
)
}
pub fn option_http_state(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "optionHttpState", params)
}
pub fn option_proxy_chain_name(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "optionProxyChainName", params)
}
pub fn option_proxy_chain_password(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "optionProxyChainPassword", params)
}
pub fn option_proxy_chain_port(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "optionProxyChainPort", params)
}
pub fn option_proxy_chain_realm(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "optionProxyChainRealm", params)
}
pub fn option_proxy_chain_user_name(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "optionProxyChainUserName", params)
}
pub fn option_timeout_in_secs(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "optionTimeoutInSecs", params)
}
pub fn option_http_state_enabled(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "optionHttpStateEnabled", params)
}
pub fn option_proxy_chain_prompt(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "optionProxyChainPrompt", params)
}
pub fn option_single_cookie_request_header(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(
service,
"core",
"view",
"optionSingleCookieRequestHeader",
params,
)
}
pub fn option_use_proxy_chain(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "optionUseProxyChain", params)
}
pub fn option_use_proxy_chain_auth(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "view", "optionUseProxyChainAuth", params)
}
pub fn access_url(
service: &ZapService,
url: String,
followredirects: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("url".to_string(), url);
params.insert("followRedirects".to_string(), followredirects);
super::call(service, "core", "action", "accessUrl", params)
}
pub fn shutdown(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "action", "shutdown", params)
}
pub fn new_session(
service: &ZapService,
name: String,
overwrite: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("name".to_string(), name);
params.insert("overwrite".to_string(), overwrite);
super::call(service, "core", "action", "newSession", params)
}
pub fn load_session(service: &ZapService, name: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("name".to_string(), name);
super::call(service, "core", "action", "loadSession", params)
}
pub fn save_session(
service: &ZapService,
name: String,
overwrite: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("name".to_string(), name);
params.insert("overwrite".to_string(), overwrite);
super::call(service, "core", "action", "saveSession", params)
}
pub fn snapshot_session(
service: &ZapService,
name: String,
overwrite: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("name".to_string(), name);
params.insert("overwrite".to_string(), overwrite);
super::call(service, "core", "action", "snapshotSession", params)
}
pub fn clear_excluded_from_proxy(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "action", "clearExcludedFromProxy", params)
}
pub fn exclude_from_proxy(service: &ZapService, regex: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("regex".to_string(), regex);
super::call(service, "core", "action", "excludeFromProxy", params)
}
pub fn set_home_directory(service: &ZapService, dir: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("dir".to_string(), dir);
super::call(service, "core", "action", "setHomeDirectory", params)
}
pub fn set_mode(service: &ZapService, mode: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("mode".to_string(), mode);
super::call(service, "core", "action", "setMode", params)
}
pub fn generate_root_ca(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "action", "generateRootCA", params)
}
pub fn send_request(
service: &ZapService,
request: String,
followredirects: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("request".to_string(), request);
params.insert("followRedirects".to_string(), followredirects);
super::call(service, "core", "action", "sendRequest", params)
}
pub fn run_garbage_collection(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "action", "runGarbageCollection", params)
}
pub fn delete_site_node(
service: &ZapService,
url: String,
method: String,
postdata: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("url".to_string(), url);
params.insert("method".to_string(), method);
params.insert("postData".to_string(), postdata);
super::call(service, "core", "action", "deleteSiteNode", params)
}
pub fn add_proxy_chain_excluded_domain(
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,
"core",
"action",
"addProxyChainExcludedDomain",
params,
)
}
pub fn modify_proxy_chain_excluded_domain(
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,
"core",
"action",
"modifyProxyChainExcludedDomain",
params,
)
}
pub fn remove_proxy_chain_excluded_domain(
service: &ZapService,
idx: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("idx".to_string(), idx);
super::call(
service,
"core",
"action",
"removeProxyChainExcludedDomain",
params,
)
}
pub fn enable_all_proxy_chain_excluded_domains(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(
service,
"core",
"action",
"enableAllProxyChainExcludedDomains",
params,
)
}
pub fn disable_all_proxy_chain_excluded_domains(
service: &ZapService,
) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(
service,
"core",
"action",
"disableAllProxyChainExcludedDomains",
params,
)
}
pub fn set_option_maximum_alert_instances(
service: &ZapService,
numberofinstances: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("numberOfInstances".to_string(), numberofinstances);
super::call(
service,
"core",
"action",
"setOptionMaximumAlertInstances",
params,
)
}
pub fn set_option_merge_related_alerts(
service: &ZapService,
enabled: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("enabled".to_string(), enabled);
super::call(
service,
"core",
"action",
"setOptionMergeRelatedAlerts",
params,
)
}
pub fn set_option_alert_overrides_file_path(
service: &ZapService,
filepath: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("filePath".to_string(), filepath);
super::call(
service,
"core",
"action",
"setOptionAlertOverridesFilePath",
params,
)
}
pub fn enable_pkcs_12_client_certificate(
service: &ZapService,
filepath: String,
password: String,
index: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("filePath".to_string(), filepath);
params.insert("password".to_string(), password);
params.insert("index".to_string(), index);
super::call(
service,
"core",
"action",
"enablePKCS12ClientCertificate",
params,
)
}
pub fn disable_client_certificate(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(
service,
"core",
"action",
"disableClientCertificate",
params,
)
}
pub fn delete_all_alerts(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "action", "deleteAllAlerts", params)
}
pub fn delete_alert(service: &ZapService, id: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("id".to_string(), id);
super::call(service, "core", "action", "deleteAlert", params)
}
pub fn set_option_default_user_agent(
service: &ZapService,
string: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("String".to_string(), string);
super::call(
service,
"core",
"action",
"setOptionDefaultUserAgent",
params,
)
}
pub fn set_option_proxy_chain_name(
service: &ZapService,
string: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("String".to_string(), string);
super::call(service, "core", "action", "setOptionProxyChainName", params)
}
pub fn set_option_proxy_chain_password(
service: &ZapService,
string: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("String".to_string(), string);
super::call(
service,
"core",
"action",
"setOptionProxyChainPassword",
params,
)
}
pub fn set_option_proxy_chain_realm(
service: &ZapService,
string: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("String".to_string(), string);
super::call(
service,
"core",
"action",
"setOptionProxyChainRealm",
params,
)
}
pub fn set_option_proxy_chain_skip_name(
service: &ZapService,
string: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("String".to_string(), string);
super::call(
service,
"core",
"action",
"setOptionProxyChainSkipName",
params,
)
}
pub fn set_option_proxy_chain_user_name(
service: &ZapService,
string: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("String".to_string(), string);
super::call(
service,
"core",
"action",
"setOptionProxyChainUserName",
params,
)
}
pub fn set_option_dns_ttl_successful_queries(
service: &ZapService,
integer: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Integer".to_string(), integer);
super::call(
service,
"core",
"action",
"setOptionDnsTtlSuccessfulQueries",
params,
)
}
pub fn set_option_http_state_enabled(
service: &ZapService,
boolean: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Boolean".to_string(), boolean);
super::call(
service,
"core",
"action",
"setOptionHttpStateEnabled",
params,
)
}
pub fn set_option_proxy_chain_port(
service: &ZapService,
integer: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Integer".to_string(), integer);
super::call(service, "core", "action", "setOptionProxyChainPort", params)
}
pub fn set_option_proxy_chain_prompt(
service: &ZapService,
boolean: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Boolean".to_string(), boolean);
super::call(
service,
"core",
"action",
"setOptionProxyChainPrompt",
params,
)
}
pub fn set_option_single_cookie_request_header(
service: &ZapService,
boolean: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Boolean".to_string(), boolean);
super::call(
service,
"core",
"action",
"setOptionSingleCookieRequestHeader",
params,
)
}
pub fn set_option_timeout_in_secs(
service: &ZapService,
integer: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Integer".to_string(), integer);
super::call(service, "core", "action", "setOptionTimeoutInSecs", params)
}
pub fn set_option_use_proxy_chain(
service: &ZapService,
boolean: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Boolean".to_string(), boolean);
super::call(service, "core", "action", "setOptionUseProxyChain", params)
}
pub fn set_option_use_proxy_chain_auth(
service: &ZapService,
boolean: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("Boolean".to_string(), boolean);
super::call(
service,
"core",
"action",
"setOptionUseProxyChainAuth",
params,
)
}
pub fn proxy_pac(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "other", "proxy.pac", params)
}
pub fn rootcert(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "other", "rootcert", params)
}
pub fn setproxy(service: &ZapService, proxy: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("proxy".to_string(), proxy);
super::call(service, "core", "other", "setproxy", params)
}
pub fn xmlreport(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "other", "xmlreport", params)
}
pub fn htmlreport(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "other", "htmlreport", params)
}
pub fn jsonreport(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "other", "jsonreport", params)
}
pub fn mdreport(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "core", "other", "mdreport", params)
}
pub fn message_har(service: &ZapService, id: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("id".to_string(), id);
super::call(service, "core", "other", "messageHar", params)
}
pub fn messages_har(
service: &ZapService,
baseurl: String,
start: String,
count: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("baseurl".to_string(), baseurl);
params.insert("start".to_string(), start);
params.insert("count".to_string(), count);
super::call(service, "core", "other", "messagesHar", params)
}
pub fn messages_har_by_id(service: &ZapService, ids: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("ids".to_string(), ids);
super::call(service, "core", "other", "messagesHarById", params)
}
pub fn send_har_request(
service: &ZapService,
request: String,
followredirects: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("request".to_string(), request);
params.insert("followRedirects".to_string(), followredirects);
super::call(service, "core", "other", "sendHarRequest", params)
}