Class: IntersightClient::ComputeRackUnit
- Inherits:
-
ComputePhysical
- Object
- MoBaseMo
- InventoryBase
- EquipmentBase
- ComputePhysical
- IntersightClient::ComputeRackUnit
- Defined in:
- lib/intersight_client/models/compute_rack_unit.rb
Overview
Describes a standalone or FI-attached Rack-mounted server.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#adapters ⇒ Object
An array of relationships to adapterUnit resources.
-
#bios_bootmode ⇒ Object
Returns the value of attribute bios_bootmode.
-
#bios_token_settings ⇒ Object
Returns the value of attribute bios_token_settings.
-
#bios_vf_select_memory_ras_configuration ⇒ Object
Returns the value of attribute bios_vf_select_memory_ras_configuration.
-
#biosunits ⇒ Object
An array of relationships to biosUnit resources.
-
#bmc ⇒ Object
Returns the value of attribute bmc.
-
#board ⇒ Object
Returns the value of attribute board.
-
#boot_device_bootmode ⇒ Object
Returns the value of attribute boot_device_bootmode.
-
#class_id ⇒ Object
The fully-qualified name of the instantiated, concrete type.
-
#connection_status ⇒ Object
Connectivity Status of RackUnit to Switch - A or B or AB.
-
#fanmodules ⇒ Object
An array of relationships to equipmentFanModule resources.
-
#generic_inventory_holders ⇒ Object
An array of relationships to inventoryGenericInventoryHolder resources.
-
#graphics_cards ⇒ Object
An array of relationships to graphicsCard resources.
-
#inventory_device_info ⇒ Object
Returns the value of attribute inventory_device_info.
-
#locator_led ⇒ Object
Returns the value of attribute locator_led.
-
#memory_arrays ⇒ Object
An array of relationships to memoryArray resources.
-
#object_type ⇒ Object
The fully-qualified name of the instantiated, concrete type.
-
#pci_devices ⇒ Object
An array of relationships to pciDevice resources.
-
#processors ⇒ Object
An array of relationships to processorUnit resources.
-
#psus ⇒ Object
An array of relationships to equipmentPsu resources.
-
#rack_enclosure_slot ⇒ Object
Returns the value of attribute rack_enclosure_slot.
-
#registered_device ⇒ Object
Returns the value of attribute registered_device.
-
#sas_expanders ⇒ Object
An array of relationships to storageSasExpander resources.
-
#server_id ⇒ Object
RackUnit ID that uniquely identifies the server.
-
#storage_controllers ⇒ Object
An array of relationships to storageController resources.
-
#storage_enclosures ⇒ Object
An array of relationships to storageEnclosure resources.
-
#top_system ⇒ Object
Returns the value of attribute top_system.
-
#topology_scan_status ⇒ Object
To maintain the Topology workflow run status.
-
#unit_personality ⇒ Object
An array of relationships to rackUnitPersonality resources.
Attributes inherited from ComputePhysical
#admin_power_state, #alarm_summary, #asset_tag, #available_memory, #bios_post_complete, #boot_cdd_devices, #boot_device_boot_security, #boot_hdd_devices, #boot_iscsi_devices, #boot_nvme_devices, #boot_pch_storage_devices, #boot_pxe_devices, #boot_san_devices, #boot_sd_devices, #boot_uefi_shell_devices, #boot_usb_devices, #boot_vmedia_devices, #fault_summary, #hardware_uuid, #kvm_ip_addresses, #management_mode, #memory_speed, #mgmt_identity, #mgmt_ip_address, #num_adaptors, #num_cpu_cores, #num_cpu_cores_enabled, #num_cpus, #num_eth_host_interfaces, #num_fc_host_interfaces, #num_threads, #oper_power_state, #oper_reason, #oper_state, #operability, #platform_type, #service_profile, #total_memory, #user_label, #uuid, #vmedia
Attributes inherited from EquipmentBase
#model, #presence, #previous_fru, #revision, #serial, #vendor
Attributes inherited from InventoryBase
Attributes inherited from MoBaseMo
#account_moid, #ancestors, #create_time, #display_names, #domain_group_moid, #mod_time, #moid, #owners, #parent, #permission_resources, #shared_scope, #tags, #version_context
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns the key-value map of all the JSON attributes this model knows about, including the ones defined in its parent(s).
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about, including the ones defined in its parent(s).
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3).
-
.openapi_discriminator_name ⇒ Object
discriminator’s property name in OpenAPI v3.
-
.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 = {}) ⇒ ComputeRackUnit
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 = {}) ⇒ ComputeRackUnit
Initializes the object
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 318 319 320 321 322 323 324 325 326 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 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 231 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `IntersightClient::ComputeRackUnit` 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.acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `#{self.class.name}`. Please check the name to make sure it's valid. List of attributes: " + self.class.acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } # call parent's initialize super(attributes) if attributes.key?(:'class_id') self.class_id = attributes[:'class_id'] else self.class_id = 'compute.RackUnit' end if attributes.key?(:'object_type') self.object_type = attributes[:'object_type'] else self.object_type = 'compute.RackUnit' end if attributes.key?(:'connection_status') self.connection_status = attributes[:'connection_status'] end if attributes.key?(:'server_id') self.server_id = attributes[:'server_id'] end if attributes.key?(:'topology_scan_status') self.topology_scan_status = attributes[:'topology_scan_status'] end if attributes.key?(:'adapters') if (value = attributes[:'adapters']).is_a?(Array) self.adapters = value end end if attributes.key?(:'bios_bootmode') self.bios_bootmode = attributes[:'bios_bootmode'] end if attributes.key?(:'bios_token_settings') self.bios_token_settings = attributes[:'bios_token_settings'] end if attributes.key?(:'bios_vf_select_memory_ras_configuration') self.bios_vf_select_memory_ras_configuration = attributes[:'bios_vf_select_memory_ras_configuration'] end if attributes.key?(:'biosunits') if (value = attributes[:'biosunits']).is_a?(Array) self.biosunits = value end end if attributes.key?(:'bmc') self.bmc = attributes[:'bmc'] end if attributes.key?(:'board') self.board = attributes[:'board'] end if attributes.key?(:'boot_device_bootmode') self.boot_device_bootmode = attributes[:'boot_device_bootmode'] end if attributes.key?(:'fanmodules') if (value = attributes[:'fanmodules']).is_a?(Array) self.fanmodules = value end end if attributes.key?(:'generic_inventory_holders') if (value = attributes[:'generic_inventory_holders']).is_a?(Array) self.generic_inventory_holders = value end end if attributes.key?(:'graphics_cards') if (value = attributes[:'graphics_cards']).is_a?(Array) self.graphics_cards = value end end if attributes.key?(:'inventory_device_info') self.inventory_device_info = attributes[:'inventory_device_info'] end if attributes.key?(:'locator_led') self.locator_led = attributes[:'locator_led'] end if attributes.key?(:'memory_arrays') if (value = attributes[:'memory_arrays']).is_a?(Array) self.memory_arrays = value end end if attributes.key?(:'pci_devices') if (value = attributes[:'pci_devices']).is_a?(Array) self.pci_devices = value end end if attributes.key?(:'processors') if (value = attributes[:'processors']).is_a?(Array) self.processors = value end end if attributes.key?(:'psus') if (value = attributes[:'psus']).is_a?(Array) self.psus = value end end if attributes.key?(:'rack_enclosure_slot') self.rack_enclosure_slot = attributes[:'rack_enclosure_slot'] end if attributes.key?(:'registered_device') self.registered_device = attributes[:'registered_device'] end if attributes.key?(:'sas_expanders') if (value = attributes[:'sas_expanders']).is_a?(Array) self. = value end end if attributes.key?(:'storage_controllers') if (value = attributes[:'storage_controllers']).is_a?(Array) self.storage_controllers = value end end if attributes.key?(:'storage_enclosures') if (value = attributes[:'storage_enclosures']).is_a?(Array) self.storage_enclosures = value end end if attributes.key?(:'top_system') self.top_system = attributes[:'top_system'] end if attributes.key?(:'unit_personality') if (value = attributes[:'unit_personality']).is_a?(Array) self.unit_personality = value end end end |
Instance Attribute Details
#adapters ⇒ Object
An array of relationships to adapterUnit resources.
35 36 37 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 35 def adapters @adapters end |
#bios_bootmode ⇒ Object
Returns the value of attribute bios_bootmode.
37 38 39 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 37 def bios_bootmode @bios_bootmode end |
#bios_token_settings ⇒ Object
Returns the value of attribute bios_token_settings.
39 40 41 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 39 def bios_token_settings @bios_token_settings end |
#bios_vf_select_memory_ras_configuration ⇒ Object
Returns the value of attribute bios_vf_select_memory_ras_configuration.
41 42 43 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 41 def bios_vf_select_memory_ras_configuration @bios_vf_select_memory_ras_configuration end |
#biosunits ⇒ Object
An array of relationships to biosUnit resources.
44 45 46 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 44 def biosunits @biosunits end |
#bmc ⇒ Object
Returns the value of attribute bmc.
46 47 48 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 46 def bmc @bmc end |
#board ⇒ Object
Returns the value of attribute board.
48 49 50 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 48 def board @board end |
#boot_device_bootmode ⇒ Object
Returns the value of attribute boot_device_bootmode.
50 51 52 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 50 def boot_device_bootmode @boot_device_bootmode end |
#class_id ⇒ Object
The fully-qualified name of the instantiated, concrete type. This property is used as a discriminator to identify the type of the payload when marshaling and unmarshaling data.
20 21 22 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 20 def class_id @class_id end |
#connection_status ⇒ Object
Connectivity Status of RackUnit to Switch - A or B or AB.
26 27 28 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 26 def connection_status @connection_status end |
#fanmodules ⇒ Object
An array of relationships to equipmentFanModule resources.
53 54 55 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 53 def fanmodules @fanmodules end |
#generic_inventory_holders ⇒ Object
An array of relationships to inventoryGenericInventoryHolder resources.
56 57 58 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 56 def generic_inventory_holders @generic_inventory_holders end |
#graphics_cards ⇒ Object
An array of relationships to graphicsCard resources.
59 60 61 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 59 def graphics_cards @graphics_cards end |
#inventory_device_info ⇒ Object
Returns the value of attribute inventory_device_info.
61 62 63 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 61 def inventory_device_info @inventory_device_info end |
#locator_led ⇒ Object
Returns the value of attribute locator_led.
63 64 65 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 63 def locator_led @locator_led end |
#memory_arrays ⇒ Object
An array of relationships to memoryArray resources.
66 67 68 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 66 def memory_arrays @memory_arrays end |
#object_type ⇒ Object
The fully-qualified name of the instantiated, concrete type. The value should be the same as the ‘ClassId’ property.
23 24 25 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 23 def object_type @object_type end |
#pci_devices ⇒ Object
An array of relationships to pciDevice resources.
69 70 71 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 69 def pci_devices @pci_devices end |
#processors ⇒ Object
An array of relationships to processorUnit resources.
72 73 74 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 72 def processors @processors end |
#psus ⇒ Object
An array of relationships to equipmentPsu resources.
75 76 77 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 75 def psus @psus end |
#rack_enclosure_slot ⇒ Object
Returns the value of attribute rack_enclosure_slot.
77 78 79 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 77 def rack_enclosure_slot @rack_enclosure_slot end |
#registered_device ⇒ Object
Returns the value of attribute registered_device.
79 80 81 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 79 def registered_device @registered_device end |
#sas_expanders ⇒ Object
An array of relationships to storageSasExpander resources.
82 83 84 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 82 def @sas_expanders end |
#server_id ⇒ Object
RackUnit ID that uniquely identifies the server.
29 30 31 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 29 def server_id @server_id end |
#storage_controllers ⇒ Object
An array of relationships to storageController resources.
85 86 87 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 85 def storage_controllers @storage_controllers end |
#storage_enclosures ⇒ Object
An array of relationships to storageEnclosure resources.
88 89 90 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 88 def storage_enclosures @storage_enclosures end |
#top_system ⇒ Object
Returns the value of attribute top_system.
90 91 92 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 90 def top_system @top_system end |
#topology_scan_status ⇒ Object
To maintain the Topology workflow run status.
32 33 34 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 32 def topology_scan_status @topology_scan_status end |
#unit_personality ⇒ Object
An array of relationships to rackUnitPersonality resources.
93 94 95 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 93 def unit_personality @unit_personality end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns the key-value map of all the JSON attributes this model knows about, including the ones defined in its parent(s)
158 159 160 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 158 def self.acceptable_attribute_map attribute_map.merge(superclass.acceptable_attribute_map) end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
153 154 155 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 153 def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 118 def self.attribute_map { :'class_id' => :'ClassId', :'object_type' => :'ObjectType', :'connection_status' => :'ConnectionStatus', :'server_id' => :'ServerId', :'topology_scan_status' => :'TopologyScanStatus', :'adapters' => :'Adapters', :'bios_bootmode' => :'BiosBootmode', :'bios_token_settings' => :'BiosTokenSettings', :'bios_vf_select_memory_ras_configuration' => :'BiosVfSelectMemoryRasConfiguration', :'biosunits' => :'Biosunits', :'bmc' => :'Bmc', :'board' => :'Board', :'boot_device_bootmode' => :'BootDeviceBootmode', :'fanmodules' => :'Fanmodules', :'generic_inventory_holders' => :'GenericInventoryHolders', :'graphics_cards' => :'GraphicsCards', :'inventory_device_info' => :'InventoryDeviceInfo', :'locator_led' => :'LocatorLed', :'memory_arrays' => :'MemoryArrays', :'pci_devices' => :'PciDevices', :'processors' => :'Processors', :'psus' => :'Psus', :'rack_enclosure_slot' => :'RackEnclosureSlot', :'registered_device' => :'RegisteredDevice', :'sas_expanders' => :'SasExpanders', :'storage_controllers' => :'StorageControllers', :'storage_enclosures' => :'StorageEnclosures', :'top_system' => :'TopSystem', :'unit_personality' => :'UnitPersonality' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
492 493 494 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 492 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3)
217 218 219 220 221 222 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 217 def self.openapi_all_of [ :'ComputePhysical', :'ComputeRackUnitAllOf' ] end |
.openapi_discriminator_name ⇒ Object
discriminator’s property name in OpenAPI v3
225 226 227 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 225 def self.openapi_discriminator_name :'ClassId' end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 198 def self.openapi_nullable Set.new([ :'adapters', :'biosunits', :'fanmodules', :'generic_inventory_holders', :'graphics_cards', :'memory_arrays', :'pci_devices', :'processors', :'psus', :'sas_expanders', :'storage_controllers', :'storage_enclosures', :'unit_personality' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 163 def self.openapi_types { :'class_id' => :'String', :'object_type' => :'String', :'connection_status' => :'String', :'server_id' => :'Integer', :'topology_scan_status' => :'String', :'adapters' => :'Array<AdapterUnitRelationship>', :'bios_bootmode' => :'BiosBootModeRelationship', :'bios_token_settings' => :'BiosTokenSettingsRelationship', :'bios_vf_select_memory_ras_configuration' => :'BiosVfSelectMemoryRasConfigurationRelationship', :'biosunits' => :'Array<BiosUnitRelationship>', :'bmc' => :'ManagementControllerRelationship', :'board' => :'ComputeBoardRelationship', :'boot_device_bootmode' => :'BootDeviceBootModeRelationship', :'fanmodules' => :'Array<EquipmentFanModuleRelationship>', :'generic_inventory_holders' => :'Array<InventoryGenericInventoryHolderRelationship>', :'graphics_cards' => :'Array<GraphicsCardRelationship>', :'inventory_device_info' => :'InventoryDeviceInfoRelationship', :'locator_led' => :'EquipmentLocatorLedRelationship', :'memory_arrays' => :'Array<MemoryArrayRelationship>', :'pci_devices' => :'Array<PciDeviceRelationship>', :'processors' => :'Array<ProcessorUnitRelationship>', :'psus' => :'Array<EquipmentPsuRelationship>', :'rack_enclosure_slot' => :'EquipmentRackEnclosureSlotRelationship', :'registered_device' => :'AssetDeviceRegistrationRelationship', :'sas_expanders' => :'Array<StorageSasExpanderRelationship>', :'storage_controllers' => :'Array<StorageControllerRelationship>', :'storage_enclosures' => :'Array<StorageEnclosureRelationship>', :'top_system' => :'TopSystemRelationship', :'unit_personality' => :'Array<RackUnitPersonalityRelationship>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 443 def ==(o) return true if self.equal?(o) self.class == o.class && class_id == o.class_id && object_type == o.object_type && connection_status == o.connection_status && server_id == o.server_id && topology_scan_status == o.topology_scan_status && adapters == o.adapters && bios_bootmode == o.bios_bootmode && bios_token_settings == o.bios_token_settings && bios_vf_select_memory_ras_configuration == o.bios_vf_select_memory_ras_configuration && biosunits == o.biosunits && bmc == o.bmc && board == o.board && boot_device_bootmode == o.boot_device_bootmode && fanmodules == o.fanmodules && generic_inventory_holders == o.generic_inventory_holders && graphics_cards == o.graphics_cards && inventory_device_info == o.inventory_device_info && locator_led == o.locator_led && memory_arrays == o.memory_arrays && pci_devices == o.pci_devices && processors == o.processors && psus == o.psus && rack_enclosure_slot == o.rack_enclosure_slot && registered_device == o.registered_device && == o. && storage_controllers == o.storage_controllers && storage_enclosures == o.storage_enclosures && top_system == o.top_system && unit_personality == o.unit_personality && super(o) end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 523 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 = IntersightClient.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
594 595 596 597 598 599 600 601 602 603 604 605 606 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 594 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
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 499 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) super(attributes) ComputeRackUnit.openapi_types.each_pair do |key, type| if attributes[ComputeRackUnit.attribute_map[key]].nil? && ComputeRackUnit.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[ComputeRackUnit.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[ComputeRackUnit.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[ComputeRackUnit.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[ComputeRackUnit.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
479 480 481 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 479 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
485 486 487 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 485 def hash [class_id, object_type, connection_status, server_id, topology_scan_status, adapters, bios_bootmode, bios_token_settings, bios_vf_select_memory_ras_configuration, biosunits, bmc, board, boot_device_bootmode, fanmodules, generic_inventory_holders, graphics_cards, inventory_device_info, locator_led, memory_arrays, pci_devices, processors, psus, rack_enclosure_slot, registered_device, , storage_controllers, storage_enclosures, top_system, unit_personality].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
396 397 398 399 400 401 402 403 404 405 406 407 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 396 def list_invalid_properties invalid_properties = super if @class_id.nil? invalid_properties.push('invalid value for "class_id", class_id cannot be nil.') end if @object_type.nil? invalid_properties.push('invalid value for "object_type", object_type cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
570 571 572 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 570 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
576 577 578 579 580 581 582 583 584 585 586 587 588 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 576 def to_hash hash = super ComputeRackUnit.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = ComputeRackUnit.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
564 565 566 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 564 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
411 412 413 414 415 416 417 418 419 |
# File 'lib/intersight_client/models/compute_rack_unit.rb', line 411 def valid? return false if @class_id.nil? class_id_validator = EnumAttributeValidator.new('String', ["compute.RackUnit"]) return false unless class_id_validator.valid?(@class_id) return false if @object_type.nil? object_type_validator = EnumAttributeValidator.new('String', ["compute.RackUnit"]) return false unless object_type_validator.valid?(@object_type) true && super end |