cloudmersive-virus-scan-api-client 2.0.3 → 2.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,298 @@
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.4.14
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveVirusScanApiClient
16
+ # Result of running an advanced virus scan on cloud storage
17
+ class CloudStorageAdvancedVirusScanResult
18
+ # True if the operation of retrieving the file, and scanning it were successfully completed, false if the file could not be downloaded from cloud storage, or if the file could not be scanned. Note that successful completion does not mean the file is clean; for the output of the virus scanning operation itself, use the CleanResult and FoundViruses parameters.
19
+ attr_accessor :successful
20
+
21
+ # True if the scan contained no viruses, false otherwise
22
+ attr_accessor :clean_result
23
+
24
+ # True if the scan contained an executable (application code), which can be a significant risk factor
25
+ attr_accessor :contains_executable
26
+
27
+ # True if the scan contained an invalid file (such as a PDF that is not a valid PDF, Word Document that is not a valid Word Document, etc.), which can be a significant risk factor
28
+ attr_accessor :contains_invalid_file
29
+
30
+ # True if the scan contained a script (such as a PHP script, Python script, etc.) which can be a significant risk factor
31
+ attr_accessor :contains_script
32
+
33
+ # True if the scan contained a password protected or encrypted file, which can be a significant risk factor
34
+ attr_accessor :contains_password_protected_file
35
+
36
+ # 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
37
+ attr_accessor :contains_restricted_file_format
38
+
39
+ # True if the uploaded file contains embedded Macros of other embedded threats within the document, which can be a significant risk factor
40
+ attr_accessor :contains_macros
41
+
42
+ # For file format verification-supported file formats, the contents-verified file format of the file. Null indicates that the file format is not supported for contents verification. If a Virus or Malware is found, this field will always be set to Null.
43
+ attr_accessor :verified_file_format
44
+
45
+ # Array of viruses found, if any
46
+ attr_accessor :found_viruses
47
+
48
+ # Detailed error message if the operation was not successful
49
+ attr_accessor :error_detailed_description
50
+
51
+ # Size in bytes of the file that was retrieved and scanned
52
+ attr_accessor :file_size
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'successful' => :'Successful',
58
+ :'clean_result' => :'CleanResult',
59
+ :'contains_executable' => :'ContainsExecutable',
60
+ :'contains_invalid_file' => :'ContainsInvalidFile',
61
+ :'contains_script' => :'ContainsScript',
62
+ :'contains_password_protected_file' => :'ContainsPasswordProtectedFile',
63
+ :'contains_restricted_file_format' => :'ContainsRestrictedFileFormat',
64
+ :'contains_macros' => :'ContainsMacros',
65
+ :'verified_file_format' => :'VerifiedFileFormat',
66
+ :'found_viruses' => :'FoundViruses',
67
+ :'error_detailed_description' => :'ErrorDetailedDescription',
68
+ :'file_size' => :'FileSize'
69
+ }
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.swagger_types
74
+ {
75
+ :'successful' => :'BOOLEAN',
76
+ :'clean_result' => :'BOOLEAN',
77
+ :'contains_executable' => :'BOOLEAN',
78
+ :'contains_invalid_file' => :'BOOLEAN',
79
+ :'contains_script' => :'BOOLEAN',
80
+ :'contains_password_protected_file' => :'BOOLEAN',
81
+ :'contains_restricted_file_format' => :'BOOLEAN',
82
+ :'contains_macros' => :'BOOLEAN',
83
+ :'verified_file_format' => :'String',
84
+ :'found_viruses' => :'Array<CloudStorageVirusFound>',
85
+ :'error_detailed_description' => :'String',
86
+ :'file_size' => :'Integer'
87
+ }
88
+ end
89
+
90
+ # Initializes the object
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ def initialize(attributes = {})
93
+ return unless attributes.is_a?(Hash)
94
+
95
+ # convert string to symbol for hash key
96
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
97
+
98
+ if attributes.has_key?(:'Successful')
99
+ self.successful = attributes[:'Successful']
100
+ end
101
+
102
+ if attributes.has_key?(:'CleanResult')
103
+ self.clean_result = attributes[:'CleanResult']
104
+ end
105
+
106
+ if attributes.has_key?(:'ContainsExecutable')
107
+ self.contains_executable = attributes[:'ContainsExecutable']
108
+ end
109
+
110
+ if attributes.has_key?(:'ContainsInvalidFile')
111
+ self.contains_invalid_file = attributes[:'ContainsInvalidFile']
112
+ end
113
+
114
+ if attributes.has_key?(:'ContainsScript')
115
+ self.contains_script = attributes[:'ContainsScript']
116
+ end
117
+
118
+ if attributes.has_key?(:'ContainsPasswordProtectedFile')
119
+ self.contains_password_protected_file = attributes[:'ContainsPasswordProtectedFile']
120
+ end
121
+
122
+ if attributes.has_key?(:'ContainsRestrictedFileFormat')
123
+ self.contains_restricted_file_format = attributes[:'ContainsRestrictedFileFormat']
124
+ end
125
+
126
+ if attributes.has_key?(:'ContainsMacros')
127
+ self.contains_macros = attributes[:'ContainsMacros']
128
+ end
129
+
130
+ if attributes.has_key?(:'VerifiedFileFormat')
131
+ self.verified_file_format = attributes[:'VerifiedFileFormat']
132
+ end
133
+
134
+ if attributes.has_key?(:'FoundViruses')
135
+ if (value = attributes[:'FoundViruses']).is_a?(Array)
136
+ self.found_viruses = value
137
+ end
138
+ end
139
+
140
+ if attributes.has_key?(:'ErrorDetailedDescription')
141
+ self.error_detailed_description = attributes[:'ErrorDetailedDescription']
142
+ end
143
+
144
+ if attributes.has_key?(:'FileSize')
145
+ self.file_size = attributes[:'FileSize']
146
+ end
147
+ end
148
+
149
+ # Show invalid properties with the reasons. Usually used together with valid?
150
+ # @return Array for valid properties with the reasons
151
+ def list_invalid_properties
152
+ invalid_properties = Array.new
153
+ invalid_properties
154
+ end
155
+
156
+ # Check to see if the all the properties in the model are valid
157
+ # @return true if the model is valid
158
+ def valid?
159
+ true
160
+ end
161
+
162
+ # Checks equality by comparing each attribute.
163
+ # @param [Object] Object to be compared
164
+ def ==(o)
165
+ return true if self.equal?(o)
166
+ self.class == o.class &&
167
+ successful == o.successful &&
168
+ clean_result == o.clean_result &&
169
+ contains_executable == o.contains_executable &&
170
+ contains_invalid_file == o.contains_invalid_file &&
171
+ contains_script == o.contains_script &&
172
+ contains_password_protected_file == o.contains_password_protected_file &&
173
+ contains_restricted_file_format == o.contains_restricted_file_format &&
174
+ contains_macros == o.contains_macros &&
175
+ verified_file_format == o.verified_file_format &&
176
+ found_viruses == o.found_viruses &&
177
+ error_detailed_description == o.error_detailed_description &&
178
+ file_size == o.file_size
179
+ end
180
+
181
+ # @see the `==` method
182
+ # @param [Object] Object to be compared
183
+ def eql?(o)
184
+ self == o
185
+ end
186
+
187
+ # Calculates hash code according to all attributes.
188
+ # @return [Fixnum] Hash code
189
+ def hash
190
+ [successful, clean_result, contains_executable, contains_invalid_file, contains_script, contains_password_protected_file, contains_restricted_file_format, contains_macros, verified_file_format, found_viruses, error_detailed_description, file_size].hash
191
+ end
192
+
193
+ # Builds the object from hash
194
+ # @param [Hash] attributes Model attributes in the form of hash
195
+ # @return [Object] Returns the model itself
196
+ def build_from_hash(attributes)
197
+ return nil unless attributes.is_a?(Hash)
198
+ self.class.swagger_types.each_pair do |key, type|
199
+ if type =~ /\AArray<(.*)>/i
200
+ # check to ensure the input is an array given that the attribute
201
+ # is documented as an array but the input is not
202
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
203
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
204
+ end
205
+ elsif !attributes[self.class.attribute_map[key]].nil?
206
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
207
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
208
+ end
209
+
210
+ self
211
+ end
212
+
213
+ # Deserializes the data based on type
214
+ # @param string type Data type
215
+ # @param string value Value to be deserialized
216
+ # @return [Object] Deserialized data
217
+ def _deserialize(type, value)
218
+ case type.to_sym
219
+ when :DateTime
220
+ DateTime.parse(value)
221
+ when :Date
222
+ Date.parse(value)
223
+ when :String
224
+ value.to_s
225
+ when :Integer
226
+ value.to_i
227
+ when :Float
228
+ value.to_f
229
+ when :BOOLEAN
230
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
231
+ true
232
+ else
233
+ false
234
+ end
235
+ when :Object
236
+ # generic object (usually a Hash), return directly
237
+ value
238
+ when /\AArray<(?<inner_type>.+)>\z/
239
+ inner_type = Regexp.last_match[:inner_type]
240
+ value.map { |v| _deserialize(inner_type, v) }
241
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
242
+ k_type = Regexp.last_match[:k_type]
243
+ v_type = Regexp.last_match[:v_type]
244
+ {}.tap do |hash|
245
+ value.each do |k, v|
246
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
247
+ end
248
+ end
249
+ else # model
250
+ temp_model = CloudmersiveVirusScanApiClient.const_get(type).new
251
+ temp_model.build_from_hash(value)
252
+ end
253
+ end
254
+
255
+ # Returns the string representation of the object
256
+ # @return [String] String presentation of the object
257
+ def to_s
258
+ to_hash.to_s
259
+ end
260
+
261
+ # to_body is an alias to to_hash (backward compatibility)
262
+ # @return [Hash] Returns the object in the form of hash
263
+ def to_body
264
+ to_hash
265
+ end
266
+
267
+ # Returns the object in the form of hash
268
+ # @return [Hash] Returns the object in the form of hash
269
+ def to_hash
270
+ hash = {}
271
+ self.class.attribute_map.each_pair do |attr, param|
272
+ value = self.send(attr)
273
+ next if value.nil?
274
+ hash[param] = _to_hash(value)
275
+ end
276
+ hash
277
+ end
278
+
279
+ # Outputs non-array value in the form of hash
280
+ # For object, use to_hash. Otherwise, just return the value
281
+ # @param [Object] value Any valid value
282
+ # @return [Hash] Returns the value in the form of hash
283
+ def _to_hash(value)
284
+ if value.is_a?(Array)
285
+ value.compact.map { |v| _to_hash(v) }
286
+ elsif value.is_a?(Hash)
287
+ {}.tap do |hash|
288
+ value.each { |k, v| hash[k] = _to_hash(v) }
289
+ end
290
+ elsif value.respond_to? :to_hash
291
+ value.to_hash
292
+ else
293
+ value
294
+ end
295
+ end
296
+
297
+ end
298
+ end
@@ -33,6 +33,12 @@ module CloudmersiveVirusScanApiClient
33
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
34
34
  attr_accessor :contains_restricted_file_format
