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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -0
  3. data/README.md +117 -0
  4. data/Rakefile +8 -0
  5. data/cloudmersive-virus-scan-api-client.gemspec +45 -0
  6. data/docs/CloudStorageAdvancedVirusScanResult.md +19 -0
  7. data/docs/CloudStorageVirusFound.md +9 -0
  8. data/docs/CloudStorageVirusScanResult.md +12 -0
  9. data/docs/ScanApi.md +189 -0
  10. data/docs/ScanCloudStorageApi.md +428 -0
  11. data/docs/VirusFound.md +9 -0
  12. data/docs/VirusScanAdvancedResult.md +17 -0
  13. data/docs/VirusScanResult.md +9 -0
  14. data/docs/WebsiteScanRequest.md +8 -0
  15. data/docs/WebsiteScanResult.md +11 -0
  16. data/git_push.sh +55 -0
  17. data/lib/cloudmersive-virus-scan-api-client.rb +49 -0
  18. data/lib/cloudmersive-virus-scan-api-client/api/scan_api.rb +208 -0
  19. data/lib/cloudmersive-virus-scan-api-client/api/scan_cloud_storage_api.rb +519 -0
  20. data/lib/cloudmersive-virus-scan-api-client/api_client.rb +391 -0
  21. data/lib/cloudmersive-virus-scan-api-client/api_error.rb +38 -0
  22. data/lib/cloudmersive-virus-scan-api-client/configuration.rb +209 -0
  23. data/lib/cloudmersive-virus-scan-api-client/models/cloud_storage_advanced_virus_scan_result.rb +298 -0
  24. data/lib/cloudmersive-virus-scan-api-client/models/cloud_storage_virus_found.rb +196 -0
  25. data/lib/cloudmersive-virus-scan-api-client/models/cloud_storage_virus_scan_result.rb +228 -0
  26. data/lib/cloudmersive-virus-scan-api-client/models/virus_found.rb +196 -0
  27. data/lib/cloudmersive-virus-scan-api-client/models/virus_scan_advanced_result.rb +278 -0
  28. data/lib/cloudmersive-virus-scan-api-client/models/virus_scan_result.rb +198 -0
  29. data/lib/cloudmersive-virus-scan-api-client/models/website_scan_request.rb +186 -0
  30. data/lib/cloudmersive-virus-scan-api-client/models/website_scan_result.rb +252 -0
  31. data/lib/cloudmersive-virus-scan-api-client/version.rb +15 -0
  32. data/spec/api/scan_api_spec.rb +78 -0
  33. data/spec/api/scan_cloud_storage_api_spec.rb +141 -0
  34. data/spec/api_client_spec.rb +243 -0
  35. data/spec/configuration_spec.rb +42 -0
  36. data/spec/models/cloud_storage_advanced_virus_scan_result_spec.rb +107 -0
  37. data/spec/models/cloud_storage_virus_found_spec.rb +47 -0
  38. data/spec/models/cloud_storage_virus_scan_result_spec.rb +65 -0
  39. data/spec/models/virus_found_spec.rb +47 -0
  40. data/spec/models/virus_scan_advanced_result_spec.rb +95 -0
  41. data/spec/models/virus_scan_result_spec.rb +47 -0
  42. data/spec/models/website_scan_request_spec.rb +41 -0
  43. data/spec/models/website_scan_result_spec.rb +63 -0
  44. data/spec/spec_helper.rb +111 -0
  45. metadata +46 -3
