/client/force-app/main/default/classes/SwagTextInputApi.cls

https://github.com/Cloudmersive/Cloudmersive.APIClient.Apex.Validate · Visual Basic for Applications · 230 lines · 205 code · 13 blank · 12 comment · 15 complexity · 9305a05e3855ea0413c22ae6bb84739e MD5 · raw file

  1. /*
  2. * validateapi
  3. * The validation APIs help you validate data. Check if an E-mail address is real. Check if a domain is real. Check up on an IP address, and even where it is located. All this and much more is available in the validation API.
  4. *
  5. * OpenAPI spec version: v1
  6. *
  7. *
  8. * NOTE: This class is auto generated by the swagger code generator program.
  9. * https://github.com/swagger-api/swagger-codegen.git
  10. * Do not edit the class manually.
  11. */
  12. public class SwagTextInputApi {
  13. SwagClient client;
  14. public SwagTextInputApi(SwagClient client) {
  15. this.client = client;
  16. }
  17. public SwagTextInputApi() {
  18. this.client = new SwagClient();
  19. }
  20. public SwagClient getClient() {
  21. return this.client;
  22. }
  23. /**
  24. * Protect html input from Server-side Request Forgery (SSRF) attacks
  25. * Detects SSRF (Server-side request forgery) attacks and unsafe URL attacks from HTML text input, where attackers can attempt to access unsafe local or network paths in the server environment by injecting them into HTML.
  26. * @param value User-facing HTML input. (required)
  27. * @return SwagHtmlSsrfDetectionResult
  28. * @throws Swagger.ApiException if fails to make API call
  29. */
  30. public SwagHtmlSsrfDetectionResult textInputCheckHtmlSsrf(Map<String, Object> params) {
  31. client.assertNotNull(params.get('value'), 'value');
  32. List<Swagger.Param> query = new List<Swagger.Param>();
  33. List<Swagger.Param> form = new List<Swagger.Param>();
  34. return (SwagHtmlSsrfDetectionResult) client.invoke(
  35. 'POST', '/validate/text-input/html/check/ssrf',
  36. (String) params.get('value'),
  37. query, form,
  38. new Map<String, Object>(),
  39. new Map<String, Object>(),
  40. new List<String>{ 'application/json' },
  41. new List<String>{ 'application/json' },
  42. new List<String> { 'Apikey' },
  43. SwagHtmlSsrfDetectionResult.class
  44. );
  45. }
  46. /**
  47. * Check text input for SQL Injection (SQLI) attacks
  48. * Detects SQL Injection (SQLI) attacks from text input.
  49. * @param value User-facing text input. (required)
  50. * @param detectionLevel Set to Normal to target a high-security SQL Injection detection level with a very low false positive rate; select High to target a very-high security SQL Injection detection level with higher false positives. Default is Normal (recommended). (optional)
  51. * @return SwagSqlInjectionDetectionResult
  52. * @throws Swagger.ApiException if fails to make API call
  53. */
  54. public SwagSqlInjectionDetectionResult textInputCheckSqlInjection(Map<String, Object> params) {
  55. client.assertNotNull(params.get('value'), 'value');
  56. List<Swagger.Param> query = new List<Swagger.Param>();
  57. List<Swagger.Param> form = new List<Swagger.Param>();
  58. return (SwagSqlInjectionDetectionResult) client.invoke(
  59. 'POST', '/validate/text-input/check/sql-injection',
  60. (String) params.get('value'),
  61. query, form,
  62. new Map<String, Object>(),
  63. new Map<String, Object>{
  64. 'detectionLevel' => (String) params.get('detectionLevel')
  65. },
  66. new List<String>{ 'application/json' },
  67. new List<String>{ 'application/json' },
  68. new List<String> { 'Apikey' },
  69. SwagSqlInjectionDetectionResult.class
  70. );
  71. }
  72. /**
  73. * Check and protect multiple text inputs for SQL Injection (SQLI) attacks in batch
  74. * Detects SQL Injection (SQLI) attacks from multiple text inputs. Output preverses order of input items.
  75. * @param value User-facing text input. (required)
  76. * @return SwagSqlInjectionCheckBatchResponse
  77. * @throws Swagger.ApiException if fails to make API call
  78. */
  79. public SwagSqlInjectionCheckBatchResponse textInputCheckSqlInjectionBatch(Map<String, Object> params) {
  80. client.assertNotNull(params.get('value'), 'value');
  81. List<Swagger.Param> query = new List<Swagger.Param>();
  82. List<Swagger.Param> form = new List<Swagger.Param>();
  83. return (SwagSqlInjectionCheckBatchResponse) client.invoke(
  84. 'POST', '/validate/text-input/check/sql-injection/batch',
  85. (SwagSqlInjectionCheckBatchRequest) params.get('value'),
  86. query, form,
  87. new Map<String, Object>(),
  88. new Map<String, Object>(),
  89. new List<String>{ 'application/json' },
  90. new List<String>{ 'application/json' },
  91. new List<String> { 'Apikey' },
  92. SwagSqlInjectionCheckBatchResponse.class
  93. );
  94. }
  95. /**
  96. * Check text input for Cross-Site-Scripting (XSS) attacks
  97. * Detects XSS (Cross-Site-Scripting) attacks from text input.
  98. * @param value User-facing text input. (required)
  99. * @return SwagXssProtectionResult
  100. * @throws Swagger.ApiException if fails to make API call
  101. */
  102. public SwagXssProtectionResult textInputCheckXss(Map<String, Object> params) {
  103. client.assertNotNull(params.get('value'), 'value');
  104. List<Swagger.Param> query = new List<Swagger.Param>();
  105. List<Swagger.Param> form = new List<Swagger.Param>();
  106. return (SwagXssProtectionResult) client.invoke(
  107. 'POST', '/validate/text-input/check/xss',
  108. (String) params.get('value'),
  109. query, form,
  110. new Map<String, Object>(),
  111. new Map<String, Object>(),
  112. new List<String>{ 'application/json' },
  113. new List<String>{ 'application/json' },
  114. new List<String> { 'Apikey' },
  115. SwagXssProtectionResult.class
  116. );
  117. }
  118. /**
  119. * Check and protect multiple text inputs for Cross-Site-Scripting (XSS) attacks in batch
  120. * Detects XSS (Cross-Site-Scripting) attacks from multiple text inputs. Output preverses order of input items.
  121. * @param value User-facing text input. (required)
  122. * @return SwagXssProtectionBatchResponse
  123. * @throws Swagger.ApiException if fails to make API call
  124. */
  125. public SwagXssProtectionBatchResponse textInputCheckXssBatch(Map<String, Object> params) {
  126. client.assertNotNull(params.get('value'), 'value');
  127. List<Swagger.Param> query = new List<Swagger.Param>();
  128. List<Swagger.Param> form = new List<Swagger.Param>();
  129. return (SwagXssProtectionBatchResponse) client.invoke(
  130. 'POST', '/validate/text-input/check-and-protect/xss/batch',
  131. (SwagXssProtectionBatchRequest) params.get('value'),
  132. query, form,
  133. new Map<String, Object>(),
  134. new Map<String, Object>(),
  135. new List<String>{ 'application/json' },
  136. new List<String>{ 'application/json' },
  137. new List<String> { 'Apikey' },
  138. SwagXssProtectionBatchResponse.class
  139. );
  140. }
  141. /**
  142. * Protect text input from XML External Entity (XXE) attacks
  143. * Detects XXE (XML External Entity) attacks from text input.
  144. * @param value User-facing text input. (required)
  145. * @param allowInternetUrls Optional: Set to true to allow Internet-based dependency URLs for DTDs and other XML External Entitites, set to false to block. Default is false. (optional)
  146. * @param knownSafeUrls Optional: Comma separated list of fully-qualified URLs that will automatically be considered safe. (optional)
  147. * @param knownUnsafeUrls Optional: Comma separated list of fully-qualified URLs that will automatically be considered unsafe. (optional)
  148. * @return SwagXxeDetectionResult
  149. * @throws Swagger.ApiException if fails to make API call
  150. */
  151. public SwagXxeDetectionResult textInputCheckXxe(Map<String, Object> params) {
  152. client.assertNotNull(params.get('value'), 'value');
  153. List<Swagger.Param> query = new List<Swagger.Param>();
  154. List<Swagger.Param> form = new List<Swagger.Param>();
  155. return (SwagXxeDetectionResult) client.invoke(
  156. 'POST', '/validate/text-input/check/xxe',
  157. (String) params.get('value'),
  158. query, form,
  159. new Map<String, Object>(),
  160. new Map<String, Object>{
  161. 'allowInternetUrls' => (Boolean) params.get('allowInternetUrls'),
  162. 'knownSafeUrls' => (String) params.get('knownSafeUrls'),
  163. 'knownUnsafeUrls' => (String) params.get('knownUnsafeUrls')
  164. },
  165. new List<String>{ 'application/json' },
  166. new List<String>{ 'application/json' },
  167. new List<String> { 'Apikey' },
  168. SwagXxeDetectionResult.class
  169. );
  170. }
  171. /**
  172. * Protect text input from XML External Entity (XXE) attacks
  173. * Detects XXE (XML External Entity) attacks from text input.
  174. * @param request (required)
  175. * @return SwagXxeDetectionBatchResponse
  176. * @throws Swagger.ApiException if fails to make API call
  177. */
  178. public SwagXxeDetectionBatchResponse textInputCheckXxeBatch(Map<String, Object> params) {
  179. client.assertNotNull(params.get('request'), 'request');
  180. List<Swagger.Param> query = new List<Swagger.Param>();
  181. List<Swagger.Param> form = new List<Swagger.Param>();
  182. return (SwagXxeDetectionBatchResponse) client.invoke(
  183. 'POST', '/validate/text-input/check/xxe/batch',
  184. (SwagXxeDetectionBatchRequest) params.get('request'),
  185. query, form,
  186. new Map<String, Object>(),
  187. new Map<String, Object>(),
  188. new List<String>{ 'application/json' },
  189. new List<String>{ 'application/json' },
  190. new List<String> { 'Apikey' },
  191. SwagXxeDetectionBatchResponse.class
  192. );
  193. }
  194. /**
  195. * Protect text input from Cross-Site-Scripting (XSS) attacks through normalization
  196. * Detects and removes XSS (Cross-Site-Scripting) attacks from text input through normalization. Returns the normalized result, as well as information on whether the original input contained an XSS risk.
  197. * @param value User-facing text input. (required)
  198. * @return SwagXssProtectionResult
  199. * @throws Swagger.ApiException if fails to make API call
  200. */
  201. public SwagXssProtectionResult textInputProtectXss(Map<String, Object> params) {
  202. client.assertNotNull(params.get('value'), 'value');
  203. List<Swagger.Param> query = new List<Swagger.Param>();
  204. List<Swagger.Param> form = new List<Swagger.Param>();
  205. return (SwagXssProtectionResult) client.invoke(
  206. 'POST', '/validate/text-input/protect/xss',
  207. (String) params.get('value'),
  208. query, form,
  209. new Map<String, Object>(),
  210. new Map<String, Object>(),
  211. new List<String>{ 'application/json' },
  212. new List<String>{ 'application/json' },
  213. new List<String> { 'Apikey' },
  214. SwagXssProtectionResult.class
  215. );
  216. }
  217. }