35
35
 
36
+ # True if the uploaded file contains embedded Macros of other embedded threats within the document, which can be a significant risk factor
37
+ attr_accessor :contains_macros
38
+
39
+ # True if the uploaded file contains embedded XML External Entity threats of other embedded threats within the document, which can be a significant risk factor
40
+ attr_accessor :contains_xml_external_entities
41
+
36
42
  # For file format verification-supported file formats, the contents-verified file format of the file. Null indicates that the file format is not supported for contents verification. If a Virus or Malware is found, this field will always be set to Null.
37
43
  attr_accessor :verified_file_format
38
44
 
@@ -48,6 +54,8 @@ module CloudmersiveVirusScanApiClient
48
54
  :'contains_script' => :'ContainsScript',
49
55
  :'contains_password_protected_file' => :'ContainsPasswordProtectedFile',
50
56
  :'contains_restricted_file_format' => :'ContainsRestrictedFileFormat',
57
+ :'contains_macros' => :'ContainsMacros',
58
+ :'contains_xml_external_entities' => :'ContainsXmlExternalEntities',
51
59
  :'verified_file_format' => :'VerifiedFileFormat',
52
60
  :'found_viruses' => :'FoundViruses'
53
61
  }
@@ -62,6 +70,8 @@ module CloudmersiveVirusScanApiClient
62
70
  :'contains_script' => :'BOOLEAN',
