zap_api/
selenium.rs

1/* Zed Attack Proxy (ZAP) and its related class files.
2 *
3 * ZAP is an HTTP/HTTPS proxy for assessing web application security.
4 *
5 * Copyright 2019 the ZAP development team
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20use super::ZapApiError;
21use super::ZapService;
22use serde_json::Value;
23use std::collections::HashMap;
24
25/**
26 * This file was automatically generated.
27 */
28/**
29 * Returns the current path to ChromeDriver
30 * <p>
31 * This component is optional and therefore the API will only work if it is installed
32*/
33pub fn option_chrome_driver_path(service: &ZapService) -> Result<Value, ZapApiError> {
34    let params = HashMap::new();
35    super::call(
36        service,
37        "selenium",
38        "view",
39        "optionChromeDriverPath",
40        params,
41    )
42}
43
44/**
45 * Returns the current path to Firefox binary
46 * <p>
47 * This component is optional and therefore the API will only work if it is installed
48*/
49pub fn option_firefox_binary_path(service: &ZapService) -> Result<Value, ZapApiError> {
50    let params = HashMap::new();
51    super::call(
52        service,
53        "selenium",
54        "view",
55        "optionFirefoxBinaryPath",
56        params,
57    )
58}
59
60/**
61 * Returns the current path to Firefox driver (geckodriver)
62 * <p>
63 * This component is optional and therefore the API will only work if it is installed
64*/
65pub fn option_firefox_driver_path(service: &ZapService) -> Result<Value, ZapApiError> {
66    let params = HashMap::new();
67    super::call(
68        service,
69        "selenium",
70        "view",
71        "optionFirefoxDriverPath",
72        params,
73    )
74}
75
76/**
77 * This component is optional and therefore the API will only work if it is installed
78 */
79pub fn option_ie_driver_path(service: &ZapService) -> Result<Value, ZapApiError> {
80    let params = HashMap::new();
81    super::call(service, "selenium", "view", "optionIeDriverPath", params)
82}
83
84/**
85 * Returns the current path to PhantomJS binary
86 * <p>
87 * This component is optional and therefore the API will only work if it is installed
88*/
89pub fn option_phantom_js_binary_path(service: &ZapService) -> Result<Value, ZapApiError> {
90    let params = HashMap::new();
91    super::call(
92        service,
93        "selenium",
94        "view",
95        "optionPhantomJsBinaryPath",
96        params,
97    )
98}
99
100/**
101 * Sets the current path to ChromeDriver
102 * <p>
103 * This component is optional and therefore the API will only work if it is installed
104*/
105pub fn set_option_chrome_driver_path(
106    service: &ZapService,
107    string: String,
108) -> Result<Value, ZapApiError> {
109    let mut params = HashMap::new();
110    params.insert("String".to_string(), string);
111    super::call(
112        service,
113        "selenium",
114        "action",
115        "setOptionChromeDriverPath",
116        params,
117    )
118}
119
120/**
121 * Sets the current path to Firefox binary
122 * <p>
123 * This component is optional and therefore the API will only work if it is installed
124*/
125pub fn set_option_firefox_binary_path(
126    service: &ZapService,
127    string: String,
128) -> Result<Value, ZapApiError> {
129    let mut params = HashMap::new();
130    params.insert("String".to_string(), string);
131    super::call(
132        service,
133        "selenium",
134        "action",
135        "setOptionFirefoxBinaryPath",
136        params,
137    )
138}
139
140/**
141 * Sets the current path to Firefox driver (geckodriver)
142 * <p>
143 * This component is optional and therefore the API will only work if it is installed
144*/
145pub fn set_option_firefox_driver_path(
146    service: &ZapService,
147    string: String,
148) -> Result<Value, ZapApiError> {
149    let mut params = HashMap::new();
150    params.insert("String".to_string(), string);
151    super::call(
152        service,
153        "selenium",
154        "action",
155        "setOptionFirefoxDriverPath",
156        params,
157    )
158}
159
160/**
161 * This component is optional and therefore the API will only work if it is installed
162 */
163pub fn set_option_ie_driver_path(
164    service: &ZapService,
165    string: String,
166) -> Result<Value, ZapApiError> {
167    let mut params = HashMap::new();
168    params.insert("String".to_string(), string);
169    super::call(
170        service,
171        "selenium",
172        "action",
173        "setOptionIeDriverPath",
174        params,
175    )
176}
177
178/**
179 * Sets the current path to PhantomJS binary
180 * <p>
181 * This component is optional and therefore the API will only work if it is installed
182*/
183pub fn set_option_phantom_js_binary_path(
184    service: &ZapService,
185    string: String,
186) -> Result<Value, ZapApiError> {
187    let mut params = HashMap::new();
188    params.insert("String".to_string(), string);
189    super::call(
190        service,
191        "selenium",
192        "action",
193        "setOptionPhantomJsBinaryPath",
194        params,
195    )
196}