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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +10 -5
  4. data/cloudmersive-virus-scan-api-client.gemspec +3 -3
  5. data/docs/CloudStorageVirusFound.md +9 -0
  6. data/docs/CloudStorageVirusScanResult.md +12 -0
  7. data/docs/ScanApi.md +7 -5
  8. data/docs/ScanCloudStorageApi.md +197 -0
  9. data/docs/VirusScanAdvancedResult.md +1 -0
  10. data/docs/WebsiteScanResult.md +1 -0
  11. data/lib/cloudmersive-virus-scan-api-client.rb +4 -1
  12. data/lib/cloudmersive-virus-scan-api-client/api/scan_api.rb +18 -18
  13. data/lib/cloudmersive-virus-scan-api-client/api/scan_cloud_storage_api.rb +244 -0
  14. data/lib/cloudmersive-virus-scan-api-client/api_client.rb +11 -9
  15. data/lib/cloudmersive-virus-scan-api-client/api_error.rb +1 -1
  16. data/lib/cloudmersive-virus-scan-api-client/configuration.rb +2 -2
  17. data/lib/cloudmersive-virus-scan-api-client/models/cloud_storage_virus_found.rb +196 -0
  18. data/lib/cloudmersive-virus-scan-api-client/models/cloud_storage_virus_scan_result.rb +228 -0
  19. data/lib/cloudmersive-virus-scan-api-client/models/virus_found.rb +7 -10
  20. data/lib/cloudmersive-virus-scan-api-client/models/virus_scan_advanced_result.rb +18 -11
  21. data/lib/cloudmersive-virus-scan-api-client/models/virus_scan_result.rb +7 -10
  22. data/lib/cloudmersive-virus-scan-api-client/models/website_scan_request.rb +7 -10
  23. data/lib/cloudmersive-virus-scan-api-client/models/website_scan_result.rb +23 -15
  24. data/lib/cloudmersive-virus-scan-api-client/version.rb +2 -2
  25. data/spec/api/scan_api_spec.rb +6 -5
  26. data/spec/api/scan_cloud_storage_api_spec.rb +79 -0
  27. data/spec/api_client_spec.rb +52 -35
  28. data/spec/configuration_spec.rb +9 -9
  29. data/spec/models/cloud_storage_virus_found_spec.rb +47 -0
  30. data/spec/models/cloud_storage_virus_scan_result_spec.rb +65 -0
  31. data/spec/models/virus_found_spec.rb +3 -4
  32. data/spec/models/virus_scan_advanced_result_spec.rb +14 -9
  33. data/spec/models/virus_scan_result_spec.rb +3 -4
  34. data/spec/models/website_scan_request_spec.rb +2 -3
  35. data/spec/models/website_scan_result_spec.rb +14 -9
  36. data/spec/spec_helper.rb +1 -1
  37. metadata +11 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea020056eeec61abfb7bc56cd2d2d15be686dc363e60936615d868f586d29b9d
4
- data.tar.gz: 2b2478122a1c6f4f2cf35f497c002bc5c4fc50967df961c12f5af138d59d4af5
3
+ metadata.gz: b7caace679782d9c3c94207830526d9155e2fe119c5ccae38f5221313a3fa154
4
+ data.tar.gz: bd072e674ea3c7b17766963649bf33e0f51a205da72b23f6c01af537733df2b1
5
5
  SHA512:
6
- metadata.gz: 20243d475e07869de2ec6b4da279ff6c6f541fc58a2144b3561097b70ee57252558cc4ed2750601f3201cbe92de6a45e8314bdb0444af68e791a6ea4ea8f94dc
7
- data.tar.gz: 16a035810d10eebad4a892f3cf3fe255f064053e7ec0d1a3ddf08bfe19d27811f492052953190ef82d9f9d993547c8f0f6ef32ea466ed4d533c6432ed0e148e3
6
+ metadata.gz: 8fcba1dd4d2d82279dafee8e8f2abf0f38045dccda0e314ccfd510affa260f10fce7b6cecbcc4ff51ea98e4a99da8e767294d6090619142115f0f40dfa42aa92
7
+ data.tar.gz: 36f045d42117fbd01b0ef22812f8e0daa99c49cab4ac89d22b731265d6b71e0d93d3e8cafa3b6a86b0a67666438401a54b08cb86165d4154d34d88b01728ab05
data/Gemfile CHANGED
@@ -3,5 +3,5 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  group :development, :test do
6
- gem 'rake', '~> 12.0.0'
6
+ gem 'rake', '~> 12.3.3'
7
7
  end
data/README.md CHANGED
@@ -7,7 +7,7 @@ The Cloudmersive Virus Scan API lets you scan files and content for viruses and
7
7
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
8
 
9
9
  - API version: v1
10
- - Package version: 1.3.2
10
+ - Package version: 2.0.3
11
11
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
12
 
13
13
  ## Installation
@@ -23,15 +23,15 @@ gem build cloudmersive-virus-scan-api-client.gemspec
23
23
  Then either install the gem locally:
24
24
 
25
25
  ```shell
26
- gem install ./cloudmersive-virus-scan-api-client-1.3.2.gem
26
+ gem install ./cloudmersive-virus-scan-api-client-2.0.3.gem
27
27
  ```
28
- (for development, run `gem install --dev ./cloudmersive-virus-scan-api-client-1.3.2.gem` to install the development dependencies)
28
+ (for development, run `gem install --dev ./cloudmersive-virus-scan-api-client-2.0.3.gem` to install the development dependencies)
29
29
 
30
30
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
31
 
32
32
  Finally add this to the Gemfile:
33
33
 
34
- gem 'cloudmersive-virus-scan-api-client', '~> 1.3.2'
34
+ gem 'cloudmersive-virus-scan-api-client', '~> 2.0.3'
35
35
 
36
36
  ### Install from Git
37
37
 
@@ -64,7 +64,7 @@ end
64
64
 
65
65
  api_instance = CloudmersiveVirusScanApiClient::ScanApi.new
66
66
 
67
- input_file = File.new("/path/to/file.txt") # File | Input file to perform the operation on.
67
+ input_file = File.new('/path/to/file.txt') # File | Input file to perform the operation on.
68
68
 
69
69
 
70
70
  begin