63
71
  :'contains_password_protected_file' => :'BOOLEAN',
64
72
  :'contains_restricted_file_format' => :'BOOLEAN',
73
+ :'contains_macros' => :'BOOLEAN',
74
+ :'contains_xml_external_entities' => :'BOOLEAN',
65
75
  :'verified_file_format' => :'String',
66
76
  :'found_viruses' => :'Array<VirusFound>'
67
77
  }
@@ -99,6 +109,14 @@ module CloudmersiveVirusScanApiClient
99
109
  self.contains_restricted_file_format = attributes[:'ContainsRestrictedFileFormat']
100
110
  end
101
111
 
112
+ if attributes.has_key?(:'ContainsMacros')
113
+ self.contains_macros = attributes[:'ContainsMacros']
114
+ end
115
+
116
+ if attributes.has_key?(:'ContainsXmlExternalEntities')
117
+ self.contains_xml_external_entities = attributes[:'ContainsXmlExternalEntities']
118
+ end
119
+
102
120
  if attributes.has_key?(:'VerifiedFileFormat')
103
121
  self.verified_file_format = attributes[:'VerifiedFileFormat']
104
122
  end
@@ -134,6 +152,8 @@ module CloudmersiveVirusScanApiClient
134
152
  contains_script == o.contains_script &&
