use super::ZapApiError;
use super::ZapService;
use serde_json::Value;
use std::collections::HashMap;
pub fn context_list(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "context", "view", "contextList", params)
}
pub fn exclude_regexs(service: &ZapService, contextname: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextName".to_string(), contextname);
super::call(service, "context", "view", "excludeRegexs", params)
}
pub fn include_regexs(service: &ZapService, contextname: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextName".to_string(), contextname);
super::call(service, "context", "view", "includeRegexs", params)
}
pub fn context(service: &ZapService, contextname: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextName".to_string(), contextname);
super::call(service, "context", "view", "context", params)
}
pub fn technology_list(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(service, "context", "view", "technologyList", params)
}
pub fn included_technology_list(
service: &ZapService,
contextname: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextName".to_string(), contextname);
super::call(service, "context", "view", "includedTechnologyList", params)
}
pub fn excluded_technology_list(
service: &ZapService,
contextname: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextName".to_string(), contextname);
super::call(service, "context", "view", "excludedTechnologyList", params)
}
pub fn urls(service: &ZapService, contextname: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextName".to_string(), contextname);
super::call(service, "context", "view", "urls", params)
}
pub fn exclude_from_context(
service: &ZapService,
contextname: String,
regex: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextName".to_string(), contextname);
params.insert("regex".to_string(), regex);
super::call(service, "context", "action", "excludeFromContext", params)
}
pub fn include_in_context(
service: &ZapService,
contextname: String,
regex: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextName".to_string(), contextname);
params.insert("regex".to_string(), regex);
super::call(service, "context", "action", "includeInContext", params)
}
pub fn set_context_regexs(
service: &ZapService,
contextname: String,
incregexs: String,
excregexs: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextName".to_string(), contextname);
params.insert("incRegexs".to_string(), incregexs);
params.insert("excRegexs".to_string(), excregexs);
super::call(service, "context", "action", "setContextRegexs", params)
}
pub fn new_context(service: &ZapService, contextname: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextName".to_string(), contextname);
super::call(service, "context", "action", "newContext", params)
}
pub fn remove_context(service: &ZapService, contextname: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextName".to_string(), contextname);
super::call(service, "context", "action", "removeContext", params)
}
pub fn export_context(
service: &ZapService,
contextname: String,
contextfile: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextName".to_string(), contextname);
params.insert("contextFile".to_string(), contextfile);
super::call(service, "context", "action", "exportContext", params)
}
pub fn import_context(service: &ZapService, contextfile: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextFile".to_string(), contextfile);
super::call(service, "context", "action", "importContext", params)
}
pub fn include_context_technologies(
service: &ZapService,
contextname: String,
technologynames: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextName".to_string(), contextname);
params.insert("technologyNames".to_string(), technologynames);
super::call(
service,
"context",
"action",
"includeContextTechnologies",
params,
)
}
pub fn include_all_context_technologies(
service: &ZapService,
contextname: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextName".to_string(), contextname);
super::call(
service,
"context",
"action",
"includeAllContextTechnologies",
params,
)
}
pub fn exclude_context_technologies(
service: &ZapService,
contextname: String,
technologynames: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextName".to_string(), contextname);
params.insert("technologyNames".to_string(), technologynames);
super::call(
service,
"context",
"action",
"excludeContextTechnologies",
params,
)
}
pub fn exclude_all_context_technologies(
service: &ZapService,
contextname: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextName".to_string(), contextname);
super::call(
service,
"context",
"action",
"excludeAllContextTechnologies",
params,
)
}
pub fn set_context_in_scope(
service: &ZapService,
contextname: String,
booleaninscope: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextName".to_string(), contextname);
params.insert("booleanInScope".to_string(), booleaninscope);
super::call(service, "context", "action", "setContextInScope", params)
}