Class: Falcon::DomainNotificationV1

Inherits:
Object
  • Object
show all
Defined in:
lib/crimson-falcon/models/domain_notification_v1.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DomainNotificationV1

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 200

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.item_author = attributes[:'item_author']
  end

  if attributes.key?(:'item_author_id')
    self.item_author_id = 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_creator_name')
    self.rule_creator_name = attributes[:'rule_creator_name']
  end

  if attributes.key?(:'rule_creator_uid')
    self.rule_creator_uid = attributes[:'rule_creator_uid']
  end

  if attributes.key?(:'rule_creator_uuid')
    self.rule_creator_uuid = attributes[:'rule_creator_uuid']
  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_slugObject

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_uidObject

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_usernameObject

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_uuidObject

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_summaryObject

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

#cidObject

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_dateObject

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

#highlightsObject

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

#idObject

The ID of the notification



57
58
59
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 57

def id
  @id
end

#item_authorObject

The author who posted the intelligence item



60
61
62
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 60

def item_author
  @item_author
end

#item_author_idObject

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
  @item_author_id
end

#item_dateObject

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_idObject

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_siteObject

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_idObject

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_typeObject

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

#logsObject

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_idObject

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_creator_nameObject

The name of the user who created the rule



86
87
88
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 86

def rule_creator_name
  @rule_creator_name
end

#rule_creator_uidObject

The user ID of the user who created the rule



89
90
91
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 89

def rule_creator_uid
  @rule_creator_uid
end

#rule_creator_uuidObject

The unique UUID of the user who created the rule



92
93
94
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 92

def rule_creator_uuid
  @rule_creator_uuid
end

#rule_idObject

The ID of the rule that generated this notification



95
96
97
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 95

def rule_id
  @rule_id
end

#rule_nameObject

The name of the rule that generated this notification



98
99
100
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 98

def rule_name
  @rule_name
end

#rule_priorityObject

The priority of the rule that generated this notification



101
102
103
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 101

def rule_priority
  @rule_priority
end

#rule_topicObject

The topic of the rule that generated this notification



104
105
106
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 104

def rule_topic
  @rule_topic
end

#source_categoryObject

Category of the source that generated the notification



107
108
109
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 107

def source_category
  @source_category
end

#statusObject

The notification status. This can be one of: ‘new`, `in-progress`, `closed-false-positive`, `closed-true-positive`.



110
111
112
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 110

def status
  @status
end

#typosquattingObject

Returns the value of attribute typosquatting.



112
113
114
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 112

def typosquatting
  @typosquatting
end

#updated_dateObject

The date when the notification was updated



115
116
117
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 115

def updated_date
  @updated_date
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



153
154
155
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 153

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



118
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
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 118

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_creator_name' => :'rule_creator_name',
    :'rule_creator_uid' => :'rule_creator_uid',
    :'rule_creator_uuid' => :'rule_creator_uuid',
    :'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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



468
469
470
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 468

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



193
194
195
196
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 193

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 158

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_creator_name' => :'String',
    :'rule_creator_uid' => :'String',
    :'rule_creator_uuid' => :'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.

Parameters:

  • Object (Object)

    to be compared



419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 419

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 &&
      item_author == o.item_author &&
      item_author_id == o.item_author_id &&
      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_creator_name == o.rule_creator_name &&
      rule_creator_uid == o.rule_creator_uid &&
      rule_creator_uuid == o.rule_creator_uuid &&
      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

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 499

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

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



570
571
572
573
574
575
576
577
578
579
580
581
582
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 570

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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 475

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

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


455
456
457
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 455

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



461
462
463
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 461

def hash
  [actor_slug, assigned_to_uid, assigned_to_username, assigned_to_uuid, breach_summary, cid, created_date, highlights, id, item_author, item_author_id, item_date, item_id, item_site, item_site_id, item_type, logs, raw_intel_id, rule_creator_name, rule_creator_uid, rule_creator_uuid, rule_id, rule_name, rule_priority, rule_topic, source_category, status, typosquatting, updated_date].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 336

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_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



546
547
548
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 546

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



552
553
554
555
556
557
558
559
560
561
562
563
564
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 552

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



540
541
542
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 540

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/crimson-falcon/models/domain_notification_v1.rb', line 399

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