Class: Falcon::DomainFemExternalAsset
- Inherits:
-
Object
- Object
- Falcon::DomainFemExternalAsset
- Defined in:
- lib/crimson-falcon/models/domain_fem_external_asset.rb
Instance Attribute Summary collapse
-
#applicable_actions ⇒ Object
Lists the user actions can be taken on this asset (triage, delete, etc).
-
#asset_type ⇒ Object
The type of external asset (ip, dns_domain).
-
#cid ⇒ Object
The customer ID.
-
#confidence ⇒ Object
Confidence level for the asset association to the organization.
-
#criticality ⇒ Object
The criticality level of the asset (Critical, High, Noncritical, or Unassigned).
-
#criticality_description ⇒ Object
The description the user entered when manually assigning a criticality level.
-
#criticality_timestamp ⇒ Object
The date and time the criticality level was manually assigned.
-
#criticality_username ⇒ Object
The username of the account that manually assigned the criticality level.
-
#data_providers ⇒ Object
A list of the source providers for the asset information.
-
#discovered_by ⇒ Object
The identifier of the asset.
-
#discovery ⇒ Object
Returns the value of attribute discovery.
-
#dns_domain ⇒ Object
Returns the value of attribute dns_domain.
-
#entity_type ⇒ Object
this is similar with the entity_type field from DiscoverAPIHost; it will be always ‘external’ and it aligns this structure with other assets structures, making UI handling of assets more generic.
-
#first_seen ⇒ Object
The first time this asset has been observed as externally exposed.
-
#id ⇒ Object
The unique external asset identifier.
-
#internet_exposure ⇒ Object
The internet exposure status of the asset.
-
#ip ⇒ Object
Returns the value of attribute ip.
-
#last_seen ⇒ Object
The last time this asset has been observed as externally exposed.
-
#manual ⇒ Object
Flag indicating if the asset has been manually added.
-
#perimeter ⇒ Object
Perimeter of this asset (Official/Unofficial).
-
#status ⇒ Object
The availability status for the asset.
-
#subsidiaries ⇒ Object
List of subsidiaries that the asset belongs to.
-
#triage ⇒ Object
Returns the value of attribute triage.
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 = {}) ⇒ DomainFemExternalAsset
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 = {}) ⇒ DomainFemExternalAsset
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 276 277 278 279 280 281 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 171 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::DomainFemExternalAsset` 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::DomainFemExternalAsset`. 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?(:'applicable_actions') if (value = attributes[:'applicable_actions']).is_a?(Array) self.applicable_actions = value end end if attributes.key?(:'asset_type') self.asset_type = attributes[:'asset_type'] end if attributes.key?(:'cid') self.cid = attributes[:'cid'] end if attributes.key?(:'confidence') self.confidence = attributes[:'confidence'] end if attributes.key?(:'criticality') self.criticality = attributes[:'criticality'] end if attributes.key?(:'criticality_description') self.criticality_description = attributes[:'criticality_description'] end if attributes.key?(:'criticality_timestamp') self. = attributes[:'criticality_timestamp'] end if attributes.key?(:'criticality_username') self.criticality_username = attributes[:'criticality_username'] end if attributes.key?(:'data_providers') if (value = attributes[:'data_providers']).is_a?(Array) self.data_providers = value end end if attributes.key?(:'discovered_by') self.discovered_by = attributes[:'discovered_by'] end if attributes.key?(:'discovery') self.discovery = attributes[:'discovery'] end if attributes.key?(:'dns_domain') self.dns_domain = attributes[:'dns_domain'] end if attributes.key?(:'entity_type') self.entity_type = attributes[:'entity_type'] end if attributes.key?(:'first_seen') self.first_seen = attributes[:'first_seen'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'internet_exposure') self.internet_exposure = attributes[:'internet_exposure'] end if attributes.key?(:'ip') self.ip = attributes[:'ip'] end if attributes.key?(:'last_seen') self.last_seen = attributes[:'last_seen'] end if attributes.key?(:'manual') self.manual = attributes[:'manual'] end if attributes.key?(:'perimeter') self.perimeter = attributes[:'perimeter'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'subsidiaries') if (value = attributes[:'subsidiaries']).is_a?(Array) self.subsidiaries = value end end if attributes.key?(:'triage') self.triage = attributes[:'triage'] end end |
Instance Attribute Details
#applicable_actions ⇒ Object
Lists the user actions can be taken on this asset (triage, delete, etc)
36 37 38 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 36 def applicable_actions @applicable_actions end |
#asset_type ⇒ Object
The type of external asset (ip, dns_domain)
39 40 41 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 39 def asset_type @asset_type end |
#cid ⇒ Object
The customer ID
42 43 44 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 42 def cid @cid end |
#confidence ⇒ Object
Confidence level for the asset association to the organization
45 46 47 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 45 def confidence @confidence end |
#criticality ⇒ Object
The criticality level of the asset (Critical, High, Noncritical, or Unassigned)
48 49 50 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 48 def criticality @criticality end |
#criticality_description ⇒ Object
The description the user entered when manually assigning a criticality level
51 52 53 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 51 def criticality_description @criticality_description end |
#criticality_timestamp ⇒ Object
The date and time the criticality level was manually assigned
54 55 56 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 54 def end |
#criticality_username ⇒ Object
The username of the account that manually assigned the criticality level
57 58 59 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 57 def criticality_username @criticality_username end |
#data_providers ⇒ Object
A list of the source providers for the asset information
60 61 62 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 60 def data_providers @data_providers end |
#discovered_by ⇒ Object
The identifier of the asset
63 64 65 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 63 def discovered_by @discovered_by end |
#discovery ⇒ Object
Returns the value of attribute discovery.
65 66 67 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 65 def discovery @discovery end |
#dns_domain ⇒ Object
Returns the value of attribute dns_domain.
67 68 69 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 67 def dns_domain @dns_domain end |
#entity_type ⇒ Object
this is similar with the entity_type field from DiscoverAPIHost; it will be always ‘external’ and it aligns this structure with other assets structures, making UI handling of assets more generic
70 71 72 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 70 def entity_type @entity_type end |
#first_seen ⇒ Object
The first time this asset has been observed as externally exposed
73 74 75 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 73 def first_seen @first_seen end |
#id ⇒ Object
The unique external asset identifier
76 77 78 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 76 def id @id end |
#internet_exposure ⇒ Object
The internet exposure status of the asset
79 80 81 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 79 def internet_exposure @internet_exposure end |
#ip ⇒ Object
Returns the value of attribute ip.
81 82 83 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 81 def ip @ip end |
#last_seen ⇒ Object
The last time this asset has been observed as externally exposed
84 85 86 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 84 def last_seen @last_seen end |
#manual ⇒ Object
Flag indicating if the asset has been manually added
87 88 89 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 87 def manual @manual end |
#perimeter ⇒ Object
Perimeter of this asset (Official/Unofficial)
90 91 92 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 90 def perimeter @perimeter end |
#status ⇒ Object
The availability status for the asset
93 94 95 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 93 def status @status end |
#subsidiaries ⇒ Object
List of subsidiaries that the asset belongs to
96 97 98 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 96 def subsidiaries @subsidiaries end |
#triage ⇒ Object
Returns the value of attribute triage.
98 99 100 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 98 def triage @triage 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_fem_external_asset.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_fem_external_asset.rb', line 101 def self.attribute_map { :'applicable_actions' => :'applicable_actions', :'asset_type' => :'asset_type', :'cid' => :'cid', :'confidence' => :'confidence', :'criticality' => :'criticality', :'criticality_description' => :'criticality_description', :'criticality_timestamp' => :'criticality_timestamp', :'criticality_username' => :'criticality_username', :'data_providers' => :'data_providers', :'discovered_by' => :'discovered_by', :'discovery' => :'discovery', :'dns_domain' => :'dns_domain', :'entity_type' => :'entity_type', :'first_seen' => :'first_seen', :'id' => :'id', :'internet_exposure' => :'internet_exposure', :'ip' => :'ip', :'last_seen' => :'last_seen', :'manual' => :'manual', :'perimeter' => :'perimeter', :'status' => :'status', :'subsidiaries' => :'subsidiaries', :'triage' => :'triage' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
381 382 383 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 381 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_fem_external_asset.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_fem_external_asset.rb', line 135 def self.openapi_types { :'applicable_actions' => :'Array<String>', :'asset_type' => :'String', :'cid' => :'String', :'confidence' => :'Integer', :'criticality' => :'String', :'criticality_description' => :'String', :'criticality_timestamp' => :'String', :'criticality_username' => :'String', :'data_providers' => :'Array<String>', :'discovered_by' => :'String', :'discovery' => :'DomainExternalAssetDiscoveryAttributes', :'dns_domain' => :'DomainFemDNSDomain', :'entity_type' => :'String', :'first_seen' => :'String', :'id' => :'String', :'internet_exposure' => :'String', :'ip' => :'DomainFemExternalIP', :'last_seen' => :'String', :'manual' => :'Boolean', :'perimeter' => :'String', :'status' => :'String', :'subsidiaries' => :'Array<DomainExternalAssetSubsidiary>', :'triage' => :'DomainExternalAssetsAPITriage' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
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 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 338 def ==(o) return true if self.equal?(o) self.class == o.class && applicable_actions == o.applicable_actions && asset_type == o.asset_type && cid == o.cid && confidence == o.confidence && criticality == o.criticality && criticality_description == o.criticality_description && == o. && criticality_username == o.criticality_username && data_providers == o.data_providers && discovered_by == o.discovered_by && discovery == o.discovery && dns_domain == o.dns_domain && entity_type == o.entity_type && first_seen == o.first_seen && id == o.id && internet_exposure == o.internet_exposure && ip == o.ip && last_seen == o.last_seen && manual == o.manual && perimeter == o.perimeter && status == o.status && subsidiaries == o.subsidiaries && triage == o.triage end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 439 440 441 442 443 444 445 446 447 448 449 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 412 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
483 484 485 486 487 488 489 490 491 492 493 494 495 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 483 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
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 388 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
368 369 370 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 368 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
374 375 376 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 374 def hash [applicable_actions, asset_type, cid, confidence, criticality, criticality_description, , criticality_username, data_providers, discovered_by, discovery, dns_domain, entity_type, first_seen, id, internet_exposure, ip, last_seen, manual, perimeter, status, subsidiaries, triage].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 285 def list_invalid_properties invalid_properties = Array.new if @applicable_actions.nil? invalid_properties.push('invalid value for "applicable_actions", applicable_actions cannot be nil.') end if @asset_type.nil? invalid_properties.push('invalid value for "asset_type", asset_type cannot be nil.') end if @cid.nil? invalid_properties.push('invalid value for "cid", cid cannot be nil.') end if @confidence.nil? invalid_properties.push('invalid value for "confidence", confidence cannot be nil.') end if @data_providers.nil? invalid_properties.push('invalid value for "data_providers", data_providers cannot be nil.') end if @entity_type.nil? invalid_properties.push('invalid value for "entity_type", entity_type cannot be nil.') end if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
459 460 461 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 459 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
465 466 467 468 469 470 471 472 473 474 475 476 477 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 465 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
453 454 455 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 453 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
324 325 326 327 328 329 330 331 332 333 334 |
# File 'lib/crimson-falcon/models/domain_fem_external_asset.rb', line 324 def valid? return false if @applicable_actions.nil? return false if @asset_type.nil? return false if @cid.nil? return false if @confidence.nil? return false if @data_providers.nil? return false if @entity_type.nil? return false if @id.nil? return false if @status.nil? true end |