cloudmersive-spam-detection-api-client 2.3.0 → 2.4.0
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 +19 -8
- data/cloudmersive-spam-detection-api-client.gemspec +1 -1
- data/docs/SpamDetectionAdvancedFormField.md +9 -0
- data/docs/SpamDetectionAdvancedFormSubmissionRequest.md +11 -0
- data/docs/SpamDetectionAdvancedResponse.md +2 -0
- data/docs/SpamDetectionApi.md +174 -0
- data/docs/SpamDetectionFormSubmissionAdvancedResponse.md +14 -0
- data/lib/cloudmersive-spam-detection-api-client/api/spam_detection_api.rb +165 -1
- data/lib/cloudmersive-spam-detection-api-client/api_client.rb +1 -1
- data/lib/cloudmersive-spam-detection-api-client/api_error.rb +1 -1
- data/lib/cloudmersive-spam-detection-api-client/configuration.rb +1 -1
- data/lib/cloudmersive-spam-detection-api-client/models/spam_detection_advanced_form_field.rb +196 -0
- data/lib/cloudmersive-spam-detection-api-client/models/spam_detection_advanced_form_submission_request.rb +218 -0
- data/lib/cloudmersive-spam-detection-api-client/models/spam_detection_advanced_request.rb +1 -1
- data/lib/cloudmersive-spam-detection-api-client/models/spam_detection_advanced_response.rb +25 -5
- data/lib/cloudmersive-spam-detection-api-client/models/spam_detection_form_submission_advanced_response.rb +246 -0
- data/lib/cloudmersive-spam-detection-api-client/models/spam_detection_request.rb +1 -1
- data/lib/cloudmersive-spam-detection-api-client/models/spam_detection_response.rb +1 -1
- data/lib/cloudmersive-spam-detection-api-client/version.rb +2 -2
- data/lib/cloudmersive-spam-detection-api-client.rb +4 -1
- data/spec/api/spam_detection_api_spec.rb +40 -1
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/spam_detection_advanced_form_field_spec.rb +47 -0
- data/spec/models/spam_detection_advanced_form_submission_request_spec.rb +59 -0
- data/spec/models/spam_detection_advanced_request_spec.rb +1 -1
- data/spec/models/spam_detection_advanced_response_spec.rb +13 -1
- data/spec/models/spam_detection_form_submission_advanced_response_spec.rb +77 -0
- data/spec/models/spam_detection_request_spec.rb +1 -1
- data/spec/models/spam_detection_response_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- 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: 764b7e5ec5157619d0c2c7e28a8b96b1d09c771b20109c4f577f7c647783dd07
|
|
4
|
+
data.tar.gz: 2a388acaf096073bfccf08cc4c332f0888dc2bc1c9446197df8e3ddb6d1a25c9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bf49d64f15a66c8b642ccbf0e79ff2932c9860e5885e4c02cead82989bd2b6737ec14d352c43b1d02169f1507b3a8f1912bf299dc7597f9208e2b8a77972444a
|
|
7
|
+
data.tar.gz: 3afbafdeb1ffdb45e6ea5f006726ae2012c90a00327f38494ba4cd7f68c7d1dec11ed6317666704b8c7235aa65bd8675d6939cd13871e438f2ebcb4bf753d968
|
data/README.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
CloudmersiveSpamDetectionApiClient - the Ruby gem for the spamapi
|
|
4
4
|
|
|
5
|
-
Easily and directly scan and block
|
|
5
|
+
Easily and directly scan and block spam security threats in input.
|
|
6
6
|
|
|
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.
|
|
10
|
+
- Package version: 2.4.0
|
|
11
11
|
- Build package: io.swagger.codegen.languages.RubyClientCodegen
|
|
12
12
|
|
|
13
13
|
## Installation
|
|
@@ -23,15 +23,15 @@ gem build cloudmersive-spam-detection-api-client.gemspec
|
|
|
23
23
|
Then either install the gem locally:
|
|
24
24
|
|
|
25
25
|
```shell
|
|
26
|
-
gem install ./cloudmersive-spam-detection-api-client-2.
|
|
26
|
+
gem install ./cloudmersive-spam-detection-api-client-2.4.0.gem
|
|
27
27
|
```
|
|
28
|
-
(for development, run `gem install --dev ./cloudmersive-spam-detection-api-client-2.
|
|
28
|
+
(for development, run `gem install --dev ./cloudmersive-spam-detection-api-client-2.4.0.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-spam-detection-api-client', '~> 2.
|
|
34
|
+
gem 'cloudmersive-spam-detection-api-client', '~> 2.4.0'
|
|
35
35
|
|
|
36
36
|
### Install from Git
|
|
37
37
|
|
|
@@ -65,15 +65,20 @@ end
|
|
|
65
65
|
api_instance = CloudmersiveSpamDetectionApiClient::SpamDetectionApi.new
|
|
66
66
|
|
|
67
67
|
opts = {
|
|
68
|
-
|
|
68
|
+
model: 'Advanced', # String | Optional: Specify which AI model to use. Possible choices are Normal and Advanced. Default is Advanced.
|
|
69
|
+
preprocessing: 'Auto', # String | Optional: Specify which preprocessing to Use. Possible choices are None, Compatability and Auto. Default is Auto.
|
|
70
|
+
allow_phishing: false, # BOOLEAN | True if phishing should be allowed, false otherwise
|
|
71
|
+
allow_unsolicited_sales: false, # BOOLEAN | True if unsolicited sales should be allowed, false otherwise
|
|
72
|
+
allow_promotional_content: true, # BOOLEAN | True if promotional content should be allowed, false otherwise
|
|
73
|
+
input_file: File.new('/path/to/file.txt') # File |
|
|
69
74
|
}
|
|
70
75
|
|
|
71
76
|
begin
|
|
72
77
|
#Perform advanced AI spam 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.
|
|
73
|
-
result = api_instance.
|
|
78
|
+
result = api_instance.spam_detect_file_advanced_post(opts)
|
|
74
79
|
p result
|
|
75
80
|
rescue CloudmersiveSpamDetectionApiClient::ApiError => e
|
|
76
|
-
puts "Exception when calling SpamDetectionApi->
|
|
81
|
+
puts "Exception when calling SpamDetectionApi->spam_detect_file_advanced_post: #{e}"
|
|
77
82
|
end
|
|
78
83
|
|
|
79
84
|
```
|
|
@@ -84,14 +89,20 @@ All URIs are relative to *https://localhost*
|
|
|
84
89
|
|
|
85
90
|
Class | Method | HTTP request | Description
|
|
86
91
|
------------ | ------------- | ------------- | -------------
|
|
92
|
+
*CloudmersiveSpamDetectionApiClient::SpamDetectionApi* | [**spam_detect_file_advanced_post**](docs/SpamDetectionApi.md#spam_detect_file_advanced_post) | **POST** /spam/detect/file/advanced | Perform advanced AI spam 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.
|
|
93
|
+
*CloudmersiveSpamDetectionApiClient::SpamDetectionApi* | [**spam_detect_file_post**](docs/SpamDetectionApi.md#spam_detect_file_post) | **POST** /spam/detect/file | Perform AI spam 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 spam, phishing and other unsafe content. Uses 100-125 API calls depending on model selected.
|
|
94
|
+
*CloudmersiveSpamDetectionApiClient::SpamDetectionApi* | [**spam_detect_form_submission_advanced_post**](docs/SpamDetectionApi.md#spam_detect_form_submission_advanced_post) | **POST** /spam/detect/form-submission/advanced | Perform advanced AI spam detection and classification against a form submission. Analyzes form 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.
|
|
87
95
|
*CloudmersiveSpamDetectionApiClient::SpamDetectionApi* | [**spam_detect_text_string_advanced_post**](docs/SpamDetectionApi.md#spam_detect_text_string_advanced_post) | **POST** /spam/detect/text-string/advanced | Perform advanced AI spam 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.
|
|
88
96
|
*CloudmersiveSpamDetectionApiClient::SpamDetectionApi* | [**spam_detect_text_string_post**](docs/SpamDetectionApi.md#spam_detect_text_string_post) | **POST** /spam/detect/text-string | Perform AI spam 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-75 API calls depending on model selected.
|
|
89
97
|
|
|
90
98
|
|
|
91
99
|
## Documentation for Models
|
|
92
100
|
|
|
101
|
+
- [CloudmersiveSpamDetectionApiClient::SpamDetectionAdvancedFormField](docs/SpamDetectionAdvancedFormField.md)
|
|
102
|
+
- [CloudmersiveSpamDetectionApiClient::SpamDetectionAdvancedFormSubmissionRequest](docs/SpamDetectionAdvancedFormSubmissionRequest.md)
|
|
93
103
|
- [CloudmersiveSpamDetectionApiClient::SpamDetectionAdvancedRequest](docs/SpamDetectionAdvancedRequest.md)
|
|
94
104
|
- [CloudmersiveSpamDetectionApiClient::SpamDetectionAdvancedResponse](docs/SpamDetectionAdvancedResponse.md)
|
|
105
|
+
- [CloudmersiveSpamDetectionApiClient::SpamDetectionFormSubmissionAdvancedResponse](docs/SpamDetectionFormSubmissionAdvancedResponse.md)
|
|
95
106
|
- [CloudmersiveSpamDetectionApiClient::SpamDetectionRequest](docs/SpamDetectionRequest.md)
|
|
96
107
|
- [CloudmersiveSpamDetectionApiClient::SpamDetectionResponse](docs/SpamDetectionResponse.md)
|
|
97
108
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# CloudmersiveSpamDetectionApiClient::SpamDetectionAdvancedFormField
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**field_title** | **String** | Title of the field | [optional]
|
|
7
|
+
**field_value** | **String** | Value of the field | [optional]
|
|
8
|
+
|
|
9
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# CloudmersiveSpamDetectionApiClient::SpamDetectionAdvancedFormSubmissionRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**input_form_fields** | [**Array<SpamDetectionAdvancedFormField>**](SpamDetectionAdvancedFormField.md) | Form fields and values that you received in your form submission | [optional]
|
|
7
|
+
**allow_unsolicited_sales** | **BOOLEAN** | True if unsolicited sales should be allowed, false otherwise | [optional]
|
|
8
|
+
**allow_promotional_content** | **BOOLEAN** | True if promotional content should be allowed, false otherwise | [optional]
|
|
9
|
+
**allow_phishing** | **BOOLEAN** | True if phishing should be allowed, false otherwise | [optional]
|
|
10
|
+
|
|
11
|
+
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
Name | Type | Description | Notes
|
|
5
5
|
------------ | ------------- | ------------- | -------------
|
|
6
6
|
**clean_result** | **BOOLEAN** | True if the result is not spam (clean), and false otherwise | [optional]
|
|
7
|
+
**spam_risk_level** | **Float** | Overall spam risk level between 0.0 and 1.0 | [optional]
|
|
7
8
|
**contains_spam** | **BOOLEAN** | True if the input text contains spam, false otherwise | [optional]
|
|
8
9
|
**contains_unsolicited_sales** | **BOOLEAN** | True if the input text contains unsolicited sales, false otherwise | [optional]
|
|
9
10
|
**contains_promotional_content** | **BOOLEAN** | True if the input text contains promotional content, false otherwise | [optional]
|
|
10
11
|
**contains_phishing_attempt** | **BOOLEAN** | True if the input text contains a phishing attempt, false otherwise | [optional]
|
|
12
|
+
**analysis_rationale** | **String** | Rationale for why the conclusion was formed | [optional]
|
|
11
13
|
|
|
12
14
|
|
data/docs/SpamDetectionApi.md
CHANGED
|
@@ -4,10 +4,184 @@ All URIs are relative to *https://localhost*
|
|
|
4
4
|
|
|
5
5
|
Method | HTTP request | Description
|
|
6
6
|
------------- | ------------- | -------------
|
|
7
|
+
[**spam_detect_file_advanced_post**](SpamDetectionApi.md#spam_detect_file_advanced_post) | **POST** /spam/detect/file/advanced | Perform advanced AI spam 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.
|
|
8
|
+
[**spam_detect_file_post**](SpamDetectionApi.md#spam_detect_file_post) | **POST** /spam/detect/file | Perform AI spam 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 spam, phishing and other unsafe content. Uses 100-125 API calls depending on model selected.
|
|
9
|
+
[**spam_detect_form_submission_advanced_post**](SpamDetectionApi.md#spam_detect_form_submission_advanced_post) | **POST** /spam/detect/form-submission/advanced | Perform advanced AI spam detection and classification against a form submission. Analyzes form 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.
|
|
7
10
|
[**spam_detect_text_string_advanced_post**](SpamDetectionApi.md#spam_detect_text_string_advanced_post) | **POST** /spam/detect/text-string/advanced | Perform advanced AI spam 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.
|
|
8
11
|
[**spam_detect_text_string_post**](SpamDetectionApi.md#spam_detect_text_string_post) | **POST** /spam/detect/text-string | Perform AI spam 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-75 API calls depending on model selected.
|
|
9
12
|
|
|
10
13
|
|
|
14
|
+
# **spam_detect_file_advanced_post**
|
|
15
|
+
> SpamDetectionAdvancedResponse spam_detect_file_advanced_post(opts)
|
|
16
|
+
|
|
17
|
+
Perform advanced AI spam 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.
|
|
18
|
+
|
|
19
|
+
### Example
|
|
20
|
+
```ruby
|
|
21
|
+
# load the gem
|
|
22
|
+
require 'cloudmersive-spam-detection-api-client'
|
|
23
|
+
# setup authorization
|
|
24
|
+
CloudmersiveSpamDetectionApiClient.configure do |config|
|
|
25
|
+
# Configure API key authorization: Apikey
|
|
26
|
+
config.api_key['Apikey'] = 'YOUR API KEY'
|
|
27
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
28
|
+
#config.api_key_prefix['Apikey'] = 'Bearer'
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
api_instance = CloudmersiveSpamDetectionApiClient::SpamDetectionApi.new
|
|
32
|
+
|
|
33
|
+
opts = {
|
|
34
|
+
model: 'Advanced', # String | Optional: Specify which AI model to use. Possible choices are Normal and Advanced. Default is Advanced.
|
|
35
|
+
preprocessing: 'Auto', # String | Optional: Specify which preprocessing to Use. Possible choices are None, Compatability and Auto. Default is Auto.
|
|
36
|
+
allow_phishing: false, # BOOLEAN | True if phishing should be allowed, false otherwise
|
|
37
|
+
allow_unsolicited_sales: false, # BOOLEAN | True if unsolicited sales should be allowed, false otherwise
|
|
38
|
+
allow_promotional_content: true, # BOOLEAN | True if promotional content should be allowed, false otherwise
|
|
39
|
+
input_file: File.new('/path/to/file.txt') # File |
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
begin
|
|
43
|
+
#Perform advanced AI spam 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.
|
|
44
|
+
result = api_instance.spam_detect_file_advanced_post(opts)
|
|
45
|
+
p result
|
|
46
|
+
rescue CloudmersiveSpamDetectionApiClient::ApiError => e
|
|
47
|
+
puts "Exception when calling SpamDetectionApi->spam_detect_file_advanced_post: #{e}"
|
|
48
|
+
end
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Parameters
|
|
52
|
+
|
|
53
|
+
Name | Type | Description | Notes
|
|
54
|
+
------------- | ------------- | ------------- | -------------
|
|
55
|
+
**model** | **String**| Optional: Specify which AI model to use. Possible choices are Normal and Advanced. Default is Advanced. | [optional] [default to Advanced]
|
|
56
|
+
**preprocessing** | **String**| Optional: Specify which preprocessing to Use. Possible choices are None, Compatability and Auto. Default is Auto. | [optional] [default to Auto]
|
|
57
|
+
**allow_phishing** | **BOOLEAN**| True if phishing should be allowed, false otherwise | [optional] [default to false]
|
|
58
|
+
**allow_unsolicited_sales** | **BOOLEAN**| True if unsolicited sales should be allowed, false otherwise | [optional] [default to false]
|
|
59
|
+
**allow_promotional_content** | **BOOLEAN**| True if promotional content should be allowed, false otherwise | [optional] [default to true]
|
|
60
|
+
**input_file** | **File**| | [optional]
|
|
61
|
+
|
|
62
|
+
### Return type
|
|
63
|
+
|
|
64
|
+
[**SpamDetectionAdvancedResponse**](SpamDetectionAdvancedResponse.md)
|
|
65
|
+
|
|
66
|
+
### Authorization
|
|
67
|
+
|
|
68
|
+
[Apikey](../README.md#Apikey)
|
|
69
|
+
|
|
70
|
+
### HTTP request headers
|
|
71
|
+
|
|
72
|
+
- **Content-Type**: multipart/form-data
|
|
73
|
+
- **Accept**: text/plain, application/json, text/json
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
# **spam_detect_file_post**
|
|
78
|
+
> SpamDetectionResponse spam_detect_file_post(opts)
|
|
79
|
+
|
|
80
|
+
Perform AI spam 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 spam, phishing and other unsafe content. Uses 100-125 API calls depending on model selected.
|
|
81
|
+
|
|
82
|
+
### Example
|
|
83
|
+
```ruby
|
|
84
|
+
# load the gem
|
|
85
|
+
require 'cloudmersive-spam-detection-api-client'
|
|
86
|
+
# setup authorization
|
|
87
|
+
CloudmersiveSpamDetectionApiClient.configure do |config|
|
|
88
|
+
# Configure API key authorization: Apikey
|
|
89
|
+
config.api_key['Apikey'] = 'YOUR API KEY'
|
|
90
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
91
|
+
#config.api_key_prefix['Apikey'] = 'Bearer'
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
api_instance = CloudmersiveSpamDetectionApiClient::SpamDetectionApi.new
|
|
95
|
+
|
|
96
|
+
opts = {
|
|
97
|
+
model: 'Advanced', # String | Model to use; default setting is Advanced
|
|
98
|
+
input_file: File.new('/path/to/file.txt') # File |
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
begin
|
|
102
|
+
#Perform AI spam 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 spam, phishing and other unsafe content. Uses 100-125 API calls depending on model selected.
|
|
103
|
+
result = api_instance.spam_detect_file_post(opts)
|
|
104
|
+
p result
|
|
105
|
+
rescue CloudmersiveSpamDetectionApiClient::ApiError => e
|
|
106
|
+
puts "Exception when calling SpamDetectionApi->spam_detect_file_post: #{e}"
|
|
107
|
+
end
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Parameters
|
|
111
|
+
|
|
112
|
+
Name | Type | Description | Notes
|
|
113
|
+
------------- | ------------- | ------------- | -------------
|
|
114
|
+
**model** | **String**| Model to use; default setting is Advanced | [optional] [default to Advanced]
|
|
115
|
+
**input_file** | **File**| | [optional]
|
|
116
|
+
|
|
117
|
+
### Return type
|
|
118
|
+
|
|
119
|
+
[**SpamDetectionResponse**](SpamDetectionResponse.md)
|
|
120
|
+
|
|
121
|
+
### Authorization
|
|
122
|
+
|
|
123
|
+
[Apikey](../README.md#Apikey)
|
|
124
|
+
|
|
125
|
+
### HTTP request headers
|
|
126
|
+
|
|
127
|
+
- **Content-Type**: multipart/form-data
|
|
128
|
+
- **Accept**: text/plain, application/json, text/json
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
# **spam_detect_form_submission_advanced_post**
|
|
133
|
+
> SpamDetectionFormSubmissionAdvancedResponse spam_detect_form_submission_advanced_post(opts)
|
|
134
|
+
|
|
135
|
+
Perform advanced AI spam detection and classification against a form submission. Analyzes form 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.
|
|
136
|
+
|
|
137
|
+
### Example
|
|
138
|
+
```ruby
|
|
139
|
+
# load the gem
|
|
140
|
+
require 'cloudmersive-spam-detection-api-client'
|
|
141
|
+
# setup authorization
|
|
142
|
+
CloudmersiveSpamDetectionApiClient.configure do |config|
|
|
143
|
+
# Configure API key authorization: Apikey
|
|
144
|
+
config.api_key['Apikey'] = 'YOUR API KEY'
|
|
145
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
146
|
+
#config.api_key_prefix['Apikey'] = 'Bearer'
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
api_instance = CloudmersiveSpamDetectionApiClient::SpamDetectionApi.new
|
|
150
|
+
|
|
151
|
+
opts = {
|
|
152
|
+
body: CloudmersiveSpamDetectionApiClient::SpamDetectionAdvancedFormSubmissionRequest.new # SpamDetectionAdvancedFormSubmissionRequest | Spam detection request
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
begin
|
|
156
|
+
#Perform advanced AI spam detection and classification against a form submission. Analyzes form 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.
|
|
157
|
+
result = api_instance.spam_detect_form_submission_advanced_post(opts)
|
|
158
|
+
p result
|
|
159
|
+
rescue CloudmersiveSpamDetectionApiClient::ApiError => e
|
|
160
|
+
puts "Exception when calling SpamDetectionApi->spam_detect_form_submission_advanced_post: #{e}"
|
|
161
|
+
end
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Parameters
|
|
165
|
+
|
|
166
|
+
Name | Type | Description | Notes
|
|
167
|
+
------------- | ------------- | ------------- | -------------
|
|
168
|
+
**body** | [**SpamDetectionAdvancedFormSubmissionRequest**](SpamDetectionAdvancedFormSubmissionRequest.md)| Spam detection request | [optional]
|
|
169
|
+
|
|
170
|
+
### Return type
|
|
171
|
+
|
|
172
|
+
[**SpamDetectionFormSubmissionAdvancedResponse**](SpamDetectionFormSubmissionAdvancedResponse.md)
|
|
173
|
+
|
|
174
|
+
### Authorization
|
|
175
|
+
|
|
176
|
+
[Apikey](../README.md#Apikey)
|
|
177
|
+
|
|
178
|
+
### HTTP request headers
|
|
179
|
+
|
|
180
|
+
- **Content-Type**: application/json, text/json, application/*+json
|
|
181
|
+
- **Accept**: text/plain, application/json, text/json
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
11
185
|
# **spam_detect_text_string_advanced_post**
|
|
12
186
|
> SpamDetectionAdvancedResponse spam_detect_text_string_advanced_post(opts)
|
|
13
187
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# CloudmersiveSpamDetectionApiClient::SpamDetectionFormSubmissionAdvancedResponse
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**clean_result** | **BOOLEAN** | True if the result is not spam (clean), and false otherwise | [optional]
|
|
7
|
+
**spam_risk_level** | **Float** | Overall spam risk level between 0.0 and 1.0 | [optional]
|
|
8
|
+
**contains_spam** | **BOOLEAN** | True if the input text contains spam, false otherwise | [optional]
|
|
9
|
+
**contains_unsolicited_sales** | **BOOLEAN** | True if the input text contains unsolicited sales, false otherwise | [optional]
|
|
10
|
+
**contains_promotional_content** | **BOOLEAN** | True if the input text contains promotional content, false otherwise | [optional]
|
|
11
|
+
**contains_phishing_attempt** | **BOOLEAN** | True if the input text contains a phishing attempt, false otherwise | [optional]
|
|
12
|
+
**analysis_rationale** | **String** | Rationale for why the conclusion was formed | [optional]
|
|
13
|
+
|
|
14
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#spamapi
|
|
3
3
|
|
|
4
|
-
#Easily and directly scan and block
|
|
4
|
+
#Easily and directly scan and block spam security threats in input.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|
|
@@ -21,6 +21,170 @@ module CloudmersiveSpamDetectionApiClient
|
|
|
21
21
|
end
|
|
22
22
|
# Perform advanced AI spam 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.
|
|
23
23
|
# @param [Hash] opts the optional parameters
|
|
24
|
+
# @option opts [String] :model Optional: Specify which AI model to use. Possible choices are Normal and Advanced. Default is Advanced. (default to Advanced)
|
|
25
|
+
# @option opts [String] :preprocessing Optional: Specify which preprocessing to Use. Possible choices are None, Compatability and Auto. Default is Auto. (default to Auto)
|
|
26
|
+
# @option opts [BOOLEAN] :allow_phishing True if phishing should be allowed, false otherwise (default to false)
|
|
27
|
+
# @option opts [BOOLEAN] :allow_unsolicited_sales True if unsolicited sales should be allowed, false otherwise (default to false)
|
|
28
|
+
# @option opts [BOOLEAN] :allow_promotional_content True if promotional content should be allowed, false otherwise (default to true)
|
|
29
|
+
# @option opts [File] :input_file
|
|
30
|
+
# @return [SpamDetectionAdvancedResponse]
|
|
31
|
+
def spam_detect_file_advanced_post(opts = {})
|
|
32
|
+
data, _status_code, _headers = spam_detect_file_advanced_post_with_http_info(opts)
|
|
33
|
+
data
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Perform advanced AI spam 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.
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @option opts [String] :model Optional: Specify which AI model to use. Possible choices are Normal and Advanced. Default is Advanced.
|
|
39
|
+
# @option opts [String] :preprocessing Optional: Specify which preprocessing to Use. Possible choices are None, Compatability and Auto. Default is Auto.
|
|
40
|
+
# @option opts [BOOLEAN] :allow_phishing True if phishing should be allowed, false otherwise
|
|
41
|
+
# @option opts [BOOLEAN] :allow_unsolicited_sales True if unsolicited sales should be allowed, false otherwise
|
|
42
|
+
# @option opts [BOOLEAN] :allow_promotional_content True if promotional content should be allowed, false otherwise
|
|
43
|
+
# @option opts [File] :input_file
|
|
44
|
+
# @return [Array<(SpamDetectionAdvancedResponse, Fixnum, Hash)>] SpamDetectionAdvancedResponse data, response status code and response headers
|
|
45
|
+
def spam_detect_file_advanced_post_with_http_info(opts = {})
|
|
46
|
+
if @api_client.config.debugging
|
|
47
|
+
@api_client.config.logger.debug 'Calling API: SpamDetectionApi.spam_detect_file_advanced_post ...'
|
|
48
|
+
end
|
|
49
|
+
# resource path
|
|
50
|
+
local_var_path = '/spam/detect/file/advanced'
|
|
51
|
+
|
|
52
|
+
# query parameters
|
|
53
|
+
query_params = {}
|
|
54
|
+
|
|
55
|
+
# header parameters
|
|
56
|
+
header_params = {}
|
|
57
|
+
# HTTP header 'Accept' (if needed)
|
|
58
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])
|
|
59
|
+
# HTTP header 'Content-Type'
|
|
60
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
|
61
|
+
header_params[:'model'] = opts[:'model'] if !opts[:'model'].nil?
|
|
62
|
+
header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil?
|
|
63
|
+
header_params[:'allowPhishing'] = opts[:'allow_phishing'] if !opts[:'allow_phishing'].nil?
|
|
64
|
+
header_params[:'allowUnsolicitedSales'] = opts[:'allow_unsolicited_sales'] if !opts[:'allow_unsolicited_sales'].nil?
|
|
65
|
+
header_params[:'allowPromotionalContent'] = opts[:'allow_promotional_content'] if !opts[:'allow_promotional_content'].nil?
|
|
66
|
+
|
|
67
|
+
# form parameters
|
|
68
|
+
form_params = {}
|
|
69
|
+
form_params['inputFile'] = opts[:'input_file'] if !opts[:'input_file'].nil?
|
|
70
|
+
|
|
71
|
+
# http body (model)
|
|
72
|
+
post_body = nil
|
|
73
|
+
auth_names = ['Apikey']
|
|
74
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => 'SpamDetectionAdvancedResponse')
|
|
81
|
+
if @api_client.config.debugging
|
|
82
|
+
@api_client.config.logger.debug "API called: SpamDetectionApi#spam_detect_file_advanced_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
83
|
+
end
|
|
84
|
+
return data, status_code, headers
|
|
85
|
+
end
|
|
86
|
+
# Perform AI spam 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 spam, phishing and other unsafe content. Uses 100-125 API calls depending on model selected.
|
|
87
|
+
# @param [Hash] opts the optional parameters
|
|
88
|
+
# @option opts [String] :model Model to use; default setting is Advanced (default to Advanced)
|
|
89
|
+
# @option opts [File] :input_file
|
|
90
|
+
# @return [SpamDetectionResponse]
|
|
91
|
+
def spam_detect_file_post(opts = {})
|
|
92
|
+
data, _status_code, _headers = spam_detect_file_post_with_http_info(opts)
|
|
93
|
+
data
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Perform AI spam 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 spam, phishing and other unsafe content. Uses 100-125 API calls depending on model selected.
|
|
97
|
+
# @param [Hash] opts the optional parameters
|
|
98
|
+
# @option opts [String] :model Model to use; default setting is Advanced
|
|
99
|
+
# @option opts [File] :input_file
|
|
100
|
+
# @return [Array<(SpamDetectionResponse, Fixnum, Hash)>] SpamDetectionResponse data, response status code and response headers
|
|
101
|
+
def spam_detect_file_post_with_http_info(opts = {})
|
|
102
|
+
if @api_client.config.debugging
|
|
103
|
+
@api_client.config.logger.debug 'Calling API: SpamDetectionApi.spam_detect_file_post ...'
|
|
104
|
+
end
|
|
105
|
+
# resource path
|
|
106
|
+
local_var_path = '/spam/detect/file'
|
|
107
|
+
|
|
108
|
+
# query parameters
|
|
109
|
+
query_params = {}
|
|
110
|
+
|
|
111
|
+
# header parameters
|
|
112
|
+
header_params = {}
|
|
113
|
+
# HTTP header 'Accept' (if needed)
|
|
114
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])
|
|
115
|
+
# HTTP header 'Content-Type'
|
|
116
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
|
117
|
+
header_params[:'model'] = opts[:'model'] if !opts[:'model'].nil?
|
|
118
|
+
|
|
119
|
+
# form parameters
|
|
120
|
+
form_params = {}
|
|
121
|
+
form_params['inputFile'] = opts[:'input_file'] if !opts[:'input_file'].nil?
|
|
122
|
+
|
|
123
|
+
# http body (model)
|
|
124
|
+
post_body = nil
|
|
125
|
+
auth_names = ['Apikey']
|
|
126
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
127
|
+
:header_params => header_params,
|
|
128
|
+
:query_params => query_params,
|
|
129
|
+
:form_params => form_params,
|
|
130
|
+
:body => post_body,
|
|
131
|
+
:auth_names => auth_names,
|
|
132
|
+
:return_type => 'SpamDetectionResponse')
|
|
133
|
+
if @api_client.config.debugging
|
|
134
|
+
@api_client.config.logger.debug "API called: SpamDetectionApi#spam_detect_file_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
135
|
+
end
|
|
136
|
+
return data, status_code, headers
|
|
137
|
+
end
|
|
138
|
+
# Perform advanced AI spam detection and classification against a form submission. Analyzes form 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.
|
|
139
|
+
# @param [Hash] opts the optional parameters
|
|
140
|
+
# @option opts [SpamDetectionAdvancedFormSubmissionRequest] :body Spam detection request
|
|
141
|
+
# @return [SpamDetectionFormSubmissionAdvancedResponse]
|
|
142
|
+
def spam_detect_form_submission_advanced_post(opts = {})
|
|
143
|
+
data, _status_code, _headers = spam_detect_form_submission_advanced_post_with_http_info(opts)
|
|
144
|
+
data
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Perform advanced AI spam detection and classification against a form submission. Analyzes form 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.
|
|
148
|
+
# @param [Hash] opts the optional parameters
|
|
149
|
+
# @option opts [SpamDetectionAdvancedFormSubmissionRequest] :body Spam detection request
|
|
150
|
+
# @return [Array<(SpamDetectionFormSubmissionAdvancedResponse, Fixnum, Hash)>] SpamDetectionFormSubmissionAdvancedResponse data, response status code and response headers
|
|
151
|
+
def spam_detect_form_submission_advanced_post_with_http_info(opts = {})
|
|
152
|
+
if @api_client.config.debugging
|
|
153
|
+
@api_client.config.logger.debug 'Calling API: SpamDetectionApi.spam_detect_form_submission_advanced_post ...'
|
|
154
|
+
end
|
|
155
|
+
# resource path
|
|
156
|
+
local_var_path = '/spam/detect/form-submission/advanced'
|
|
157
|
+
|
|
158
|
+
# query parameters
|
|
159
|
+
query_params = {}
|
|
160
|
+
|
|
161
|
+
# header parameters
|
|
162
|
+
header_params = {}
|
|
163
|
+
# HTTP header 'Accept' (if needed)
|
|
164
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])
|
|
165
|
+
# HTTP header 'Content-Type'
|
|
166
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/*+json'])
|
|
167
|
+
|
|
168
|
+
# form parameters
|
|
169
|
+
form_params = {}
|
|
170
|
+
|
|
171
|
+
# http body (model)
|
|
172
|
+
post_body = @api_client.object_to_http_body(opts[:'body'])
|
|
173
|
+
auth_names = ['Apikey']
|
|
174
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
175
|
+
:header_params => header_params,
|
|
176
|
+
:query_params => query_params,
|
|
177
|
+
:form_params => form_params,
|
|
178
|
+
:body => post_body,
|
|
179
|
+
:auth_names => auth_names,
|
|
180
|
+
:return_type => 'SpamDetectionFormSubmissionAdvancedResponse')
|
|
181
|
+
if @api_client.config.debugging
|
|
182
|
+
@api_client.config.logger.debug "API called: SpamDetectionApi#spam_detect_form_submission_advanced_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
183
|
+
end
|
|
184
|
+
return data, status_code, headers
|
|
185
|
+
end
|
|
186
|
+
# Perform advanced AI spam 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.
|
|
187
|
+
# @param [Hash] opts the optional parameters
|
|
24
188
|
# @option opts [SpamDetectionAdvancedRequest] :body Spam detection request
|
|
25
189
|
# @return [SpamDetectionAdvancedResponse]
|
|
26
190
|
def spam_detect_text_string_advanced_post(opts = {})
|