135
153
  contains_password_protected_file == o.contains_password_protected_file &&
136
154
  contains_restricted_file_format == o.contains_restricted_file_format &&
155
+ contains_macros == o.contains_macros &&
156
+ contains_xml_external_entities == o.contains_xml_external_entities &&
137
157
  verified_file_format == o.verified_file_format &&
138
158
  found_viruses == o.found_viruses
139
159
  end
@@ -147,7 +167,7 @@ module CloudmersiveVirusScanApiClient
147
167
  # Calculates hash code according to all attributes.
148
168
  # @return [Fixnum] Hash code
149
169
  def 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
170
+ [clean_result, contains_executable, contains_invalid_file, contains_script, contains_password_protected_file, contains_restricted_file_format, contains_macros, contains_xml_external_entities, verified_file_format, found_viruses].hash
151
171
  end
152
172
 
153
173
  # Builds the object from hash
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.14
11
11
  =end
12
12
 
13
13
  module CloudmersiveVirusScanApiClient
14
- VERSION = '2.0.3'
14
+ VERSION = '2.0.7'
15
15
  end
@@ -17,6 +17,7 @@ require 'cloudmersive-virus-scan-api-client/version'
17
17
  require 'cloudmersive-virus-scan-api-client/configuration'
18
18
 
19
19
  # Models
20
+ require 'cloudmersive-virus-scan-api-client/models/cloud_storage_advanced_virus_scan_result'
20
21
  require 'cloudmersive-virus-scan-api-client/models/cloud_storage_virus_found'
21
22
  require 'cloudmersive-virus-scan-api-client/models/cloud_storage_virus_scan_result'
22
23
  require 'cloudmersive-virus-scan-api-client/models/virus_found'
@@ -53,6 +53,8 @@ describe 'ScanApi' do
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, Python 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
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).
56
+ # @option opts [BOOLEAN] :allow_macros Set to false to block macros and other threats embedded in document files, such as Word, Excel and PowerPoint embedded Macros, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended).
57
+ # @option opts [BOOLEAN] :allow_xml_external_entities Set to false to block XML External Entities and other threats embedded in XML files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended).
56
58
  # @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.
57
59
  # @return [VirusScanAdvancedResult]
58
60
  describe 'scan_file_advanced test' do
@@ -48,6 +48,29 @@ describe 'ScanCloudStorageApi' do
48
48
  end
49
49
  end
50
50
 
