cloudmersive-virus-scan-api-client 1.3.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -27,6 +27,9 @@ module CloudmersiveVirusScanApiClient
27
27
  # True if the scan contained a script (such as a PHP script, Python script, etc.) which can be a significant risk factor
28
28
  attr_accessor :contains_script
29
29
 
30
+ # True if the scan contained a password protected or encrypted file, which can be a significant risk factor
31
+ attr_accessor :contains_password_protected_file
32
+
30
33
  # True if the uploaded file is of a type that is not allowed based on the optional restrictFileTypes parameter, false otherwise; if restrictFileTypes is not set, this will always be false
31
34
  attr_accessor :contains_restricted_file_format
32
35
 
@@ -36,7 +39,6 @@ module CloudmersiveVirusScanApiClient
36
39
  # Array of viruses found, if any
37
40
  attr_accessor :found_viruses
38
41
 
39
-
40
42
  # Attribute mapping from ruby-style variable name to JSON key.
41
43
  def self.attribute_map
42
44
  {
@@ -44,6 +46,7 @@ module CloudmersiveVirusScanApiClient
44
46
  :'contains_executable' => :'ContainsExecutable',
45
47
  :'contains_invalid_file' => :'ContainsInvalidFile',
46
48
  :'contains_script' => :'ContainsScript',
49
+ :'contains_password_protected_file' => :'ContainsPasswordProtectedFile',
47
50
  :'contains_restricted_file_format' => :'ContainsRestrictedFileFormat',
48
51
  :'verified_file_format' => :'VerifiedFileFormat',
49
52
  :'found_viruses' => :'FoundViruses'
@@ -57,6 +60,7 @@ module CloudmersiveVirusScanApiClient
57
60
  :'contains_executable' => :'BOOLEAN',
58
61
  :'contains_invalid_file' => :'BOOLEAN',
59
62
  :'contains_script' => :'BOOLEAN',
63
+ :'contains_password_protected_file' => :'BOOLEAN',
60
64
  :'contains_restricted_file_format' => :'BOOLEAN',
61
65
  :'verified_file_format' => :'String',
62
66
  :'found_viruses' => :'Array<VirusFound>'
@@ -69,7 +73,7 @@ module CloudmersiveVirusScanApiClient
69
73
  return unless attributes.is_a?(Hash)
70
74
 
71
75
  # convert string to symbol for hash key
72
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
76
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
73
77
 
74
78
  if attributes.has_key?(:'CleanResult')
75
79
  self.clean_result = attributes[:'CleanResult']
@@ -87,6 +91,10 @@ module CloudmersiveVirusScanApiClient
87
91
  self.contains_script = attributes[:'ContainsScript']
88
92
  end
89
93
 
94
+ if attributes.has_key?(:'ContainsPasswordProtectedFile')
95
+ self.contains_password_protected_file = attributes[:'ContainsPasswordProtectedFile']
96
+ end
97
+
90
98
  if attributes.has_key?(:'ContainsRestrictedFileFormat')
91
99
  self.contains_restricted_file_format = attributes[:'ContainsRestrictedFileFormat']
92
100
  end
@@ -100,20 +108,19 @@ module CloudmersiveVirusScanApiClient
100
108
  self.found_viruses = value
101
109
  end
102
110
  end
103
-
104
111
  end
105
112
 
106
113
  # Show invalid properties with the reasons. Usually used together with valid?
107
114
  # @return Array for valid properties with the reasons
108
115
  def list_invalid_properties
109
116
  invalid_properties = Array.new
110
- return invalid_properties
117
+ invalid_properties
111
118
  end
112
119
 
113
120
  # Check to see if the all the properties in the model are valid
114
121
  # @return true if the model is valid
115
122
  def valid?
116
- return true
123
+ true
117
124
  end
118
125
 
119
126
  # Checks equality by comparing each attribute.
@@ -125,6 +132,7 @@ module CloudmersiveVirusScanApiClient
125
132
  contains_executable == o.contains_executable &&
126
133
  contains_invalid_file == o.contains_invalid_file &&
127
134
  contains_script == o.contains_script &&
135
+ contains_password_protected_file == o.contains_password_protected_file &&
128
136
  contains_restricted_file_format == o.contains_restricted_file_format &&
129
137
  verified_file_format == o.verified_file_format &&
130
138
  found_viruses == o.found_viruses
@@ -139,7 +147,7 @@ module CloudmersiveVirusScanApiClient
139
147
  # Calculates hash code according to all attributes.
140
148
  # @return [Fixnum] Hash code
141
149
  def hash
142
- [clean_result, contains_executable, contains_invalid_file, contains_script, contains_restricted_file_format, verified_file_format, found_viruses].hash
150
+ [clean_result, contains_executable, contains_invalid_file, contains_script, contains_password_protected_file, contains_restricted_file_format, verified_file_format, found_viruses].hash
143
151
  end
144
152
 
145
153
  # Builds the object from hash
@@ -149,10 +157,10 @@ module CloudmersiveVirusScanApiClient
149
157
  return nil unless attributes.is_a?(Hash)
150
158
  self.class.swagger_types.each_pair do |key, type|
151
159
  if type =~ /\AArray<(.*)>/i
152
- # check to ensure the input is an array given that the the attribute
160
+ # check to ensure the input is an array given that the attribute
153
161
  # is documented as an array but the input is not
154
162
  if attributes[self.class.attribute_map[key]].is_a?(Array)
155
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
163
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
156
164
  end
157
165
  elsif !attributes[self.class.attribute_map[key]].nil?
158
166
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -234,7 +242,7 @@ module CloudmersiveVirusScanApiClient
234
242
  # @return [Hash] Returns the value in the form of hash
235
243
  def _to_hash(value)
236
244
  if value.is_a?(Array)
237
- value.compact.map{ |v| _to_hash(v) }
245
+ value.compact.map { |v| _to_hash(v) }
238
246
  elsif value.is_a?(Hash)
239
247
  {}.tap do |hash|
240
248
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -247,5 +255,4 @@ module CloudmersiveVirusScanApiClient
247
255
  end
248
256
 
249
257
  end
250
-
251
258
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -21,7 +21,6 @@ module CloudmersiveVirusScanApiClient
21
21
  # Array of viruses found, if any
22
22
  attr_accessor :found_viruses
23
23
 
24
-
25
24
  # Attribute mapping from ruby-style variable name to JSON key.
26
25
  def self.attribute_map
27
26
  {
@@ -44,7 +43,7 @@ module CloudmersiveVirusScanApiClient
44
43
  return unless attributes.is_a?(Hash)
45
44
 
46
45
  # convert string to symbol for hash key
47
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
46
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
48
47
 
49
48
  if attributes.has_key?(:'CleanResult')
50
49
  self.clean_result = attributes[:'CleanResult']
@@ -55,20 +54,19 @@ module CloudmersiveVirusScanApiClient
55
54
  self.found_viruses = value
56
55
  end
57
56
  end
58
-
59
57
  end
60
58
 
61
59
  # Show invalid properties with the reasons. Usually used together with valid?
62
60
  # @return Array for valid properties with the reasons
63
61
  def list_invalid_properties
64
62
  invalid_properties = Array.new
65
- return invalid_properties
63
+ invalid_properties
66
64
  end
67
65
 
68
66
  # Check to see if the all the properties in the model are valid
69
67
  # @return true if the model is valid
70
68
  def valid?
71
- return true
69
+ true
72
70
  end
73
71
 
74
72
  # Checks equality by comparing each attribute.
@@ -99,10 +97,10 @@ module CloudmersiveVirusScanApiClient
99
97
  return nil unless attributes.is_a?(Hash)
100
98
  self.class.swagger_types.each_pair do |key, type|
101
99
  if type =~ /\AArray<(.*)>/i
102
- # check to ensure the input is an array given that the the attribute
100
+ # check to ensure the input is an array given that the attribute
103
101
  # is documented as an array but the input is not
104
102
  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) } )
