cloudmersive-phishing-detection-api-client 2.2.2 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -4
- data/docs/PhishingDetectionAdvancedRequest.md +7 -1
- data/docs/PhishingDetectionAdvancedResponse.md +7 -1
- data/docs/PhishingDetectionApi.md +54 -0
- data/docs/PhishingDetectionTextStringRequest.md +10 -0
- data/docs/PhishingDetectionTextStringResponse.md +10 -0
- data/docs/UnsafeUrlResult.md +12 -0
- data/lib/cloudmersive-phishing-detection-api-client/api/phishing_detection_api.rb +48 -0
- data/lib/cloudmersive-phishing-detection-api-client/models/phishing_detection_advanced_request.rb +71 -11
- data/lib/cloudmersive-phishing-detection-api-client/models/phishing_detection_advanced_response.rb +73 -11
- data/lib/cloudmersive-phishing-detection-api-client/models/phishing_detection_text_string_request.rb +206 -0
- data/lib/cloudmersive-phishing-detection-api-client/models/phishing_detection_text_string_response.rb +206 -0
- data/lib/cloudmersive-phishing-detection-api-client/models/unsafe_url_result.rb +226 -0
- data/lib/cloudmersive-phishing-detection-api-client/version.rb +1 -1
- data/lib/cloudmersive-phishing-detection-api-client.rb +3 -0
- data/spec/api/phishing_detection_api_spec.rb +11 -0
- data/spec/models/phishing_detection_advanced_request_spec.rb +39 -3
- data/spec/models/phishing_detection_advanced_response_spec.rb +37 -1
- data/spec/models/phishing_detection_text_string_request_spec.rb +53 -0
- data/spec/models/phishing_detection_text_string_response_spec.rb +53 -0
- data/spec/models/unsafe_url_result_spec.rb +65 -0
- metadata +11 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0914deac554fb10ebcb51c0ccbfb8f6fd883811dad78e9722e9da05e8e098dee'
|
|
4
|
+
data.tar.gz: bb85570269976f3d0675d4f8617854ccb667b314f95a0e9adac3a6ebbe0818fd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 152942bf4642a422f14390985b0cb60995f7925bd6796423c27e339fa35ba7fdecffc024d46e28ab001594a9f478e553cabee2f241d094fe1b352a3ac18e035a
|
|
7
|
+
data.tar.gz: c5ff1a5cb28235ecdbb45bd09b2b0ce57c3f246b78a8f3b85e4965d608a0f6a55084965121acf807bfb6b8cc06d0d19ab626ed24b4459b01bde122de2ccef783
|
data/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Easily and directly scan and block phishing security threats in input.
|
|
|
7
7
|
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
|
8
8
|
|
|
9
9
|
- API version: v1
|
|
10
|
-
- Package version: 2.2.
|
|
10
|
+
- Package version: 2.2.3
|
|
11
11
|
- Build package: io.swagger.codegen.languages.RubyClientCodegen
|
|
12
12
|
|
|
13
13
|
## Installation
|
|
@@ -23,15 +23,15 @@ gem build cloudmersive-phishing-detection-api-client.gemspec
|
|
|
23
23
|
Then either install the gem locally:
|
|
24
24
|
|
|
25
25
|
```shell
|
|
26
|
-
gem install ./cloudmersive-phishing-detection-api-client-2.2.
|
|
26
|
+
gem install ./cloudmersive-phishing-detection-api-client-2.2.3.gem
|
|
27
27
|
```
|
|
28
|
-
(for development, run `gem install --dev ./cloudmersive-phishing-detection-api-client-2.2.
|
|
28
|
+
(for development, run `gem install --dev ./cloudmersive-phishing-detection-api-client-2.2.3.gem` to install the development dependencies)
|
|
29
29
|
|
|
30
30
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
|
31
31
|
|
|
32
32
|
Finally add this to the Gemfile:
|
|
33
33
|
|
|
34
|
-
gem 'cloudmersive-phishing-detection-api-client', '~> 2.2.
|
|
34
|
+
gem 'cloudmersive-phishing-detection-api-client', '~> 2.2.3'
|
|
35
35
|
|
|
36
36
|
### Install from Git
|
|
37
37
|
|
|
@@ -88,6 +88,7 @@ Class | Method | HTTP request | Description
|
|
|
88
88
|
*CloudmersivePhishingDetectionApiClient::PhishingDetectionApi* | [**phishing_detect_file_advanced_post**](docs/PhishingDetectionApi.md#phishing_detect_file_advanced_post) | **POST** /phishing/detect/file/advanced | Perform advanced AI phishing detection and classification against input text string. Analyzes input content as well as embedded URLs with AI deep learning to detect phishing, phishing and other unsafe content. Uses 25-100 API calls depending on model selected.
|
|
89
89
|
*CloudmersivePhishingDetectionApiClient::PhishingDetectionApi* | [**phishing_detect_file_post**](docs/PhishingDetectionApi.md#phishing_detect_file_post) | **POST** /phishing/detect/file | Perform AI phishing detection and classification on an input image or document (PDF or DOCX). Analyzes input content as well as embedded URLs with AI deep learnign to detect phishing and other unsafe content. Uses 100-125 API calls depending on model selected.
|
|
90
90
|
*CloudmersivePhishingDetectionApiClient::PhishingDetectionApi* | [**phishing_detect_text_string_advanced_post**](docs/PhishingDetectionApi.md#phishing_detect_text_string_advanced_post) | **POST** /phishing/detect/text-string/advanced | Perform advanced AI phishing detection and classification against input text string. Analyzes input content as well as embedded URLs with AI deep learnign to detect spam, phishing and other unsafe content. Uses 25-100 API calls depending on model selected.
|
|
91
|
+
*CloudmersivePhishingDetectionApiClient::PhishingDetectionApi* | [**phishing_detect_text_string_post**](docs/PhishingDetectionApi.md#phishing_detect_text_string_post) | **POST** /phishing/detect/text-string | Perform AI phishing detection against input text string. Returns a clean/not-clean result with confidence level and optional rationale.
|
|
91
92
|
*CloudmersivePhishingDetectionApiClient::PhishingDetectionApi* | [**phishing_detect_url_advanced_post**](docs/PhishingDetectionApi.md#phishing_detect_url_advanced_post) | **POST** /phishing/detect/url/advanced | Perform advanced AI phishing detection and classification against an input URL. Retrieves the URL content, checks for SSRF threats, and analyzes the page with AI deep learning to detect phishing and other unsafe content. Uses 100-125 API calls.
|
|
92
93
|
|
|
93
94
|
|
|
@@ -99,7 +100,10 @@ Class | Method | HTTP request | Description
|
|
|
99
100
|
- [CloudmersivePhishingDetectionApiClient::PhishingDetectionAdvancedResponse](docs/PhishingDetectionAdvancedResponse.md)
|
|
100
101
|
- [CloudmersivePhishingDetectionApiClient::PhishingDetectionEmailAdvancedResponse](docs/PhishingDetectionEmailAdvancedResponse.md)
|
|
101
102
|
- [CloudmersivePhishingDetectionApiClient::PhishingDetectionResponse](docs/PhishingDetectionResponse.md)
|
|
103
|
+
- [CloudmersivePhishingDetectionApiClient::PhishingDetectionTextStringRequest](docs/PhishingDetectionTextStringRequest.md)
|
|
104
|
+
- [CloudmersivePhishingDetectionApiClient::PhishingDetectionTextStringResponse](docs/PhishingDetectionTextStringResponse.md)
|
|
102
105
|
- [CloudmersivePhishingDetectionApiClient::PhishingDetectionUrlAdvancedResponse](docs/PhishingDetectionUrlAdvancedResponse.md)
|
|
106
|
+
- [CloudmersivePhishingDetectionApiClient::UnsafeUrlResult](docs/UnsafeUrlResult.md)
|
|
103
107
|
|
|
104
108
|
|
|
105
109
|
## Documentation for Authorization
|
|
@@ -4,10 +4,16 @@
|
|
|
4
4
|
Name | Type | Description | Notes
|
|
5
5
|
------------ | ------------- | ------------- | -------------
|
|
6
6
|
**input_string** | **String** | Input text string to detect phishing against | [optional]
|
|
7
|
+
**text_type** | **String** | Optional: Type of text being analyzed. Must be one of: \"TextMessage\", \"UserMessage\", \"SalesLead\", \"EmailMessage\", \"SupportCase\", \"AppMessage\", \"Other\". | [optional]
|
|
7
8
|
**model** | **String** | Optional: Specify which AI model to use. Possible choices are Normal and Advanced. Default is Advanced. | [optional]
|
|
9
|
+
**allow_unsolicited_sales** | **BOOLEAN** | Optional: True if unsolicited sales should be allowed, false otherwise. Defaults to true. | [optional]
|
|
10
|
+
**allow_promotional_content** | **BOOLEAN** | Optional: True if promotional content should be allowed, false otherwise. Defaults to true. | [optional]
|
|
11
|
+
**allow_web_urls** | **BOOLEAN** | Optional: True if web URLs should be allowed in the input text, false otherwise. Defaults to true. When false, input containing URLs (including homoglyph URLs and spaced-out URLs) will be flagged as not clean. | [optional]
|
|
12
|
+
**allow_phone_numbers** | **BOOLEAN** | Optional: True if phone numbers should be allowed in the input text, false otherwise. Defaults to true. When false, input containing phone numbers (including homoglyph digits and spaced-out or spelled-out workarounds) will be flagged as not clean. | [optional]
|
|
13
|
+
**allow_email_addresses** | **BOOLEAN** | Optional: True if email addresses should be allowed in the input text, false otherwise. Defaults to true. When false, input containing email addresses (including homoglyph characters and obfuscated workarounds like \"danny at somedomaine [DOT] com\") will be flagged as not clean. | [optional]
|
|
14
|
+
**provide_url_analysis** | **BOOLEAN** | Optional: True to perform deep URL analysis on any URLs detected in the text. When enabled, if the initial AI scan detects URLs, a second AI call enumerates them and each URL is individually analyzed for phishing. Defaults to true. | [optional]
|
|
8
15
|
**custom_policy_id** | **String** | Apply a Custom Policy for Phishing Enforcement by providing the ID; to create a Custom Policy, navigate to the Cloudmersive Management Portal and select Custom Policies. Requires Managed Instance or Private Cloud | [optional]
|
|
9
16
|
**provide_analysis_rationale** | **BOOLEAN** | Optional: Set to true to include an analysis rationale in the response explaining why the content was or was not flagged. Default is true. | [optional]
|
|
10
|
-
**text_type** | **String** | Optional: Type of text being analyzed. Must be one of: \"Text Message\", \"User Message\", \"Sales Lead\", \"Email Message\", \"Support Case\", \"Other\". | [optional]
|
|
11
17
|
**from_name** | **String** | Optional: Name of the sender | [optional]
|
|
12
18
|
**to_name** | **String** | Optional: Name of the recipient | [optional]
|
|
13
19
|
**from_phone_number** | **String** | Optional: Phone number of the sender | [optional]
|
|
@@ -4,8 +4,14 @@
|
|
|
4
4
|
Name | Type | Description | Notes
|
|
5
5
|
------------ | ------------- | ------------- | -------------
|
|
6
6
|
**clean_result** | **BOOLEAN** | True if the result is not phishing (clean), and false otherwise | [optional]
|
|
7
|
-
**
|
|
7
|
+
**contains_phishing** | **BOOLEAN** | True if the input text contains a phishing attempt, false otherwise | [optional]
|
|
8
|
+
**contains_unsolicited_sales** | **BOOLEAN** | True if the input text contains unsolicited sales, false otherwise | [optional]
|
|
9
|
+
**contains_promotional_content** | **BOOLEAN** | True if the input text contains promotional content, false otherwise | [optional]
|
|
10
|
+
**contains_web_urls** | **BOOLEAN** | True if the input text contains web URLs, including homoglyph URLs and spaced-out URL workarounds | [optional]
|
|
11
|
+
**contains_phone_numbers** | **BOOLEAN** | True if the input text contains phone numbers, including homoglyph digits and spaced-out or spelled-out workarounds | [optional]
|
|
12
|
+
**contains_email_addresses** | **BOOLEAN** | True if the input text contains email addresses, including homoglyph characters and obfuscated workarounds | [optional]
|
|
8
13
|
**confidence_level** | **Float** | Confidence level between 0.0 and 1.0 where values over 0.9 indicate high confidence | [optional]
|
|
9
14
|
**analysis_rationale** | **String** | Rationale for why the conclusion was formed | [optional]
|
|
15
|
+
**unsafe_urls** | [**Array<UnsafeUrlResult>**](UnsafeUrlResult.md) | URLs detected in the input text that were analyzed and found to be unsafe. Only populated when ProvideUrlAnalysis is true and URLs are detected. | [optional]
|
|
10
16
|
|
|
11
17
|
|
|
@@ -8,6 +8,7 @@ Method | HTTP request | Description
|
|
|
8
8
|
[**phishing_detect_file_advanced_post**](PhishingDetectionApi.md#phishing_detect_file_advanced_post) | **POST** /phishing/detect/file/advanced | Perform advanced AI phishing detection and classification against input text string. Analyzes input content as well as embedded URLs with AI deep learning to detect phishing, phishing and other unsafe content. Uses 25-100 API calls depending on model selected.
|
|
9
9
|
[**phishing_detect_file_post**](PhishingDetectionApi.md#phishing_detect_file_post) | **POST** /phishing/detect/file | Perform AI phishing detection and classification on an input image or document (PDF or DOCX). Analyzes input content as well as embedded URLs with AI deep learnign to detect phishing and other unsafe content. Uses 100-125 API calls depending on model selected.
|
|
10
10
|
[**phishing_detect_text_string_advanced_post**](PhishingDetectionApi.md#phishing_detect_text_string_advanced_post) | **POST** /phishing/detect/text-string/advanced | Perform advanced AI phishing detection and classification against input text string. Analyzes input content as well as embedded URLs with AI deep learnign to detect spam, phishing and other unsafe content. Uses 25-100 API calls depending on model selected.
|
|
11
|
+
[**phishing_detect_text_string_post**](PhishingDetectionApi.md#phishing_detect_text_string_post) | **POST** /phishing/detect/text-string | Perform AI phishing detection against input text string. Returns a clean/not-clean result with confidence level and optional rationale.
|
|
11
12
|
[**phishing_detect_url_advanced_post**](PhishingDetectionApi.md#phishing_detect_url_advanced_post) | **POST** /phishing/detect/url/advanced | Perform advanced AI phishing detection and classification against an input URL. Retrieves the URL content, checks for SSRF threats, and analyzes the page with AI deep learning to detect phishing and other unsafe content. Uses 100-125 API calls.
|
|
12
13
|
|
|
13
14
|
|
|
@@ -229,6 +230,59 @@ Name | Type | Description | Notes
|
|
|
229
230
|
|
|
230
231
|
|
|
231
232
|
|
|
233
|
+
# **phishing_detect_text_string_post**
|
|
234
|
+
> PhishingDetectionTextStringResponse phishing_detect_text_string_post(opts)
|
|
235
|
+
|
|
236
|
+
Perform AI phishing detection against input text string. Returns a clean/not-clean result with confidence level and optional rationale.
|
|
237
|
+
|
|
238
|
+
### Example
|
|
239
|
+
```ruby
|
|
240
|
+
# load the gem
|
|
241
|
+
require 'cloudmersive-phishing-detection-api-client'
|
|
242
|
+
# setup authorization
|
|
243
|
+
CloudmersivePhishingDetectionApiClient.configure do |config|
|
|
244
|
+
# Configure API key authorization: Apikey
|
|
245
|
+
config.api_key['Apikey'] = 'YOUR API KEY'
|
|
246
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
247
|
+
#config.api_key_prefix['Apikey'] = 'Bearer'
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
api_instance = CloudmersivePhishingDetectionApiClient::PhishingDetectionApi.new
|
|
251
|
+
|
|
252
|
+
opts = {
|
|
253
|
+
body: CloudmersivePhishingDetectionApiClient::PhishingDetectionTextStringRequest.new # PhishingDetectionTextStringRequest | Phishing detection request
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
begin
|
|
257
|
+
#Perform AI phishing detection against input text string. Returns a clean/not-clean result with confidence level and optional rationale.
|
|
258
|
+
result = api_instance.phishing_detect_text_string_post(opts)
|
|
259
|
+
p result
|
|
260
|
+
rescue CloudmersivePhishingDetectionApiClient::ApiError => e
|
|
261
|
+
puts "Exception when calling PhishingDetectionApi->phishing_detect_text_string_post: #{e}"
|
|
262
|
+
end
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Parameters
|
|
266
|
+
|
|
267
|
+
Name | Type | Description | Notes
|
|
268
|
+
------------- | ------------- | ------------- | -------------
|
|
269
|
+
**body** | [**PhishingDetectionTextStringRequest**](PhishingDetectionTextStringRequest.md)| Phishing detection request | [optional]
|
|
270
|
+
|
|
271
|
+
### Return type
|
|
272
|
+
|
|
273
|
+
[**PhishingDetectionTextStringResponse**](PhishingDetectionTextStringResponse.md)
|
|
274
|
+
|
|
275
|
+
### Authorization
|
|
276
|
+
|
|
277
|
+
[Apikey](../README.md#Apikey)
|
|
278
|
+
|
|
279
|
+
### HTTP request headers
|
|
280
|
+
|
|
281
|
+
- **Content-Type**: application/json, text/json, application/*+json
|
|
282
|
+
- **Accept**: text/plain, application/json, text/json
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
232
286
|
# **phishing_detect_url_advanced_post**
|
|
233
287
|
> PhishingDetectionUrlAdvancedResponse phishing_detect_url_advanced_post(opts)
|
|
234
288
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# CloudmersivePhishingDetectionApiClient::PhishingDetectionTextStringRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**input_string** | **String** | Input text string to detect phishing against | [optional]
|
|
7
|
+
**model** | **String** | Optional: Specify which AI model to use. Possible choices are Normal and Advanced. Default is Advanced. | [optional]
|
|
8
|
+
**provide_analysis_rationale** | **BOOLEAN** | Optional: Set to true to include an analysis rationale in the response explaining why the content was or was not flagged. Default is true. | [optional]
|
|
9
|
+
|
|
10
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# CloudmersivePhishingDetectionApiClient::PhishingDetectionTextStringResponse
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**clean_result** | **BOOLEAN** | True if the result is not phishing (clean), and false otherwise | [optional]
|
|
7
|
+
**confidence_level** | **Float** | Confidence level between 0.0 and 1.0 where values over 0.9 indicate high confidence | [optional]
|
|
8
|
+
**analysis_rationale** | **String** | Rationale for why the conclusion was formed | [optional]
|
|
9
|
+
|
|
10
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# CloudmersivePhishingDetectionApiClient::UnsafeUrlResult
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**url** | **String** | The URL that was detected and analyzed | [optional]
|
|
7
|
+
**clean_result** | **BOOLEAN** | True if the result is not phishing (clean), and false otherwise | [optional]
|
|
8
|
+
**is_ssrf_threat** | **BOOLEAN** | True if the URL is an SSRF threat | [optional]
|
|
9
|
+
**contains_phishing** | **BOOLEAN** | True if the URL contains phishing threat risks, false otherwise | [optional]
|
|
10
|
+
**contains_phishing_attempt** | **BOOLEAN** | True if the URL contains a phishing attempt, false otherwise | [optional]
|
|
11
|
+
|
|
12
|
+
|
|
@@ -222,6 +222,54 @@ module CloudmersivePhishingDetectionApiClient
|
|
|
222
222
|
end
|
|
223
223
|
return data, status_code, headers
|
|
224
224
|
end
|
|
225
|
+
# Perform AI phishing detection against input text string. Returns a clean/not-clean result with confidence level and optional rationale.
|
|
226
|
+
# @param [Hash] opts the optional parameters
|
|
227
|
+
# @option opts [PhishingDetectionTextStringRequest] :body Phishing detection request
|
|
228
|
+
# @return [PhishingDetectionTextStringResponse]
|
|
229
|
+
def phishing_detect_text_string_post(opts = {})
|
|
230
|
+
data, _status_code, _headers = phishing_detect_text_string_post_with_http_info(opts)
|
|
231
|
+
data
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Perform AI phishing detection against input text string. Returns a clean/not-clean result with confidence level and optional rationale.
|
|
235
|
+
# @param [Hash] opts the optional parameters
|
|
236
|
+
# @option opts [PhishingDetectionTextStringRequest] :body Phishing detection request
|
|
237
|
+
# @return [Array<(PhishingDetectionTextStringResponse, Fixnum, Hash)>] PhishingDetectionTextStringResponse data, response status code and response headers
|
|
238
|
+
def phishing_detect_text_string_post_with_http_info(opts = {})
|
|
239
|
+
if @api_client.config.debugging
|
|
240
|
+
@api_client.config.logger.debug 'Calling API: PhishingDetectionApi.phishing_detect_text_string_post ...'
|
|
241
|
+
end
|
|
242
|
+
# resource path
|
|
243
|
+
local_var_path = '/phishing/detect/text-string'
|
|
244
|
+
|
|
245
|
+
# query parameters
|
|
246
|
+
query_params = {}
|
|
247
|
+
|
|
248
|
+
# header parameters
|
|
249
|
+
header_params = {}
|
|
250
|
+
# HTTP header 'Accept' (if needed)
|
|
251
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])
|
|
252
|
+
# HTTP header 'Content-Type'
|
|
253
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/*+json'])
|
|
254
|
+
|
|
255
|
+
# form parameters
|
|
256
|
+
form_params = {}
|
|
257
|
+
|
|
258
|
+
# http body (model)
|
|
259
|
+
post_body = @api_client.object_to_http_body(opts[:'body'])
|
|
260
|
+
auth_names = ['Apikey']
|
|
261
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
262
|
+
:header_params => header_params,
|
|
263
|
+
:query_params => query_params,
|
|
264
|
+
:form_params => form_params,
|
|
265
|
+
:body => post_body,
|
|
266
|
+
:auth_names => auth_names,
|
|
267
|
+
:return_type => 'PhishingDetectionTextStringResponse')
|
|
268
|
+
if @api_client.config.debugging
|
|
269
|
+
@api_client.config.logger.debug "API called: PhishingDetectionApi#phishing_detect_text_string_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
270
|
+
end
|
|
271
|
+
return data, status_code, headers
|
|
272
|
+
end
|
|
225
273
|
# Perform advanced AI phishing detection and classification against an input URL. Retrieves the URL content, checks for SSRF threats, and analyzes the page with AI deep learning to detect phishing and other unsafe content. Uses 100-125 API calls.
|
|
226
274
|
# @param [Hash] opts the optional parameters
|
|
227
275
|
# @option opts [AdvancedUrlDetectionRequest] :body URL phishing detection request
|
data/lib/cloudmersive-phishing-detection-api-client/models/phishing_detection_advanced_request.rb
CHANGED
|
@@ -18,18 +18,36 @@ module CloudmersivePhishingDetectionApiClient
|
|
|
18
18
|
# Input text string to detect phishing against
|
|
19
19
|
attr_accessor :input_string
|
|
20
20
|
|
|
21
|
+
# Optional: Type of text being analyzed. Must be one of: \"TextMessage\", \"UserMessage\", \"SalesLead\", \"EmailMessage\", \"SupportCase\", \"AppMessage\", \"Other\".
|
|
22
|
+
attr_accessor :text_type
|
|
23
|
+
|
|
21
24
|
# Optional: Specify which AI model to use. Possible choices are Normal and Advanced. Default is Advanced.
|
|
22
25
|
attr_accessor :model
|
|
23
26
|
|
|
27
|
+
# Optional: True if unsolicited sales should be allowed, false otherwise. Defaults to true.
|
|
28
|
+
attr_accessor :allow_unsolicited_sales
|
|
29
|
+
|
|
30
|
+
# Optional: True if promotional content should be allowed, false otherwise. Defaults to true.
|
|
31
|
+
attr_accessor :allow_promotional_content
|
|
32
|
+
|
|
33
|
+
# Optional: True if web URLs should be allowed in the input text, false otherwise. Defaults to true. When false, input containing URLs (including homoglyph URLs and spaced-out URLs) will be flagged as not clean.
|
|
34
|
+
attr_accessor :allow_web_urls
|
|
35
|
+
|
|
36
|
+
# Optional: True if phone numbers should be allowed in the input text, false otherwise. Defaults to true. When false, input containing phone numbers (including homoglyph digits and spaced-out or spelled-out workarounds) will be flagged as not clean.
|
|
37
|
+
attr_accessor :allow_phone_numbers
|
|
38
|
+
|
|
39
|
+
# Optional: True if email addresses should be allowed in the input text, false otherwise. Defaults to true. When false, input containing email addresses (including homoglyph characters and obfuscated workarounds like \"danny at somedomaine [DOT] com\") will be flagged as not clean.
|
|
40
|
+
attr_accessor :allow_email_addresses
|
|
41
|
+
|
|
42
|
+
# Optional: True to perform deep URL analysis on any URLs detected in the text. When enabled, if the initial AI scan detects URLs, a second AI call enumerates them and each URL is individually analyzed for phishing. Defaults to true.
|
|
43
|
+
attr_accessor :provide_url_analysis
|
|
44
|
+
|
|
24
45
|
# Apply a Custom Policy for Phishing Enforcement by providing the ID; to create a Custom Policy, navigate to the Cloudmersive Management Portal and select Custom Policies. Requires Managed Instance or Private Cloud
|
|
25
46
|
attr_accessor :custom_policy_id
|
|
26
47
|
|
|
27
48
|
# Optional: Set to true to include an analysis rationale in the response explaining why the content was or was not flagged. Default is true.
|
|
28
49
|
attr_accessor :provide_analysis_rationale
|
|
29
50
|
|
|
30
|
-
# Optional: Type of text being analyzed. Must be one of: \"Text Message\", \"User Message\", \"Sales Lead\", \"Email Message\", \"Support Case\", \"Other\".
|
|
31
|
-
attr_accessor :text_type
|
|
32
|
-
|
|
33
51
|
# Optional: Name of the sender
|
|
34
52
|
attr_accessor :from_name
|
|
35
53
|
|
|
@@ -52,10 +70,16 @@ module CloudmersivePhishingDetectionApiClient
|
|
|
52
70
|
def self.attribute_map
|
|
53
71
|
{
|
|
54
72
|
:'input_string' => :'InputString',
|
|
73
|
+
:'text_type' => :'TextType',
|
|
55
74
|
:'model' => :'Model',
|
|
75
|
+
:'allow_unsolicited_sales' => :'AllowUnsolicitedSales',
|
|
76
|
+
:'allow_promotional_content' => :'AllowPromotionalContent',
|
|
77
|
+
:'allow_web_urls' => :'AllowWebUrls',
|
|
78
|
+
:'allow_phone_numbers' => :'AllowPhoneNumbers',
|
|
79
|
+
:'allow_email_addresses' => :'AllowEmailAddresses',
|
|
80
|
+
:'provide_url_analysis' => :'ProvideUrlAnalysis',
|
|
56
81
|
:'custom_policy_id' => :'CustomPolicyID',
|
|
57
82
|
:'provide_analysis_rationale' => :'ProvideAnalysisRationale',
|
|
58
|
-
:'text_type' => :'TextType',
|
|
59
83
|
:'from_name' => :'FromName',
|
|
60
84
|
:'to_name' => :'ToName',
|
|
61
85
|
:'from_phone_number' => :'FromPhoneNumber',
|
|
@@ -69,10 +93,16 @@ module CloudmersivePhishingDetectionApiClient
|
|
|
69
93
|
def self.swagger_types
|
|
70
94
|
{
|
|
71
95
|
:'input_string' => :'String',
|
|
96
|
+
:'text_type' => :'String',
|
|
72
97
|
:'model' => :'String',
|
|
98
|
+
:'allow_unsolicited_sales' => :'BOOLEAN',
|
|
99
|
+
:'allow_promotional_content' => :'BOOLEAN',
|
|
100
|
+
:'allow_web_urls' => :'BOOLEAN',
|
|
101
|
+
:'allow_phone_numbers' => :'BOOLEAN',
|
|
102
|
+
:'allow_email_addresses' => :'BOOLEAN',
|
|
103
|
+
:'provide_url_analysis' => :'BOOLEAN',
|
|
73
104
|
:'custom_policy_id' => :'String',
|
|
74
105
|
:'provide_analysis_rationale' => :'BOOLEAN',
|
|
75
|
-
:'text_type' => :'String',
|
|
76
106
|
:'from_name' => :'String',
|
|
77
107
|
:'to_name' => :'String',
|
|
78
108
|
:'from_phone_number' => :'String',
|
|
@@ -94,10 +124,38 @@ module CloudmersivePhishingDetectionApiClient
|
|
|
94
124
|
self.input_string = attributes[:'InputString']
|
|
95
125
|
end
|
|
96
126
|
|
|
127
|
+
if attributes.has_key?(:'TextType')
|
|
128
|
+
self.text_type = attributes[:'TextType']
|
|
129
|
+
end
|
|
130
|
+
|
|
97
131
|
if attributes.has_key?(:'Model')
|
|
98
132
|
self.model = attributes[:'Model']
|
|
99
133
|
end
|
|
100
134
|
|
|
135
|
+
if attributes.has_key?(:'AllowUnsolicitedSales')
|
|
136
|
+
self.allow_unsolicited_sales = attributes[:'AllowUnsolicitedSales']
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if attributes.has_key?(:'AllowPromotionalContent')
|
|
140
|
+
self.allow_promotional_content = attributes[:'AllowPromotionalContent']
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if attributes.has_key?(:'AllowWebUrls')
|
|
144
|
+
self.allow_web_urls = attributes[:'AllowWebUrls']
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.has_key?(:'AllowPhoneNumbers')
|
|
148
|
+
self.allow_phone_numbers = attributes[:'AllowPhoneNumbers']
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if attributes.has_key?(:'AllowEmailAddresses')
|
|
152
|
+
self.allow_email_addresses = attributes[:'AllowEmailAddresses']
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if attributes.has_key?(:'ProvideUrlAnalysis')
|
|
156
|
+
self.provide_url_analysis = attributes[:'ProvideUrlAnalysis']
|
|
157
|
+
end
|
|
158
|
+
|
|
101
159
|
if attributes.has_key?(:'CustomPolicyID')
|
|
102
160
|
self.custom_policy_id = attributes[:'CustomPolicyID']
|
|
103
161
|
end
|
|
@@ -106,10 +164,6 @@ module CloudmersivePhishingDetectionApiClient
|
|
|
106
164
|
self.provide_analysis_rationale = attributes[:'ProvideAnalysisRationale']
|
|
107
165
|
end
|
|
108
166
|
|
|
109
|
-
if attributes.has_key?(:'TextType')
|
|
110
|
-
self.text_type = attributes[:'TextType']
|
|
111
|
-
end
|
|
112
|
-
|
|
113
167
|
if attributes.has_key?(:'FromName')
|
|
114
168
|
self.from_name = attributes[:'FromName']
|
|
115
169
|
end
|
|
@@ -154,10 +208,16 @@ module CloudmersivePhishingDetectionApiClient
|
|
|
154
208
|
return true if self.equal?(o)
|
|
155
209
|
self.class == o.class &&
|
|
156
210
|
input_string == o.input_string &&
|
|
211
|
+
text_type == o.text_type &&
|
|
157
212
|
model == o.model &&
|
|
213
|
+
allow_unsolicited_sales == o.allow_unsolicited_sales &&
|
|
214
|
+
allow_promotional_content == o.allow_promotional_content &&
|
|
215
|
+
allow_web_urls == o.allow_web_urls &&
|
|
216
|
+
allow_phone_numbers == o.allow_phone_numbers &&
|
|
217
|
+
allow_email_addresses == o.allow_email_addresses &&
|
|
218
|
+
provide_url_analysis == o.provide_url_analysis &&
|
|
158
219
|
custom_policy_id == o.custom_policy_id &&
|
|
159
220
|
provide_analysis_rationale == o.provide_analysis_rationale &&
|
|
160
|
-
text_type == o.text_type &&
|
|
161
221
|
from_name == o.from_name &&
|
|
162
222
|
to_name == o.to_name &&
|
|
163
223
|
from_phone_number == o.from_phone_number &&
|
|
@@ -175,7 +235,7 @@ module CloudmersivePhishingDetectionApiClient
|
|
|
175
235
|
# Calculates hash code according to all attributes.
|
|
176
236
|
# @return [Fixnum] Hash code
|
|
177
237
|
def hash
|
|
178
|
-
[input_string, model, custom_policy_id, provide_analysis_rationale,
|
|
238
|
+
[input_string, text_type, model, allow_unsolicited_sales, allow_promotional_content, allow_web_urls, allow_phone_numbers, allow_email_addresses, provide_url_analysis, custom_policy_id, provide_analysis_rationale, from_name, to_name, from_phone_number, to_phone_number, from_email_address, to_email_address].hash
|
|
179
239
|
end
|
|
180
240
|
|
|
181
241
|
# Builds the object from hash
|
data/lib/cloudmersive-phishing-detection-api-client/models/phishing_detection_advanced_response.rb
CHANGED
|
@@ -18,8 +18,23 @@ module CloudmersivePhishingDetectionApiClient
|
|
|
18
18
|
# True if the result is not phishing (clean), and false otherwise
|
|
19
19
|
attr_accessor :clean_result
|
|
20
20
|
|
|
21
|
-
#
|
|
22
|
-
attr_accessor :
|
|
21
|
+
# True if the input text contains a phishing attempt, false otherwise
|
|
22
|
+
attr_accessor :contains_phishing
|
|
23
|
+
|
|
24
|
+
# True if the input text contains unsolicited sales, false otherwise
|
|
25
|
+
attr_accessor :contains_unsolicited_sales
|
|
26
|
+
|
|
27
|
+
# True if the input text contains promotional content, false otherwise
|
|
28
|
+
attr_accessor :contains_promotional_content
|
|
29
|
+
|
|
30
|
+
# True if the input text contains web URLs, including homoglyph URLs and spaced-out URL workarounds
|
|
31
|
+
attr_accessor :contains_web_urls
|
|
32
|
+
|
|
33
|
+
# True if the input text contains phone numbers, including homoglyph digits and spaced-out or spelled-out workarounds
|
|
34
|
+
attr_accessor :contains_phone_numbers
|
|
35
|
+
|
|
36
|
+
# True if the input text contains email addresses, including homoglyph characters and obfuscated workarounds
|
|
37
|
+
attr_accessor :contains_email_addresses
|
|
23
38
|
|
|
24
39
|
# Confidence level between 0.0 and 1.0 where values over 0.9 indicate high confidence
|
|
25
40
|
attr_accessor :confidence_level
|
|
@@ -27,13 +42,22 @@ module CloudmersivePhishingDetectionApiClient
|
|
|
27
42
|
# Rationale for why the conclusion was formed
|
|
28
43
|
attr_accessor :analysis_rationale
|
|
29
44
|
|
|
45
|
+
# URLs detected in the input text that were analyzed and found to be unsafe. Only populated when ProvideUrlAnalysis is true and URLs are detected.
|
|
46
|
+
attr_accessor :unsafe_urls
|
|
47
|
+
|
|
30
48
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
49
|
def self.attribute_map
|
|
32
50
|
{
|
|
33
51
|
:'clean_result' => :'CleanResult',
|
|
34
|
-
:'
|
|
52
|
+
:'contains_phishing' => :'ContainsPhishing',
|
|
53
|
+
:'contains_unsolicited_sales' => :'ContainsUnsolicitedSales',
|
|
54
|
+
:'contains_promotional_content' => :'ContainsPromotionalContent',
|
|
55
|
+
:'contains_web_urls' => :'ContainsWebUrls',
|
|
56
|
+
:'contains_phone_numbers' => :'ContainsPhoneNumbers',
|
|
57
|
+
:'contains_email_addresses' => :'ContainsEmailAddresses',
|
|
35
58
|
:'confidence_level' => :'ConfidenceLevel',
|
|
36
|
-
:'analysis_rationale' => :'AnalysisRationale'
|
|
59
|
+
:'analysis_rationale' => :'AnalysisRationale',
|
|
60
|
+
:'unsafe_urls' => :'UnsafeUrls'
|
|
37
61
|
}
|
|
38
62
|
end
|
|
39
63
|
|
|
@@ -41,9 +65,15 @@ module CloudmersivePhishingDetectionApiClient
|
|
|
41
65
|
def self.swagger_types
|
|
42
66
|
{
|
|
43
67
|
:'clean_result' => :'BOOLEAN',
|
|
44
|
-
:'
|
|
68
|
+
:'contains_phishing' => :'BOOLEAN',
|
|
69
|
+
:'contains_unsolicited_sales' => :'BOOLEAN',
|
|
70
|
+
:'contains_promotional_content' => :'BOOLEAN',
|
|
71
|
+
:'contains_web_urls' => :'BOOLEAN',
|
|
72
|
+
:'contains_phone_numbers' => :'BOOLEAN',
|
|
73
|
+
:'contains_email_addresses' => :'BOOLEAN',
|
|
45
74
|
:'confidence_level' => :'Float',
|
|
46
|
-
:'analysis_rationale' => :'String'
|
|
75
|
+
:'analysis_rationale' => :'String',
|
|
76
|
+
:'unsafe_urls' => :'Array<UnsafeUrlResult>'
|
|
47
77
|
}
|
|
48
78
|
end
|
|
49
79
|
|
|
@@ -59,8 +89,28 @@ module CloudmersivePhishingDetectionApiClient
|
|
|
59
89
|
self.clean_result = attributes[:'CleanResult']
|
|
60
90
|
end
|
|
61
91
|
|
|
62
|
-
if attributes.has_key?(:'
|
|
63
|
-
self.
|
|
92
|
+
if attributes.has_key?(:'ContainsPhishing')
|
|
93
|
+
self.contains_phishing = attributes[:'ContainsPhishing']
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.has_key?(:'ContainsUnsolicitedSales')
|
|
97
|
+
self.contains_unsolicited_sales = attributes[:'ContainsUnsolicitedSales']
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.has_key?(:'ContainsPromotionalContent')
|
|
101
|
+
self.contains_promotional_content = attributes[:'ContainsPromotionalContent']
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.has_key?(:'ContainsWebUrls')
|
|
105
|
+
self.contains_web_urls = attributes[:'ContainsWebUrls']
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.has_key?(:'ContainsPhoneNumbers')
|
|
109
|
+
self.contains_phone_numbers = attributes[:'ContainsPhoneNumbers']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.has_key?(:'ContainsEmailAddresses')
|
|
113
|
+
self.contains_email_addresses = attributes[:'ContainsEmailAddresses']
|
|
64
114
|
end
|
|
65
115
|
|
|
66
116
|
if attributes.has_key?(:'ConfidenceLevel')
|
|
@@ -70,6 +120,12 @@ module CloudmersivePhishingDetectionApiClient
|
|
|
70
120
|
if attributes.has_key?(:'AnalysisRationale')
|
|
71
121
|
self.analysis_rationale = attributes[:'AnalysisRationale']
|
|
72
122
|
end
|
|
123
|
+
|
|
124
|
+
if attributes.has_key?(:'UnsafeUrls')
|
|
125
|
+
if (value = attributes[:'UnsafeUrls']).is_a?(Array)
|
|
126
|
+
self.unsafe_urls = value
|
|
127
|
+
end
|
|
128
|
+
end
|
|
73
129
|
end
|
|
74
130
|
|
|
75
131
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -91,9 +147,15 @@ module CloudmersivePhishingDetectionApiClient
|
|
|
91
147
|
return true if self.equal?(o)
|
|
92
148
|
self.class == o.class &&
|
|
93
149
|
clean_result == o.clean_result &&
|
|
94
|
-
|
|
150
|
+
contains_phishing == o.contains_phishing &&
|
|
151
|
+
contains_unsolicited_sales == o.contains_unsolicited_sales &&
|
|
152
|
+
contains_promotional_content == o.contains_promotional_content &&
|
|
153
|
+
contains_web_urls == o.contains_web_urls &&
|
|
154
|
+
contains_phone_numbers == o.contains_phone_numbers &&
|
|
155
|
+
contains_email_addresses == o.contains_email_addresses &&
|
|
95
156
|
confidence_level == o.confidence_level &&
|
|
96
|
-
analysis_rationale == o.analysis_rationale
|
|
157
|
+
analysis_rationale == o.analysis_rationale &&
|
|
158
|
+
unsafe_urls == o.unsafe_urls
|
|
97
159
|
end
|
|
98
160
|
|
|
99
161
|
# @see the `==` method
|
|
@@ -105,7 +167,7 @@ module CloudmersivePhishingDetectionApiClient
|
|
|
105
167
|
# Calculates hash code according to all attributes.
|
|
106
168
|
# @return [Fixnum] Hash code
|
|
107
169
|
def hash
|
|
108
|
-
[clean_result,
|
|
170
|
+
[clean_result, contains_phishing, contains_unsolicited_sales, contains_promotional_content, contains_web_urls, contains_phone_numbers, contains_email_addresses, confidence_level, analysis_rationale, unsafe_urls].hash
|
|
109
171
|
end
|
|
110
172
|
|
|
111
173
|
# Builds the object from hash
|