51
+ # unit tests for scan_cloud_storage_scan_aws_s3_file_advanced
52
+ # Advanced Scan an AWS S3 file for viruses
53
+ # Advanced Scan the contents of a single AWS S3 file and its content for viruses and threats. Advanced Scan files with 360-degree Content Protection across Viruses and Malware, executables, invalid files, scripts, and even restrictions on accepted file types with complete content verification. Customize threat rules to your needs. Leverage continuously updated signatures for millions of threats, and advanced high-performance scanning capabilities. Over 17 million virus and malware signatures. Continuous cloud-based updates. Block threats beyond viruses including executables, scripts, invalid files, and more. Optionally limit input files to a specific set of file types (e.g. PDF and Word Documents only). Wide file format support including Office, PDF, HTML, Flash. Zip support including .Zip, .Rar, .DMG, .Tar, and other archive formats. Multi-threat scanning across viruses, malware, trojans, ransomware, and spyware. High-speed in-memory scanning delivers subsecond typical response time.
54
+ # @param access_key AWS S3 access key for the S3 bucket; you can get this from My Security Credentials in the AWS console
55
+ # @param secret_key AWS S3 secret key for the S3 bucket; you can get this from My Security Credentials in the AWS console
56
+ # @param bucket_region Name of the region of the S3 bucket, such as &#39;US-East-1&#39;
57
+ # @param bucket_name Name of the S3 bucket
58
+ # @param key_name Key name (also called file name) of the file in S3 that you wish to scan for viruses
59
+ # @param [Hash] opts the optional parameters
60
+ # @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).
61
+ # @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).
62
+ # @option opts [BOOLEAN] :allow_scripts Set to false to block script files, such as a PHP files, Python 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).
63
+ # @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).
64
+ # @option opts [BOOLEAN] :allow_macros Set to false to block macros and other threats embedded in document files, such as Word, Excel and PowerPoint embedded Macros, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended).
65
+ # @option opts [BOOLEAN] :allow_xml_external_entities Set to false to block XML External Entities and other threats embedded in XML files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended).
66
+ # @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.
67
+ # @return [CloudStorageAdvancedVirusScanResult]
68
+ describe 'scan_cloud_storage_scan_aws_s3_file_advanced test' do
69
+ it 'should work' do
70
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
71
+ end
72
+ end
73
+
51
74
  # unit tests for scan_cloud_storage_scan_azure_blob
52
75
  # Scan an Azure Blob for viruses
53
76
  # Scan the contents of a single Azure Blob and its content for viruses. Leverage continuously updated signatures for millions of threats, and advanced high-performance scanning capabilities. Over 17 million virus and malware signatures. Continuous cloud-based updates. Wide file format support including Office, PDF, HTML, Flash. Zip support including .Zip, .Rar, .DMG, .Tar, and other archive formats. Multi-threat scanning across viruses, malware, trojans, ransomware, and spyware. High-speed in-memory scanning delivers subsecond typical response time.
@@ -62,6 +85,27 @@ describe 'ScanCloudStorageApi' do
62
85
  end
63
86
  end
64
87
 