@@ -86,10 +86,15 @@ Class | Method | HTTP request | Description
86
86
  *CloudmersiveVirusScanApiClient::ScanApi* | [**scan_file**](docs/ScanApi.md#scan_file) | **POST** /virus/scan/file | Scan a file for viruses
87
87
  *CloudmersiveVirusScanApiClient::ScanApi* | [**scan_file_advanced**](docs/ScanApi.md#scan_file_advanced) | **POST** /virus/scan/file/advanced | Advanced Scan a file for viruses
88
88
  *CloudmersiveVirusScanApiClient::ScanApi* | [**scan_website**](docs/ScanApi.md#scan_website) | **POST** /virus/scan/website | Scan a website for malicious content and threats
89
+ *CloudmersiveVirusScanApiClient::ScanCloudStorageApi* | [**scan_cloud_storage_scan_aws_s3_file**](docs/ScanCloudStorageApi.md#scan_cloud_storage_scan_aws_s3_file) | **POST** /virus/scan/cloud-storage/aws-s3/single | Scan an AWS S3 file for viruses
90
+ *CloudmersiveVirusScanApiClient::ScanCloudStorageApi* | [**scan_cloud_storage_scan_azure_blob**](docs/ScanCloudStorageApi.md#scan_cloud_storage_scan_azure_blob) | **POST** /virus/scan/cloud-storage/azure-blob/single | Scan an Azure Blob for viruses
91
+ *CloudmersiveVirusScanApiClient::ScanCloudStorageApi* | [**scan_cloud_storage_scan_gcp_storage_file**](docs/ScanCloudStorageApi.md#scan_cloud_storage_scan_gcp_storage_file) | **POST** /virus/scan/cloud-storage/gcp-storage/single | Scan an Google Cloud Platform (GCP) Storage file for viruses
89
92
 
90
93
 
91
94
  ## Documentation for Models
92
95
 
96
+ - [CloudmersiveVirusScanApiClient::CloudStorageVirusFound](docs/CloudStorageVirusFound.md)
97
+ - [CloudmersiveVirusScanApiClient::CloudStorageVirusScanResult](docs/CloudStorageVirusScanResult.md)
93
98
  - [CloudmersiveVirusScanApiClient::VirusFound](docs/VirusFound.md)
94
99
  - [CloudmersiveVirusScanApiClient::VirusScanAdvancedResult](docs/VirusScanAdvancedResult.md)
95
100
  - [CloudmersiveVirusScanApiClient::VirusScanResult](docs/VirusScanResult.md)
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
- #
2
+
3
3
  =begin
4
4
  #virusapi
5
5
 
@@ -8,7 +8,7 @@
8
8
  OpenAPI spec version: v1
9
9
 
10
10
  Generated by: https://github.com/swagger-api/swagger-codegen.git
11
- Swagger Codegen version: 2.3.1
11
+ Swagger Codegen version: 2.4.14
12
12
 
13
13
  =end
14
14
 
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
24
24
  s.homepage = "https://www.cloudmersive.com/virus-api"
25
25
  s.summary = "Scan files and content for viruses."
26
26
  s.description = "Virus API lets you scan files and content for viruses and identify security issues with content."
27
- s.license = "Apache 2.0"
27
+ s.license = 'Apache 2.0'
28
28
  s.required_ruby_version = ">= 1.9"
29
29
 
30
30
  s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
@@ -0,0 +1,9 @@
1
+ # CloudmersiveVirusScanApiClient::CloudStorageVirusFound
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,12 @@
1
+ # CloudmersiveVirusScanApiClient::CloudStorageVirusScanResult
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **successful** | **BOOLEAN** | 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. | [optional]
7
+ **clean_result** | **BOOLEAN** | True if the scan contained no viruses, false otherwise | [optional]
8
+ **found_viruses** | [**Array<CloudStorageVirusFound>**](CloudStorageVirusFound.md) | Array of viruses found, if any | [optional]
9
+ **error_detailed_description** | **String** | Detailed error message if the operation was not successful | [optional]
10
+ **file_size** | **Integer** | Size in bytes of the file that was retrieved and scanned | [optional]
11
+
12
+
@@ -30,7 +30,7 @@ end
30
30
 
31
31
  api_instance = CloudmersiveVirusScanApiClient::ScanApi.new
32
32
 
33
- input_file = File.new("/path/to/file.txt") # File | Input file to perform the operation on.
33
+ input_file = File.new('/path/to/file.txt') # File | Input file to perform the operation on.
34
34
 
35
35
 
36
36
  begin
@@ -84,13 +84,14 @@ end
84
84
 
85
85
  api_instance = CloudmersiveVirusScanApiClient::ScanApi.new
86
86
 
87
- input_file = File.new("/path/to/file.txt") # File | Input file to perform the operation on.
87
+ input_file = File.new('/path/to/file.txt') # File | Input file to perform the operation on.
88
88
 
89
89
  opts = {
90
90
  allow_executables: true, # BOOLEAN | Set to false to block executable files (program code) from being allowed in the input file. Default is false (recommended).
91
91
  allow_invalid_files: true, # BOOLEAN | 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).
92
- allow_scripts: true, # BOOLEAN | Set to false to block script files, such as a PHP files, Pythong scripts, and other malicious content or security threats that can be embedded in the file. Set to true to allow these file types. Default is false (recommended).
93
- restrict_file_types: "restrict_file_types_example" # String | 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=false. Set restrictFileTypes parameter to null or empty string to disable; default is disabled.
92
+ allow_scripts: true, # BOOLEAN | 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).
93
+ allow_password_protected_files: true, # BOOLEAN | 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).
94
+ restrict_file_types: 'restrict_file_types_example' # String | 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=false. Set restrictFileTypes parameter to null or empty string to disable; default is disabled.
94
95
  }
95
96
 
96
97
  begin
@@ -109,7 +110,8 @@ Name | Type | Description | Notes
109
110
  **input_file** | **File**| Input file to perform the operation on. |
110
111
  **allow_executables** | **BOOLEAN**| Set to false to block executable files (program code) from being allowed in the input file. Default is false (recommended). | [optional]
111
112
  **allow_invalid_files** | **BOOLEAN**| 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). | [optional]
112
- **allow_scripts** | **BOOLEAN**| Set to false to block script files, such as a PHP files, Pythong scripts, and other malicious content or security threats that can be embedded in the file. Set to true to allow these file types. Default is false (recommended). | [optional]
113
+ **allow_scripts** | **BOOLEAN**| 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). | [optional]
114
+ **allow_password_protected_files** | **BOOLEAN**| 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). | [optional]
113
115
  **restrict_file_types** | **String**| 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=false. Set restrictFileTypes parameter to null or empty string to disable; default is disabled. | [optional]
114
116
 
115
117
  ### Return type
@@ -0,0 +1,197 @@
1
+ # CloudmersiveVirusScanApiClient::ScanCloudStorageApi
2
+
3
+ All URIs are relative to *https://api.cloudmersive.com*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**scan_cloud_storage_scan_aws_s3_file**](ScanCloudStorageApi.md#scan_cloud_storage_scan_aws_s3_file) | **POST** /virus/scan/cloud-storage/aws-s3/single | Scan an AWS S3 file for viruses
8
+ [**scan_cloud_storage_scan_azure_blob**](ScanCloudStorageApi.md#scan_cloud_storage_scan_azure_blob) | **POST** /virus/scan/cloud-storage/azure-blob/single | Scan an Azure Blob for viruses
9
+ [**scan_cloud_storage_scan_gcp_storage_file**](ScanCloudStorageApi.md#scan_cloud_storage_scan_gcp_storage_file) | **POST** /virus/scan/cloud-storage/gcp-storage/single | Scan an Google Cloud Platform (GCP) Storage file for viruses
10
+
11
+
12
+ # **scan_cloud_storage_scan_aws_s3_file**
13
+ > CloudStorageVirusScanResult scan_cloud_storage_scan_aws_s3_file(access_key, secret_key, bucket_region, bucket_name, key_name)
14
+
15
+ Scan an AWS S3 file for viruses
16
+
17
+ 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.
18
+
19
+ ### Example
20
+ ```ruby
21
+ # load the gem
22
+ require 'cloudmersive-virus-scan-api-client'
23
+ # setup authorization
24
+ CloudmersiveVirusScanApiClient.configure do |config|
25
+ # Configure API key authorization: Apikey
26
+ config.api_key['Apikey'] = 'YOUR API KEY'
27
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
28
+ #config.api_key_prefix['Apikey'] = 'Bearer'
29
+ end
30
+
31
+ api_instance = CloudmersiveVirusScanApiClient::ScanCloudStorageApi.new
32
+
33
+ access_key = 'access_key_example' # String | AWS S3 access key for the S3 bucket; you can get this from My Security Credentials in the AWS console
34
+
35
+ secret_key = 'secret_key_example' # String | AWS S3 secret key for the S3 bucket; you can get this from My Security Credentials in the AWS console
36
+
37
+ bucket_region = 'bucket_region_example' # String | Name of the region of the S3 bucket, such as 'US-East-1'
38
+
39
+ bucket_name = 'bucket_name_example' # String | Name of the S3 bucket
40
+
41
+ key_name = 'key_name_example' # String | Key name (also called file name) of the file in S3 that you wish to scan for viruses
42
+
43
+
44
+ begin
45
+ #Scan an AWS S3 file for viruses
46
+ result = api_instance.scan_cloud_storage_scan_aws_s3_file(access_key, secret_key, bucket_region, bucket_name, key_name)
47
+ p result
48
+ rescue CloudmersiveVirusScanApiClient::ApiError => e
49
+ puts "Exception when calling ScanCloudStorageApi->scan_cloud_storage_scan_aws_s3_file: #{e}"
50
+ end
51
+ ```
52
+
53
+ ### Parameters
54
+
55
+ Name | Type | Description | Notes
56
+ ------------- | ------------- | ------------- | -------------
57
+ **access_key** | **String**| AWS S3 access key for the S3 bucket; you can get this from My Security Credentials in the AWS console |
58
+ **secret_key** | **String**| AWS S3 secret key for the S3 bucket; you can get this from My Security Credentials in the AWS console |
59
+ **bucket_region** | **String**| Name of the region of the S3 bucket, such as 'US-East-1' |
60
+ **bucket_name** | **String**| Name of the S3 bucket |
61
+ **key_name** | **String**| Key name (also called file name) of the file in S3 that you wish to scan for viruses |
62
+
63
+ ### Return type
64
+
65
+ [**CloudStorageVirusScanResult**](CloudStorageVirusScanResult.md)
66
+
67
+ ### Authorization
68
+
69
+ [Apikey](../README.md#Apikey)
70
+
71
+ ### HTTP request headers
72
+
73
+ - **Content-Type**: multipart/form-data
74
+ - **Accept**: application/json, text/json, application/xml, text/xml
75
+
76
+
77
+
78
+ # **scan_cloud_storage_scan_azure_blob**
79
+ > CloudStorageVirusScanResult scan_cloud_storage_scan_azure_blob(connection_string, container_name, blob_path)
80
+
81
+ Scan an Azure Blob for viruses
82
+
83
+ 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.
84
+
85
+ ### Example
86
+ ```ruby
87
+ # load the gem
88
+ require 'cloudmersive-virus-scan-api-client'
89
+ # setup authorization
90
+ CloudmersiveVirusScanApiClient.configure do |config|
91
+ # Configure API key authorization: Apikey
92
+ config.api_key['Apikey'] = 'YOUR API KEY'
93
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
94
+ #config.api_key_prefix['Apikey'] = 'Bearer'
95
+ end
96
+
97
+ api_instance = CloudmersiveVirusScanApiClient::ScanCloudStorageApi.new
98
+
99
+ connection_string = 'connection_string_example' # 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.
100
+
101
+ container_name = 'container_name_example' # String | Name of the Blob container within the Azure Blob Storage account
102
+
103
+ blob_path = 'blob_path_example' # String | Path to the blob within the container, such as 'hello.pdf' or '/folder/subfolder/world.pdf'
104
+
105
+
106
+ begin
107
+ #Scan an Azure Blob for viruses
108
+ result = api_instance.scan_cloud_storage_scan_azure_blob(connection_string, container_name, blob_path)
109
+ p result
110
+ rescue CloudmersiveVirusScanApiClient::ApiError => e
111
+ puts "Exception when calling ScanCloudStorageApi->scan_cloud_storage_scan_azure_blob: #{e}"
112
+ end
113
+ ```
114
+
115
+ ### Parameters
116
+
117
+ Name | Type | Description | Notes
118
+ ------------- | ------------- | ------------- | -------------
119
+ **connection_string** | **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. |
120
+ **container_name** | **String**| Name of the Blob container within the Azure Blob Storage account |
121
+ **blob_path** | **String**| Path to the blob within the container, such as 'hello.pdf' or '/folder/subfolder/world.pdf' |
122
+
123
+ ### Return type
124
+
125
+ [**CloudStorageVirusScanResult**](CloudStorageVirusScanResult.md)
126
+
127
+ ### Authorization
128
+
129
+ [Apikey](../README.md#Apikey)
130
+
131
+ ### HTTP request headers
132
+
133
+ - **Content-Type**: multipart/form-data
134
+ - **Accept**: application/json, text/json, application/xml, text/xml
135
+
136
+
137
+
138
+ # **scan_cloud_storage_scan_gcp_storage_file**
139
+ > CloudStorageVirusScanResult scan_cloud_storage_scan_gcp_storage_file(bucket_name, object_name, json_credential_file)
140
+
141
+ Scan an Google Cloud Platform (GCP) Storage file for viruses
142
+
143
+ 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.
144
+
145
+ ### Example
146
+ ```ruby
147
+ # load the gem
148
+ require 'cloudmersive-virus-scan-api-client'
149
+ # setup authorization
150
+ CloudmersiveVirusScanApiClient.configure do |config|
151
+ # Configure API key authorization: Apikey
152
+ config.api_key['Apikey'] = 'YOUR API KEY'
153
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
154
+ #config.api_key_prefix['Apikey'] = 'Bearer'
155
+ end
156
+
157
+ api_instance = CloudmersiveVirusScanApiClient::ScanCloudStorageApi.new
158
+
159
+ bucket_name = 'bucket_name_example' # String | Name of the bucket in Google Cloud Storage
160
+
161
+ object_name = 'object_name_example' # String | Name of the object or file in Google Cloud Storage
162
+
163
+ json_credential_file = File.new('/path/to/file.txt') # File | Service Account credential for Google Cloud stored in a JSON file.
164
+
165
+
166
+ begin
167
+ #Scan an Google Cloud Platform (GCP) Storage file for viruses
168
+ result = api_instance.scan_cloud_storage_scan_gcp_storage_file(bucket_name, object_name, json_credential_file)
169
+ p result
170
+ rescue CloudmersiveVirusScanApiClient::ApiError => e
171
+ puts "Exception when calling ScanCloudStorageApi->scan_cloud_storage_scan_gcp_storage_file: #{e}"
172
+ end
173
+ ```
174
+
175
+ ### Parameters
176
+
177
+ Name | Type | Description | Notes
178
+ ------------- | ------------- | ------------- | -------------
179
+ **bucket_name** | **String**| Name of the bucket in Google Cloud Storage |
180
+ **object_name** | **String**| Name of the object or file in Google Cloud Storage |
181
+ **json_credential_file** | **File**| Service Account credential for Google Cloud stored in a JSON file. |
182
+
183
+ ### Return type
184
+
185
+ [**CloudStorageVirusScanResult**](CloudStorageVirusScanResult.md)
186
+
187
+ ### Authorization
188
+
189
+ [Apikey](../README.md#Apikey)
190
+
191
+ ### HTTP request headers
192
+
193
+ - **Content-Type**: multipart/form-data
194
+ - **Accept**: application/json, text/json, application/xml, text/xml
195
+
196
+
197
+
@@ -7,6 +7,7 @@ Name | Type | Description | Notes
7
7
  **contains_executable** | **BOOLEAN** | True if the scan contained an executable (application code), which can be a significant risk factor | [optional]
8
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
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]
10
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]
11
12
  **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]
12
13
  **found_viruses** | [**Array<VirusFound>**](VirusFound.md) | Array of viruses found, if any | [optional]
@@ -6,5 +6,6 @@ Name | Type | Description | Notes
6
6
  **clean_result** | **BOOLEAN** | True if the scan contained no threats, false otherwise | [optional]
7
7
  **website_threat_type** | **String** | Type of threat returned; can be None, Malware, ForcedDownload or Phishing | [optional]
8
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]
9
10
 
10
11
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -17,6 +17,8 @@ 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_virus_found'
21
+ require 'cloudmersive-virus-scan-api-client/models/cloud_storage_virus_scan_result'
20
22
  require 'cloudmersive-virus-scan-api-client/models/virus_found'
21
23
  require 'cloudmersive-virus-scan-api-client/models/virus_scan_advanced_result'
22
24
  require 'cloudmersive-virus-scan-api-client/models/virus_scan_result'
@@ -25,6 +27,7 @@ require 'cloudmersive-virus-scan-api-client/models/website_scan_result'
25
27
 
26
28
  # APIs
27
29
  require 'cloudmersive-virus-scan-api-client/api/scan_api'
30
+ require 'cloudmersive-virus-scan-api-client/api/scan_cloud_storage_api'
28
31
 
29
32
  module CloudmersiveVirusScanApiClient
30
33
  class << self
@@ -6,11 +6,11 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
13
- require "uri"
13
+ require 'uri'
14
14
 
15
15
  module CloudmersiveVirusScanApiClient
16
16
  class ScanApi
@@ -19,7 +19,6 @@ module CloudmersiveVirusScanApiClient
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
-
23
22
  # Scan a file for viruses
24
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.
25
24
  # @param input_file Input file to perform the operation on.
@@ -27,7 +26,7 @@ module CloudmersiveVirusScanApiClient
27
26
  # @return [VirusScanResult]
28
27
  def scan_file(input_file, opts = {})
29
28
  data, _status_code, _headers = scan_file_with_http_info(input_file, opts)
30
- return data
29
+ data
31
30
  end
32
31
 
33
32
  # Scan a file for viruses
@@ -37,14 +36,14 @@ module CloudmersiveVirusScanApiClient
37
36
  # @return [Array<(VirusScanResult, Fixnum, Hash)>] VirusScanResult data, response status code and response headers
38
37
  def scan_file_with_http_info(input_file, opts = {})
39
38
  if @api_client.config.debugging
40
- @api_client.config.logger.debug "Calling API: ScanApi.scan_file ..."
39
+ @api_client.config.logger.debug 'Calling API: ScanApi.scan_file ...'
41
40
  end
42
41
  # verify the required parameter 'input_file' is set
43
42
  if @api_client.config.client_side_validation && input_file.nil?
44
43
  fail ArgumentError, "Missing the required parameter 'input_file' when calling ScanApi.scan_file"
45
44
  end
46
45
  # resource path
47
- local_var_path = "/virus/scan/file"
46
+ local_var_path = '/virus/scan/file'
48
47
 
49
48
  # query parameters
50
49
  query_params = {}
@@ -58,7 +57,7 @@ module CloudmersiveVirusScanApiClient
58
57
 
59
58
  # form parameters
60
59
  form_params = {}
61
- form_params["inputFile"] = input_file
60
+ form_params['inputFile'] = input_file
62
61
 
63
62
  # http body (model)
64
63
  post_body = nil
@@ -75,19 +74,19 @@ module CloudmersiveVirusScanApiClient
75
74
  end
76
75
  return data, status_code, headers
77
76
  end
78
-
79
77
  # Advanced Scan a file for viruses
80
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.
81
79
  # @param input_file Input file to perform the operation on.
82
80
  # @param [Hash] opts the optional parameters
83
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).
84
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).
85
- # @option opts [BOOLEAN] :allow_scripts Set to false to block script files, such as a PHP files, Pythong scripts, and other malicious content or security threats that can be embedded in the file. Set to true to allow these file types. Default is false (recommended).
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).
86
85
  # @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.
87
86
  # @return [VirusScanAdvancedResult]
88
87
  def scan_file_advanced(input_file, opts = {})
89
88
  data, _status_code, _headers = scan_file_advanced_with_http_info(input_file, opts)
90
- return data
89
+ data
91
90
  end
92
91
 
93
92
  # Advanced Scan a file for viruses
@@ -96,19 +95,20 @@ module CloudmersiveVirusScanApiClient
96
95
  # @param [Hash] opts the optional parameters
97
96
  # @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).
98
97
  # @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).
99
- # @option opts [BOOLEAN] :allow_scripts Set to false to block script files, such as a PHP files, Pythong scripts, and other malicious content or security threats that can be embedded in the file. Set to true to allow these file types. Default is false (recommended).
98
+ # @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).
99
+ # @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).
100
100
  # @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.
101
101
  # @return [Array<(VirusScanAdvancedResult, Fixnum, Hash)>] VirusScanAdvancedResult data, response status code and response headers
102
102
  def scan_file_advanced_with_http_info(input_file, opts = {})
103
103
  if @api_client.config.debugging
104
- @api_client.config.logger.debug "Calling API: ScanApi.scan_file_advanced ..."
104
+ @api_client.config.logger.debug 'Calling API: ScanApi.scan_file_advanced ...'
105
105
  end
106
106
  # verify the required parameter 'input_file' is set
107
107
  if @api_client.config.client_side_validation && input_file.nil?
108
108
  fail ArgumentError, "Missing the required parameter 'input_file' when calling ScanApi.scan_file_advanced"
109
109
  end
110
110
  # resource path
111
- local_var_path = "/virus/scan/file/advanced"
111
+ local_var_path = '/virus/scan/file/advanced'
112
112
 
113
113
  # query parameters
114
114
  query_params = {}
@@ -122,11 +122,12 @@ module CloudmersiveVirusScanApiClient
122
122
  header_params[:'allowExecutables'] = opts[:'allow_executables'] if !opts[:'allow_executables'].nil?
123
123
  header_params[:'allowInvalidFiles'] = opts[:'allow_invalid_files'] if !opts[:'allow_invalid_files'].nil?
124
124
  header_params[:'allowScripts'] = opts[:'allow_scripts'] if !opts[:'allow_scripts'].nil?
125
+ header_params[:'allowPasswordProtectedFiles'] = opts[:'allow_password_protected_files'] if !opts[:'allow_password_protected_files'].nil?
125
126
  header_params[:'restrictFileTypes'] = opts[:'restrict_file_types'] if !opts[:'restrict_file_types'].nil?
126
127
 
127
128
  # form parameters
128
129
  form_params = {}
129
- form_params["inputFile"] = input_file
130
+ form_params['inputFile'] = input_file
130
131
 
131
132
  # http body (model)
132
133
  post_body = nil
@@ -143,7 +144,6 @@ module CloudmersiveVirusScanApiClient
143
144
  end
144
145
  return data, status_code, headers
145
146
  end
146
-
147
147
  # Scan a website for malicious content and threats
148
148
  # Operation includes scanning the content of the URL for various types of malicious content and threats, including viruses and threats (including Phishing).
149
149
  # @param input
@@ -151,7 +151,7 @@ module CloudmersiveVirusScanApiClient
151
151
  # @return [WebsiteScanResult]
152
152
  def scan_website(input, opts = {})
153
153
  data, _status_code, _headers = scan_website_with_http_info(input, opts)
154
- return data
154
+ data
155
155
  end
156
156
 
157
157
  # Scan a website for malicious content and threats
@@ -161,14 +161,14 @@ module CloudmersiveVirusScanApiClient
161
161
  # @return [Array<(WebsiteScanResult, Fixnum, Hash)>] WebsiteScanResult data, response status code and response headers
162
162
  def scan_website_with_http_info(input, opts = {})
163
163
  if @api_client.config.debugging
164
- @api_client.config.logger.debug "Calling API: ScanApi.scan_website ..."
164
+ @api_client.config.logger.debug 'Calling API: ScanApi.scan_website ...'
165
165
  end
166
166
  # verify the required parameter 'input' is set
167
167
  if @api_client.config.client_side_validation && input.nil?
168
168
  fail ArgumentError, "Missing the required parameter 'input' when calling ScanApi.scan_website"
169
169
  end
170
170
  # resource path
171
- local_var_path = "/virus/scan/website"
171
+ local_var_path = '/virus/scan/website'
172
172
 
173
173
  # query parameters
174
174
  query_params = {}