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.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +10 -5
- data/cloudmersive-virus-scan-api-client.gemspec +3 -3
- data/docs/CloudStorageVirusFound.md +9 -0
- data/docs/CloudStorageVirusScanResult.md +12 -0
- data/docs/ScanApi.md +7 -5
- data/docs/ScanCloudStorageApi.md +197 -0
- data/docs/VirusScanAdvancedResult.md +1 -0
- data/docs/WebsiteScanResult.md +1 -0
- data/lib/cloudmersive-virus-scan-api-client.rb +4 -1
- data/lib/cloudmersive-virus-scan-api-client/api/scan_api.rb +18 -18
- data/lib/cloudmersive-virus-scan-api-client/api/scan_cloud_storage_api.rb +244 -0
- data/lib/cloudmersive-virus-scan-api-client/api_client.rb +11 -9
- data/lib/cloudmersive-virus-scan-api-client/api_error.rb +1 -1
- data/lib/cloudmersive-virus-scan-api-client/configuration.rb +2 -2
- 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/models/virus_found.rb +7 -10
- data/lib/cloudmersive-virus-scan-api-client/models/virus_scan_advanced_result.rb +18 -11
- data/lib/cloudmersive-virus-scan-api-client/models/virus_scan_result.rb +7 -10
- data/lib/cloudmersive-virus-scan-api-client/models/website_scan_request.rb +7 -10
- data/lib/cloudmersive-virus-scan-api-client/models/website_scan_result.rb +23 -15
- data/lib/cloudmersive-virus-scan-api-client/version.rb +2 -2
- data/spec/api/scan_api_spec.rb +6 -5
- data/spec/api/scan_cloud_storage_api_spec.rb +79 -0
- data/spec/api_client_spec.rb +52 -35
- data/spec/configuration_spec.rb +9 -9
- data/spec/models/cloud_storage_virus_found_spec.rb +47 -0
- data/spec/models/cloud_storage_virus_scan_result_spec.rb +65 -0
- data/spec/models/virus_found_spec.rb +3 -4
- data/spec/models/virus_scan_advanced_result_spec.rb +14 -9
- data/spec/models/virus_scan_result_spec.rb +3 -4
- data/spec/models/website_scan_request_spec.rb +2 -3
- data/spec/models/website_scan_result_spec.rb +14 -9
- data/spec/spec_helper.rb +1 -1
- metadata +11 -2
@@ -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
|
@@ -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.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -21,7 +21,6 @@ module CloudmersiveVirusScanApiClient
|
|
21
21
|
# Name of the virus that was found
|
22
22
|
attr_accessor :virus_name
|
23
23
|
|
24
|
-
|
25
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
26
25
|
def self.attribute_map
|
27
26
|
{
|
@@ -44,7 +43,7 @@ module CloudmersiveVirusScanApiClient
|
|
44
43
|
return unless attributes.is_a?(Hash)
|
45
44
|
|
46
45
|
# convert string to symbol for hash key
|
47
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
46
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
48
47
|
|
49
48
|
if attributes.has_key?(:'FileName')
|
50
49
|
self.file_name = attributes[:'FileName']
|
@@ -53,20 +52,19 @@ module CloudmersiveVirusScanApiClient
|
|
53
52
|
if attributes.has_key?(:'VirusName')
|
54
53
|
self.virus_name = attributes[:'VirusName']
|
55
54
|
end
|
56
|
-
|
57
55
|
end
|
58
56
|
|
59
57
|
# Show invalid properties with the reasons. Usually used together with valid?
|
60
58
|
# @return Array for valid properties with the reasons
|
61
59
|
def list_invalid_properties
|
62
60
|
invalid_properties = Array.new
|
63
|
-
|
61
|
+
invalid_properties
|
64
62
|
end
|
65
63
|
|
66
64
|
# Check to see if the all the properties in the model are valid
|
67
65
|
# @return true if the model is valid
|
68
66
|
def valid?
|
69
|
-
|
67
|
+
true
|
70
68
|
end
|
71
69
|
|
72
70
|
# Checks equality by comparing each attribute.
|
@@ -97,10 +95,10 @@ module CloudmersiveVirusScanApiClient
|
|
97
95
|
return nil unless attributes.is_a?(Hash)
|
98
96
|
self.class.swagger_types.each_pair do |key, type|
|
99
97
|
if type =~ /\AArray<(.*)>/i
|
100
|
-
# check to ensure the input is an array given that the
|
98
|
+
# check to ensure the input is an array given that the attribute
|
101
99
|
# is documented as an array but the input is not
|
102
100
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
103
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
101
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
104
102
|
end
|
105
103
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
106
104
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -182,7 +180,7 @@ module CloudmersiveVirusScanApiClient
|
|
182
180
|
# @return [Hash] Returns the value in the form of hash
|
183
181
|
def _to_hash(value)
|
184
182
|
if value.is_a?(Array)
|
185
|
-
value.compact.map{ |v| _to_hash(v) }
|
183
|
+
value.compact.map { |v| _to_hash(v) }
|
186
184
|
elsif value.is_a?(Hash)
|
187
185
|
{}.tap do |hash|
|
188
186
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -195,5 +193,4 @@ module CloudmersiveVirusScanApiClient
|
|
195
193
|
end
|
196
194
|
|
197
195
|
end
|
198
|
-
|
199
196
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -27,6 +27,9 @@ module CloudmersiveVirusScanApiClient
|
|
27
27
|
# True if the scan contained a script (such as a PHP script, Python script, etc.) which can be a significant risk factor
|
28
28
|
attr_accessor :contains_script
|
29
29
|
|
30
|
+
# True if the scan contained a password protected or encrypted file, which can be a significant risk factor
|
31
|
+
attr_accessor :contains_password_protected_file
|
32
|
+
|
30
33
|
# True if the uploaded file is of a type that is not allowed based on the optional restrictFileTypes parameter, false otherwise; if restrictFileTypes is not set, this will always be false
|
31
34
|
attr_accessor :contains_restricted_file_format
|
32
35
|
|
@@ -36,7 +39,6 @@ module CloudmersiveVirusScanApiClient
|
|
36
39
|
# Array of viruses found, if any
|
37
40
|
attr_accessor :found_viruses
|
38
41
|
|
39
|
-
|
40
42
|
# Attribute mapping from ruby-style variable name to JSON key.
|
41
43
|
def self.attribute_map
|
42
44
|
{
|
@@ -44,6 +46,7 @@ module CloudmersiveVirusScanApiClient
|
|
44
46
|
:'contains_executable' => :'ContainsExecutable',
|
45
47
|
:'contains_invalid_file' => :'ContainsInvalidFile',
|
46
48
|
:'contains_script' => :'ContainsScript',
|
49
|
+
:'contains_password_protected_file' => :'ContainsPasswordProtectedFile',
|
47
50
|
:'contains_restricted_file_format' => :'ContainsRestrictedFileFormat',
|
48
51
|
:'verified_file_format' => :'VerifiedFileFormat',
|
49
52
|
:'found_viruses' => :'FoundViruses'
|
@@ -57,6 +60,7 @@ module CloudmersiveVirusScanApiClient
|
|
57
60
|
:'contains_executable' => :'BOOLEAN',
|
58
61
|
:'contains_invalid_file' => :'BOOLEAN',
|
59
62
|
:'contains_script' => :'BOOLEAN',
|
63
|
+
:'contains_password_protected_file' => :'BOOLEAN',
|
60
64
|
:'contains_restricted_file_format' => :'BOOLEAN',
|
61
65
|
:'verified_file_format' => :'String',
|
62
66
|
:'found_viruses' => :'Array<VirusFound>'
|
@@ -69,7 +73,7 @@ module CloudmersiveVirusScanApiClient
|
|
69
73
|
return unless attributes.is_a?(Hash)
|
70
74
|
|
71
75
|
# convert string to symbol for hash key
|
72
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
76
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
73
77
|
|
74
78
|
if attributes.has_key?(:'CleanResult')
|
75
79
|
self.clean_result = attributes[:'CleanResult']
|
@@ -87,6 +91,10 @@ module CloudmersiveVirusScanApiClient
|
|
87
91
|
self.contains_script = attributes[:'ContainsScript']
|
88
92
|
end
|
89
93
|
|
94
|
+
if attributes.has_key?(:'ContainsPasswordProtectedFile')
|
95
|
+
self.contains_password_protected_file = attributes[:'ContainsPasswordProtectedFile']
|
96
|
+
end
|
97
|
+
|
90
98
|
if attributes.has_key?(:'ContainsRestrictedFileFormat')
|
91
99
|
self.contains_restricted_file_format = attributes[:'ContainsRestrictedFileFormat']
|
92
100
|
end
|
@@ -100,20 +108,19 @@ module CloudmersiveVirusScanApiClient
|
|
100
108
|
self.found_viruses = value
|
101
109
|
end
|
102
110
|
end
|
103
|
-
|
104
111
|
end
|
105
112
|
|
106
113
|
# Show invalid properties with the reasons. Usually used together with valid?
|
107
114
|
# @return Array for valid properties with the reasons
|
108
115
|
def list_invalid_properties
|
109
116
|
invalid_properties = Array.new
|
110
|
-
|
117
|
+
invalid_properties
|
111
118
|
end
|
112
119
|
|
113
120
|
# Check to see if the all the properties in the model are valid
|
114
121
|
# @return true if the model is valid
|
115
122
|
def valid?
|
116
|
-
|
123
|
+
true
|
117
124
|
end
|
118
125
|
|
119
126
|
# Checks equality by comparing each attribute.
|
@@ -125,6 +132,7 @@ module CloudmersiveVirusScanApiClient
|
|
125
132
|
contains_executable == o.contains_executable &&
|
126
133
|
contains_invalid_file == o.contains_invalid_file &&
|
127
134
|
contains_script == o.contains_script &&
|
135
|
+
contains_password_protected_file == o.contains_password_protected_file &&
|
128
136
|
contains_restricted_file_format == o.contains_restricted_file_format &&
|
129
137
|
verified_file_format == o.verified_file_format &&
|
130
138
|
found_viruses == o.found_viruses
|
@@ -139,7 +147,7 @@ module CloudmersiveVirusScanApiClient
|
|
139
147
|
# Calculates hash code according to all attributes.
|
140
148
|
# @return [Fixnum] Hash code
|
141
149
|
def hash
|
142
|
-
[clean_result, contains_executable, contains_invalid_file, contains_script, contains_restricted_file_format, verified_file_format, found_viruses].hash
|
150
|
+
[clean_result, contains_executable, contains_invalid_file, contains_script, contains_password_protected_file, contains_restricted_file_format, verified_file_format, found_viruses].hash
|
143
151
|
end
|
144
152
|
|
145
153
|
# Builds the object from hash
|
@@ -149,10 +157,10 @@ module CloudmersiveVirusScanApiClient
|
|
149
157
|
return nil unless attributes.is_a?(Hash)
|
150
158
|
self.class.swagger_types.each_pair do |key, type|
|
151
159
|
if type =~ /\AArray<(.*)>/i
|
152
|
-
# check to ensure the input is an array given that the
|
160
|
+
# check to ensure the input is an array given that the attribute
|
153
161
|
# is documented as an array but the input is not
|
154
162
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
155
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
163
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
156
164
|
end
|
157
165
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
158
166
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -234,7 +242,7 @@ module CloudmersiveVirusScanApiClient
|
|
234
242
|
# @return [Hash] Returns the value in the form of hash
|
235
243
|
def _to_hash(value)
|
236
244
|
if value.is_a?(Array)
|
237
|
-
value.compact.map{ |v| _to_hash(v) }
|
245
|
+
value.compact.map { |v| _to_hash(v) }
|
238
246
|
elsif value.is_a?(Hash)
|
239
247
|
{}.tap do |hash|
|
240
248
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -247,5 +255,4 @@ module CloudmersiveVirusScanApiClient
|
|
247
255
|
end
|
248
256
|
|
249
257
|
end
|
250
|
-
|
251
258
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -21,7 +21,6 @@ module CloudmersiveVirusScanApiClient
|
|
21
21
|
# Array of viruses found, if any
|
22
22
|
attr_accessor :found_viruses
|
23
23
|
|
24
|
-
|
25
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
26
25
|
def self.attribute_map
|
27
26
|
{
|
@@ -44,7 +43,7 @@ module CloudmersiveVirusScanApiClient
|
|
44
43
|
return unless attributes.is_a?(Hash)
|
45
44
|
|
46
45
|
# convert string to symbol for hash key
|
47
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
46
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
48
47
|
|
49
48
|
if attributes.has_key?(:'CleanResult')
|
50
49
|
self.clean_result = attributes[:'CleanResult']
|
@@ -55,20 +54,19 @@ module CloudmersiveVirusScanApiClient
|
|
55
54
|
self.found_viruses = value
|
56
55
|
end
|
57
56
|
end
|
58
|
-
|
59
57
|
end
|
60
58
|
|
61
59
|
# Show invalid properties with the reasons. Usually used together with valid?
|
62
60
|
# @return Array for valid properties with the reasons
|
63
61
|
def list_invalid_properties
|
64
62
|
invalid_properties = Array.new
|
65
|
-
|
63
|
+
invalid_properties
|
66
64
|
end
|
67
65
|
|
68
66
|
# Check to see if the all the properties in the model are valid
|
69
67
|
# @return true if the model is valid
|
70
68
|
def valid?
|
71
|
-
|
69
|
+
true
|
72
70
|
end
|
73
71
|
|
74
72
|
# Checks equality by comparing each attribute.
|
@@ -99,10 +97,10 @@ module CloudmersiveVirusScanApiClient
|
|
99
97
|
return nil unless attributes.is_a?(Hash)
|
100
98
|
self.class.swagger_types.each_pair do |key, type|
|
101
99
|
if type =~ /\AArray<(.*)>/i
|
102
|
-
# check to ensure the input is an array given that the
|
100
|
+
# check to ensure the input is an array given that the attribute
|
103
101
|
# is documented as an array but the input is not
|
104
102
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
105
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
103
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
106
104
|
end
|
107
105
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
108
106
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -184,7 +182,7 @@ module CloudmersiveVirusScanApiClient
|
|
184
182
|
# @return [Hash] Returns the value in the form of hash
|
185
183
|
def _to_hash(value)
|
186
184
|
if value.is_a?(Array)
|
187
|
-
value.compact.map{ |v| _to_hash(v) }
|
185
|
+
value.compact.map { |v| _to_hash(v) }
|
188
186
|
elsif value.is_a?(Hash)
|
189
187
|
{}.tap do |hash|
|
190
188
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -197,5 +195,4 @@ module CloudmersiveVirusScanApiClient
|
|
197
195
|
end
|
198
196
|
|
199
197
|
end
|
200
|
-
|
201
198
|
end
|