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.
-
#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.
-
#grouping_ids ⇒ Object
Returns the value of attribute grouping_ids.
-
#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
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 320 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 180 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?(:'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?(:'grouping_ids') if (value = attributes[:'grouping_ids']).is_a?(Array) self.grouping_ids = value end 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.
35 36 37 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 35 def aid @aid end |
#alert_ids ⇒ Object
Returns the value of attribute alert_ids.
37 38 39 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 37 def alert_ids @alert_ids end |
#behavior_id ⇒ Object
Returns the value of attribute behavior_id.
39 40 41 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 39 def behavior_id @behavior_id end |
#cid ⇒ Object
Returns the value of attribute cid.
41 42 43 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 41 def cid @cid end |
#cmdline ⇒ Object
Returns the value of attribute cmdline.
43 44 45 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 43 def cmdline @cmdline end |
#compound_tto ⇒ Object
Returns the value of attribute compound_tto.
45 46 47 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 45 def compound_tto @compound_tto end |
#detection_ids ⇒ Object
Returns the value of attribute detection_ids.
47 48 49 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 47 def detection_ids @detection_ids end |
#display_name ⇒ Object
Returns the value of attribute display_name.
49 50 51 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 49 def display_name @display_name end |
#domain ⇒ Object
Returns the value of attribute domain.
51 52 53 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 51 def domain @domain end |
#exclusion_type ⇒ Object
Returns the value of attribute exclusion_type.
53 54 55 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 53 def exclusion_type @exclusion_type end |
#filepath ⇒ Object
Returns the value of attribute filepath.
55 56 57 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 55 def filepath @filepath end |
#grouping_ids ⇒ Object
Returns the value of attribute grouping_ids.
57 58 59 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 57 def grouping_ids @grouping_ids end |
#incident_id ⇒ Object
Returns the value of attribute incident_id.
59 60 61 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 59 def incident_id @incident_id end |
#incident_ids ⇒ Object
Returns the value of attribute incident_ids.
61 62 63 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 61 def incident_ids @incident_ids end |
#ioc_source ⇒ Object
Returns the value of attribute ioc_source.
63 64 65 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 63 def ioc_source @ioc_source end |
#ioc_type ⇒ Object
Returns the value of attribute ioc_type.
65 66 67 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 65 def ioc_type @ioc_type end |
#ioc_value ⇒ Object
Returns the value of attribute ioc_value.
67 68 69 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 67 def ioc_value @ioc_value end |
#objective ⇒ Object
Returns the value of attribute objective.
69 70 71 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 69 def objective @objective end |
#pattern_description ⇒ Object
Returns the value of attribute pattern_description.
71 72 73 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 71 def pattern_description @pattern_description end |
#pattern_disposition ⇒ Object
Returns the value of attribute pattern_disposition.
73 74 75 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 73 def pattern_disposition @pattern_disposition end |
#pattern_disposition_details ⇒ Object
Returns the value of attribute pattern_disposition_details.
75 76 77 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 75 def pattern_disposition_details @pattern_disposition_details end |
#pattern_id ⇒ Object
Returns the value of attribute pattern_id.
77 78 79 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 77 def pattern_id @pattern_id end |
#sha256 ⇒ Object
Returns the value of attribute sha256.
79 80 81 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 79 def sha256 @sha256 end |
#tactic ⇒ Object
Returns the value of attribute tactic.
81 82 83 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 81 def tactic @tactic end |
#tactic_id ⇒ Object
Returns the value of attribute tactic_id.
83 84 85 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 83 def tactic_id @tactic_id end |
#technique ⇒ Object
Returns the value of attribute technique.
85 86 87 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 85 def technique @technique end |
#technique_id ⇒ Object
Returns the value of attribute technique_id.
87 88 89 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 87 def technique_id @technique_id end |
#template_instance_id ⇒ Object
Returns the value of attribute template_instance_id.
89 90 91 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 89 def template_instance_id @template_instance_id end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
91 92 93 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 91 def @timestamp end |
#user_name ⇒ Object
Returns the value of attribute user_name.
93 94 95 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 93 def user_name @user_name end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
132 133 134 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 132 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 129 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 96 def self.attribute_map { :'aid' => :'aid', :'alert_ids' => :'alert_ids', :'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', :'grouping_ids' => :'grouping_ids', :'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
402 403 404 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 402 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
173 174 175 176 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 173 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 170 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 137 def self.openapi_types { :'aid' => :'String', :'alert_ids' => :'Array<String>', :'behavior_id' => :'String', :'cid' => :'String', :'cmdline' => :'String', :'compound_tto' => :'String', :'detection_ids' => :'Array<String>', :'display_name' => :'String', :'domain' => :'String', :'exclusion_type' => :'String', :'filepath' => :'String', :'grouping_ids' => :'Array<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.
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 385 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 352 def ==(o) return true if self.equal?(o) self.class == o.class && aid == o.aid && alert_ids == o.alert_ids && 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 && grouping_ids == o.grouping_ids && 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
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 470 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 433 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
504 505 506 507 508 509 510 511 512 513 514 515 516 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 504 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
409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 409 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
389 390 391 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 389 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
395 396 397 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 395 def hash [aid, alert_ids, behavior_id, cid, cmdline, compound_tto, detection_ids, display_name, domain, exclusion_type, filepath, grouping_ids, 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?
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 324 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)
480 481 482 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 480 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
486 487 488 489 490 491 492 493 494 495 496 497 498 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 486 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
474 475 476 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 474 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
343 344 345 346 347 348 |
# File 'lib/crimson-falcon/models/domain_behavior.rb', line 343 def valid? return false if @pattern_id.nil? return false if @template_instance_id.nil? return false if @timestamp.nil? true end |