@@ -0,0 +1,9 @@
1
+ # CloudmersiveVirusScanApiClient::VirusFound
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **file_name** | **String** | Name of the file containing the virus | [optional]
7
+ **virus_name** | **String** | Name of the virus that was found | [optional]
8
+
9
+
@@ -0,0 +1,17 @@
1
+ # CloudmersiveVirusScanApiClient::VirusScanAdvancedResult
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **clean_result** | **BOOLEAN** | True if the scan contained no viruses, false otherwise | [optional]
7
+ **contains_executable** | **BOOLEAN** | True if the scan contained an executable (application code), which can be a significant risk factor | [optional]
8
+ **contains_invalid_file** | **BOOLEAN** | 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 | [optional]
9
+ **contains_script** | **BOOLEAN** | True if the scan contained a script (such as a PHP script, Python script, etc.) which can be a significant risk factor | [optional]
10
+ **contains_password_protected_file** | **BOOLEAN** | True if the scan contained a password protected or encrypted file, which can be a significant risk factor | [optional]
11
+ **contains_restricted_file_format** | **BOOLEAN** | 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 | [optional]
12
+ **contains_macros** | **BOOLEAN** | True if the uploaded file contains embedded Macros of other embedded threats within the document, which can be a significant risk factor | [optional]
13
+ **contains_xml_external_entities** | **BOOLEAN** | 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 | [optional]
14
+ **verified_file_format** | **String** | 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. | [optional]
15
+ **found_viruses** | [**Array<VirusFound>**](VirusFound.md) | Array of viruses found, if any | [optional]
16
+
17
+
@@ -0,0 +1,9 @@
1
+ # CloudmersiveVirusScanApiClient::VirusScanResult
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **clean_result** | **BOOLEAN** | True if the scan contained no viruses, false otherwise | [optional]
7
+ **found_viruses** | [**Array<VirusFound>**](VirusFound.md) | Array of viruses found, if any | [optional]
8
+
9
+
@@ -0,0 +1,8 @@
1
+ # CloudmersiveVirusScanApiClient::WebsiteScanRequest
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **url** | **String** | URL of the website to scan; should begin with http:// or https:// | [optional]
7
+
8
+
@@ -0,0 +1,11 @@
1
+ # CloudmersiveVirusScanApiClient::WebsiteScanResult
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **clean_result** | **BOOLEAN** | True if the scan contained no threats, false otherwise | [optional]
7
+ **website_threat_type** | **String** | Type of threat returned; can be None, Malware, ForcedDownload or Phishing | [optional]
8
+ **found_viruses** | [**Array<VirusFound>**](VirusFound.md) | Array of viruses found, if any | [optional]
9
+ **website_http_response_code** | **Integer** | 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. | [optional]
10
+
11
+
data/git_push.sh ADDED
@@ -0,0 +1,55 @@
1
+ #!/bin/sh
2
+ #
3
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
4
+ #
5
+ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
6
+ #
7
+ # Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
8
+
9
+ git_user_id=$1
10
+ git_repo_id=$2
11
+ release_note=$3
12
+
13
+ if [ "$git_user_id" = "" ]; then
14
+ git_user_id="GIT_USER_ID"
15
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
16
+ fi
17
+
18
+ if [ "$git_repo_id" = "" ]; then
19
+ git_repo_id="GIT_REPO_ID"
20
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
21
+ fi
22
+
23
+ if [ "$release_note" = "" ]; then
24
+ release_note="Minor update"
25
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
26
+ fi
27
+
28
+ # Initialize the local directory as a Git repository
29
+ git init
30
+
31
+ # Adds the files in the local repository and stages them for commit.
32
+ git add .
33
+
34
+ # Commits the tracked changes and prepares them to be pushed to a remote repository.
35
+ git commit -m "$release_note"
36
+
37
+ # Sets the new remote
38
+ git_remote=`git remote`
39
+ if [ "$git_remote" = "" ]; then # git remote not defined
40
+
41
+ if [ "$GIT_TOKEN" = "" ]; then
42
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
43
+ git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
44
+ else
45
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
46
+ fi
47
+
48
+ fi
49
+
50
+ git pull origin master
51
+
52
+ # Pushes (Forces) the changes in the local repository up to the remote repository
53
+ echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
54
+ git push origin master 2>&1 | grep -v 'To https'
55
+
@@ -0,0 +1,49 @@
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
+ # Common files
14
+ require 'cloudmersive-virus-scan-api-client/api_client'
15
+ require 'cloudmersive-virus-scan-api-client/api_error'
16
+ require 'cloudmersive-virus-scan-api-client/version'
17
+ require 'cloudmersive-virus-scan-api-client/configuration'
18
+
19
+ # Models
20
+ require 'cloudmersive-virus-scan-api-client/models/cloud_storage_advanced_virus_scan_result'
21
+ require 'cloudmersive-virus-scan-api-client/models/cloud_storage_virus_found'
22
+ require 'cloudmersive-virus-scan-api-client/models/cloud_storage_virus_scan_result'
23
+ require 'cloudmersive-virus-scan-api-client/models/virus_found'
24
+ require 'cloudmersive-virus-scan-api-client/models/virus_scan_advanced_result'
25
+ require 'cloudmersive-virus-scan-api-client/models/virus_scan_result'
26
+ require 'cloudmersive-virus-scan-api-client/models/website_scan_request'
27
+ require 'cloudmersive-virus-scan-api-client/models/website_scan_result'
28
+
29
+ # APIs
30
+ require 'cloudmersive-virus-scan-api-client/api/scan_api'
31
+ require 'cloudmersive-virus-scan-api-client/api/scan_cloud_storage_api'
32
+
33
+ module CloudmersiveVirusScanApiClient
34
+ class << self
35
+ # Customize default settings for the SDK using block.
36
+ # CloudmersiveVirusScanApiClient.configure do |config|
37
+ # config.username = "xxx"
38
+ # config.password = "xxx"
39
+ # end
40
+ # If no block given, return the default Configuration object.
41
+ def configure
42
+ if block_given?
43
+ yield(Configuration.default)
44
+ else
45
+ Configuration.default
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,208 @@
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 'uri'
14
+
15
+ module CloudmersiveVirusScanApiClient
16
+ class ScanApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Scan a file for viruses
23
+ # Scan files and 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.
24
+ # @param input_file Input file to perform the operation on.
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [VirusScanResult]
27
+ def scan_file(input_file, opts = {})
28
+ data, _status_code, _headers = scan_file_with_http_info(input_file, opts)
29
+ data
30
+ end
31
+
32
+ # Scan a file for viruses
33
+ # Scan files and 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.
34
+ # @param input_file Input file to perform the operation on.
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(VirusScanResult, Fixnum, Hash)>] VirusScanResult data, response status code and response headers
37
+ def scan_file_with_http_info(input_file, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: ScanApi.scan_file ...'
40
+ end
41
+ # verify the required parameter 'input_file' is set
42
+ if @api_client.config.client_side_validation && input_file.nil?
43
+ fail ArgumentError, "Missing the required parameter 'input_file' when calling ScanApi.scan_file"
44
+ end
45
+ # resource path
46
+ local_var_path = '/virus/scan/file'
47
+
48
+ # query parameters
49
+ query_params = {}
50
+
51
+ # header parameters
52
+ header_params = {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
55
+ # HTTP header 'Content-Type'
56
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
57
+
58
+ # form parameters
59
+ form_params = {}
60
+ form_params['inputFile'] = input_file
61
+
62
+ # http body (model)
63
+ post_body = nil
64
+ auth_names = ['Apikey']
65
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
66
+ :header_params => header_params,
67
+ :query_params => query_params,
68
+ :form_params => form_params,
69
+ :body => post_body,
70
+ :auth_names => auth_names,
71
+ :return_type => 'VirusScanResult')
72
+ if @api_client.config.debugging
73
+ @api_client.config.logger.debug "API called: ScanApi#scan_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
74
+ end
75
+ return data, status_code, headers
76
+ end
77
+ # Advanced Scan a file for viruses
78
+ # 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.
79
+ # @param input_file Input file to perform the operation on.
80
+ # @param [Hash] opts the optional parameters
81
+ # @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).
82
+ # @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).
83
+ # @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).
84
+ # @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).
85
+ # @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).
86
+ # @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).
87
+ # @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.
88
+ # @return [VirusScanAdvancedResult]
89
+ def scan_file_advanced(input_file, opts = {})
90
+ data, _status_code, _headers = scan_file_advanced_with_http_info(input_file, opts)
91
+ data
92
+ end
93
+
94
+ # Advanced Scan a file for viruses
95
+ # 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.
96
+ # @param input_file Input file to perform the operation on.
97
+ # @param [Hash] opts the optional parameters
98
+ # @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).
99
+ # @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).
100
+ # @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).
101
+ # @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).
102
+ # @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).
103
+ # @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).
104
+ # @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.
105
+ # @return [Array<(VirusScanAdvancedResult, Fixnum, Hash)>] VirusScanAdvancedResult data, response status code and response headers
106
+ def scan_file_advanced_with_http_info(input_file, opts = {})
107
+ if @api_client.config.debugging
108
+ @api_client.config.logger.debug 'Calling API: ScanApi.scan_file_advanced ...'
109
+ end
110
+ # verify the required parameter 'input_file' is set
111
+ if @api_client.config.client_side_validation && input_file.nil?
112
+ fail ArgumentError, "Missing the required parameter 'input_file' when calling ScanApi.scan_file_advanced"
113
+ end
114
+ # resource path
115
+ local_var_path = '/virus/scan/file/advanced'
116
+
117
+ # query parameters
118
+ query_params = {}
119
+
120
+ # header parameters
121
+ header_params = {}
122
+ # HTTP header 'Accept' (if needed)
123
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
124
+ # HTTP header 'Content-Type'
125
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
126
+ header_params[:'allowExecutables'] = opts[:'allow_executables'] if !opts[:'allow_executables'].nil?
127
+ header_params[:'allowInvalidFiles'] = opts[:'allow_invalid_files'] if !opts[:'allow_invalid_files'].nil?
128
+ header_params[:'allowScripts'] = opts[:'allow_scripts'] if !opts[:'allow_scripts'].nil?
129
+ header_params[:'allowPasswordProtectedFiles'] = opts[:'allow_password_protected_files'] if !opts[:'allow_password_protected_files'].nil?
130
+ header_params[:'allowMacros'] = opts[:'allow_macros'] if !opts[:'allow_macros'].nil?
131
+ header_params[:'allowXmlExternalEntities'] = opts[:'allow_xml_external_entities'] if !opts[:'allow_xml_external_entities'].nil?
132
+ header_params[:'restrictFileTypes'] = opts[:'restrict_file_types'] if !opts[:'restrict_file_types'].nil?
133
+
134
+ # form parameters
135
+ form_params = {}
136
+ form_params['inputFile'] = input_file
137
+
138
+ # http body (model)
139
+ post_body = nil
140
+ auth_names = ['Apikey']
141
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
142
+ :header_params => header_params,
143
+ :query_params => query_params,
144
+ :form_params => form_params,
145
+ :body => post_body,
146
+ :auth_names => auth_names,
147
+ :return_type => 'VirusScanAdvancedResult')
148
+ if @api_client.config.debugging
149
+ @api_client.config.logger.debug "API called: ScanApi#scan_file_advanced\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
150
+ end
151
+ return data, status_code, headers
152
+ end
153
+ # Scan a website for malicious content and threats
154
+ # Operation includes scanning the content of the URL for various types of malicious content and threats, including viruses and threats (including Phishing).
155
+ # @param input
156
+ # @param [Hash] opts the optional parameters
157
+ # @return [WebsiteScanResult]
158
+ def scan_website(input, opts = {})
159
+ data, _status_code, _headers = scan_website_with_http_info(input, opts)
160
+ data
161
+ end
162
+
163
+ # Scan a website for malicious content and threats
164
+ # Operation includes scanning the content of the URL for various types of malicious content and threats, including viruses and threats (including Phishing).
165
+ # @param input
166
+ # @param [Hash] opts the optional parameters
167
+ # @return [Array<(WebsiteScanResult, Fixnum, Hash)>] WebsiteScanResult data, response status code and response headers
168
+ def scan_website_with_http_info(input, opts = {})
169
+ if @api_client.config.debugging
170
+ @api_client.config.logger.debug 'Calling API: ScanApi.scan_website ...'
171
+ end
172
+ # verify the required parameter 'input' is set
173
+ if @api_client.config.client_side_validation && input.nil?
174
+ fail ArgumentError, "Missing the required parameter 'input' when calling ScanApi.scan_website"
175
+ end
176
+ # resource path
177
+ local_var_path = '/virus/scan/website'
178
+
179
+ # query parameters
180
+ query_params = {}
181
+
182
+ # header parameters
183
+ header_params = {}
184
+ # HTTP header 'Accept' (if needed)
185
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
186
+ # HTTP header 'Content-Type'
187
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
188
+
189
+ # form parameters
190
+ form_params = {}
191
+
192
+ # http body (model)
193
+ post_body = @api_client.object_to_http_body(input)
194
+ auth_names = ['Apikey']
195
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
196
+ :header_params => header_params,
197
+ :query_params => query_params,
198
+ :form_params => form_params,
199
+ :body => post_body,
200
+ :auth_names => auth_names,
201
+ :return_type => 'WebsiteScanResult')
202
+ if @api_client.config.debugging
203
+ @api_client.config.logger.debug "API called: ScanApi#scan_website\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
204
+ end
205
+ return data, status_code, headers
206
+ end
207
+ end
208
+ end
@@ -0,0 +1,519 @@
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 'uri'
14
+
15
+ module CloudmersiveVirusScanApiClient
16
+ class ScanCloudStorageApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Scan an AWS S3 file for viruses
23
+ # Scan the contents of a single AWS S3 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.
24
+ # @param access_key AWS S3 access key for the S3 bucket; you can get this from My Security Credentials in the AWS console
25
+ # @param secret_key AWS S3 secret key for the S3 bucket; you can get this from My Security Credentials in the AWS console
26
+ # @param bucket_region Name of the region of the S3 bucket, such as &#39;US-East-1&#39;
27
+ # @param bucket_name Name of the S3 bucket
28
+ # @param key_name Key name (also called file name) of the file in S3 that you wish to scan for viruses
29
+ # @param [Hash] opts the optional parameters
30
+ # @return [CloudStorageVirusScanResult]
31
+ def scan_cloud_storage_scan_aws_s3_file(access_key, secret_key, bucket_region, bucket_name, key_name, opts = {})
32
+ data, _status_code, _headers = scan_cloud_storage_scan_aws_s3_file_with_http_info(access_key, secret_key, bucket_region, bucket_name, key_name, opts)
33
+ data
34
+ end
35
+
36
+ # Scan an AWS S3 file for viruses
37
+ # Scan the contents of a single AWS S3 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.
38
+ # @param access_key AWS S3 access key for the S3 bucket; you can get this from My Security Credentials in the AWS console
39
+ # @param secret_key AWS S3 secret key for the S3 bucket; you can get this from My Security Credentials in the AWS console
40
+ # @param bucket_region Name of the region of the S3 bucket, such as &#39;US-East-1&#39;
41
+ # @param bucket_name Name of the S3 bucket
42
+ # @param key_name Key name (also called file name) of the file in S3 that you wish to scan for viruses
43
+ # @param [Hash] opts the optional parameters
44
+ # @return [Array<(CloudStorageVirusScanResult, Fixnum, Hash)>] CloudStorageVirusScanResult data, response status code and response headers
45
+ def scan_cloud_storage_scan_aws_s3_file_with_http_info(access_key, secret_key, bucket_region, bucket_name, key_name, opts = {})
46
+ if @api_client.config.debugging
47
+ @api_client.config.logger.debug 'Calling API: ScanCloudStorageApi.scan_cloud_storage_scan_aws_s3_file ...'
48
+ end
49
+ # verify the required parameter 'access_key' is set
50
+ if @api_client.config.client_side_validation && access_key.nil?
51
+ fail ArgumentError, "Missing the required parameter 'access_key' when calling ScanCloudStorageApi.scan_cloud_storage_scan_aws_s3_file"
52
+ end
53
+ # verify the required parameter 'secret_key' is set
54
+ if @api_client.config.client_side_validation && secret_key.nil?
55
+ fail ArgumentError, "Missing the required parameter 'secret_key' when calling ScanCloudStorageApi.scan_cloud_storage_scan_aws_s3_file"
56
+ end
57
+ # verify the required parameter 'bucket_region' is set
58
+ if @api_client.config.client_side_validation && bucket_region.nil?
59
+ fail ArgumentError, "Missing the required parameter 'bucket_region' when calling ScanCloudStorageApi.scan_cloud_storage_scan_aws_s3_file"
60
+ end
61
+ # verify the required parameter 'bucket_name' is set
62
+ if @api_client.config.client_side_validation && bucket_name.nil?
63
+ fail ArgumentError, "Missing the required parameter 'bucket_name' when calling ScanCloudStorageApi.scan_cloud_storage_scan_aws_s3_file"
64
+ end
65
+ # verify the required parameter 'key_name' is set
66
+ if @api_client.config.client_side_validation && key_name.nil?
67
+ fail ArgumentError, "Missing the required parameter 'key_name' when calling ScanCloudStorageApi.scan_cloud_storage_scan_aws_s3_file"
68
+ end
69
+ # resource path
70
+ local_var_path = '/virus/scan/cloud-storage/aws-s3/single'
71
+
72
+ # query parameters
73
+ query_params = {}
74
+
75
+ # header parameters
76
+ header_params = {}
77
+ # HTTP header 'Accept' (if needed)
78
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
79
+ # HTTP header 'Content-Type'
80
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
81
+ header_params[:'accessKey'] = access_key
82
+ header_params[:'secretKey'] = secret_key
83
+ header_params[:'bucketRegion'] = bucket_region
84
+ header_params[:'bucketName'] = bucket_name
85
+ header_params[:'keyName'] = key_name
86
+
87
+ # form parameters
88
+ form_params = {}
89
+
90
+ # http body (model)
91
+ post_body = nil
92
+ auth_names = ['Apikey']
93
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
94
+ :header_params => header_params,
95
+ :query_params => query_params,
96
+ :form_params => form_params,
97
+ :body => post_body,
98
+ :auth_names => auth_names,
99
+ :return_type => 'CloudStorageVirusScanResult')
100
+ if @api_client.config.debugging
101
+ @api_client.config.logger.debug "API called: ScanCloudStorageApi#scan_cloud_storage_scan_aws_s3_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
102
+ end
103
+ return data, status_code, headers
104
+ end
105
+ # Advanced Scan an AWS S3 file for viruses
106
+ # 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.
107
+ # @param access_key AWS S3 access key for the S3 bucket; you can get this from My Security Credentials in the AWS console
108
+ # @param secret_key AWS S3 secret key for the S3 bucket; you can get this from My Security Credentials in the AWS console
109
+ # @param bucket_region Name of the region of the S3 bucket, such as &#39;US-East-1&#39;
110
+ # @param bucket_name Name of the S3 bucket
111
+ # @param key_name Key name (also called file name) of the file in S3 that you wish to scan for viruses
112
+ # @param [Hash] opts the optional parameters
113
+ # @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).
114
+ # @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).
115
+ # @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).
116
+ # @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).
117
+ # @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).
118
+ # @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.
119
+ # @return [CloudStorageAdvancedVirusScanResult]
120
+ def scan_cloud_storage_scan_aws_s3_file_advanced(access_key, secret_key, bucket_region, bucket_name, key_name, opts = {})
121
+ data, _status_code, _headers = scan_cloud_storage_scan_aws_s3_file_advanced_with_http_info(access_key, secret_key, bucket_region, bucket_name, key_name, opts)
122
+ data
123
+ end
124
+
125
+ # Advanced Scan an AWS S3 file for viruses
126
+ # 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.
127
+ # @param access_key AWS S3 access key for the S3 bucket; you can get this from My Security Credentials in the AWS console
128
+ # @param secret_key AWS S3 secret key for the S3 bucket; you can get this from My Security Credentials in the AWS console
129
+ # @param bucket_region Name of the region of the S3 bucket, such as &#39;US-East-1&#39;
130
+ # @param bucket_name Name of the S3 bucket
131
+ # @param key_name Key name (also called file name) of the file in S3 that you wish to scan for viruses
132
+ # @param [Hash] opts the optional parameters
133
+ # @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).
134
+ # @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).
135
+ # @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).
136
+ # @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).
137
+ # @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).
138
+ # @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.
139
+ # @return [Array<(CloudStorageAdvancedVirusScanResult, Fixnum, Hash)>] CloudStorageAdvancedVirusScanResult data, response status code and response headers
140
+ def scan_cloud_storage_scan_aws_s3_file_advanced_with_http_info(access_key, secret_key, bucket_region, bucket_name, key_name, opts = {})
141
+ if @api_client.config.debugging
142
+ @api_client.config.logger.debug 'Calling API: ScanCloudStorageApi.scan_cloud_storage_scan_aws_s3_file_advanced ...'
143
+ end
144
+ # verify the required parameter 'access_key' is set
145
+ if @api_client.config.client_side_validation && access_key.nil?
146
+ fail ArgumentError, "Missing the required parameter 'access_key' when calling ScanCloudStorageApi.scan_cloud_storage_scan_aws_s3_file_advanced"
147
+ end
148
+ # verify the required parameter 'secret_key' is set
149
+ if @api_client.config.client_side_validation && secret_key.nil?
150
+ fail ArgumentError, "Missing the required parameter 'secret_key' when calling ScanCloudStorageApi.scan_cloud_storage_scan_aws_s3_file_advanced"
151
+ end
152
+ # verify the required parameter 'bucket_region' is set
153
+ if @api_client.config.client_side_validation && bucket_region.nil?
154
+ fail ArgumentError, "Missing the required parameter 'bucket_region' when calling ScanCloudStorageApi.scan_cloud_storage_scan_aws_s3_file_advanced"
155
+ end
156
+ # verify the required parameter 'bucket_name' is set
157
+ if @api_client.config.client_side_validation && bucket_name.nil?
158
+ fail ArgumentError, "Missing the required parameter 'bucket_name' when calling ScanCloudStorageApi.scan_cloud_storage_scan_aws_s3_file_advanced"
159
+ end
160
+ # verify the required parameter 'key_name' is set
161
+ if @api_client.config.client_side_validation && key_name.nil?
162
+ fail ArgumentError, "Missing the required parameter 'key_name' when calling ScanCloudStorageApi.scan_cloud_storage_scan_aws_s3_file_advanced"
163
+ end
164
+ # resource path
165
+ local_var_path = '/virus/scan/cloud-storage/aws-s3/single/advanced'
166
+
167
+ # query parameters
168
+ query_params = {}
169
+
170
+ # header parameters
171
+ header_params = {}
172
+ # HTTP header 'Accept' (if needed)
173
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
174
+ # HTTP header 'Content-Type'
175
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
176
+ header_params[:'accessKey'] = access_key
177
+ header_params[:'secretKey'] = secret_key
178
+ header_params[:'bucketRegion'] = bucket_region
179
+ header_params[:'bucketName'] = bucket_name
180
+ header_params[:'keyName'] = key_name
181
+ header_params[:'allowExecutables'] = opts[:'allow_executables'] if !opts[:'allow_executables'].nil?
182
+ header_params[:'allowInvalidFiles'] = opts[:'allow_invalid_files'] if !opts[:'allow_invalid_files'].nil?
183
+ header_params[:'allowScripts'] = opts[:'allow_scripts'] if !opts[:'allow_scripts'].nil?
184
+ header_params[:'allowPasswordProtectedFiles'] = opts[:'allow_password_protected_files'] if !opts[:'allow_password_protected_files'].nil?
185
+ header_params[:'allowMacros'] = opts[:'allow_macros'] if !opts[:'allow_macros'].nil?
186
+ header_params[:'restrictFileTypes'] = opts[:'restrict_file_types'] if !opts[:'restrict_file_types'].nil?
187
+
188
+ # form parameters
189
+ form_params = {}
190
+
191
+ # http body (model)
192
+ post_body = nil
193
+ auth_names = ['Apikey']
194
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
195
+ :header_params => header_params,
196
+ :query_params => query_params,
197
+ :form_params => form_params,
198
+ :body => post_body,
199
+ :auth_names => auth_names,
200
+ :return_type => 'CloudStorageAdvancedVirusScanResult')
201
+ if @api_client.config.debugging
202
+ @api_client.config.logger.debug "API called: ScanCloudStorageApi#scan_cloud_storage_scan_aws_s3_file_advanced\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
203
+ end
204
+ return data, status_code, headers
205
+ end
206
+ # Scan an Azure Blob for viruses
207
+ # 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.
208
+ # @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.
209
+ # @param container_name Name of the Blob container within the Azure Blob Storage account
210
+ # @param blob_path Path to the blob within the container, such as &#39;hello.pdf&#39; or &#39;/folder/subfolder/world.pdf&#39;
211
+ # @param [Hash] opts the optional parameters
212
+ # @return [CloudStorageVirusScanResult]
213
+ def scan_cloud_storage_scan_azure_blob(connection_string, container_name, blob_path, opts = {})
214
+ data, _status_code, _headers = scan_cloud_storage_scan_azure_blob_with_http_info(connection_string, container_name, blob_path, opts)
215
+ data
216
+ end
217
+
218
+ # Scan an Azure Blob for viruses
219
+ # 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.
220
+ # @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.
221
+ # @param container_name Name of the Blob container within the Azure Blob Storage account
222
+ # @param blob_path Path to the blob within the container, such as &#39;hello.pdf&#39; or &#39;/folder/subfolder/world.pdf&#39;
223
+ # @param [Hash] opts the optional parameters
224
+ # @return [Array<(CloudStorageVirusScanResult, Fixnum, Hash)>] CloudStorageVirusScanResult data, response status code and response headers
225
+ def scan_cloud_storage_scan_azure_blob_with_http_info(connection_string, container_name, blob_path, opts = {})
226
+ if @api_client.config.debugging
227
+ @api_client.config.logger.debug 'Calling API: ScanCloudStorageApi.scan_cloud_storage_scan_azure_blob ...'
228
+ end
229
+ # verify the required parameter 'connection_string' is set
230
+ if @api_client.config.client_side_validation && connection_string.nil?
231
+ fail ArgumentError, "Missing the required parameter 'connection_string' when calling ScanCloudStorageApi.scan_cloud_storage_scan_azure_blob"
232
+ end
233
+ # verify the required parameter 'container_name' is set
234
+ if @api_client.config.client_side_validation && container_name.nil?
235
+ fail ArgumentError, "Missing the required parameter 'container_name' when calling ScanCloudStorageApi.scan_cloud_storage_scan_azure_blob"
236
+ end
237
+ # verify the required parameter 'blob_path' is set
238
+ if @api_client.config.client_side_validation && blob_path.nil?
239
+ fail ArgumentError, "Missing the required parameter 'blob_path' when calling ScanCloudStorageApi.scan_cloud_storage_scan_azure_blob"
240
+ end
241
+ # resource path
242
+ local_var_path = '/virus/scan/cloud-storage/azure-blob/single'
243
+
244
+ # query parameters
245
+ query_params = {}
246
+
247
+ # header parameters
248
+ header_params = {}
249
+ # HTTP header 'Accept' (if needed)
250
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
251
+ # HTTP header 'Content-Type'
252
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
253
+ header_params[:'connectionString'] = connection_string
254
+ header_params[:'containerName'] = container_name
255
+ header_params[:'blobPath'] = blob_path
256
+
257
+ # form parameters
258
+ form_params = {}
259
+
260
+ # http body (model)
261
+ post_body = nil
262
+ auth_names = ['Apikey']
263
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
264
+ :header_params => header_params,
265
+ :query_params => query_params,
266
+ :form_params => form_params,
267
+ :body => post_body,
268
+ :auth_names => auth_names,
269
+ :return_type => 'CloudStorageVirusScanResult')
270
+ if @api_client.config.debugging
271
+ @api_client.config.logger.debug "API called: ScanCloudStorageApi#scan_cloud_storage_scan_azure_blob\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
272
+ end
273
+ return data, status_code, headers
274
+ end
275
+ # Advanced Scan an Azure Blob for viruses
276
+ # 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.
277
+ # @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.
278
+ # @param container_name Name of the Blob container within the Azure Blob Storage account
279
+ # @param blob_path Path to the blob within the container, such as &#39;hello.pdf&#39; or &#39;/folder/subfolder/world.pdf&#39;
280
+ # @param [Hash] opts the optional parameters
281
+ # @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).
282
+ # @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).
283
+ # @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).
284
+ # @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).
285
+ # @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).
286
+ # @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.
287
+ # @return [CloudStorageAdvancedVirusScanResult]
288
+ def scan_cloud_storage_scan_azure_blob_advanced(connection_string, container_name, blob_path, opts = {})
289
+ data, _status_code, _headers = scan_cloud_storage_scan_azure_blob_advanced_with_http_info(connection_string, container_name, blob_path, opts)
290
+ data
291
+ end
292
+
293
+ # Advanced Scan an Azure Blob for viruses
294
+ # 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.
295
+ # @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.
296
+ # @param container_name Name of the Blob container within the Azure Blob Storage account
297
+ # @param blob_path Path to the blob within the container, such as &#39;hello.pdf&#39; or &#39;/folder/subfolder/world.pdf&#39;
298
+ # @param [Hash] opts the optional parameters
299
+ # @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).
300
+ # @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).
301
+ # @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).
302
+ # @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).
303
+ # @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).
304
+ # @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.
305
+ # @return [Array<(CloudStorageAdvancedVirusScanResult, Fixnum, Hash)>] CloudStorageAdvancedVirusScanResult data, response status code and response headers
306
+ def scan_cloud_storage_scan_azure_blob_advanced_with_http_info(connection_string, container_name, blob_path, opts = {})
307
+ if @api_client.config.debugging
308
+ @api_client.config.logger.debug 'Calling API: ScanCloudStorageApi.scan_cloud_storage_scan_azure_blob_advanced ...'
309
+ end
310
+ # verify the required parameter 'connection_string' is set
311
+ if @api_client.config.client_side_validation && connection_string.nil?
312
+ fail ArgumentError, "Missing the required parameter 'connection_string' when calling ScanCloudStorageApi.scan_cloud_storage_scan_azure_blob_advanced"
313
+ end
314
+ # verify the required parameter 'container_name' is set
315
+ if @api_client.config.client_side_validation && container_name.nil?
316
+ fail ArgumentError, "Missing the required parameter 'container_name' when calling ScanCloudStorageApi.scan_cloud_storage_scan_azure_blob_advanced"
317
+ end
318
+ # verify the required parameter 'blob_path' is set
319
+ if @api_client.config.client_side_validation && blob_path.nil?
320
+ fail ArgumentError, "Missing the required parameter 'blob_path' when calling ScanCloudStorageApi.scan_cloud_storage_scan_azure_blob_advanced"
321
+ end
322
+ # resource path
323
+ local_var_path = '/virus/scan/cloud-storage/azure-blob/single/advanced'
324
+
325
+ # query parameters
326
+ query_params = {}
327
+
328
+ # header parameters
329
+ header_params = {}
330
+ # HTTP header 'Accept' (if needed)
331
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
332
+ # HTTP header 'Content-Type'
333
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
334
+ header_params[:'connectionString'] = connection_string
335
+ header_params[:'containerName'] = container_name
336
+ header_params[:'blobPath'] = blob_path
337
+ header_params[:'allowExecutables'] = opts[:'allow_executables'] if !opts[:'allow_executables'].nil?
338
+ header_params[:'allowInvalidFiles'] = opts[:'allow_invalid_files'] if !opts[:'allow_invalid_files'].nil?
339
+ header_params[:'allowScripts'] = opts[:'allow_scripts'] if !opts[:'allow_scripts'].nil?
340
+ header_params[:'allowPasswordProtectedFiles'] = opts[:'allow_password_protected_files'] if !opts[:'allow_password_protected_files'].nil?
341
+ header_params[:'allowMacros'] = opts[:'allow_macros'] if !opts[:'allow_macros'].nil?
342
+ header_params[:'restrictFileTypes'] = opts[:'restrict_file_types'] if !opts[:'restrict_file_types'].nil?
343
+
344
+ # form parameters
345
+ form_params = {}
346
+
347
+ # http body (model)
348
+ post_body = nil
349
+ auth_names = ['Apikey']
350
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
351
+ :header_params => header_params,
352
+ :query_params => query_params,
353
+ :form_params => form_params,
354
+ :body => post_body,
355
+ :auth_names => auth_names,
356
+ :return_type => 'CloudStorageAdvancedVirusScanResult')
357
+ if @api_client.config.debugging
358
+ @api_client.config.logger.debug "API called: ScanCloudStorageApi#scan_cloud_storage_scan_azure_blob_advanced\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
359
+ end
360
+ return data, status_code, headers
361
+ end
362
+ # Scan an Google Cloud Platform (GCP) Storage file for viruses
363
+ # 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.
364
+ # @param bucket_name Name of the bucket in Google Cloud Storage
365
+ # @param object_name Name of the object or file in Google Cloud Storage
366
+ # @param json_credential_file Service Account credential for Google Cloud stored in a JSON file.
367
+ # @param [Hash] opts the optional parameters
368
+ # @return [CloudStorageVirusScanResult]
369
+ def scan_cloud_storage_scan_gcp_storage_file(bucket_name, object_name, json_credential_file, opts = {})
370
+ data, _status_code, _headers = scan_cloud_storage_scan_gcp_storage_file_with_http_info(bucket_name, object_name, json_credential_file, opts)
371
+ data
372
+ end
373
+
374
+ # Scan an Google Cloud Platform (GCP) Storage file for viruses
375
+ # 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.
376
+ # @param bucket_name Name of the bucket in Google Cloud Storage
377
+ # @param object_name Name of the object or file in Google Cloud Storage
378
+ # @param json_credential_file Service Account credential for Google Cloud stored in a JSON file.
379
+ # @param [Hash] opts the optional parameters
380
+ # @return [Array<(CloudStorageVirusScanResult, Fixnum, Hash)>] CloudStorageVirusScanResult data, response status code and response headers
381
+ def scan_cloud_storage_scan_gcp_storage_file_with_http_info(bucket_name, object_name, json_credential_file, opts = {})
382
+ if @api_client.config.debugging
383
+ @api_client.config.logger.debug 'Calling API: ScanCloudStorageApi.scan_cloud_storage_scan_gcp_storage_file ...'
384
+ end
385
+ # verify the required parameter 'bucket_name' is set
386
+ if @api_client.config.client_side_validation && bucket_name.nil?
387
+ fail ArgumentError, "Missing the required parameter 'bucket_name' when calling ScanCloudStorageApi.scan_cloud_storage_scan_gcp_storage_file"
388
+ end
389
+ # verify the required parameter 'object_name' is set
390
+ if @api_client.config.client_side_validation && object_name.nil?
391
+ fail ArgumentError, "Missing the required parameter 'object_name' when calling ScanCloudStorageApi.scan_cloud_storage_scan_gcp_storage_file"
392
+ end
393
+ # verify the required parameter 'json_credential_file' is set
394
+ if @api_client.config.client_side_validation && json_credential_file.nil?
395
+ fail ArgumentError, "Missing the required parameter 'json_credential_file' when calling ScanCloudStorageApi.scan_cloud_storage_scan_gcp_storage_file"
396
+ end
397
+ # resource path
398
+ local_var_path = '/virus/scan/cloud-storage/gcp-storage/single'
399
+
400
+ # query parameters
401
+ query_params = {}
402
+
403
+ # header parameters
404
+ header_params = {}
405
+ # HTTP header 'Accept' (if needed)
406
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
407
+ # HTTP header 'Content-Type'
408
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
409
+ header_params[:'bucketName'] = bucket_name
410
+ header_params[:'objectName'] = object_name
411
+
412
+ # form parameters
413
+ form_params = {}
414
+ form_params['jsonCredentialFile'] = json_credential_file
415
+
416
+ # http body (model)
417
+ post_body = nil
418
+ auth_names = ['Apikey']
419
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
420
+ :header_params => header_params,
421
+ :query_params => query_params,
422
+ :form_params => form_params,
423
+ :body => post_body,
424
+ :auth_names => auth_names,
425
+ :return_type => 'CloudStorageVirusScanResult')
426
+ if @api_client.config.debugging
427
+ @api_client.config.logger.debug "API called: ScanCloudStorageApi#scan_cloud_storage_scan_gcp_storage_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
428
+ end
429
+ return data, status_code, headers
430
+ end
431
+ # Advanced Scan an Google Cloud Platform (GCP) Storage file for viruses
432
+ # 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.
433
+ # @param bucket_name Name of the bucket in Google Cloud Storage
434
+ # @param object_name Name of the object or file in Google Cloud Storage
435
+ # @param json_credential_file Service Account credential for Google Cloud stored in a JSON file.
436
+ # @param [Hash] opts the optional parameters
437
+ # @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).
438
+ # @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).
439
+ # @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).
440
+ # @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).
441
+ # @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).
442
+ # @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.
443
+ # @return [CloudStorageAdvancedVirusScanResult]
444
+ def scan_cloud_storage_scan_gcp_storage_file_advanced(bucket_name, object_name, json_credential_file, opts = {})
445
+ data, _status_code, _headers = scan_cloud_storage_scan_gcp_storage_file_advanced_with_http_info(bucket_name, object_name, json_credential_file, opts)
446
+ data
447
+ end
448
+
449
+ # Advanced Scan an Google Cloud Platform (GCP) Storage file for viruses
450
+ # 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.
451
+ # @param bucket_name Name of the bucket in Google Cloud Storage
452
+ # @param object_name Name of the object or file in Google Cloud Storage
453
+ # @param json_credential_file Service Account credential for Google Cloud stored in a JSON file.
454
+ # @param [Hash] opts the optional parameters
455
+ # @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).
456
+ # @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).
457
+ # @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).
458
+ # @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).
459
+ # @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).
460
+ # @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.
461
+ # @return [Array<(CloudStorageAdvancedVirusScanResult, Fixnum, Hash)>] CloudStorageAdvancedVirusScanResult data, response status code and response headers
462
+ def scan_cloud_storage_scan_gcp_storage_file_advanced_with_http_info(bucket_name, object_name, json_credential_file, opts = {})
463
+ if @api_client.config.debugging
464
+ @api_client.config.logger.debug 'Calling API: ScanCloudStorageApi.scan_cloud_storage_scan_gcp_storage_file_advanced ...'
465
+ end
466
+ # verify the required parameter 'bucket_name' is set
467
+ if @api_client.config.client_side_validation && bucket_name.nil?
468
+ fail ArgumentError, "Missing the required parameter 'bucket_name' when calling ScanCloudStorageApi.scan_cloud_storage_scan_gcp_storage_file_advanced"
469
+ end
470
+ # verify the required parameter 'object_name' is set
471
+ if @api_client.config.client_side_validation && object_name.nil?
472
+ fail ArgumentError, "Missing the required parameter 'object_name' when calling ScanCloudStorageApi.scan_cloud_storage_scan_gcp_storage_file_advanced"
473
+ end
474
+ # verify the required parameter 'json_credential_file' is set
475
+ if @api_client.config.client_side_validation && json_credential_file.nil?
476
+ fail ArgumentError, "Missing the required parameter 'json_credential_file' when calling ScanCloudStorageApi.scan_cloud_storage_scan_gcp_storage_file_advanced"
477
+ end
478
+ # resource path
479
+ local_var_path = '/virus/scan/cloud-storage/gcp-storage/single/advanced'
480
+
481
+ # query parameters
482
+ query_params = {}
483
+
484
+ # header parameters
485
+ header_params = {}
486
+ # HTTP header 'Accept' (if needed)
487
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
488
+ # HTTP header 'Content-Type'
489
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
490
+ header_params[:'bucketName'] = bucket_name
491
+ header_params[:'objectName'] = object_name
492
+ header_params[:'allowExecutables'] = opts[:'allow_executables'] if !opts[:'allow_executables'].nil?
493
+ header_params[:'allowInvalidFiles'] = opts[:'allow_invalid_files'] if !opts[:'allow_invalid_files'].nil?
494
+ header_params[:'allowScripts'] = opts[:'allow_scripts'] if !opts[:'allow_scripts'].nil?
495
+ header_params[:'allowPasswordProtectedFiles'] = opts[:'allow_password_protected_files'] if !opts[:'allow_password_protected_files'].nil?
496
+ header_params[:'allowMacros'] = opts[:'allow_macros'] if !opts[:'allow_macros'].nil?
497
+ header_params[:'restrictFileTypes'] = opts[:'restrict_file_types'] if !opts[:'restrict_file_types'].nil?
498
+
499
+ # form parameters
500
+ form_params = {}
501
+ form_params['jsonCredentialFile'] = json_credential_file
502
+
503
+ # http body (model)
504
+ post_body = nil
505
+ auth_names = ['Apikey']
506
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
507
+ :header_params => header_params,
508
+ :query_params => query_params,
509
+ :form_params => form_params,
510
+ :body => post_body,
511
+ :auth_names => auth_names,
512
+ :return_type => 'CloudStorageAdvancedVirusScanResult')
513
+ if @api_client.config.debugging
514
+ @api_client.config.logger.debug "API called: ScanCloudStorageApi#scan_cloud_storage_scan_gcp_storage_file_advanced\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
515
+ end
516
+ return data, status_code, headers
517
+ end
518
+ end
519
+ end