88
+ # unit tests for scan_cloud_storage_scan_azure_blob_advanced
89
+ # Advanced Scan an Azure Blob for viruses
90
+ # Advanced Scan the contents of a single Azure Blob and its content for viruses and threats. Advanced Scan files with 360-degree Content Protection across Viruses and Malware, executables, invalid files, scripts, and even restrictions on accepted file types with complete content verification. Customize threat rules to your needs. Leverage continuously updated signatures for millions of threats, and advanced high-performance scanning capabilities. Over 17 million virus and malware signatures. Continuous cloud-based updates. Block threats beyond viruses including executables, scripts, invalid files, and more. Optionally limit input files to a specific set of file types (e.g. PDF and Word Documents only). Wide file format support including Office, PDF, HTML, Flash. Zip support including .Zip, .Rar, .DMG, .Tar, and other archive formats. Multi-threat scanning across viruses, malware, trojans, ransomware, and spyware. High-speed in-memory scanning delivers subsecond typical response time.
91
+ # @param connection_string Connection string for the Azure Blob Storage Account; you can get this connection string from the Access Keys tab of the Storage Account blade in the Azure Portal.
92
+ # @param container_name Name of the Blob container within the Azure Blob Storage account
93
+ # @param blob_path Path to the blob within the container, such as &#39;hello.pdf&#39; or &#39;/folder/subfolder/world.pdf&#39;
94
+ # @param [Hash] opts the optional parameters
95
+ # @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).
96
+ # @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).
97
+ # @option opts [BOOLEAN] :allow_scripts Set to false to block script files, such as a PHP files, Python 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).
98
+ # @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).
99
+ # @option opts [BOOLEAN] :allow_macros Set to false to block macros and other threats embedded in document files, such as Word, Excel and PowerPoint embedded Macros, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended).
100
+ # @option opts [BOOLEAN] :allow_xml_external_entities Set to false to block XML External Entities and other threats embedded in XML files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended).
101
+ # @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.
102
+ # @return [CloudStorageAdvancedVirusScanResult]
103
+ describe 'scan_cloud_storage_scan_azure_blob_advanced test' do
104
+ it 'should work' do
105
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
106
+ end
107
+ end
108
+
65
109
  # unit tests for scan_cloud_storage_scan_gcp_storage_file
66
110
  # Scan an Google Cloud Platform (GCP) Storage file for viruses
67
111
  # Scan the contents of a single Google Cloud Platform (GCP) Storage file and its content for viruses. Leverage continuously updated signatures for millions of threats, and advanced high-performance scanning capabilities. Over 17 million virus and malware signatures. Continuous cloud-based updates. Wide file format support including Office, PDF, HTML, Flash. Zip support including .Zip, .Rar, .DMG, .Tar, and other archive formats. Multi-threat scanning across viruses, malware, trojans, ransomware, and spyware. High-speed in-memory scanning delivers subsecond typical response time.
@@ -76,4 +120,66 @@ describe 'ScanCloudStorageApi' do
76
120
  end
77
121
  end
78
122
 
