cloudmersive-spam-detection-api-client 2.2.1 → 2.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a070426986b622338d79527af36c6a67ae0622636c56107f2db3a0ec0cad74b
4
- data.tar.gz: 73d7f89496568184e0ad5cd747ed9956b1c8f23671da65aee3f0ad94e9be9876
3
+ metadata.gz: b6c35d673d893361bc3597ccae72552fedef2b936c40b228bc2bc1fd01a6b7a9
4
+ data.tar.gz: c1c41115fa8dfb2a7a1a07f6a14805ba8d32b519b8cad9f9b9b414aeba879c91
5
5
  SHA512:
6
- metadata.gz: a2c3cd8dd9c2c50240d6fe77f54df1f21b01da081ef68603c42cb4401a8b299abe814a8f0712c9fba425f337478ca33823db3c64f9a7c6692d5e16b892f72ca9
7
- data.tar.gz: 62d782ddc28c0afce33f465ed9465f121c5cf8bcf6c90faad064f04a993fd964c87d4cd1b125df211b96f1143cbd8a1b9efd8f401c0863fd1f01199670ed24c5
6
+ metadata.gz: 07b2200a1df7403389143d0a90982846d507e7a2125de4f1ed7bf443be625bd604e2a2cf59f679198099a6325eec9fe8e942e64f055ae7f73c1a9ef20fe1453d
7
+ data.tar.gz: 6615752fc301424a9ea5cf4cb18044ce5640e3038352ec74ff456118c9378ae67c077d9563abcc1c9aaeb6a6423e7ad43a083b7175caa6a8e6915206361dc316
data/README.md CHANGED
@@ -7,7 +7,7 @@ Easily and directly scan and block phishing security threats.
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.1
10
+ - Package version: 2.3.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.2.1.gem
26
+ gem install ./cloudmersive-spam-detection-api-client-2.3.0.gem
27
27
  ```
28
- (for development, run `gem install --dev ./cloudmersive-spam-detection-api-client-2.2.1.gem` to install the development dependencies)
28
+ (for development, run `gem install --dev ./cloudmersive-spam-detection-api-client-2.3.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.2.1'
34
+ gem 'cloudmersive-spam-detection-api-client', '~> 2.3.0'
35
35
 
36
36
  ### Install from Git
37
37
 
@@ -69,7 +69,7 @@ opts = {
69
69
  }
70
70
 
71
71
  begin
72
- #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.
72
+ #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
73
  result = api_instance.spam_detect_text_string_advanced_post(opts)
74
74
  p result
75
75
  rescue CloudmersiveSpamDetectionApiClient::ApiError => e
@@ -84,14 +84,15 @@ All URIs are relative to *https://localhost*
84
84
 
85
85
  Class | Method | HTTP request | Description
86
86
  ------------ | ------------- | ------------- | -------------
87
- *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.
88
- *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.
87
+ *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
+ *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
89
 
90
90
 
91
91
  ## Documentation for Models
92
92
 
93
93
  - [CloudmersiveSpamDetectionApiClient::SpamDetectionAdvancedRequest](docs/SpamDetectionAdvancedRequest.md)
94
94
  - [CloudmersiveSpamDetectionApiClient::SpamDetectionAdvancedResponse](docs/SpamDetectionAdvancedResponse.md)
95
+ - [CloudmersiveSpamDetectionApiClient::SpamDetectionRequest](docs/SpamDetectionRequest.md)
95
96
  - [CloudmersiveSpamDetectionApiClient::SpamDetectionResponse](docs/SpamDetectionResponse.md)
96
97
 
97
98
 
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.platform = Gem::Platform::RUBY
22
22
  s.authors = ["Cloudmersive"]
23
23
  s.email = [""]
24
- s.homepage = "https://www.cloudmersive.com/spam-api"
24
+ s.homepage = "https://cloudmersive.com/spam-detection-api"
25
25
  s.summary = "Scan content for spam."
