cloudmersive-virus-scan-api-client 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -4
- data/docs/CloudStorageVirusFound.md +9 -0
- data/docs/CloudStorageVirusScanResult.md +12 -0
- data/docs/ScanApi.md +2 -2
- data/docs/ScanCloudStorageApi.md +197 -0
- data/lib/cloudmersive-virus-scan-api-client.rb +3 -0
- data/lib/cloudmersive-virus-scan-api-client/api/scan_api.rb +2 -2
- data/lib/cloudmersive-virus-scan-api-client/api/scan_cloud_storage_api.rb +244 -0
- data/lib/cloudmersive-virus-scan-api-client/models/cloud_storage_virus_found.rb +196 -0
- data/lib/cloudmersive-virus-scan-api-client/models/cloud_storage_virus_scan_result.rb +228 -0
- data/lib/cloudmersive-virus-scan-api-client/version.rb +1 -1
- data/spec/api/scan_api_spec.rb +1 -1
- data/spec/api/scan_cloud_storage_api_spec.rb +79 -0
- data/spec/models/cloud_storage_virus_found_spec.rb +47 -0
- data/spec/models/cloud_storage_virus_scan_result_spec.rb +65 -0
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7caace679782d9c3c94207830526d9155e2fe119c5ccae38f5221313a3fa154
|
4
|
+
data.tar.gz: bd072e674ea3c7b17766963649bf33e0f51a205da72b23f6c01af537733df2b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fcba1dd4d2d82279dafee8e8f2abf0f38045dccda0e314ccfd510affa260f10fce7b6cecbcc4ff51ea98e4a99da8e767294d6090619142115f0f40dfa42aa92
|
7
|
+
data.tar.gz: 36f045d42117fbd01b0ef22812f8e0daa99c49cab4ac89d22b731265d6b71e0d93d3e8cafa3b6a86b0a67666438401a54b08cb86165d4154d34d88b01728ab05
|
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: 2.0.
|
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-2.0.
|
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-2.0.
|
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', '~> 2.0.
|
34
|
+
gem 'cloudmersive-virus-scan-api-client', '~> 2.0.3'
|
35
35
|
|
36
36
|
### Install from Git
|
37
37
|
|
@@ -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)
|
@@ -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
|
+
|
data/docs/ScanApi.md
CHANGED
@@ -89,7 +89,7 @@ input_file = File.new('/path/to/file.txt') # File | Input file to perform the op
|
|
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,
|
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
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
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.
|
95
95
|
}
|
@@ -110,7 +110,7 @@ Name | Type | Description | Notes
|
|
110
110
|
**input_file** | **File**| Input file to perform the operation on. |
|
111
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]
|
112
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]
|
113
|
-
**allow_scripts** | **BOOLEAN**| Set to false to block script files, such as a PHP files,
|
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
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]
|
115
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]
|
116
116
|
|
@@ -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
|
+
|
@@ -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
|
@@ -80,7 +80,7 @@ module CloudmersiveVirusScanApiClient
|
|
80
80
|
# @param [Hash] opts the optional parameters
|
81
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
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,
|
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
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
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=false. Set restrictFileTypes parameter to null or empty string to disable; default is disabled.
|
86
86
|
# @return [VirusScanAdvancedResult]
|
@@ -95,7 +95,7 @@ module CloudmersiveVirusScanApiClient
|
|
95
95
|
# @param [Hash] opts the optional parameters
|
96
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).
|
97
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).
|
98
|
-
# @option opts [BOOLEAN] :allow_scripts Set to false to block script files, such as a PHP files,
|
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
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=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
|
@@ -0,0 +1,244 @@
|
|
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 'US-East-1'
|
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 'US-East-1'
|
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
|
+
# Scan an Azure Blob for viruses
|
106
|
+
# 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.
|
107
|
+
# @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.
|
108
|
+
# @param container_name Name of the Blob container within the Azure Blob Storage account
|
109
|
+
# @param blob_path Path to the blob within the container, such as 'hello.pdf' or '/folder/subfolder/world.pdf'
|
110
|
+
# @param [Hash] opts the optional parameters
|
111
|
+
# @return [CloudStorageVirusScanResult]
|
112
|
+
def scan_cloud_storage_scan_azure_blob(connection_string, container_name, blob_path, opts = {})
|
113
|
+
data, _status_code, _headers = scan_cloud_storage_scan_azure_blob_with_http_info(connection_string, container_name, blob_path, opts)
|
114
|
+
data
|
115
|
+
end
|
116
|
+
|
117
|
+
# Scan an Azure Blob for viruses
|
118
|
+
# 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.
|
119
|
+
# @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.
|
120
|
+
# @param container_name Name of the Blob container within the Azure Blob Storage account
|
121
|
+
# @param blob_path Path to the blob within the container, such as 'hello.pdf' or '/folder/subfolder/world.pdf'
|
122
|
+
# @param [Hash] opts the optional parameters
|
123
|
+
# @return [Array<(CloudStorageVirusScanResult, Fixnum, Hash)>] CloudStorageVirusScanResult data, response status code and response headers
|
124
|
+
def scan_cloud_storage_scan_azure_blob_with_http_info(connection_string, container_name, blob_path, opts = {})
|
125
|
+
if @api_client.config.debugging
|
126
|
+
@api_client.config.logger.debug 'Calling API: ScanCloudStorageApi.scan_cloud_storage_scan_azure_blob ...'
|
127
|
+
end
|
128
|
+
# verify the required parameter 'connection_string' is set
|
129
|
+
if @api_client.config.client_side_validation && connection_string.nil?
|
130
|
+
fail ArgumentError, "Missing the required parameter 'connection_string' when calling ScanCloudStorageApi.scan_cloud_storage_scan_azure_blob"
|
131
|
+
end
|
132
|
+
# verify the required parameter 'container_name' is set
|
133
|
+
if @api_client.config.client_side_validation && container_name.nil?
|
134
|
+
fail ArgumentError, "Missing the required parameter 'container_name' when calling ScanCloudStorageApi.scan_cloud_storage_scan_azure_blob"
|
135
|
+
end
|
136
|
+
# verify the required parameter 'blob_path' is set
|
137
|
+
if @api_client.config.client_side_validation && blob_path.nil?
|
138
|
+
fail ArgumentError, "Missing the required parameter 'blob_path' when calling ScanCloudStorageApi.scan_cloud_storage_scan_azure_blob"
|
139
|
+
end
|
140
|
+
# resource path
|
141
|
+
local_var_path = '/virus/scan/cloud-storage/azure-blob/single'
|
142
|
+
|
143
|
+
# query parameters
|
144
|
+
query_params = {}
|
145
|
+
|
146
|
+
# header parameters
|
147
|
+
header_params = {}
|
148
|
+
# HTTP header 'Accept' (if needed)
|
149
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
|
150
|
+
# HTTP header 'Content-Type'
|
151
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
152
|
+
header_params[:'connectionString'] = connection_string
|
153
|
+
header_params[:'containerName'] = container_name
|
154
|
+
header_params[:'blobPath'] = blob_path
|
155
|
+
|
156
|
+
# form parameters
|
157
|
+
form_params = {}
|
158
|
+
|
159
|
+
# http body (model)
|
160
|
+
post_body = nil
|
161
|
+
auth_names = ['Apikey']
|
162
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
163
|
+
:header_params => header_params,
|
164
|
+
:query_params => query_params,
|
165
|
+
:form_params => form_params,
|
166
|
+
:body => post_body,
|
167
|
+
:auth_names => auth_names,
|
168
|
+
:return_type => 'CloudStorageVirusScanResult')
|
169
|
+
if @api_client.config.debugging
|
170
|
+
@api_client.config.logger.debug "API called: ScanCloudStorageApi#scan_cloud_storage_scan_azure_blob\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
171
|
+
end
|
172
|
+
return data, status_code, headers
|
173
|
+
end
|
174
|
+
# Scan an Google Cloud Platform (GCP) Storage file for viruses
|
175
|
+
# 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.
|
176
|
+
# @param bucket_name Name of the bucket in Google Cloud Storage
|
177
|
+
# @param object_name Name of the object or file in Google Cloud Storage
|
178
|
+
# @param json_credential_file Service Account credential for Google Cloud stored in a JSON file.
|
179
|
+
# @param [Hash] opts the optional parameters
|
180
|
+
# @return [CloudStorageVirusScanResult]
|
181
|
+
def scan_cloud_storage_scan_gcp_storage_file(bucket_name, object_name, json_credential_file, opts = {})
|
182
|
+
data, _status_code, _headers = scan_cloud_storage_scan_gcp_storage_file_with_http_info(bucket_name, object_name, json_credential_file, opts)
|
183
|
+
data
|
184
|
+
end
|
185
|
+
|
186
|
+
# Scan an Google Cloud Platform (GCP) Storage file for viruses
|
187
|
+
# 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.
|
188
|
+
# @param bucket_name Name of the bucket in Google Cloud Storage
|
189
|
+
# @param object_name Name of the object or file in Google Cloud Storage
|
190
|
+
# @param json_credential_file Service Account credential for Google Cloud stored in a JSON file.
|
191
|
+
# @param [Hash] opts the optional parameters
|
192
|
+
# @return [Array<(CloudStorageVirusScanResult, Fixnum, Hash)>] CloudStorageVirusScanResult data, response status code and response headers
|
193
|
+
def scan_cloud_storage_scan_gcp_storage_file_with_http_info(bucket_name, object_name, json_credential_file, opts = {})
|
194
|
+
if @api_client.config.debugging
|
195
|
+
@api_client.config.logger.debug 'Calling API: ScanCloudStorageApi.scan_cloud_storage_scan_gcp_storage_file ...'
|
196
|
+
end
|
197
|
+
# verify the required parameter 'bucket_name' is set
|
198
|
+
if @api_client.config.client_side_validation && bucket_name.nil?
|
199
|
+
fail ArgumentError, "Missing the required parameter 'bucket_name' when calling ScanCloudStorageApi.scan_cloud_storage_scan_gcp_storage_file"
|
200
|
+
end
|
201
|
+
# verify the required parameter 'object_name' is set
|
202
|
+
if @api_client.config.client_side_validation && object_name.nil?
|
203
|
+
fail ArgumentError, "Missing the required parameter 'object_name' when calling ScanCloudStorageApi.scan_cloud_storage_scan_gcp_storage_file"
|
204
|
+
end
|
205
|
+
# verify the required parameter 'json_credential_file' is set
|
206
|
+
if @api_client.config.client_side_validation && json_credential_file.nil?
|
207
|
+
fail ArgumentError, "Missing the required parameter 'json_credential_file' when calling ScanCloudStorageApi.scan_cloud_storage_scan_gcp_storage_file"
|
208
|
+
end
|
209
|
+
# resource path
|
210
|
+
local_var_path = '/virus/scan/cloud-storage/gcp-storage/single'
|
211
|
+
|
212
|
+
# query parameters
|
213
|
+
query_params = {}
|
214
|
+
|
215
|
+
# header parameters
|
216
|
+
header_params = {}
|
217
|
+
# HTTP header 'Accept' (if needed)
|
218
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
|
219
|
+
# HTTP header 'Content-Type'
|
220
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
221
|
+
header_params[:'bucketName'] = bucket_name
|
222
|
+
header_params[:'objectName'] = object_name
|
223
|
+
|
224
|
+
# form parameters
|
225
|
+
form_params = {}
|
226
|
+
form_params['jsonCredentialFile'] = json_credential_file
|
227
|
+
|
228
|
+
# http body (model)
|
229
|
+
post_body = nil
|
230
|
+
auth_names = ['Apikey']
|
231
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
232
|
+
:header_params => header_params,
|
233
|
+
:query_params => query_params,
|
234
|
+
:form_params => form_params,
|
235
|
+
:body => post_body,
|
236
|
+
:auth_names => auth_names,
|
237
|
+
:return_type => 'CloudStorageVirusScanResult')
|
238
|
+
if @api_client.config.debugging
|
239
|
+
@api_client.config.logger.debug "API called: ScanCloudStorageApi#scan_cloud_storage_scan_gcp_storage_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
240
|
+
end
|
241
|
+
return data, status_code, headers
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
@@ -0,0 +1,196 @@
|
|
1
|
+
=begin
|
2
|
+
#virusapi
|
3
|
+
|
4
|
+
#The Cloudmersive Virus Scan API lets you scan files and content for viruses and identify security issues with content.
|
5
|
+
|
6
|
+
OpenAPI spec version: v1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module CloudmersiveVirusScanApiClient
|
16
|
+
# Virus positively identified
|
17
|
+
class CloudStorageVirusFound
|
18
|
+
# Name of the file containing the virus
|
19
|
+
attr_accessor :file_name
|
20
|
+
|
21
|
+
# Name of the virus that was found
|
22
|
+
attr_accessor :virus_name
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'file_name' => :'FileName',
|
28
|
+
:'virus_name' => :'VirusName'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.swagger_types
|
34
|
+
{
|
35
|
+
:'file_name' => :'String',
|
36
|
+
:'virus_name' => :'String'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Initializes the object
|
41
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
42
|
+
def initialize(attributes = {})
|
43
|
+
return unless attributes.is_a?(Hash)
|
44
|
+
|
45
|
+
# convert string to symbol for hash key
|
46
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
47
|
+
|
48
|
+
if attributes.has_key?(:'FileName')
|
49
|
+
self.file_name = attributes[:'FileName']
|
50
|
+
end
|
51
|
+
|
52
|
+
if attributes.has_key?(:'VirusName')
|
53
|
+
self.virus_name = attributes[:'VirusName']
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
58
|
+
# @return Array for valid properties with the reasons
|
59
|
+
def list_invalid_properties
|
60
|
+
invalid_properties = Array.new
|
61
|
+
invalid_properties
|
62
|
+
end
|
63
|
+
|
64
|
+
# Check to see if the all the properties in the model are valid
|
65
|
+
# @return true if the model is valid
|
66
|
+
def valid?
|
67
|
+
true
|
68
|
+
end
|
69
|
+
|
70
|
+
# Checks equality by comparing each attribute.
|
71
|
+
# @param [Object] Object to be compared
|
72
|
+
def ==(o)
|
73
|
+
return true if self.equal?(o)
|
74
|
+
self.class == o.class &&
|
75
|
+
file_name == o.file_name &&
|
76
|
+
virus_name == o.virus_name
|
77
|
+
end
|
78
|
+
|
79
|
+
# @see the `==` method
|
80
|
+
# @param [Object] Object to be compared
|
81
|
+
def eql?(o)
|
82
|
+
self == o
|
83
|
+
end
|
84
|
+
|
85
|
+
# Calculates hash code according to all attributes.
|
86
|
+
# @return [Fixnum] Hash code
|
87
|
+
def hash
|
88
|
+
[file_name, virus_name].hash
|
89
|
+
end
|
90
|
+
|
91
|
+
# Builds the object from hash
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
93
|
+
# @return [Object] Returns the model itself
|
94
|
+
def build_from_hash(attributes)
|
95
|
+
return nil unless attributes.is_a?(Hash)
|
96
|
+
self.class.swagger_types.each_pair do |key, type|
|
97
|
+
if type =~ /\AArray<(.*)>/i
|
98
|
+
# check to ensure the input is an array given that the attribute
|
99
|
+
# is documented as an array but the input is not
|
100
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
101
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
102
|
+
end
|
103
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
104
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
105
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
106
|
+
end
|
107
|
+
|
108
|
+
self
|
109
|
+
end
|
110
|
+
|
111
|
+
# Deserializes the data based on type
|
112
|
+
# @param string type Data type
|
113
|
+
# @param string value Value to be deserialized
|
114
|
+
# @return [Object] Deserialized data
|
115
|
+
def _deserialize(type, value)
|
116
|
+
case type.to_sym
|
117
|
+
when :DateTime
|
118
|
+
DateTime.parse(value)
|
119
|
+
when :Date
|
120
|
+
Date.parse(value)
|
121
|
+
when :String
|
122
|
+
value.to_s
|
123
|
+
when :Integer
|
124
|
+
value.to_i
|
125
|
+
when :Float
|
126
|
+
value.to_f
|
127
|
+
when :BOOLEAN
|
128
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
129
|
+
true
|
130
|
+
else
|
131
|
+
false
|
132
|
+
end
|
133
|
+
when :Object
|
134
|
+
# generic object (usually a Hash), return directly
|
135
|
+
value
|
136
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
137
|
+
inner_type = Regexp.last_match[:inner_type]
|
138
|
+
value.map { |v| _deserialize(inner_type, v) }
|
139
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
140
|
+
k_type = Regexp.last_match[:k_type]
|
141
|
+
v_type = Regexp.last_match[:v_type]
|
142
|
+
{}.tap do |hash|
|
143
|
+
value.each do |k, v|
|
144
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
else # model
|
148
|
+
temp_model = CloudmersiveVirusScanApiClient.const_get(type).new
|
149
|
+
temp_model.build_from_hash(value)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
# Returns the string representation of the object
|
154
|
+
# @return [String] String presentation of the object
|
155
|
+
def to_s
|
156
|
+
to_hash.to_s
|
157
|
+
end
|
158
|
+
|
159
|
+
# to_body is an alias to to_hash (backward compatibility)
|
160
|
+
# @return [Hash] Returns the object in the form of hash
|
161
|
+
def to_body
|
162
|
+
to_hash
|
163
|
+
end
|
164
|
+
|
165
|
+
# Returns the object in the form of hash
|
166
|
+
# @return [Hash] Returns the object in the form of hash
|
167
|
+
def to_hash
|
168
|
+
hash = {}
|
169
|
+
self.class.attribute_map.each_pair do |attr, param|
|
170
|
+
value = self.send(attr)
|
171
|
+
next if value.nil?
|
172
|
+
hash[param] = _to_hash(value)
|
173
|
+
end
|
174
|
+
hash
|
175
|
+
end
|
176
|
+
|
177
|
+
# Outputs non-array value in the form of hash
|
178
|
+
# For object, use to_hash. Otherwise, just return the value
|
179
|
+
# @param [Object] value Any valid value
|
180
|
+
# @return [Hash] Returns the value in the form of hash
|
181
|
+
def _to_hash(value)
|
182
|
+
if value.is_a?(Array)
|
183
|
+
value.compact.map { |v| _to_hash(v) }
|
184
|
+
elsif value.is_a?(Hash)
|
185
|
+
{}.tap do |hash|
|
186
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
187
|
+
end
|
188
|
+
elsif value.respond_to? :to_hash
|
189
|
+
value.to_hash
|
190
|
+
else
|
191
|
+
value
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
end
|
196
|
+
end
|
@@ -0,0 +1,228 @@
|
|
1
|
+
=begin
|
2
|
+
#virusapi
|
3
|
+
|
4
|
+
#The Cloudmersive Virus Scan API lets you scan files and content for viruses and identify security issues with content.
|
5
|
+
|
6
|
+
OpenAPI spec version: v1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module CloudmersiveVirusScanApiClient
|
16
|
+
# Result of running a virus scan on cloud storage
|
17
|
+
class CloudStorageVirusScanResult
|
18
|
+
# True if the operation of retrieving the file, and scanning it were successfully completed, false if the file could not be downloaded from cloud storage, or if the file could not be scanned. Note that successful completion does not mean the file is clean; for the output of the virus scanning operation itself, use the CleanResult and FoundViruses parameters.
|
19
|
+
attr_accessor :successful
|
20
|
+
|
21
|
+
# True if the scan contained no viruses, false otherwise
|
22
|
+
attr_accessor :clean_result
|
23
|
+
|
24
|
+
# Array of viruses found, if any
|
25
|
+
attr_accessor :found_viruses
|
26
|
+
|
27
|
+
# Detailed error message if the operation was not successful
|
28
|
+
attr_accessor :error_detailed_description
|
29
|
+
|
30
|
+
# Size in bytes of the file that was retrieved and scanned
|
31
|
+
attr_accessor :file_size
|
32
|
+
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
34
|
+
def self.attribute_map
|
35
|
+
{
|
36
|
+
:'successful' => :'Successful',
|
37
|
+
:'clean_result' => :'CleanResult',
|
38
|
+
:'found_viruses' => :'FoundViruses',
|
39
|
+
:'error_detailed_description' => :'ErrorDetailedDescription',
|
40
|
+
:'file_size' => :'FileSize'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# Attribute type mapping.
|
45
|
+
def self.swagger_types
|
46
|
+
{
|
47
|
+
:'successful' => :'BOOLEAN',
|
48
|
+
:'clean_result' => :'BOOLEAN',
|
49
|
+
:'found_viruses' => :'Array<CloudStorageVirusFound>',
|
50
|
+
:'error_detailed_description' => :'String',
|
51
|
+
:'file_size' => :'Integer'
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
# Initializes the object
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
57
|
+
def initialize(attributes = {})
|
58
|
+
return unless attributes.is_a?(Hash)
|
59
|
+
|
60
|
+
# convert string to symbol for hash key
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
62
|
+
|
63
|
+
if attributes.has_key?(:'Successful')
|
64
|
+
self.successful = attributes[:'Successful']
|
65
|
+
end
|
66
|
+
|
67
|
+
if attributes.has_key?(:'CleanResult')
|
68
|
+
self.clean_result = attributes[:'CleanResult']
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.has_key?(:'FoundViruses')
|
72
|
+
if (value = attributes[:'FoundViruses']).is_a?(Array)
|
73
|
+
self.found_viruses = value
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.has_key?(:'ErrorDetailedDescription')
|
78
|
+
self.error_detailed_description = attributes[:'ErrorDetailedDescription']
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes.has_key?(:'FileSize')
|
82
|
+
self.file_size = attributes[:'FileSize']
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
87
|
+
# @return Array for valid properties with the reasons
|
88
|
+
def list_invalid_properties
|
89
|
+
invalid_properties = Array.new
|
90
|
+
invalid_properties
|
91
|
+
end
|
92
|
+
|
93
|
+
# Check to see if the all the properties in the model are valid
|
94
|
+
# @return true if the model is valid
|
95
|
+
def valid?
|
96
|
+
true
|
97
|
+
end
|
98
|
+
|
99
|
+
# Checks equality by comparing each attribute.
|
100
|
+
# @param [Object] Object to be compared
|
101
|
+
def ==(o)
|
102
|
+
return true if self.equal?(o)
|
103
|
+
self.class == o.class &&
|
104
|
+
successful == o.successful &&
|
105
|
+
clean_result == o.clean_result &&
|
106
|
+
found_viruses == o.found_viruses &&
|
107
|
+
error_detailed_description == o.error_detailed_description &&
|
108
|
+
file_size == o.file_size
|
109
|
+
end
|
110
|
+
|
111
|
+
# @see the `==` method
|
112
|
+
# @param [Object] Object to be compared
|
113
|
+
def eql?(o)
|
114
|
+
self == o
|
115
|
+
end
|
116
|
+
|
117
|
+
# Calculates hash code according to all attributes.
|
118
|
+
# @return [Fixnum] Hash code
|
119
|
+
def hash
|
120
|
+
[successful, clean_result, found_viruses, error_detailed_description, file_size].hash
|
121
|
+
end
|
122
|
+
|
123
|
+
# Builds the object from hash
|
124
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
125
|
+
# @return [Object] Returns the model itself
|
126
|
+
def build_from_hash(attributes)
|
127
|
+
return nil unless attributes.is_a?(Hash)
|
128
|
+
self.class.swagger_types.each_pair do |key, type|
|
129
|
+
if type =~ /\AArray<(.*)>/i
|
130
|
+
# check to ensure the input is an array given that the attribute
|
131
|
+
# is documented as an array but the input is not
|
132
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
133
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
134
|
+
end
|
135
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
136
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
137
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
138
|
+
end
|
139
|
+
|
140
|
+
self
|
141
|
+
end
|
142
|
+
|
143
|
+
# Deserializes the data based on type
|
144
|
+
# @param string type Data type
|
145
|
+
# @param string value Value to be deserialized
|
146
|
+
# @return [Object] Deserialized data
|
147
|
+
def _deserialize(type, value)
|
148
|
+
case type.to_sym
|
149
|
+
when :DateTime
|
150
|
+
DateTime.parse(value)
|
151
|
+
when :Date
|
152
|
+
Date.parse(value)
|
153
|
+
when :String
|
154
|
+
value.to_s
|
155
|
+
when :Integer
|
156
|
+
value.to_i
|
157
|
+
when :Float
|
158
|
+
value.to_f
|
159
|
+
when :BOOLEAN
|
160
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
161
|
+
true
|
162
|
+
else
|
163
|
+
false
|
164
|
+
end
|
165
|
+
when :Object
|
166
|
+
# generic object (usually a Hash), return directly
|
167
|
+
value
|
168
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
169
|
+
inner_type = Regexp.last_match[:inner_type]
|
170
|
+
value.map { |v| _deserialize(inner_type, v) }
|
171
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
172
|
+
k_type = Regexp.last_match[:k_type]
|
173
|
+
v_type = Regexp.last_match[:v_type]
|
174
|
+
{}.tap do |hash|
|
175
|
+
value.each do |k, v|
|
176
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
else # model
|
180
|
+
temp_model = CloudmersiveVirusScanApiClient.const_get(type).new
|
181
|
+
temp_model.build_from_hash(value)
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
# Returns the string representation of the object
|
186
|
+
# @return [String] String presentation of the object
|
187
|
+
def to_s
|
188
|
+
to_hash.to_s
|
189
|
+
end
|
190
|
+
|
191
|
+
# to_body is an alias to to_hash (backward compatibility)
|
192
|
+
# @return [Hash] Returns the object in the form of hash
|
193
|
+
def to_body
|
194
|
+
to_hash
|
195
|
+
end
|
196
|
+
|
197
|
+
# Returns the object in the form of hash
|
198
|
+
# @return [Hash] Returns the object in the form of hash
|
199
|
+
def to_hash
|
200
|
+
hash = {}
|
201
|
+
self.class.attribute_map.each_pair do |attr, param|
|
202
|
+
value = self.send(attr)
|
203
|
+
next if value.nil?
|
204
|
+
hash[param] = _to_hash(value)
|
205
|
+
end
|
206
|
+
hash
|
207
|
+
end
|
208
|
+
|
209
|
+
# Outputs non-array value in the form of hash
|
210
|
+
# For object, use to_hash. Otherwise, just return the value
|
211
|
+
# @param [Object] value Any valid value
|
212
|
+
# @return [Hash] Returns the value in the form of hash
|
213
|
+
def _to_hash(value)
|
214
|
+
if value.is_a?(Array)
|
215
|
+
value.compact.map { |v| _to_hash(v) }
|
216
|
+
elsif value.is_a?(Hash)
|
217
|
+
{}.tap do |hash|
|
218
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
219
|
+
end
|
220
|
+
elsif value.respond_to? :to_hash
|
221
|
+
value.to_hash
|
222
|
+
else
|
223
|
+
value
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
end
|
228
|
+
end
|
data/spec/api/scan_api_spec.rb
CHANGED
@@ -51,7 +51,7 @@ describe 'ScanApi' do
|
|
51
51
|
# @param [Hash] opts the optional parameters
|
52
52
|
# @option opts [BOOLEAN] :allow_executables Set to false to block executable files (program code) from being allowed in the input file. Default is false (recommended).
|
53
53
|
# @option opts [BOOLEAN] :allow_invalid_files Set to false to block invalid files, such as a PDF file that is not really a valid PDF file, or a Word Document that is not a valid Word Document. Default is false (recommended).
|
54
|
-
# @option opts [BOOLEAN] :allow_scripts Set to false to block script files, such as a PHP files,
|
54
|
+
# @option opts [BOOLEAN] :allow_scripts Set to false to block script files, such as a PHP files, Python scripts, and other malicious content or security threats that can be embedded in the file. Set to true to allow these file types. Default is false (recommended).
|
55
55
|
# @option opts [BOOLEAN] :allow_password_protected_files Set to false to block password protected and encrypted files, such as encrypted zip and rar files, and other files that seek to circumvent scanning through passwords. Set to true to allow these file types. Default is false (recommended).
|
56
56
|
# @option opts [String] :restrict_file_types Specify a restricted set of file formats to allow as clean as a comma-separated list of file formats, such as .pdf,.docx,.png would allow only PDF, PNG and Word document files. All files must pass content verification against this list of file formats, if they do not, then the result will be returned as CleanResult=false. Set restrictFileTypes parameter to null or empty string to disable; default is disabled.
|
57
57
|
# @return [VirusScanAdvancedResult]
|
@@ -0,0 +1,79 @@
|
|
1
|
+
=begin
|
2
|
+
#virusapi
|
3
|
+
|
4
|
+
#The Cloudmersive Virus Scan API lets you scan files and content for viruses and identify security issues with content.
|
5
|
+
|
6
|
+
OpenAPI spec version: v1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for CloudmersiveVirusScanApiClient::ScanCloudStorageApi
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'ScanCloudStorageApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@instance = CloudmersiveVirusScanApiClient::ScanCloudStorageApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of ScanCloudStorageApi' do
|
30
|
+
it 'should create an instance of ScanCloudStorageApi' do
|
31
|
+
expect(@instance).to be_instance_of(CloudmersiveVirusScanApiClient::ScanCloudStorageApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for scan_cloud_storage_scan_aws_s3_file
|
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 'US-East-1'
|
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 [CloudStorageVirusScanResult]
|
45
|
+
describe 'scan_cloud_storage_scan_aws_s3_file test' do
|
46
|
+
it 'should work' do
|
47
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# unit tests for scan_cloud_storage_scan_azure_blob
|
52
|
+
# Scan an Azure Blob for viruses
|
53
|
+
# 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.
|
54
|
+
# @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.
|
55
|
+
# @param container_name Name of the Blob container within the Azure Blob Storage account
|
56
|
+
# @param blob_path Path to the blob within the container, such as 'hello.pdf' or '/folder/subfolder/world.pdf'
|
57
|
+
# @param [Hash] opts the optional parameters
|
58
|
+
# @return [CloudStorageVirusScanResult]
|
59
|
+
describe 'scan_cloud_storage_scan_azure_blob test' do
|
60
|
+
it 'should work' do
|
61
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# unit tests for scan_cloud_storage_scan_gcp_storage_file
|
66
|
+
# Scan an Google Cloud Platform (GCP) Storage file for viruses
|
67
|
+
# 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.
|
68
|
+
# @param bucket_name Name of the bucket in Google Cloud Storage
|
69
|
+
# @param object_name Name of the object or file in Google Cloud Storage
|
70
|
+
# @param json_credential_file Service Account credential for Google Cloud stored in a JSON file.
|
71
|
+
# @param [Hash] opts the optional parameters
|
72
|
+
# @return [CloudStorageVirusScanResult]
|
73
|
+
describe 'scan_cloud_storage_scan_gcp_storage_file test' do
|
74
|
+
it 'should work' do
|
75
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
=begin
|
2
|
+
#virusapi
|
3
|
+
|
4
|
+
#The Cloudmersive Virus Scan API lets you scan files and content for viruses and identify security issues with content.
|
5
|
+
|
6
|
+
OpenAPI spec version: v1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for CloudmersiveVirusScanApiClient::CloudStorageVirusFound
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'CloudStorageVirusFound' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = CloudmersiveVirusScanApiClient::CloudStorageVirusFound.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of CloudStorageVirusFound' do
|
31
|
+
it 'should create an instance of CloudStorageVirusFound' do
|
32
|
+
expect(@instance).to be_instance_of(CloudmersiveVirusScanApiClient::CloudStorageVirusFound)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "file_name"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe 'test attribute "virus_name"' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
=begin
|
2
|
+
#virusapi
|
3
|
+
|
4
|
+
#The Cloudmersive Virus Scan API lets you scan files and content for viruses and identify security issues with content.
|
5
|
+
|
6
|
+
OpenAPI spec version: v1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for CloudmersiveVirusScanApiClient::CloudStorageVirusScanResult
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'CloudStorageVirusScanResult' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = CloudmersiveVirusScanApiClient::CloudStorageVirusScanResult.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of CloudStorageVirusScanResult' do
|
31
|
+
it 'should create an instance of CloudStorageVirusScanResult' do
|
32
|
+
expect(@instance).to be_instance_of(CloudmersiveVirusScanApiClient::CloudStorageVirusScanResult)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "successful"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe 'test attribute "clean_result"' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe 'test attribute "found_viruses"' do
|
48
|
+
it 'should work' do
|
49
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
describe 'test attribute "error_detailed_description"' do
|
54
|
+
it 'should work' do
|
55
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
describe 'test attribute "file_size"' do
|
60
|
+
it 'should work' do
|
61
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudmersive-virus-scan-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cloudmersive
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -202,7 +202,10 @@ files:
|
|
202
202
|
- "./README.md"
|
203
203
|
- "./Rakefile"
|
204
204
|
- "./cloudmersive-virus-scan-api-client.gemspec"
|
205
|
+
- "./docs/CloudStorageVirusFound.md"
|
206
|
+
- "./docs/CloudStorageVirusScanResult.md"
|
205
207
|
- "./docs/ScanApi.md"
|
208
|
+
- "./docs/ScanCloudStorageApi.md"
|
206
209
|
- "./docs/VirusFound.md"
|
207
210
|
- "./docs/VirusScanAdvancedResult.md"
|
208
211
|
- "./docs/VirusScanResult.md"
|
@@ -211,9 +214,12 @@ files:
|
|
211
214
|
- "./git_push.sh"
|
212
215
|
- "./lib/cloudmersive-virus-scan-api-client.rb"
|
213
216
|
- "./lib/cloudmersive-virus-scan-api-client/api/scan_api.rb"
|
217
|
+
- "./lib/cloudmersive-virus-scan-api-client/api/scan_cloud_storage_api.rb"
|
214
218
|
- "./lib/cloudmersive-virus-scan-api-client/api_client.rb"
|
215
219
|
- "./lib/cloudmersive-virus-scan-api-client/api_error.rb"
|
216
220
|
- "./lib/cloudmersive-virus-scan-api-client/configuration.rb"
|
221
|
+
- "./lib/cloudmersive-virus-scan-api-client/models/cloud_storage_virus_found.rb"
|
222
|
+
- "./lib/cloudmersive-virus-scan-api-client/models/cloud_storage_virus_scan_result.rb"
|
217
223
|
- "./lib/cloudmersive-virus-scan-api-client/models/virus_found.rb"
|
218
224
|
- "./lib/cloudmersive-virus-scan-api-client/models/virus_scan_advanced_result.rb"
|
219
225
|
- "./lib/cloudmersive-virus-scan-api-client/models/virus_scan_result.rb"
|
@@ -221,8 +227,11 @@ files:
|
|
221
227
|
- "./lib/cloudmersive-virus-scan-api-client/models/website_scan_result.rb"
|
222
228
|
- "./lib/cloudmersive-virus-scan-api-client/version.rb"
|
223
229
|
- "./spec/api/scan_api_spec.rb"
|
230
|
+
- "./spec/api/scan_cloud_storage_api_spec.rb"
|
224
231
|
- "./spec/api_client_spec.rb"
|
225
232
|
- "./spec/configuration_spec.rb"
|
233
|
+
- "./spec/models/cloud_storage_virus_found_spec.rb"
|
234
|
+
- "./spec/models/cloud_storage_virus_scan_result_spec.rb"
|
226
235
|
- "./spec/models/virus_found_spec.rb"
|
227
236
|
- "./spec/models/virus_scan_advanced_result_spec.rb"
|
228
237
|
- "./spec/models/virus_scan_result_spec.rb"
|