Class: SwaggerClient::Asset
- Inherits:
-
Object
- Object
- SwaggerClient::Asset
- Defined in:
- lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#addresses ⇒ Object
All addresses discovered on the asset.
-
#assessed_for_policies ⇒ Object
Whether the asset has been assessed for policies at least once.
-
#assessed_for_vulnerabilities ⇒ Object
Whether the asset has been assessed for vulnerabilities at least once.
-
#configurations ⇒ Object
Configuration key-values pairs enumerated on the asset.
-
#databases ⇒ Object
The databases enumerated on the asset.
-
#files ⇒ Object
The files discovered with searching on the asset.
-
#history ⇒ Object
The history of changes to the asset over time.
-
#host_name ⇒ Object
The primary host name (local or FQDN) of the asset.
-
#host_names ⇒ Object
All host names or aliases discovered on the asset.
-
#id ⇒ Object
The identifier of the asset.
-
#ids ⇒ Object
Unique identifiers found on the asset, such as hardware or operating system identifiers.
-
#ip ⇒ Object
The primary IPv4 or IPv6 address of the asset.
-
#links ⇒ Object
Hypermedia links to corresponding or related resources.
-
#mac ⇒ Object
The primary Media Access Control (MAC) address of the asset.
-
#os ⇒ Object
The full description of the operating system of the asset.
-
#os_certainty ⇒ Object
$assetasset.osasset.os.certainty.
-
#os_fingerprint ⇒ Object
Returns the value of attribute os_fingerprint.
-
#raw_risk_score ⇒ Object
The base risk score of the asset.
-
#risk_score ⇒ Object
The risk score (with criticality adjustments) of the asset.
-
#services ⇒ Object
The services discovered on the asset.
-
#software ⇒ Object
The software discovered on the asset.
-
#type ⇒ Object
The type of asset.
-
#user_groups ⇒ Object
The group accounts enumerated on the asset.
-
#users ⇒ Object
The user accounts enumerated on the asset.
-
#vulnerabilities ⇒ Object
Returns the value of attribute vulnerabilities.
Class Method Summary collapse
-
.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 = {}) ⇒ Asset
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 = {}) ⇒ Asset
Initializes the object
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 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 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 181 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `SwaggerClient::Asset` 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 `SwaggerClient::Asset`. 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?(:'addresses') if (value = attributes[:'addresses']).is_a?(Array) self.addresses = value end end if attributes.key?(:'assessed_for_policies') self.assessed_for_policies = attributes[:'assessed_for_policies'] end if attributes.key?(:'assessed_for_vulnerabilities') self.assessed_for_vulnerabilities = attributes[:'assessed_for_vulnerabilities'] end if attributes.key?(:'configurations') if (value = attributes[:'configurations']).is_a?(Array) self.configurations = value end end if attributes.key?(:'databases') if (value = attributes[:'databases']).is_a?(Array) self.databases = value end end if attributes.key?(:'files') if (value = attributes[:'files']).is_a?(Array) self.files = value end end if attributes.key?(:'history') if (value = attributes[:'history']).is_a?(Array) self.history = value end end if attributes.key?(:'host_name') self.host_name = attributes[:'host_name'] end if attributes.key?(:'host_names') if (value = attributes[:'host_names']).is_a?(Array) self.host_names = value end end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'ids') if (value = attributes[:'ids']).is_a?(Array) self.ids = value end end if attributes.key?(:'ip') self.ip = attributes[:'ip'] end if attributes.key?(:'links') if (value = attributes[:'links']).is_a?(Array) self.links = value end end if attributes.key?(:'mac') self.mac = attributes[:'mac'] end if attributes.key?(:'os') self.os = attributes[:'os'] end if attributes.key?(:'os_certainty') self.os_certainty = attributes[:'os_certainty'] end if attributes.key?(:'os_fingerprint') self.os_fingerprint = attributes[:'os_fingerprint'] end if attributes.key?(:'raw_risk_score') self.raw_risk_score = attributes[:'raw_risk_score'] end if attributes.key?(:'risk_score') self.risk_score = attributes[:'risk_score'] end if attributes.key?(:'services') if (value = attributes[:'services']).is_a?(Array) self.services = value end end if attributes.key?(:'software') if (value = attributes[:'software']).is_a?(Array) self.software = value end end if attributes.key?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'user_groups') if (value = attributes[:'user_groups']).is_a?(Array) self.user_groups = value end end if attributes.key?(:'users') if (value = attributes[:'users']).is_a?(Array) self.users = value end end if attributes.key?(:'vulnerabilities') self.vulnerabilities = attributes[:'vulnerabilities'] end end |
Instance Attribute Details
#addresses ⇒ Object
All addresses discovered on the asset.
17 18 19 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 17 def addresses @addresses end |
#assessed_for_policies ⇒ Object
Whether the asset has been assessed for policies at least once.
20 21 22 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 20 def assessed_for_policies @assessed_for_policies end |
#assessed_for_vulnerabilities ⇒ Object
Whether the asset has been assessed for vulnerabilities at least once.
23 24 25 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 23 def assessed_for_vulnerabilities @assessed_for_vulnerabilities end |
#configurations ⇒ Object
Configuration key-values pairs enumerated on the asset.
26 27 28 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 26 def configurations @configurations end |
#databases ⇒ Object
The databases enumerated on the asset.
29 30 31 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 29 def databases @databases end |
#files ⇒ Object
The files discovered with searching on the asset.
32 33 34 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 32 def files @files end |
#history ⇒ Object
The history of changes to the asset over time.
35 36 37 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 35 def history @history end |
#host_name ⇒ Object
The primary host name (local or FQDN) of the asset.
38 39 40 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 38 def host_name @host_name end |
#host_names ⇒ Object
All host names or aliases discovered on the asset.
41 42 43 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 41 def host_names @host_names end |
#id ⇒ Object
The identifier of the asset.
44 45 46 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 44 def id @id end |
#ids ⇒ Object
Unique identifiers found on the asset, such as hardware or operating system identifiers.
47 48 49 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 47 def ids @ids end |
#ip ⇒ Object
The primary IPv4 or IPv6 address of the asset.
50 51 52 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 50 def ip @ip end |
#links ⇒ Object
Hypermedia links to corresponding or related resources.
53 54 55 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 53 def links @links end |
#mac ⇒ Object
The primary Media Access Control (MAC) address of the asset. The format is six groups of two hexadecimal digits separated by colons.
56 57 58 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 56 def mac @mac end |
#os ⇒ Object
The full description of the operating system of the asset.
59 60 61 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 59 def os @os end |
#os_certainty ⇒ Object
$SwaggerClient::Asset.assetasset.osasset.os.certainty
62 63 64 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 62 def os_certainty @os_certainty end |
#os_fingerprint ⇒ Object
Returns the value of attribute os_fingerprint.
64 65 66 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 64 def os_fingerprint @os_fingerprint end |
#raw_risk_score ⇒ Object
The base risk score of the asset.
67 68 69 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 67 def raw_risk_score @raw_risk_score end |
#risk_score ⇒ Object
The risk score (with criticality adjustments) of the asset.
70 71 72 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 70 def risk_score @risk_score end |
#services ⇒ Object
The services discovered on the asset.
73 74 75 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 73 def services @services end |
#software ⇒ Object
The software discovered on the asset.
76 77 78 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 76 def software @software end |
#type ⇒ Object
The type of asset.
79 80 81 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 79 def type @type end |
#user_groups ⇒ Object
The group accounts enumerated on the asset.
82 83 84 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 82 def user_groups @user_groups end |
#users ⇒ Object
The user accounts enumerated on the asset.
85 86 87 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 85 def users @users end |
#vulnerabilities ⇒ Object
Returns the value of attribute vulnerabilities.
87 88 89 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 87 def vulnerabilities @vulnerabilities end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 112 def self.attribute_map { :'addresses' => :'addresses', :'assessed_for_policies' => :'assessedForPolicies', :'assessed_for_vulnerabilities' => :'assessedForVulnerabilities', :'configurations' => :'configurations', :'databases' => :'databases', :'files' => :'files', :'history' => :'history', :'host_name' => :'hostName', :'host_names' => :'hostNames', :'id' => :'id', :'ids' => :'ids', :'ip' => :'ip', :'links' => :'links', :'mac' => :'mac', :'os' => :'os', :'os_certainty' => :'osCertainty', :'os_fingerprint' => :'osFingerprint', :'raw_risk_score' => :'rawRiskScore', :'risk_score' => :'riskScore', :'services' => :'services', :'software' => :'software', :'type' => :'type', :'user_groups' => :'userGroups', :'users' => :'users', :'vulnerabilities' => :'vulnerabilities' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
391 392 393 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 391 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
174 175 176 177 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 174 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 143 def self.openapi_types { :'addresses' => :'Object', :'assessed_for_policies' => :'Object', :'assessed_for_vulnerabilities' => :'Object', :'configurations' => :'Object', :'databases' => :'Object', :'files' => :'Object', :'history' => :'Object', :'host_name' => :'Object', :'host_names' => :'Object', :'id' => :'Object', :'ids' => :'Object', :'ip' => :'Object', :'links' => :'Object', :'mac' => :'Object', :'os' => :'Object', :'os_certainty' => :'Object', :'os_fingerprint' => :'Object', :'raw_risk_score' => :'Object', :'risk_score' => :'Object', :'services' => :'Object', :'software' => :'Object', :'type' => :'Object', :'user_groups' => :'Object', :'users' => :'Object', :'vulnerabilities' => :'Object' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
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 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 346 def ==(o) return true if self.equal?(o) self.class == o.class && addresses == o.addresses && assessed_for_policies == o.assessed_for_policies && assessed_for_vulnerabilities == o.assessed_for_vulnerabilities && configurations == o.configurations && databases == o.databases && files == o.files && history == o.history && host_name == o.host_name && host_names == o.host_names && id == o.id && ids == o.ids && ip == o.ip && links == o.links && mac == o.mac && os == o.os && os_certainty == o.os_certainty && os_fingerprint == o.os_fingerprint && raw_risk_score == o.raw_risk_score && risk_score == o.risk_score && services == o.services && software == o.software && type == o.type && user_groups == o.user_groups && users == o.users && vulnerabilities == o.vulnerabilities end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 452 453 454 455 456 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 421 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.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 SwaggerClient.const_get(type).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
490 491 492 493 494 495 496 497 498 499 500 501 502 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 490 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
398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 398 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| if 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]])) elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) end end self end |
#eql?(o) ⇒ Boolean
378 379 380 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 378 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
384 385 386 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 384 def hash [addresses, assessed_for_policies, assessed_for_vulnerabilities, configurations, databases, files, history, host_name, host_names, id, ids, ip, links, mac, os, os_certainty, os_fingerprint, raw_risk_score, risk_score, services, software, type, user_groups, users, vulnerabilities].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
321 322 323 324 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 321 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
466 467 468 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 466 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
472 473 474 475 476 477 478 479 480 481 482 483 484 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 472 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
460 461 462 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 460 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
328 329 330 331 332 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/asset.rb', line 328 def valid? type_validator = EnumAttributeValidator.new('Object', ['unknown', 'guest', 'hypervisor', 'physical', 'mobile']) return false unless type_validator.valid?(@type) true end |