use super::ZapApiError;
use super::ZapService;
use serde_json::Value;
use std::collections::HashMap;
pub fn get_authorization_detection_method(
service: &ZapService,
contextid: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextId".to_string(), contextid);
super::call(
service,
"authorization",
"view",
"getAuthorizationDetectionMethod",
params,
)
}
pub fn set_basic_authorization_detection_method(
service: &ZapService,
contextid: String,
headerregex: String,
bodyregex: String,
statuscode: String,
logicaloperator: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextId".to_string(), contextid);
params.insert("headerRegex".to_string(), headerregex);
params.insert("bodyRegex".to_string(), bodyregex);
params.insert("statusCode".to_string(), statuscode);
params.insert("logicalOperator".to_string(), logicaloperator);
super::call(
service,
"authorization",
"action",
"setBasicAuthorizationDetectionMethod",
params,
)
}