Class: Falcon::DomainBehavior
- Inherits:
-
Object
- Object
- Falcon::DomainBehavior
- Defined in:
- lib/crimson-falcon/models/domain_behavior.rb
Instance Attribute Summary collapse
-
#aid ⇒ Object
Returns the value of attribute aid.
-
#alert_ids ⇒ Object
Returns the value of attribute alert_ids.
-
#alerts_details ⇒ Object
Returns the value of attribute alerts_details.
-
#behavior_id ⇒ Object
Returns the value of attribute behavior_id.
-
#cid ⇒ Object
Returns the value of attribute cid.
-
#cmdline ⇒ Object
Returns the value of attribute cmdline.
-
#compound_tto ⇒ Object
Returns the value of attribute compound_tto.
-
#detection_ids ⇒ Object
Returns the value of attribute detection_ids.
-
#display_name ⇒ Object
Returns the value of attribute display_name.
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#exclusion_type ⇒ Object
Returns the value of attribute exclusion_type.
-
#filepath ⇒ Object
Returns the value of attribute filepath.
-
#incident_id ⇒ Object
Returns the value of attribute incident_id.
-
#incident_ids ⇒ Object
Returns the value of attribute incident_ids.
-
#ioc_source ⇒ Object
Returns the value of attribute ioc_source.
-
#ioc_type ⇒ Object
Returns the value of attribute ioc_type.
-
#ioc_value ⇒ Object
Returns the value of attribute ioc_value.
-
#objective ⇒ Object
Returns the value of attribute objective.
-
#pattern_description ⇒ Object
Returns the value of attribute pattern_description.
-
#pattern_disposition ⇒ Object
Returns the value of attribute pattern_disposition.
-
#pattern_disposition_details ⇒ Object
Returns the value of attribute pattern_disposition_details.
-
#pattern_id ⇒ Object
Returns the value of attribute pattern_id.
-
#sha256 ⇒ Object
Returns the value of attribute sha256.
-
#tactic ⇒ Object
Returns the value of attribute tactic.
-
#tactic_id ⇒ Object
Returns the value of attribute tactic_id.
-
#technique ⇒ Object
Returns the value of attribute technique.
-
#technique_id ⇒ Object
Returns the value of attribute technique_id.
-
#template_instance_id ⇒ Object
Returns the value of attribute template_instance_id.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#user_name ⇒ Object
Returns the value of attribute user_name.
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 = {}) ⇒ DomainBehavior
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 = {}) ⇒ DomainBehavior
Initializes the object
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 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 179 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::DomainBehavior` 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::DomainBehavior`. 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?(:'aid') self.aid = attributes[:'aid'] end if attributes.key?(:'alert_ids') if (value = attributes[:'alert_ids']).is_a?(Array) self.alert_ids = value end end if attributes.key?(:'alerts_details') if (value = attributes[:'alerts_details']).is_a?(Array) self.alerts_details = value end end if attributes.key?(:'behavior_id') self.behavior_id = attributes[:'behavior_id'] end if attributes.key?(:'cid') self.cid = attributes[:'cid'] end if attributes.key?(:'cmdline') self.cmdline = attributes[:'cmdline'] end if attributes.key?(:'compound_tto') self.compound_tto = attributes[:'compound_tto'] end if attributes.key?(:'detection_ids') if (value = attributes[:'detection_ids']).is_a?(Array) self.detection_ids = value end end if attributes.key?(:'display_name') self.display_name = attributes[:'display_name'] end if attributes.key?(:'domain') self.domain = attributes[:'domain'] end if attributes.key?(:'exclusion_type') self.exclusion_type = attributes[:'exclusion_type'] end if attributes.key?(:'filepath') self.filepath = attributes[:'filepath'] end if attributes.key?(:'incident_id') self.incident_id = attributes[:'incident_id'] end if attributes.key?(:'incident_ids') if (value = attributes[:'incident_ids']).is_a?(Array) self.incident_ids = value end end if attributes.key?(:'ioc_source') self.ioc_source = attributes[:'ioc_source'] end if attributes.key?(:'ioc_type') self.ioc_type = attributes[:'ioc_type'] end if attributes.key?(:'ioc_value') self.ioc_value = attributes[:'ioc_value'] end if attributes.key?(:'objective') self.objective = attributes[:'objective'] end if attributes.key?(:'pattern_description') self.pattern_description = attributes[:'pattern_description'] end if attributes.key?(:'pattern_disposition') self.pattern_disposition = attributes[:'pattern_disposition'] end if attributes.key?(:'pattern_disposition_details') self.pattern_disposition_details = attributes[:'pattern_disposition_details'] end if attributes.key?(:'pattern_id') self.pattern_id = attributes[:'pattern_id'] end if attributes.key?(:'sha256') self.sha256 = attributes[:'sha256'] end if attributes.key?(:'tactic') self.tactic = attributes[:'tactic'] end if attributes.key?(:'tactic_id') self.tactic_id = attributes[:'tactic_id'] end if attributes.key?(:'technique') self.technique = attributes[:'technique'] end if attributes.key?(:'technique_id') self.technique_id = attributes[:'technique_id'] end if attributes.key?(:'template_instance_id') self.template_instance_id = attributes[:'template_instance_id'] end if attributes.key?(:'timestamp') self. = attributes[:'timestamp'] end if attributes.key?(:'user_name') self.user_name = attributes[:'user_name'] end end |
Instance Attribute Details
#aid ⇒ Object
Returns the value of attribute aid.
34 35 36 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 34 def aid @aid end |
#alert_ids ⇒ Object
Returns the value of attribute alert_ids.
36 37 38 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 36 def alert_ids @alert_ids end |
#alerts_details ⇒ Object
Returns the value of attribute alerts_details.
38 39 40 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 38 def alerts_details @alerts_details end |
#behavior_id ⇒ Object
Returns the value of attribute behavior_id.
40 41 42 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 40 def behavior_id @behavior_id end |
#cid ⇒ Object
Returns the value of attribute cid.
42 43 44 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 42 def cid @cid end |
#cmdline ⇒ Object
Returns the value of attribute cmdline.
44 45 46 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 44 def cmdline @cmdline end |
#compound_tto ⇒ Object
Returns the value of attribute compound_tto.
46 47 48 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 46 def compound_tto @compound_tto end |
#detection_ids ⇒ Object
Returns the value of attribute detection_ids.
48 49 50 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 48 def detection_ids @detection_ids end |
#display_name ⇒ Object
Returns the value of attribute display_name.
50 51 52 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 50 def display_name @display_name end |
#domain ⇒ Object
Returns the value of attribute domain.
52 53 54 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 52 def domain @domain end |
#exclusion_type ⇒ Object
Returns the value of attribute exclusion_type.
54 55 56 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 54 def exclusion_type @exclusion_type end |
#filepath ⇒ Object
Returns the value of attribute filepath.
56 57 58 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 56 def filepath @filepath end |
#incident_id ⇒ Object
Returns the value of attribute incident_id.
58 59 60 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 58 def incident_id @incident_id end |
#incident_ids ⇒ Object
Returns the value of attribute incident_ids.
60 61 62 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 60 def incident_ids @incident_ids end |
#ioc_source ⇒ Object
Returns the value of attribute ioc_source.
62 63 64 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 62 def ioc_source @ioc_source end |
#ioc_type ⇒ Object
Returns the value of attribute ioc_type.
64 65 66 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 64 def ioc_type @ioc_type end |
#ioc_value ⇒ Object
Returns the value of attribute ioc_value.
66 67 68 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 66 def ioc_value @ioc_value end |
#objective ⇒ Object
Returns the value of attribute objective.
68 69 70 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 68 def objective @objective end |
#pattern_description ⇒ Object
Returns the value of attribute pattern_description.
70 71 72 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 70 def pattern_description @pattern_description end |
#pattern_disposition ⇒ Object
Returns the value of attribute pattern_disposition.
72 73 74 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 72 def pattern_disposition @pattern_disposition end |
#pattern_disposition_details ⇒ Object
Returns the value of attribute pattern_disposition_details.
74 75 76 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 74 def pattern_disposition_details @pattern_disposition_details end |
#pattern_id ⇒ Object
Returns the value of attribute pattern_id.
76 77 78 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 76 def pattern_id @pattern_id end |
#sha256 ⇒ Object
Returns the value of attribute sha256.
78 79 80 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 78 def sha256 @sha256 end |
#tactic ⇒ Object
Returns the value of attribute tactic.
80 81 82 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 80 def tactic @tactic end |
#tactic_id ⇒ Object
Returns the value of attribute tactic_id.
82 83 84 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 82 def tactic_id @tactic_id end |
#technique ⇒ Object
Returns the value of attribute technique.
84 85 86 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 84 def technique @technique end |
#technique_id ⇒ Object
Returns the value of attribute technique_id.
86 87 88 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 86 def technique_id @technique_id end |
#template_instance_id ⇒ Object
Returns the value of attribute template_instance_id.
88 89 90 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 88 def template_instance_id @template_instance_id end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
90 91 92 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 90 def @timestamp end |
#user_name ⇒ Object
Returns the value of attribute user_name.
92 93 94 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 92 def user_name @user_name end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
131 132 133 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 131 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 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 95 def self.attribute_map { :'aid' => :'aid', :'alert_ids' => :'alert_ids', :'alerts_details' => :'alerts_details', :'behavior_id' => :'behavior_id', :'cid' => :'cid', :'cmdline' => :'cmdline', :'compound_tto' => :'compound_tto', :'detection_ids' => :'detection_ids', :'display_name' => :'display_name', :'domain' => :'domain', :'exclusion_type' => :'exclusion_type', :'filepath' => :'filepath', :'incident_id' => :'incident_id', :'incident_ids' => :'incident_ids', :'ioc_source' => :'ioc_source', :'ioc_type' => :'ioc_type', :'ioc_value' => :'ioc_value', :'objective' => :'objective', :'pattern_description' => :'pattern_description', :'pattern_disposition' => :'pattern_disposition', :'pattern_disposition_details' => :'pattern_disposition_details', :'pattern_id' => :'pattern_id', :'sha256' => :'sha256', :'tactic' => :'tactic', :'tactic_id' => :'tactic_id', :'technique' => :'technique', :'technique_id' => :'technique_id', :'template_instance_id' => :'template_instance_id', :'timestamp' => :'timestamp', :'user_name' => :'user_name' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
401 402 403 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 401 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
172 173 174 175 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 172 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 136 def self.openapi_types { :'aid' => :'String', :'alert_ids' => :'Array<String>', :'alerts_details' => :'Array<DomainAlertDetails>', :'behavior_id' => :'String', :'cid' => :'String', :'cmdline' => :'String', :'compound_tto' => :'String', :'detection_ids' => :'Array<String>', :'display_name' => :'String', :'domain' => :'String', :'exclusion_type' => :'String', :'filepath' => :'String', :'incident_id' => :'String', :'incident_ids' => :'Array<String>', :'ioc_source' => :'String', :'ioc_type' => :'String', :'ioc_value' => :'String', :'objective' => :'String', :'pattern_description' => :'String', :'pattern_disposition' => :'Integer', :'pattern_disposition_details' => :'PatterndispositionPatternDisposition', :'pattern_id' => :'Integer', :'sha256' => :'String', :'tactic' => :'String', :'tactic_id' => :'String', :'technique' => :'String', :'technique_id' => :'String', :'template_instance_id' => :'Integer', :'timestamp' => :'Time', :'user_name' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 351 def ==(o) return true if self.equal?(o) self.class == o.class && aid == o.aid && alert_ids == o.alert_ids && alerts_details == o.alerts_details && behavior_id == o.behavior_id && cid == o.cid && cmdline == o.cmdline && compound_tto == o.compound_tto && detection_ids == o.detection_ids && display_name == o.display_name && domain == o.domain && exclusion_type == o.exclusion_type && filepath == o.filepath && incident_id == o.incident_id && incident_ids == o.incident_ids && ioc_source == o.ioc_source && ioc_type == o.ioc_type && ioc_value == o.ioc_value && objective == o.objective && pattern_description == o.pattern_description && pattern_disposition == o.pattern_disposition && pattern_disposition_details == o.pattern_disposition_details && pattern_id == o.pattern_id && sha256 == o.sha256 && tactic == o.tactic && tactic_id == o.tactic_id && technique == o.technique && technique_id == o.technique_id && template_instance_id == o.template_instance_id && == o. && user_name == o.user_name end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 432 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
503 504 505 506 507 508 509 510 511 512 513 514 515 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 503 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
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 408 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
388 389 390 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 388 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
394 395 396 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 394 def hash [aid, alert_ids, alerts_details, behavior_id, cid, cmdline, compound_tto, detection_ids, display_name, domain, exclusion_type, filepath, incident_id, incident_ids, ioc_source, ioc_type, ioc_value, objective, pattern_description, pattern_disposition, pattern_disposition_details, pattern_id, sha256, tactic, tactic_id, technique, technique_id, template_instance_id, , user_name].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 323 def list_invalid_properties invalid_properties = Array.new if @pattern_id.nil? invalid_properties.push('invalid value for "pattern_id", pattern_id cannot be nil.') end if @template_instance_id.nil? invalid_properties.push('invalid value for "template_instance_id", template_instance_id cannot be nil.') end if @timestamp.nil? invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
479 480 481 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 479 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
485 486 487 488 489 490 491 492 493 494 495 496 497 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 485 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
473 474 475 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 473 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
342 343 344 345 346 347 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 342 def valid? return false if @pattern_id.nil? return false if @template_instance_id.nil? return false if @timestamp.nil? true end |