26
26
  s.description = "Spam Detection API lets you scan content for spam using AI."
27
27
  s.license = 'Apache 2.0'
@@ -4,5 +4,9 @@
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
6
  **input_string** | **String** | Input text string to detect spam against | [optional]
7
+ **model** | **String** | Optional: Specify which AI model to use. Possible choices are Normal and Advanced. Default is Advanced. | [optional]
8
+ **allow_unsolicited_sales** | **BOOLEAN** | True if unsolicited sales should be allowed, false otherwise | [optional]
9
+ **allow_promotional_content** | **BOOLEAN** | True if promotional content should be allowed, false otherwise | [optional]
10
+ **allow_phishing** | **BOOLEAN** | True if phishing should be allowed, false otherwise | [optional]
7
11
 
8
12
 
@@ -4,5 +4,9 @@
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
+ **contains_spam** | **BOOLEAN** | True if the input text contains spam, 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_phishing_attempt** | **BOOLEAN** | True if the input text contains a phishing attempt, false otherwise | [optional]
7
11
 
8
12
 
@@ -4,14 +4,14 @@ All URIs are relative to *https://localhost*
4
4
 
5
5
  Method | HTTP request | Description
6
6
  ------------- | ------------- | -------------
7
- [**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.
8
- [**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.
7
+ [**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
+ [**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
9
 
10
10
 
11
11
  # **spam_detect_text_string_advanced_post**
12
12
  > SpamDetectionAdvancedResponse spam_detect_text_string_advanced_post(opts)
13
13
 
14
- 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.
14
+ 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.
15
15
 
16
16
  ### Example
17
17
  ```ruby
@@ -32,7 +32,7 @@ opts = {
32
32
  }
33
33
 
34
34
  begin
35
- #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.
35
+ #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.
36
36
  result = api_instance.spam_detect_text_string_advanced_post(opts)
37
37
  p result
38
38
  rescue CloudmersiveSpamDetectionApiClient::ApiError => e
@@ -64,7 +64,7 @@ Name | Type | Description | Notes
64
64
  # **spam_detect_text_string_post**
65
65
  > SpamDetectionResponse spam_detect_text_string_post(opts)
66
66
 
67
- 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.
67
+ 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.
68
68
 
69
69
  ### Example
70
70
  ```ruby
@@ -81,11 +81,11 @@ end
81
81
  api_instance = CloudmersiveSpamDetectionApiClient::SpamDetectionApi.new
82
82
 
83
83
  opts = {
84
- body: CloudmersiveSpamDetectionApiClient::SpamDetectionAdvancedRequest.new # SpamDetectionAdvancedRequest | Spam detection request
84
+ body: CloudmersiveSpamDetectionApiClient::SpamDetectionRequest.new # SpamDetectionRequest | Spam detection request
85
85
  }
86
86
 
87
87
  begin
88
- #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.
88
+ #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
89
  result = api_instance.spam_detect_text_string_post(opts)
90
90
  p result
91
91
  rescue CloudmersiveSpamDetectionApiClient::ApiError => e
@@ -97,7 +97,7 @@ end
97
97
 
98
98
  Name | Type | Description | Notes
99
99
  ------------- | ------------- | ------------- | -------------
100
- **body** | [**SpamDetectionAdvancedRequest**](SpamDetectionAdvancedRequest.md)| Spam detection request | [optional]
100
+ **body** | [**SpamDetectionRequest**](SpamDetectionRequest.md)| Spam detection request | [optional]
101
101
 
102
102
  ### Return type
103
103
 
@@ -0,0 +1,9 @@
1
+ # CloudmersiveSpamDetectionApiClient::SpamDetectionRequest
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **input_string** | **String** | Input text string to detect spam against | [optional]
7
+ **model** | **String** | Optional: Specify which AI model to use. Possible choices are Normal and Advanced. Default is Advanced. | [optional]
8
+
9
+
@@ -19,7 +19,7 @@ module CloudmersiveSpamDetectionApiClient
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
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.
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
24
  # @option opts [SpamDetectionAdvancedRequest] :body Spam detection request
25
25
  # @return [SpamDetectionAdvancedResponse]
@@ -28,7 +28,7 @@ module CloudmersiveSpamDetectionApiClient
28
28
  data
29
29
  end
30
30
 
31
- # 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.
31
+ # 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.
32
32
  # @param [Hash] opts the optional parameters
33
33
  # @option opts [SpamDetectionAdvancedRequest] :body Spam detection request
34
34
  # @return [Array<(SpamDetectionAdvancedResponse, Fixnum, Hash)>] SpamDetectionAdvancedResponse data, response status code and response headers
@@ -67,18 +67,18 @@ module CloudmersiveSpamDetectionApiClient
67
67
  end
68
68
  return data, status_code, headers
69
69
  end
70
- # 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.
70
+ # 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.
71
71
  # @param [Hash] opts the optional parameters
72
- # @option opts [SpamDetectionAdvancedRequest] :body Spam detection request
72
+ # @option opts [SpamDetectionRequest] :body Spam detection request
73
73
  # @return [SpamDetectionResponse]
74
74
  def spam_detect_text_string_post(opts = {})
75
75
  data, _status_code, _headers = spam_detect_text_string_post_with_http_info(opts)
76
76
  data
77
77
  end
78
78
 
79
- # 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.
79
+ # 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.
80
80
  # @param [Hash] opts the optional parameters
81
- # @option opts [SpamDetectionAdvancedRequest] :body Spam detection request
81
+ # @option opts [SpamDetectionRequest] :body Spam detection request
82
82
  # @return [Array<(SpamDetectionResponse, Fixnum, Hash)>] SpamDetectionResponse data, response status code and response headers
83
83
  def spam_detect_text_string_post_with_http_info(opts = {})
84
84
  if @api_client.config.debugging
@@ -18,17 +18,37 @@ module CloudmersiveSpamDetectionApiClient
18
18
  # Input text string to detect spam against
19
19
  attr_accessor :input_string
20
20
 
21
+ # Optional: Specify which AI model to use. Possible choices are Normal and Advanced. Default is Advanced.
22
+ attr_accessor :model
23
+
24
+ # True if unsolicited sales should be allowed, false otherwise
25
+ attr_accessor :allow_unsolicited_sales
26
+
27
+ # True if promotional content should be allowed, false otherwise
28
+ attr_accessor :allow_promotional_content
29
+
30
+ # True if phishing should be allowed, false otherwise
31
+ attr_accessor :allow_phishing
32
+
21
33
  # Attribute mapping from ruby-style variable name to JSON key.
22
34
  def self.attribute_map
23
35
  {
24
- :'input_string' => :'InputString'
36
+ :'input_string' => :'InputString',
37
+ :'model' => :'Model',
38
+ :'allow_unsolicited_sales' => :'AllowUnsolicitedSales',
39
+ :'allow_promotional_content' => :'AllowPromotionalContent',
40
+ :'allow_phishing' => :'AllowPhishing'
25
41
  }
26
42
  end
27
43
 
28
44
  # Attribute type mapping.
29
45
  def self.swagger_types
30
46
  {
31
- :'input_string' => :'String'
47
+ :'input_string' => :'String',
48
+ :'model' => :'String',
49
+ :'allow_unsolicited_sales' => :'BOOLEAN',
50
+ :'allow_promotional_content' => :'BOOLEAN',
51
+ :'allow_phishing' => :'BOOLEAN'
32
52
  }
33
53
  end
34
54
 
@@ -43,6 +63,22 @@ module CloudmersiveSpamDetectionApiClient
43
63
  if attributes.has_key?(:'InputString')
44
64
  self.input_string = attributes[:'InputString']
45
65
  end
66
+
67
+ if attributes.has_key?(:'Model')
68
+ self.model = attributes[:'Model']
69
+ end
70
+
71
+ if attributes.has_key?(:'AllowUnsolicitedSales')
72
+ self.allow_unsolicited_sales = attributes[:'AllowUnsolicitedSales']
73
+ end
74
+
75
+ if attributes.has_key?(:'AllowPromotionalContent')
76
+ self.allow_promotional_content = attributes[:'AllowPromotionalContent']
77
+ end
78
+
79
+ if attributes.has_key?(:'AllowPhishing')
80
+ self.allow_phishing = attributes[:'AllowPhishing']
81
+ end
46
82
  end
47
83
 
48
84
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -63,7 +99,11 @@ module CloudmersiveSpamDetectionApiClient
63
99
  def ==(o)
64
100
  return true if self.equal?(o)
65
101
  self.class == o.class &&
66
- input_string == o.input_string
102
+ input_string == o.input_string &&
103
+ model == o.model &&
104
+ allow_unsolicited_sales == o.allow_unsolicited_sales &&
105
+ allow_promotional_content == o.allow_promotional_content &&
106
+ allow_phishing == o.allow_phishing
67
107
  end
68
108
 
69
109
  # @see the `==` method
@@ -75,7 +115,7 @@ module CloudmersiveSpamDetectionApiClient
75
115
  # Calculates hash code according to all attributes.
76
116
  # @return [Fixnum] Hash code
77
117
  def hash
78
- [input_string].hash
118
+ [input_string, model, allow_unsolicited_sales, allow_promotional_content, allow_phishing].hash
79
119
  end
80
120
 
81
121
  # Builds the object from hash
@@ -18,17 +18,37 @@ module CloudmersiveSpamDetectionApiClient
18
18
  # True if the result is not spam (clean), and false otherwise
19
19
  attr_accessor :clean_result
20
20
 
21
+ # True if the input text contains spam, false otherwise
22
+ attr_accessor :contains_spam
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 a phishing attempt, false otherwise
31
+ attr_accessor :contains_phishing_attempt
32
+
21
33
  # Attribute mapping from ruby-style variable name to JSON key.
22
34
  def self.attribute_map
23
35
  {
24
- :'clean_result' => :'CleanResult'
36
+ :'clean_result' => :'CleanResult',
37
+ :'contains_spam' => :'ContainsSpam',
38
+ :'contains_unsolicited_sales' => :'ContainsUnsolicitedSales',
39
+ :'contains_promotional_content' => :'ContainsPromotionalContent',
40
+ :'contains_phishing_attempt' => :'ContainsPhishingAttempt'
25
41
  }
26
42
  end
27
43
 
28
44
  # Attribute type mapping.
29
45
  def self.swagger_types
30
46
  {
31
- :'clean_result' => :'BOOLEAN'
47
+ :'clean_result' => :'BOOLEAN',
48
+ :'contains_spam' => :'BOOLEAN',
49
+ :'contains_unsolicited_sales' => :'BOOLEAN',
50
+ :'contains_promotional_content' => :'BOOLEAN',
51
+ :'contains_phishing_attempt' => :'BOOLEAN'
32
52
  }
33
53
  end
34
54
 
@@ -43,6 +63,22 @@ module CloudmersiveSpamDetectionApiClient
43
63
  if attributes.has_key?(:'CleanResult')
44
64
  self.clean_result = attributes[:'CleanResult']
45
65
  end
66
+
67
+ if attributes.has_key?(:'ContainsSpam')
68
+ self.contains_spam = attributes[:'ContainsSpam']
69
+ end
70
+
71
+ if attributes.has_key?(:'ContainsUnsolicitedSales')
72
+ self.contains_unsolicited_sales = attributes[:'ContainsUnsolicitedSales']
73
+ end
74
+
75
+ if attributes.has_key?(:'ContainsPromotionalContent')
76
+ self.contains_promotional_content = attributes[:'ContainsPromotionalContent']
77
+ end
78
+
79
+ if attributes.has_key?(:'ContainsPhishingAttempt')
80
+ self.contains_phishing_attempt = attributes[:'ContainsPhishingAttempt']
81
+ end
46
82
  end
47
83
 
48
84
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -63,7 +99,11 @@ module CloudmersiveSpamDetectionApiClient
63
99
  def ==(o)
64
100
  return true if self.equal?(o)
65
101
  self.class == o.class &&
66
- clean_result == o.clean_result
102
+ clean_result == o.clean_result &&
103
+ contains_spam == o.contains_spam &&
104
+ contains_unsolicited_sales == o.contains_unsolicited_sales &&
105
+ contains_promotional_content == o.contains_promotional_content &&
106
+ contains_phishing_attempt == o.contains_phishing_attempt
67
107
  end
68
108
 
69
109
  # @see the `==` method
@@ -75,7 +115,7 @@ module CloudmersiveSpamDetectionApiClient
75
115
  # Calculates hash code according to all attributes.
76
116
  # @return [Fixnum] Hash code
77
117
  def hash
78
- [clean_result].hash
118
+ [clean_result, contains_spam, contains_unsolicited_sales, contains_promotional_content, contains_phishing_attempt].hash
79
119
  end
80
120
 
81
121
  # Builds the object from hash
@@ -0,0 +1,196 @@
1
+ =begin
2
+ #spamapi
3
+
4
+ #Easily and directly scan and block phishing security threats.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveSpamDetectionApiClient
16
+ # AI spam detection request
17
+ class SpamDetectionRequest
18
+ # Input text string to detect spam against
19
+ attr_accessor :input_string
20
+
21
+ # Optional: Specify which AI model to use. Possible choices are Normal and Advanced. Default is Advanced.
22
+ attr_accessor :model
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'input_string' => :'InputString',
28
+ :'model' => :'Model'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'input_string' => :'String',
36
+ :'model' => :'String'
37
+ }
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ return unless attributes.is_a?(Hash)
44
+
45
+ # convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
47
+
48
+ if attributes.has_key?(:'InputString')
49
+ self.input_string = attributes[:'InputString']
50
+ end
51
+
52
+ if attributes.has_key?(:'Model')
53
+ self.model = attributes[:'Model']
54
+ end
55
+ end
56
+
57
+ # Show invalid properties with the reasons. Usually used together with valid?
58
+ # @return Array for valid properties with the reasons
59
+ def list_invalid_properties
60
+ invalid_properties = Array.new
61
+ invalid_properties
62
+ end
63
+
64
+ # Check to see if the all the properties in the model are valid
65
+ # @return true if the model is valid
66
+ def valid?
67
+ true
68
+ end
69
+
70
+ # Checks equality by comparing each attribute.
71
+ # @param [Object] Object to be compared
72
+ def ==(o)
73
+ return true if self.equal?(o)
74
+ self.class == o.class &&
75
+ input_string == o.input_string &&
76
+ model == o.model
77
+ end
78
+
79
+ # @see the `==` method
80
+ # @param [Object] Object to be compared
81
+ def eql?(o)
82
+ self == o
83
+ end
84
+
85
+ # Calculates hash code according to all attributes.
86
+ # @return [Fixnum] Hash code
87
+ def hash
88
+ [input_string, model].hash
89
+ end
90
+
91
+ # Builds the object from hash
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ # @return [Object] Returns the model itself
94
+ def build_from_hash(attributes)
95
+ return nil unless attributes.is_a?(Hash)
96
+ self.class.swagger_types.each_pair do |key, type|
97
+ if type =~ /\AArray<(.*)>/i
98
+ # check to ensure the input is an array given that the attribute
99
+ # is documented as an array but the input is not
100
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
101
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
102
+ end
103
+ elsif !attributes[self.class.attribute_map[key]].nil?
104
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
105
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
106
+ end
107
+
108
+ self
109
+ end
110
+
111
+ # Deserializes the data based on type
112
+ # @param string type Data type
113
+ # @param string value Value to be deserialized
114
+ # @return [Object] Deserialized data
115
+ def _deserialize(type, value)
116
+ case type.to_sym
117
+ when :DateTime
118
+ DateTime.parse(value)
119
+ when :Date
120
+ Date.parse(value)
121
+ when :String
122
+ value.to_s
123
+ when :Integer
124
+ value.to_i
125
+ when :Float
126
+ value.to_f
127
+ when :BOOLEAN
128
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
129
+ true
130
+ else
131
+ false
132
+ end
133
+ when :Object
134
+ # generic object (usually a Hash), return directly
135
+ value
136
+ when /\AArray<(?<inner_type>.+)>\z/
137
+ inner_type = Regexp.last_match[:inner_type]
138
+ value.map { |v| _deserialize(inner_type, v) }
139
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
140
+ k_type = Regexp.last_match[:k_type]
141
+ v_type = Regexp.last_match[:v_type]
142
+ {}.tap do |hash|
143
+ value.each do |k, v|
144
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
145
+ end
146
+ end
147
+ else # model
148
+ temp_model = CloudmersiveSpamDetectionApiClient.const_get(type).new
149
+ temp_model.build_from_hash(value)
150
+ end
151
+ end
152
+
153
+ # Returns the string representation of the object
154
+ # @return [String] String presentation of the object
155
+ def to_s
156
+ to_hash.to_s
157
+ end
158
+
159
+ # to_body is an alias to to_hash (backward compatibility)
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_body
162
+ to_hash
163
+ end
164
+
165
+ # Returns the object in the form of hash
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_hash
168
+ hash = {}
169
+ self.class.attribute_map.each_pair do |attr, param|
170
+ value = self.send(attr)
171
+ next if value.nil?
172
+ hash[param] = _to_hash(value)
173
+ end
174
+ hash
175
+ end
176
+
177
+ # Outputs non-array value in the form of hash
178
+ # For object, use to_hash. Otherwise, just return the value
179
+ # @param [Object] value Any valid value
180
+ # @return [Hash] Returns the value in the form of hash
181
+ def _to_hash(value)
182
+ if value.is_a?(Array)
183
+ value.compact.map { |v| _to_hash(v) }
184
+ elsif value.is_a?(Hash)
185
+ {}.tap do |hash|
186
+ value.each { |k, v| hash[k] = _to_hash(v) }
187
+ end
188
+ elsif value.respond_to? :to_hash
189
+ value.to_hash
190
+ else
191
+ value
192
+ end
193
+ end
194
+
195
+ end
196
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.14
11
11
  =end
12
12
 
13
13
  module CloudmersiveSpamDetectionApiClient
14
- VERSION = '2.2.1'
14
+ VERSION = '2.3.0'
15
15
  end
@@ -19,6 +19,7 @@ require 'cloudmersive-spam-detection-api-client/configuration'
19
19
  # Models
20
20
  require 'cloudmersive-spam-detection-api-client/models/spam_detection_advanced_request'
21
21
  require 'cloudmersive-spam-detection-api-client/models/spam_detection_advanced_response'
22
+ require 'cloudmersive-spam-detection-api-client/models/spam_detection_request'
22
23
  require 'cloudmersive-spam-detection-api-client/models/spam_detection_response'
23
24
 
24
25
  # APIs
@@ -33,7 +33,7 @@ describe 'SpamDetectionApi' do
33
33
  end
34
34
 
35
35
  # unit tests for spam_detect_text_string_advanced_post
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.
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
37
  # @param [Hash] opts the optional parameters
38
38
  # @option opts [SpamDetectionAdvancedRequest] :body Spam detection request
39
39
  # @return [SpamDetectionAdvancedResponse]
@@ -44,9 +44,9 @@ describe 'SpamDetectionApi' do
44
44
  end
45
45
 
46
46
  # unit tests for spam_detect_text_string_post
47
- # 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.
47
+ # 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.
48
48
  # @param [Hash] opts the optional parameters
49
- # @option opts [SpamDetectionAdvancedRequest] :body Spam detection request
49
+ # @option opts [SpamDetectionRequest] :body Spam detection request
50
50
  # @return [SpamDetectionResponse]
51
51
  describe 'spam_detect_text_string_post test' do
52
52
  it 'should work' do
@@ -38,4 +38,28 @@ describe 'SpamDetectionAdvancedRequest' do
38
38
  end
39
39
  end
40
40
 
41
+ describe 'test attribute "model"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "allow_unsolicited_sales"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ describe 'test attribute "allow_promotional_content"' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
59
+ describe 'test attribute "allow_phishing"' do
60
+ it 'should work' do
61
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
62
+ end
63
+ end
64
+
41
65
  end
@@ -38,4 +38,28 @@ describe 'SpamDetectionAdvancedResponse' do
38
38
  end
39
39
  end
40
40
 
41
+ describe 'test attribute "contains_spam"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "contains_unsolicited_sales"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ describe 'test attribute "contains_promotional_content"' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
59
+ describe 'test attribute "contains_phishing_attempt"' do
60
+ it 'should work' do
61
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
62
+ end
63
+ end
64
+
41
65
  end
@@ -0,0 +1,47 @@
1
+ =begin
2
+ #spamapi
3
+
4
+ #Easily and directly scan and block phishing security threats.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudmersiveSpamDetectionApiClient::SpamDetectionRequest
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'SpamDetectionRequest' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveSpamDetectionApiClient::SpamDetectionRequest.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of SpamDetectionRequest' do
31
+ it 'should create an instance of SpamDetectionRequest' do
32
+ expect(@instance).to be_instance_of(CloudmersiveSpamDetectionApiClient::SpamDetectionRequest)
33
+ end
34
+ end
35
+ describe 'test attribute "input_string"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "model"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudmersive-spam-detection-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cloudmersive
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-07-07 00:00:00.000000000 Z
11
+ date: 2025-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -204,6 +204,7 @@ files:
204
204
  - "./docs/SpamDetectionAdvancedRequest.md"
205
205
  - "./docs/SpamDetectionAdvancedResponse.md"
206
206
  - "./docs/SpamDetectionApi.md"
207
+ - "./docs/SpamDetectionRequest.md"
207
208
  - "./docs/SpamDetectionResponse.md"
208
209
  - "./git_push.sh"
209
210
  - "./lib/cloudmersive-spam-detection-api-client.rb"
@@ -213,6 +214,7 @@ files:
213
214
  - "./lib/cloudmersive-spam-detection-api-client/configuration.rb"
214
215
  - "./lib/cloudmersive-spam-detection-api-client/models/spam_detection_advanced_request.rb"
215
216
  - "./lib/cloudmersive-spam-detection-api-client/models/spam_detection_advanced_response.rb"
217
+ - "./lib/cloudmersive-spam-detection-api-client/models/spam_detection_request.rb"
216
218
  - "./lib/cloudmersive-spam-detection-api-client/models/spam_detection_response.rb"
217
219
  - "./lib/cloudmersive-spam-detection-api-client/version.rb"
218
220
  - "./spec/api/spam_detection_api_spec.rb"
@@ -220,9 +222,10 @@ files:
220
222
  - "./spec/configuration_spec.rb"
221
223
  - "./spec/models/spam_detection_advanced_request_spec.rb"
222
224
  - "./spec/models/spam_detection_advanced_response_spec.rb"
225
+ - "./spec/models/spam_detection_request_spec.rb"
223
226
  - "./spec/models/spam_detection_response_spec.rb"
224
227
  - "./spec/spec_helper.rb"
225
- homepage: https://www.cloudmersive.com/spam-api
228
+ homepage: https://cloudmersive.com/spam-detection-api
226
229
  licenses:
227
230
  - Apache 2.0
228
231
  metadata: {}