Class: Falcon::DomainMatchedBreachSummaryV1

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DomainMatchedBreachSummaryV1

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
171
172
173
174
175
176
177
178
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
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 141

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::DomainMatchedBreachSummaryV1` 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::DomainMatchedBreachSummaryV1`. 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?(:'community_name')
    self.community_name = attributes[:'community_name']
  end

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

  if attributes.key?(:'credential_statuses')
    if (value = attributes[:'credential_statuses']).is_a?(Array)
      self.credential_statuses = value
    end
  end

  if attributes.key?(:'credentials_domains')
    if (value = attributes[:'credentials_domains']).is_a?(Array)
      self.credentials_domains = value
    end
  end

  if attributes.key?(:'credentials_ips')
    if (value = attributes[:'credentials_ips']).is_a?(Array)
      self.credentials_ips = value
    end
  end

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

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

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

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

  if attributes.key?(:'fields')
    if (value = attributes[:'fields']).is_a?(Array)
      self.fields = value
    end
  end

  if attributes.key?(:'files')
    if (value = attributes[:'files']).is_a?(Array)
      self.files = value
    end
  end

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

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

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

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

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

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

Instance Attribute Details

#community_nameObject

Community/colloquial exposed data event name.



36
37
38
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 36

def community_name
  @community_name
end

#confidence_levelObject

The level of confidence regarding data veridicality. Options for likely authentic, confirmed authentic (default: unverified).



39
40
41
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 39

def confidence_level
  @confidence_level
end

#credential_statusesObject

A list of statuses for the exposed data records contained in the notification. Possible values: ‘newly_detected’, ‘previously_reported’ and/or ‘other’



42
43
44
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 42

def credential_statuses
  @credential_statuses
end

#credentials_domainsObject

Returns the value of attribute credentials_domains.



44
45
46
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 44

def credentials_domains
  @credentials_domains
end

#credentials_ipsObject

Returns the value of attribute credentials_ips.



46
47
48
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 46

def credentials_ips
  @credentials_ips
end

#descriptionObject

The description of the breach



49
50
51
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 49

def description
  @description
end

#event_dateObject

The date the exposed data event occurred.



52
53
54
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 52

def event_date
  @event_date
end

#event_idObject

CrowdStrike-generated unique exposed data event identifier.



55
56
57
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 55

def event_id
  @event_id
end

#exposure_dateObject

The date when the data was leaked online



58
59
60
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 58

def exposure_date
  @exposure_date
end

#fieldsObject

The set of fields which were breached: ‘email’, ‘password’, ‘login_id’, ‘phone’, etc.



61
62
63
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 61

def fields
  @fields
end

#filesObject

Metadata regarding the file(s) where exposed data records where found.



64
65
66
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 64

def files
  @files
end

#idp_send_dateObject

Returns the value of attribute idp_send_date.



66
67
68
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 66

def idp_send_date
  @idp_send_date
end

#idp_send_statusObject

Returns the value of attribute idp_send_status.



68
69
70
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 68

def idp_send_status
  @idp_send_status
end

#is_retroactively_dedupedObject

(Boolean) If the notification was processed before the introduction of exposed data deduplication



71
72
73
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 71

def is_retroactively_deduped
  @is_retroactively_deduped
end

#nameObject

The name of the breach



74
75
76
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 74

def name
  @name
end

#obtained_byObject

Exposed Data Event Threat Actor/Group: Moniker(s) or real name(s) of the individual/group who unveiled confidential data.



77
78
79
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 77

def obtained_by
  @obtained_by
end

#urlObject

Where the leak was found.



80
81
82
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 80

def url
  @url
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



106
107
108
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 106

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 83

def self.attribute_map
  {
    :'community_name' => :'community_name',
    :'confidence_level' => :'confidence_level',
    :'credential_statuses' => :'credential_statuses',
    :'credentials_domains' => :'credentials_domains',
    :'credentials_ips' => :'credentials_ips',
    :'description' => :'description',
    :'event_date' => :'event_date',
    :'event_id' => :'event_id',
    :'exposure_date' => :'exposure_date',
    :'fields' => :'fields',
    :'files' => :'files',
    :'idp_send_date' => :'idp_send_date',
    :'idp_send_status' => :'idp_send_status',
    :'is_retroactively_deduped' => :'is_retroactively_deduped',
    :'name' => :'name',
    :'obtained_by' => :'obtained_by',
    :'url' => :'url'
  }
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



305
306
307
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 305

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

.openapi_nullableObject

List of attributes with nullable: true



134
135
136
137
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 134

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

.openapi_typesObject

Attribute type mapping.



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 111

def self.openapi_types
  {
    :'community_name' => :'String',
    :'confidence_level' => :'String',
    :'credential_statuses' => :'Array<String>',
    :'credentials_domains' => :'Array<String>',
    :'credentials_ips' => :'Array<String>',
    :'description' => :'String',
    :'event_date' => :'String',
    :'event_id' => :'String',
    :'exposure_date' => :'Time',
    :'fields' => :'Array<String>',
    :'files' => :'Array<DomainFileDetailsV1>',
    :'idp_send_date' => :'Time',
    :'idp_send_status' => :'String',
    :'is_retroactively_deduped' => :'Boolean',
    :'name' => :'String',
    :'obtained_by' => :'String',
    :'url' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 268

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      community_name == o.community_name &&
      confidence_level == o.confidence_level &&
      credential_statuses == o.credential_statuses &&
      credentials_domains == o.credentials_domains &&
      credentials_ips == o.credentials_ips &&
      description == o.description &&
      event_date == o.event_date &&
      event_id == o.event_id &&
      exposure_date == o.exposure_date &&
      fields == o.fields &&
      files == o.files &&
      idp_send_date == o.idp_send_date &&
      idp_send_status == o.idp_send_status &&
      is_retroactively_deduped == o.is_retroactively_deduped &&
      name == o.name &&
      obtained_by == o.obtained_by &&
      url == o.url
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



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

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



407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 407

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



312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 312

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


292
293
294
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 292

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



298
299
300
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 298

def hash
  [community_name, confidence_level, credential_statuses, credentials_domains, credentials_ips, description, event_date, event_id, exposure_date, fields, files, idp_send_date, idp_send_status, is_retroactively_deduped, name, obtained_by, url].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 235

def list_invalid_properties
  invalid_properties = Array.new
  if @description.nil?
    invalid_properties.push('invalid value for "description", description cannot be nil.')
  end

  if @fields.nil?
    invalid_properties.push('invalid value for "fields", fields cannot be nil.')
  end

  if @is_retroactively_deduped.nil?
    invalid_properties.push('invalid value for "is_retroactively_deduped", is_retroactively_deduped cannot be nil.')
  end

  if @name.nil?
    invalid_properties.push('invalid value for "name", name 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



383
384
385
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 383

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



389
390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 389

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



377
378
379
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 377

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



258
259
260
261
262
263
264
# File 'lib/crimson-falcon/models/domain_matched_breach_summary_v1.rb', line 258

def valid?
  return false if @description.nil?
  return false if @fields.nil?
  return false if @is_retroactively_deduped.nil?
  return false if @name.nil?
  true
end