123
+ # unit tests for scan_cloud_storage_scan_gcp_storage_file_advanced
124
+ # Advanced Scan an Google Cloud Platform (GCP) Storage file for viruses
125
+ # Advanced Scan the contents of a single Google Cloud Platform (GCP) Storage file and its content for viruses and threats. Advanced Scan files with 360-degree Content Protection across Viruses and Malware, executables, invalid files, scripts, and even restrictions on accepted file types with complete content verification. Customize threat rules to your needs. Leverage continuously updated signatures for millions of threats, and advanced high-performance scanning capabilities. Over 17 million virus and malware signatures. Continuous cloud-based updates. Block threats beyond viruses including executables, scripts, invalid files, and more. Optionally limit input files to a specific set of file types (e.g. PDF and Word Documents only). Wide file format support including Office, PDF, HTML, Flash. Zip support including .Zip, .Rar, .DMG, .Tar, and other archive formats. Multi-threat scanning across viruses, malware, trojans, ransomware, and spyware. High-speed in-memory scanning delivers subsecond typical response time.
126
+ # @param bucket_name Name of the bucket in Google Cloud Storage
127
+ # @param object_name Name of the object or file in Google Cloud Storage
128
+ # @param json_credential_file Service Account credential for Google Cloud stored in a JSON file.
129
+ # @param [Hash] opts the optional parameters
130
+ # @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).
131
+ # @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).
132
+ # @option opts [BOOLEAN] :allow_scripts Set to false to block script files, such as a PHP files, Python 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).
133
+ # @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).
134
+ # @option opts [BOOLEAN] :allow_macros Set to false to block macros and other threats embedded in document files, such as Word, Excel and PowerPoint embedded Macros, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended).
135
+ # @option opts [BOOLEAN] :allow_xml_external_entities Set to false to block XML External Entities and other threats embedded in XML files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended).
136
+ # @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.
137
+ # @return [CloudStorageAdvancedVirusScanResult]
138
+ describe 'scan_cloud_storage_scan_gcp_storage_file_advanced test' do
139
+ it 'should work' do
140
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
141
+ end
142
+ end
143
+
144
+ # unit tests for scan_cloud_storage_scan_share_point_online_file
145
+ # Virus Scan a file in a SharePoint Online Site Drive
146
+ # Virus Scan the contents of a single SharePoint Online Site Drive file and its content for viruses. Leverage continuously updated signatures for millions of threats, and advanced high-performance scanning capabilities. Over 17 million virus and malware signatures. Continuous cloud-based updates. Wide file format support including Office, PDF, HTML, Flash. Zip support including .Zip, .Rar, .DMG, .Tar, and other archive formats. Multi-threat scanning across viruses, malware, trojans, ransomware, and spyware. High-speed in-memory scanning delivers subsecond typical response time. To get the Client ID and Client Secret, follow these steps: (1) Navigate to the Azure Portal and click on Azure Active Directory, (2) click on App Registrations on the left hand side, (3) click on Register Application, (4) Name the application CloudmersiveAntiVirus and click on Register, (5) Get the client ID by clicking on Overview and copying the value labeled Application (client) ID, (6) click on Certificates and Secrets, (7) click on New client secret, choose a longer expiration and give the secret a name, (8) copy the secret value to the clipboard and save it securely, this is your Client Secret, (9) Now we need to grant permissions to SharePOint; click on API Permissions on the left hand side, (10) click on Add a permission and choose Microsoft Graph, (11) click on Application Permissions, (12) search for Sites.FullControl.All, (13) Click on Add Permissions, (14) now navigate back to Azure Active Directory and click on Enterprise Applications, click on CloudmersiveAntiVirus and click on Permissions, and (15) click on Grant Admin Consent.
147
+ # @param client_id Client ID access credentials; see description above for instructions on how to get the Client ID from the Azure Active Directory portal.
148
+ # @param client_secret Client Secret access credentials; see description above for instructions on how to get the Client Secret from the Azure Active Directory portal
149
+ # @param sharepoint_domain_name SharePoint Online domain name, such as mydomain.sharepoint.com
150
+ # @param site_id Site ID (GUID) of the SharePoint site you wish to retrieve the file from
151
+ # @param file_path Path to the file within the drive, such as &#39;hello.pdf&#39; or &#39;/folder/subfolder/world.pdf&#39;
152
+ # @param [Hash] opts the optional parameters
153
+ # @option opts [String] :tenant_id Optional; Tenant ID of your Azure Active Directory
154
+ # @return [CloudStorageVirusScanResult]
155
+ describe 'scan_cloud_storage_scan_share_point_online_file test' do
156
+ it 'should work' do
157
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
158
+ end
159
+ end
160
+
161
+ # unit tests for scan_cloud_storage_scan_share_point_online_file_advanced
162
+ # Advanced Virus Scan a file in a SharePoint Online Site Drive
163
+ # Advanced Virus Scan the contents of a single SharePoint Online Site Drive file and its content for viruses and threats. Advanced Scan files with 360-degree Content Protection across Viruses and Malware, executables, invalid files, scripts, and even restrictions on accepted file types with complete content verification. Customize threat rules to your needs. Leverage continuously updated signatures for millions of threats, and advanced high-performance scanning capabilities. Over 17 million virus and malware signatures. Continuous cloud-based updates. Block threats beyond viruses including executables, scripts, invalid files, and more. Optionally limit input files to a specific set of file types (e.g. PDF and Word Documents only). Wide file format support including Office, PDF, HTML, Flash. Zip support including .Zip, .Rar, .DMG, .Tar, and other archive formats. Multi-threat scanning across viruses, malware, trojans, ransomware, and spyware. High-speed in-memory scanning delivers subsecond typical response time. To get the Client ID and Client Secret, follow these steps: (1) Navigate to the Azure Portal and click on Azure Active Directory, (2) click on App Registrations on the left hand side, (3) click on Register Application, (4) Name the application CloudmersiveAntiVirus and click on Register, (5) Get the client ID by clicking on Overview and copying the value labeled Application (client) ID, (6) click on Certificates and Secrets, (7) click on New client secret, choose a longer expiration and give the secret a name, (8) copy the secret value to the clipboard and save it securely, this is your Client Secret, (9) Now we need to grant permissions to SharePOint; click on API Permissions on the left hand side, (10) click on Add a permission and choose Microsoft Graph, (11) click on Application Permissions, (12) search for Sites.FullControl.All, (13) Click on Add Permissions, (14) now navigate back to Azure Active Directory and click on Enterprise Applications, click on CloudmersiveAntiVirus and click on Permissions, and (15) click on Grant Admin Consent.
164
+ # @param client_id Client ID access credentials; see description above for instructions on how to get the Client ID from the Azure Active Directory portal.
165
+ # @param client_secret Client Secret access credentials; see description above for instructions on how to get the Client Secret from the Azure Active Directory portal
166
+ # @param sharepoint_domain_name SharePoint Online domain name, such as mydomain.sharepoint.com
167
+ # @param site_id Site ID (GUID) of the SharePoint site you wish to retrieve the file from
168
+ # @param file_path Path to the file within the drive, such as &#39;hello.pdf&#39; or &#39;/folder/subfolder/world.pdf&#39;
169
+ # @param [Hash] opts the optional parameters
170
+ # @option opts [String] :tenant_id Optional; Tenant ID of your Azure Active Directory
171
+ # @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).
172
+ # @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).
173
+ # @option opts [BOOLEAN] :allow_scripts Set to false to block script files, such as a PHP files, Python 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).
174
+ # @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).
175
+ # @option opts [BOOLEAN] :allow_macros Set to false to block macros and other threats embedded in document files, such as Word, Excel and PowerPoint embedded Macros, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended).
176
+ # @option opts [BOOLEAN] :allow_xml_external_entities Set to false to block XML External Entities and other threats embedded in XML files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended).
177
+ # @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.
178
+ # @return [CloudStorageAdvancedVirusScanResult]
179
+ describe 'scan_cloud_storage_scan_share_point_online_file_advanced test' do
180
+ it 'should work' do
181
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
182
+ end
183
+ end
184
+
79
185
  end
