1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
use super::ZapApiError;
use super::ZapService;
use serde_json::Value;
use std::collections::HashMap;
pub fn is_forced_user_mode_enabled(service: &ZapService) -> Result<Value, ZapApiError> {
let params = HashMap::new();
super::call(
service,
"forcedUser",
"view",
"isForcedUserModeEnabled",
params,
)
}
pub fn get_forced_user(service: &ZapService, contextid: String) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextId".to_string(), contextid);
super::call(service, "forcedUser", "view", "getForcedUser", params)
}
pub fn set_forced_user(
service: &ZapService,
contextid: String,
userid: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("contextId".to_string(), contextid);
params.insert("userId".to_string(), userid);
super::call(service, "forcedUser", "action", "setForcedUser", params)
}
pub fn set_forced_user_mode_enabled(
service: &ZapService,
boolean: String,
) -> Result<Value, ZapApiError> {
let mut params = HashMap::new();
params.insert("boolean".to_string(), boolean);
super::call(
service,
"forcedUser",
"action",
"setForcedUserModeEnabled",
params,
)
}