cloudmersive-phishing-detection-api-client 2.2.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 +7 -0
- data/Gemfile +7 -0
- data/README.md +112 -0
- data/Rakefile +8 -0
- data/cloudmersive-phishing-detection-api-client.gemspec +45 -0
- data/docs/PhishingUrlAdvancedRequest.md +10 -0
- data/docs/PhishingUrlAdvancedRequestBatch.md +10 -0
- data/docs/PhishingUrlAdvancedResponse.md +18 -0
- data/docs/PhishingUrlAdvancedResponseBatch.md +9 -0
- data/docs/PhishingUrlApi.md +120 -0
- data/docs/PhishingUrlBatchApi.md +120 -0
- data/docs/PhishingUrlRequest.md +8 -0
- data/docs/PhishingUrlResponse.md +13 -0
- data/docs/PhishingUrlResponseBatch.md +9 -0
- data/git_push.sh +55 -0
- data/lib/cloudmersive-phishing-detection-api-client/api/phishing_url_api.rb +123 -0
- data/lib/cloudmersive-phishing-detection-api-client/api/phishing_url_batch_api.rb +123 -0
- data/lib/cloudmersive-phishing-detection-api-client/api_client.rb +391 -0
- data/lib/cloudmersive-phishing-detection-api-client/api_error.rb +38 -0
- data/lib/cloudmersive-phishing-detection-api-client/configuration.rb +209 -0
- data/lib/cloudmersive-phishing-detection-api-client/models/phishing_url_advanced_request.rb +234 -0
- data/lib/cloudmersive-phishing-detection-api-client/models/phishing_url_advanced_request_batch.rb +217 -0
- data/lib/cloudmersive-phishing-detection-api-client/models/phishing_url_advanced_response.rb +286 -0
- data/lib/cloudmersive-phishing-detection-api-client/models/phishing_url_advanced_response_batch.rb +198 -0
- data/lib/cloudmersive-phishing-detection-api-client/models/phishing_url_request.rb +191 -0
- data/lib/cloudmersive-phishing-detection-api-client/models/phishing_url_response.rb +236 -0
- data/lib/cloudmersive-phishing-detection-api-client/models/phishing_url_response_batch.rb +198 -0
- data/lib/cloudmersive-phishing-detection-api-client/version.rb +15 -0
- data/lib/cloudmersive-phishing-detection-api-client.rb +48 -0
- data/spec/api/phishing_url_api_spec.rb +59 -0
- data/spec/api/phishing_url_batch_api_spec.rb +59 -0
- data/spec/api_client_spec.rb +243 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/phishing_url_advanced_request_batch_spec.rb +53 -0
- data/spec/models/phishing_url_advanced_request_spec.rb +53 -0
- data/spec/models/phishing_url_advanced_response_batch_spec.rb +47 -0
- data/spec/models/phishing_url_advanced_response_spec.rb +101 -0
- data/spec/models/phishing_url_request_spec.rb +41 -0
- data/spec/models/phishing_url_response_batch_spec.rb +47 -0
- data/spec/models/phishing_url_response_spec.rb +71 -0
- data/spec/spec_helper.rb +111 -0
- metadata +264 -0
@@ -0,0 +1,236 @@
|
|
1
|
+
=begin
|
2
|
+
#phishingapi
|
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 CloudmersivePhishingDetectionApiClient
|
16
|
+
# Response for the phishing validation apis
|
17
|
+
class PhishingUrlResponse
|
18
|
+
# Specifies if the url (or its host or domain) passed all the checks or not.
|
19
|
+
attr_accessor :clean_result
|
20
|
+
|
21
|
+
# Risk value from 0.0 - 1.0. Higher numbers are a higher risk <br />Anything below 0.3 should be considered safe. Anything above 0.7 should be considered a significant risk. <br /> A score of 1.0 indicates the url, host, or domain failed significant safety checks.<br /> If a url passes all the tests for the basic api, the risk will be 0.7. If a url passes all the tests for the advanced api, the risk will be 0.2.
|
22
|
+
attr_accessor :risk
|
23
|
+
|
24
|
+
# Specifies if the full url with query parameters and fragment is a phishing threat <br />The advanced api performs more checks on the full url.
|
25
|
+
attr_accessor :contains_threat_url
|
26
|
+
|
27
|
+
# Specifies if the host of the url (i.e. ```mysite.hostingsite.com``` for a url of ```https://mysite.hostingsite.com/index.html```) is a phishing threat <br />The advanced api performs more checks on the host
|
28
|
+
attr_accessor :contains_threat_host
|
29
|
+
|
30
|
+
# Specifies if the registerable domain of the url (i.e. ```hostingsite.com``` for a url of ```https://mysite.hostingsite.com/index.html```) is a phishing threat <br />The advanced api performs more checks on the domain
|
31
|
+
attr_accessor :contains_threat_domain
|
32
|
+
|
33
|
+
# Input URL that was scanned
|
34
|
+
attr_accessor :input_url
|
35
|
+
|
36
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
37
|
+
def self.attribute_map
|
38
|
+
{
|
39
|
+
:'clean_result' => :'CleanResult',
|
40
|
+
:'risk' => :'Risk',
|
41
|
+
:'contains_threat_url' => :'ContainsThreatUrl',
|
42
|
+
:'contains_threat_host' => :'ContainsThreatHost',
|
43
|
+
:'contains_threat_domain' => :'ContainsThreatDomain',
|
44
|
+
:'input_url' => :'InputUrl'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Attribute type mapping.
|
49
|
+
def self.swagger_types
|
50
|
+
{
|
51
|
+
:'clean_result' => :'BOOLEAN',
|
52
|
+
:'risk' => :'Float',
|
53
|
+
:'contains_threat_url' => :'BOOLEAN',
|
54
|
+
:'contains_threat_host' => :'BOOLEAN',
|
55
|
+
:'contains_threat_domain' => :'BOOLEAN',
|
56
|
+
:'input_url' => :'String'
|
57
|
+
}
|
58
|
+
end
|
59
|
+
|
60
|
+
# Initializes the object
|
61
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
62
|
+
def initialize(attributes = {})
|
63
|
+
return unless attributes.is_a?(Hash)
|
64
|
+
|
65
|
+
# convert string to symbol for hash key
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
67
|
+
|
68
|
+
if attributes.has_key?(:'CleanResult')
|
69
|
+
self.clean_result = attributes[:'CleanResult']
|
70
|
+
end
|
71
|
+
|
72
|
+
if attributes.has_key?(:'Risk')
|
73
|
+
self.risk = attributes[:'Risk']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.has_key?(:'ContainsThreatUrl')
|
77
|
+
self.contains_threat_url = attributes[:'ContainsThreatUrl']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.has_key?(:'ContainsThreatHost')
|
81
|
+
self.contains_threat_host = attributes[:'ContainsThreatHost']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.has_key?(:'ContainsThreatDomain')
|
85
|
+
self.contains_threat_domain = attributes[:'ContainsThreatDomain']
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.has_key?(:'InputUrl')
|
89
|
+
self.input_url = attributes[:'InputUrl']
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
94
|
+
# @return Array for valid properties with the reasons
|
95
|
+
def list_invalid_properties
|
96
|
+
invalid_properties = Array.new
|
97
|
+
invalid_properties
|
98
|
+
end
|
99
|
+
|
100
|
+
# Check to see if the all the properties in the model are valid
|
101
|
+
# @return true if the model is valid
|
102
|
+
def valid?
|
103
|
+
true
|
104
|
+
end
|
105
|
+
|
106
|
+
# Checks equality by comparing each attribute.
|
107
|
+
# @param [Object] Object to be compared
|
108
|
+
def ==(o)
|
109
|
+
return true if self.equal?(o)
|
110
|
+
self.class == o.class &&
|
111
|
+
clean_result == o.clean_result &&
|
112
|
+
risk == o.risk &&
|
113
|
+
contains_threat_url == o.contains_threat_url &&
|
114
|
+
contains_threat_host == o.contains_threat_host &&
|
115
|
+
contains_threat_domain == o.contains_threat_domain &&
|
116
|
+
input_url == o.input_url
|
117
|
+
end
|
118
|
+
|
119
|
+
# @see the `==` method
|
120
|
+
# @param [Object] Object to be compared
|
121
|
+
def eql?(o)
|
122
|
+
self == o
|
123
|
+
end
|
124
|
+
|
125
|
+
# Calculates hash code according to all attributes.
|
126
|
+
# @return [Fixnum] Hash code
|
127
|
+
def hash
|
128
|
+
[clean_result, risk, contains_threat_url, contains_threat_host, contains_threat_domain, input_url].hash
|
129
|
+
end
|
130
|
+
|
131
|
+
# Builds the object from hash
|
132
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
133
|
+
# @return [Object] Returns the model itself
|
134
|
+
def build_from_hash(attributes)
|
135
|
+
return nil unless attributes.is_a?(Hash)
|
136
|
+
self.class.swagger_types.each_pair do |key, type|
|
137
|
+
if type =~ /\AArray<(.*)>/i
|
138
|
+
# check to ensure the input is an array given that the attribute
|
139
|
+
# is documented as an array but the input is not
|
140
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
141
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
142
|
+
end
|
143
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
144
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
145
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
146
|
+
end
|
147
|
+
|
148
|
+
self
|
149
|
+
end
|
150
|
+
|
151
|
+
# Deserializes the data based on type
|
152
|
+
# @param string type Data type
|
153
|
+
# @param string value Value to be deserialized
|
154
|
+
# @return [Object] Deserialized data
|
155
|
+
def _deserialize(type, value)
|
156
|
+
case type.to_sym
|
157
|
+
when :DateTime
|
158
|
+
DateTime.parse(value)
|
159
|
+
when :Date
|
160
|
+
Date.parse(value)
|
161
|
+
when :String
|
162
|
+
value.to_s
|
163
|
+
when :Integer
|
164
|
+
value.to_i
|
165
|
+
when :Float
|
166
|
+
value.to_f
|
167
|
+
when :BOOLEAN
|
168
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
169
|
+
true
|
170
|
+
else
|
171
|
+
false
|
172
|
+
end
|
173
|
+
when :Object
|
174
|
+
# generic object (usually a Hash), return directly
|
175
|
+
value
|
176
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
177
|
+
inner_type = Regexp.last_match[:inner_type]
|
178
|
+
value.map { |v| _deserialize(inner_type, v) }
|
179
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
180
|
+
k_type = Regexp.last_match[:k_type]
|
181
|
+
v_type = Regexp.last_match[:v_type]
|
182
|
+
{}.tap do |hash|
|
183
|
+
value.each do |k, v|
|
184
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
185
|
+
end
|
186
|
+
end
|
187
|
+
else # model
|
188
|
+
temp_model = CloudmersivePhishingDetectionApiClient.const_get(type).new
|
189
|
+
temp_model.build_from_hash(value)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
# Returns the string representation of the object
|
194
|
+
# @return [String] String presentation of the object
|
195
|
+
def to_s
|
196
|
+
to_hash.to_s
|
197
|
+
end
|
198
|
+
|
199
|
+
# to_body is an alias to to_hash (backward compatibility)
|
200
|
+
# @return [Hash] Returns the object in the form of hash
|
201
|
+
def to_body
|
202
|
+
to_hash
|
203
|
+
end
|
204
|
+
|
205
|
+
# Returns the object in the form of hash
|
206
|
+
# @return [Hash] Returns the object in the form of hash
|
207
|
+
def to_hash
|
208
|
+
hash = {}
|
209
|
+
self.class.attribute_map.each_pair do |attr, param|
|
210
|
+
value = self.send(attr)
|
211
|
+
next if value.nil?
|
212
|
+
hash[param] = _to_hash(value)
|
213
|
+
end
|
214
|
+
hash
|
215
|
+
end
|
216
|
+
|
217
|
+
# Outputs non-array value in the form of hash
|
218
|
+
# For object, use to_hash. Otherwise, just return the value
|
219
|
+
# @param [Object] value Any valid value
|
220
|
+
# @return [Hash] Returns the value in the form of hash
|
221
|
+
def _to_hash(value)
|
222
|
+
if value.is_a?(Array)
|
223
|
+
value.compact.map { |v| _to_hash(v) }
|
224
|
+
elsif value.is_a?(Hash)
|
225
|
+
{}.tap do |hash|
|
226
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
227
|
+
end
|
228
|
+
elsif value.respond_to? :to_hash
|
229
|
+
value.to_hash
|
230
|
+
else
|
231
|
+
value
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
end
|
236
|
+
end
|
@@ -0,0 +1,198 @@
|
|
1
|
+
=begin
|
2
|
+
#phishingapi
|
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 CloudmersivePhishingDetectionApiClient
|
16
|
+
# Responses for the batch calls to Phishing Url
|
17
|
+
class PhishingUrlResponseBatch
|
18
|
+
# Specifies if all the urls (or its hosts or domains) in this batch call passed all the checks or not.
|
19
|
+
attr_accessor :clean_result
|
20
|
+
|
21
|
+
# Dictionary where the requesting url is the key and the value is the resulting validation
|
22
|
+
attr_accessor :url_responses
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'clean_result' => :'CleanResult',
|
28
|
+
:'url_responses' => :'UrlResponses'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.swagger_types
|
34
|
+
{
|
35
|
+
:'clean_result' => :'BOOLEAN',
|
36
|
+
:'url_responses' => :'Array<PhishingUrlResponse>'
|
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?(:'CleanResult')
|
49
|
+
self.clean_result = attributes[:'CleanResult']
|
50
|
+
end
|
51
|
+
|
52
|
+
if attributes.has_key?(:'UrlResponses')
|
53
|
+
if (value = attributes[:'UrlResponses']).is_a?(Array)
|
54
|
+
self.url_responses = value
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
60
|
+
# @return Array for valid properties with the reasons
|
61
|
+
def list_invalid_properties
|
62
|
+
invalid_properties = Array.new
|
63
|
+
invalid_properties
|
64
|
+
end
|
65
|
+
|
66
|
+
# Check to see if the all the properties in the model are valid
|
67
|
+
# @return true if the model is valid
|
68
|
+
def valid?
|
69
|
+
true
|
70
|
+
end
|
71
|
+
|
72
|
+
# Checks equality by comparing each attribute.
|
73
|
+
# @param [Object] Object to be compared
|
74
|
+
def ==(o)
|
75
|
+
return true if self.equal?(o)
|
76
|
+
self.class == o.class &&
|
77
|
+
clean_result == o.clean_result &&
|
78
|
+
url_responses == o.url_responses
|
79
|
+
end
|
80
|
+
|
81
|
+
# @see the `==` method
|
82
|
+
# @param [Object] Object to be compared
|
83
|
+
def eql?(o)
|
84
|
+
self == o
|
85
|
+
end
|
86
|
+
|
87
|
+
# Calculates hash code according to all attributes.
|
88
|
+
# @return [Fixnum] Hash code
|
89
|
+
def hash
|
90
|
+
[clean_result, url_responses].hash
|
91
|
+
end
|
92
|
+
|
93
|
+
# Builds the object from hash
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
95
|
+
# @return [Object] Returns the model itself
|
96
|
+
def build_from_hash(attributes)
|
97
|
+
return nil unless attributes.is_a?(Hash)
|
98
|
+
self.class.swagger_types.each_pair do |key, type|
|
99
|
+
if type =~ /\AArray<(.*)>/i
|
100
|
+
# check to ensure the input is an array given that the attribute
|
101
|
+
# is documented as an array but the input is not
|
102
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
103
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
104
|
+
end
|
105
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
106
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
107
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
108
|
+
end
|
109
|
+
|
110
|
+
self
|
111
|
+
end
|
112
|
+
|
113
|
+
# Deserializes the data based on type
|
114
|
+
# @param string type Data type
|
115
|
+
# @param string value Value to be deserialized
|
116
|
+
# @return [Object] Deserialized data
|
117
|
+
def _deserialize(type, value)
|
118
|
+
case type.to_sym
|
119
|
+
when :DateTime
|
120
|
+
DateTime.parse(value)
|
121
|
+
when :Date
|
122
|
+
Date.parse(value)
|
123
|
+
when :String
|
124
|
+
value.to_s
|
125
|
+
when :Integer
|
126
|
+
value.to_i
|
127
|
+
when :Float
|
128
|
+
value.to_f
|
129
|
+
when :BOOLEAN
|
130
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
131
|
+
true
|
132
|
+
else
|
133
|
+
false
|
134
|
+
end
|
135
|
+
when :Object
|
136
|
+
# generic object (usually a Hash), return directly
|
137
|
+
value
|
138
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
139
|
+
inner_type = Regexp.last_match[:inner_type]
|
140
|
+
value.map { |v| _deserialize(inner_type, v) }
|
141
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
142
|
+
k_type = Regexp.last_match[:k_type]
|
143
|
+
v_type = Regexp.last_match[:v_type]
|
144
|
+
{}.tap do |hash|
|
145
|
+
value.each do |k, v|
|
146
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
else # model
|
150
|
+
temp_model = CloudmersivePhishingDetectionApiClient.const_get(type).new
|
151
|
+
temp_model.build_from_hash(value)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
# Returns the string representation of the object
|
156
|
+
# @return [String] String presentation of the object
|
157
|
+
def to_s
|
158
|
+
to_hash.to_s
|
159
|
+
end
|
160
|
+
|
161
|
+
# to_body is an alias to to_hash (backward compatibility)
|
162
|
+
# @return [Hash] Returns the object in the form of hash
|
163
|
+
def to_body
|
164
|
+
to_hash
|
165
|
+
end
|
166
|
+
|
167
|
+
# Returns the object in the form of hash
|
168
|
+
# @return [Hash] Returns the object in the form of hash
|
169
|
+
def to_hash
|
170
|
+
hash = {}
|
171
|
+
self.class.attribute_map.each_pair do |attr, param|
|
172
|
+
value = self.send(attr)
|
173
|
+
next if value.nil?
|
174
|
+
hash[param] = _to_hash(value)
|
175
|
+
end
|
176
|
+
hash
|
177
|
+
end
|
178
|
+
|
179
|
+
# Outputs non-array value in the form of hash
|
180
|
+
# For object, use to_hash. Otherwise, just return the value
|
181
|
+
# @param [Object] value Any valid value
|
182
|
+
# @return [Hash] Returns the value in the form of hash
|
183
|
+
def _to_hash(value)
|
184
|
+
if value.is_a?(Array)
|
185
|
+
value.compact.map { |v| _to_hash(v) }
|
186
|
+
elsif value.is_a?(Hash)
|
187
|
+
{}.tap do |hash|
|
188
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
189
|
+
end
|
190
|
+
elsif value.respond_to? :to_hash
|
191
|
+
value.to_hash
|
192
|
+
else
|
193
|
+
value
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
end
|
198
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
=begin
|
2
|
+
#phishingapi
|
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
|
+
module CloudmersivePhishingDetectionApiClient
|
14
|
+
VERSION = '2.2.0'
|
15
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
=begin
|
2
|
+
#phishingapi
|
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
|
+
# Common files
|
14
|
+
require 'cloudmersive-phishing-detection-api-client/api_client'
|
15
|
+
require 'cloudmersive-phishing-detection-api-client/api_error'
|
16
|
+
require 'cloudmersive-phishing-detection-api-client/version'
|
17
|
+
require 'cloudmersive-phishing-detection-api-client/configuration'
|
18
|
+
|
19
|
+
# Models
|
20
|
+
require 'cloudmersive-phishing-detection-api-client/models/phishing_url_advanced_request'
|
21
|
+
require 'cloudmersive-phishing-detection-api-client/models/phishing_url_advanced_request_batch'
|
22
|
+
require 'cloudmersive-phishing-detection-api-client/models/phishing_url_advanced_response'
|
23
|
+
require 'cloudmersive-phishing-detection-api-client/models/phishing_url_advanced_response_batch'
|
24
|
+
require 'cloudmersive-phishing-detection-api-client/models/phishing_url_request'
|
25
|
+
require 'cloudmersive-phishing-detection-api-client/models/phishing_url_response'
|
26
|
+
require 'cloudmersive-phishing-detection-api-client/models/phishing_url_response_batch'
|
27
|
+
|
28
|
+
# APIs
|
29
|
+
require 'cloudmersive-phishing-detection-api-client/api/phishing_url_api'
|
30
|
+
require 'cloudmersive-phishing-detection-api-client/api/phishing_url_batch_api'
|
31
|
+
|
32
|
+
module CloudmersivePhishingDetectionApiClient
|
33
|
+
class << self
|
34
|
+
# Customize default settings for the SDK using block.
|
35
|
+
# CloudmersivePhishingDetectionApiClient.configure do |config|
|
36
|
+
# config.username = "xxx"
|
37
|
+
# config.password = "xxx"
|
38
|
+
# end
|
39
|
+
# If no block given, return the default Configuration object.
|
40
|
+
def configure
|
41
|
+
if block_given?
|
42
|
+
yield(Configuration.default)
|
43
|
+
else
|
44
|
+
Configuration.default
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
=begin
|
2
|
+
#phishingapi
|
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
|
+
|
16
|
+
# Unit tests for CloudmersivePhishingDetectionApiClient::PhishingUrlApi
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'PhishingUrlApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@instance = CloudmersivePhishingDetectionApiClient::PhishingUrlApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of PhishingUrlApi' do
|
30
|
+
it 'should create an instance of PhishingUrlApi' do
|
31
|
+
expect(@instance).to be_instance_of(CloudmersivePhishingDetectionApiClient::PhishingUrlApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for phishing_url_advanced_post
|
36
|
+
# Use advanced AI detection to determine if a URL is a known phishing threat
|
37
|
+
# Uses advanced AI and deterministic methods to detect if a URL is a phishing threat.
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [PhishingUrlAdvancedRequest] :body
|
40
|
+
# @return [PhishingUrlAdvancedResponse]
|
41
|
+
describe 'phishing_url_advanced_post test' 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
|
+
# unit tests for phishing_url_post
|
48
|
+
# Use AI and deterministic detection to determine if a URL is a phishing threat
|
49
|
+
# Uses AI and deterministic methods to detect if a URL is a phishing threat.
|
50
|
+
# @param [Hash] opts the optional parameters
|
51
|
+
# @option opts [PhishingUrlRequest] :body
|
52
|
+
# @return [PhishingUrlResponse]
|
53
|
+
describe 'phishing_url_post test' 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
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
=begin
|
2
|
+
#phishingapi
|
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
|
+
|
16
|
+
# Unit tests for CloudmersivePhishingDetectionApiClient::PhishingUrlBatchApi
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'PhishingUrlBatchApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@instance = CloudmersivePhishingDetectionApiClient::PhishingUrlBatchApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of PhishingUrlBatchApi' do
|
30
|
+
it 'should create an instance of PhishingUrlBatchApi' do
|
31
|
+
expect(@instance).to be_instance_of(CloudmersivePhishingDetectionApiClient::PhishingUrlBatchApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for phishing_url_advanced_batch_post
|
36
|
+
# Accept multiple urls at once to perform lookups to see if the urls are known phishing sites as well as multiple other scans to determine if the URL is a potential phishing threat.
|
37
|
+
# Uses advanced AI and deterministic methods to detect if a URL is a phishing threat.
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [PhishingUrlAdvancedRequestBatch] :body
|
40
|
+
# @return [PhishingUrlAdvancedResponseBatch]
|
41
|
+
describe 'phishing_url_advanced_batch_post test' 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
|
+
# unit tests for phishing_url_batch_post
|
48
|
+
# Accept multiple urls at oncee and perform AI and deterministic methods to detect if a URL is a phishing threat.
|
49
|
+
# Uses AI and deterministic methods to detect if a URL is a phishing threat.
|
50
|
+
# @param [Hash] opts the optional parameters
|
51
|
+
# @option opts [Array<PhishingUrlRequest>] :body
|
52
|
+
# @return [PhishingUrlResponseBatch]
|
53
|
+
describe 'phishing_url_batch_post test' 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
|
+
end
|