@@ -0,0 +1,107 @@
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.4.14
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudmersiveVirusScanApiClient::CloudStorageAdvancedVirusScanResult
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'CloudStorageAdvancedVirusScanResult' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveVirusScanApiClient::CloudStorageAdvancedVirusScanResult.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of CloudStorageAdvancedVirusScanResult' do
31
+ it 'should create an instance of CloudStorageAdvancedVirusScanResult' do
32
+ expect(@instance).to be_instance_of(CloudmersiveVirusScanApiClient::CloudStorageAdvancedVirusScanResult)
33
+ end
34
+ end
35
+ describe 'test attribute "successful"' 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 "clean_result"' 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_executable"' 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_invalid_file"' 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_script"' 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
+
65
+ describe 'test attribute "contains_password_protected_file"' do
66
+ it 'should work' do
67
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
68
+ end
69
+ end
70
+
71
+ describe 'test attribute "contains_restricted_file_format"' do
72
+ it 'should work' do
73
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
74
+ end
75
+ end
76
+
77
+ describe 'test attribute "contains_macros"' do
78
+ it 'should work' do
79
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
80
+ end
81
+ end
82
+
83
+ describe 'test attribute "verified_file_format"' do
84
+ it 'should work' do
85
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
86
+ end
87
+ end
88
+
89
+ describe 'test attribute "found_viruses"' do
90
+ it 'should work' do
91
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
92
+ end
93
+ end
94
+
95
+ describe 'test attribute "error_detailed_description"' do
96
+ it 'should work' do
97
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
98
+ end
99
+ end
100
+
101
+ describe 'test attribute "file_size"' do
102
+ it 'should work' do
103
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
104
+ end
105
+ end
106
+
107
+ end
@@ -68,6 +68,18 @@ describe 'VirusScanAdvancedResult' do
68
68
  end
69
69
  end
70
70
 
71
+ describe 'test attribute "contains_macros"' do
72
+ it 'should work' do
73
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
74
+ end
75
+ end
76
+
77
+ describe 'test attribute "contains_xml_external_entities"' do
78
+ it 'should work' do
79
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
80
+ end
81
+ end
82
+
71
83
  describe 'test attribute "verified_file_format"' do
72
84
  it 'should work' do
73
85
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers