|
| 1 | +/* |
| 2 | + * Zed Attack Proxy (ZAP) and its related class files. |
| 3 | + * |
| 4 | + * ZAP is an HTTP/HTTPS proxy for assessing web application security. |
| 5 | + * |
| 6 | + * Copyright 2025 The ZAP Development Team |
| 7 | + * |
| 8 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | + * you may not use this file except in compliance with the License. |
| 10 | + * You may obtain a copy of the License at |
| 11 | + * |
| 12 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | + * |
| 14 | + * Unless required by applicable law or agreed to in writing, software |
| 15 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | + * See the License for the specific language governing permissions and |
| 18 | + * limitations under the License. |
| 19 | + */ |
| 20 | +package org.zaproxy.clientapi.gen; |
| 21 | + |
| 22 | +import java.util.HashMap; |
| 23 | +import java.util.Map; |
| 24 | +import org.zaproxy.clientapi.core.ApiResponse; |
| 25 | +import org.zaproxy.clientapi.core.ClientApi; |
| 26 | +import org.zaproxy.clientapi.core.ClientApiException; |
| 27 | + |
| 28 | +/** This file was automatically generated. */ |
| 29 | +@SuppressWarnings("javadoc") |
| 30 | +public class Oast { |
| 31 | + |
| 32 | + private final ClientApi api; |
| 33 | + |
| 34 | + public Oast(ClientApi api) { |
| 35 | + this.api = api; |
| 36 | + } |
| 37 | + |
| 38 | + /** |
| 39 | + * Gets the service used with the active scanner, if any. |
| 40 | + * |
| 41 | + * <p>This component is optional and therefore the API will only work if it is installed |
| 42 | + */ |
| 43 | + public ApiResponse getActiveScanService() throws ClientApiException { |
| 44 | + return api.callApi("oast", "view", "getActiveScanService", null); |
| 45 | + } |
| 46 | + |
| 47 | + /** |
| 48 | + * Gets all of the services. |
| 49 | + * |
| 50 | + * <p>This component is optional and therefore the API will only work if it is installed |
| 51 | + */ |
| 52 | + public ApiResponse getServices() throws ClientApiException { |
| 53 | + return api.callApi("oast", "view", "getServices", null); |
| 54 | + } |
| 55 | + |
| 56 | + /** |
| 57 | + * Gets the BOAST options. |
| 58 | + * |
| 59 | + * <p>This component is optional and therefore the API will only work if it is installed |
| 60 | + */ |
| 61 | + public ApiResponse getBoastOptions() throws ClientApiException { |
| 62 | + return api.callApi("oast", "view", "getBoastOptions", null); |
| 63 | + } |
| 64 | + |
| 65 | + /** |
| 66 | + * Gets the Callback options. |
| 67 | + * |
| 68 | + * <p>This component is optional and therefore the API will only work if it is installed |
| 69 | + */ |
| 70 | + public ApiResponse getCallbackOptions() throws ClientApiException { |
| 71 | + return api.callApi("oast", "view", "getCallbackOptions", null); |
| 72 | + } |
| 73 | + |
| 74 | + /** |
| 75 | + * Gets the Interactsh options. |
| 76 | + * |
| 77 | + * <p>This component is optional and therefore the API will only work if it is installed |
| 78 | + */ |
| 79 | + public ApiResponse getInteractshOptions() throws ClientApiException { |
| 80 | + return api.callApi("oast", "view", "getInteractshOptions", null); |
| 81 | + } |
| 82 | + |
| 83 | + /** |
| 84 | + * Gets the number of days the OAST records will be kept for. |
| 85 | + * |
| 86 | + * <p>This component is optional and therefore the API will only work if it is installed |
| 87 | + */ |
| 88 | + public ApiResponse getDaysToKeepRecords() throws ClientApiException { |
| 89 | + return api.callApi("oast", "view", "getDaysToKeepRecords", null); |
| 90 | + } |
| 91 | + |
| 92 | + /** |
| 93 | + * Sets the service used with the active scanner. |
| 94 | + * |
| 95 | + * <p>This component is optional and therefore the API will only work if it is installed |
| 96 | + */ |
| 97 | + public ApiResponse setActiveScanService(String name) throws ClientApiException { |
| 98 | + Map<String, String> map = new HashMap<>(); |
| 99 | + map.put("name", name); |
| 100 | + return api.callApi("oast", "action", "setActiveScanService", map); |
| 101 | + } |
| 102 | + |
| 103 | + /** |
| 104 | + * Sets the BOAST options. |
| 105 | + * |
| 106 | + * <p>This component is optional and therefore the API will only work if it is installed |
| 107 | + */ |
| 108 | + public ApiResponse setBoastOptions(String server, String pollinsecs) throws ClientApiException { |
| 109 | + Map<String, String> map = new HashMap<>(); |
| 110 | + map.put("server", server); |
| 111 | + map.put("pollInSecs", pollinsecs); |
| 112 | + return api.callApi("oast", "action", "setBoastOptions", map); |
| 113 | + } |
| 114 | + |
| 115 | + /** |
| 116 | + * Sets the Callback options. |
| 117 | + * |
| 118 | + * <p>This component is optional and therefore the API will only work if it is installed |
| 119 | + */ |
| 120 | + public ApiResponse setCallbackOptions(String localaddress, String remoteaddress, String port) |
| 121 | + throws ClientApiException { |
| 122 | + Map<String, String> map = new HashMap<>(); |
| 123 | + map.put("localAddress", localaddress); |
| 124 | + map.put("remoteAddress", remoteaddress); |
| 125 | + map.put("port", port); |
| 126 | + return api.callApi("oast", "action", "setCallbackOptions", map); |
| 127 | + } |
| 128 | + |
| 129 | + /** |
| 130 | + * Sets the Interactsh options. |
| 131 | + * |
| 132 | + * <p>This component is optional and therefore the API will only work if it is installed |
| 133 | + */ |
| 134 | + public ApiResponse setInteractshOptions(String server, String pollinsecs, String authtoken) |
| 135 | + throws ClientApiException { |
| 136 | + Map<String, String> map = new HashMap<>(); |
| 137 | + map.put("server", server); |
| 138 | + map.put("pollInSecs", pollinsecs); |
| 139 | + map.put("authToken", authtoken); |
| 140 | + return api.callApi("oast", "action", "setInteractshOptions", map); |
| 141 | + } |
| 142 | + |
| 143 | + /** |
| 144 | + * Sets the number of days the OAST records will be kept for. |
| 145 | + * |
| 146 | + * <p>This component is optional and therefore the API will only work if it is installed |
| 147 | + */ |
| 148 | + public ApiResponse setDaysToKeepRecords(String days) throws ClientApiException { |
| 149 | + Map<String, String> map = new HashMap<>(); |
| 150 | + map.put("days", days); |
| 151 | + return api.callApi("oast", "action", "setDaysToKeepRecords", map); |
| 152 | + } |
| 153 | +} |
0 commit comments