Class: Falcon::DomainNotificationV1
- Inherits:
-
Object
- Object
- Falcon::DomainNotificationV1
- Defined in:
- lib/crimson-falcon/models/domain_notification_v1.rb
Instance Attribute Summary collapse
-
#actor_slug ⇒ Object
Returns the value of attribute actor_slug.
-
#assigned_to_uid ⇒ Object
The email of the user who is assigned to this notification.
-
#assigned_to_username ⇒ Object
The name of the user who is assigned to this notification.
-
#assigned_to_uuid ⇒ Object
The unique ID of the user who is assigned to this notification.
-
#breach_summary ⇒ Object
Returns the value of attribute breach_summary.
-
#cid ⇒ Object
Returns the value of attribute cid.
-
#created_date ⇒ Object
The date when the notification was generated.
-
#highlights ⇒ Object
Highlighted content based on the rule that generated the notifications.
-
#id ⇒ Object
The ID of the notification.
-
#item_author ⇒ Object
The author who posted the intelligence item.
-
#item_author_id ⇒ Object
The ID of the author who posted the intelligence item.
-
#item_date ⇒ Object
Timestamp when the item is considered to have been created.
-
#item_id ⇒ Object
ID of the item which matched the rule.
-
#item_site ⇒ Object
The site where the intelligence item was found.
-
#item_site_id ⇒ Object
The ID of the site where the intelligence item was found.
-
#item_type ⇒ Object
Type of the item which matched the rule: ‘post`, `reply`, `botnet_config`, `breach`, etc.
-
#logs ⇒ Object
Returns the value of attribute logs.
-
#raw_intel_id ⇒ Object
ID of the raw intel item that matched the rule.
-
#rule_id ⇒ Object
The ID of the rule that generated this notification.
-
#rule_name ⇒ Object
The name of the rule that generated this notification.
-
#rule_priority ⇒ Object
The priority of the rule that generated this notification.
-
#rule_topic ⇒ Object
The topic of the rule that generated this notification.
-
#source_category ⇒ Object
Category of the source that generated the notification.
-
#status ⇒ Object
The notification status.
-
#typosquatting ⇒ Object
Returns the value of attribute typosquatting.
-
#updated_date ⇒ Object
The date when the notification was updated.
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 = {}) ⇒ DomainNotificationV1
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 = {}) ⇒ DomainNotificationV1
Initializes the object
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 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 185 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::DomainNotificationV1` 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::DomainNotificationV1`. 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?(:'actor_slug') self.actor_slug = attributes[:'actor_slug'] end if attributes.key?(:'assigned_to_uid') self.assigned_to_uid = attributes[:'assigned_to_uid'] end if attributes.key?(:'assigned_to_username') self.assigned_to_username = attributes[:'assigned_to_username'] end if attributes.key?(:'assigned_to_uuid') self.assigned_to_uuid = attributes[:'assigned_to_uuid'] end if attributes.key?(:'breach_summary') self.breach_summary = attributes[:'breach_summary'] end if attributes.key?(:'cid') self.cid = attributes[:'cid'] end if attributes.key?(:'created_date') self.created_date = attributes[:'created_date'] end if attributes.key?(:'highlights') if (value = attributes[:'highlights']).is_a?(Array) self.highlights = value end end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'item_author') self. = attributes[:'item_author'] end if attributes.key?(:'item_author_id') self. = attributes[:'item_author_id'] end if attributes.key?(:'item_date') self.item_date = attributes[:'item_date'] end if attributes.key?(:'item_id') self.item_id = attributes[:'item_id'] end if attributes.key?(:'item_site') self.item_site = attributes[:'item_site'] end if attributes.key?(:'item_site_id') self.item_site_id = attributes[:'item_site_id'] end if attributes.key?(:'item_type') self.item_type = attributes[:'item_type'] end if attributes.key?(:'logs') if (value = attributes[:'logs']).is_a?(Array) self.logs = value end end if attributes.key?(:'raw_intel_id') self.raw_intel_id = attributes[:'raw_intel_id'] end if attributes.key?(:'rule_id') self.rule_id = attributes[:'rule_id'] end if attributes.key?(:'rule_name') self.rule_name = attributes[:'rule_name'] end if attributes.key?(:'rule_priority') self.rule_priority = attributes[:'rule_priority'] end if attributes.key?(:'rule_topic') self.rule_topic = attributes[:'rule_topic'] end if attributes.key?(:'source_category') self.source_category = attributes[:'source_category'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'typosquatting') self.typosquatting = attributes[:'typosquatting'] end if attributes.key?(:'updated_date') self.updated_date = attributes[:'updated_date'] end end |
Instance Attribute Details
#actor_slug ⇒ Object
Returns the value of attribute actor_slug.
35 36 37 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 35 def actor_slug @actor_slug end |
#assigned_to_uid ⇒ Object
The email of the user who is assigned to this notification
38 39 40 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 38 def assigned_to_uid @assigned_to_uid end |
#assigned_to_username ⇒ Object
The name of the user who is assigned to this notification
41 42 43 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 41 def assigned_to_username @assigned_to_username end |
#assigned_to_uuid ⇒ Object
The unique ID of the user who is assigned to this notification
44 45 46 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 44 def assigned_to_uuid @assigned_to_uuid end |
#breach_summary ⇒ Object
Returns the value of attribute breach_summary.
46 47 48 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 46 def breach_summary @breach_summary end |
#cid ⇒ Object
Returns the value of attribute cid.
48 49 50 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 48 def cid @cid end |
#created_date ⇒ Object
The date when the notification was generated
51 52 53 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 51 def created_date @created_date end |
#highlights ⇒ Object
Highlighted content based on the rule that generated the notifications. Highlights are surrounded with a ‘<cs-highlight>` tag
54 55 56 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 54 def highlights @highlights end |
#id ⇒ Object
The ID of the notification
57 58 59 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 57 def id @id end |
#item_author ⇒ Object
The author who posted the intelligence item
60 61 62 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 60 def @item_author end |
#item_author_id ⇒ Object
The ID of the author who posted the intelligence item
63 64 65 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 63 def @item_author_id end |
#item_date ⇒ Object
Timestamp when the item is considered to have been created
66 67 68 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 66 def item_date @item_date end |
#item_id ⇒ Object
ID of the item which matched the rule
69 70 71 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 69 def item_id @item_id end |
#item_site ⇒ Object
The site where the intelligence item was found
72 73 74 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 72 def item_site @item_site end |
#item_site_id ⇒ Object
The ID of the site where the intelligence item was found
75 76 77 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 75 def item_site_id @item_site_id end |
#item_type ⇒ Object
Type of the item which matched the rule: ‘post`, `reply`, `botnet_config`, `breach`, etc.
78 79 80 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 78 def item_type @item_type end |
#logs ⇒ Object
Returns the value of attribute logs.
80 81 82 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 80 def logs @logs end |
#raw_intel_id ⇒ Object
ID of the raw intel item that matched the rule
83 84 85 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 83 def raw_intel_id @raw_intel_id end |
#rule_id ⇒ Object
The ID of the rule that generated this notification
86 87 88 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 86 def rule_id @rule_id end |
#rule_name ⇒ Object
The name of the rule that generated this notification
89 90 91 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 89 def rule_name @rule_name end |
#rule_priority ⇒ Object
The priority of the rule that generated this notification
92 93 94 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 92 def rule_priority @rule_priority end |
#rule_topic ⇒ Object
The topic of the rule that generated this notification
95 96 97 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 95 def rule_topic @rule_topic end |
#source_category ⇒ Object
Category of the source that generated the notification
98 99 100 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 98 def source_category @source_category end |
#status ⇒ Object
The notification status. This can be one of: ‘new`, `in-progress`, `closed-false-positive`, `closed-true-positive`.
101 102 103 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 101 def status @status end |
#typosquatting ⇒ Object
Returns the value of attribute typosquatting.
103 104 105 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 103 def typosquatting @typosquatting end |
#updated_date ⇒ Object
The date when the notification was updated
106 107 108 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 106 def updated_date @updated_date end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
141 142 143 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 141 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 109 def self.attribute_map { :'actor_slug' => :'actor_slug', :'assigned_to_uid' => :'assigned_to_uid', :'assigned_to_username' => :'assigned_to_username', :'assigned_to_uuid' => :'assigned_to_uuid', :'breach_summary' => :'breach_summary', :'cid' => :'cid', :'created_date' => :'created_date', :'highlights' => :'highlights', :'id' => :'id', :'item_author' => :'item_author', :'item_author_id' => :'item_author_id', :'item_date' => :'item_date', :'item_id' => :'item_id', :'item_site' => :'item_site', :'item_site_id' => :'item_site_id', :'item_type' => :'item_type', :'logs' => :'logs', :'raw_intel_id' => :'raw_intel_id', :'rule_id' => :'rule_id', :'rule_name' => :'rule_name', :'rule_priority' => :'rule_priority', :'rule_topic' => :'rule_topic', :'source_category' => :'source_category', :'status' => :'status', :'typosquatting' => :'typosquatting', :'updated_date' => :'updated_date' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
438 439 440 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 438 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
178 179 180 181 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 178 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 171 172 173 174 175 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 146 def self.openapi_types { :'actor_slug' => :'String', :'assigned_to_uid' => :'String', :'assigned_to_username' => :'String', :'assigned_to_uuid' => :'String', :'breach_summary' => :'DomainMatchedBreachSummaryV1', :'cid' => :'String', :'created_date' => :'Time', :'highlights' => :'Array<String>', :'id' => :'String', :'item_author' => :'String', :'item_author_id' => :'String', :'item_date' => :'Time', :'item_id' => :'String', :'item_site' => :'String', :'item_site_id' => :'String', :'item_type' => :'String', :'logs' => :'Array<SadomainNotificationLog>', :'raw_intel_id' => :'String', :'rule_id' => :'String', :'rule_name' => :'String', :'rule_priority' => :'String', :'rule_topic' => :'String', :'source_category' => :'String', :'status' => :'String', :'typosquatting' => :'SadomainTyposquattingComponent', :'updated_date' => :'Time' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 392 def ==(o) return true if self.equal?(o) self.class == o.class && actor_slug == o.actor_slug && assigned_to_uid == o.assigned_to_uid && assigned_to_username == o.assigned_to_username && assigned_to_uuid == o.assigned_to_uuid && breach_summary == o.breach_summary && cid == o.cid && created_date == o.created_date && highlights == o.highlights && id == o.id && == o. && == o. && item_date == o.item_date && item_id == o.item_id && item_site == o.item_site && item_site_id == o.item_site_id && item_type == o.item_type && logs == o.logs && raw_intel_id == o.raw_intel_id && rule_id == o.rule_id && rule_name == o.rule_name && rule_priority == o.rule_priority && rule_topic == o.rule_topic && source_category == o.source_category && status == o.status && typosquatting == o.typosquatting && updated_date == o.updated_date end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 469 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
540 541 542 543 544 545 546 547 548 549 550 551 552 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 540 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
445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 445 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
425 426 427 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 425 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
431 432 433 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 431 def hash [actor_slug, assigned_to_uid, assigned_to_username, assigned_to_uuid, breach_summary, cid, created_date, highlights, id, , , item_date, item_id, item_site, item_site_id, item_type, logs, raw_intel_id, rule_id, rule_name, rule_priority, rule_topic, source_category, status, typosquatting, updated_date].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 309 def list_invalid_properties invalid_properties = Array.new if @actor_slug.nil? invalid_properties.push('invalid value for "actor_slug", actor_slug cannot be nil.') end if @cid.nil? invalid_properties.push('invalid value for "cid", cid cannot be nil.') end if @created_date.nil? invalid_properties.push('invalid value for "created_date", created_date cannot be nil.') end if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @item_date.nil? invalid_properties.push('invalid value for "item_date", item_date cannot be nil.') end if @item_id.nil? invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') end if @item_type.nil? invalid_properties.push('invalid value for "item_type", item_type cannot be nil.') end if @raw_intel_id.nil? invalid_properties.push('invalid value for "raw_intel_id", raw_intel_id cannot be nil.') end if @rule_id.nil? invalid_properties.push('invalid value for "rule_id", rule_id cannot be nil.') end if @rule_name.nil? invalid_properties.push('invalid value for "rule_name", rule_name cannot be nil.') end if @rule_priority.nil? invalid_properties.push('invalid value for "rule_priority", rule_priority cannot be nil.') end if @rule_topic.nil? invalid_properties.push('invalid value for "rule_topic", rule_topic cannot be nil.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end if @updated_date.nil? invalid_properties.push('invalid value for "updated_date", updated_date cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
516 517 518 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 516 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
522 523 524 525 526 527 528 529 530 531 532 533 534 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 522 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
510 511 512 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 510 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 372 def valid? return false if @actor_slug.nil? return false if @cid.nil? return false if @created_date.nil? return false if @id.nil? return false if @item_date.nil? return false if @item_id.nil? return false if @item_type.nil? return false if @raw_intel_id.nil? return false if @rule_id.nil? return false if @rule_name.nil? return false if @rule_priority.nil? return false if @rule_topic.nil? return false if @status.nil? return false if @updated_date.nil? true end |