Class: Falcon::DomainItemDetailsV1
- Inherits:
-
Object
- Object
- Falcon::DomainItemDetailsV1
- Defined in:
- lib/crimson-falcon/models/domain_item_details_v1.rb
Instance Attribute Summary collapse
-
#actor_slug ⇒ Object
The threat actor associated with a raw intelligence item, if available.
-
#attachments ⇒ Object
Attachments items linked to the raw intelligence item.
-
#author ⇒ Object
The author’s username of a raw intelligence item.
-
#author_id ⇒ Object
The raw intelligence item author identifier in our system.
-
#category ⇒ Object
The type of source where the raw intelligence item was found.
-
#collection_date ⇒ Object
The date and time the raw intelligence item was scraped from the original source.
-
#content ⇒ Object
Highlighted content based on the monitoring rule that generated the notification.
-
#created_date ⇒ Object
The date and time when the raw intelligence item was created.
-
#file_type ⇒ Object
The file type of the raw intelligence item, if available.
-
#fragment_info ⇒ Object
Returns the value of attribute fragment_info.
-
#full_content_url ⇒ Object
The URL to download the full raw text content of the raw intelligence item.
-
#ioc_types ⇒ Object
The types of IOCs found in the raw intelligence item.
-
#iocs ⇒ Object
Returns the value of attribute iocs.
-
#labels ⇒ Object
Labels for the type of information included in a raw intelligence item.
-
#language ⇒ Object
The language of the raw intelligence item.
-
#marketplace_product ⇒ Object
Returns the value of attribute marketplace_product.
-
#mime_type ⇒ Object
The mime type of the file.
-
#screenshots ⇒ Object
Screenshots of the raw intelligence item.
-
#sha256 ⇒ Object
The SHA256 hash for the file.
-
#site ⇒ Object
The site where the raw intelligence item was found.
-
#site_id ⇒ Object
The ID of the site where the raw intelligence item was found.
-
#size ⇒ Object
The size of the item’s content in bytes, if available.
-
#telegram_info ⇒ Object
Returns the value of attribute telegram_info.
-
#thread_id ⇒ Object
Identifier that groups all raw intelligence items belonging to the same conversation thread.
-
#title ⇒ Object
The title of the raw intelligence item.
-
#type ⇒ Object
The type of the raw intelligence item.
-
#updated_date ⇒ Object
The date and time when the raw intelligence item was updated.
-
#url ⇒ Object
The URL of the raw intelligence item.
-
#user_id ⇒ Object
The raw intelligence item author identifier in the original 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 = {}) ⇒ DomainItemDetailsV1
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 = {}) ⇒ DomainItemDetailsV1
Initializes the object
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 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 201 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::DomainItemDetailsV1` 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::DomainItemDetailsV1`. 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?(:'attachments') if (value = attributes[:'attachments']).is_a?(Array) self. = value end end if attributes.key?(:'author') self. = attributes[:'author'] end if attributes.key?(:'author_id') self. = attributes[:'author_id'] end if attributes.key?(:'category') self.category = attributes[:'category'] end if attributes.key?(:'collection_date') self.collection_date = attributes[:'collection_date'] end if attributes.key?(:'content') self.content = attributes[:'content'] end if attributes.key?(:'created_date') self.created_date = attributes[:'created_date'] end if attributes.key?(:'file_type') self.file_type = attributes[:'file_type'] end if attributes.key?(:'fragment_info') self.fragment_info = attributes[:'fragment_info'] end if attributes.key?(:'full_content_url') self.full_content_url = attributes[:'full_content_url'] end if attributes.key?(:'ioc_types') if (value = attributes[:'ioc_types']).is_a?(Array) self.ioc_types = value end end if attributes.key?(:'iocs') self.iocs = attributes[:'iocs'] end if attributes.key?(:'labels') if (value = attributes[:'labels']).is_a?(Array) self.labels = value end end if attributes.key?(:'language') self.language = attributes[:'language'] end if attributes.key?(:'marketplace_product') self.marketplace_product = attributes[:'marketplace_product'] end if attributes.key?(:'mime_type') self.mime_type = attributes[:'mime_type'] end if attributes.key?(:'screenshots') if (value = attributes[:'screenshots']).is_a?(Array) self.screenshots = value end end if attributes.key?(:'sha256') self.sha256 = attributes[:'sha256'] end if attributes.key?(:'site') self.site = attributes[:'site'] end if attributes.key?(:'site_id') self.site_id = attributes[:'site_id'] end if attributes.key?(:'size') self.size = attributes[:'size'] end if attributes.key?(:'telegram_info') self.telegram_info = attributes[:'telegram_info'] end if attributes.key?(:'thread_id') self.thread_id = attributes[:'thread_id'] end if attributes.key?(:'title') self.title = attributes[:'title'] end if attributes.key?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'updated_date') self.updated_date = attributes[:'updated_date'] end if attributes.key?(:'url') self.url = attributes[:'url'] end if attributes.key?(:'user_id') self.user_id = attributes[:'user_id'] end end |
Instance Attribute Details
#actor_slug ⇒ Object
The threat actor associated with a raw intelligence item, if available.
36 37 38 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 36 def actor_slug @actor_slug end |
#attachments ⇒ Object
Attachments items linked to the raw intelligence item
39 40 41 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 39 def end |
#author ⇒ Object
The author’s username of a raw intelligence item
42 43 44 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 42 def end |
#author_id ⇒ Object
The raw intelligence item author identifier in our system
45 46 47 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 45 def end |
#category ⇒ Object
The type of source where the raw intelligence item was found
48 49 50 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 48 def category @category end |
#collection_date ⇒ Object
The date and time the raw intelligence item was scraped from the original source
51 52 53 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 51 def collection_date @collection_date end |
#content ⇒ Object
Highlighted content based on the monitoring rule that generated the notification. Highlights are surrounded with a ‘<cs-highlight>` tag
54 55 56 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 54 def content @content end |
#created_date ⇒ Object
The date and time when the raw intelligence item was created
57 58 59 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 57 def created_date @created_date end |
#file_type ⇒ Object
The file type of the raw intelligence item, if available
60 61 62 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 60 def file_type @file_type end |
#fragment_info ⇒ Object
Returns the value of attribute fragment_info.
62 63 64 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 62 def fragment_info @fragment_info end |
#full_content_url ⇒ Object
The URL to download the full raw text content of the raw intelligence item. It has a limited time to live
65 66 67 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 65 def full_content_url @full_content_url end |
#ioc_types ⇒ Object
The types of IOCs found in the raw intelligence item. List of keys populated in the iocs field
68 69 70 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 68 def ioc_types @ioc_types end |
#iocs ⇒ Object
Returns the value of attribute iocs.
70 71 72 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 70 def iocs @iocs end |
#labels ⇒ Object
Labels for the type of information included in a raw intelligence item
73 74 75 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 73 def labels @labels end |
#language ⇒ Object
The language of the raw intelligence item
76 77 78 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 76 def language @language end |
#marketplace_product ⇒ Object
Returns the value of attribute marketplace_product.
78 79 80 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 78 def marketplace_product @marketplace_product end |
#mime_type ⇒ Object
The mime type of the file
81 82 83 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 81 def mime_type @mime_type end |
#screenshots ⇒ Object
Screenshots of the raw intelligence item
84 85 86 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 84 def screenshots @screenshots end |
#sha256 ⇒ Object
The SHA256 hash for the file
87 88 89 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 87 def sha256 @sha256 end |
#site ⇒ Object
The site where the raw intelligence item was found
90 91 92 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 90 def site @site end |
#site_id ⇒ Object
The ID of the site where the raw intelligence item was found
93 94 95 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 93 def site_id @site_id end |
#size ⇒ Object
The size of the item’s content in bytes, if available
96 97 98 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 96 def size @size end |
#telegram_info ⇒ Object
Returns the value of attribute telegram_info.
98 99 100 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 98 def telegram_info @telegram_info end |
#thread_id ⇒ Object
Identifier that groups all raw intelligence items belonging to the same conversation thread
101 102 103 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 101 def thread_id @thread_id end |
#title ⇒ Object
The title of the raw intelligence item
104 105 106 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 104 def title @title end |
#type ⇒ Object
The type of the raw intelligence item
107 108 109 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 107 def type @type end |
#updated_date ⇒ Object
The date and time when the raw intelligence item was updated
110 111 112 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 110 def updated_date @updated_date end |
#url ⇒ Object
The URL of the raw intelligence item
113 114 115 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 113 def url @url end |
#user_id ⇒ Object
The raw intelligence item author identifier in the original source
116 117 118 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 116 def user_id @user_id end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
154 155 156 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 154 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 119 def self.attribute_map { :'actor_slug' => :'actor_slug', :'attachments' => :'attachments', :'author' => :'author', :'author_id' => :'author_id', :'category' => :'category', :'collection_date' => :'collection_date', :'content' => :'content', :'created_date' => :'created_date', :'file_type' => :'file_type', :'fragment_info' => :'fragment_info', :'full_content_url' => :'full_content_url', :'ioc_types' => :'ioc_types', :'iocs' => :'iocs', :'labels' => :'labels', :'language' => :'language', :'marketplace_product' => :'marketplace_product', :'mime_type' => :'mime_type', :'screenshots' => :'screenshots', :'sha256' => :'sha256', :'site' => :'site', :'site_id' => :'site_id', :'size' => :'size', :'telegram_info' => :'telegram_info', :'thread_id' => :'thread_id', :'title' => :'title', :'type' => :'type', :'updated_date' => :'updated_date', :'url' => :'url', :'user_id' => :'user_id' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
433 434 435 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 433 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
194 195 196 197 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 194 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 159 def self.openapi_types { :'actor_slug' => :'String', :'attachments' => :'Array<DomainAttachment>', :'author' => :'String', :'author_id' => :'String', :'category' => :'String', :'collection_date' => :'Time', :'content' => :'String', :'created_date' => :'Time', :'file_type' => :'String', :'fragment_info' => :'DomainFragmentInfo', :'full_content_url' => :'String', :'ioc_types' => :'Array<String>', :'iocs' => :'DomainIOC', :'labels' => :'Array<String>', :'language' => :'String', :'marketplace_product' => :'DomainMarketplaceProduct', :'mime_type' => :'String', :'screenshots' => :'Array<DomainScreenshot>', :'sha256' => :'String', :'site' => :'String', :'site_id' => :'String', :'size' => :'Integer', :'telegram_info' => :'DomainTelegramInfo', :'thread_id' => :'String', :'title' => :'String', :'type' => :'String', :'updated_date' => :'Time', :'url' => :'String', :'user_id' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
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 416 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 384 def ==(o) return true if self.equal?(o) self.class == o.class && actor_slug == o.actor_slug && == o. && == o. && == o. && category == o.category && collection_date == o.collection_date && content == o.content && created_date == o.created_date && file_type == o.file_type && fragment_info == o.fragment_info && full_content_url == o.full_content_url && ioc_types == o.ioc_types && iocs == o.iocs && labels == o.labels && language == o.language && marketplace_product == o.marketplace_product && mime_type == o.mime_type && screenshots == o.screenshots && sha256 == o.sha256 && site == o.site && site_id == o.site_id && size == o.size && telegram_info == o.telegram_info && thread_id == o.thread_id && title == o.title && type == o.type && updated_date == o.updated_date && url == o.url && user_id == o.user_id end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
464 465 466 467 468 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 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 464 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
535 536 537 538 539 540 541 542 543 544 545 546 547 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 535 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
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 440 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
420 421 422 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 420 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
426 427 428 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 426 def hash [actor_slug, , , , category, collection_date, content, created_date, file_type, fragment_info, full_content_url, ioc_types, iocs, labels, language, marketplace_product, mime_type, screenshots, sha256, site, site_id, size, telegram_info, thread_id, title, type, updated_date, url, user_id].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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_item_details_v1.rb', line 341 def list_invalid_properties invalid_properties = Array.new if @category.nil? invalid_properties.push('invalid value for "category", category cannot be nil.') end if @content.nil? invalid_properties.push('invalid value for "content", content cannot be nil.') end if @created_date.nil? invalid_properties.push('invalid value for "created_date", created_date cannot be nil.') end if @site_id.nil? invalid_properties.push('invalid value for "site_id", site_id cannot be nil.') end if @type.nil? invalid_properties.push('invalid value for "type", type 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)
511 512 513 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 511 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
517 518 519 520 521 522 523 524 525 526 527 528 529 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 517 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
505 506 507 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 505 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 |
# File 'lib/crimson-falcon/models/domain_item_details_v1.rb', line 372 def valid? return false if @category.nil? return false if @content.nil? return false if @created_date.nil? return false if @site_id.nil? return false if @type.nil? return false if @updated_date.nil? true end |