cloudmersive-virus-scan-api-client 1.3.4 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. metadata +3 -34
  3. data/Gemfile +0 -7
  4. data/README.md +0 -108
  5. data/Rakefile +0 -8
  6. data/cloudmersive-virus-scan-api-client.gemspec +0 -45
  7. data/docs/ScanApi.md +0 -185
  8. data/docs/VirusFound.md +0 -9
  9. data/docs/VirusScanAdvancedResult.md +0 -15
  10. data/docs/VirusScanResult.md +0 -9
  11. data/docs/WebsiteScanRequest.md +0 -8
  12. data/docs/WebsiteScanResult.md +0 -11
  13. data/git_push.sh +0 -55
  14. data/lib/cloudmersive-virus-scan-api-client.rb +0 -45
  15. data/lib/cloudmersive-virus-scan-api-client/api/scan_api.rb +0 -205
  16. data/lib/cloudmersive-virus-scan-api-client/api_client.rb +0 -389
  17. data/lib/cloudmersive-virus-scan-api-client/api_error.rb +0 -38
  18. data/lib/cloudmersive-virus-scan-api-client/configuration.rb +0 -209
  19. data/lib/cloudmersive-virus-scan-api-client/models/virus_found.rb +0 -199
  20. data/lib/cloudmersive-virus-scan-api-client/models/virus_scan_advanced_result.rb +0 -261
  21. data/lib/cloudmersive-virus-scan-api-client/models/virus_scan_result.rb +0 -201
  22. data/lib/cloudmersive-virus-scan-api-client/models/website_scan_request.rb +0 -189
  23. data/lib/cloudmersive-virus-scan-api-client/models/website_scan_result.rb +0 -254
  24. data/lib/cloudmersive-virus-scan-api-client/version.rb +0 -15
  25. data/spec/api/scan_api_spec.rb +0 -76
  26. data/spec/api_client_spec.rb +0 -226
  27. data/spec/configuration_spec.rb +0 -42
  28. data/spec/models/virus_found_spec.rb +0 -48
  29. data/spec/models/virus_scan_advanced_result_spec.rb +0 -84
  30. data/spec/models/virus_scan_result_spec.rb +0 -48
  31. data/spec/models/website_scan_request_spec.rb +0 -42
  32. data/spec/models/website_scan_result_spec.rb +0 -64
  33. data/spec/spec_helper.rb +0 -111
