Class: Falcon::DomainBreachedItemV1
- Inherits:
-
Object
- Object
- Falcon::DomainBreachedItemV1
- Defined in:
- lib/crimson-falcon/models/domain_breached_item_v1.rb
Instance Attribute Summary collapse
-
#bot ⇒ Object
Returns the value of attribute bot.
-
#company ⇒ Object
The company of the user.
-
#credential_status ⇒ Object
The status set after deduplication.
-
#credentials_domain ⇒ Object
The domain where the credentials are valid.
-
#credentials_ip ⇒ Object
The IP where the credentials are valid.
-
#credentials_url ⇒ Object
The URL where the credentials are valid.
-
#display_name ⇒ Object
The nickname of the user on the impacted site.
-
#domain ⇒ Object
The domain associated with the breached account.
-
#email ⇒ Object
The email of the breached account.
-
#financial ⇒ Object
Returns the value of attribute financial.
-
#hash_type ⇒ Object
The original hashing algorithm applied to the breached password.
-
#job_position ⇒ Object
The user’s job at the company.
-
#location ⇒ Object
Returns the value of attribute location.
-
#login_id ⇒ Object
The username of the breached account.
-
#malware_family ⇒ Object
The stealer log bot malware family.
-
#name ⇒ Object
The name of the person associated with the breached account.
-
#password ⇒ Object
The breached password.
-
#password_hash ⇒ Object
The password hash.
-
#password_salt ⇒ Object
The password salt.
-
#phone ⇒ Object
The phone number of the person associated with the breached account.
-
#social ⇒ Object
Returns the value of attribute social.
-
#user_id ⇒ Object
The ID of the user on the impacted site.
-
#user_ip ⇒ Object
The IP of the user on the impacted site.
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 = {}) ⇒ DomainBreachedItemV1
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 = {}) ⇒ DomainBreachedItemV1
Initializes the object
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.login_id = 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. = 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
#bot ⇒ Object
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 |
#company ⇒ Object
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_status ⇒ Object
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_domain ⇒ Object
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_ip ⇒ Object
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_url ⇒ Object
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_name ⇒ Object
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 |
#domain ⇒ Object
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 |
#email ⇒ Object
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 |
#financial ⇒ Object
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_type ⇒ Object
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_position ⇒ Object
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 |
#location ⇒ Object
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_id ⇒ Object
The username of the breached account.
72 73 74 |
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 72 def login_id @login_id end |
#malware_family ⇒ Object
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 |
#name ⇒ Object
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 |
#password ⇒ Object
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_hash ⇒ Object
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_salt ⇒ Object
The password salt
87 88 89 |
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 87 def password_salt @password_salt end |
#phone ⇒ Object
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 |
#social ⇒ Object
Returns the value of attribute social.
92 93 94 |
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 92 def @social end |
#user_id ⇒ Object
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_ip ⇒ Object
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_attributes ⇒ Object
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_map ⇒ Object
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
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_nullable ⇒ Object
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_types ⇒ Object
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.
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 && login_id == o.login_id && malware_family == o.malware_family && name == o.name && password == o.password && password_hash == o.password_hash && password_salt == o.password_salt && phone == o.phone && == o. && user_id == o.user_id && user_ip == o.user_ip end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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
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
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
357 358 359 |
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 357 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
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, login_id, malware_family, name, password, password_hash, password_salt, phone, , user_id, user_ip].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
448 449 450 |
# File 'lib/crimson-falcon/models/domain_breached_item_v1.rb', line 448 def to_body to_hash end |
#to_hash ⇒ 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_s ⇒ String
Returns the string representation 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
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 |