Class: Falcon::DomainBreachedItemV1

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DomainBreachedItemV1

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#botObject

Returns the value of attribute bot.



35
36
37
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 35

def bot
  @bot
end

#companyObject

The company of the user



38
39
40
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 38

def company
  @company
end

#credential_statusObject

The status set after deduplication. Possible values: ‘newly_detected’, ‘previously_reported’, ‘other’



41
42
43
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 41

def credential_status
  @credential_status
end

#credentials_domainObject

The domain where the credentials are valid



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

def credentials_domain
  @credentials_domain
end

#credentials_ipObject

The IP where the credentials are valid



47
48
49
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 47

def credentials_ip
  @credentials_ip
end

#credentials_urlObject

The URL where the credentials are valid



50
51
52
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 50

def credentials_url
  @credentials_url
end

#display_nameObject

The nickname of the user on the impacted site



53
54
55
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 53

def display_name
  @display_name
end

#domainObject

The domain associated with the breached account.



56
57
58
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 56

def domain
  @domain
end

#emailObject

The email of the breached account.



59
60
61
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 59

def email
  @email
end

#financialObject

Returns the value of attribute financial.



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

def financial
  @financial
end

#hash_typeObject

The original hashing algorithm applied to the breached password. Possible values: ‘plain’, ‘unknown’, ‘base64’, ‘md5’, ‘sha1’, ‘bcrypt’, etc. The value ‘plain’ means that the password was originally found as plaintext.



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

def hash_type
  @hash_type
end

#job_positionObject

The user’s job at the company



67
68
69
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 67

def job_position
  @job_position
end

#locationObject

Returns the value of attribute location.



69
70
71
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 69

def location
  @location
end

#login_idObject

The username of the breached account.



72
73
74
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 72

def 
  @login_id
end

#malware_familyObject

The stealer log bot malware family



75
76
77
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 75

def malware_family
  @malware_family
end

#nameObject

The name of the person associated with the breached account.



78
79
80
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 78

def name
  @name
end

#passwordObject

The breached password. Passwords are returned as salted hashes, generated using the SHA256 algorithm and the CID as the salt.



81
82
83
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 81

def password
  @password
end

#password_hashObject

The password hash



84
85
86
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 84

def password_hash
  @password_hash
end

#password_saltObject

The password salt



87
88
89
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 87

def password_salt
  @password_salt
end

#phoneObject

The phone number of the person associated with the breached account.



90
91
92
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 90

def phone
  @phone
end

#socialObject

Returns the value of attribute social.



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

def social
  @social
end

#user_idObject

The ID of the user on the impacted site



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

def user_id
  @user_id
end

#user_ipObject

The IP of the user on the impacted site



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

def user_ip
  @user_ip
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



130
131
132
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 130

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



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

def self.attribute_map
  {
    :'bot' => :'bot',
    :'company' => :'company',
    :'credential_status' => :'credential_status',
    :'credentials_domain' => :'credentials_domain',
    :'credentials_ip' => :'credentials_ip',
    :'credentials_url' => :'credentials_url',
    :'display_name' => :'display_name',
    :'domain' => :'domain',
    :'email' => :'email',
    :'financial' => :'financial',
    :'hash_type' => :'hash_type',
    :'job_position' => :'job_position',
    :'location' => :'location',
    :'login_id' => :'login_id',
    :'malware_family' => :'malware_family',
    :'name' => :'name',
    :'password' => :'password',
    :'password_hash' => :'password_hash',
    :'password_salt' => :'password_salt',
    :'phone' => :'phone',
    :'social' => :'social',
    :'user_id' => :'user_id',
    :'user_ip' => :'user_ip'
  }
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



370
371
372
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 370

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

.openapi_nullableObject

List of attributes with nullable: true



164
165
166
167
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 164

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

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'bot' => :'DomainExposedDataRecordBotV1',
    :'company' => :'String',
    :'credential_status' => :'String',
    :'credentials_domain' => :'String',
    :'credentials_ip' => :'String',
    :'credentials_url' => :'String',
    :'display_name' => :'String',
    :'domain' => :'String',
    :'email' => :'String',
    :'financial' => :'DomainExposedDataRecordFinancialV1',
    :'hash_type' => :'String',
    :'job_position' => :'String',
    :'location' => :'DomainExposedDataRecordLocationV1',
    :'login_id' => :'String',
    :'malware_family' => :'String',
    :'name' => :'String',
    :'password' => :'String',
    :'password_hash' => :'String',
    :'password_salt' => :'String',
    :'phone' => :'String',
    :'social' => :'DomainExposedDataRecordSocialV1',
    :'user_id' => :'String',
    :'user_ip' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      bot == o.bot &&
      company == o.company &&
      credential_status == o.credential_status &&
      credentials_domain == o.credentials_domain &&
      credentials_ip == o.credentials_ip &&
      credentials_url == o.credentials_url &&
      display_name == o.display_name &&
      domain == o.domain &&
      email == o.email &&
      financial == o.financial &&
      hash_type == o.hash_type &&
      job_position == o.job_position &&
      location == o.location &&
       == o. &&
      malware_family == o.malware_family &&
      name == o.name &&
      password == o.password &&
      password_hash == o.password_hash &&
      password_salt == o.password_salt &&
      phone == o.phone &&
      social == o.social &&
      user_id == o.user_id &&
      user_ip == o.user_ip
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



401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 401

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



472
473
474
475
476
477
478
479
480
481
482
483
484
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 472

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



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_breached_item_v1.rb', line 377

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


357
358
359
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 357

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



363
364
365
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 363

def hash
  [bot, company, credential_status, credentials_domain, credentials_ip, credentials_url, display_name, domain, email, financial, hash_type, job_position, location, , malware_family, name, password, password_hash, password_salt, phone, social, user_id, user_ip].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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

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

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

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

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

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

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

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



448
449
450
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 448

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



454
455
456
457
458
459
460
461
462
463
464
465
466
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 454

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



442
443
444
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 442

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



314
315
316
317
318
319
320
321
322
323
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 314

def valid?
  return false if @domain.nil?
  return false if @email.nil?
  return false if @hash_type.nil?
  return false if @login_id.nil?
  return false if @name.nil?
  return false if @password.nil?
  return false if @phone.nil?
  true
end