@@ -1,201 +0,0 @@
1
- =begin
2
- #virusapi
3
-
4
- #The Cloudmersive Virus Scan API lets you scan files and content for viruses and identify security issues with content.
5
-
6
- OpenAPI spec version: v1
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module CloudmersiveVirusScanApiClient
16
- # Result of running a virus scan
17
- class VirusScanResult
18
- # True if the scan contained no viruses, false otherwise
19
- attr_accessor :clean_result
20
-
21
- # Array of viruses found, if any
22
- attr_accessor :found_viruses
23
-
24
-
25
- # Attribute mapping from ruby-style variable name to JSON key.
26
- def self.attribute_map
27
- {
28
- :'clean_result' => :'CleanResult',
29
- :'found_viruses' => :'FoundViruses'
30
- }
31
- end
32
-
33
- # Attribute type mapping.
34
- def self.swagger_types
35
- {
36
- :'clean_result' => :'BOOLEAN',
37
- :'found_viruses' => :'Array<VirusFound>'
38
- }
39
- end
40
-
41
- # Initializes the object
42
- # @param [Hash] attributes Model attributes in the form of hash
43
- def initialize(attributes = {})
44
- return unless attributes.is_a?(Hash)
45
-
46
- # convert string to symbol for hash key
47
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
48
-
49
- if attributes.has_key?(:'CleanResult')
50
- self.clean_result = attributes[:'CleanResult']
51
- end
52
-
53
- if attributes.has_key?(:'FoundViruses')
54
- if (value = attributes[:'FoundViruses']).is_a?(Array)
55
- self.found_viruses = value
56
- end
57
- end
58
-
59
- end
60
-
61
- # Show invalid properties with the reasons. Usually used together with valid?
62
- # @return Array for valid properties with the reasons
63
- def list_invalid_properties
64
- invalid_properties = Array.new
65
- return invalid_properties
66
- end
67
-
68
- # Check to see if the all the properties in the model are valid
69
- # @return true if the model is valid
70
- def valid?
71
- return true
72
- end
73
-
74
- # Checks equality by comparing each attribute.
75
- # @param [Object] Object to be compared
76
- def ==(o)
77
- return true if self.equal?(o)
78
- self.class == o.class &&
79
- clean_result == o.clean_result &&
80
- found_viruses == o.found_viruses
81
- end
82
-
83
- # @see the `==` method
84
- # @param [Object] Object to be compared
85
- def eql?(o)
86
- self == o
87
- end
88
-
89
- # Calculates hash code according to all attributes.
90
- # @return [Fixnum] Hash code
91
- def hash
92
- [clean_result, found_viruses].hash
93
- end
94
-
95
- # Builds the object from hash
96
- # @param [Hash] attributes Model attributes in the form of hash
97
- # @return [Object] Returns the model itself
98
- def build_from_hash(attributes)
99
- return nil unless attributes.is_a?(Hash)
100
- self.class.swagger_types.each_pair do |key, type|
101
- if type =~ /\AArray<(.*)>/i
102
- # check to ensure the input is an array given that the the attribute
103
- # is documented as an array but the input is not
104
- if attributes[self.class.attribute_map[key]].is_a?(Array)
105
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
106
- end
107
- elsif !attributes[self.class.attribute_map[key]].nil?
108
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
109
- end # or else data not found in attributes(hash), not an issue as the data can be optional
110
- end
111
-
112
- self
113
- end
114
-
115
- # Deserializes the data based on type
116
- # @param string type Data type
117
- # @param string value Value to be deserialized
118
- # @return [Object] Deserialized data
119
- def _deserialize(type, value)
120
- case type.to_sym
121
- when :DateTime
122
- DateTime.parse(value)
123
- when :Date
124
- Date.parse(value)
125
- when :String
126
- value.to_s
127
- when :Integer
128
- value.to_i
129
- when :Float
130
- value.to_f
131
- when :BOOLEAN
132
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
133
- true
134
- else
135
- false
136
- end
137
- when :Object
138
- # generic object (usually a Hash), return directly
139
- value
140
- when /\AArray<(?<inner_type>.+)>\z/
141
- inner_type = Regexp.last_match[:inner_type]
142
- value.map { |v| _deserialize(inner_type, v) }
143
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
144
- k_type = Regexp.last_match[:k_type]
145
- v_type = Regexp.last_match[:v_type]
146
- {}.tap do |hash|
147
- value.each do |k, v|
148
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
149
- end
150
- end
151
- else # model
152
- temp_model = CloudmersiveVirusScanApiClient.const_get(type).new
153
- temp_model.build_from_hash(value)
154
- end
155
- end
156
-
157
- # Returns the string representation of the object
158
- # @return [String] String presentation of the object
159
- def to_s
160
- to_hash.to_s
161
- end
162
-
163
- # to_body is an alias to to_hash (backward compatibility)
164
- # @return [Hash] Returns the object in the form of hash
165
- def to_body
166
- to_hash
167
- end
168
-
169
- # Returns the object in the form of hash
170
- # @return [Hash] Returns the object in the form of hash
171
- def to_hash
172
- hash = {}
173
- self.class.attribute_map.each_pair do |attr, param|
174
- value = self.send(attr)
175
- next if value.nil?
176
- hash[param] = _to_hash(value)
177
- end
178
- hash
179
- end
180
-
181
- # Outputs non-array value in the form of hash
182
- # For object, use to_hash. Otherwise, just return the value
183
- # @param [Object] value Any valid value
184
- # @return [Hash] Returns the value in the form of hash
185
- def _to_hash(value)
186
- if value.is_a?(Array)
187
- value.compact.map{ |v| _to_hash(v) }
188
- elsif value.is_a?(Hash)
189
- {}.tap do |hash|
190
- value.each { |k, v| hash[k] = _to_hash(v) }
191
- end
192
- elsif value.respond_to? :to_hash
193
- value.to_hash
194
- else
195
- value
196
- end
197
- end
198
-
199
- end
200
-
201
- end
@@ -1,189 +0,0 @@
1
- =begin
2
- #virusapi
3
-
4
- #The Cloudmersive Virus Scan API lets you scan files and content for viruses and identify security issues with content.
5
-
6
- OpenAPI spec version: v1
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module CloudmersiveVirusScanApiClient
16
- # Request to scan a website for malicious content
17
- class WebsiteScanRequest
18
- # URL of the website to scan; should begin with http:// or https://
19
- attr_accessor :url
20
-
21
-
22
- # Attribute mapping from ruby-style variable name to JSON key.
23
- def self.attribute_map
24
- {
25
- :'url' => :'Url'
26
- }
27
- end
28
-
29
- # Attribute type mapping.
30
- def self.swagger_types
31
- {
32
- :'url' => :'String'
33
- }
34
- end
35
-
36
- # Initializes the object
37
- # @param [Hash] attributes Model attributes in the form of hash
38
- def initialize(attributes = {})
39
- return unless attributes.is_a?(Hash)
40
-
41
- # convert string to symbol for hash key
42
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
43
-
44
- if attributes.has_key?(:'Url')
45
- self.url = attributes[:'Url']
46
- end
47
-
48
- end
49
-
50
- # Show invalid properties with the reasons. Usually used together with valid?
51
- # @return Array for valid properties with the reasons
52
- def list_invalid_properties
53
- invalid_properties = Array.new
54
- return invalid_properties
55
- end
56
-
57
- # Check to see if the all the properties in the model are valid
58
- # @return true if the model is valid
59
- def valid?
60
- return true
61
- end
62
-
63
- # Checks equality by comparing each attribute.
64
- # @param [Object] Object to be compared
65
- def ==(o)
66
- return true if self.equal?(o)
67
- self.class == o.class &&
68
- url == o.url
69
- end
70
-
71
- # @see the `==` method
72
- # @param [Object] Object to be compared
73
- def eql?(o)
74
- self == o
75
- end
76
-
77
- # Calculates hash code according to all attributes.
78
- # @return [Fixnum] Hash code
79
- def hash
80
- [url].hash
81
- end
82
-
83
- # Builds the object from hash
84
- # @param [Hash] attributes Model attributes in the form of hash
85
- # @return [Object] Returns the model itself
86
- def build_from_hash(attributes)
87
- return nil unless attributes.is_a?(Hash)
88
- self.class.swagger_types.each_pair do |key, type|
89
- if type =~ /\AArray<(.*)>/i
90
- # check to ensure the input is an array given that the the attribute
91
- # is documented as an array but the input is not
92
- if attributes[self.class.attribute_map[key]].is_a?(Array)
93
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
94
- end
95
- elsif !attributes[self.class.attribute_map[key]].nil?
96
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
97
- end # or else data not found in attributes(hash), not an issue as the data can be optional
98
- end
99
-
100
- self
101
- end
102
-
103
- # Deserializes the data based on type
104
- # @param string type Data type
105
- # @param string value Value to be deserialized
106
- # @return [Object] Deserialized data
107
- def _deserialize(type, value)
108
- case type.to_sym
109
- when :DateTime
110
- DateTime.parse(value)
111
- when :Date
112
- Date.parse(value)
113
- when :String
114
- value.to_s
115
- when :Integer
116
- value.to_i
117
- when :Float
118
- value.to_f
119
- when :BOOLEAN
120
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
121
- true
122
- else
123
- false
124
- end
125
- when :Object
126
- # generic object (usually a Hash), return directly
127
- value
128
- when /\AArray<(?<inner_type>.+)>\z/
129
- inner_type = Regexp.last_match[:inner_type]
130
- value.map { |v| _deserialize(inner_type, v) }
131
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
132
- k_type = Regexp.last_match[:k_type]
133
- v_type = Regexp.last_match[:v_type]
134
- {}.tap do |hash|
135
- value.each do |k, v|
136
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
137
- end
138
- end
139
- else # model
140
- temp_model = CloudmersiveVirusScanApiClient.const_get(type).new
141
- temp_model.build_from_hash(value)
142
- end
143
- end
144
-
145
- # Returns the string representation of the object
146
- # @return [String] String presentation of the object
147
- def to_s
148
- to_hash.to_s
149
- end
150
-
151
- # to_body is an alias to to_hash (backward compatibility)
152
- # @return [Hash] Returns the object in the form of hash
153
- def to_body
154
- to_hash
155
- end
156
-
157
- # Returns the object in the form of hash
158
- # @return [Hash] Returns the object in the form of hash
159
- def to_hash
160
- hash = {}
161
- self.class.attribute_map.each_pair do |attr, param|
162
- value = self.send(attr)
163
- next if value.nil?
164
- hash[param] = _to_hash(value)
165
- end
166
- hash
167
- end
168
-
169
- # Outputs non-array value in the form of hash
170
- # For object, use to_hash. Otherwise, just return the value
171
- # @param [Object] value Any valid value
172
- # @return [Hash] Returns the value in the form of hash
173
- def _to_hash(value)
174
- if value.is_a?(Array)
175
- value.compact.map{ |v| _to_hash(v) }
176
- elsif value.is_a?(Hash)
177
- {}.tap do |hash|
178
- value.each { |k, v| hash[k] = _to_hash(v) }
179
- end
180
- elsif value.respond_to? :to_hash
181
- value.to_hash
182
- else
183
- value
184
- end
185
- end
186
-
187
- end
188
-
189
- end
@@ -1,254 +0,0 @@
1
- =begin
2
- #virusapi
3
-
4
- #The Cloudmersive Virus Scan API lets you scan files and content for viruses and identify security issues with content.
5
-
6
- OpenAPI spec version: v1
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module CloudmersiveVirusScanApiClient
16
- # Result of running a website scan
17
- class WebsiteScanResult
18
- # True if the scan contained no threats, false otherwise
19
- attr_accessor :clean_result
20
-
21
- # Type of threat returned; can be None, Malware, ForcedDownload or Phishing
22
- attr_accessor :website_threat_type
23
-
24
- # Array of viruses found, if any
25
- attr_accessor :found_viruses
26
-
27
- # The remote server URL HTTP reasponse code; useful for debugging issues with scanning; typically if the remote server returns a 200 or 300-series code this means a successful response, while a 400 or 500 series code would represent an error returned from the remote server for the provided URL.
28
- attr_accessor :website_http_response_code
29
-
30
- class EnumAttributeValidator
31
- attr_reader :datatype
32
- attr_reader :allowable_values
33
-
34
- def initialize(datatype, allowable_values)
35
- @allowable_values = allowable_values.map do |value|
36
- case datatype.to_s
37
- when /Integer/i
38
- value.to_i
39
- when /Float/i
40
- value.to_f
41
- else
42
- value
43
- end
44
- end
45
- end
46
-
47
- def valid?(value)
48
- !value || allowable_values.include?(value)
49
- end
50
- end
51
-
52
- # Attribute mapping from ruby-style variable name to JSON key.
53
- def self.attribute_map
54
- {
55
- :'clean_result' => :'CleanResult',
56
- :'website_threat_type' => :'WebsiteThreatType',
57
- :'found_viruses' => :'FoundViruses',
58
- :'website_http_response_code' => :'WebsiteHttpResponseCode'
59
- }
60
- end
61
-
62
- # Attribute type mapping.
63
- def self.swagger_types
64
- {
65
- :'clean_result' => :'BOOLEAN',
66
- :'website_threat_type' => :'String',
67
- :'found_viruses' => :'Array<VirusFound>',
68
- :'website_http_response_code' => :'Integer'
69
- }
70
- end
71
-
72
- # Initializes the object
73
- # @param [Hash] attributes Model attributes in the form of hash
74
- def initialize(attributes = {})
75
- return unless attributes.is_a?(Hash)
76
-
77
- # convert string to symbol for hash key
78
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
79
-
80
- if attributes.has_key?(:'CleanResult')
81
- self.clean_result = attributes[:'CleanResult']
82
- end
83
-
84
- if attributes.has_key?(:'WebsiteThreatType')
85
- self.website_threat_type = attributes[:'WebsiteThreatType']
86
- end
87
-
88
- if attributes.has_key?(:'FoundViruses')
89
- if (value = attributes[:'FoundViruses']).is_a?(Array)
90
- self.found_viruses = value
91
- end
92
- end
93
-
94
- if attributes.has_key?(:'WebsiteHttpResponseCode')
95
- self.website_http_response_code = attributes[:'WebsiteHttpResponseCode']
96
- end
97
-
98
- end
99
-
100
- # Show invalid properties with the reasons. Usually used together with valid?
101
- # @return Array for valid properties with the reasons
102
- def list_invalid_properties
103
- invalid_properties = Array.new
104
- return invalid_properties
105
- end
106
-
107
- # Check to see if the all the properties in the model are valid
108
- # @return true if the model is valid
109
- def valid?
110
- website_threat_type_validator = EnumAttributeValidator.new('String', ["None", "Malware", "Phishing", "ForcedDownload", "UnableToConnect"])
111
- return false unless website_threat_type_validator.valid?(@website_threat_type)
112
- return true
113
- end
114
-
115
- # Custom attribute writer method checking allowed values (enum).
116
- # @param [Object] website_threat_type Object to be assigned
117
- def website_threat_type=(website_threat_type)
118
- validator = EnumAttributeValidator.new('String', ["None", "Malware", "Phishing", "ForcedDownload", "UnableToConnect"])
119
- unless validator.valid?(website_threat_type)
120
- fail ArgumentError, "invalid value for 'website_threat_type', must be one of #{validator.allowable_values}."
121
- end
122
- @website_threat_type = website_threat_type
123
- end
124
-
125
- # Checks equality by comparing each attribute.
126
- # @param [Object] Object to be compared
127
- def ==(o)
128
- return true if self.equal?(o)
129
- self.class == o.class &&
130
- clean_result == o.clean_result &&
131
- website_threat_type == o.website_threat_type &&
132
- found_viruses == o.found_viruses &&
133
- website_http_response_code == o.website_http_response_code
134
- end
135
-
136
- # @see the `==` method
137
- # @param [Object] Object to be compared
138
- def eql?(o)
139
- self == o
140
- end
141
-
142
- # Calculates hash code according to all attributes.
143
- # @return [Fixnum] Hash code
144
- def hash
145
- [clean_result, website_threat_type, found_viruses, website_http_response_code].hash
146
- end
147
-
148
- # Builds the object from hash
149
- # @param [Hash] attributes Model attributes in the form of hash
150
- # @return [Object] Returns the model itself
151
- def build_from_hash(attributes)
152
- return nil unless attributes.is_a?(Hash)
153
- self.class.swagger_types.each_pair do |key, type|
154
- if type =~ /\AArray<(.*)>/i
155
- # check to ensure the input is an array given that the the attribute
156
- # is documented as an array but the input is not
157
- if attributes[self.class.attribute_map[key]].is_a?(Array)
158
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
159
- end
160
- elsif !attributes[self.class.attribute_map[key]].nil?
161
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
162
- end # or else data not found in attributes(hash), not an issue as the data can be optional
163
- end
164
-
165
- self
166
- end
167
-
168
- # Deserializes the data based on type
169
- # @param string type Data type
170
- # @param string value Value to be deserialized
171
- # @return [Object] Deserialized data
172
- def _deserialize(type, value)
173
- case type.to_sym
174
- when :DateTime
175
- DateTime.parse(value)
176
- when :Date
177
- Date.parse(value)
178
- when :String
179
- value.to_s
180
- when :Integer
181
- value.to_i
182
- when :Float
183
- value.to_f
184
- when :BOOLEAN
185
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
186
- true
187
- else
188
- false
189
- end
190
- when :Object
191
- # generic object (usually a Hash), return directly
192
- value
193
- when /\AArray<(?<inner_type>.+)>\z/
194
- inner_type = Regexp.last_match[:inner_type]
195
- value.map { |v| _deserialize(inner_type, v) }
196
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
197
- k_type = Regexp.last_match[:k_type]
198
- v_type = Regexp.last_match[:v_type]
199
- {}.tap do |hash|
200
- value.each do |k, v|
201
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
202
- end
203
- end
204
- else # model
205
- temp_model = CloudmersiveVirusScanApiClient.const_get(type).new
206
- temp_model.build_from_hash(value)
207
- end
208
- end
209
-
210
- # Returns the string representation of the object
211
- # @return [String] String presentation of the object
212
- def to_s
213
- to_hash.to_s
214
- end
215
-
216
- # to_body is an alias to to_hash (backward compatibility)
217
- # @return [Hash] Returns the object in the form of hash
218
- def to_body
219
- to_hash
220
- end
221
-
222
- # Returns the object in the form of hash
223
- # @return [Hash] Returns the object in the form of hash
224
- def to_hash
225
- hash = {}
226
- self.class.attribute_map.each_pair do |attr, param|
227
- value = self.send(attr)
228
- next if value.nil?
229
- hash[param] = _to_hash(value)
230
- end
231
- hash
232
- end
233
-
234
- # Outputs non-array value in the form of hash
235
- # For object, use to_hash. Otherwise, just return the value
236
- # @param [Object] value Any valid value
237
- # @return [Hash] Returns the value in the form of hash
238
- def _to_hash(value)
239
- if value.is_a?(Array)
240
- value.compact.map{ |v| _to_hash(v) }
241
- elsif value.is_a?(Hash)
242
- {}.tap do |hash|
243
- value.each { |k, v| hash[k] = _to_hash(v) }
244
- end
245
- elsif value.respond_to? :to_hash
246
- value.to_hash
247
- else
248
- value
249
- end
250
- end
251
-
252
- end
253
-
254
- end