103
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
106
104
  end
107
105
  elsif !attributes[self.class.attribute_map[key]].nil?
108
106
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -184,7 +182,7 @@ module CloudmersiveVirusScanApiClient
184
182
  # @return [Hash] Returns the value in the form of hash
185
183
  def _to_hash(value)
186
184
  if value.is_a?(Array)
187
- value.compact.map{ |v| _to_hash(v) }
185
+ value.compact.map { |v| _to_hash(v) }
188
186
  elsif value.is_a?(Hash)
189
187
  {}.tap do |hash|
190
188
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -197,5 +195,4 @@ module CloudmersiveVirusScanApiClient
197
195
  end
198
196
 
199
197
  end
200
-
201
198
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -18,7 +18,6 @@ module CloudmersiveVirusScanApiClient
18
18
  # URL of the website to scan; should begin with http:// or https://
19
19
  attr_accessor :url
20
20
 
21
-
22
21
  # Attribute mapping from ruby-style variable name to JSON key.
23
22
  def self.attribute_map
24
23
  {
@@ -39,25 +38,24 @@ module CloudmersiveVirusScanApiClient
39
38
  return unless attributes.is_a?(Hash)
40
39
 
41
40
  # convert string to symbol for hash key
42
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
41
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
43
42
 
44
43
  if attributes.has_key?(:'Url')
45
44
  self.url = attributes[:'Url']
46
45
  end
47
-
48
46
  end
49
47
 
50
48
  # Show invalid properties with the reasons. Usually used together with valid?
51
49
  # @return Array for valid properties with the reasons
52
50
  def list_invalid_properties
53
51
  invalid_properties = Array.new
54
- return invalid_properties
52
+ invalid_properties
55
53
  end
56
54
 
57
55
  # Check to see if the all the properties in the model are valid
58
56
  # @return true if the model is valid
59
57
  def valid?
60
- return true
58
+ true
61
59
  end
62
60
 
63
61
  # Checks equality by comparing each attribute.
@@ -87,10 +85,10 @@ module CloudmersiveVirusScanApiClient
87
85
  return nil unless attributes.is_a?(Hash)
88
86
  self.class.swagger_types.each_pair do |key, type|
89
87
  if type =~ /\AArray<(.*)>/i
90
- # check to ensure the input is an array given that the the attribute
88
+ # check to ensure the input is an array given that the attribute
91
89
  # is documented as an array but the input is not
92
90
  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) } )
