Class: Falcon::QuickscanproScanResult
- Inherits:
-
Object
- Object
- Falcon::QuickscanproScanResult
- Defined in:
- lib/crimson-falcon/models/quickscanpro_scan_result.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#adversary ⇒ Object
Returns the value of attribute adversary.
-
#artifacts_tree ⇒ Object
Returns the value of attribute artifacts_tree.
-
#beta_intelligence_context ⇒ Object
Returns the value of attribute beta_intelligence_context.
-
#file_artifacts ⇒ Object
Returns the value of attribute file_artifacts.
-
#file_size ⇒ Object
Returns the value of attribute file_size.
-
#file_type ⇒ Object
Returns the value of attribute file_type.
-
#file_type_short ⇒ Object
Returns the value of attribute file_type_short.
-
#first_content_bytes_ascii ⇒ Object
Returns the value of attribute first_content_bytes_ascii.
-
#first_content_bytes_hex ⇒ Object
Returns the value of attribute first_content_bytes_hex.
-
#malicious_confidence ⇒ Object
Returns the value of attribute malicious_confidence.
-
#malware_config ⇒ Object
Returns the value of attribute malware_config.
-
#mime_type ⇒ Object
Returns the value of attribute mime_type.
-
#mitre_attacks ⇒ Object
Returns the value of attribute mitre_attacks.
-
#static_indicators ⇒ Object
Returns the value of attribute static_indicators.
-
#url_artifacts ⇒ Object
Returns the value of attribute url_artifacts.
-
#verdict ⇒ Object
Returns the value of attribute verdict.
-
#verdict_reason ⇒ Object
Returns the value of attribute verdict_reason.
-
#verdict_reasons ⇒ Object
Returns the value of attribute verdict_reasons.
-
#verdict_source ⇒ Object
Returns the value of attribute verdict_source.
Class Method Summary collapse
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ QuickscanproScanResult
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ QuickscanproScanResult
Initializes the object
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 157 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::QuickscanproScanResult` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Falcon::QuickscanproScanResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'adversary') self.adversary = attributes[:'adversary'] end if attributes.key?(:'artifacts_tree') self.artifacts_tree = attributes[:'artifacts_tree'] end if attributes.key?(:'beta_intelligence_context') self.beta_intelligence_context = attributes[:'beta_intelligence_context'] end if attributes.key?(:'file_artifacts') if (value = attributes[:'file_artifacts']).is_a?(Array) self.file_artifacts = value end end if attributes.key?(:'file_size') self.file_size = attributes[:'file_size'] end if attributes.key?(:'file_type') self.file_type = attributes[:'file_type'] end if attributes.key?(:'file_type_short') self.file_type_short = attributes[:'file_type_short'] end if attributes.key?(:'first_content_bytes_ascii') self.first_content_bytes_ascii = attributes[:'first_content_bytes_ascii'] end if attributes.key?(:'first_content_bytes_hex') self.first_content_bytes_hex = attributes[:'first_content_bytes_hex'] end if attributes.key?(:'malicious_confidence') self.malicious_confidence = attributes[:'malicious_confidence'] end if attributes.key?(:'malware_config') if (value = attributes[:'malware_config']).is_a?(Hash) self.malware_config = value end end if attributes.key?(:'mime_type') self.mime_type = attributes[:'mime_type'] end if attributes.key?(:'mitre_attacks') if (value = attributes[:'mitre_attacks']).is_a?(Array) self.mitre_attacks = value end end if attributes.key?(:'static_indicators') if (value = attributes[:'static_indicators']).is_a?(Array) self.static_indicators = value end end if attributes.key?(:'url_artifacts') if (value = attributes[:'url_artifacts']).is_a?(Array) self.url_artifacts = value end end if attributes.key?(:'verdict') self.verdict = attributes[:'verdict'] end if attributes.key?(:'verdict_reason') self.verdict_reason = attributes[:'verdict_reason'] end if attributes.key?(:'verdict_reasons') if (value = attributes[:'verdict_reasons']).is_a?(Array) self.verdict_reasons = value end end if attributes.key?(:'verdict_source') if (value = attributes[:'verdict_source']).is_a?(Array) self.verdict_source = value end end end |
Instance Attribute Details
#adversary ⇒ Object
Returns the value of attribute adversary.
34 35 36 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 34 def adversary @adversary end |
#artifacts_tree ⇒ Object
Returns the value of attribute artifacts_tree.
36 37 38 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 36 def artifacts_tree @artifacts_tree end |
#beta_intelligence_context ⇒ Object
Returns the value of attribute beta_intelligence_context.
38 39 40 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 38 def beta_intelligence_context @beta_intelligence_context end |
#file_artifacts ⇒ Object
Returns the value of attribute file_artifacts.
40 41 42 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 40 def file_artifacts @file_artifacts end |
#file_size ⇒ Object
Returns the value of attribute file_size.
42 43 44 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 42 def file_size @file_size end |
#file_type ⇒ Object
Returns the value of attribute file_type.
44 45 46 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 44 def file_type @file_type end |
#file_type_short ⇒ Object
Returns the value of attribute file_type_short.
46 47 48 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 46 def file_type_short @file_type_short end |
#first_content_bytes_ascii ⇒ Object
Returns the value of attribute first_content_bytes_ascii.
48 49 50 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 48 def first_content_bytes_ascii @first_content_bytes_ascii end |
#first_content_bytes_hex ⇒ Object
Returns the value of attribute first_content_bytes_hex.
50 51 52 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 50 def first_content_bytes_hex @first_content_bytes_hex end |
#malicious_confidence ⇒ Object
Returns the value of attribute malicious_confidence.
52 53 54 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 52 def malicious_confidence @malicious_confidence end |
#malware_config ⇒ Object
Returns the value of attribute malware_config.
54 55 56 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 54 def malware_config @malware_config end |
#mime_type ⇒ Object
Returns the value of attribute mime_type.
56 57 58 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 56 def mime_type @mime_type end |
#mitre_attacks ⇒ Object
Returns the value of attribute mitre_attacks.
58 59 60 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 58 def mitre_attacks @mitre_attacks end |
#static_indicators ⇒ Object
Returns the value of attribute static_indicators.
60 61 62 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 60 def static_indicators @static_indicators end |
#url_artifacts ⇒ Object
Returns the value of attribute url_artifacts.
62 63 64 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 62 def url_artifacts @url_artifacts end |
#verdict ⇒ Object
Returns the value of attribute verdict.
64 65 66 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 64 def verdict @verdict end |
#verdict_reason ⇒ Object
Returns the value of attribute verdict_reason.
66 67 68 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 66 def verdict_reason @verdict_reason end |
#verdict_reasons ⇒ Object
Returns the value of attribute verdict_reasons.
68 69 70 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 68 def verdict_reasons @verdict_reasons end |
#verdict_source ⇒ Object
Returns the value of attribute verdict_source.
70 71 72 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 70 def verdict_source @verdict_source end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
120 121 122 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 120 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 95 def self.attribute_map { :'adversary' => :'adversary', :'artifacts_tree' => :'artifacts_tree', :'beta_intelligence_context' => :'beta_intelligence_context', :'file_artifacts' => :'file_artifacts', :'file_size' => :'file_size', :'file_type' => :'file_type', :'file_type_short' => :'file_type_short', :'first_content_bytes_ascii' => :'first_content_bytes_ascii', :'first_content_bytes_hex' => :'first_content_bytes_hex', :'malicious_confidence' => :'malicious_confidence', :'malware_config' => :'malware_config', :'mime_type' => :'mime_type', :'mitre_attacks' => :'mitre_attacks', :'static_indicators' => :'static_indicators', :'url_artifacts' => :'url_artifacts', :'verdict' => :'verdict', :'verdict_reason' => :'verdict_reason', :'verdict_reasons' => :'verdict_reasons', :'verdict_source' => :'verdict_source' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
347 348 349 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 347 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
150 151 152 153 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 150 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 125 def self.openapi_types { :'adversary' => :'String', :'artifacts_tree' => :'QuickscanproArtifactsTree', :'beta_intelligence_context' => :'Object', :'file_artifacts' => :'Array<QuickscanproFileResult>', :'file_size' => :'Integer', :'file_type' => :'String', :'file_type_short' => :'String', :'first_content_bytes_ascii' => :'String', :'first_content_bytes_hex' => :'String', :'malicious_confidence' => :'Integer', :'malware_config' => :'Hash<String, Array<String>>', :'mime_type' => :'String', :'mitre_attacks' => :'Array<DomainMITREAttack>', :'static_indicators' => :'Array<String>', :'url_artifacts' => :'Array<QuickscanproURLResult>', :'verdict' => :'String', :'verdict_reason' => :'String', :'verdict_reasons' => :'Array<String>', :'verdict_source' => :'Array<String>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 308 def ==(o) return true if self.equal?(o) self.class == o.class && adversary == o.adversary && artifacts_tree == o.artifacts_tree && beta_intelligence_context == o.beta_intelligence_context && file_artifacts == o.file_artifacts && file_size == o.file_size && file_type == o.file_type && file_type_short == o.file_type_short && first_content_bytes_ascii == o.first_content_bytes_ascii && first_content_bytes_hex == o.first_content_bytes_hex && malicious_confidence == o.malicious_confidence && malware_config == o.malware_config && mime_type == o.mime_type && mitre_attacks == o.mitre_attacks && static_indicators == o.static_indicators && url_artifacts == o.url_artifacts && verdict == o.verdict && verdict_reason == o.verdict_reason && verdict_reasons == o.verdict_reasons && verdict_source == o.verdict_source end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 378 def _deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = Falcon.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
449 450 451 452 453 454 455 456 457 458 459 460 461 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 449 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 354 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
334 335 336 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 334 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
340 341 342 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 340 def hash [adversary, artifacts_tree, beta_intelligence_context, file_artifacts, file_size, file_type, file_type_short, first_content_bytes_ascii, first_content_bytes_hex, malicious_confidence, malware_config, mime_type, mitre_attacks, static_indicators, url_artifacts, verdict, verdict_reason, verdict_reasons, verdict_source].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 263 def list_invalid_properties invalid_properties = Array.new if @file_artifacts.nil? invalid_properties.push('invalid value for "file_artifacts", file_artifacts cannot be nil.') end if @malicious_confidence.nil? invalid_properties.push('invalid value for "malicious_confidence", malicious_confidence cannot be nil.') end if @verdict.nil? invalid_properties.push('invalid value for "verdict", verdict cannot be nil.') end if @verdict_reason.nil? invalid_properties.push('invalid value for "verdict_reason", verdict_reason cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
425 426 427 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 425 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
431 432 433 434 435 436 437 438 439 440 441 442 443 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 431 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
419 420 421 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 419 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
286 287 288 289 290 291 292 293 294 |
# File 'lib/crimson-falcon/models/quickscanpro_scan_result.rb', line 286 def valid? return false if @file_artifacts.nil? return false if @malicious_confidence.nil? return false if @verdict.nil? verdict_validator = EnumAttributeValidator.new('String', ["clean", "likely_benign", "suspicious", "malicious", "unknown"]) return false unless verdict_validator.valid?(@verdict) return false if @verdict_reason.nil? true end |