91
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
94
92
  end
95
93
  elsif !attributes[self.class.attribute_map[key]].nil?
96
94
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -172,7 +170,7 @@ module CloudmersiveVirusScanApiClient
172
170
  # @return [Hash] Returns the value in the form of hash
173
171
  def _to_hash(value)
174
172
  if value.is_a?(Array)
175
- value.compact.map{ |v| _to_hash(v) }
173
+ value.compact.map { |v| _to_hash(v) }
176
174
  elsif value.is_a?(Hash)
177
175
  {}.tap do |hash|
178
176
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -185,5 +183,4 @@ module CloudmersiveVirusScanApiClient
185
183
  end
186
184
 
187
185
  end
188
-
189
186
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -21,6 +21,12 @@ module CloudmersiveVirusScanApiClient
21
21
  # Type of threat returned; can be None, Malware, ForcedDownload or Phishing
22
22
  attr_accessor :website_threat_type
23
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
+
24
30
  class EnumAttributeValidator
25
31
  attr_reader :datatype
26
32
  attr_reader :allowable_values
@@ -47,7 +53,9 @@ module CloudmersiveVirusScanApiClient
47
53
  def self.attribute_map
48
54
  {
49
55
  :'clean_result' => :'CleanResult',
50
- :'website_threat_type' => :'WebsiteThreatType'
56
+ :'website_threat_type' => :'WebsiteThreatType',
57
+ :'found_viruses' => :'FoundViruses',
58
+ :'website_http_response_code' => :'WebsiteHttpResponseCode'
51
59
  }
52
60
  end
53
61
 
@@ -55,7 +63,9 @@ module CloudmersiveVirusScanApiClient
55
63
  def self.swagger_types
56
64
  {
57
65
  :'clean_result' => :'BOOLEAN',
58
- :'website_threat_type' => :'String'
66
+ :'website_threat_type' => :'String',
67
+ :'found_viruses' => :'Array<VirusFound>',
68
+ :'website_http_response_code' => :'Integer'
59
69
  }
60
70
  end
61
71
 
@@ -65,7 +75,7 @@ module CloudmersiveVirusScanApiClient
65
75
  return unless attributes.is_a?(Hash)
66
76
 
67
77
  # convert string to symbol for hash key
68
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
78
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
69
79
 
70
80
  if attributes.has_key?(:'CleanResult')
71
81
  self.clean_result = attributes[:'CleanResult']
@@ -75,29 +85,38 @@ module CloudmersiveVirusScanApiClient
75
85
  self.website_threat_type = attributes[:'WebsiteThreatType']
76
86
  end
77
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
78
97
  end
79
98
 
80
99
  # Show invalid properties with the reasons. Usually used together with valid?
81
100
  # @return Array for valid properties with the reasons
82
101
  def list_invalid_properties
83
102
  invalid_properties = Array.new
84
- return invalid_properties
103
+ invalid_properties
85
104
  end
86
105
 
87
106
  # Check to see if the all the properties in the model are valid
88
107
  # @return true if the model is valid
89
108
  def valid?
90
- website_threat_type_validator = EnumAttributeValidator.new('String', ["None", "Malware", "Phishing", "ForcedDownload", "UnableToConnect"])
109
+ website_threat_type_validator = EnumAttributeValidator.new('String', ['None', 'Malware', 'Phishing', 'ForcedDownload', 'UnableToConnect'])
91
110
  return false unless website_threat_type_validator.valid?(@website_threat_type)
92
- return true
111
+ true
93
112
  end
94
113
 
95
114
  # Custom attribute writer method checking allowed values (enum).
96
115
  # @param [Object] website_threat_type Object to be assigned
97
116
  def website_threat_type=(website_threat_type)
98
- validator = EnumAttributeValidator.new('String', ["None", "Malware", "Phishing", "ForcedDownload", "UnableToConnect"])
117
+ validator = EnumAttributeValidator.new('String', ['None', 'Malware', 'Phishing', 'ForcedDownload', 'UnableToConnect'])
99
118
  unless validator.valid?(website_threat_type)
100
- fail ArgumentError, "invalid value for 'website_threat_type', must be one of #{validator.allowable_values}."
119
+ fail ArgumentError, 'invalid value for "website_threat_type", must be one of #{validator.allowable_values}.'
101
120
  end
102
121
  @website_threat_type = website_threat_type
103
122
  end
@@ -108,7 +127,9 @@ module CloudmersiveVirusScanApiClient
108
127
  return true if self.equal?(o)
109
128
  self.class == o.class &&
110
129
  clean_result == o.clean_result &&
111
- website_threat_type == o.website_threat_type
130
+ website_threat_type == o.website_threat_type &&
131
+ found_viruses == o.found_viruses &&
132
+ website_http_response_code == o.website_http_response_code
112
133
  end
113
134
 
114
135
  # @see the `==` method
@@ -120,7 +141,7 @@ module CloudmersiveVirusScanApiClient
120
141
  # Calculates hash code according to all attributes.
121
142
  # @return [Fixnum] Hash code
122
143
  def hash
123
- [clean_result, website_threat_type].hash
144
+ [clean_result, website_threat_type, found_viruses, website_http_response_code].hash
124
145
  end
125
146
 
126
147
  # Builds the object from hash
@@ -130,10 +151,10 @@ module CloudmersiveVirusScanApiClient
130
151
  return nil unless attributes.is_a?(Hash)
131
152
  self.class.swagger_types.each_pair do |key, type|
132
153
  if type =~ /\AArray<(.*)>/i
133
- # check to ensure the input is an array given that the the attribute
154
+ # check to ensure the input is an array given that the attribute
134
155
  # is documented as an array but the input is not
135
156
  if attributes[self.class.attribute_map[key]].is_a?(Array)
136
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
157
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
137
158
  end
138
159
  elsif !attributes[self.class.attribute_map[key]].nil?
139
160
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -215,7 +236,7 @@ module CloudmersiveVirusScanApiClient
215
236
  # @return [Hash] Returns the value in the form of hash
216
237
  def _to_hash(value)
217
238
  if value.is_a?(Array)
218
- value.compact.map{ |v| _to_hash(v) }
239
+ value.compact.map { |v| _to_hash(v) }
219
240
  elsif value.is_a?(Hash)
220
241
  {}.tap do |hash|
221
242
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -228,5 +249,4 @@ module CloudmersiveVirusScanApiClient
228
249
  end
229
250
 
230
251
  end
231
-
232
252
  end
@@ -6,10 +6,10 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
13
13
  module CloudmersiveVirusScanApiClient
14
- VERSION = "1.3.1"
14
+ VERSION = '2.0.2'
15
15
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -39,7 +39,7 @@ describe 'ScanApi' do
39
39
  # @param [Hash] opts the optional parameters
40
40
  # @return [VirusScanResult]
41
41
  describe 'scan_file test' do
42
- it "should work" do
42
+ it 'should work' do
43
43
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
44
  end
45
45
  end
@@ -52,10 +52,11 @@ describe 'ScanApi' do
52
52
  # @option opts [BOOLEAN] :allow_executables Set to false to block executable files (program code) from being allowed in the input file. Default is false (recommended).
53
53
  # @option opts [BOOLEAN] :allow_invalid_files Set to false to block invalid files, such as a PDF file that is not really a valid PDF file, or a Word Document that is not a valid Word Document. Default is false (recommended).
54
54
  # @option opts [BOOLEAN] :allow_scripts Set to false to block script files, such as a PHP files, Pythong scripts, and other malicious content or security threats that can be embedded in the file. Set to true to allow these file types. Default is false (recommended).
55
+ # @option opts [BOOLEAN] :allow_password_protected_files Set to false to block password protected and encrypted files, such as encrypted zip and rar files, and other files that seek to circumvent scanning through passwords. Set to true to allow these file types. Default is false (recommended).
55
56
  # @option opts [String] :restrict_file_types Specify a restricted set of file formats to allow as clean as a comma-separated list of file formats, such as .pdf,.docx,.png would allow only PDF, PNG and Word document files. All files must pass content verification against this list of file formats, if they do not, then the result will be returned as CleanResult&#x3D;false. Set restrictFileTypes parameter to null or empty string to disable; default is disabled.
56
57
  # @return [VirusScanAdvancedResult]
57
58
  describe 'scan_file_advanced test' do
58
- it "should work" do
59
+ it 'should work' do
59
60
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
60
61
  end
61
62
  end
@@ -67,7 +68,7 @@ describe 'ScanApi' do
67
68
  # @param [Hash] opts the optional parameters
68
69
  # @return [WebsiteScanResult]
69
70
  describe 'scan_website test' do
70
- it "should work" do
71
+ it 'should work' do
71
72
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
72
73
  end
73
74
  end